source: codes/icosagcm/devel/src/vertical/disvert_dcmip200.f90 @ 915

Last change on this file since 915 was 912, checked in by dubos, 5 years ago

devel : cosmetic changes to comply with XCodeML

File size: 2.2 KB
Line 
1  MODULE disvert_dcmip200_mod
2    USE prec, ONLY : rstd
3    USE grid_param, ONLY : llm
4
5  IMPLICIT NONE
6  PRIVATE
7
8  REAL(rstd), SAVE, ALLOCATABLE,TARGET :: ap(:)
9!$OMP THREADPRIVATE(ap)
10  REAL(rstd), SAVE, ALLOCATABLE,TARGET :: bp(:)
11!$OMP THREADPRIVATE(bp)
12  REAL(rstd), SAVE, ALLOCATABLE,TARGET :: presnivs(:)
13!$OMP THREADPRIVATE(presnivs)
14
15  PUBLIC :: init_disvert, ap, bp, presnivs
16
17CONTAINS
18!=========================================================================
19
20  SUBROUTINE init_disvert
21    USE mpipara
22   
23    ALLOCATE(ap(llm+1))
24    ALLOCATE(bp(llm+1))
25    ALLOCATE(presnivs(llm))
26   
27    CALL disvert(ap,bp,presnivs)   
28   
29  END SUBROUTINE init_disvert
30
31  SUBROUTINE disvert(ap,bp,presnivs)
32    USE earth_const, ONLY : cpp, kappa, preff, g
33    USE icosa, ONLY       : ncar_dz, ncar_T0, ncar_p0
34    USE getin_mod, ONLY   : getin
35    USE mpipara, ONLY     : is_mpi_root
36    REAL(rstd),INTENT(OUT) :: ap(:)
37    REAL(rstd),INTENT(OUT) :: bp(:)
38    REAL(rstd),INTENT(OUT) :: presnivs(:)
39    ! reads from run.def : ncar_dz, ncar_T0, ncar_p0, ncar_disvert_c
40    INTEGER :: l,cindx
41    REAL(rstd) ::  eta_top, eta
42    REAL(rstd),PARAMETER :: N=0.01         ! Brunt-Vaisala frequency (s-1)
43    REAL(rstd),PARAMETER :: T0=300.       ! Surface temperature at the equator (K)
44    REAL(rstd) :: Rd       
45    REAL(rstd), PARAMETER :: Gamma=0.0065       
46   
47    Rd=cpp*kappa
48    ncar_dz=400 ; CALL getin('ncar_dz',ncar_dz);
49    cindx=1 ; CALL getin('ncar_disvert_c',cindx) 
50   
51    eta_top = (1-Gamma/T0*llm*ncar_dz)**(g/(Rd*Gamma)) 
52    do l = 1,llm+1
53       eta = (1-Gamma/T0*(l-1)*ncar_dz)**(g/(Rd*Gamma))
54       PRINT *,'eta ->', eta
55       bp(l) = ((eta - eta_top)/(1 - eta_top))**cindx
56       ap(l) = preff * ( eta - bp(l) )
57    ENDDO
58    bp(1)=1.
59    ap(1)=0.
60    bp(llm+1) = 0
61   
62    DO l = 1, llm
63       presnivs(l) = 0.5 *( ap(l)+bp(l)*preff + ap(l+1)+bp(l+1)*preff )
64    ENDDO
65   
66    !$OMP MASTER 
67    IF (is_mpi_root) PRINT *, 'Vertical placement of model levels according to DCMIP Appendix E.3'
68    IF (is_mpi_root) PRINT *, 'Parameters : ncar_dz=', ncar_dz, '  ncar_p0=',ncar_p0, '  ncar_disvert_c=',cindx
69    IF (is_mpi_root) PRINT *, 'Isothermal amtosphere with ncar_T0=',ncar_T0 
70    !$OMP END MASTER 
71   
72  END SUBROUTINE disvert
73 
74END  MODULE disvert_dcmip200_mod
Note: See TracBrowser for help on using the repository browser.