source: LMDZ6/branches/LMDZ-COSP/libf/phylmd/rrtm/srtm_taumol28.F90 @ 3847

Last change on this file since 3847 was 1990, checked in by Laurent Fairhead, 11 years ago

Corrections à la version r1989 pour permettre la compilation avec RRTM
Inclusion de la licence CeCILL_V2 pour RRTM


Changes to revision r1989 to enable RRTM code compilation
RRTM part put under CeCILL_V2 licence

  • Property copyright set to
    Name of program: LMDZ
    Creation date: 1984
    Version: LMDZ5
    License: CeCILL version 2
    Holder: Laboratoire de m\'et\'eorologie dynamique, CNRS, UMR 8539
    See the license file in the root directory
File size: 6.0 KB
Line 
1SUBROUTINE SRTM_TAUMOL28 &
2 & ( KLEV,&
3 & P_FAC00   , P_FAC01  , P_FAC10   , P_FAC11,&
4 & K_JP      , K_JT     , K_JT1     , P_ONEMINUS,&
5 & P_COLMOL  , P_COLO2  , P_COLO3,&
6 & K_LAYTROP,&
7 & P_SFLUXZEN, P_TAUG   , P_TAUR    &
8 & ) 
9
10!     Written by Eli J. Mlawer, Atmospheric & Environmental Research.
11
12!     BAND 28:  38000-50000 cm-1 (low - O3,O2; high - O3,O2)
13
14! Modifications
15!        M.Hamrud      01-Oct-2003 CY28 Cleaning
16
17!     JJMorcrette 2003-02-24 adapted to ECMWF environment
18
19!      PARAMETER (MG=16, MXLAY=203, NBANDS=14)
20
21USE PARKIND1  ,ONLY : JPIM     ,JPRB
22USE YOMHOOK   ,ONLY : LHOOK,   DR_HOOK
23
24USE PARSRTM  , ONLY : JPLAY, JPG, NG28
25USE YOESRTA28, ONLY : ABSA, ABSB &
26 & , SFLUXREFC, RAYL &
27 & , LAYREFFR, STRRAT 
28USE YOESRTWN , ONLY : NSPA, NSPB
29
30IMPLICIT NONE
31
32!-- Output
33INTEGER(KIND=JPIM),INTENT(IN)    :: KLEV
34REAL(KIND=JPRB)   ,INTENT(IN)    :: P_FAC00(JPLAY)
35REAL(KIND=JPRB)   ,INTENT(IN)    :: P_FAC01(JPLAY)
36REAL(KIND=JPRB)   ,INTENT(IN)    :: P_FAC10(JPLAY)
37REAL(KIND=JPRB)   ,INTENT(IN)    :: P_FAC11(JPLAY)
38INTEGER(KIND=JPIM),INTENT(IN)    :: K_JP(JPLAY)
39INTEGER(KIND=JPIM),INTENT(IN)    :: K_JT(JPLAY)
40INTEGER(KIND=JPIM),INTENT(IN)    :: K_JT1(JPLAY)
41REAL(KIND=JPRB)   ,INTENT(IN)    :: P_ONEMINUS
42REAL(KIND=JPRB)   ,INTENT(IN)    :: P_COLMOL(JPLAY)
43REAL(KIND=JPRB)   ,INTENT(IN)    :: P_COLO2(JPLAY)
44REAL(KIND=JPRB)   ,INTENT(IN)    :: P_COLO3(JPLAY)
45INTEGER(KIND=JPIM),INTENT(IN)    :: K_LAYTROP
46
47REAL(KIND=JPRB)   ,INTENT(OUT)   :: P_SFLUXZEN(JPG)
48REAL(KIND=JPRB)   ,INTENT(OUT)   :: P_TAUG(JPLAY,JPG)
49REAL(KIND=JPRB)   ,INTENT(OUT)   :: P_TAUR(JPLAY,JPG)
50!- from INTFAC     
51!- from INTIND
52!- from PRECISE             
53!- from PROFDATA             
54!- from SELF             
55INTEGER(KIND=JPIM) :: IG, IND0, IND1, JS, I_LAY, I_LAYSOLFR, I_NLAYERS
56
57REAL(KIND=JPRB) :: Z_FAC000, Z_FAC001, Z_FAC010, Z_FAC011, Z_FAC100, Z_FAC101,&
58 & Z_FAC110, Z_FAC111, Z_FS, Z_SPECCOMB, Z_SPECMULT, Z_SPECPARM, &
59 & Z_TAURAY 
60REAL(KIND=JPRB) :: ZHOOK_HANDLE
61
62IF (LHOOK) CALL DR_HOOK('SRTM_TAUMOL28',0,ZHOOK_HANDLE)
63I_NLAYERS = KLEV
64
65!     Compute the optical depth by interpolating in ln(pressure),
66!     temperature, and appropriate species.  Below LAYTROP, the water
67!     vapor self-continuum is interpolated (in temperature) separately. 
68
69DO I_LAY = 1, K_LAYTROP
70  Z_SPECCOMB = P_COLO3(I_LAY) + STRRAT*P_COLO2(I_LAY)
71  Z_SPECPARM = P_COLO3(I_LAY)/Z_SPECCOMB
72  IF (Z_SPECPARM >= P_ONEMINUS) Z_SPECPARM = P_ONEMINUS
73  Z_SPECMULT = 8.*(Z_SPECPARM)
74  JS = 1 + INT(Z_SPECMULT)
75  Z_FS = MOD(Z_SPECMULT, 1.0_JPRB )
76! Z_FAC000 = (1. - Z_FS) * P_FAC00(I_LAY)
77! Z_FAC010 = (1. - Z_FS) * P_FAC10(I_LAY)
78! Z_FAC100 = Z_FS * P_FAC00(I_LAY)
79! Z_FAC110 = Z_FS * P_FAC10(I_LAY)
80! Z_FAC001 = (1. - Z_FS) * P_FAC01(I_LAY)
81! Z_FAC011 = (1. - Z_FS) * P_FAC11(I_LAY)
82! Z_FAC101 = Z_FS * P_FAC01(I_LAY)
83! Z_FAC111 = Z_FS * P_FAC11(I_LAY)
84  IND0 = ((K_JP(I_LAY)-1)*5+(K_JT(I_LAY)-1))*NSPA(28) + JS
85  IND1 = (K_JP(I_LAY)*5+(K_JT1(I_LAY)-1))*NSPA(28) + JS
86  Z_TAURAY = P_COLMOL(I_LAY) * RAYL
87
88!  DO IG = 1, NG(28)
89  DO IG = 1 , NG28
90    P_TAUG(I_LAY,IG) = Z_SPECCOMB * &
91!    & (Z_FAC000 * ABSA(IND0,IG) + &
92!    & Z_FAC100 * ABSA(IND0+1,IG) + &
93!    & Z_FAC010 * ABSA(IND0+9,IG) + &
94!    & Z_FAC110 * ABSA(IND0+10,IG) + &
95!    & Z_FAC001 * ABSA(IND1,IG) + &
96!    & Z_FAC101 * ABSA(IND1+1,IG) + &
97!    & Z_FAC011 * ABSA(IND1+9,IG) + &
98!    & Z_FAC111 * ABSA(IND1+10,IG))   
99     & (&
100     & (1. - Z_FS) * ( ABSA(IND0,IG) * P_FAC00(I_LAY) + &
101     &                 ABSA(IND0+9,IG) * P_FAC10(I_LAY) + &
102     &                 ABSA(IND1,IG) * P_FAC01(I_LAY) + &
103     &                 ABSA(IND1+9,IG) * P_FAC11(I_LAY) ) + &
104     & Z_FS        * ( ABSA(IND0+1,IG) * P_FAC00(I_LAY) + &
105     &                 ABSA(IND0+10,IG) * P_FAC10(I_LAY) + &
106     &                 ABSA(IND1+1,IG) * P_FAC01(I_LAY) + &
107     &                 ABSA(IND1+10,IG) * P_FAC11(I_LAY) ) &
108     & )
109!     &           + TAURAY
110!    SSA(LAY,IG) = TAURAY/TAUG(LAY,IG)
111    P_TAUR(I_LAY,IG) = Z_TAURAY
112  ENDDO
113ENDDO
114
115I_LAYSOLFR = I_NLAYERS
116
117DO I_LAY = K_LAYTROP+1, I_NLAYERS
118  IF (K_JP(I_LAY-1) < LAYREFFR .AND. K_JP(I_LAY) >= LAYREFFR) &
119   & I_LAYSOLFR = I_LAY 
120  Z_SPECCOMB = P_COLO3(I_LAY) + STRRAT*P_COLO2(I_LAY)
121  Z_SPECPARM = P_COLO3(I_LAY)/Z_SPECCOMB
122  IF (Z_SPECPARM >= P_ONEMINUS) Z_SPECPARM = P_ONEMINUS
123  Z_SPECMULT = 4.*(Z_SPECPARM)
124  JS = 1 + INT(Z_SPECMULT)
125  Z_FS = MOD(Z_SPECMULT, 1.0_JPRB )
126! Z_FAC000 = (1. - Z_FS) * P_FAC00(I_LAY)
127! Z_FAC010 = (1. - Z_FS) * P_FAC10(I_LAY)
128! Z_FAC100 = Z_FS * P_FAC00(I_LAY)
129! Z_FAC110 = Z_FS * P_FAC10(I_LAY)
130! Z_FAC001 = (1. - Z_FS) * P_FAC01(I_LAY)
131! Z_FAC011 = (1. - Z_FS) * P_FAC11(I_LAY)
132! Z_FAC101 = Z_FS * P_FAC01(I_LAY)
133! Z_FAC111 = Z_FS * P_FAC11(I_LAY)
134  IND0 = ((K_JP(I_LAY)-13)*5+(K_JT(I_LAY)-1))*NSPB(28) + JS
135  IND1 = ((K_JP(I_LAY)-12)*5+(K_JT1(I_LAY)-1))*NSPB(28) + JS
136  Z_TAURAY = P_COLMOL(I_LAY) * RAYL
137
138!  DO IG = 1, NG(28)
139  DO IG = 1 , NG28
140    P_TAUG(I_LAY,IG) = Z_SPECCOMB * &
141!    & (Z_FAC000 * ABSB(IND0,IG) + &
142!    & Z_FAC100 * ABSB(IND0+1,IG) + &
143!    & Z_FAC010 * ABSB(IND0+5,IG) + &
144!    & Z_FAC110 * ABSB(IND0+6,IG) + &
145!    & Z_FAC001 * ABSB(IND1,IG) + &
146!    & Z_FAC101 * ABSB(IND1+1,IG) + &
147!    & Z_FAC011 * ABSB(IND1+5,IG) + &
148!    & Z_FAC111 * ABSB(IND1+6,IG))   
149     & (&
150     & (1. - Z_FS) * ( ABSB(IND0,IG) * P_FAC00(I_LAY) + &
151     &                 ABSB(IND0+5,IG) * P_FAC10(I_LAY) + &
152     &                 ABSB(IND1,IG) * P_FAC01(I_LAY) + &
153     &                 ABSB(IND1+5,IG) * P_FAC11(I_LAY) ) + &
154     & Z_FS        * ( ABSB(IND0+1,IG) * P_FAC00(I_LAY) + &
155     &                 ABSB(IND0+6,IG) * P_FAC10(I_LAY) + &
156     &                 ABSB(IND1+1,IG) * P_FAC01(I_LAY) + &
157     &                 ABSB(IND1+6,IG) * P_FAC11(I_LAY) ) &
158     & )
159!     &           + TAURAY
160!    SSA(LAY,IG) = TAURAY/TAUG(LAY,IG)
161    IF (I_LAY == I_LAYSOLFR) P_SFLUXZEN(IG) = SFLUXREFC(IG,JS) &
162     & + Z_FS * (SFLUXREFC(IG,JS+1) - SFLUXREFC(IG,JS)) 
163    P_TAUR(I_LAY,IG) = Z_TAURAY
164  ENDDO
165ENDDO
166
167!-----------------------------------------------------------------------
168IF (LHOOK) CALL DR_HOOK('SRTM_TAUMOL28',1,ZHOOK_HANDLE)
169END SUBROUTINE SRTM_TAUMOL28
170
Note: See TracBrowser for help on using the repository browser.