source: LMDZ6/trunk/libf/phylmd/ecrad/ifsrrtm/srtm_taumol25.F90 @ 5408

Last change on this file since 5408 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: 4.4 KB
Line 
1SUBROUTINE SRTM_TAUMOL25 &
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 , 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 25:  16000-22650 cm-1 (low - H2O; high - nothing)
13
14!      PARAMETER (MG=16, MXLAY=203, NBANDS=14)
15
16! Modifications
17!        M.Hamrud      01-Oct-2003 CY28 Cleaning
18
19!     JJMorcrette 2003-02-24 adapted to ECMWF environment
20!        D.Salmond  31-Oct-2007 Vector version in the style of RRTM from Meteo France & NEC
21!     JJMorcrette 20110610 Flexible configuration for number of g-points
22
23USE PARKIND1 , ONLY : JPIM, JPRB
24USE YOMHOOK  , ONLY : LHOOK, DR_HOOK, JPHOOK
25USE PARSRTM  , ONLY : JPG
26USE YOESRTM  , ONLY : NG25
27USE YOESRTA25, ONLY : ABSA, SFLUXREFC, ABSO3AC, ABSO3BC, RAYLC, LAYREFFR 
28USE YOESRTWN , ONLY : NSPA
29
30IMPLICIT NONE
31
32!-- Output
33INTEGER(KIND=JPIM),INTENT(IN)    :: KIDIA, KFDIA
34INTEGER(KIND=JPIM),INTENT(IN)    :: KLEV
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_COLH2O(KIDIA:KFDIA,KLEV)
43REAL(KIND=JPRB)   ,INTENT(IN)    :: P_COLMOL(KIDIA:KFDIA,KLEV)
44REAL(KIND=JPRB)   ,INTENT(IN)    :: P_COLO3(KIDIA:KFDIA,KLEV)
45INTEGER(KIND=JPIM),INTENT(IN)    :: K_LAYTROP(KIDIA:KFDIA)
46
47REAL(KIND=JPRB)   ,INTENT(OUT)   :: P_SFLUXZEN(KIDIA:KFDIA,JPG)
48REAL(KIND=JPRB)   ,INTENT(OUT)   :: P_TAUG(KIDIA:KFDIA,KLEV,JPG)
49REAL(KIND=JPRB)   ,INTENT(OUT)   :: P_TAUR(KIDIA:KFDIA,KLEV,JPG)
50REAL(KIND=JPRB)   ,INTENT(IN)    :: PRMU0(KIDIA:KFDIA)
51!- from INTFAC     
52!- from INTIND
53!- from PRECISE             
54!- from PROFDATA             
55!- from SELF             
56INTEGER(KIND=JPIM) :: IG, IND0, IND1, I_LAY, I_LAYSOLFR(KIDIA:KFDIA), I_NLAYERS, IPLON
57
58INTEGER(KIND=JPIM) :: I_LAY_NEXT
59
60REAL(KIND=JPRB) :: Z_TAURAY 
61REAL(KIND=JPHOOK) :: ZHOOK_HANDLE
62
63IF (LHOOK) CALL DR_HOOK('SRTM_TAUMOL25',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
71I_LAYSOLFR(KIDIA:KFDIA) = K_LAYTROP(KIDIA:KFDIA)
72
73DO I_LAY = 1, I_NLAYERS
74  I_LAY_NEXT = MIN(I_NLAYERS, I_LAY+1)
75  DO IPLON = KIDIA, KFDIA
76    IF (PRMU0(IPLON) > 0.0_JPRB) THEN
77      IF (I_LAY <= K_LAYTROP(IPLON)) THEN
78        IF (K_JP(IPLON,I_LAY) < LAYREFFR .AND. K_JP(IPLON,I_LAY_NEXT) >= LAYREFFR) &
79         & I_LAYSOLFR(IPLON) = MIN(I_LAY+1,K_LAYTROP(IPLON)) 
80        IND0 = ((K_JP(IPLON,I_LAY)-1)*5+(K_JT(IPLON,I_LAY)-1))*NSPA(25) + 1
81        IND1 = (K_JP(IPLON,I_LAY)*5+(K_JT1(IPLON,I_LAY)-1))*NSPA(25) + 1
82
83        !  DO IG = 1, NG(25)
84!CDIR UNROLL=NG25
85        DO IG = 1 , NG25
86          Z_TAURAY = P_COLMOL(IPLON,I_LAY) * RAYLC(IG)
87          P_TAUG(IPLON,I_LAY,IG) = P_COLH2O(IPLON,I_LAY) * &
88           & (P_FAC00(IPLON,I_LAY) * ABSA(IND0,IG) + &
89           & P_FAC10(IPLON,I_LAY) * ABSA(IND0+1,IG) + &
90           & P_FAC01(IPLON,I_LAY) * ABSA(IND1,IG) + &
91           & P_FAC11(IPLON,I_LAY) * ABSA(IND1+1,IG)) + &
92           & P_COLO3(IPLON,I_LAY) * ABSO3AC(IG)   
93          !     &          + TAURAY
94          !    SSA(LAY,IG) = TAURAY/TAUG(LAY,IG)
95          IF (I_LAY == I_LAYSOLFR(IPLON)) P_SFLUXZEN(IPLON,IG) = SFLUXREFC(IG)
96          P_TAUR(IPLON,I_LAY,IG) = Z_TAURAY
97        ENDDO
98      ENDIF
99    ENDIF
100  ENDDO
101ENDDO
102
103DO I_LAY = 1, I_NLAYERS
104  DO IPLON = KIDIA, KFDIA
105    IF (PRMU0(IPLON) > 0.0_JPRB) THEN
106      IF (I_LAY >= K_LAYTROP(IPLON)+1) THEN
107        !  DO IG = 1, NG(25)
108!CDIR UNROLL=NG25
109        DO IG = 1 , NG25
110          Z_TAURAY = P_COLMOL(IPLON,I_LAY) * RAYLC(IG)
111          P_TAUG(IPLON,I_LAY,IG) = P_COLO3(IPLON,I_LAY) * ABSO3BC(IG)
112          !     &          + TAURAY
113          !    SSA(LAY,IG) = TAURAY/TAUG(LAY,IG)
114          P_TAUR(IPLON,I_LAY,IG) = Z_TAURAY
115        ENDDO
116      ENDIF
117    ENDIF
118  ENDDO
119ENDDO
120
121!-----------------------------------------------------------------------
122IF (LHOOK) CALL DR_HOOK('SRTM_TAUMOL25',1,ZHOOK_HANDLE)
123
124END SUBROUTINE SRTM_TAUMOL25
Note: See TracBrowser for help on using the repository browser.