source: LMDZ5/branches/testing/libf/phylmd/rrtm/srtm_taumol17.F90 @ 2435

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

Merged trunk changes r1920:1997 into testing branch

  • 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.6 KB
RevLine 
[1989]1SUBROUTINE SRTM_TAUMOL17 &
2 & ( KLEV,&
3 & P_FAC00   , P_FAC01  , P_FAC10   , P_FAC11,&
4 & K_JP      , K_JT     , K_JT1     , P_ONEMINUS,&
5 & P_COLH2O  , P_COLCO2 , P_COLMOL,&
6 & K_LAYTROP , P_SELFFAC, P_SELFFRAC, K_INDSELF  , P_FORFAC, P_FORFRAC, K_INDFOR,&
7 & P_SFLUXZEN, P_TAUG   , P_TAUR    &
8 & ) 
9
10!     Written by Eli J. Mlawer, Atmospheric & Environmental Research.
11
12!     BAND 17:  3250-4000 cm-1 (low - H2O,CO2; high - H2O,CO2)
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, NG17
25USE YOESRTA17, ONLY : ABSA, ABSB, FORREFC, SELFREFC &
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_COLH2O(JPLAY)
43REAL(KIND=JPRB)   ,INTENT(IN)    :: P_COLCO2(JPLAY)
44REAL(KIND=JPRB)   ,INTENT(IN)    :: P_COLMOL(JPLAY)
45INTEGER(KIND=JPIM),INTENT(IN)    :: K_LAYTROP
46REAL(KIND=JPRB)   ,INTENT(IN)    :: P_SELFFAC(JPLAY)
47REAL(KIND=JPRB)   ,INTENT(IN)    :: P_SELFFRAC(JPLAY)
48INTEGER(KIND=JPIM),INTENT(IN)    :: K_INDSELF(JPLAY)
49REAL(KIND=JPRB)   ,INTENT(IN)    :: P_FORFAC(JPLAY)
50REAL(KIND=JPRB)   ,INTENT(IN)    :: P_FORFRAC(JPLAY)
51INTEGER(KIND=JPIM),INTENT(IN)    :: K_INDFOR(JPLAY)
52
53REAL(KIND=JPRB)   ,INTENT(OUT)   :: P_SFLUXZEN(JPG)
54REAL(KIND=JPRB)   ,INTENT(OUT)   :: P_TAUG(JPLAY,JPG)
55REAL(KIND=JPRB)   ,INTENT(OUT)   :: P_TAUR(JPLAY,JPG)
56!- from INTFAC     
57!- from INTIND
58!- from PRECISE             
59!- from PROFDATA             
60!- from SELF             
61INTEGER(KIND=JPIM) :: IG, IND0, IND1, INDS, INDF, JS, I_LAY, I_LAYSOLFR, I_NLAYERS
62
63REAL(KIND=JPRB) :: Z_FAC000, Z_FAC001, Z_FAC010, Z_FAC011, Z_FAC100, Z_FAC101,&
64 & Z_FAC110, Z_FAC111, Z_FS, Z_SPECCOMB, Z_SPECMULT, Z_SPECPARM, &
65 & Z_TAURAY 
66REAL(KIND=JPRB) :: ZHOOK_HANDLE
67
68IF (LHOOK) CALL DR_HOOK('SRTM_TAUMOL17',0,ZHOOK_HANDLE)
69I_NLAYERS = KLEV
70
71!     Compute the optical depth by interpolating in ln(pressure),
72!     temperature, and appropriate species.  Below LAYTROP, the water
73!     vapor self-continuum is interpolated (in temperature) separately. 
74DO I_LAY = 1, K_LAYTROP
75  Z_SPECCOMB = P_COLH2O(I_LAY) + STRRAT*P_COLCO2(I_LAY)
76  Z_SPECPARM = P_COLH2O(I_LAY)/Z_SPECCOMB
77  IF (Z_SPECPARM >= P_ONEMINUS) Z_SPECPARM = P_ONEMINUS
78  Z_SPECMULT = 8.*(Z_SPECPARM)
79  JS = 1 + INT(Z_SPECMULT)
80  Z_FS = MOD(Z_SPECMULT, 1.0_JPRB )
81! Z_FAC000 = (1. - Z_FS) * P_FAC00(I_LAY)
82! Z_FAC010 = (1. - Z_FS) * P_FAC10(I_LAY)
83! Z_FAC100 = Z_FS * P_FAC00(I_LAY)
84! Z_FAC110 = Z_FS * P_FAC10(I_LAY)
85! Z_FAC001 = (1. - Z_FS) * P_FAC01(I_LAY)
86! Z_FAC011 = (1. - Z_FS) * P_FAC11(I_LAY)
87! Z_FAC101 = Z_FS * P_FAC01(I_LAY)
88! Z_FAC111 = Z_FS * P_FAC11(I_LAY)
89  IND0 = ((K_JP(I_LAY)-1)*5+(K_JT(I_LAY)-1))*NSPA(17) + JS
90  IND1 = (K_JP(I_LAY)*5+(K_JT1(I_LAY)-1))*NSPA(17) + JS
91  INDS = K_INDSELF(I_LAY)
92  INDF = K_INDFOR(I_LAY)
93  Z_TAURAY = P_COLMOL(I_LAY) * RAYL
94
95!  DO IG = 1, NG(17)
96  DO IG = 1, NG17
97    P_TAUG(I_LAY,IG) = Z_SPECCOMB * &
98     & (&
99     & (1. - Z_FS) * ( ABSA(IND0,IG) * P_FAC00(I_LAY) + &
100     &                 ABSA(IND0+9,IG) * P_FAC10(I_LAY) + &
101     &                 ABSA(IND1,IG) * P_FAC01(I_LAY) + &
102     &                 ABSA(IND1+9,IG) * P_FAC11(I_LAY) ) + &
103     & Z_FS        * ( ABSA(IND0+1,IG) * P_FAC00(I_LAY) + &
104     &                 ABSA(IND0+10,IG) * P_FAC10(I_LAY) + &
105     &                 ABSA(IND1+1,IG) * P_FAC01(I_LAY) + &
106     &                 ABSA(IND1+10,IG) * P_FAC11(I_LAY) ) &
107     & ) + &
108     & P_COLH2O(I_LAY) * &
109     & (P_SELFFAC(I_LAY) * (SELFREFC(INDS,IG) + &
110     & P_SELFFRAC(I_LAY) * &
111     & (SELFREFC(INDS+1,IG) - SELFREFC(INDS,IG))) + &
112     & P_FORFAC(I_LAY) * (FORREFC(INDF,IG) + &
113     & P_FORFRAC(I_LAY) * &
114     & (FORREFC(INDF+1,IG) - FORREFC(INDF,IG))))   
115!     &           + TAURAY
116!    SSA(LAY,IG) = TAURAY/TAUG(LAY,IG)
117    P_TAUR(I_LAY,IG) = Z_TAURAY
118  ENDDO
119ENDDO
120
121I_LAYSOLFR = I_NLAYERS
122
123DO I_LAY = K_LAYTROP+1, I_NLAYERS
124  IF (K_JP(I_LAY-1) < LAYREFFR .AND. K_JP(I_LAY) >= LAYREFFR) &
125   & I_LAYSOLFR = I_LAY 
126  Z_SPECCOMB = P_COLH2O(I_LAY) + STRRAT*P_COLCO2(I_LAY)
127  Z_SPECPARM = P_COLH2O(I_LAY)/Z_SPECCOMB
128  IF (Z_SPECPARM >= P_ONEMINUS) Z_SPECPARM = P_ONEMINUS
129  Z_SPECMULT = 4.*(Z_SPECPARM)
130  JS = 1 + INT(Z_SPECMULT)
131  Z_FS = MOD(Z_SPECMULT, 1.0_JPRB )
132! Z_FAC000 = (1. - Z_FS) * P_FAC00(I_LAY)
133! Z_FAC010 = (1. - Z_FS) * P_FAC10(I_LAY)
134! Z_FAC100 = Z_FS * P_FAC00(I_LAY)
135! Z_FAC110 = Z_FS * P_FAC10(I_LAY)
136! Z_FAC001 = (1. - Z_FS) * P_FAC01(I_LAY)
137! Z_FAC011 = (1. - Z_FS) * P_FAC11(I_LAY)
138! Z_FAC101 = Z_FS * P_FAC01(I_LAY)
139! Z_FAC111 = Z_FS * P_FAC11(I_LAY)
140  IND0 = ((K_JP(I_LAY)-13)*5+(K_JT(I_LAY)-1))*NSPB(17) + JS
141  IND1 = ((K_JP(I_LAY)-12)*5+(K_JT1(I_LAY)-1))*NSPB(17) + JS
142  INDF = K_INDFOR(I_LAY)
143  Z_TAURAY = P_COLMOL(I_LAY) * RAYL
144
145!  DO IG = 1, NG(17)
146  DO IG = 1, NG17
147    P_TAUG(I_LAY,IG) = Z_SPECCOMB * &
148!    & (Z_FAC000 * ABSB(IND0,IG) + &
149!    & Z_FAC100 * ABSB(IND0+1,IG) + &
150!    & Z_FAC010 * ABSB(IND0+5,IG) + &
151!    & Z_FAC110 * ABSB(IND0+6,IG) + &
152!    & Z_FAC001 * ABSB(IND1,IG) + &
153!    & Z_FAC101 * ABSB(IND1+1,IG) + &
154!    & Z_FAC011 * ABSB(IND1+5,IG) + &
155!    & Z_FAC111 * ABSB(IND1+6,IG)) + &
156     & (&
157     & (1. - Z_FS) * ( ABSB(IND0,IG) * P_FAC00(I_LAY) + &
158     &                 ABSB(IND0+5,IG) * P_FAC10(I_LAY) + &
159     &                 ABSB(IND1,IG) * P_FAC01(I_LAY) + &
160     &                 ABSB(IND1+5,IG) * P_FAC11(I_LAY) ) + &
161     & Z_FS        * ( ABSB(IND0+1,IG) * P_FAC00(I_LAY) + &
162     &                 ABSB(IND0+6,IG) * P_FAC10(I_LAY) + &
163     &                 ABSB(IND1+1,IG) * P_FAC01(I_LAY) + &
164     &                 ABSB(IND1+6,IG) * P_FAC11(I_LAY) ) &
165     & ) + &
166     & P_COLH2O(I_LAY) * &
167     & P_FORFAC(I_LAY) * (FORREFC(INDF,IG) + &
168     & P_FORFRAC(I_LAY) * &
169     & (FORREFC(INDF+1,IG) - FORREFC(INDF,IG)))   
170!     &           + TAURAY
171!    SSA(LAY,IG) = TAURAY/TAUG(LAY,IG)
172    IF (I_LAY == I_LAYSOLFR) P_SFLUXZEN(IG) = SFLUXREFC(IG,JS) &
173     & + Z_FS * (SFLUXREFC(IG,JS+1) - SFLUXREFC(IG,JS)) 
174    P_TAUR(I_LAY,IG) = Z_TAURAY
175  ENDDO
176ENDDO
177
178!-----------------------------------------------------------------------
179IF (LHOOK) CALL DR_HOOK('SRTM_TAUMOL17',1,ZHOOK_HANDLE)
180END SUBROUTINE SRTM_TAUMOL17
181
Note: See TracBrowser for help on using the repository browser.