source: LMDZ6/trunk/libf/phy_common/vertical_layers_mod.f90 @ 5403

Last change on this file since 5403 was 5268, checked in by abarral, 7 weeks ago

.f90 <-> .F90 depending on cpp key use

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