LMDZ
rrtm_taumol2.F90
Go to the documentation of this file.
1 !----------------------------------------------------------------------------
2 SUBROUTINE rrtm_taumol2 (KLEV,P_TAU,P_COLDRY,&
3  & p_tauaerl,p_fac00,p_fac01,p_fac10,p_fac11,p_forfac,k_jp,k_jt,k_jt1,&
4  & p_colh2o,k_laytrop,p_selffac,p_selffrac,k_indself,pfrac)
5 
6 ! BAND 2: 250-500 cm-1 (low - H2O; high - H2O)
7 
8 ! Modifications
9 ! M.Hamrud 01-Oct-2003 CY28 Cleaning
10 
11 ! D Salmond 2000-05-15 speed-up
12 ! JJMorcrette 2000-05-17 speed-up
13 ! JJMorcrette 2000-07-14 bugfix
14 ! Y. Seity 2006-09-26 Nec optimisation
15 
16 USE parkind1 ,ONLY : jpim ,jprb
17 USE yomhook ,ONLY : lhook, dr_hook
18 
19 USE parrrtm , ONLY : jplay ,jpband ,jpgpt ,ng2 ,ngs1
20 USE yoerrtwn , ONLY : nspa ,nspb
21 USE yoerrta2 , ONLY : absa ,absb ,fracrefa, fracrefb,&
22  & forref ,selfref , refparam
23 USE yoerrtbg2, ONLY : corr1 ,corr2
24 
25 ! Input
26 !#include "yoeratm.h"
27 
28 IMPLICIT NONE
29 
30 INTEGER(KIND=JPIM),INTENT(IN) :: KLEV
31 REAL(KIND=JPRB) ,INTENT(OUT) :: P_TAU(jpgpt,jplay)
32 REAL(KIND=JPRB) ,INTENT(IN) :: P_COLDRY(jplay)
33 REAL(KIND=JPRB) ,INTENT(IN) :: P_TAUAERL(jplay,jpband)
34 REAL(KIND=JPRB) ,INTENT(IN) :: P_FAC00(jplay)
35 REAL(KIND=JPRB) ,INTENT(IN) :: P_FAC01(jplay)
36 REAL(KIND=JPRB) ,INTENT(IN) :: P_FAC10(jplay)
37 REAL(KIND=JPRB) ,INTENT(IN) :: P_FAC11(jplay)
38 REAL(KIND=JPRB) ,INTENT(IN) :: P_FORFAC(jplay)
39 INTEGER(KIND=JPIM),INTENT(IN) :: K_JP(jplay)
40 INTEGER(KIND=JPIM),INTENT(IN) :: K_JT(jplay)
41 INTEGER(KIND=JPIM),INTENT(IN) :: K_JT1(jplay)
42 REAL(KIND=JPRB) ,INTENT(IN) :: P_COLH2O(jplay)
43 INTEGER(KIND=JPIM),INTENT(IN) :: K_LAYTROP
44 REAL(KIND=JPRB) ,INTENT(IN) :: P_SELFFAC(jplay)
45 REAL(KIND=JPRB) ,INTENT(IN) :: P_SELFFRAC(jplay)
46 INTEGER(KIND=JPIM),INTENT(IN) :: K_INDSELF(jplay)
47 REAL(KIND=JPRB) ,INTENT(OUT) :: PFRAC(jpgpt,jplay)
48 ! Output
49 !- from AER
50 !- from INTFAC
51 !- from INTIND
52 !- from PROFDATA
53 !- from SELF
54 !- from SP
55 REAL(KIND=JPRB) :: Z_FC00(jplay),Z_FC01(jplay),Z_FC10(jplay),Z_FC11(jplay)
56 ! REAL TAUAER(JPLAY)
57 REAL(KIND=JPRB) :: Z_FRACINT(jplay)
58 INTEGER(KIND=JPIM) :: IND0(jplay),IND1(jplay),INDS(jplay), INDEX(jplay)
59 
60 INTEGER(KIND=JPIM) :: IFP, IFRAC, IG, JFRAC, I_LAY
61 
62 REAL(KIND=JPRB) :: Z_FP, Z_H2OPARAM, Z_WATER
63 REAL(KIND=JPRB) :: ZHOOK_HANDLE
64 
65 ! EQUIVALENCE (TAUAERL(1,2),TAUAER)
66 
67 ! Compute the optical depth by interpolating in ln(pressure) and
68 ! temperature. Below LAYTROP, the water vapor self-continuum is
69 ! interpolated (in temperature) separately.
70 
71 IF (lhook) CALL dr_hook('RRTM_TAUMOL2',0,zhook_handle)
72 DO i_lay = 1, k_laytrop
73  z_water = 1.e20_jprb * p_colh2o(i_lay) / p_coldry(i_lay)
74  z_h2oparam = z_water/(z_water +.002_jprb)
75 
76 ! DO IFRAC = 2, 12
77 ! IF (H2OPARAM >= REFPARAM(IFRAC)) GO TO 1900
78 ! ENDDO
79 ! 1900 CONTINUE
80 ! FRACINT(LAY) = (H2OPARAM-REFPARAM(IFRAC))/&
81 ! &(REFPARAM(IFRAC-1)-REFPARAM(IFRAC))
82  ifrac=index(i_lay)
83  IF (z_h2oparam >= refparam(2)) THEN
84  ifrac=2
85  ELSE
86 !cdir unroll=11
87  DO jfrac = 2, 12
88  IF (z_h2oparam < refparam(jfrac)) THEN
89  ifrac=jfrac+1
90  ENDIF
91  ENDDO
92  ENDIF
93 
94 !---- JJM_000714
95 ! set above IFRAC instead of INDEX(I_LAY), store now - NEC jh
96 ! IFRAC=INDEX(I_LAY)
97  index(i_lay)=ifrac
98 
99  z_fracint(i_lay) = (z_h2oparam-refparam(ifrac))/&
100  & (refparam(ifrac-1)-refparam(ifrac))
101 ENDDO
102 
103 DO i_lay = 1, k_laytrop
104 
105  z_fp = p_fac11(i_lay) + p_fac01(i_lay)
106  ifp = 2.e2_jprb*z_fp+0.5_jprb
107 
108 !---MI 981104
109 ! IF (IFP.LE.0) IFP=0
110 
111  ifp=max(0,ifp)
112 
113  z_fc00(i_lay) = p_fac00(i_lay) * corr2(ifp)
114  z_fc10(i_lay) = p_fac10(i_lay) * corr2(ifp)
115  z_fc01(i_lay) = p_fac01(i_lay) * corr1(ifp)
116  z_fc11(i_lay) = p_fac11(i_lay) * corr1(ifp)
117  ind0(i_lay) = ((k_jp(i_lay)-1)*5+(k_jt(i_lay)-1))*nspa(2) + 1
118  ind1(i_lay) = (k_jp(i_lay)*5+(k_jt1(i_lay)-1))*nspa(2) + 1
119  inds(i_lay) = k_indself(i_lay)
120 ENDDO
121 
122 !-- DS_000515
123 DO ig = 1, ng2
124  DO i_lay = 1, k_laytrop
125 !-- JJM_000714
126  ifrac=index(i_lay)
127 !-- DS_000515
128  p_tau(ngs1+ig,i_lay) = p_colh2o(i_lay) *&
129  & (z_fc00(i_lay) * absa(ind0(i_lay) ,ig) +&
130  & z_fc10(i_lay) * absa(ind0(i_lay)+1,ig) +&
131  & z_fc01(i_lay) * absa(ind1(i_lay) ,ig) +&
132  & z_fc11(i_lay) * absa(ind1(i_lay)+1,ig) +&
133  & p_selffac(i_lay) * (selfref(inds(i_lay),ig) + &
134  & p_selffrac(i_lay) *&
135  & (selfref(inds(i_lay)+1,ig) - selfref(inds(i_lay),ig)))&
136  & + p_forfac(i_lay) * forref(ig) ) &
137  & + p_tauaerl(i_lay,2)
138  pfrac(ngs1+ig,i_lay) = fracrefa(ig,ifrac) + z_fracint(i_lay) *&
139  & (fracrefa(ig,ifrac-1)-fracrefa(ig,ifrac))
140  ENDDO
141 ENDDO
142 
143 DO i_lay = k_laytrop+1, klev
144  z_fp = p_fac11(i_lay) + p_fac01(i_lay)
145  ifp = 2.e2_jprb*z_fp+0.5_jprb
146 
147 !---MI 981104
148  IF (ifp <= 0) ifp=0
149 
150  z_fc00(i_lay) = p_fac00(i_lay) * corr2(ifp)
151  z_fc10(i_lay) = p_fac10(i_lay) * corr2(ifp)
152  z_fc01(i_lay) = p_fac01(i_lay) * corr1(ifp)
153  z_fc11(i_lay) = p_fac11(i_lay) * corr1(ifp)
154  ind0(i_lay) = ((k_jp(i_lay)-13)*5+(k_jt(i_lay)-1))*nspb(2) + 1
155  ind1(i_lay) = ((k_jp(i_lay)-12)*5+(k_jt1(i_lay)-1))*nspb(2) + 1
156 ENDDO
157 
158 !-- JJM_000517
159 DO ig = 1, ng2
160  DO i_lay = k_laytrop+1, klev
161 !-- JJM_000517
162  p_tau(ngs1+ig,i_lay) = p_colh2o(i_lay) *&
163  & (z_fc00(i_lay) * absb(ind0(i_lay) ,ig) +&
164  & z_fc10(i_lay) * absb(ind0(i_lay)+1,ig) +&
165  & z_fc01(i_lay) * absb(ind1(i_lay) ,ig) +&
166  & z_fc11(i_lay) * absb(ind1(i_lay)+1,ig)&
167  & + p_forfac(i_lay) * forref(ig) ) &
168  & + p_tauaerl(i_lay,2)
169  pfrac(ngs1+ig,i_lay) = fracrefb(ig)
170  ENDDO
171 ENDDO
172 
173 IF (lhook) CALL dr_hook('RRTM_TAUMOL2',1,zhook_handle)
174 END SUBROUTINE rrtm_taumol2
real(kind=jprb), dimension(13) refparam
Definition: yoerrta2.F90:18
real(kind=jprb), dimension(0:200) corr2
Definition: yoerrtbg2.F90:16
integer(kind=jpim), parameter jpgpt
Definition: parrrtm.F90:21
integer(kind=jpim), parameter jpband
Definition: parrrtm.F90:18
real(kind=jprb), dimension(ng2) forref
Definition: yoerrta2.F90:21
real(kind=jprb), dimension(235, ng2) absb
Definition: yoerrta2.F90:20
integer, parameter jprb
Definition: parkind1.F90:31
integer(kind=jpim), dimension(16) nspb
Definition: yoerrtwn.F90:13
integer(kind=jpim), dimension(16) nspa
Definition: yoerrtwn.F90:12
logical lhook
Definition: yomhook.F90:12
real(kind=jprb), dimension(65, ng2) absa
Definition: yoerrta2.F90:19
integer(kind=jpim), parameter ng2
Definition: parrrtm.F90:24
real(kind=jprb), dimension(ng2, 13) fracrefa
Definition: yoerrta2.F90:18
real(kind=jprb), dimension(10, ng2) selfref
Definition: yoerrta2.F90:21
integer(kind=jpim), parameter jplay
Definition: parrrtm.F90:15
subroutine dr_hook(CDNAME, KSWITCH, PKEY)
Definition: yomhook.F90:17
real(kind=jprb), dimension(ng2) fracrefb
Definition: yoerrta2.F90:18
integer, parameter jpim
Definition: parkind1.F90:13
subroutine rrtm_taumol2(KLEV, P_TAU, P_COLDRY, P_TAUAERL, P_FAC00, P_FAC01, P_FAC10, P_FAC11, P_FORFAC, K_JP, K_JT, K_JT1, P_COLH2O, K_LAYTROP, P_SELFFAC, P_SELFFRAC, K_INDSELF, PFRAC)
Definition: rrtm_taumol2.F90:5
integer(kind=jpim), parameter ngs1
Definition: parrrtm.F90:40
real(kind=jprb), dimension(0:200) corr1
Definition: yoerrtbg2.F90:15