LMDZ
rrtm_taumol1.F90
Go to the documentation of this file.
1 !******************************************************************************
2 ! *
3 ! Optical depths developed for the *
4 ! *
5 ! RAPID RADIATIVE TRANSFER MODEL (RRTM) *
6 ! *
7 ! ATMOSPHERIC AND ENVIRONMENTAL RESEARCH, INC. *
8 ! 840 MEMORIAL DRIVE *
9 ! CAMBRIDGE, MA 02139 *
10 ! *
11 ! ELI J. MLAWER *
12 ! STEVEN J. TAUBMAN *
13 ! SHEPARD A. CLOUGH *
14 ! *
15 ! email: mlawer@aer.com *
16 ! *
17 ! The authors wish to acknowledge the contributions of the *
18 ! following people: Patrick D. Brown, Michael J. Iacono, *
19 ! Ronald E. Farren, Luke Chen, Robert Bergstrom. *
20 ! *
21 !******************************************************************************
22 ! Modified by: *
23 ! JJ Morcrette 980714 ECMWF for use on ECMWF's Fujitsu VPP770 *
24 ! Reformatted for F90 by JJMorcrette, ECMWF *
25 ! - replacing COMMONs by MODULEs *
26 ! - changing labelled to unlabelled DO loops *
27 ! - creating set-up routines for all block data statements *
28 ! - reorganizing the parameter statements *
29 ! - passing KLEV as argument *
30 ! - suppressing some equivalencing *
31 ! *
32 ! D Salmond 9907 ECMWF Speed-up modifications *
33 ! D Salmond 000515 ECMWF Speed-up modifications *
34 !******************************************************************************
35 ! TAUMOL *
36 ! *
37 ! This file contains the subroutines TAUGBn (where n goes from *
38 ! 1 to 16). TAUGBn calculates the optical depths and Planck fractions *
39 ! per g-value and layer for band n. *
40 ! *
41 ! Output: optical depths (unitless) *
42 ! fractions needed to compute Planck functions at every layer *
43 ! and g-value *
44 ! *
45 ! COMMON /TAUGCOM/ TAUG(MXLAY,MG) *
46 ! COMMON /PLANKG/ FRACS(MXLAY,MG) *
47 ! *
48 ! Input *
49 ! *
50 ! COMMON /FEATURES/ NG(NBANDS),NSPA(NBANDS),NSPB(NBANDS) *
51 ! COMMON /PRECISE/ ONEMINUS *
52 ! COMMON /PROFILE/ NLAYERS,PAVEL(MXLAY),TAVEL(MXLAY), *
53 ! & PZ(0:MXLAY),TZ(0:MXLAY),TBOUND *
54 ! COMMON /PROFDATA/ LAYTROP,LAYSWTCH,LAYLOW, *
55 ! & COLH2O(MXLAY),COLCO2(MXLAY), *
56 ! & COLO3(MXLAY),COLN2O(MXLAY),COLCH4(MXLAY), *
57 ! & COLO2(MXLAY),CO2MULT(MXLAY) *
58 ! COMMON /INTFAC/ FAC00(MXLAY),FAC01(MXLAY), *
59 ! & FAC10(MXLAY),FAC11(MXLAY) *
60 ! COMMON /INTIND/ JP(MXLAY),JT(MXLAY),JT1(MXLAY) *
61 ! COMMON /SELF/ SELFFAC(MXLAY), SELFFRAC(MXLAY), INDSELF(MXLAY) *
62 ! *
63 ! Description: *
64 ! NG(IBAND) - number of g-values in band IBAND *
65 ! NSPA(IBAND) - for the lower atmosphere, the number of reference *
66 ! atmospheres that are stored for band IBAND per *
67 ! pressure level and temperature. Each of these *
68 ! atmospheres has different relative amounts of the *
69 ! key species for the band (i.e. different binary *
70 ! species parameters). *
71 ! NSPB(IBAND) - same for upper atmosphere *
72 ! ONEMINUS - since problems are caused in some cases by interpolation *
73 ! parameters equal to or greater than 1, for these cases *
74 ! these parameters are set to this value, slightly < 1. *
75 ! PAVEL - layer pressures (mb) *
76 ! TAVEL - layer temperatures (degrees K) *
77 ! PZ - level pressures (mb) *
78 ! TZ - level temperatures (degrees K) *
79 ! LAYTROP - layer at which switch is made from one combination of *
80 ! key species to another *
81 ! COLH2O, COLCO2, COLO3, COLN2O, COLCH4 - column amounts of water *
82 ! vapor,carbon dioxide, ozone, nitrous ozide, methane, *
83 ! respectively (molecules/cm**2) *
84 ! CO2MULT - for bands in which carbon dioxide is implemented as a *
85 ! trace species, this is the factor used to multiply the *
86 ! band's average CO2 absorption coefficient to get the added *
87 ! contribution to the optical depth relative to 355 ppm. *
88 ! FACij(LAY) - for layer LAY, these are factors that are needed to *
89 ! compute the interpolation factors that multiply the *
90 ! appropriate reference k-values. A value of 0 (1) for *
91 ! i,j indicates that the corresponding factor multiplies *
92 ! reference k-value for the lower (higher) of the two *
93 ! appropriate temperatures, and altitudes, respectively. *
94 ! JP - the index of the lower (in altitude) of the two appropriate *
95 ! reference pressure levels needed for interpolation *
96 ! JT, JT1 - the indices of the lower of the two appropriate reference *
97 ! temperatures needed for interpolation (for pressure *
98 ! levels JP and JP+1, respectively) *
99 ! SELFFAC - scale factor needed to water vapor self-continuum, equals *
100 ! (water vapor density)/(atmospheric density at 296K and *
101 ! 1013 mb) *
102 ! SELFFRAC - factor needed for temperature interpolation of reference *
103 ! water vapor self-continuum data *
104 ! INDSELF - index of the lower of the two appropriate reference *
105 ! temperatures needed for the self-continuum interpolation *
106 ! *
107 ! Data input *
108 ! COMMON /Kn/ KA(NSPA(n),5,13,MG), KB(NSPB(n),5,13:59,MG), SELFREF(10,MG) *
109 ! (note: n is the band number) *
110 ! *
111 ! Description: *
112 ! KA - k-values for low reference atmospheres (no water vapor *
113 ! self-continuum) (units: cm**2/molecule) *
114 ! KB - k-values for high reference atmospheres (all sources) *
115 ! (units: cm**2/molecule) *
116 ! SELFREF - k-values for water vapor self-continuum for reference *
117 ! atmospheres (used below LAYTROP) *
118 ! (units: cm**2/molecule) *
119 ! *
120 ! DIMENSION ABSA(65*NSPA(n),MG), ABSB(235*NSPB(n),MG) *
121 ! EQUIVALENCE (KA,ABSA),(KB,ABSB) *
122 ! *
123 !******************************************************************************
124 
125 SUBROUTINE rrtm_taumol1 (KLEV,P_TAU,&
126  & p_tauaerl,p_fac00,p_fac01,p_fac10,p_fac11,p_forfac,k_jp,k_jt,k_jt1,&
127  & p_colh2o,k_laytrop,p_selffac,p_selffrac,k_indself,pfrac)
129 ! Written by Eli J. Mlawer, Atmospheric & Environmental Research.
130 ! Revised by Michael J. Iacono, Atmospheric & Environmental Research.
131 
132 ! BAND 1: 10-250 cm-1 (low - H2O; high - H2O)
133 
134 ! Modifications
135 ! M.Hamrud 01-Oct-2003 CY28 Cleaning
136 
137 ! D Salmond 2000-05-15 speed-up
138 ! JJMorcrette 2000-05-17 speed-up
139 
140 USE parkind1 ,ONLY : jpim ,jprb
141 USE yomhook ,ONLY : lhook, dr_hook
142 
143 USE parrrtm , ONLY : jplay ,jpband ,jpgpt ,ng1
144 USE yoerrtwn , ONLY : nspa ,nspb
145 USE yoerrta1 , ONLY : absa ,absb ,fracrefa, fracrefb,&
146  & forref ,selfref
147 
148 !#include "yoeratm.h"
149 
150 ! REAL TAUAER(JPLAY)
151 
152 IMPLICIT NONE
153 
154 ! Output
155 INTEGER(KIND=JPIM),INTENT(IN) :: KLEV
156 REAL(KIND=JPRB) ,INTENT(OUT) :: P_TAU(jpgpt,jplay)
157 REAL(KIND=JPRB) ,INTENT(IN) :: P_TAUAERL(jplay,jpband)
158 REAL(KIND=JPRB) ,INTENT(IN) :: P_FAC00(jplay)
159 REAL(KIND=JPRB) ,INTENT(IN) :: P_FAC01(jplay)
160 REAL(KIND=JPRB) ,INTENT(IN) :: P_FAC10(jplay)
161 REAL(KIND=JPRB) ,INTENT(IN) :: P_FAC11(jplay)
162 REAL(KIND=JPRB) ,INTENT(IN) :: P_FORFAC(jplay)
163 INTEGER(KIND=JPIM),INTENT(IN) :: K_JP(jplay)
164 INTEGER(KIND=JPIM),INTENT(IN) :: K_JT(jplay)
165 INTEGER(KIND=JPIM),INTENT(IN) :: K_JT1(jplay)
166 REAL(KIND=JPRB) ,INTENT(IN) :: P_COLH2O(jplay)
167 INTEGER(KIND=JPIM),INTENT(IN) :: K_LAYTROP
168 REAL(KIND=JPRB) ,INTENT(IN) :: P_SELFFAC(jplay)
169 REAL(KIND=JPRB) ,INTENT(IN) :: P_SELFFRAC(jplay)
170 INTEGER(KIND=JPIM),INTENT(IN) :: K_INDSELF(jplay)
171 REAL(KIND=JPRB) ,INTENT(OUT) :: PFRAC(jpgpt,jplay)
172 !- from AER
173 !- from INTFAC
174 !- from INTIND
175 !- from PRECISE
176 !- from PROFDATA
177 !- from SELF
178 !- from SP
179 INTEGER(KIND=JPIM) :: IND0(jplay),IND1(jplay),INDS(jplay)
180 
181 INTEGER(KIND=JPIM) :: IG, I_LAY
182 REAL(KIND=JPRB) :: ZHOOK_HANDLE
183 
184 ! EQUIVALENCE (TAUAERL(1,1),TAUAER)
185 
186 ! Compute the optical depth by interpolating in ln(pressure) and
187 ! temperature. Below LAYTROP, the water vapor self-continuum
188 ! is interpolated (in temperature) separately.
189 
190 IF (lhook) CALL dr_hook('RRTM_TAUMOL1',0,zhook_handle)
191 !--ajout OB
192 IF (k_laytrop.GT.100) THEN
193 print *,'ATTENTION KLAY_TROP > 100 PROBLEME ARRAY DANS RRTM ON ARRETE'
194 stop
195 !--fin ajout OB
196 ENDIF
197 DO i_lay = 1, k_laytrop
198  ind0(i_lay) = ((k_jp(i_lay)-1)*5+(k_jt(i_lay)-1))*nspa(1) + 1
199  ind1(i_lay) = (k_jp(i_lay)*5+(k_jt1(i_lay)-1))*nspa(1) + 1
200  inds(i_lay) = k_indself(i_lay)
201 ENDDO
202 
203 DO ig = 1, ng1
204  DO i_lay = 1, k_laytrop
205 !-- DS_000515
206  p_tau(ig,i_lay) = p_colh2o(i_lay) *&
207  & (p_fac00(i_lay) * absa(ind0(i_lay) ,ig) +&
208  & p_fac10(i_lay) * absa(ind0(i_lay)+1,ig) +&
209  & p_fac01(i_lay) * absa(ind1(i_lay) ,ig) +&
210  & p_fac11(i_lay) * absa(ind1(i_lay)+1,ig) +&
211  & p_selffac(i_lay) * (selfref(inds(i_lay),ig) + &
212  & p_selffrac(i_lay) *&
213  & (selfref(inds(i_lay)+1,ig) - selfref(inds(i_lay),ig)))&
214  & + p_forfac(i_lay) * forref(ig) ) &
215  & + p_tauaerl(i_lay,1)
216  pfrac(ig,i_lay) = fracrefa(ig)
217  ENDDO
218 ENDDO
219 
220 DO i_lay = k_laytrop+1, klev
221  ind0(i_lay) = ((k_jp(i_lay)-13)*5+(k_jt(i_lay)-1))*nspb(1) + 1
222  ind1(i_lay) = ((k_jp(i_lay)-12)*5+(k_jt1(i_lay)-1))*nspb(1) + 1
223 ENDDO
224 
225 !-- JJM000517
226 DO ig = 1, ng1
227  DO i_lay = k_laytrop+1, klev
228 !-- JJM000517
229  p_tau(ig,i_lay) = p_colh2o(i_lay) *&
230  & (p_fac00(i_lay) * absb(ind0(i_lay) ,ig) +&
231  & p_fac10(i_lay) * absb(ind0(i_lay)+1,ig) +&
232  & p_fac01(i_lay) * absb(ind1(i_lay) ,ig) +&
233  & p_fac11(i_lay) * absb(ind1(i_lay)+1,ig)&
234  & + p_forfac(i_lay) * forref(ig) ) &
235  & + p_tauaerl(i_lay,1)
236  pfrac(ig,i_lay) = fracrefb(ig)
237  ENDDO
238 ENDDO
239 
240 IF (lhook) CALL dr_hook('RRTM_TAUMOL1',1,zhook_handle)
241 END SUBROUTINE rrtm_taumol1
real(kind=jprb), dimension(65, ng1) absa
Definition: yoerrta1.F90:17
real(kind=jprb), dimension(235, ng1) absb
Definition: yoerrta1.F90:18
real(kind=jprb), dimension(ng1) fracrefb
Definition: yoerrta1.F90:16
integer(kind=jpim), parameter jpgpt
Definition: parrrtm.F90:21
integer(kind=jpim), parameter ng1
Definition: parrrtm.F90:23
integer(kind=jpim), parameter jpband
Definition: parrrtm.F90:18
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
real(kind=jprb), dimension(ng1) fracrefa
Definition: yoerrta1.F90:16
logical lhook
Definition: yomhook.F90:12
real(kind=jprb), dimension(ng1) forref
Definition: yoerrta1.F90:19
integer(kind=jpim), parameter jplay
Definition: parrrtm.F90:15
subroutine dr_hook(CDNAME, KSWITCH, PKEY)
Definition: yomhook.F90:17
subroutine rrtm_taumol1(KLEV, P_TAU, 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)
integer, parameter jpim
Definition: parkind1.F90:13
real(kind=jprb), dimension(10, ng1) selfref
Definition: yoerrta1.F90:19