source: LMDZ6/trunk/libf/phylmd/ecrad/ifsrrtm/rrtm_taumol2.F90 @ 5440

Last change on this file since 5440 was 4773, checked in by idelkadi, 12 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: 5.3 KB
Line 
1!----------------------------------------------------------------------------
2SUBROUTINE RRTM_TAUMOL2 (KIDIA,KFDIA,KLEV,P_TAU,PAVEL,P_COLDRY,&
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,K_LAYTROP,P_SELFFAC,P_SELFFRAC,K_INDSELF,PFRAC) 
5
6!     BAND 2:  250-500 cm-1 (low - H2O; high - H2O)
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 201305 updated to rrtmg_lw_v4.85:
18!*********
19!     band 2:  350-500 cm-1 (low key - h2o; high key - h2o)
20!
21!     note: previous version of rrtm band 2:
22!           250 - 500 cm-1 (low - h2o; high - h2o)
23!
24! ---------------------------------------------------------------------------
25
26USE PARKIND1  ,ONLY : JPIM     ,JPRB
27USE YOMHOOK   ,ONLY : LHOOK, DR_HOOK, JPHOOK
28
29USE PARRRTM  , ONLY : JPBAND
30USE YOERRTM  , ONLY : JPGPT  ,NG2   ,NGS1
31USE YOERRTWN , ONLY : NSPA   ,NSPB
32USE YOERRTA2 , ONLY : ABSA   ,ABSB   ,FRACREFA, FRACREFB,&
33 & FORREF   ,SELFREF 
34
35IMPLICIT NONE
36
37INTEGER(KIND=JPIM),INTENT(IN)    :: KIDIA
38INTEGER(KIND=JPIM),INTENT(IN)    :: KFDIA
39INTEGER(KIND=JPIM),INTENT(IN)    :: KLEV
40REAL(KIND=JPRB)   ,INTENT(OUT)   :: P_TAU(KIDIA:KFDIA,JPGPT,KLEV)
41REAL(KIND=JPRB)   ,INTENT(IN)    :: PAVEL(KIDIA:KFDIA,KLEV) ! Layer pressures (hPa)
42REAL(KIND=JPRB)   ,INTENT(IN)    :: P_COLDRY(KIDIA:KFDIA,KLEV)
43REAL(KIND=JPRB)   ,INTENT(IN)    :: P_TAUAERL(KIDIA:KFDIA,KLEV,JPBAND)
44REAL(KIND=JPRB)   ,INTENT(IN)    :: P_FAC00(KIDIA:KFDIA,KLEV)
45REAL(KIND=JPRB)   ,INTENT(IN)    :: P_FAC01(KIDIA:KFDIA,KLEV)
46REAL(KIND=JPRB)   ,INTENT(IN)    :: P_FAC10(KIDIA:KFDIA,KLEV)
47REAL(KIND=JPRB)   ,INTENT(IN)    :: P_FAC11(KIDIA:KFDIA,KLEV)
48REAL(KIND=JPRB)   ,INTENT(IN)    :: P_FORFRAC(KIDIA:KFDIA,KLEV)
49REAL(KIND=JPRB)   ,INTENT(IN)    :: P_FORFAC(KIDIA:KFDIA,KLEV)
50INTEGER(KIND=JPIM),INTENT(IN)    :: K_JP(KIDIA:KFDIA,KLEV)
51INTEGER(KIND=JPIM),INTENT(IN)    :: K_JT(KIDIA:KFDIA,KLEV)
52INTEGER(KIND=JPIM),INTENT(IN)    :: K_JT1(KIDIA:KFDIA,KLEV)
53REAL(KIND=JPRB)   ,INTENT(IN)    :: P_COLH2O(KIDIA:KFDIA,KLEV)
54INTEGER(KIND=JPIM),INTENT(IN)    :: K_LAYTROP(KIDIA:KFDIA)
55REAL(KIND=JPRB)   ,INTENT(IN)    :: P_SELFFAC(KIDIA:KFDIA,KLEV)
56REAL(KIND=JPRB)   ,INTENT(IN)    :: P_SELFFRAC(KIDIA:KFDIA,KLEV)
57INTEGER(KIND=JPIM),INTENT(IN)    :: K_INDSELF(KIDIA:KFDIA,KLEV)
58INTEGER(KIND=JPIM),INTENT(IN)    :: K_INDFOR(KIDIA:KFDIA,KLEV)
59REAL(KIND=JPRB)   ,INTENT(OUT)   :: PFRAC(KIDIA:KFDIA,JPGPT,KLEV)
60
61! ---------------------------------------------------------------------------
62
63INTEGER(KIND=JPIM) :: IND0(KLEV),IND1(KLEV),INDS(KLEV), INDF(KLEV)
64
65INTEGER(KIND=JPIM) :: IG, JLAY
66INTEGER(KIND=JPIM) :: JLON
67
68REAL(KIND=JPRB) :: ZTAUFOR,ZTAUSELF,ZCORRADJ,ZPP
69REAL(KIND=JPHOOK) :: ZHOOK_HANDLE
70
71!     Compute the optical depth by interpolating in ln(pressure) and
72!     temperature.  Below LAYTROP, the water vapor self-continuum is
73!     interpolated (in temperature) separately.
74
75ASSOCIATE(NFLEVG=>KLEV)
76IF (LHOOK) CALL DR_HOOK('RRTM_TAUMOL2',0,ZHOOK_HANDLE)
77
78DO JLAY = 1, KLEV
79  DO JLON = KIDIA, KFDIA
80    IF (JLAY <= K_LAYTROP(JLON)) THEN
81      IND0(JLAY) = ((K_JP(JLON,JLAY)-1)*5+(K_JT(JLON,JLAY)-1))*NSPA(2) + 1
82      IND1(JLAY) = (K_JP(JLON,JLAY)*5+(K_JT1(JLON,JLAY)-1))*NSPA(2) + 1
83      INDS(JLAY) = K_INDSELF(JLON,JLAY)
84      INDF(JLAY) = K_INDFOR(JLON,JLAY)
85      ZPP = PAVEL(JLON,JLAY) !hPa(mb)
86      ZCORRADJ = 1._JPRB - .05_JPRB * (ZPP - 100._JPRB) / 900._JPRB
87!-- DS_000515 
88!CDIR UNROLL=NG2
89      DO IG = 1, NG2
90!-- DS_000515 
91         ZTAUSELF = P_SELFFAC(JLON,JLAY) * (SELFREF(INDS(JLAY),IG) + P_SELFFRAC(JLON,JLAY) * &
92                 & (SELFREF(INDS(JLAY)+1,IG) - SELFREF(INDS(JLAY),IG)))
93         ZTAUFOR =  P_FORFAC(JLON,JLAY) * (FORREF(INDF(JLAY),IG) + P_FORFRAC(JLON,JLAY) * &
94                 & (FORREF(INDF(JLAY)+1,IG) - FORREF(INDF(JLAY),IG)))
95         P_TAU(JLON,NGS1+IG,JLAY) = ZCORRADJ * (P_COLH2O(JLON,JLAY) * &
96                 & (P_FAC00(JLON,JLAY) * ABSA(IND0(JLAY),IG) + &
97                 &  P_FAC10(JLON,JLAY) * ABSA(IND0(JLAY)+1,IG) + &
98                 &  P_FAC01(JLON,JLAY) * ABSA(IND1(JLAY),IG) + &
99                 &  P_FAC11(JLON,JLAY) * ABSA(IND1(JLAY)+1,IG)) &
100               &  + ZTAUSELF + ZTAUFOR)+ P_TAUAERL(JLON,JLAY,2)
101        PFRAC(JLON,NGS1+IG,JLAY) = FRACREFA(IG)
102
103      ENDDO
104    ENDIF
105    IF (JLAY > K_LAYTROP(JLON)) THEN
106
107      IND0(JLAY) = ((K_JP(JLON,JLAY)-13)*5+(K_JT(JLON,JLAY)-1))*NSPB(2) + 1
108      IND1(JLAY) = ((K_JP(JLON,JLAY)-12)*5+(K_JT1(JLON,JLAY)-1))*NSPB(2) + 1
109      INDF(JLAY) = K_INDFOR(JLON,JLAY)
110!-- JJM_000517
111!CDIR UNROLL=NG2
112      DO IG = 1, NG2
113!-- JJM_000517
114         ZTAUFOR = P_FORFAC(JLON,JLAY) * (FORREF(INDF(JLAY),IG) + &
115                &  P_FORFRAC(JLON,JLAY) * (FORREF(INDF(JLAY)+1,IG) - FORREF(INDF(JLAY),IG)))
116         P_TAU(JLON,NGS1+IG,JLAY) = P_COLH2O(JLON,JLAY) * &
117              &  (P_FAC00(JLON,JLAY) * ABSB(IND0(JLAY),IG) + &
118              &   P_FAC10(JLON,JLAY) * ABSB(IND0(JLAY)+1,IG) + &
119              &   P_FAC01(JLON,JLAY) * ABSB(IND1(JLAY),IG) + &
120              &   P_FAC11(JLON,JLAY) * ABSB(IND1(JLAY)+1,IG)) &
121              &   + ZTAUFOR + P_TAUAERL(JLON,JLAY,2)
122       PFRAC(JLON,NGS1+IG,JLAY) = FRACREFB(IG)
123
124      ENDDO
125    ENDIF
126  ENDDO
127ENDDO
128
129IF (LHOOK) CALL DR_HOOK('RRTM_TAUMOL2',1,ZHOOK_HANDLE)
130
131END ASSOCIATE
132END SUBROUTINE RRTM_TAUMOL2
Note: See TracBrowser for help on using the repository browser.