source: LMDZ6/trunk/libf/phylmd/ecrad.v1.5.1/srtm_taumol23.F90 @ 4976

Last change on this file since 4976 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: 5.1 KB
Line 
1SUBROUTINE SRTM_TAUMOL23 &
2 & ( KIDIA   , KFDIA    , KLEV,&
3 & P_FAC00   , P_FAC01  , P_FAC10   , P_FAC11,&
4 & K_JP      , K_JT     , K_JT1,&
5 & P_COLH2O  , P_COLMOL,&
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 23:  8050-12850 cm-1 (low - H2O; high - nothing)
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 : NG23
25USE YOESRTA23, ONLY : ABSA, FORREFC, SELFREFC, SFLUXREFC, RAYLC, LAYREFFR, GIVFAC   
26USE YOESRTWN , ONLY : NSPA
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_COLH2O(KIDIA:KFDIA,KLEV)
41REAL(KIND=JPRB)   ,INTENT(IN)    :: P_COLMOL(KIDIA:KFDIA,KLEV)
42INTEGER(KIND=JPIM),INTENT(IN)    :: K_LAYTROP(KIDIA:KFDIA)
43REAL(KIND=JPRB)   ,INTENT(IN)    :: P_SELFFAC(KIDIA:KFDIA,KLEV)
44REAL(KIND=JPRB)   ,INTENT(IN)    :: P_SELFFRAC(KIDIA:KFDIA,KLEV)
45INTEGER(KIND=JPIM),INTENT(IN)    :: K_INDSELF(KIDIA:KFDIA,KLEV)
46REAL(KIND=JPRB)   ,INTENT(IN)    :: P_FORFAC(KIDIA:KFDIA,KLEV)
47REAL(KIND=JPRB)   ,INTENT(IN)    :: P_FORFRAC(KIDIA:KFDIA,KLEV)
48INTEGER(KIND=JPIM),INTENT(IN)    :: K_INDFOR(KIDIA:KFDIA,KLEV)
49
50REAL(KIND=JPRB)   ,INTENT(OUT)   :: P_SFLUXZEN(KIDIA:KFDIA,JPG)
51REAL(KIND=JPRB)   ,INTENT(OUT)   :: P_TAUG(KIDIA:KFDIA,KLEV,JPG)
52REAL(KIND=JPRB)   ,INTENT(OUT)   :: P_TAUR(KIDIA:KFDIA,KLEV,JPG)
53REAL(KIND=JPRB)   ,INTENT(IN)    :: PRMU0(KIDIA:KFDIA)
54!- from INTFAC     
55!- from INTIND
56!- from PRECISE             
57!- from PROFDATA             
58!- from SELF             
59INTEGER(KIND=JPIM) :: IG, IND0, IND1, INDS, INDF, I_LAY, I_LAYSOLFR(KIDIA:KFDIA), I_NLAYERS, IPLON
60
61INTEGER(KIND=JPIM) :: I_LAY_NEXT
62
63REAL(KIND=JPRB) ::  &
64 & Z_TAURAY 
65REAL(KIND=JPRB) :: ZHOOK_HANDLE
66
67ASSOCIATE(NFLEVG=>KLEV)
68IF (LHOOK) CALL DR_HOOK('SRTM_TAUMOL23',0,ZHOOK_HANDLE)
69
70I_NLAYERS = KLEV
71
72!     Compute the optical depth by interpolating in ln(pressure),
73!     temperature, and appropriate species.  Below LAYTROP, the water
74!     vapor self-continuum is interpolated (in temperature) separately. 
75
76I_LAYSOLFR(KIDIA:KFDIA) = K_LAYTROP(KIDIA:KFDIA)
77
78DO I_LAY = 1, I_NLAYERS
79  I_LAY_NEXT = MIN(I_NLAYERS, I_LAY+1)
80  DO IPLON = KIDIA, KFDIA
81    IF (PRMU0(IPLON) > 0.0_JPRB) THEN
82      IF (I_LAY <= K_LAYTROP(IPLON)) THEN
83        IF (K_JP(IPLON,I_LAY) < LAYREFFR .AND. K_JP(IPLON,I_LAY_NEXT) >= LAYREFFR) &
84         & I_LAYSOLFR(IPLON) = MIN(I_LAY+1,K_LAYTROP(IPLON)) 
85        IND0 = ((K_JP(IPLON,I_LAY)-1)*5+(K_JT(IPLON,I_LAY)-1))*NSPA(23) + 1
86        IND1 = (K_JP(IPLON,I_LAY)*5+(K_JT1(IPLON,I_LAY)-1))*NSPA(23) + 1
87        INDS = K_INDSELF(IPLON,I_LAY)
88        INDF = K_INDFOR(IPLON,I_LAY)
89
90        !  DO IG = 1, NG(23)
91!CDIR UNROLL=NG23
92        DO IG = 1 , NG23
93          Z_TAURAY = P_COLMOL(IPLON,I_LAY) * RAYLC(IG)
94          P_TAUG(IPLON,I_LAY,IG) = P_COLH2O(IPLON,I_LAY) * &
95           & (GIVFAC * (P_FAC00(IPLON,I_LAY) * ABSA(IND0,IG) + &
96           & P_FAC10(IPLON,I_LAY) * ABSA(IND0+1,IG) + &
97           & P_FAC01(IPLON,I_LAY) * ABSA(IND1,IG) + &
98           & P_FAC11(IPLON,I_LAY) * ABSA(IND1+1,IG)) + &
99           & P_SELFFAC(IPLON,I_LAY) * (SELFREFC(INDS,IG) + &
100           & P_SELFFRAC(IPLON,I_LAY) * &
101           & (SELFREFC(INDS+1,IG) - SELFREFC(INDS,IG))) + &
102           & P_FORFAC(IPLON,I_LAY) * (FORREFC(INDF,IG) + &
103           & P_FORFRAC(IPLON,I_LAY) * &
104           & (FORREFC(INDF+1,IG) - FORREFC(INDF,IG))))   
105          !     &          + TAURAY
106          !    SSA(LAY,IG) = TAURAY/TAUG(LAY,IG)
107          IF (I_LAY == I_LAYSOLFR(IPLON)) P_SFLUXZEN(IPLON,IG) = SFLUXREFC(IG)
108          P_TAUR(IPLON,I_LAY,IG) = Z_TAURAY
109        ENDDO
110      ENDIF
111    ENDIF
112  ENDDO
113ENDDO
114
115DO I_LAY = 1, I_NLAYERS
116  DO IPLON = KIDIA, KFDIA
117    IF (PRMU0(IPLON) > 0.0_JPRB) THEN
118      IF (I_LAY >= K_LAYTROP(IPLON)+1) THEN
119        !  DO IG = 1, NG(23)
120!CDIR UNROLL=NG23
121        DO IG = 1 , NG23
122          !    TAUG(LAY,IG) = COLMOL(LAY) * RAYLC(IG)
123          !    SSA(LAY,IG) = 1.0
124          P_TAUG(IPLON,I_LAY,IG) = 0.0_JPRB
125          P_TAUR(IPLON,I_LAY,IG) = P_COLMOL(IPLON,I_LAY) * RAYLC(IG)
126        ENDDO
127      ENDIF
128    ENDIF
129  ENDDO
130ENDDO
131
132!-----------------------------------------------------------------------
133IF (LHOOK) CALL DR_HOOK('SRTM_TAUMOL23',1,ZHOOK_HANDLE)
134END ASSOCIATE
135END SUBROUTINE SRTM_TAUMOL23
Note: See TracBrowser for help on using the repository browser.