source: trunk/LMDZ.MARS/libf/phymars/yomlw_h.F90 @ 1524

Last change on this file since 1524 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.9 KB
Line 
1module yomlw_h
2! Coefficients for the longwave radiation subroutines
3use dimradmars_mod, only: nir, nabsmx, npademx
4implicit none
5
6  real,save :: at(2,2)
7  real,save :: bt(2,2)
8  real,save :: tref= 200.0 ! tref: temperature dependence of the absorption
9  real,save :: xp(6,nir)
10  real,save :: tstand = 200.0 ! reference temperature for the Planck function
11  real,save :: ga(npademx,nabsmx)
12  real,save :: gb(npademx,nabsmx)
13  real,save :: cst_voigt(2,nabsmx)
14  real,save :: gcp ! = g/cpp (set in callradite)
15
16! Number of layers on which LTE calculations (in lw and sw) are performed
17! (Computed in nlthermeq) :
18  integer,save :: nlaylte
19
20  real,save,allocatable :: xi(:,:,:,:)
21  real,save,allocatable :: xi_ground(:,:)
22  real,save,allocatable :: xi_emis(:,:,:)
23
24contains
25
26! Allocate array (subroutine ini_yomlw_h is called by phys_state_var_init)
27  subroutine ini_yomlw_h(ngrid)
28   
29    use dimradmars_mod, only: nuco2,nflev
30    implicit none
31   
32    integer,intent(in) :: ngrid ! number of atmospheric columns
33   
34    allocate(xi(ngrid,nuco2,0:nflev+1,0:nflev+1))
35    allocate(xi_ground(ngrid,nuco2))
36    allocate(xi_emis(ngrid,nuco2,nflev-1))
37   
38    ! initialize xp(),at(),bt(),ga(),gb(),cst_voigt()
39
40    ! What follows was taken from old "sulw.F" routine (by Jean-Jacques
41    ! Morcrette, ECMWF, further simplified by F. Forget 01/2000),
42    ! adapted to F90
43   
44    ! ROOTS AND WEIGHTS FOR THE 2-POINT GAUSSIAN QUADRATURE
45!     DATA (RT1(IG1),IG1=1,2) / -0.577350269, +0.577350269 /
46!     DATA (WG1(IG1),IG1=1,2) /  1.0        ,  1.0         /
47    ! COEFFICIENTS OF THE POLYNOMIALS GIVING THE PLANCK FUNCTIONS
48    xp = reshape ( (/ &
49           0.63849788E+01, 0.30969419E+02, 0.44790835E+02, &
50           0.52651048E+01,-0.18799237E+02, 0.92836181E+01, &
51           0.26166790E+02, 0.12348011E+03, 0.17868306E+03, &
52           0.33657659E+02,-0.66869343E+02, 0.21017507E+02, &
53           0.11101254E+02, 0.86037325E+02, 0.25892695E+03, &
54           0.35582991E+03, 0.16958020E+03,-0.41311413E+02, &
55           0.47045285E+02, 0.12234377E+03, 0.61873275E+02, &
56           -0.31971883E+02, 0.59168472E+01, 0.91927407E+01 &
57                    /) , (/ 6,nir /) )
58
59    ! temperature dependency of absorber amounts:
60    at = reshape( (/ &
61           0.694E-03, 0.272E-02, 0.275E-02, 0.178E-01  &
62                   /) , (/ 2,2 /) )
63    bt = reshape( (/ &
64           0.328E-05, 0.298E-05,-0.705E-04,-0.163E-04  &
65                   /) , (/ 2,2 /) )
66
67    ga(1:4,1) = (/ 0.288231E-04, 0.170794E-01,-0.339714E-01, 0.000000E+00 /)
68    gb(1:4,1) = (/ 0.288231E-04, 0.145426E-01, 0.543812E+00, 0.100000E+01 /)
69   
70    ga(1:4,2) = (/ 0.289299E-01, 0.190634E+01, 0.384061E+01, 0.000000E+00 /)
71    gb(1:4,2) = (/ 0.289299E-01, 0.189485E+01, 0.600363E+01, 0.100000E+01 /)
72   
73    cst_voigt = reshape( (/ &
74                  0.500E-02, 0.100E-01, 0.150E-01, 0.100E+00  &
75                         /) , (/ 2,2 /) )
76 
77  end subroutine ini_yomlw_h
78   
79end module yomlw_h
Note: See TracBrowser for help on using the repository browser.