Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Meso-NH-NOT-OFFICIAL-TESTONLY
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RODIER Quentin
Meso-NH-NOT-OFFICIAL-TESTONLY
Commits
111dd0a9
Commit
111dd0a9
authored
3 years ago
by
ESCOBAR MUNOZ Juan
Browse files
Options
Downloads
Patches
Plain Diff
Juan 21/09/2021:p_abs.f90, add acc kernels + BIT_REPRO call
parent
1f51c51d
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/ZSOLVER/p_abs.f90
+40
-13
40 additions, 13 deletions
src/ZSOLVER/p_abs.f90
with
40 additions
and
13 deletions
src/ZSOLVER/p_abs.f90
+
40
−
13
View file @
111dd0a9
...
...
@@ -122,6 +122,10 @@ USE MODE_ll
!JUAN
USE
MODE_REPRO_SUM
!JUAN
!
#ifdef MNH_BITREP
USE
MODI_BITREP
#endif
!
IMPLICIT
NONE
!
...
...
@@ -185,6 +189,7 @@ REAL :: ZPHI0
!
INTEGER
::
IINFO_ll
!
LOGICAL
::
GPRVREF0
!-------------------------------------------------------------------------------
!
!* 1. COMPUTE DIMENSIONS OF ARRAYS AND OTHER INDICES:
...
...
@@ -196,6 +201,8 @@ IKE = IKU - JPVEXT
!
CALL
GET_INDICE_ll
(
IIB
,
IJB
,
IIE
,
IJE
)
!
GPRVREF0
=
(
SIZE
(
PRVREF
,
1
)
==
0
)
!
ALLOCATE
(
ZMASS_O_PI_2D
(
IIB
:
IIE
,
IJB
:
IJE
))
ALLOCATE
(
ZMASSGUESS_2D
(
IIB
:
IIE
,
IJB
:
IJE
))
ALLOCATE
(
ZWATERMASST_2D
(
IIB
:
IIE
,
IJB
:
IJE
))
...
...
@@ -212,7 +219,8 @@ ZCVD_O_RD = (XCPD - XRD) / XRD
!
!
IF
(
CEQNSYS
==
'DUR'
.OR.
CEQNSYS
==
'MAE'
)
THEN
!
!
!$acc kernels
IF
(
KRR
>
0
)
THEN
!
! compute the mixing ratio of the total water (ZRTOT)
...
...
@@ -227,21 +235,29 @@ IF ( CEQNSYS=='DUR' .OR. CEQNSYS=='MAE' ) THEN
ZMASSGUESS_2D
=
0.
ZMASS_O_PI_2D
=
0.
ZWATERMASST_2D
=
0.
!$acc end kernels
!
IF
(
CEQNSYS
==
'DUR'
)
THEN
!$acc kernels
! compute the Jacobian in ZWORK
IF
(
SIZE
(
PRVREF
,
1
)
==
0
)
THEN
IF
(
G
PRVREF0
)
THEN
ZWORK
(:,:,:)
=
PRHODJ
*
XTH00
/
(
PRHODREF
*
PTHVREF
)
ELSE
ZWORK
(:,:,:)
=
PRHODJ
*
XTH00
&
/
(
PRHODREF
*
PTHVREF
*
(
1.
+
PRVREF
)
)
END
IF
!
!$acc loop seq
DO
JK
=
IKB
,
IKE
!$acc loop independent collapse(2)
DO
JJ
=
IJB
,
IJE
DO
JI
=
IIB
,
IIE
ZMASSGUESS_2D
(
JI
,
JJ
)
=
ZMASSGUESS_2D
(
JI
,
JJ
)
+
&
(
PEXNREF
(
JI
,
JJ
,
JK
)
+
PPHIT
(
JI
,
JJ
,
JK
))
**
ZCVD_O_RD
&
ZMASSGUESS_2D
(
JI
,
JJ
)
=
ZMASSGUESS_2D
(
JI
,
JJ
)
+
&
#ifndef MNH_OPENACC
(
PEXNREF
(
JI
,
JJ
,
JK
)
+
PPHIT
(
JI
,
JJ
,
JK
))
**
ZCVD_O_RD
&
#else
BR_POW
((
PEXNREF
(
JI
,
JJ
,
JK
)
+
PPHIT
(
JI
,
JJ
,
JK
)),
ZCVD_O_RD
)
&
#endif
*
ZWORK
(
JI
,
JJ
,
JK
)
/
PTHETAV
(
JI
,
JJ
,
JK
)
ZMASS_O_PI_2D
(
JI
,
JJ
)
=
ZMASS_O_PI_2D
(
JI
,
JJ
)
+
ZWORK
(
JI
,
JJ
,
JK
)
/
PTHETAV
(
JI
,
JJ
,
JK
)
ZWATERMASST_2D
(
JI
,
JJ
)
=
ZWATERMASST_2D
(
JI
,
JJ
)
+
&
...
...
@@ -249,7 +265,8 @@ IF ( CEQNSYS=='DUR' .OR. CEQNSYS=='MAE' ) THEN
END
DO
END
DO
END
DO
!
!$acc end kernels
!
ELSE
DO
JK
=
IKB
,
IKE
DO
JJ
=
IJB
,
IJE
...
...
@@ -273,23 +290,31 @@ IF ( CEQNSYS=='DUR' .OR. CEQNSYS=='MAE' ) THEN
!
ZMASS_O_PI
=
ZMASS_O_PI
*
ZP00_O_RD
*
ZCVD_O_RD
ZPI0
=
(
PDRYMASST
+
ZWATERMASST
-
ZP00_O_RD
*
ZMASSGUESS
)
/
ZMASS_O_PI
!$acc kernels
PPHIT
(:,:,:)
=
PPHIT
(:,:,:)
+
ZPI0
!$acc end kernels
!
!
!
! Second iteration
!
!$acc kernels
ZMASSGUESS_2D
=
0.
!$acc end kernels
IF
(
CEQNSYS
==
'DUR'
)
THEN
DO
JK
=
IKB
,
IKE
DO
JJ
=
IJB
,
IJE
DO
JI
=
IIB
,
IIE
ZMASSGUESS_2D
(
JI
,
JJ
)
=
ZMASSGUESS_2D
(
JI
,
JJ
)
+
&
(
PEXNREF
(
JI
,
JJ
,
JK
)
+
PPHIT
(
JI
,
JJ
,
JK
))
**
ZCVD_O_RD
&
*
ZWORK
(
JI
,
JJ
,
JK
)
/
PTHETAV
(
JI
,
JJ
,
JK
)
!$acc kernels
!$acc loop seq
DO
JK
=
IKB
,
IKE
!$acc loop independent collapse(2)
DO
JJ
=
IJB
,
IJE
DO
JI
=
IIB
,
IIE
ZMASSGUESS_2D
(
JI
,
JJ
)
=
ZMASSGUESS_2D
(
JI
,
JJ
)
+
&
(
PEXNREF
(
JI
,
JJ
,
JK
)
+
PPHIT
(
JI
,
JJ
,
JK
))
**
ZCVD_O_RD
&
*
ZWORK
(
JI
,
JJ
,
JK
)
/
PTHETAV
(
JI
,
JJ
,
JK
)
END
DO
END
DO
END
DO
END
DO
END
DO
!$acc end kernels
ELSE
DO
JK
=
IKB
,
IKE
DO
JJ
=
IJB
,
IJE
...
...
@@ -306,7 +331,9 @@ IF ( CEQNSYS=='DUR' .OR. CEQNSYS=='MAE' ) THEN
ZMASSGUESS
=
SUM_DD_R2_ll
(
ZMASSGUESS_2D
)
!
ZPI0
=
(
PDRYMASST
+
ZWATERMASST
-
ZP00_O_RD
*
ZMASSGUESS
)
/
ZMASS_O_PI
!$acc kernels
PPHIT
(:,:,:)
=
PPHIT
(:,:,:)
+
ZPI0
!$acc end kernels
!
!
ELSEIF
(
CEQNSYS
==
'LHE'
)
THEN
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment