source: LMDZ6/branches/cirrus/libf/phylmd/ecrad.v1.5.1/srtm_taumol28.F90 @ 5435

Last change on this file since 5435 was 3908, checked in by idelkadi, 4 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: 8.0 KB
Line 
1SUBROUTINE SRTM_TAUMOL28 &
2 & ( KIDIA   , KFDIA    , KLEV,&
3 & P_FAC00   , P_FAC01  , P_FAC10   , P_FAC11,&
4 & K_JP      , K_JT     , K_JT1     , P_ONEMINUS,&
5 & P_COLMOL  , P_COLO2  , P_COLO3,&
6 & K_LAYTROP,&
7 & P_SFLUXZEN, P_TAUG   , P_TAUR    , PRMU0   &
8 & ) 
9
10!     Written by Eli J. Mlawer, Atmospheric & Environmental Research.
11
12!     BAND 28:  38000-50000 cm-1 (low - O3,O2; high - O3,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 20010610 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 : NG28
25USE YOESRTA28, ONLY : ABSA, ABSB, SFLUXREFC, RAYL, LAYREFFR, STRRAT 
26USE YOESRTWN , ONLY : NSPA, NSPB
27
28IMPLICIT NONE
29
30!-- Output
31INTEGER(KIND=JPIM),INTENT(IN)    :: KIDIA, KFDIA
32INTEGER(KIND=JPIM),INTENT(IN)    :: KLEV
33REAL(KIND=JPRB)   ,INTENT(IN)    :: P_FAC00(KIDIA:KFDIA,KLEV)
34REAL(KIND=JPRB)   ,INTENT(IN)    :: P_FAC01(KIDIA:KFDIA,KLEV)
35REAL(KIND=JPRB)   ,INTENT(IN)    :: P_FAC10(KIDIA:KFDIA,KLEV)
36REAL(KIND=JPRB)   ,INTENT(IN)    :: P_FAC11(KIDIA:KFDIA,KLEV)
37INTEGER(KIND=JPIM),INTENT(IN)    :: K_JP(KIDIA:KFDIA,KLEV)
38INTEGER(KIND=JPIM),INTENT(IN)    :: K_JT(KIDIA:KFDIA,KLEV)
39INTEGER(KIND=JPIM),INTENT(IN)    :: K_JT1(KIDIA:KFDIA,KLEV)
40REAL(KIND=JPRB)   ,INTENT(IN)    :: P_ONEMINUS(KIDIA:KFDIA)
41REAL(KIND=JPRB)   ,INTENT(IN)    :: P_COLMOL(KIDIA:KFDIA,KLEV)
42REAL(KIND=JPRB)   ,INTENT(IN)    :: P_COLO2(KIDIA:KFDIA,KLEV)
43REAL(KIND=JPRB)   ,INTENT(IN)    :: P_COLO3(KIDIA:KFDIA,KLEV)
44INTEGER(KIND=JPIM),INTENT(IN)    :: K_LAYTROP(KIDIA:KFDIA)
45
46REAL(KIND=JPRB)   ,INTENT(OUT)   :: P_SFLUXZEN(KIDIA:KFDIA,JPG)
47REAL(KIND=JPRB)   ,INTENT(OUT)   :: P_TAUG(KIDIA:KFDIA,KLEV,JPG)
48REAL(KIND=JPRB)   ,INTENT(OUT)   :: P_TAUR(KIDIA:KFDIA,KLEV,JPG)
49REAL(KIND=JPRB)   ,INTENT(IN)    :: PRMU0(KIDIA:KFDIA)
50!- from INTFAC     
51!- from INTIND
52!- from PRECISE             
53!- from PROFDATA             
54!- from SELF             
55INTEGER(KIND=JPIM) :: IG, IND0, IND1, JS, I_LAY, I_LAYSOLFR(KIDIA:KFDIA), I_NLAYERS, IPLON
56
57REAL(KIND=JPRB) :: Z_FAC000, Z_FAC001, Z_FAC010, Z_FAC011, Z_FAC100, Z_FAC101,&
58 & Z_FAC110, Z_FAC111, Z_FS, Z_SPECCOMB, Z_SPECMULT, Z_SPECPARM, &
59 & Z_TAURAY 
60REAL(KIND=JPRB) :: ZHOOK_HANDLE
61
62ASSOCIATE(NFLEVG=>KLEV)
63IF (LHOOK) CALL DR_HOOK('SRTM_TAUMOL28',0,ZHOOK_HANDLE)
64
65I_NLAYERS = KLEV
66
67!     Compute the optical depth by interpolating in ln(pressure),
68!     temperature, and appropriate species.  Below LAYTROP, the water
69!     vapor self-continuum is interpolated (in temperature) separately. 
70
71DO I_LAY = 1, I_NLAYERS
72  DO IPLON = KIDIA, KFDIA
73    IF (PRMU0(IPLON) > 0.0_JPRB) THEN
74      IF (I_LAY <= K_LAYTROP(IPLON)) THEN
75        Z_SPECCOMB = P_COLO3(IPLON,I_LAY) + STRRAT*P_COLO2(IPLON,I_LAY)
76        Z_SPECPARM = P_COLO3(IPLON,I_LAY)/Z_SPECCOMB
77        IF (Z_SPECPARM >= P_ONEMINUS(IPLON)) Z_SPECPARM = P_ONEMINUS(IPLON)
78        Z_SPECMULT = 8.*(Z_SPECPARM)
79        JS = 1 + INT(Z_SPECMULT)
80        Z_FS = MOD(Z_SPECMULT, 1.0_JPRB )
81        ! Z_FAC000 = (1. - Z_FS) * P_FAC00(I_LAY)
82        ! Z_FAC010 = (1. - Z_FS) * P_FAC10(I_LAY)
83        ! Z_FAC100 = Z_FS * P_FAC00(I_LAY)
84        ! Z_FAC110 = Z_FS * P_FAC10(I_LAY)
85        ! Z_FAC001 = (1. - Z_FS) * P_FAC01(I_LAY)
86        ! Z_FAC011 = (1. - Z_FS) * P_FAC11(I_LAY)
87        ! Z_FAC101 = Z_FS * P_FAC01(I_LAY)
88        ! Z_FAC111 = Z_FS * P_FAC11(I_LAY)
89        IND0 = ((K_JP(IPLON,I_LAY)-1)*5+(K_JT(IPLON,I_LAY)-1))*NSPA(28) + JS
90        IND1 = (K_JP(IPLON,I_LAY)*5+(K_JT1(IPLON,I_LAY)-1))*NSPA(28) + JS
91        Z_TAURAY = P_COLMOL(IPLON,I_LAY) * RAYL
92
93        !  DO IG = 1, NG(28)
94!CDIR UNROLL=NG28
95        DO IG = 1 , NG28
96          P_TAUG(IPLON,I_LAY,IG) = Z_SPECCOMB * &
97           !    & (Z_FAC000 * ABSA(IND0,IG) + &
98           !    & Z_FAC100 * ABSA(IND0+1,IG) + &
99           !    & Z_FAC010 * ABSA(IND0+9,IG) + &
100           !    & Z_FAC110 * ABSA(IND0+10,IG) + &
101           !    & Z_FAC001 * ABSA(IND1,IG) + &
102           !    & Z_FAC101 * ABSA(IND1+1,IG) + &
103           !    & Z_FAC011 * ABSA(IND1+9,IG) + &
104           !    & Z_FAC111 * ABSA(IND1+10,IG))   
105           & (&
106           & (1. - Z_FS) * ( ABSA(IND0,IG) * P_FAC00(IPLON,I_LAY) + &
107           &                 ABSA(IND0+9,IG) * P_FAC10(IPLON,I_LAY) + &
108           &                 ABSA(IND1,IG) * P_FAC01(IPLON,I_LAY) + &
109           &                 ABSA(IND1+9,IG) * P_FAC11(IPLON,I_LAY) ) + &
110           & Z_FS        * ( ABSA(IND0+1,IG) * P_FAC00(IPLON,I_LAY) + &
111           &                 ABSA(IND0+10,IG) * P_FAC10(IPLON,I_LAY) + &
112           &                 ABSA(IND1+1,IG) * P_FAC01(IPLON,I_LAY) + &
113           &                 ABSA(IND1+10,IG) * P_FAC11(IPLON,I_LAY) ) &
114           & )
115          !     &           + TAURAY
116          !    SSA(LAY,IG) = TAURAY/TAUG(LAY,IG)
117          P_TAUR(IPLON,I_LAY,IG) = Z_TAURAY
118        ENDDO
119      ENDIF
120    ENDIF
121  ENDDO
122ENDDO
123
124I_LAYSOLFR(:) = I_NLAYERS
125
126DO I_LAY = 1, I_NLAYERS
127  DO IPLON = KIDIA, KFDIA
128    IF (PRMU0(IPLON) > 0.0_JPRB) THEN
129      IF (I_LAY >= K_LAYTROP(IPLON)+1) THEN
130        IF (K_JP(IPLON,I_LAY-1) < LAYREFFR .AND. K_JP(IPLON,I_LAY) >= LAYREFFR) &
131         & I_LAYSOLFR(IPLON) = I_LAY 
132        Z_SPECCOMB = P_COLO3(IPLON,I_LAY) + STRRAT*P_COLO2(IPLON,I_LAY)
133        Z_SPECPARM = P_COLO3(IPLON,I_LAY)/Z_SPECCOMB
134        IF (Z_SPECPARM >= P_ONEMINUS(IPLON)) Z_SPECPARM = P_ONEMINUS(IPLON)
135        Z_SPECMULT = 4.*(Z_SPECPARM)
136        JS = 1 + INT(Z_SPECMULT)
137        Z_FS = MOD(Z_SPECMULT, 1.0_JPRB )
138        ! Z_FAC000 = (1. - Z_FS) * P_FAC00(I_LAY)
139        ! Z_FAC010 = (1. - Z_FS) * P_FAC10(I_LAY)
140        ! Z_FAC100 = Z_FS * P_FAC00(I_LAY)
141        ! Z_FAC110 = Z_FS * P_FAC10(I_LAY)
142        ! Z_FAC001 = (1. - Z_FS) * P_FAC01(I_LAY)
143        ! Z_FAC011 = (1. - Z_FS) * P_FAC11(I_LAY)
144        ! Z_FAC101 = Z_FS * P_FAC01(I_LAY)
145        ! Z_FAC111 = Z_FS * P_FAC11(I_LAY)
146        IND0 = ((K_JP(IPLON,I_LAY)-13)*5+(K_JT(IPLON,I_LAY)-1))*NSPB(28) + JS
147        IND1 = ((K_JP(IPLON,I_LAY)-12)*5+(K_JT1(IPLON,I_LAY)-1))*NSPB(28) + JS
148        Z_TAURAY = P_COLMOL(IPLON,I_LAY) * RAYL
149
150        !  DO IG = 1, NG(28)
151!CDIR UNROLL=NG28
152        DO IG = 1 , NG28
153          P_TAUG(IPLON,I_LAY,IG) = Z_SPECCOMB * &
154           !    & (Z_FAC000 * ABSB(IND0,IG) + &
155           !    & Z_FAC100 * ABSB(IND0+1,IG) + &
156           !    & Z_FAC010 * ABSB(IND0+5,IG) + &
157           !    & Z_FAC110 * ABSB(IND0+6,IG) + &
158           !    & Z_FAC001 * ABSB(IND1,IG) + &
159           !    & Z_FAC101 * ABSB(IND1+1,IG) + &
160           !    & Z_FAC011 * ABSB(IND1+5,IG) + &
161           !    & Z_FAC111 * ABSB(IND1+6,IG))   
162           & (&
163           & (1. - Z_FS) * ( ABSB(IND0,IG) * P_FAC00(IPLON,I_LAY) + &
164           &                 ABSB(IND0+5,IG) * P_FAC10(IPLON,I_LAY) + &
165           &                 ABSB(IND1,IG) * P_FAC01(IPLON,I_LAY) + &
166           &                 ABSB(IND1+5,IG) * P_FAC11(IPLON,I_LAY) ) + &
167           & Z_FS        * ( ABSB(IND0+1,IG) * P_FAC00(IPLON,I_LAY) + &
168           &                 ABSB(IND0+6,IG) * P_FAC10(IPLON,I_LAY) + &
169           &                 ABSB(IND1+1,IG) * P_FAC01(IPLON,I_LAY) + &
170           &                 ABSB(IND1+6,IG) * P_FAC11(IPLON,I_LAY) ) &
171           & )
172          !     &           + TAURAY
173          !    SSA(LAY,IG) = TAURAY/TAUG(LAY,IG)
174          IF (I_LAY == I_LAYSOLFR(IPLON)) P_SFLUXZEN(IPLON,IG) = SFLUXREFC(IG,JS) &
175           & + Z_FS * (SFLUXREFC(IG,JS+1) - SFLUXREFC(IG,JS)) 
176! The following actually improves this band by setting the solar
177! spectrum at each g point equal to what would be computed if
178! molecular oxygen was set to zero. But it is worse overall due to a
179! compensating error with the previous band 27.
180!          IF (I_LAY == I_LAYSOLFR) P_SFLUXZEN(IPLON,IG) = SFLUXREFC(IG,5)
181          P_TAUR(IPLON,I_LAY,IG) = Z_TAURAY
182        ENDDO
183      ENDIF
184    ENDIF
185  ENDDO
186ENDDO
187
188!-----------------------------------------------------------------------
189IF (LHOOK) CALL DR_HOOK('SRTM_TAUMOL28',1,ZHOOK_HANDLE)
190END ASSOCIATE
191END SUBROUTINE SRTM_TAUMOL28
Note: See TracBrowser for help on using the repository browser.