source: LMDZ6/branches/contrails/libf/phylmd/rrtm/rrtm_taumol5.F90 @ 5428

Last change on this file since 5428 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.8 KB
Line 
1!----------------------------------------------------------------------------
2SUBROUTINE RRTM_TAUMOL5 (KLEV,P_TAU,P_WX,&
3 & P_TAUAERL,P_FAC00,P_FAC01,P_FAC10,P_FAC11,P_FORFAC,K_JP,K_JT,K_JT1,P_ONEMINUS,&
4 & P_COLH2O,P_COLCO2, P_COLO3,K_LAYTROP,P_SELFFAC,P_SELFFRAC,K_INDSELF,PFRAC) 
5
6!     BAND 5:  700-820 cm-1 (low - H2O,CO2; high - O3,CO2)
7
8! Modifications
9!        M.Hamrud      01-Oct-2003 CY28 Cleaning
10
11!     D Salmond 2000-05-15 speed-up
12
13USE PARKIND1  ,ONLY : JPIM     ,JPRB
14USE YOMHOOK   ,ONLY : LHOOK,   DR_HOOK
15
16USE PARRRTM  , ONLY : JPLAY  ,JPBAND ,JPGPT  ,JPXSEC ,NG5   ,NGS4
17USE YOERRTWN , ONLY :      NSPA   ,NSPB
18USE YOERRTA5 , ONLY : ABSA   ,ABSB   ,CCL4   , FRACREFA, FRACREFB,SELFREF,STRRAT1, STRRAT2
19
20!  Input
21!#include "yoeratm.h"
22
23!      REAL TAUAER(JPLAY)
24
25IMPLICIT NONE
26
27INTEGER(KIND=JPIM),INTENT(IN)    :: KLEV
28REAL(KIND=JPRB)   ,INTENT(OUT)   :: P_TAU(JPGPT,JPLAY)
29REAL(KIND=JPRB)   ,INTENT(IN)    :: P_WX(JPXSEC,JPLAY) ! Amount of trace gases
30REAL(KIND=JPRB)   ,INTENT(IN)    :: P_TAUAERL(JPLAY,JPBAND)
31REAL(KIND=JPRB)   ,INTENT(IN)    :: P_FAC00(JPLAY)
32REAL(KIND=JPRB)   ,INTENT(IN)    :: P_FAC01(JPLAY)
33REAL(KIND=JPRB)   ,INTENT(IN)    :: P_FAC10(JPLAY)
34REAL(KIND=JPRB)   ,INTENT(IN)    :: P_FAC11(JPLAY)
35REAL(KIND=JPRB)                  :: P_FORFAC(JPLAY) ! Argument NOT used
36INTEGER(KIND=JPIM),INTENT(IN)    :: K_JP(JPLAY)
37INTEGER(KIND=JPIM),INTENT(IN)    :: K_JT(JPLAY)
38INTEGER(KIND=JPIM),INTENT(IN)    :: K_JT1(JPLAY)
39REAL(KIND=JPRB)   ,INTENT(IN)    :: P_ONEMINUS
40REAL(KIND=JPRB)   ,INTENT(IN)    :: P_COLH2O(JPLAY)
41REAL(KIND=JPRB)   ,INTENT(IN)    :: P_COLCO2(JPLAY)
42REAL(KIND=JPRB)   ,INTENT(IN)    :: P_COLO3(JPLAY)
43INTEGER(KIND=JPIM),INTENT(IN)    :: K_LAYTROP
44REAL(KIND=JPRB)   ,INTENT(IN)    :: P_SELFFAC(JPLAY)
45REAL(KIND=JPRB)   ,INTENT(IN)    :: P_SELFFRAC(JPLAY)
46INTEGER(KIND=JPIM),INTENT(IN)    :: K_INDSELF(JPLAY)
47REAL(KIND=JPRB)   ,INTENT(OUT)   :: PFRAC(JPGPT,JPLAY)
48!  Output
49!- from AER
50!- from INTFAC     
51!- from INTIND
52!- from PRECISE             
53!- from PROFDATA             
54!- from SELF             
55!- from SP             
56INTEGER(KIND=JPIM) :: IJS(JPLAY)
57REAL(KIND=JPRB) :: ZFS(JPLAY),Z_SPECCOMB(JPLAY)
58INTEGER(KIND=JPIM) :: IND0(JPLAY),IND1(JPLAY),INDS(JPLAY)
59
60INTEGER(KIND=JPIM) :: IG, JS, I_LAY
61
62REAL(KIND=JPRB) :: Z_FAC000, Z_FAC001, Z_FAC010, Z_FAC011, Z_FAC100, Z_FAC101,&
63 & Z_FAC110, Z_FAC111, Z_FS, Z_SPECMULT, Z_SPECPARM 
64REAL(KIND=JPRB) :: ZHOOK_HANDLE
65
66!      EQUIVALENCE (TAUAERL(1,5),TAUAER)
67
68!     Compute the optical depth by interpolating in ln(pressure),
69!     temperature, and appropriate species.  Below LAYTROP, the water
70!     vapor self-continuum is interpolated (in temperature) separately. 
71
72IF (LHOOK) CALL DR_HOOK('RRTM_TAUMOL5',0,ZHOOK_HANDLE)
73DO I_LAY = 1, K_LAYTROP
74  Z_SPECCOMB(I_LAY) = P_COLH2O(I_LAY) + STRRAT1*P_COLCO2(I_LAY)
75  Z_SPECPARM = P_COLH2O(I_LAY)/Z_SPECCOMB(I_LAY)
76  Z_SPECPARM=MIN(P_ONEMINUS,Z_SPECPARM)
77  Z_SPECMULT = 8._JPRB*(Z_SPECPARM)
78  JS = 1 + INT(Z_SPECMULT)
79  Z_FS = MOD(Z_SPECMULT,1.0_JPRB)
80  IND0(I_LAY) = ((K_JP(I_LAY)-1)*5+(K_JT(I_LAY)-1))*NSPA(5) + JS
81  IND1(I_LAY) = (K_JP(I_LAY)*5+(K_JT1(I_LAY)-1))*NSPA(5) + JS
82  INDS(I_LAY) = K_INDSELF(I_LAY)
83
84  ZFS(I_LAY)=Z_FS
85  IJS(I_LAY)=JS
86
87ENDDO
88
89!-- DS_000515
90DO I_LAY = 1, K_LAYTROP
91!-- DS_000515
92
93  Z_FS=ZFS(I_LAY)
94  JS=IJS(I_LAY)
95  DO IG = 1, NG5
96!---jjm
97!    FAC000 = (_ONE_ - FS) * FAC00(LAY)
98!    FAC010 = (_ONE_ - FS) * FAC10(LAY)
99!    FAC100 = FS * FAC00(LAY)
100!    FAC110 = FS * FAC10(LAY)
101!    FAC001 = (_ONE_ - FS) * FAC01(LAY)
102!    FAC011 = (_ONE_ - FS) * FAC11(LAY)
103!    FAC101 = FS * FAC01(LAY)
104!    FAC111 = FS * FAC11(LAY)
105!-----         
106
107    P_TAU (NGS4+IG,I_LAY) = Z_SPECCOMB(I_LAY) *    &
108     !-- DS_000515
109     & ( (1. - Z_FS) *(P_FAC00(I_LAY) * ABSA(IND0(I_LAY)   ,IG) +   &
110     & P_FAC10(I_LAY) * ABSA(IND0(I_LAY)+ 9,IG) +   &
111     & P_FAC01(I_LAY) * ABSA(IND1(I_LAY)   ,IG) +    &
112     & P_FAC11(I_LAY) * ABSA(IND1(I_LAY)+ 9,IG))+   &
113     & Z_FS     *(P_FAC00(I_LAY) * ABSA(IND0(I_LAY)+ 1,IG) +   &
114     & P_FAC10(I_LAY) * ABSA(IND0(I_LAY)+10,IG) +   &
115     & P_FAC01(I_LAY) * ABSA(IND1(I_LAY)+ 1,IG) +   &
116     & P_FAC11(I_LAY) * ABSA(IND1(I_LAY)+10,IG))) + &
117     !     &(Z_FAC000 * ABSA(IND0(I_LAY)   ,IG) +&
118     !     & Z_FAC100 * ABSA(IND0(I_LAY)+ 1,IG) +&
119     !     & Z_FAC010 * ABSA(IND0(I_LAY)+ 9,IG) +&
120     !     & Z_FAC110 * ABSA(IND0(I_LAY)+10,IG) +&
121     !     & Z_FAC001 * ABSA(IND1(I_LAY)   ,IG) +&
122     !     & Z_FAC101 * ABSA(IND1(I_LAY)+ 1,IG) +&
123     !     & Z_FAC011 * ABSA(IND1(I_LAY)+ 9,IG) +&
124     !     & Z_FAC111 * ABSA(IND1(I_LAY)+10,IG))+&
125     !-- DS_000515
126     & P_COLH2O(I_LAY) * &
127     & P_SELFFAC(I_LAY) * (SELFREF(INDS(I_LAY),IG) + &
128     & P_SELFFRAC(I_LAY) *&
129     & (SELFREF(INDS(I_LAY)+1,IG) - SELFREF(INDS(I_LAY),IG)))&
130     & + P_WX(1,I_LAY) * CCL4(IG)&
131     & + P_TAUAERL(I_LAY,5) 
132    PFRAC(NGS4+IG,I_LAY) = FRACREFA(IG,JS) + Z_FS *&
133     & (FRACREFA(IG,JS+1) - FRACREFA(IG,JS)) 
134  ENDDO
135ENDDO
136
137DO I_LAY = K_LAYTROP+1, KLEV
138  Z_SPECCOMB(I_LAY) = P_COLO3(I_LAY) + STRRAT2*P_COLCO2(I_LAY)
139  Z_SPECPARM = P_COLO3(I_LAY)/Z_SPECCOMB(I_LAY)
140  Z_SPECPARM=MIN(P_ONEMINUS,Z_SPECPARM)
141  Z_SPECMULT = 4._JPRB*(Z_SPECPARM)
142  JS = 1 + INT(Z_SPECMULT)
143  Z_FS = MOD(Z_SPECMULT,1.0_JPRB)
144  IND0(I_LAY) = ((K_JP(I_LAY)-13)*5+(K_JT(I_LAY)-1))*NSPB(5) + JS
145  IND1(I_LAY) = ((K_JP(I_LAY)-12)*5+(K_JT1(I_LAY)-1))*NSPB(5) + JS
146  ZFS(I_LAY)=Z_FS
147  IJS(I_LAY)=JS
148ENDDO
149
150!----jjm         
151!  FAC000 = (_ONE_ - FS) * FAC00(LAY)
152!  FAC010 = (_ONE_ - FS) * FAC10(LAY)
153!  FAC100 = FS * FAC00(LAY)
154!  FAC110 = FS * FAC10(LAY)
155!  FAC001 = (_ONE_ - FS) * FAC01(LAY)
156!  FAC011 = (_ONE_ - FS) * FAC11(LAY)
157!  FAC101 = FS * FAC01(LAY)
158!  FAC111 = FS * FAC11(LAY)
159!----         
160DO I_LAY = K_LAYTROP+1, KLEV
161  Z_FS=ZFS(I_LAY)
162  JS=IJS(I_LAY)
163  DO IG = 1, NG5
164!-- DS_000515
165    P_TAU (NGS4+IG,I_LAY) = Z_SPECCOMB(I_LAY) *    &
166     & ( (1. - Z_FS) *(P_FAC00(I_LAY) * ABSB(IND0(I_LAY)  ,IG) +   &
167     & P_FAC10(I_LAY) * ABSB(IND0(I_LAY)+5,IG) +   &
168     & P_FAC01(I_LAY) * ABSB(IND1(I_LAY)  ,IG) +    &
169     & P_FAC11(I_LAY) * ABSB(IND1(I_LAY)+5,IG))+   &
170     & Z_FS     *(P_FAC00(I_LAY) * ABSB(IND0(I_LAY)+1,IG) +   &
171     & P_FAC10(I_LAY) * ABSB(IND0(I_LAY)+6,IG) +   &
172     & P_FAC01(I_LAY) * ABSB(IND1(I_LAY)+1,IG) +   &
173     & P_FAC11(I_LAY) * ABSB(IND1(I_LAY)+6,IG)))   &
174     !     &(Z_FAC000 * ABSB(IND0(I_LAY)  ,IG) +&
175     !     & Z_FAC100 * ABSB(IND0(I_LAY)+1,IG) +&
176     !     & Z_FAC010 * ABSB(IND0(I_LAY)+5,IG) +&
177     !     & Z_FAC110 * ABSB(IND0(I_LAY)+6,IG) +&
178     !     & Z_FAC001 * ABSB(IND1(I_LAY)  ,IG) +&
179     !     & Z_FAC101 * ABSB(IND1(I_LAY)+1,IG) +&
180     !     & Z_FAC011 * ABSB(IND1(I_LAY)+5,IG) +&
181     !     & Z_FAC111 * ABSB(IND1(I_LAY)+6,IG))&
182     !-- DS_000515
183     & + P_WX(1,I_LAY) * CCL4(IG)&
184     & + P_TAUAERL(I_LAY,5) 
185    PFRAC(NGS4+IG,I_LAY) = FRACREFB(IG,JS) + Z_FS *&
186     & (FRACREFB(IG,JS+1) - FRACREFB(IG,JS)) 
187  ENDDO
188ENDDO
189
190IF (LHOOK) CALL DR_HOOK('RRTM_TAUMOL5',1,ZHOOK_HANDLE)
191END SUBROUTINE RRTM_TAUMOL5
Note: See TracBrowser for help on using the repository browser.