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

Last change on this file since 2829 was 2826, checked in by romain.vande, 3 years ago

Mars GCM:
The variable co2ice is deleted. All the co2 ice on surface is now in qsurf(:,igcm_co2).
CO2 tracer is now mandatory. diagfi output is unchanged.
RV

File size: 4.8 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)
58 
59  implicit none
60  integer,intent(in) :: ngrid ! number of atmospheric columns
61  integer,intent(in) :: nq ! number of tracers 
62
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))
74    allocate(tsurf(ngrid))
75    allocate(watercap(ngrid))
76    allocate(emis(ngrid))
77    allocate(capcal(ngrid))
78    allocate(fluxgrd(ngrid))
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
118end module surfdat_h
Note: See TracBrowser for help on using the repository browser.