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

Last change on this file since 3582 was 3582, checked in by jbclement, 3 weeks ago

Mars PCM:

  • Correction of r3581: the key-words to get 'albedo_perennialco2(1:2)" from the "callphys.def" are now 'albedo_perennialco2_north' and 'albedo_perennialco2_south'.
  • Moving 'albedo_perennialco2' from the 'paleoclimate' module to the 'surfdat_h' module.

JBC

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