source: LMDZ5/branches/IPSLCM5A2.1/libf/phylmd/vertical_layers_mod.F90 @ 2952

Last change on this file since 2952 was 2907, checked in by acozic, 7 years ago

Add some modification to fit with recent version of model Inca

File size: 1.9 KB
Line 
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)
11   REAL,SAVE,ALLOCATABLE :: presnivs(:) ! reference pressure at mid-layer (Pa),
12                                        ! based on preff, ap and bp
13   REAL,SAVE,ALLOCATABLE :: pseudoalt(:) ! pseudo-altitude of model layers (km),
14                                         ! based on preff and scaleheight
15   
16!$OMP THREADPRIVATE(preff,scaleheight,ap,bp,presnivs,pseudoalt)
17   REAL, SAVE, ALLOCATABLE :: Ahyb(:), Bhyb(:)
18!$OMP THREADPRIVATE(Ahyb, Bhyb)
19
20CONTAINS
21
22  SUBROUTINE init_vertical_layers(nlayer,preff_,scaleheight_,ap_,bp_,&
23                                 presnivs_, pseudoalt_)
24    IMPLICIT NONE
25    INTEGER,INTENT(IN) :: nlayer ! number of atmospheric layers
26    REAL,INTENT(IN)    :: preff_ ! reference surface pressure (Pa)
27    REAL,INTENT(IN)    :: scaleheight_ ! atmospheric scale height (km)
28    REAL,INTENT(IN)    :: ap_(nlayer+1) ! hybrid coordinate at interfaces
29    REAL,INTENT(IN)    :: bp_(nlayer+1) ! hybrid coordinate at interfaces
30    REAL,INTENT(IN)    :: presnivs_(nlayer) ! Appproximative pressure of atm. layers (Pa)
31    REAL,INTENT(IN)    :: pseudoalt_(nlayer) ! pseudo-altitude of atm. layers (km)
32 
33    ALLOCATE(ap(nlayer+1))
34    ALLOCATE(bp(nlayer+1))
35    ALLOCATE(presnivs(nlayer))
36    ALLOCATE(pseudoalt(nlayer))
37    ALLOCATE(Ahyb(nlayer))
38    ALLOCATE(Bhyb(nlayer))
39
40
41    preff = preff_
42    scaleheight=scaleheight_
43    ap(:) = ap_(:)
44    bp(:) = bp_(:)
45    presnivs(:) = presnivs_(:)
46    pseudoalt(:) = pseudoalt_(:)
47
48  END SUBROUTINE init_vertical_layers
49
50END MODULE vertical_layers_mod
Note: See TracBrowser for help on using the repository browser.