GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: phylmd/rrtm/srtm_taumol16.F90 Lines: 0 29 0.0 %
Date: 2023-06-30 12:56:34 Branches: 0 20 0.0 %

Line Branch Exec Source
1
SUBROUTINE SRTM_TAUMOL16 &
2
 & ( KLEV,&
3
 & P_FAC00   , P_FAC01   , P_FAC10   , P_FAC11,&
4
 & K_JP      , K_JT      , K_JT1     , P_ONEMINUS,&
5
 & P_COLH2O  , P_COLCH4  , P_COLMOL,&
6
 & K_LAYTROP , P_SELFFAC , P_SELFFRAC, K_INDSELF , P_FORFAC  , P_FORFRAC, K_INDFOR,&
7
 & P_SFLUXZEN, P_TAUG    , P_TAUR    &
8
 & )
9
10
!     Written by Eli J. Mlawer, Atmospheric & Environmental Research.
11
12
!     BAND 16:  2600-3250 cm-1 (low - H2O,CH4; high - CH4)
13
14
! Modifications
15
!        M.Hamrud      01-Oct-2003 CY28 Cleaning
16
17
!     JJMorcrette 2003-02-24 adapted to ECMWF environment
18
19
!      PARAMETER (MG=16, MXLAY=203, NBANDS=14)
20
21
USE PARKIND1  ,ONLY : JPIM     ,JPRB
22
USE YOMHOOK   ,ONLY : LHOOK,   DR_HOOK
23
24
USE PARSRTM  , ONLY : JPLAY, JPG, NG16
25
USE YOESRTA16, ONLY : ABSA, ABSB, FORREFC, SELFREFC &
26
 & , SFLUXREFC, RAYL &
27
 & , LAYREFFR, STRRAT1
28
USE YOESRTWN , ONLY : NSPA, NSPB
29
30
IMPLICIT NONE
31
32
!-- Output
33
INTEGER(KIND=JPIM),INTENT(IN)    :: KLEV
34
REAL(KIND=JPRB)   ,INTENT(IN)    :: P_FAC00(JPLAY)
35
REAL(KIND=JPRB)   ,INTENT(IN)    :: P_FAC01(JPLAY)
36
REAL(KIND=JPRB)   ,INTENT(IN)    :: P_FAC10(JPLAY)
37
REAL(KIND=JPRB)   ,INTENT(IN)    :: P_FAC11(JPLAY)
38
INTEGER(KIND=JPIM),INTENT(IN)    :: K_JP(JPLAY)
39
INTEGER(KIND=JPIM),INTENT(IN)    :: K_JT(JPLAY)
40
INTEGER(KIND=JPIM),INTENT(IN)    :: K_JT1(JPLAY)
41
REAL(KIND=JPRB)   ,INTENT(IN)    :: P_ONEMINUS
42
REAL(KIND=JPRB)   ,INTENT(IN)    :: P_COLH2O(JPLAY)
43
REAL(KIND=JPRB)   ,INTENT(IN)    :: P_COLCH4(JPLAY)
44
REAL(KIND=JPRB)   ,INTENT(IN)    :: P_COLMOL(JPLAY)
45
INTEGER(KIND=JPIM),INTENT(IN)    :: K_LAYTROP
46
REAL(KIND=JPRB)   ,INTENT(IN)    :: P_SELFFAC(JPLAY)
47
REAL(KIND=JPRB)   ,INTENT(IN)    :: P_SELFFRAC(JPLAY)
48
INTEGER(KIND=JPIM),INTENT(IN)    :: K_INDSELF(JPLAY)
49
REAL(KIND=JPRB)   ,INTENT(IN)    :: P_FORFAC(JPLAY)
50
REAL(KIND=JPRB)   ,INTENT(IN)    :: P_FORFRAC(JPLAY)
51
INTEGER(KIND=JPIM),INTENT(IN)    :: K_INDFOR(JPLAY)
52
53
REAL(KIND=JPRB)   ,INTENT(OUT)   :: P_SFLUXZEN(JPG)
54
REAL(KIND=JPRB)   ,INTENT(OUT)   :: P_TAUG(JPLAY,JPG)
55
REAL(KIND=JPRB)   ,INTENT(OUT)   :: P_TAUR(JPLAY,JPG)
56
!- from INTFAC
57
!- from INTIND
58
!- from PRECISE
59
!- from PROFDATA
60
!- from SELF
61
INTEGER(KIND=JPIM) :: IG, IND0, IND1, INDS, INDF, JS, I_LAY, I_LAYSOLFR, I_NLAYERS
62
63
REAL(KIND=JPRB) :: Z_FAC000, Z_FAC001, Z_FAC010, Z_FAC011, Z_FAC100, Z_FAC101,&
64
 & Z_FAC110, Z_FAC111, Z_FS, Z_SPECCOMB, Z_SPECMULT, Z_SPECPARM, &
65
 & Z_TAURAY
66
REAL(KIND=JPRB) :: ZHOOK_HANDLE
67
68
IF (LHOOK) CALL DR_HOOK('SRTM_TAUMOL16',0,ZHOOK_HANDLE)
69
I_NLAYERS = KLEV
70
71
!     Compute the optical depth by interpolating in ln(pressure),
72
!     temperature, and appropriate species.  Below LAYTROP, the water
73
!     vapor self-continuum is interpolated (in temperature) separately.
74
75
DO I_LAY = 1, K_LAYTROP
76
  Z_SPECCOMB = P_COLH2O(I_LAY) + STRRAT1*P_COLCH4(I_LAY)
77
  Z_SPECPARM = P_COLH2O(I_LAY)/Z_SPECCOMB
78
  IF (Z_SPECPARM >= P_ONEMINUS) Z_SPECPARM = P_ONEMINUS
79
  Z_SPECMULT = 8._JPRB*(Z_SPECPARM)
80
  JS = 1 + INT(Z_SPECMULT)
81
  Z_FS = MOD(Z_SPECMULT, 1.0_JPRB )
82
! Z_FAC000 = (1.0_JPRB - Z_FS) * P_FAC00(I_LAY)
83
! Z_FAC010 = (1.0_JPRB - Z_FS) * P_FAC10(I_LAY)
84
! Z_FAC100 = Z_FS * P_FAC00(I_LAY)
85
! Z_FAC110 = Z_FS * P_FAC10(I_LAY)
86
! Z_FAC001 = (1.0_JPRB - Z_FS) * P_FAC01(I_LAY)
87
! Z_FAC011 = (1.0_JPRB - Z_FS) * P_FAC11(I_LAY)
88
! Z_FAC101 = Z_FS * P_FAC01(I_LAY)
89
! Z_FAC111 = Z_FS * P_FAC11(I_LAY)
90
  IND0 = ((K_JP(I_LAY)-1)*5+(K_JT(I_LAY)-1))*NSPA(16) + JS
91
  IND1 = (K_JP(I_LAY)*5+(K_JT1(I_LAY)-1))*NSPA(16) + JS
92
  INDS = K_INDSELF(I_LAY)
93
  INDF = K_INDFOR(I_LAY)
94
  Z_TAURAY = P_COLMOL(I_LAY) * RAYL
95
96
!  print 9001,LAY,IND0,IND1,INDS,INDF,FAC000,FAC010,FAC100,FAC110,FAC001,FAC011,FAC101,FAC111 &
97
!   &,TAURAY,SELFFAC(LAY),SELFFRAC(LAY),FORFAC(LAY),FORFRAC(LAY)
98
  9001 format(1x,'T16 ',5I4,13E12.3)
99
100
!  DO IG = 1, NG(16)
101
  DO IG = 1, NG16
102
    P_TAUG(I_LAY,IG) = Z_SPECCOMB * &
103
!    & (Z_FAC000 * ABSA(IND0   ,IG) + &
104
!    & Z_FAC100 * ABSA(IND0 +1,IG) + &
105
!    & Z_FAC010 * ABSA(IND0 +9,IG) + &
106
!    & Z_FAC110 * ABSA(IND0+10,IG) + &
107
!    & Z_FAC001 * ABSA(IND1   ,IG) + &
108
!    & Z_FAC101 * ABSA(IND1 +1,IG) + &
109
!    & Z_FAC011 * ABSA(IND1 +9,IG) + &
110
!    & Z_FAC111 * ABSA(IND1+10,IG)) + &
111
     & (&
112
     & (1. - Z_FS) * ( ABSA(IND0,IG) * P_FAC00(I_LAY) + &
113
     &                 ABSA(IND0+9,IG) * P_FAC10(I_LAY) + &
114
     &                 ABSA(IND1,IG) * P_FAC01(I_LAY) + &
115
     &                 ABSA(IND1+9,IG) * P_FAC11(I_LAY) ) + &
116
     & Z_FS        * ( ABSA(IND0+1,IG) * P_FAC00(I_LAY) + &
117
     &                 ABSA(IND0+10,IG) * P_FAC10(I_LAY) + &
118
     &                 ABSA(IND1+1,IG) * P_FAC01(I_LAY) + &
119
     &                 ABSA(IND1+10,IG) * P_FAC11(I_LAY) ) &
120
     & ) + &
121
     & P_COLH2O(I_LAY) * &
122
     & (P_SELFFAC(I_LAY) * (SELFREFC(INDS,IG) + &
123
     & P_SELFFRAC(I_LAY) * &
124
     & (SELFREFC(INDS+1,IG) - SELFREFC(INDS,IG))) + &
125
     & P_FORFAC(I_LAY) * (FORREFC(INDF,IG) + &
126
     & P_FORFRAC(I_LAY) * &
127
     & (FORREFC(INDF+1,IG) - FORREFC(INDF,IG))))
128
!     &           + TAURAY
129
!    SSA(LAY,IG) = TAURAY/TAUG(LAY,IG)
130
    P_TAUR(I_LAY,IG) = Z_TAURAY
131
!    print 9002,LAY,IG,ABSA(IND0,IG),ABSA(IND0+1,IG),ABSA(IND0+9,IG),ABSA(IND0+10,IG) &
132
!      &, ABSA(IND1,IG),ABSA(IND1+1,IG),ABSA(IND1+9,IG),ABSA(IND1+10,IG) &
133
!      &, SELFREFC(INDS+1,IG),SELFREFC(INDS,IG),FORREFC(INDF+1,IG),FORREFC(INDF,IG)
134
    9002 format(1x,'U16 ',2I3,12E12.3)
135
  ENDDO
136
ENDDO
137
138
I_LAYSOLFR = I_NLAYERS
139
140
DO I_LAY = K_LAYTROP+1, I_NLAYERS
141
  IF (K_JP(I_LAY-1) < LAYREFFR .AND. K_JP(I_LAY) >= LAYREFFR) &
142
   & I_LAYSOLFR = I_LAY
143
  IND0 = ((K_JP(I_LAY)-13)*5+(K_JT(I_LAY)-1))*NSPB(16) + 1
144
  IND1 = ((K_JP(I_LAY)-12)*5+(K_JT1(I_LAY)-1))*NSPB(16) + 1
145
  Z_TAURAY = P_COLMOL(I_LAY) * RAYL
146
147
!  DO IG = 1, NG(16)
148
  DO IG = 1, NG16
149
    P_TAUG(I_LAY,IG) = P_COLCH4(I_LAY) * &
150
     & (P_FAC00(I_LAY) * ABSB(IND0  ,IG) + &
151
     & P_FAC10(I_LAY) * ABSB(IND0+1,IG) + &
152
     & P_FAC01(I_LAY) * ABSB(IND1  ,IG) + &
153
     & P_FAC11(I_LAY) * ABSB(IND1+1,IG))
154
!     &           + TAURAY
155
!    SSA(LAY,IG) = TAURAY/TAUG(LAY,IG)
156
    IF (I_LAY == I_LAYSOLFR) P_SFLUXZEN(IG) = SFLUXREFC(IG)
157
    P_TAUR(I_LAY,IG) = Z_TAURAY
158
  ENDDO
159
ENDDO
160
161
!DO LAY=1,NLAYERS
162
!  print 9003,LAY,(TAUG(LAY,IG),IG=1,NG16)
163
9003 format(1x,'O16 ',I3,16E13.5)
164
!END DO
165
166
!----------------------------------------------------------------------
167
IF (LHOOK) CALL DR_HOOK('SRTM_TAUMOL16',1,ZHOOK_HANDLE)
168
END SUBROUTINE SRTM_TAUMOL16
169