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

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

First stage of implementing Open_MP in the physic.
So far it can initialyse physic and run with all routines at .FALSE.

File size: 4.3 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  !! variables
39  REAL,SAVE,ALLOCATABLE :: tsurf(:)   ! Surface temperature (K)
40  REAL,SAVE,ALLOCATABLE :: co2ice(:)  ! co2 ice surface layer (kg.m-2) 
41  REAL,SAVE,ALLOCATABLE :: emis(:)    ! Thermal IR surface emissivity
42  REAL,SAVE,ALLOCATABLE :: capcal(:) ! surface heat capacity (J m-2 K-1)
43  REAL,SAVE,ALLOCATABLE :: fluxgrd(:) ! surface conduction flux (W.m-2)
44  REAL,ALLOCATABLE,SAVE :: qsurf(:,:) ! tracer on surface (e.g. kg.m-2)
45  REAL,SAVE,ALLOCATABLE :: watercap(:) ! Surface water ice (kg.m-2)
46
47!$OMP THREADPRIVATE(tsurf,co2ice,emis,capcal,fluxgrd,qsurf,watercap)
48
49contains
50
51  subroutine ini_surfdat_h(ngrid,nq)
52 
53  implicit none
54  integer,intent(in) :: ngrid ! number of atmospheric columns
55  integer,intent(in) :: nq ! number of tracers 
56
57    allocate(albedodat(ngrid))
58    allocate(phisfi(ngrid))
59    allocate(watercaptag(ngrid))
60    allocate(dryness(ngrid))
61    allocate(zmea(ngrid))
62    allocate(zstd(ngrid))
63    allocate(zsig(ngrid))
64    allocate(zgam(ngrid))
65    allocate(zthe(ngrid))
66    allocate(z0(ngrid))
67    allocate(qsurf(ngrid,nq))
68    allocate(tsurf(ngrid))
69    allocate(co2ice(ngrid))
70    allocate(watercap(ngrid))
71    allocate(emis(ngrid))
72    allocate(capcal(ngrid))
73    allocate(fluxgrd(ngrid))
74    allocate(hmons(ngrid))
75    allocate(summit(ngrid))
76    allocate(base(ngrid))
77   
78  end subroutine ini_surfdat_h
79
80
81  subroutine end_surfdat_h
82
83  implicit none
84
85    if (allocated(albedodat))   deallocate(albedodat)
86    if (allocated(phisfi))      deallocate(phisfi)
87    if (allocated(watercaptag)) deallocate(watercaptag)
88    if (allocated(dryness))     deallocate(dryness)
89    if (allocated(zmea))        deallocate(zmea)
90    if (allocated(zstd))        deallocate(zstd)
91    if (allocated(zsig))        deallocate(zsig)
92    if (allocated(zgam))        deallocate(zgam)
93    if (allocated(zthe))        deallocate(zthe)
94    if (allocated(z0))          deallocate(z0)
95    if (allocated(qsurf))       deallocate(qsurf)
96    if (allocated(tsurf))       deallocate(tsurf)
97    if (allocated(co2ice))      deallocate(co2ice)
98    if (allocated(watercap))    deallocate(watercap)
99    if (allocated(emis))        deallocate(emis)
100    if (allocated(capcal))      deallocate(capcal)
101    if (allocated(fluxgrd))     deallocate(fluxgrd)
102    if (allocated(hmons))       deallocate(hmons)
103    if (allocated(summit))      deallocate(summit)
104    if (allocated(base))        deallocate(base)
105   
106  end subroutine end_surfdat_h
107
108end module surfdat_h
Note: See TracBrowser for help on using the repository browser.