source: trunk/LMDZ.MARS/libf/phymars/surfdat_h.F90 @ 2932

Last change on this file since 2932 was 2909, checked in by romain.vande, 22 months ago

Mars PEM:
New Boolean options for following orbital parameters of ob_ex_lsp.asc: var_obl, var_ex, var_lsp.
If using evol_orbit_pem=true, you can specify which parameter to follow.
True by default: Do you want to change the parameter XXX during the PEM run as prescribed in ob_ex_lsp.asc.
If false, it is set to constant (to the value of the tab_cntrl in the start)
RV

File size: 5.9 KB
Line 
1module surfdat_h
2
3  ! arrays are allocated in conf_phys
4  real,save,allocatable :: albedodat(:) ! albedo of bare ground
5  real,save,allocatable :: phisfi(:) ! geopotential at ground level
6  real,save :: albedice(2) ! default albedo for ice (1: North H. 2: South H.)
7  real,save :: emisice(2) ! ice emissivity; 1:Northern hemisphere 2:Southern hemisphere
8  real,save :: emissiv ! emissivity of bare ground
9  logical,save :: TESicealbedo ! use TES ice cap albedoes (if set to .true.)
10  logical,save,allocatable :: watercaptag(:) ! flag for water ice surface
11  real, save, allocatable :: dryness(:)
12
13!$OMP THREADPRIVATE(albedodat, phisfi,albedice,emisice,emissiv,TESicealbedo,     &
14!$OMP                watercaptag,dryness)
15     
16  logical,save :: temptag !temp tag for water caps
17
18!$OMP THREADPRIVATE(temptag)
19     
20  real,save :: albedo_h2o_cap ! water cap albedo
21  real,save :: albedo_h2o_frost ! water frost albedo
22  real,save :: inert_h2o_ice ! water ice thermal inertia
23  real,save :: frost_albedo_threshold ! water frost thickness on the ground (kg.m^-2, ie mm)
24  real,save :: frost_metam_threshold ! water frost threshold before conversion to ice (kg.m^-2, ie mm)
25  real,save :: TESice_Ncoef ! coefficient for TES ice albedo in Northern hemisphere
26  real,save :: TESice_Scoef ! coefficient for TES ice albedo in Southern hemisphere
27  real,save :: iceradius(2) , dtemisice(2)
28  real,save,allocatable :: zmea(:),zstd(:),zsig(:),zgam(:),zthe(:)
29  real,save,allocatable :: hmons(:),summit(:),base(:)
30  real,save,allocatable :: z0(:) ! surface roughness length (m)
31  real,save :: z0_default ! default (constant over planet) surface roughness (m)
32
33!$OMP THREADPRIVATE(albedo_h2o_cap,albedo_h2o_frost,inert_h2o_ice,               &
34!$OMP                frost_albedo_threshold,frost_metam_threshold,TESice_Ncoef,  &
35!$OMP                TESice_Scoef,iceradius,dtemisice,                           &
36!$OMP                zmea,zstd,zsig,zgam,zthe,hmons,summit,base,z0,z0_default )
37
38  !! mountain top dust flows
39  REAL,SAVE,ALLOCATABLE :: alpha_hmons(:) ! sub-grid scale mountain mesh fraction
40  REAL,SAVE,ALLOCATABLE :: hsummit(:) ! mountain height above the GCM surface
41  LOGICAL,SAVE,ALLOCATABLE :: contains_mons(:) ! is there a mountain in the grid mesh ?
42         
43!$OMP THREADPRIVATE(alpha_hmons,hsummit,contains_mons)
44
45  !! variables
46  REAL,SAVE,ALLOCATABLE :: tsurf(:,:)   ! Surface temperature (K)
47  REAL,SAVE,ALLOCATABLE :: emis(:,:)    ! Thermal IR surface emissivity
48  REAL,SAVE,ALLOCATABLE :: capcal(:,:) ! surface heat capacity (J m-2 K-1)
49  REAL,SAVE,ALLOCATABLE :: fluxgrd(:,:) ! surface conduction flux (W.m-2)
50  REAL,ALLOCATABLE,SAVE :: qsurf(:,:,:) ! tracer on surface (e.g. kg.m-2)
51  REAL,SAVE,ALLOCATABLE :: watercap(:,:) ! Surface water ice (kg.m-2)
52
53!$OMP THREADPRIVATE(tsurf,emis,capcal,fluxgrd,qsurf,watercap)
54
55contains
56
57  subroutine ini_surfdat_h(ngrid,nq,nslope)
58 
59  implicit none
60  integer,intent(in) :: ngrid ! number of atmospheric columns
61  integer,intent(in) :: nq ! number of tracers 
62  integer,intent(in) :: nslope ! number of sub-grid scale slope 
63    allocate(albedodat(ngrid))
64    allocate(phisfi(ngrid))
65    allocate(watercaptag(ngrid))
66    allocate(dryness(ngrid))
67    allocate(zmea(ngrid))
68    allocate(zstd(ngrid))
69    allocate(zsig(ngrid))
70    allocate(zgam(ngrid))
71    allocate(zthe(ngrid))
72    allocate(z0(ngrid))
73    allocate(qsurf(ngrid,nq,nslope))
74    allocate(tsurf(ngrid,nslope))
75    allocate(watercap(ngrid,nslope))
76    allocate(emis(ngrid,nslope))
77    allocate(capcal(ngrid,nslope))
78    allocate(fluxgrd(ngrid,nslope))
79    allocate(hmons(ngrid))
80    allocate(summit(ngrid))
81    allocate(base(ngrid))
82    allocate(alpha_hmons(ngrid))
83    allocate(hsummit(ngrid))
84    allocate(contains_mons(ngrid))
85       
86  end subroutine ini_surfdat_h
87
88
89  subroutine end_surfdat_h
90
91  implicit none
92
93    if (allocated(albedodat))     deallocate(albedodat)
94    if (allocated(phisfi))        deallocate(phisfi)
95    if (allocated(watercaptag))   deallocate(watercaptag)
96    if (allocated(dryness))       deallocate(dryness)
97    if (allocated(zmea))          deallocate(zmea)
98    if (allocated(zstd))          deallocate(zstd)
99    if (allocated(zsig))          deallocate(zsig)
100    if (allocated(zgam))          deallocate(zgam)
101    if (allocated(zthe))          deallocate(zthe)
102    if (allocated(z0))            deallocate(z0)
103    if (allocated(qsurf))         deallocate(qsurf)
104    if (allocated(tsurf))         deallocate(tsurf)
105    if (allocated(watercap))      deallocate(watercap)
106    if (allocated(emis))          deallocate(emis)
107    if (allocated(capcal))        deallocate(capcal)
108    if (allocated(fluxgrd))       deallocate(fluxgrd)
109    if (allocated(hmons))         deallocate(hmons)
110    if (allocated(summit))        deallocate(summit)
111    if (allocated(base))          deallocate(base)
112    if (allocated(alpha_hmons))   deallocate(alpha_hmons)
113    if (allocated(hsummit))       deallocate(hsummit)
114    if (allocated(contains_mons)) deallocate(contains_mons)
115   
116  end subroutine end_surfdat_h
117
118  subroutine ini_surfdat_h_slope_var(ngrid,nq,nslope)
119 
120  implicit none
121  integer,intent(in) :: ngrid ! number of atmospheric columns
122  integer,intent(in) :: nq ! number of tracers 
123  integer,intent(in) :: nslope ! number of sub-grid scale slope 
124    allocate(qsurf(ngrid,nq,nslope))
125    allocate(tsurf(ngrid,nslope))
126    allocate(watercap(ngrid,nslope))
127    allocate(emis(ngrid,nslope))
128    allocate(capcal(ngrid,nslope))
129    allocate(fluxgrd(ngrid,nslope))
130       
131  end subroutine ini_surfdat_h_slope_var
132
133  subroutine end_surfdat_h_slope_var
134
135  implicit none
136
137    if (allocated(qsurf))         deallocate(qsurf)
138    if (allocated(tsurf))         deallocate(tsurf)
139    if (allocated(watercap))      deallocate(watercap)
140    if (allocated(emis))          deallocate(emis)
141    if (allocated(capcal))        deallocate(capcal)
142    if (allocated(fluxgrd))       deallocate(fluxgrd)
143   
144  end subroutine end_surfdat_h_slope_var
145
146end module surfdat_h
Note: See TracBrowser for help on using the repository browser.