1 | |
---|
2 | ! $Id: $ |
---|
3 | |
---|
4 | MODULE callphysiq_mod |
---|
5 | |
---|
6 | IMPLICIT NONE |
---|
7 | |
---|
8 | CONTAINS |
---|
9 | |
---|
10 | SUBROUTINE call_physiq(klon,llm,nqtot,tname, & |
---|
11 | debut_split,lafin_split, & |
---|
12 | jD_cur,jH_cur_split,zdt_split, & |
---|
13 | zplev_omp,zplay_omp, & |
---|
14 | zpk_omp,zphi_omp,zphis_omp, & |
---|
15 | presnivs_omp, & |
---|
16 | zufi_omp,zvfi_omp,zrfi_omp,ztfi_omp,zqfi_omp, & |
---|
17 | flxwfi_omp,pducov, & |
---|
18 | zdufi_omp,zdvfi_omp,zdtfi_omp,zdqfi_omp,zdpsrf_omp) |
---|
19 | |
---|
20 | |
---|
21 | USE lmdz_grid_phy, ONLY: nbp_lon, nbp_lat |
---|
22 | USE control_mod, ONLY: planet_type, ok_dyn_xios |
---|
23 | USE physiq_mod, ONLY: physiq |
---|
24 | USE lmdz_xios, ONLY: xios_set_current_context, xios_get_current_context, xios_context |
---|
25 | IMPLICIT NONE |
---|
26 | |
---|
27 | INTEGER,INTENT(IN) :: klon ! (local) number of atmospheric columns |
---|
28 | INTEGER,INTENT(IN) :: llm ! number of atmospheric layers |
---|
29 | INTEGER,INTENT(IN) :: nqtot ! number of tracers |
---|
30 | CHARACTER(len=*),INTENT(IN) :: tname(nqtot) ! tracer names |
---|
31 | LOGICAL,INTENT(IN) :: debut_split ! .TRUE. if very first CALL to physics |
---|
32 | LOGICAL,INTENT(IN) :: lafin_split ! .TRUE. if last CALL to physics |
---|
33 | REAL,INTENT(IN) :: JD_cur ! Julian day |
---|
34 | REAL,INTENT(IN) :: JH_cur_split ! Julian hour (fraction of day) |
---|
35 | REAL,INTENT(IN) :: zdt_split ! time step over which the physics are evaluated |
---|
36 | REAL,INTENT(IN) :: zplev_omp(klon,llm+1) ! interlayer pressure (Pa) |
---|
37 | REAL,INTENT(IN) :: zplay_omp(klon,llm) ! mid-layer pressure (Pa) |
---|
38 | REAL,INTENT(IN) :: zpk_omp(klon,llm) ! Exner function |
---|
39 | REAL,INTENT(IN) :: zphi_omp(klon,llm) ! geopotential at midlayer |
---|
40 | REAL,INTENT(IN) :: zphis_omp(klon) ! surface geopotential |
---|
41 | REAL,INTENT(IN) :: presnivs_omp(llm) ! approximate pressure of atm. layers |
---|
42 | REAL,INTENT(IN) :: zufi_omp(klon,llm) ! zonal wind (m/s) |
---|
43 | REAL,INTENT(IN) :: zvfi_omp(klon,llm) ! meridional wind (m/s) |
---|
44 | REAL,INTENT(IN) :: zrfi_omp(klon,llm) ! relative wind vorticity, in s-1 |
---|
45 | REAL,INTENT(IN) :: ztfi_omp(klon,llm) ! temperature (K) |
---|
46 | REAL,INTENT(IN) :: zqfi_omp(klon,llm,nqtot) ! tracers (*/kg of air) |
---|
47 | REAL,INTENT(IN) :: flxwfi_omp(klon,llm) ! Vertical mass flux on lower mesh interfaces (kg/s) |
---|
48 | REAL,INTENT(IN) :: pducov(nbp_lon+1,nbp_lat,llm) ! dynamical tendency on ucov |
---|
49 | ! tendencies (in */s) from the physics: |
---|
50 | REAL,INTENT(OUT) :: zdufi_omp(klon,llm) ! tendency on zonal winds |
---|
51 | REAL,INTENT(OUT) :: zdvfi_omp(klon,llm) ! tendency on meridional winds |
---|
52 | REAL,INTENT(OUT) :: zdtfi_omp(klon,llm) ! tendency on temperature |
---|
53 | REAL,INTENT(OUT) :: zdqfi_omp(klon,llm,nqtot) ! tendency on tracers |
---|
54 | REAL,INTENT(OUT) :: zdpsrf_omp(klon) ! tendency on surface pressure |
---|
55 | TYPE(xios_context) :: dyn3d_ctx_handle |
---|
56 | |
---|
57 | ! Local variables |
---|
58 | CHARACTER(len=11) :: modname="call_physiq" |
---|
59 | LOGICAL,SAVE :: firstcall=.TRUE. |
---|
60 | !$OMP THREADPRIVATE(firstcall) |
---|
61 | |
---|
62 | ! Sanity check on physics package type |
---|
63 | IF (firstcall) THEN |
---|
64 | IF (planet_type/="earth") THEN |
---|
65 | CALL abort_gcm(modname,"wrong planet_type for this physics package",1) |
---|
66 | ENDIF |
---|
67 | firstcall=.FALSE. |
---|
68 | ENDIF |
---|
69 | |
---|
70 | !$OMP MASTER |
---|
71 | if (ok_dyn_xios) then |
---|
72 | CALL xios_get_current_context(dyn3d_ctx_handle) |
---|
73 | endif |
---|
74 | !$OMP END MASTER |
---|
75 | |
---|
76 | ! Call physics package with required inputs/outputs |
---|
77 | CALL physiq(klon, & |
---|
78 | llm, & |
---|
79 | debut_split, & |
---|
80 | lafin_split, & |
---|
81 | zdt_split, & |
---|
82 | zplev_omp, & |
---|
83 | zplay_omp, & |
---|
84 | zphi_omp, & |
---|
85 | zphis_omp, & |
---|
86 | presnivs_omp, & |
---|
87 | zufi_omp, & |
---|
88 | zvfi_omp, & |
---|
89 | zrfi_omp, & |
---|
90 | ztfi_omp, & |
---|
91 | zqfi_omp, & |
---|
92 | flxwfi_omp, & |
---|
93 | zdufi_omp, & |
---|
94 | zdvfi_omp, & |
---|
95 | zdtfi_omp, & |
---|
96 | zdqfi_omp, & |
---|
97 | zdpsrf_omp) |
---|
98 | |
---|
99 | ! switching back to LMDZDYN context |
---|
100 | !$OMP MASTER |
---|
101 | if (ok_dyn_xios) then |
---|
102 | CALL xios_set_current_context(dyn3d_ctx_handle) |
---|
103 | endif |
---|
104 | !$OMP END MASTER |
---|
105 | |
---|
106 | |
---|
107 | END SUBROUTINE call_physiq |
---|
108 | |
---|
109 | END MODULE callphysiq_mod |
---|