source: trunk/LMDZ.MARS/libf/phymars/comsoil_h.F90 @ 1619

Last change on this file since 1619 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: 1.7 KB
Line 
1module comsoil_h
2
3implicit none
4! nsoilmx : number of subterranean layers
5!EM: old soil routine:      integer, parameter :: nsoilmx = 10
6  integer, parameter :: nsoilmx = 18
7
8  real,save,allocatable,dimension(:) :: layer      ! soil layer depths
9  real,save,allocatable,dimension(:) :: mlayer     ! soil mid-layer depths
10  real,save,allocatable,dimension(:,:) :: inertiedat ! soil thermal inertia
11  real,save :: volcapa    ! soil volumetric heat capacity
12       ! NB: volcapa is read fromn control(35) from physicq start file
13       !     in physdem (or set via tabfi, or initialized in
14       !                 soil_settings.F)
15
16  ! variables
17  REAL,SAVE,ALLOCATABLE :: tsoil(:,:)  ! sub-surface temperatures (K)
18  real,save,allocatable :: mthermdiff(:,:)  ! mid-layer thermal diffusivity
19  real,save,allocatable :: thermdiff(:,:)   ! inter-layer thermal diffusivity
20  real,save,allocatable :: coefq(:)         ! q_{k+1/2} coefficients
21  real,save,allocatable :: coefd(:,:)       ! d_k coefficients
22  real,save,allocatable :: alph(:,:)        ! alpha_k coefficients
23  real,save,allocatable :: beta(:,:)        ! beta_k coefficients
24  real,save :: mu
25
26contains
27
28  subroutine ini_comsoil_h(ngrid)
29 
30  implicit none
31  integer,intent(in) :: ngrid ! number of atmospheric columns
32 
33    allocate(layer(nsoilmx)) !soil layer depths
34    allocate(mlayer(0:nsoilmx-1)) ! soil mid-layer depths
35    allocate(inertiedat(ngrid,nsoilmx)) ! soil thermal inertia
36 
37    allocate(tsoil(ngrid,nsoilmx)) ! soil temperatures
38
39    allocate(mthermdiff(ngrid,0:nsoilmx-1))
40    allocate(thermdiff(ngrid,nsoilmx-1))
41    allocate(coefq(0:nsoilmx-1))
42    allocate(coefd(ngrid,nsoilmx-1))
43    allocate(alph(ngrid,nsoilmx-1))
44    allocate(beta(ngrid,nsoilmx-1))
45
46 
47  end subroutine ini_comsoil_h
48
49end module comsoil_h
Note: See TracBrowser for help on using the repository browser.