source: LMDZ5/branches/testing/libf/phymar/rrtm_taumol9.F90 @ 3670

Last change on this file since 3670 was 2160, checked in by Laurent Fairhead, 10 years ago

Merged trunk changes -r2070:2158 into testing branch. Compilation problems introduced by revision r2155 have been corrected by hand

File size: 5.6 KB
Line 
1!----------------------------------------------------------------------------
2SUBROUTINE RRTM_TAUMOL9 (KLEV,TAU,&
3  &TAUAERL,FAC00,FAC01,FAC10,FAC11,JP,JT,JT1,ONEMINUS,&
4  &COLH2O,COLN2O,COLCH4,LAYTROP,LAYSWTCH,LAYLOW,SELFFAC,SELFFRAC,INDSELF,PFRAC)
5
6!     BAND 9:  1180-1390 cm-1 (low - H2O,CH4; high - CH4)
7
8! Modifications
9!
10!     D Salmond   2000-05-15 speed-up
11!     JJMorcrette 2000-05-17 speed-up
12
13
14#include "tsmbkind.h"
15
16USE PARRRTM  , ONLY : JPLAY  ,JPBAND ,JPGPT  ,JPXSEC  , NGS8
17USE YOERRTWN , ONLY : NG     ,NSPA   ,NSPB
18USE YOERRTA9 , ONLY : NG9    ,ABSA   ,ABSB   ,FRACREFA, FRACREFB,&
19            &KA      , KB     ,SELFREF,ABSN2O  , CH4REF  ,&
20            &ETAREF  , H2OREF ,N2OREF ,STRRAT
21
22!  Input
23!#include "yoeratm.h"
24
25
26IMPLICIT NONE
27
28!  Output
29REAL_B :: TAU   (JPGPT,JPLAY)
30
31!     DUMMY INTEGER SCALARS
32INTEGER_M :: KLEV
33
34!- from AER
35REAL_B :: TAUAERL(JPLAY,JPBAND)
36
37!- from INTFAC     
38REAL_B :: FAC00(JPLAY)
39REAL_B :: FAC01(JPLAY)
40REAL_B :: FAC10(JPLAY)
41REAL_B :: FAC11(JPLAY)
42
43!- from INTIND
44INTEGER_M :: JP(JPLAY)
45INTEGER_M :: JT(JPLAY)
46INTEGER_M :: JT1(JPLAY)
47
48!- from PRECISE             
49REAL_B :: ONEMINUS
50
51!- from PROFDATA             
52REAL_B :: COLH2O(JPLAY)
53REAL_B :: COLN2O(JPLAY)
54REAL_B :: COLCH4(JPLAY)
55INTEGER_M :: LAYTROP
56INTEGER_M :: LAYSWTCH
57INTEGER_M :: LAYLOW
58
59!- from SELF             
60REAL_B :: SELFFAC(JPLAY)
61REAL_B :: SELFFRAC(JPLAY)
62INTEGER_M :: INDSELF(JPLAY)
63
64!- from SP             
65REAL_B :: PFRAC(JPGPT,JPLAY)
66
67INTEGER_M :: JFRAC(JPLAY)
68REAL_B :: FFRAC(JPLAY),ZFS(JPLAY),SPECCOMB(JPLAY)
69INTEGER_M :: IND0(JPLAY),IND1(JPLAY),INDS(JPLAY),IIOFF(JPLAY)
70
71!      REAL TAUAER(JPLAY)
72REAL_B :: N2OMULT(JPLAY)
73
74!     LOCAL INTEGER SCALARS
75INTEGER_M :: IG, IOFF, JS, LAY, NS
76
77!     LOCAL REAL SCALARS
78REAL_B :: COLREF1, COLREF2, CURRN2O, FAC000, FAC001,&
79          &FAC010, FAC011, FAC100, FAC101, FAC110, FAC111, &
80          &FP, FS, RATIO, SPECMULT, SPECPARM, WCOMB1, &
81          &WCOMB2
82
83!      EQUIVALENCE (TAUAERL(1,9),TAUAER)
84
85IOFF = 0
86
87!     Compute the optical depth by interpolating in ln(pressure),
88!     temperature, and appropriate species.  Below LAYTROP, the water
89!     vapor self-continuum is interpolated (in temperature) separately.
90 
91DO LAY = 1, LAYTROP
92  SPECCOMB(LAY) = COLH2O(LAY) + STRRAT*COLCH4(LAY)
93  SPECPARM = COLH2O(LAY)/SPECCOMB(LAY)
94  SPECPARM=MIN(ONEMINUS,SPECPARM)
95  SPECMULT = 8._JPRB*(SPECPARM)
96  JS = 1 + INT(SPECMULT)
97  JFRAC(LAY) = JS
98  FS = MOD(SPECMULT,_ONE_)
99  FFRAC(LAY) = FS
100  IF (JS  ==  8) THEN
101    IF (FS.LE. 0.68_JPRB) THEN
102      FS = FS/0.68_JPRB
103    ELSEIF (FS  <=  0.92_JPRB) THEN
104      JS = JS + 1
105      FS = (FS-0.68_JPRB)/0.24_JPRB
106    ELSE
107      JS = JS + 2
108      FS = (FS-0.92_JPRB)/0.08_JPRB
109    ENDIF
110  ELSEIF (JS  == 9) THEN
111    JS = 10
112    FS = _ONE_
113    JFRAC(LAY) = 8
114    FFRAC(LAY) = _ONE_
115  ENDIF
116  FP = FAC01(LAY) + FAC11(LAY)
117  NS = JS + INT(FS + _HALF_)
118  IND0(LAY) = ((JP(LAY)-1)*5+(JT(LAY)-1))*NSPA(9) + JS
119  IND1(LAY) = (JP(LAY)*5+(JT1(LAY)-1))*NSPA(9) + JS
120  INDS(LAY) = INDSELF(LAY)
121  IF (LAY  ==  LAYLOW) IOFF = NG9
122  IF (LAY  ==  LAYSWTCH) IOFF = 2*NG9
123  COLREF1 = N2OREF(JP(LAY))
124  COLREF2 = N2OREF(JP(LAY)+1)
125  IF (NS  ==  11) THEN
126    WCOMB1 = _ONE_/H2OREF(JP(LAY))
127    WCOMB2 = _ONE_/H2OREF(JP(LAY)+1)
128  ELSE
129    WCOMB1 = (_ONE_-ETAREF(NS))/(STRRAT * CH4REF(JP(LAY)))
130    WCOMB2 = (_ONE_-ETAREF(NS))/(STRRAT * CH4REF(JP(LAY)+1))
131  ENDIF
132  RATIO = (COLREF1*WCOMB1)+FP*((COLREF2*WCOMB2)-(COLREF1*WCOMB1))
133  CURRN2O = SPECCOMB(LAY) * RATIO
134  N2OMULT(LAY) = COLN2O(LAY) - CURRN2O
135
136  ZFS(LAY)=FS
137  IIOFF(LAY)=IOFF
138
139ENDDO
140
141!-- DS_000515
142DO IG = 1, NG9
143  DO LAY = 1, LAYTROP
144!-- DS_000515
145
146    FS=ZFS(LAY)
147    IOFF=IIOFF(LAY)
148!---jjm
149!    FAC000 = (_ONE_ - FS) * FAC00(LAY)
150!    FAC010 = (_ONE_ - FS) * FAC10(LAY)
151!    FAC100 = FS * FAC00(LAY)
152!    FAC110 = FS * FAC10(LAY)
153!    FAC001 = (_ONE_ - FS) * FAC01(LAY)
154!    FAC011 = (_ONE_ - FS) * FAC11(LAY)
155!    FAC101 = FS * FAC01(LAY)
156!    FAC111 = FS * FAC11(LAY)
157!------         
158
159    TAU (NGS8+IG,LAY) = SPECCOMB(LAY) *&
160!-- DS_000515
161!     &(FAC000 * ABSA(IND0(LAY)   ,IG) +&
162!     & FAC100 * ABSA(IND0(LAY)+ 1,IG) +&
163!     & FAC010 * ABSA(IND0(LAY)+11,IG) +&
164!     & FAC110 * ABSA(IND0(LAY)+12,IG) +&
165!     & FAC001 * ABSA(IND1(LAY)   ,IG) +&
166!     & FAC101 * ABSA(IND1(LAY)+ 1,IG) +&
167!     & FAC011 * ABSA(IND1(LAY)+11,IG) +&
168!     & FAC111 * ABSA(IND1(LAY)+12,IG))+&
169     &( (1. - FS) *(FAC00(LAY) * ABSA(IND0(LAY)   ,IG) +   &
170     &              FAC10(LAY) * ABSA(IND0(LAY)+11,IG) +   &
171     &              FAC01(LAY) * ABSA(IND1(LAY)   ,IG) +   &
172     &              FAC11(LAY) * ABSA(IND1(LAY)+11,IG))+   &
173     &     FS     *(FAC00(LAY) * ABSA(IND0(LAY)+ 1,IG) +   &
174     &              FAC10(LAY) * ABSA(IND0(LAY)+12,IG) +   &
175     &              FAC01(LAY) * ABSA(IND1(LAY)+ 1,IG) +   &
176     &              FAC11(LAY) * ABSA(IND1(LAY)+12,IG))) + &
177!-- DS_000515
178     &COLH2O(LAY) * &
179     &SELFFAC(LAY) * (SELFREF(INDS(LAY),IG) + &
180     &SELFFRAC(LAY) *&
181     &(SELFREF(INDS(LAY)+1,IG) - SELFREF(INDS(LAY),IG)))&
182     &+ N2OMULT(LAY) * ABSN2O(IG+IOFF)&
183     &+ TAUAERL(LAY,9)
184    PFRAC(NGS8+IG,LAY) = FRACREFA(IG,JFRAC(LAY)) + FFRAC(LAY) *&
185     &(FRACREFA(IG,JFRAC(LAY)+1) - FRACREFA(IG,JFRAC(LAY)))
186  ENDDO
187ENDDO
188
189DO LAY = LAYTROP+1, KLEV
190  IND0(LAY) = ((JP(LAY)-13)*5+(JT(LAY)-1))*NSPB(9) + 1
191  IND1(LAY) = ((JP(LAY)-12)*5+(JT1(LAY)-1))*NSPB(9) + 1
192ENDDO
193
194!-- JJM_000517
195DO IG = 1, NG9
196  DO LAY = LAYTROP+1, KLEV
197!-- JJM_000517
198    TAU (NGS8+IG,LAY) = COLCH4(LAY) *&
199     &(FAC00(LAY) * ABSB(IND0(LAY)  ,IG) +&
200     & FAC10(LAY) * ABSB(IND0(LAY)+1,IG) +&
201     & FAC01(LAY) * ABSB(IND1(LAY)  ,IG) +&
202     & FAC11(LAY) * ABSB(IND1(LAY)+1,IG))&
203     &+ TAUAERL(LAY,9)
204    PFRAC(NGS8+IG,LAY) = FRACREFB(IG)
205  ENDDO
206ENDDO
207
208RETURN
209END SUBROUTINE RRTM_TAUMOL9
Note: See TracBrowser for help on using the repository browser.