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

Last change on this file since 1242 was 1224, checked in by aslmd, 11 years ago

LMDZ.MARS. If not major, a quite important commit.

  1. No more SAVE,ALLOCATABLE arrays outside modules.

This is important to solve the nesting conundrum in MESOSCALE.
And overall this is good for the harmony of the universe.
(Joke apart, this is good for any interfacing task. And compliant with a F90 spirit).
Note that bit-to-bit compatibility of results in debug mode was checked.

  1. inifis is split in two : phys_state_var_init + conf_phys

This makes interfacing with MESOSCALE more transparent.
This is also clearer for LMDZ.MARS.
Before, inifis has two very different tasks to do.

  1. a bit of cleaning as far as modules and saves are concerned

Point 1

  • Removed SAVE,ALLOCATABLE arrays from

physiq, aeropacity, updatereffrad, soil

and put those in

dimradmars_mod, surfdat_h, tracer_mod, comsoil_h

and changed accordingly the initialization subroutines associated to each module.
Allocating these arrays is thus done at initialization.

Point 2

  • Created a subroutine phys_state_var_init which does all the allocation / initialization work for modules. This was previously done in inifis.
  • Replaced inifis which was then (after the previous modification) just about reading callphys.def and setting a few constants by conf_phys. This mimics the new LMDZ terminology (cf. LMDZ.VENUS for instance)
  • Bye bye inifis.

Point 3

  • Removed comdiurn and put everything in comgeomfi
  • Created a turb_mod module for turbulence variables (e.g. l0 in yamada4)
  • dryness had nothing to do in tracer_h, put it in surfdat_h (like watercaptag)
  • topdust0 does not need to be SAVE in aeropacity. better use sinlat.
  • emisref does not need to be SAVE in newcondens. made it automatic array.
  • Removed useless co2ice argument in initracer.
File size: 2.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  logical,save :: temptag !temp tag for water caps
14     
15  real,save :: albedo_h2o_ice ! water ice albedo
16  real,save :: inert_h2o_ice ! water ice thermal inertia
17  real,save :: frost_albedo_threshold ! water frost thickness on the ground (kg.m^-2, ie mm)
18  real,save :: TESice_Ncoef ! coefficient for TES ice albedo in Northern hemisphere
19  real,save :: TESice_Scoef ! coefficient for TES ice albedo in Southern hemisphere
20  real,save :: iceradius(2) , dtemisice(2)
21  real,save,allocatable :: zmea(:),zstd(:),zsig(:),zgam(:),zthe(:)
22  real,save,allocatable :: z0(:) ! surface roughness length (m)
23  real,save :: z0_default ! default (constant over planet) surface roughness (m)
24
25  !! variables
26  REAL,SAVE,ALLOCATABLE :: tsurf(:)   ! Surface temperature (K)
27  REAL,SAVE,ALLOCATABLE :: co2ice(:)  ! co2 ice surface layer (kg.m-2) 
28  REAL,SAVE,ALLOCATABLE :: emis(:)    ! Thermal IR surface emissivity
29  REAL,SAVE,ALLOCATABLE :: capcal(:) ! surface heat capacity (J m-2 K-1)
30  REAL,SAVE,ALLOCATABLE :: fluxgrd(:) ! surface conduction flux (W.m-2)
31  REAL,ALLOCATABLE,SAVE :: qsurf(:,:) ! tracer on surface (e.g. kg.m-2)
32
33contains
34
35  subroutine ini_surfdat_h(ngrid,nq)
36 
37  implicit none
38  integer,intent(in) :: ngrid ! number of atmospheric columns
39  integer,intent(in) :: nq ! number of tracers 
40
41    allocate(albedodat(ngrid))
42    allocate(phisfi(ngrid))
43    allocate(watercaptag(ngrid))
44    allocate(dryness(ngrid))
45    allocate(zmea(ngrid))
46    allocate(zstd(ngrid))
47    allocate(zsig(ngrid))
48    allocate(zgam(ngrid))
49    allocate(zthe(ngrid))
50    allocate(z0(ngrid))
51    allocate(qsurf(ngrid,nq))
52    allocate(tsurf(ngrid))
53    allocate(co2ice(ngrid))
54    allocate(emis(ngrid))
55    allocate(capcal(ngrid))
56    allocate(fluxgrd(ngrid))
57 
58  end subroutine ini_surfdat_h
59
60end module surfdat_h
Note: See TracBrowser for help on using the repository browser.