source: LMDZ6/trunk/libf/phylmd/ecrad/srtm_taumol24.F90 @ 4388

Last change on this file since 4388 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: 7.6 KB
Line 
1SUBROUTINE SRTM_TAUMOL24 &
2 & ( KIDIA   , KFDIA    , KLEV,&
3 & P_FAC00   , P_FAC01  , P_FAC10   , P_FAC11,&
4 & K_JP      , K_JT     , K_JT1     , P_ONEMINUS,&
5 & P_COLH2O  , P_COLMOL , P_COLO2   , P_COLO3,&
6 & K_LAYTROP , P_SELFFAC, P_SELFFRAC, K_INDSELF  , P_FORFAC, P_FORFRAC, K_INDFOR,&
7 & P_SFLUXZEN, P_TAUG   , P_TAUR    , PRMU0   &
8 & ) 
9
10!     Written by Eli J. Mlawer, Atmospheric & Environmental Research.
11
12!     BAND 24:  12850-16000 cm-1 (low - H2O,O2; high - O2)
13
14! Modifications
15!        M.Hamrud      01-Oct-2003 CY28 Cleaning
16
17!     JJMorcrette 2003-02-24 adapted to ECMWF environment
18!        D.Salmond  31-Oct-2007 Vector version in the style of RRTM from Meteo France & NEC
19!     JJMorcrette 20110610 Flexible configuration for number of g-points
20
21USE PARKIND1 , ONLY : JPIM, JPRB
22USE YOMHOOK  , ONLY : LHOOK, DR_HOOK
23USE PARSRTM  , ONLY : JPG
24USE YOESRTM  , ONLY : NG24
25USE YOESRTA24, ONLY : ABSA, ABSB, FORREFC, SELFREFC, SFLUXREFC, &
26 & ABSO3AC, ABSO3BC, RAYLAC, RAYLBC, LAYREFFR, STRRAT 
27USE YOESRTWN , ONLY : NSPA, NSPB
28
29IMPLICIT NONE
30
31!-- Output
32INTEGER(KIND=JPIM),INTENT(IN)    :: KIDIA, KFDIA
33INTEGER(KIND=JPIM),INTENT(IN)    :: KLEV
34REAL(KIND=JPRB)   ,INTENT(IN)    :: P_FAC00(KIDIA:KFDIA,KLEV)
35REAL(KIND=JPRB)   ,INTENT(IN)    :: P_FAC01(KIDIA:KFDIA,KLEV)
36REAL(KIND=JPRB)   ,INTENT(IN)    :: P_FAC10(KIDIA:KFDIA,KLEV)
37REAL(KIND=JPRB)   ,INTENT(IN)    :: P_FAC11(KIDIA:KFDIA,KLEV)
38INTEGER(KIND=JPIM),INTENT(IN)    :: K_JP(KIDIA:KFDIA,KLEV)
39INTEGER(KIND=JPIM),INTENT(IN)    :: K_JT(KIDIA:KFDIA,KLEV)
40INTEGER(KIND=JPIM),INTENT(IN)    :: K_JT1(KIDIA:KFDIA,KLEV)
41REAL(KIND=JPRB)   ,INTENT(IN)    :: P_ONEMINUS(KIDIA:KFDIA)
42REAL(KIND=JPRB)   ,INTENT(IN)    :: P_COLH2O(KIDIA:KFDIA,KLEV)
43REAL(KIND=JPRB)   ,INTENT(IN)    :: P_COLMOL(KIDIA:KFDIA,KLEV)
44REAL(KIND=JPRB)   ,INTENT(IN)    :: P_COLO2(KIDIA:KFDIA,KLEV)
45REAL(KIND=JPRB)   ,INTENT(IN)    :: P_COLO3(KIDIA:KFDIA,KLEV)
46INTEGER(KIND=JPIM),INTENT(IN)    :: K_LAYTROP(KIDIA:KFDIA)
47REAL(KIND=JPRB)   ,INTENT(IN)    :: P_SELFFAC(KIDIA:KFDIA,KLEV)
48REAL(KIND=JPRB)   ,INTENT(IN)    :: P_SELFFRAC(KIDIA:KFDIA,KLEV)
49INTEGER(KIND=JPIM),INTENT(IN)    :: K_INDSELF(KIDIA:KFDIA,KLEV)
50REAL(KIND=JPRB)   ,INTENT(IN)    :: P_FORFAC(KIDIA:KFDIA,KLEV)
51REAL(KIND=JPRB)   ,INTENT(IN)    :: P_FORFRAC(KIDIA:KFDIA,KLEV)
52INTEGER(KIND=JPIM),INTENT(IN)    :: K_INDFOR(KIDIA:KFDIA,KLEV)
53
54REAL(KIND=JPRB)   ,INTENT(OUT)   :: P_SFLUXZEN(KIDIA:KFDIA,JPG)
55REAL(KIND=JPRB)   ,INTENT(OUT)   :: P_TAUG(KIDIA:KFDIA,KLEV,JPG)
56REAL(KIND=JPRB)   ,INTENT(OUT)   :: P_TAUR(KIDIA:KFDIA,KLEV,JPG)
57REAL(KIND=JPRB)   ,INTENT(IN)    :: PRMU0(KIDIA:KFDIA)
58!- from INTFAC     
59!- from INTIND
60!- from PRECISE             
61!- from PROFDATA             
62!- from SELF             
63INTEGER(KIND=JPIM) :: IG, IND0, IND1, INDS, INDF, JS, I_LAY, I_LAYSOLFR(KIDIA:KFDIA), I_NLAYERS, IPLON
64
65INTEGER(KIND=JPIM) :: I_LAY_NEXT
66
67REAL(KIND=JPRB) :: Z_FAC000, Z_FAC001, Z_FAC010, Z_FAC011, Z_FAC100, Z_FAC101,&
68 & Z_FAC110, Z_FAC111, Z_FS, Z_SPECCOMB, Z_SPECMULT, Z_SPECPARM, &
69 & Z_TAURAY 
70REAL(KIND=JPRB) :: ZHOOK_HANDLE
71
72ASSOCIATE(NFLEVG=>KLEV)
73IF (LHOOK) CALL DR_HOOK('SRTM_TAUMOL24',0,ZHOOK_HANDLE)
74
75I_NLAYERS = KLEV
76
77!     Compute the optical depth by interpolating in ln(pressure),
78!     temperature, and appropriate species.  Below LAYTROP, the water
79!     vapor self-continuum is interpolated (in temperature) separately. 
80
81I_LAYSOLFR(KIDIA:KFDIA) = K_LAYTROP(KIDIA:KFDIA)
82
83DO I_LAY = 1, I_NLAYERS
84  I_LAY_NEXT = MIN(I_NLAYERS, I_LAY+1)
85  DO IPLON = KIDIA, KFDIA
86    IF (PRMU0(IPLON) > 0.0_JPRB) THEN
87      IF (I_LAY <= K_LAYTROP(IPLON)) THEN
88        IF (K_JP(IPLON,I_LAY) < LAYREFFR .AND. K_JP(IPLON,I_LAY_NEXT) >= LAYREFFR) &
89         & I_LAYSOLFR(IPLON) = MIN(I_LAY+1,K_LAYTROP(IPLON)) 
90        Z_SPECCOMB = P_COLH2O(IPLON,I_LAY) + STRRAT*P_COLO2(IPLON,I_LAY)
91        Z_SPECPARM = P_COLH2O(IPLON,I_LAY)/Z_SPECCOMB
92        IF (Z_SPECPARM >= P_ONEMINUS(IPLON)) Z_SPECPARM = P_ONEMINUS(IPLON)
93        Z_SPECMULT = 8.*(Z_SPECPARM)
94        JS = 1 + INT(Z_SPECMULT)
95        Z_FS = MOD(Z_SPECMULT, 1.0_JPRB )
96        ! Z_FAC000 = (1. - Z_FS) * P_FAC00(I_LAY)
97        ! Z_FAC010 = (1. - Z_FS) * P_FAC10(I_LAY)
98        ! Z_FAC100 = Z_FS * P_FAC00(I_LAY)
99        ! Z_FAC110 = Z_FS * P_FAC10(I_LAY)
100        ! Z_FAC001 = (1. - Z_FS) * P_FAC01(I_LAY)
101        ! Z_FAC011 = (1. - Z_FS) * P_FAC11(I_LAY)
102        ! Z_FAC101 = Z_FS * P_FAC01(I_LAY)
103        ! Z_FAC111 = Z_FS * P_FAC11(I_LAY)
104        IND0 = ((K_JP(IPLON,I_LAY)-1)*5+(K_JT(IPLON,I_LAY)-1))*NSPA(24) + JS
105        IND1 = (K_JP(IPLON,I_LAY)*5+(K_JT1(IPLON,I_LAY)-1))*NSPA(24) + JS
106        INDS = K_INDSELF(IPLON,I_LAY)
107        INDF = K_INDFOR(IPLON,I_LAY)
108
109        !  DO IG = 1, NG(24)
110!CDIR UNROLL=NG24
111        DO IG = 1 , NG24
112          Z_TAURAY = P_COLMOL(IPLON,I_LAY) * (RAYLAC(IG,JS) + &
113           & Z_FS * (RAYLAC(IG,JS+1) - RAYLAC(IG,JS))) 
114          P_TAUG(IPLON,I_LAY,IG) = Z_SPECCOMB * &
115           !    & (Z_FAC000 * ABSA(IND0,IG) + &
116           !    & Z_FAC100 * ABSA(IND0+1,IG) + &
117           !    & Z_FAC010 * ABSA(IND0+9,IG) + &
118           !    & Z_FAC110 * ABSA(IND0+10,IG) + &
119           !    & Z_FAC001 * ABSA(IND1,IG) + &
120           !    & Z_FAC101 * ABSA(IND1+1,IG) + &
121           !    & Z_FAC011 * ABSA(IND1+9,IG) + &
122           !    & Z_FAC111 * ABSA(IND1+10,IG)) + &
123           & (&
124           & (1. - Z_FS) * ( ABSA(IND0,IG) * P_FAC00(IPLON,I_LAY) + &
125           &                 ABSA(IND0+9,IG) * P_FAC10(IPLON,I_LAY) + &
126           &                 ABSA(IND1,IG) * P_FAC01(IPLON,I_LAY) + &
127           &                 ABSA(IND1+9,IG) * P_FAC11(IPLON,I_LAY) ) + &
128           & Z_FS        * ( ABSA(IND0+1,IG) * P_FAC00(IPLON,I_LAY) + &
129           &                 ABSA(IND0+10,IG) * P_FAC10(IPLON,I_LAY) + &
130           &                 ABSA(IND1+1,IG) * P_FAC01(IPLON,I_LAY) + &
131           &                 ABSA(IND1+10,IG) * P_FAC11(IPLON,I_LAY) ) &
132           & ) + &
133           & P_COLO3(IPLON,I_LAY) * ABSO3AC(IG) + &
134           & P_COLH2O(IPLON,I_LAY) *  &
135           & (P_SELFFAC(IPLON,I_LAY) * (SELFREFC(INDS,IG) + &
136           & P_SELFFRAC(IPLON,I_LAY) * &
137           & (SELFREFC(INDS+1,IG) - SELFREFC(INDS,IG))) + &
138           & P_FORFAC(IPLON,I_LAY) * (FORREFC(INDF,IG) +  &
139           & P_FORFRAC(IPLON,I_LAY) * &
140           & (FORREFC(INDF+1,IG) - FORREFC(INDF,IG)))) 
141          !     &           + TAURAY
142          !    SSA(LAY,IG) = TAURAY/TAUG(LAY,IG)
143          IF (I_LAY == I_LAYSOLFR(IPLON)) P_SFLUXZEN(IPLON,IG) = SFLUXREFC(IG,JS) &
144           & + Z_FS * (SFLUXREFC(IG,JS+1) - SFLUXREFC(IG,JS)) 
145          P_TAUR(IPLON,I_LAY,IG) =  Z_TAURAY
146        ENDDO
147      ENDIF
148    ENDIF
149  ENDDO
150ENDDO
151
152DO I_LAY = 1, I_NLAYERS
153  DO IPLON = KIDIA, KFDIA
154    IF (PRMU0(IPLON) > 0.0_JPRB) THEN
155      IF (I_LAY >= K_LAYTROP(IPLON)+1) THEN
156        IND0 = ((K_JP(IPLON,I_LAY)-13)*5+(K_JT(IPLON,I_LAY)-1))*NSPB(24) + 1
157        IND1 = ((K_JP(IPLON,I_LAY)-12)*5+(K_JT1(IPLON,I_LAY)-1))*NSPB(24) + 1
158
159        !  DO IG = 1, NG(24)
160!CDIR UNROLL=NG24
161        DO IG = 1 , NG24
162          Z_TAURAY = P_COLMOL(IPLON,I_LAY) * RAYLBC(IG)
163          P_TAUG(IPLON,I_LAY,IG) = P_COLO2(IPLON,I_LAY) * &
164           & (P_FAC00(IPLON,I_LAY) * ABSB(IND0,IG) + &
165           & P_FAC10(IPLON,I_LAY) * ABSB(IND0+1,IG) + &
166           & P_FAC01(IPLON,I_LAY) * ABSB(IND1,IG) + &
167           & P_FAC11(IPLON,I_LAY) * ABSB(IND1+1,IG)) + &
168           & P_COLO3(IPLON,I_LAY) * ABSO3BC(IG) 
169          !     &          + TAURAY
170          !    SSA(LAY,IG) = TAURAY/TAUG(LAY,IG)
171          P_TAUR(IPLON,I_LAY,IG) = Z_TAURAY
172        ENDDO
173      ENDIF
174    ENDIF
175  ENDDO
176ENDDO
177
178!-----------------------------------------------------------------------
179IF (LHOOK) CALL DR_HOOK('SRTM_TAUMOL24',1,ZHOOK_HANDLE)
180END ASSOCIATE
181END SUBROUTINE SRTM_TAUMOL24
Note: See TracBrowser for help on using the repository browser.