source: LMDZ6/trunk/libf/dynphy_lonlat/phylmd/callphysiq_mod.F90 @ 4467

Last change on this file since 4467 was 4146, checked in by Laurent Fairhead, 3 years ago

Source code and xml files needed for XIOS output in the LMDZ LonLat? dynamical core.
One flag controls everything: ok_dyn_xios. Parameters controlling outputs need to be put in the xml
files, nothing is set in the code
Work to follow on the dynzon file and the modipsl/libIGCM framework.
ok_dyn_xios = n should not change anything

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