source: trunk/LMDZ.GENERIC/libf/phystd/phyredem.F90 @ 1704

Last change on this file since 1704 was 1621, checked in by emillour, 8 years ago

Further work on full dynamics/physics separation.

LMDZ.COMMON:

  • added phy_common/vertical_layers_mod.F90 to store information on vertical grid. This is where routines in the physics should get the information.
  • The contents of vertical_layers_mod intialized via dynphy_lonlat/inigeomphy_mod.F90.

LMDZ.MARS:

  • physics now completely decoupled from dynamics; the physics package may now be compiled as a library (-libphy option of makelmdz_fcm).
  • created an "ini_tracer_mod" routine in module "tracer_mod" for a cleaner initialization of the later.
  • removed some purely dynamics-related outputs (etot0, zoom parameters, etc.) from diagfi.nc and stats.nc outputs as these informations are not available in the physics.

LMDZ.GENERIC:

  • physics now completely decoupled from dynamics; the physics package may now be compiled as a library (-libphy option of makelmdz_fcm).
  • added nqtot to tracer_h.F90.
  • removed some purely dynamics-related outputs (etot0, zoom parameters, etc.) from diagfi.nc and stats.nc outputs as these informations are not available in the physics.

LMDZ.VENUS:

  • physics now completely decoupled from dynamics; the physics package may now be compiled as a library (-libphy option of makelmdz_fcm).
  • added infotrac_phy.F90 to store information on tracers in the physics. Initialized via iniphysiq.
  • added cpdet_phy_mod.F90 to store t2tpot etc. functions to be used in the physics. Initialized via iniphysiq. IMPORTANT: there are some hard-coded constants! These should match what is in cpdet_mod.F90 in the dynamics.
  • got rid of references to moyzon_mod module within the physics. The required variables (tmoy, plevmoy) are passed to the physics as arguments to physiq.

LMDZ.TITAN:

  • added infotrac_phy.F90 to store information on tracers in the physics. Initialized via iniphysiq.
  • added cpdet_phy_mod.F90 to store t2tpot etc. functions to be used in the physics.
  • Extra work required to completely decouple physics and dynamics: moyzon_mod should be cleaned up and information passed from dynamics to physics as as arguments. Likewise moyzon_ch and moyzon_mu should not be queried from logic_mod (which is in the dynamics).

EM

File size: 7.4 KB
Line 
1module phyredem
2
3implicit none
4
5contains
6
7subroutine physdem0(filename,lonfi,latfi,nsoil,ngrid,nlay,nq, &
8                         phystep,day_ini,time,airefi, &
9                         alb,ith,pzmea,pzstd,pzsig,pzgam,pzthe)
10! create physics restart file and write time-independent variables
11  use comsoil_h, only: volcapa, mlayer
12  use geometry_mod, only: cell_area
13  use surfdat_h, only: zmea, zstd, zsig, zgam, zthe, &
14                       emisice, emissiv,             &
15                       iceradius, dtemisice, phisfi
16  use iostart, only : open_restartphy, close_restartphy, &
17                      put_var, put_field, length
18  use mod_grid_phy_lmdz, only : klon_glo
19  use planete_mod, only: year_day, periastr, apoastr, peri_day, &
20                         obliquit, z0, lmixmin, emin_turb
21  use comcstfi_mod, only: rad, omeg, g, mugaz, rcp
22  use time_phylmdz_mod, only: daysec
23
24  implicit none
25
26  character(len=*), intent(in) :: filename
27  real,intent(in) :: lonfi(ngrid)
28  real,intent(in) :: latfi(ngrid)
29  integer,intent(in) :: nsoil
30  integer,intent(in) :: ngrid
31  integer,intent(in) :: nlay
32  integer,intent(in) :: nq
33  real,intent(in) :: phystep
34  real,intent(in) :: day_ini
35  real,intent(in) :: time
36  real,intent(in) :: airefi(ngrid)
37  real,intent(in) :: alb(ngrid)
38  real,intent(in) :: ith(ngrid,nsoil)
39  real,intent(in) :: pzmea(ngrid)
40  real,intent(in) :: pzstd(ngrid)
41  real,intent(in) :: pzsig(ngrid)
42  real,intent(in) :: pzgam(ngrid)
43  real,intent(in) :: pzthe(ngrid)
44 
45  real :: tab_cntrl(length) ! nb "length=100" defined in iostart module
46 
47  ! Create physics start file
48  call open_restartphy(filename)
49
50! tab_cntrl() contains run parameters
51  tab_cntrl(:)=0 ! initialization
52!cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
53! Fill control array tab_cntrl(:) with paramleters for this run
54!cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
55! Informations on the physics grid
56  tab_cntrl(1) = float(klon_glo)  ! number of nodes on physics grid
57  tab_cntrl(2) = float(nlay) ! number of atmospheric layers
58  tab_cntrl(3) = day_ini + int(time)         ! final day
59  tab_cntrl(4) = time -int(time)            ! final time of day
60
61! Informations about Mars, used by dynamics and physics
62  tab_cntrl(5) = rad      ! radius of Mars (m) ~3397200
63  tab_cntrl(6) = omeg     ! rotation rate (rad.s-1)
64  tab_cntrl(7) = g        ! gravity (m.s-2) ~3.72
65  tab_cntrl(8) = mugaz    ! Molar mass of the atmosphere (g.mol-1) ~43.49
66  tab_cntrl(9) = rcp      !  = r/cp  ~0.256793 (=kappa dans dynamique)
67  tab_cntrl(10) = daysec  ! length of a sol (s)  ~88775
68
69  tab_cntrl(11) = phystep  ! time step in the physics
70  tab_cntrl(12) = 0.
71  tab_cntrl(13) = 0.
72
73! Informations about Mars, only for physics
74  tab_cntrl(14) = year_day  ! length of year (sols) ~668.6
75  tab_cntrl(15) = periastr  ! min. star-planet distance (AU)
76  tab_cntrl(16) = apoastr   ! max. star-planet distance (AU)
77  tab_cntrl(17) = peri_day  ! date of periastron (sols since N. spring)
78  tab_cntrl(18) = obliquit  ! Obliquity of the planet (deg) ~23.98
79
80! Boundary layer and turbulence
81  tab_cntrl(19) = z0        ! surface roughness (m) ~0.01
82  tab_cntrl(20) = lmixmin   ! mixing length ~100
83  tab_cntrl(21) = emin_turb ! minimal energy ~1.e-8
84
85! Optical properties of polar caps and ground emissivity
86  tab_cntrl(24) = emisice(1)   ! Emissivity of northern cap ~0.95
87  tab_cntrl(25) = emisice(2)   ! Emissivity of southern cap ~0.95
88  tab_cntrl(26) = emissiv      ! Emissivity of martian soil ~.95
89  tab_cntrl(31) = iceradius(1) ! mean scat radius of CO2 snow (north)
90  tab_cntrl(32) = iceradius(2) ! mean scat radius of CO2 snow (south)
91  tab_cntrl(33) = dtemisice(1) ! time scale for snow metamorphism (north)
92  tab_cntrl(34) = dtemisice(2) ! time scale for snow metamorphism (south)
93
94  tab_cntrl(28) = 0.
95  tab_cntrl(29) = 0.
96  tab_cntrl(30) = 0.
97
98! Soil properties:
99  tab_cntrl(35) = volcapa ! soil volumetric heat capacity
100
101  call put_var("controle","Control parameters",tab_cntrl)
102 
103  ! Write the mid-layer depths
104  call put_var("soildepth","Soil mid-layer depth",mlayer)
105 
106  ! Write longitudes
107  call put_field("longitude","Longitudes of physics grid",lonfi)
108 
109  ! Write latitudes
110  call put_field("latitude","Latitudes of physics grid",latfi)
111 
112  ! Write mesh areas
113  call put_field("area","Mesh area",cell_area)
114 
115  ! Write surface geopotential
116  call put_field("phisfi","Geopotential at the surface",phisfi)
117 
118  ! Write surface albedo
119  call put_field("albedodat","Albedo of bare ground",alb)
120 
121  ! Subgrid topogaphy variables
122  call put_field("ZMEA","Relief: mean relief",zmea)
123  call put_field("ZSTD","Relief: standard deviation",zstd)
124  call put_field("ZSIG","Relief: sigma parameter",zsig)
125  call put_field("ZGAM","Relief: gamma parameter",zgam)
126  call put_field("ZTHE","Relief: theta parameter",zthe)
127 
128  ! Soil thermal inertia
129  call put_field("inertiedat","Soil thermal inertia",ith)
130 
131  ! Close file
132  call close_restartphy
133 
134end subroutine physdem0
135
136subroutine physdem1(filename,nsoil,ngrid,nlay,nq, &
137                    phystep,time,tsurf,tsoil,emis,q2,qsurf, &
138                    cloudfrac,totcloudfrac,hice, &
139                    rnat,pctsrf_sic,tslab,tsea_ice,sea_ice)
140  ! write time-dependent variable to restart file
141  use iostart, only : open_restartphy, close_restartphy, &
142                      put_var, put_field
143  use tracer_h, only: noms
144  use slab_ice_h, only: noceanmx
145  use callkeys_mod, only: ok_slab_ocean
146
147  implicit none
148
149  character(len=*),intent(in) :: filename
150  integer,intent(in) :: nsoil
151  integer,intent(in) :: ngrid
152  integer,intent(in) :: nlay
153  integer,intent(in) :: nq
154  real,intent(in) :: phystep
155  real,intent(in) :: time
156  real,intent(in) :: tsurf(ngrid)
157  real,intent(in) :: tsoil(ngrid,nsoil)
158  real,intent(in) :: emis(ngrid)
159  real,intent(in) :: q2(ngrid,nlay+1)
160  real,intent(in) :: qsurf(ngrid,nq)
161  real,intent(in) :: cloudfrac(ngrid,nlay)
162  real,intent(in) :: totcloudfrac(ngrid)
163  real,intent(in) :: hice(ngrid)
164  real,intent(in) :: rnat(ngrid)
165  real,intent(in) :: pctsrf_sic(ngrid)
166  real,intent(in) :: tslab(ngrid,noceanmx)
167  real,intent(in) :: tsea_ice(ngrid)
168  real,intent(in) :: sea_ice(ngrid)
169
170  integer :: iq
171 
172  ! Open file
173  call open_restartphy(filename)
174
175  ! First variable to write must be "Time", in order to correctly
176  ! set time counter in file
177  !call put_var("Time","Temps de simulation",time)
178 
179  ! Surface temperature
180  call put_field("tsurf","Surface temperature",tsurf)
181 
182  ! Soil temperature
183  call put_field("tsoil","Soil temperature",tsoil)
184 
185  ! Emissivity of the surface
186  call put_field("emis","Surface emissivity",emis)
187 
188  ! Planetary Boundary Layer
189  call put_field("q2","pbl wind variance",q2)
190 
191! cloud fraction and sea ice (NB: these should be optional... to be improved)
192  call put_field("cloudfrac","Cloud fraction",cloudfrac)
193  call put_field("totcloudfrac","Total fraction",totcloudfrac)
194  call put_field("hice","Height of oceanic ice",hice)
195
196 !Slab ocean
197 if(ok_slab_ocean) then
198   call put_field("rnat","Nature of surface",rnat)
199   call put_field("pctsrf_sic","Pourcentage sea ice",pctsrf_sic)
200   call put_field("tslab","Temperature slab ocean",tslab)
201   call put_field("tsea_ice","Temperature sea ice",tsea_ice)
202   call put_field("sea_ice","Sea ice mass",sea_ice)
203 endif!(ok_slab_ocean)
204
205
206! tracers
207  if (nq>0) then
208    do iq=1,nq
209      call put_field(noms(iq),"tracer on surface",qsurf(:,iq))
210    enddo
211  endif ! of if (nq>0)
212
213! close file
214      CALL close_restartphy
215!$OMP BARRIER
216
217end subroutine physdem1
218
219end module phyredem
Note: See TracBrowser for help on using the repository browser.