source: LMDZ6/trunk/libf/phylmd/ecrad/rrtm_taumol14.F90 @ 4586

Last change on this file since 4586 was 3908, checked in by idelkadi, 3 years ago

Online implementation of the radiative transfer code ECRAD in the LMDZ model.

  • Inclusion of the ecrad directory containing the sources of the ECRAD code
    • interface routine : radiation_scheme.F90
  • Adaptation of compilation scripts :
    • compilation under CPP key CPP_ECRAD
    • compilation with option "-rad ecard" or "-ecard true"
    • The "-rad old/rtm/ecran" build option will need to replace the "-rrtm true" and "-ecrad true" options in the future.
  • Runing LMDZ simulations with ecrad, you need :
    • logical key iflag_rrtm = 2 in physiq.def
    • namelist_ecrad (DefLists?)
    • the directory "data" containing the configuration files is temporarily placed in ../libfphylmd/ecrad/
  • Compilation and execution are tested in the 1D case. The repository under svn would allow to continue the implementation work: tests, verification of the results, ...
File size: 4.7 KB
Line 
1!******************************************************************************
2SUBROUTINE RRTM_TAUMOL14 (KIDIA,KFDIA,KLEV,P_TAU,&
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_COLCO2,K_LAYTROP,P_SELFFAC,P_SELFFRAC,K_INDSELF,PFRAC) 
5
6!     BAND 14:  2250-2380 cm-1 (low - CO2; high - CO2)
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! ---------------------------------------------------------------------------
19
20USE PARKIND1  ,ONLY : JPIM     ,JPRB
21USE YOMHOOK   ,ONLY : LHOOK,   DR_HOOK
22
23USE PARRRTM  , ONLY : JPBAND
24USE YOERRTM  , ONLY : JPGPT  ,NGS13  ,NG14
25USE YOERRTWN , ONLY : NSPA   ,NSPB
26USE YOERRTA14, ONLY : ABSA   ,ABSB   ,FRACREFA, FRACREFB,SELFREF,FORREF
27
28IMPLICIT NONE
29
30INTEGER(KIND=JPIM),INTENT(IN)    :: KIDIA
31INTEGER(KIND=JPIM),INTENT(IN)    :: KFDIA
32INTEGER(KIND=JPIM),INTENT(IN)    :: KLEV
33REAL(KIND=JPRB)   ,INTENT(OUT)   :: P_TAU(KIDIA:KFDIA,JPGPT,KLEV)
34REAL(KIND=JPRB)   ,INTENT(IN)    :: P_TAUAERL(KIDIA:KFDIA,KLEV,JPBAND)
35REAL(KIND=JPRB)   ,INTENT(IN)    :: P_FAC00(KIDIA:KFDIA,KLEV)
36REAL(KIND=JPRB)   ,INTENT(IN)    :: P_FAC01(KIDIA:KFDIA,KLEV)
37REAL(KIND=JPRB)   ,INTENT(IN)    :: P_FAC10(KIDIA:KFDIA,KLEV)
38REAL(KIND=JPRB)   ,INTENT(IN)    :: P_FAC11(KIDIA:KFDIA,KLEV)
39INTEGER(KIND=JPIM),INTENT(IN)    :: K_JP(KIDIA:KFDIA,KLEV)
40INTEGER(KIND=JPIM),INTENT(IN)    :: K_JT(KIDIA:KFDIA,KLEV)
41INTEGER(KIND=JPIM),INTENT(IN)    :: K_JT1(KIDIA:KFDIA,KLEV)
42REAL(KIND=JPRB)   ,INTENT(IN)    :: P_COLCO2(KIDIA:KFDIA,KLEV)
43INTEGER(KIND=JPIM),INTENT(IN)    :: K_LAYTROP(KIDIA:KFDIA)
44REAL(KIND=JPRB)   ,INTENT(IN)    :: P_SELFFAC(KIDIA:KFDIA,KLEV)
45REAL(KIND=JPRB)   ,INTENT(IN)    :: P_SELFFRAC(KIDIA:KFDIA,KLEV)
46INTEGER(KIND=JPIM),INTENT(IN)    :: K_INDSELF(KIDIA:KFDIA,KLEV)
47REAL(KIND=JPRB)   ,INTENT(OUT)   :: PFRAC(KIDIA:KFDIA,JPGPT,KLEV)
48
49INTEGER(KIND=JPIM),INTENT(IN)   :: K_INDFOR(KIDIA:KFDIA,KLEV)
50REAL(KIND=JPRB)   ,INTENT(IN)   :: P_FORFAC(KIDIA:KFDIA,KLEV)
51REAL(KIND=JPRB)   ,INTENT(IN)   :: P_FORFRAC(KIDIA:KFDIA,KLEV)
52! ---------------------------------------------------------------------------
53
54INTEGER(KIND=JPIM) :: IG, IND0, IND1, INDS, INDF, JLAY
55INTEGER(KIND=JPIM) :: JLON
56REAL(KIND=JPRB) :: ZTAUFOR,ZTAUSELF
57REAL(KIND=JPRB) :: ZHOOK_HANDLE
58
59! Compute the optical depth by interpolating in ln(pressure) and
60! temperature.  Below laytrop, the water vapor self-continuum
61! and foreign continuum is interpolated (in temperature) separately. 
62
63ASSOCIATE(NFLEVG=>KLEV)
64IF (LHOOK) CALL DR_HOOK('RRTM_TAUMOL14',0,ZHOOK_HANDLE)
65
66DO JLAY = 1, KLEV
67  DO JLON = KIDIA, KFDIA
68    IF (JLAY <= K_LAYTROP(JLON)) THEN
69      IND0 = ((K_JP(JLON,JLAY)-1)*5+(K_JT(JLON,JLAY)-1))*NSPA(14) + 1
70      IND1 = (K_JP(JLON,JLAY)*5+(K_JT1(JLON,JLAY)-1))*NSPA(14) + 1
71      INDS = K_INDSELF(JLON,JLAY)
72      INDF = K_INDFOR(JLON,JLAY)
73
74!-- DS_990714 
75!-- jjm20110728 re-establishing the loop instead of specified IG to allow a flexible number of NG14
76      DO IG = 1, NG14
77!      IG=1
78        ZTAUSELF = P_SELFFAC(JLON,JLAY)* (SELFREF(INDS,IG) + P_SELFFRAC(JLON,JLAY) * &
79          &       (SELFREF(INDS+1,IG) - SELFREF(INDS,IG)))
80        ZTAUFOR = P_FORFAC(JLON,JLAY) * (FORREF(INDF,IG) + P_FORFRAC(JLON,JLAY) * &
81          &       (FORREF(INDF+1,IG) - FORREF(INDF,IG)))
82
83        P_TAU(JLON,NGS13+IG,JLAY) = P_COLCO2(JLON,JLAY) *&
84         & (P_FAC00(JLON,JLAY) * ABSA(IND0  ,IG) +&
85         & P_FAC10(JLON,JLAY) * ABSA(IND0+1,IG) +&
86         & P_FAC01(JLON,JLAY) * ABSA(IND1  ,IG) +&
87         & P_FAC11(JLON,JLAY) * ABSA(IND1+1,IG)) &
88         & + ZTAUSELF + ZTAUFOR &
89         & + P_TAUAERL(JLON,JLAY,14) 
90        PFRAC(JLON,NGS13+IG,JLAY) = FRACREFA(IG)
91      ENDDO
92!-- jjm20110728
93!-- DS_990714 
94    ENDIF
95
96    IF (JLAY > K_LAYTROP(JLON)) THEN
97      IND0 = ((K_JP(JLON,JLAY)-13)*5+(K_JT(JLON,JLAY)-1))*NSPB(14) + 1
98      IND1 = ((K_JP(JLON,JLAY)-12)*5+(K_JT1(JLON,JLAY)-1))*NSPB(14) + 1
99!-- DS_990714 
100!-- jjm20110728 re-establishing the loop instead of specified IG to allow a flexible number of NG14
101      DO IG = 1, NG14
102!      IG=1
103        P_TAU(JLON,NGS13+IG,JLAY) = P_COLCO2(JLON,JLAY) *&
104         & (P_FAC00(JLON,JLAY) * ABSB(IND0  ,IG) +&
105         & P_FAC10(JLON,JLAY) * ABSB(IND0+1,IG) +&
106         & P_FAC01(JLON,JLAY) * ABSB(IND1  ,IG) +&
107         & P_FAC11(JLON,JLAY) * ABSB(IND1+1,IG)) &
108         & + P_TAUAERL(JLON,JLAY,14) 
109        PFRAC(JLON,NGS13+IG,JLAY) = FRACREFB(IG)
110      ENDDO
111!-- jjm20110728
112!-- DS_990714 
113    ENDIF
114  ENDDO
115ENDDO
116
117
118IF (LHOOK) CALL DR_HOOK('RRTM_TAUMOL14',1,ZHOOK_HANDLE)
119
120END ASSOCIATE
121END SUBROUTINE RRTM_TAUMOL14
Note: See TracBrowser for help on using the repository browser.