source: LMDZ6/trunk/libf/phylmd/ecrad/ifsrrtm/srtm_taumol27.F90 @ 5440

Last change on this file since 5440 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.5 KB
RevLine 
[4773]1SUBROUTINE SRTM_TAUMOL27 &
2 & ( KIDIA   , KFDIA    , KLEV,&
3 & P_FAC00   , P_FAC01  , P_FAC10   , P_FAC11,&
4 & K_JP      , K_JT     , K_JT1,&
5 & 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 27:  29000-38000 cm-1 (low - O3; high - O3)
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, JPHOOK
23USE PARSRTM  , ONLY : JPG
24USE YOESRTM  , ONLY : NG27
25USE YOESRTA27, ONLY : ABSA, ABSB, SFLUXREFC, RAYLC, LAYREFFR, SCALEKUR 
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_COLMOL(KIDIA:KFDIA,KLEV)
41REAL(KIND=JPRB)   ,INTENT(IN)    :: P_COLO3(KIDIA:KFDIA,KLEV)
42INTEGER(KIND=JPIM),INTENT(IN)    :: K_LAYTROP(KIDIA:KFDIA)
43
44REAL(KIND=JPRB)   ,INTENT(OUT)   :: P_SFLUXZEN(KIDIA:KFDIA,JPG)
45REAL(KIND=JPRB)   ,INTENT(OUT)   :: P_TAUG(KIDIA:KFDIA,KLEV,JPG)
46REAL(KIND=JPRB)   ,INTENT(OUT)   :: P_TAUR(KIDIA:KFDIA,KLEV,JPG)
47REAL(KIND=JPRB)   ,INTENT(IN)    :: PRMU0(KIDIA:KFDIA)
48!- from INTFAC     
49!- from INTIND
50!- from PRECISE             
51!- from PROFDATA             
52!- from SELF             
53INTEGER(KIND=JPIM) :: IG, IND0, IND1, I_LAY, I_LAYSOLFR(KIDIA:KFDIA), I_NLAYERS, IPLON
54
55REAL(KIND=JPRB) :: Z_TAURAY 
56REAL(KIND=JPHOOK) :: ZHOOK_HANDLE
57
58IF (LHOOK) CALL DR_HOOK('SRTM_TAUMOL27',0,ZHOOK_HANDLE)
59
60I_NLAYERS = KLEV
61
62!     Compute the optical depth by interpolating in ln(pressure),
63!     temperature, and appropriate species.  Below LAYTROP, the water
64!     vapor self-continuum is interpolated (in temperature) separately. 
65DO I_LAY = 1, I_NLAYERS
66  DO IPLON = KIDIA, KFDIA
67    IF (PRMU0(IPLON) > 0.0_JPRB) THEN
68      IF (I_LAY <= K_LAYTROP(IPLON)) THEN
69        IND0 = ((K_JP(IPLON,I_LAY)-1)*5+(K_JT(IPLON,I_LAY)-1))*NSPA(27) + 1
70        IND1 = (K_JP(IPLON,I_LAY)*5+(K_JT1(IPLON,I_LAY)-1))*NSPA(27) + 1
71
72        !  DO IG = 1, NG(27)
73!CDIR UNROLL=NG27
74        DO IG = 1 , NG27
75          Z_TAURAY = P_COLMOL(IPLON,I_LAY) * RAYLC(IG)
76          P_TAUG(IPLON,I_LAY,IG) = P_COLO3(IPLON,I_LAY) * &
77           & (P_FAC00(IPLON,I_LAY) * ABSA(IND0,IG) + &
78           & P_FAC10(IPLON,I_LAY) * ABSA(IND0+1,IG) + &
79           & P_FAC01(IPLON,I_LAY) * ABSA(IND1,IG) + &
80           & P_FAC11(IPLON,I_LAY) * ABSA(IND1+1,IG)) 
81          !     &          + TAURAY
82          !    SSA(LAY,IG) = TAURAY/TAUG(LAY,IG)
83          P_TAUR(IPLON,I_LAY,IG) = Z_TAURAY
84        ENDDO
85      ENDIF
86    ENDIF
87  ENDDO
88ENDDO
89
90I_LAYSOLFR(:) = I_NLAYERS
91
92DO I_LAY = 1, I_NLAYERS
93  DO IPLON = KIDIA, KFDIA
94    IF (PRMU0(IPLON) > 0.0_JPRB) THEN
95      IF (I_LAY >= K_LAYTROP(IPLON)+1) THEN
96        IF (K_JP(IPLON,I_LAY-1) < LAYREFFR .AND. K_JP(IPLON,I_LAY) >= LAYREFFR) &
97         & I_LAYSOLFR(IPLON) = I_LAY 
98        IND0 = ((K_JP(IPLON,I_LAY)-13)*5+(K_JT(IPLON,I_LAY)-1))*NSPB(27) + 1
99        IND1 = ((K_JP(IPLON,I_LAY)-12)*5+(K_JT1(IPLON,I_LAY)-1))*NSPB(27) + 1
100
101        !  DO IG = 1, NG(27)
102!CDIR UNROLL=NG27
103        DO IG = 1 , NG27
104          Z_TAURAY = P_COLMOL(IPLON,I_LAY) * RAYLC(IG)
105          P_TAUG(IPLON,I_LAY,IG) = P_COLO3(IPLON,I_LAY) * &
106           & (P_FAC00(IPLON,I_LAY) * ABSB(IND0,IG) + &
107           & P_FAC10(IPLON,I_LAY) * ABSB(IND0+1,IG) + &
108           & P_FAC01(IPLON,I_LAY) * ABSB(IND1,IG) +  &
109           & P_FAC11(IPLON,I_LAY) * ABSB(IND1+1,IG)) 
110          !     &          + TAURAY
111          !    SSA(LAY,IG) = TAURAY/TAUG(LAY,IG)
112          IF (I_LAY == I_LAYSOLFR(IPLON)) P_SFLUXZEN(IPLON,IG) = SCALEKUR * SFLUXREFC(IG)
113          P_TAUR(IPLON,I_LAY,IG) = Z_TAURAY
114        ENDDO
115      ENDIF
116    ENDIF
117  ENDDO
118ENDDO
119
120!-----------------------------------------------------------------------
121IF (LHOOK) CALL DR_HOOK('SRTM_TAUMOL27',1,ZHOOK_HANDLE)
122
123END SUBROUTINE SRTM_TAUMOL27
Note: See TracBrowser for help on using the repository browser.