GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: phylmd/rrtm/srtm_taumol28.F90 Lines: 0 34 0.0 %
Date: 2023-06-30 12:51:15 Branches: 0 22 0.0 %

Line Branch Exec Source
1
SUBROUTINE SRTM_TAUMOL28 &
2
 & ( 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    &
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
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, NG28
25
USE YOESRTA28, ONLY : ABSA, ABSB &
26
 & , SFLUXREFC, RAYL &
27
 & , LAYREFFR, STRRAT
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_COLMOL(JPLAY)
43
REAL(KIND=JPRB)   ,INTENT(IN)    :: P_COLO2(JPLAY)
44
REAL(KIND=JPRB)   ,INTENT(IN)    :: P_COLO3(JPLAY)
45
INTEGER(KIND=JPIM),INTENT(IN)    :: K_LAYTROP
46
47
REAL(KIND=JPRB)   ,INTENT(OUT)   :: P_SFLUXZEN(JPG)
48
REAL(KIND=JPRB)   ,INTENT(OUT)   :: P_TAUG(JPLAY,JPG)
49
REAL(KIND=JPRB)   ,INTENT(OUT)   :: P_TAUR(JPLAY,JPG)
50
!- from INTFAC
51
!- from INTIND
52
!- from PRECISE
53
!- from PROFDATA
54
!- from SELF
55
INTEGER(KIND=JPIM) :: IG, IND0, IND1, JS, I_LAY, I_LAYSOLFR, I_NLAYERS
56
57
REAL(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
60
REAL(KIND=JPRB) :: ZHOOK_HANDLE
61
62
IF (LHOOK) CALL DR_HOOK('SRTM_TAUMOL28',0,ZHOOK_HANDLE)
63
I_NLAYERS = KLEV
64
65
!     Compute the optical depth by interpolating in ln(pressure),
66
!     temperature, and appropriate species.  Below LAYTROP, the water
67
!     vapor self-continuum is interpolated (in temperature) separately.
68
69
DO I_LAY = 1, K_LAYTROP
70
  Z_SPECCOMB = P_COLO3(I_LAY) + STRRAT*P_COLO2(I_LAY)
71
  Z_SPECPARM = P_COLO3(I_LAY)/Z_SPECCOMB
72
  IF (Z_SPECPARM >= P_ONEMINUS) Z_SPECPARM = P_ONEMINUS
73
  Z_SPECMULT = 8.*(Z_SPECPARM)
74
  JS = 1 + INT(Z_SPECMULT)
75
  Z_FS = MOD(Z_SPECMULT, 1.0_JPRB )
76
! Z_FAC000 = (1. - Z_FS) * P_FAC00(I_LAY)
77
! Z_FAC010 = (1. - Z_FS) * P_FAC10(I_LAY)
78
! Z_FAC100 = Z_FS * P_FAC00(I_LAY)
79
! Z_FAC110 = Z_FS * P_FAC10(I_LAY)
80
! Z_FAC001 = (1. - Z_FS) * P_FAC01(I_LAY)
81
! Z_FAC011 = (1. - Z_FS) * P_FAC11(I_LAY)
82
! Z_FAC101 = Z_FS * P_FAC01(I_LAY)
83
! Z_FAC111 = Z_FS * P_FAC11(I_LAY)
84
  IND0 = ((K_JP(I_LAY)-1)*5+(K_JT(I_LAY)-1))*NSPA(28) + JS
85
  IND1 = (K_JP(I_LAY)*5+(K_JT1(I_LAY)-1))*NSPA(28) + JS
86
  Z_TAURAY = P_COLMOL(I_LAY) * RAYL
87
88
!  DO IG = 1, NG(28)
89
  DO IG = 1 , NG28
90
    P_TAUG(I_LAY,IG) = Z_SPECCOMB * &
91
!    & (Z_FAC000 * ABSA(IND0,IG) + &
92
!    & Z_FAC100 * ABSA(IND0+1,IG) + &
93
!    & Z_FAC010 * ABSA(IND0+9,IG) + &
94
!    & Z_FAC110 * ABSA(IND0+10,IG) + &
95
!    & Z_FAC001 * ABSA(IND1,IG) + &
96
!    & Z_FAC101 * ABSA(IND1+1,IG) + &
97
!    & Z_FAC011 * ABSA(IND1+9,IG) + &
98
!    & Z_FAC111 * ABSA(IND1+10,IG))
99
     & (&
100
     & (1. - Z_FS) * ( ABSA(IND0,IG) * P_FAC00(I_LAY) + &
101
     &                 ABSA(IND0+9,IG) * P_FAC10(I_LAY) + &
102
     &                 ABSA(IND1,IG) * P_FAC01(I_LAY) + &
103
     &                 ABSA(IND1+9,IG) * P_FAC11(I_LAY) ) + &
104
     & Z_FS        * ( ABSA(IND0+1,IG) * P_FAC00(I_LAY) + &
105
     &                 ABSA(IND0+10,IG) * P_FAC10(I_LAY) + &
106
     &                 ABSA(IND1+1,IG) * P_FAC01(I_LAY) + &
107
     &                 ABSA(IND1+10,IG) * P_FAC11(I_LAY) ) &
108
     & )
109
!     &           + TAURAY
110
!    SSA(LAY,IG) = TAURAY/TAUG(LAY,IG)
111
    P_TAUR(I_LAY,IG) = Z_TAURAY
112
  ENDDO
113
ENDDO
114
115
I_LAYSOLFR = I_NLAYERS
116
117
DO I_LAY = K_LAYTROP+1, I_NLAYERS
118
  IF (K_JP(I_LAY-1) < LAYREFFR .AND. K_JP(I_LAY) >= LAYREFFR) &
119
   & I_LAYSOLFR = I_LAY
120
  Z_SPECCOMB = P_COLO3(I_LAY) + STRRAT*P_COLO2(I_LAY)
121
  Z_SPECPARM = P_COLO3(I_LAY)/Z_SPECCOMB
122
  IF (Z_SPECPARM >= P_ONEMINUS) Z_SPECPARM = P_ONEMINUS
123
  Z_SPECMULT = 4.*(Z_SPECPARM)
124
  JS = 1 + INT(Z_SPECMULT)
125
  Z_FS = MOD(Z_SPECMULT, 1.0_JPRB )
126
! Z_FAC000 = (1. - Z_FS) * P_FAC00(I_LAY)
127
! Z_FAC010 = (1. - Z_FS) * P_FAC10(I_LAY)
128
! Z_FAC100 = Z_FS * P_FAC00(I_LAY)
129
! Z_FAC110 = Z_FS * P_FAC10(I_LAY)
130
! Z_FAC001 = (1. - Z_FS) * P_FAC01(I_LAY)
131
! Z_FAC011 = (1. - Z_FS) * P_FAC11(I_LAY)
132
! Z_FAC101 = Z_FS * P_FAC01(I_LAY)
133
! Z_FAC111 = Z_FS * P_FAC11(I_LAY)
134
  IND0 = ((K_JP(I_LAY)-13)*5+(K_JT(I_LAY)-1))*NSPB(28) + JS
135
  IND1 = ((K_JP(I_LAY)-12)*5+(K_JT1(I_LAY)-1))*NSPB(28) + JS
136
  Z_TAURAY = P_COLMOL(I_LAY) * RAYL
137
138
!  DO IG = 1, NG(28)
139
  DO IG = 1 , NG28
140
    P_TAUG(I_LAY,IG) = Z_SPECCOMB * &
141
!    & (Z_FAC000 * ABSB(IND0,IG) + &
142
!    & Z_FAC100 * ABSB(IND0+1,IG) + &
143
!    & Z_FAC010 * ABSB(IND0+5,IG) + &
144
!    & Z_FAC110 * ABSB(IND0+6,IG) + &
145
!    & Z_FAC001 * ABSB(IND1,IG) + &
146
!    & Z_FAC101 * ABSB(IND1+1,IG) + &
147
!    & Z_FAC011 * ABSB(IND1+5,IG) + &
148
!    & Z_FAC111 * ABSB(IND1+6,IG))
149
     & (&
150
     & (1. - Z_FS) * ( ABSB(IND0,IG) * P_FAC00(I_LAY) + &
151
     &                 ABSB(IND0+5,IG) * P_FAC10(I_LAY) + &
152
     &                 ABSB(IND1,IG) * P_FAC01(I_LAY) + &
153
     &                 ABSB(IND1+5,IG) * P_FAC11(I_LAY) ) + &
154
     & Z_FS        * ( ABSB(IND0+1,IG) * P_FAC00(I_LAY) + &
155
     &                 ABSB(IND0+6,IG) * P_FAC10(I_LAY) + &
156
     &                 ABSB(IND1+1,IG) * P_FAC01(I_LAY) + &
157
     &                 ABSB(IND1+6,IG) * P_FAC11(I_LAY) ) &
158
     & )
159
!     &           + TAURAY
160
!    SSA(LAY,IG) = TAURAY/TAUG(LAY,IG)
161
    IF (I_LAY == I_LAYSOLFR) P_SFLUXZEN(IG) = SFLUXREFC(IG,JS) &
162
     & + Z_FS * (SFLUXREFC(IG,JS+1) - SFLUXREFC(IG,JS))
163
    P_TAUR(I_LAY,IG) = Z_TAURAY
164
  ENDDO
165
ENDDO
166
167
!-----------------------------------------------------------------------
168
IF (LHOOK) CALL DR_HOOK('SRTM_TAUMOL28',1,ZHOOK_HANDLE)
169
END SUBROUTINE SRTM_TAUMOL28
170