source: trunk/LMDZ.PLUTO/libf/phypluto/phyredem.F90 @ 3586

Last change on this file since 3586 was 3539, checked in by tbertrand, 8 weeks ago

LMDZ.PLUTO:
Update and Validation of the Volatile Transport Model (VTM, or "nogcm")
Merging missing elements with Pluto.old
TB

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