source: LMDZ6/trunk/libf/phylmd/rrtm/rrtm_taumol4.F90 @ 5150

Last change on this file since 5150 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_TAUMOL4 (KLEV,P_TAU,&
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 4:  630-700 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  ,NG4   ,NGS3
17USE YOERRTWN , ONLY :      NSPA   ,NSPB
18USE YOERRTA4 , ONLY : ABSA   ,ABSB   ,FRACREFA, FRACREFB,SELFREF,STRRAT1 , STRRAT2
19
20!  Input
21!#include "yoeratm.h"
22
23!      REAL TAUAER(JPLAY)
24
25IMPLICIT NONE
26
27!  Output
28INTEGER(KIND=JPIM),INTENT(IN)    :: KLEV
29REAL(KIND=JPRB)   ,INTENT(OUT)   :: P_TAU(JPGPT,JPLAY)
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!- from AER
49!- from INTFAC     
50!- from INTIND
51!- from PRECISE             
52!- from PROFDATA             
53!- from SELF             
54!- from SP             
55INTEGER(KIND=JPIM) :: IJS(JPLAY)
56REAL(KIND=JPRB) :: ZFS(JPLAY),Z_SPECCOMB(JPLAY)
57INTEGER(KIND=JPIM) :: IND0(JPLAY),IND1(JPLAY),INDS(JPLAY)
58
59INTEGER(KIND=JPIM) :: IG, JS, I_LAY
60
61REAL(KIND=JPRB) :: Z_FAC000, Z_FAC001, Z_FAC010, Z_FAC011, Z_FAC100, Z_FAC101,&
62 & Z_FAC110, Z_FAC111, Z_FS, Z_SPECMULT, Z_SPECPARM 
63REAL(KIND=JPRB) :: ZHOOK_HANDLE
64
65!      EQUIVALENCE (TAUAERL(1,4),TAUAER)
66
67!     Compute the optical depth by interpolating in ln(pressure),
68!     temperature, and appropriate species.  Below LAYTROP, the water
69!     vapor self-continuum is interpolated (in temperature) separately.
70 
71IF (LHOOK) CALL DR_HOOK('RRTM_TAUMOL4',0,ZHOOK_HANDLE)
72DO I_LAY = 1, K_LAYTROP
73  Z_SPECCOMB(I_LAY) = P_COLH2O(I_LAY) + STRRAT1*P_COLCO2(I_LAY)
74  Z_SPECPARM = P_COLH2O(I_LAY)/Z_SPECCOMB(I_LAY)
75  Z_SPECPARM=MIN(P_ONEMINUS,Z_SPECPARM)
76  Z_SPECMULT = 8._JPRB*(Z_SPECPARM)
77  JS = 1 + INT(Z_SPECMULT)
78  Z_FS = MOD(Z_SPECMULT,1.0_JPRB)
79  IND0(I_LAY) = ((K_JP(I_LAY)-1)*5+(K_JT(I_LAY)-1))*NSPA(4) + JS
80  IND1(I_LAY) = (K_JP(I_LAY)*5+(K_JT1(I_LAY)-1))*NSPA(4) + JS
81  INDS(I_LAY) = K_INDSELF(I_LAY)
82
83  ZFS(I_LAY)=Z_FS
84  IJS(I_LAY)=JS
85
86ENDDO
87
88!-- DS_000515
89DO IG = 1, NG4
90  DO I_LAY = 1, K_LAYTROP
91!-- DS_000515
92
93    Z_FS=ZFS(I_LAY)
94    JS=IJS(I_LAY)
95!--jjm         
96!    FAC000 = (_ONE_ - FS) * FAC00(LAY)
97!    FAC010 = (_ONE_ - FS) * FAC10(LAY)
98!    FAC100 = FS * FAC00(LAY)
99!    FAC110 = FS * FAC10(LAY)
100!    FAC001 = (_ONE_ - FS) * FAC01(LAY)
101!    FAC011 = (_ONE_ - FS) * FAC11(LAY)
102!    FAC101 = FS * FAC01(LAY)
103!    FAC111 = FS * FAC11(LAY)
104!---
105
106    P_TAU (NGS3+IG,I_LAY) = Z_SPECCOMB(I_LAY) *    &
107     !-- DS_000515
108     & ((1. - Z_FS) *(P_FAC00(I_LAY) * ABSA(IND0(I_LAY)   ,IG) +   &
109     & P_FAC10(I_LAY) * ABSA(IND0(I_LAY)+ 9,IG) +   &
110     & P_FAC01(I_LAY) * ABSA(IND1(I_LAY)   ,IG) +    &
111     & P_FAC11(I_LAY) * ABSA(IND1(I_LAY)+ 9,IG))+   &
112     & Z_FS     *(P_FAC00(I_LAY) * ABSA(IND0(I_LAY)+ 1,IG) +   &
113     & P_FAC10(I_LAY) * ABSA(IND0(I_LAY)+10,IG) +   &
114     & P_FAC01(I_LAY) * ABSA(IND1(I_LAY)+ 1,IG) +   &
115     & P_FAC11(I_LAY) * ABSA(IND1(I_LAY)+10,IG))) + &
116     !     &(Z_FAC000 * ABSA(IND0(I_LAY)   ,IG) +&
117     !     & Z_FAC100 * ABSA(IND0(I_LAY)+ 1,IG) +&
118     !     & Z_FAC010 * ABSA(IND0(I_LAY)+ 9,IG) +&
119     !     & Z_FAC110 * ABSA(IND0(I_LAY)+10,IG) +&
120     !     & Z_FAC001 * ABSA(IND1(I_LAY)   ,IG) +&
121     !     & Z_FAC101 * ABSA(IND1(I_LAY)+ 1,IG) +&
122     !     & Z_FAC011 * ABSA(IND1(I_LAY)+ 9,IG) +&
123     !     & Z_FAC111 * ABSA(IND1(I_LAY)+10,IG))+&
124     !-- DS_000515
125     & P_COLH2O(I_LAY) * &
126     & P_SELFFAC(I_LAY) * (SELFREF(INDS(I_LAY),IG) + &
127     & P_SELFFRAC(I_LAY) *&
128     & (SELFREF(INDS(I_LAY)+1,IG) - SELFREF(INDS(I_LAY),IG)))&
129     & + P_TAUAERL(I_LAY,4) 
130    PFRAC(NGS3+IG,I_LAY) = FRACREFA(IG,JS) + Z_FS *&
131     & (FRACREFA(IG,JS+1) - FRACREFA(IG,JS)) 
132  ENDDO
133ENDDO
134
135DO I_LAY = K_LAYTROP+1, KLEV
136  Z_SPECCOMB(I_LAY) = P_COLO3(I_LAY) + STRRAT2*P_COLCO2(I_LAY)
137  Z_SPECPARM = P_COLO3(I_LAY)/Z_SPECCOMB(I_LAY)
138  Z_SPECPARM=MIN(P_ONEMINUS,Z_SPECPARM)
139  Z_SPECMULT = 4._JPRB*(Z_SPECPARM)
140  JS = 1 + INT(Z_SPECMULT)
141  Z_FS = MOD(Z_SPECMULT,1.0_JPRB)
142  IF (JS  >  1) THEN
143    JS = JS + 1
144  ELSEIF (Z_FS  >=  0.0024_JPRB) THEN
145    JS = 2
146    Z_FS = (Z_FS - 0.0024_JPRB)/0.9976_JPRB
147  ELSE
148    JS = 1
149    Z_FS = Z_FS/0.0024_JPRB
150  ENDIF
151  IND0(I_LAY) = ((K_JP(I_LAY)-13)*5+(K_JT(I_LAY)-1))*NSPB(4) + JS
152  IND1(I_LAY) = ((K_JP(I_LAY)-12)*5+(K_JT1(I_LAY)-1))*NSPB(4) + JS
153  ZFS(I_LAY)=Z_FS
154  IJS(I_LAY)=JS
155ENDDO
156
157DO I_LAY = K_LAYTROP+1, KLEV
158  Z_FS=ZFS(I_LAY)
159  JS=IJS(I_LAY)
160!--- jjm
161!  FAC000 = (_ONE_ - FS) * FAC00(LAY)
162!  FAC010 = (_ONE_ - FS) * FAC10(LAY)
163!  FAC100 = FS * FAC00(LAY)
164!  FAC110 = FS * FAC10(LAY)
165!  FAC001 = (_ONE_ - FS) * FAC01(LAY)
166!  FAC011 = (_ONE_ - FS) * FAC11(LAY)
167!  FAC101 = FS * FAC01(LAY)
168!  FAC111 = FS * FAC11(LAY)
169!------                   
170  DO IG = 1, NG4
171    P_TAU (NGS3+IG,I_LAY) = Z_SPECCOMB(I_LAY) *   &
172     !-- DS_000515
173     & ( (1. - Z_FS) *(P_FAC00(I_LAY) * ABSB(IND0(I_LAY)  ,IG) +   &
174     & P_FAC10(I_LAY) * ABSB(IND0(I_LAY)+6,IG) +   &
175     & P_FAC01(I_LAY) * ABSB(IND1(I_LAY)  ,IG) +    &
176     & P_FAC11(I_LAY) * ABSB(IND1(I_LAY)+6,IG))+   &
177     & Z_FS     *(P_FAC00(I_LAY) * ABSB(IND0(I_LAY)+1,IG) +   &
178     & P_FAC10(I_LAY) * ABSB(IND0(I_LAY)+7,IG) +   &
179     & P_FAC01(I_LAY) * ABSB(IND1(I_LAY)+1,IG) +   &
180     & P_FAC11(I_LAY) * ABSB(IND1(I_LAY)+7,IG)))   &
181     !     &(Z_FAC000 * ABSB(IND0(I_LAY)   ,IG) +&
182     !     & Z_FAC100 * ABSB(IND0(I_LAY)+ 1,IG) +&
183     !     & Z_FAC010 * ABSB(IND0(I_LAY)+ 6,IG) +&
184     !     & Z_FAC110 * ABSB(IND0(I_LAY)+ 7,IG) +&
185     !     & Z_FAC001 * ABSB(IND1(I_LAY)   ,IG) +&
186     !     & Z_FAC101 * ABSB(IND1(I_LAY)+ 1,IG) +&
187     !     & Z_FAC011 * ABSB(IND1(I_LAY)+ 6,IG) +&
188     !     & Z_FAC111 * ABSB(IND1(I_LAY)+ 7,IG))&
189     !-- DS_000515
190     & + P_TAUAERL(I_LAY,4) 
191    PFRAC(NGS3+IG,I_LAY) = FRACREFB(IG,JS) + Z_FS *&
192     & (FRACREFB(IG,JS+1) - FRACREFB(IG,JS)) 
193  ENDDO
194ENDDO
195
196IF (LHOOK) CALL DR_HOOK('RRTM_TAUMOL4',1,ZHOOK_HANDLE)
197END SUBROUTINE RRTM_TAUMOL4
Note: See TracBrowser for help on using the repository browser.