source: LMDZ6/branches/Amaury_dev/libf/phy_common/lmdz_vertical_layers.f90 @ 5229

Last change on this file since 5229 was 5112, checked in by abarral, 4 months ago

Rename modules in phy_common from *_mod > lmdz_*

File size: 2.6 KB
Line 
1MODULE lmdz_vertical_layers
2
3   REAL,SAVE             :: preff  ! reference surface pressure (Pa)
4   REAL,SAVE             :: scaleheight ! atmospheric reference scale height (km)
5   REAL,SAVE,ALLOCATABLE :: ap(:) ! hybrid (pressure contribution) coordinate
6                                  ! at layer interfaces (Pa)
7   REAL,SAVE,ALLOCATABLE :: bp(:) ! hybrid (sigma contribution) coordinate
8                                  ! at layer interfaces (Pa)
9   REAL,SAVE,ALLOCATABLE :: aps(:) ! hybrid (pressure contribution) coordinate
10                                   ! at mid-layer (Pa)
11   REAL,SAVE,ALLOCATABLE :: bps(:) ! hybrid (sigma contribution) coordinate
12                                   ! at mid-layer
13   REAL,SAVE,ALLOCATABLE :: presnivs(:) ! reference pressure at mid-layer (Pa),
14                                        ! based on preff, ap and bp
15   REAL,SAVE,ALLOCATABLE :: presinter(:) ! reference pressure at interface (Pa),
16                                        ! based on preff, ap and bp
17   REAL,SAVE,ALLOCATABLE :: pseudoalt(:) ! pseudo-altitude of model layers (km),
18                                         ! based on preff and scaleheight
19
20!$OMP THREADPRIVATE(preff,scaleheight,ap,bp,aps,bps,presnivs,presinter,pseudoalt)
21
22
23CONTAINS
24
25  SUBROUTINE init_vertical_layers(nlayer,preff_,scaleheight_,ap_,bp_,&
26                                 aps_,bps_,presnivs_, presinter_, pseudoalt_)
27    IMPLICIT NONE
28    INTEGER,INTENT(IN) :: nlayer ! number of atmospheric layers
29    REAL,INTENT(IN)    :: preff_ ! reference surface pressure (Pa)
30    REAL,INTENT(IN)    :: scaleheight_ ! atmospheric scale height (km)
31    REAL,INTENT(IN)    :: ap_(nlayer+1) ! hybrid coordinate at interfaces
32    REAL,INTENT(IN)    :: bp_(nlayer+1) ! hybrid coordinate at interfaces
33    REAL,INTENT(IN)    :: aps_(nlayer) ! hybrid coordinate at mid-layer
34    REAL,INTENT(IN)    :: bps_(nlayer) ! hybrid coordinate at mid-layer
35    REAL,INTENT(IN)    :: presnivs_(nlayer) ! Appproximative pressure of atm. layers (Pa)
36    REAL,INTENT(IN)    :: presinter_(nlayer+1) ! Appproximative pressure of atm. layers (Pa)
37    REAL,INTENT(IN)    :: pseudoalt_(nlayer) ! pseudo-altitude of atm. layers (km)
38
39    ALLOCATE(ap(nlayer+1))
40    ALLOCATE(bp(nlayer+1))
41    ALLOCATE(aps(nlayer))
42    ALLOCATE(bps(nlayer))
43    ALLOCATE(presnivs(nlayer))
44    ALLOCATE(presinter(nlayer+1))
45    ALLOCATE(pseudoalt(nlayer))
46
47    preff = preff_
48    scaleheight=scaleheight_
49    ap(:) = ap_(:)
50    bp(:) = bp_(:)
51    aps(:) = aps_(:)
52    bps(:) = bps_(:)
53    presnivs(:) = presnivs_(:)
54    presinter(:) = presinter_(:)
55    pseudoalt(:) = pseudoalt_(:)
56
57  END SUBROUTINE init_vertical_layers
58
59END MODULE lmdz_vertical_layers
Note: See TracBrowser for help on using the repository browser.