source: LMDZ6/trunk/libf/phylmd/ecrad/ifsrrtm/rrtm_taumol6.F90 @ 5423

Last change on this file since 5423 was 4773, checked in by idelkadi, 13 months ago
  • Update of Ecrad in LMDZ The same organization of the Ecrad offline version is retained in order to facilitate the updating of Ecrad in LMDZ and the comparison between online and offline results. version 1.6.1 of Ecrad (https://github.com/lguez/ecrad.git)
  • Implementation of the double call of Ecrad in LMDZ


File size: 6.0 KB
RevLine 
[4773]1!----------------------------------------------------------------------------
2SUBROUTINE RRTM_TAUMOL6 (KIDIA,KFDIA,KLEV,P_TAU,P_WX,&
3 & P_TAUAERL,P_FAC00,P_FAC01,P_FAC10,P_FAC11,P_FORFAC,P_FORFRAC,K_INDFOR,K_JP,K_JT,K_JT1,&
4 & P_COLH2O,P_COLCO2,P_COLDRY,K_LAYTROP,P_SELFFAC,P_SELFFRAC,K_INDSELF,PFRAC,PMINORFRAC,KINDMINOR) 
5
6!     BAND 6:  820-980 cm-1 (low - H2O; high - nothing)
7
8!     AUTHOR.
9!     -------
10!      JJMorcrette, ECMWF
11
12!     MODIFICATIONS.
13!     --------------
14!      M.Hamrud      01-Oct-2003 CY28 Cleaning
15!      NEC           25-Oct-2007 Optimisations
16!      JJMorcrette 20110613 flexible number of g-points
17!      ABozzo 201306 updated to rrtmg v4.85
18!     band 6:  820-980 cm-1 (low key - h2o; low minor - co2)
19!                           (high key - nothing; high minor - cfc11, cfc12)
20! ---------------------------------------------------------------------------
21
22USE PARKIND1  ,ONLY : JPIM     ,JPRB
23USE YOMHOOK   ,ONLY : LHOOK, DR_HOOK, JPHOOK
24
25USE PARRRTM  , ONLY : JPBAND ,JPXSEC
26USE YOERRTM  , ONLY : JPGPT  ,NG6   ,NGS5
27USE YOERRTWN , ONLY : NSPA   
28USE YOERRTA6 , ONLY : ABSA   ,KA_MCO2 ,CFC11ADJ , CFC12  ,&
29 & FRACREFA,SELFREF,FORREF 
30USE YOERRTRF, ONLY : CHI_MLS
31
32IMPLICIT NONE
33
34INTEGER(KIND=JPIM),INTENT(IN)    :: KIDIA
35INTEGER(KIND=JPIM),INTENT(IN)    :: KFDIA
36INTEGER(KIND=JPIM),INTENT(IN)    :: KLEV
37REAL(KIND=JPRB)   ,INTENT(OUT)   :: P_TAU(KIDIA:KFDIA,JPGPT,KLEV)
38REAL(KIND=JPRB)   ,INTENT(IN)    :: P_WX(KIDIA:KFDIA,JPXSEC,KLEV) ! Amount of trace gases
39REAL(KIND=JPRB)   ,INTENT(IN)    :: P_TAUAERL(KIDIA:KFDIA,KLEV,JPBAND)
40REAL(KIND=JPRB)   ,INTENT(IN)    :: P_FAC00(KIDIA:KFDIA,KLEV)
41REAL(KIND=JPRB)   ,INTENT(IN)    :: P_FAC01(KIDIA:KFDIA,KLEV)
42REAL(KIND=JPRB)   ,INTENT(IN)    :: P_FAC10(KIDIA:KFDIA,KLEV)
43REAL(KIND=JPRB)   ,INTENT(IN)    :: P_FAC11(KIDIA:KFDIA,KLEV)
44INTEGER(KIND=JPIM),INTENT(IN)    :: K_JP(KIDIA:KFDIA,KLEV)
45INTEGER(KIND=JPIM),INTENT(IN)    :: K_JT(KIDIA:KFDIA,KLEV)
46INTEGER(KIND=JPIM),INTENT(IN)    :: K_JT1(KIDIA:KFDIA,KLEV)
47REAL(KIND=JPRB)   ,INTENT(IN)    :: P_COLH2O(KIDIA:KFDIA,KLEV)
48REAL(KIND=JPRB)   ,INTENT(IN)    :: P_COLCO2(KIDIA:KFDIA,KLEV)
49REAL(KIND=JPRB)   ,INTENT(IN)    :: P_COLDRY(KIDIA:KFDIA,KLEV)
50INTEGER(KIND=JPIM),INTENT(IN)    :: K_LAYTROP(KIDIA:KFDIA)
51REAL(KIND=JPRB)   ,INTENT(IN)    :: P_SELFFAC(KIDIA:KFDIA,KLEV)
52REAL(KIND=JPRB)   ,INTENT(IN)    :: P_SELFFRAC(KIDIA:KFDIA,KLEV)
53INTEGER(KIND=JPIM),INTENT(IN)    :: K_INDSELF(KIDIA:KFDIA,KLEV)
54REAL(KIND=JPRB)   ,INTENT(OUT)   :: PFRAC(KIDIA:KFDIA,JPGPT,KLEV)
55
56INTEGER(KIND=JPIM),INTENT(IN)   :: K_INDFOR(KIDIA:KFDIA,KLEV)
57REAL(KIND=JPRB)   ,INTENT(IN)   :: P_FORFAC(KIDIA:KFDIA,KLEV)
58REAL(KIND=JPRB)   ,INTENT(IN)   :: P_FORFRAC(KIDIA:KFDIA,KLEV)
59REAL(KIND=JPRB)   ,INTENT(IN)   :: PMINORFRAC(KIDIA:KFDIA,KLEV)
60INTEGER(KIND=JPIM),INTENT(IN)   :: KINDMINOR(KIDIA:KFDIA,KLEV)
61
62! ---------------------------------------------------------------------------
63
64INTEGER(KIND=JPIM) :: IND0(KLEV),IND1(KLEV),INDS(KLEV),INDF(KLEV),INDM(KLEV)
65
66INTEGER(KIND=JPIM) :: IG, JLAY
67INTEGER(KIND=JPIM) :: JLON
68
69REAL(KIND=JPRB) :: ZADJFAC,ZADJCOLCO2(KIDIA:KFDIA,KLEV),ZRATCO2,ZCHI_CO2
70REAL(KIND=JPRB) :: ZTAUFOR,ZTAUSELF,ZABSCO2
71REAL(KIND=JPHOOK) :: ZHOOK_HANDLE
72
73! Minor gas mapping level:
74!     lower - co2, p = 706.2720 mb, t = 294.2 k
75!     upper - cfc11, cfc12
76
77
78!     Compute the optical depth by interpolating in ln(pressure) and
79!     temperature. The water vapor self- and foreign- continuum is interpolated
80!     (in temperature) separately. 
81
82ASSOCIATE(NFLEVG=>KLEV)
83IF (LHOOK) CALL DR_HOOK('RRTM_TAUMOL6',0,ZHOOK_HANDLE)
84
85DO JLAY = 1, KLEV
86  DO JLON = KIDIA, KFDIA
87    IF (JLAY <= K_LAYTROP(JLON)) THEN
88! In atmospheres where the amount of CO2 is too great to be considered
89! a minor species, adjust the column amount of CO2 by an empirical factor
90! to obtain the proper contribution.
91      ZCHI_CO2 = P_COLCO2(JLON,JLAY)/P_COLDRY(JLON,JLAY)
92      ZRATCO2 = 1.E20_JPRB*ZCHI_CO2/CHI_MLS(2,K_JP(JLON,JLAY)+1)
93      IF (ZRATCO2 > 3.0_JPRB) THEN
94         ZADJFAC = 2.0_JPRB+(ZRATCO2-2.0_JPRB)**0.77_JPRB
95         ZADJCOLCO2(JLON,JLAY) = ZADJFAC*CHI_MLS(2,K_JP(JLON,JLAY)+1)*P_COLDRY(JLON,JLAY)*1.E-20_JPRB
96      ELSE
97         ZADJCOLCO2(JLON,JLAY) = P_COLCO2(JLON,JLAY)
98      ENDIF
99
100      IND0(JLAY) = ((K_JP(JLON,JLAY)-1)*5+(K_JT(JLON,JLAY)-1))*NSPA(6) + 1
101      IND1(JLAY) = (K_JP(JLON,JLAY)*5+(K_JT1(JLON,JLAY)-1))*NSPA(6) + 1
102      INDS(JLAY) = K_INDSELF(JLON,JLAY)
103      INDF(JLAY) = K_INDFOR(JLON,JLAY)
104      INDM(JLAY) = KINDMINOR(JLON,JLAY)
105
106!-- DS_000515 
107!CDIR UNROLL=NG6
108      DO IG = 1, NG6
109!-- DS_000515 
110        ZTAUSELF = P_SELFFAC(JLON,JLAY)* (SELFREF(INDS(JLAY),IG) + P_SELFFRAC(JLON,JLAY) * &
111            &     (SELFREF(INDS(JLAY)+1,IG) - SELFREF(INDS(JLAY),IG)))
112        ZTAUFOR = P_FORFAC(JLON,JLAY) * (FORREF(INDF(JLAY),IG) + P_FORFRAC(JLON,JLAY) * &
113            &     (FORREF(INDF(JLAY)+1,IG) - FORREF(INDF(JLAY),IG)))
114        ZABSCO2 = KA_MCO2(INDM(JLAY),IG) + PMINORFRAC(JLON,JLAY) * &
115            &     (KA_MCO2(INDM(JLAY)+1,IG) - KA_MCO2(INDM(JLAY),IG))
116
117        P_TAU(JLON,NGS5+IG,JLAY) = P_COLH2O(JLON,JLAY) *&
118         & (P_FAC00(JLON,JLAY) * ABSA(IND0(JLAY)  ,IG) +&
119         & P_FAC10(JLON,JLAY) * ABSA(IND0(JLAY)+1,IG) +&
120         & P_FAC01(JLON,JLAY) * ABSA(IND1(JLAY)  ,IG) +&
121         & P_FAC11(JLON,JLAY) * ABSA(IND1(JLAY)+1,IG)) +&
122         & ZTAUSELF + ZTAUFOR &
123         & + P_WX(JLON,2,JLAY) * CFC11ADJ(IG)&
124         & + P_WX(JLON,3,JLAY) * CFC12(IG)&
125         & + ZADJCOLCO2(JLON,JLAY) * ZABSCO2 &
126         & + P_TAUAERL(JLON,JLAY,6) 
127        PFRAC(JLON,NGS5+IG,JLAY) = FRACREFA(IG)
128      ENDDO
129    ENDIF
130
131!     Nothing important goes on above LAYTROP in this band.
132!-- JJM_000517
133    IF (JLAY > K_LAYTROP(JLON)) THEN
134!CDIR UNROLL=NG6
135      DO IG = 1, NG6
136!-- JJM_000517
137        P_TAU(JLON,NGS5+IG,JLAY) = 0.0_JPRB &
138         & + P_WX(JLON,2,JLAY) * CFC11ADJ(IG)&
139         & + P_WX(JLON,3,JLAY) * CFC12(IG)&
140         & + P_TAUAERL(JLON,JLAY,6) 
141        PFRAC(JLON,NGS5+IG,JLAY) = FRACREFA(IG)
142      ENDDO
143    ENDIF
144  ENDDO
145ENDDO
146
147IF (LHOOK) CALL DR_HOOK('RRTM_TAUMOL6',1,ZHOOK_HANDLE)
148
149END ASSOCIATE
150END SUBROUTINE RRTM_TAUMOL6
Note: See TracBrowser for help on using the repository browser.