GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: phylmd/rrtm/rrtm_taumol15.F90 Lines: 31 31 100.0 %
Date: 2023-06-30 12:51:15 Branches: 6 8 75.0 %

Line Branch Exec Source
1
!----------------------------------------------------------------------------
2
71568
SUBROUTINE RRTM_TAUMOL15 (KLEV,P_TAU,&
3
 & P_TAUAERL,P_FAC00,P_FAC01,P_FAC10,P_FAC11,K_JP,K_JT,K_JT1,P_ONEMINUS,&
4
 & P_COLH2O,P_COLCO2,P_COLN2O,K_LAYTROP,P_SELFFAC,P_SELFFRAC,K_INDSELF,PFRAC)
5
6
!     BAND 15:  2380-2600 cm-1 (low - N2O,CO2; high - nothing)
7
8
! Modifications
9
!        M.Hamrud      01-Oct-2003 CY28 Cleaning
10
11
!     D Salmond 1999-07-14 speed-up
12
13
USE PARKIND1  ,ONLY : JPIM     ,JPRB
14
USE YOMHOOK   ,ONLY : LHOOK,   DR_HOOK
15
16
USE PARRRTM  , ONLY : JPLAY  ,JPBAND ,JPGPT  ,NGS14
17
USE YOERRTWN , ONLY :      NSPA
18
USE YOERRTA15, ONLY : ABSA   ,FRACREFA,SELFREF,STRRAT
19
20
IMPLICIT NONE
21
22
!  Output
23
INTEGER(KIND=JPIM),INTENT(IN)    :: KLEV
24
REAL(KIND=JPRB)   ,INTENT(OUT)   :: P_TAU(JPGPT,JPLAY)
25
REAL(KIND=JPRB)   ,INTENT(IN)    :: P_TAUAERL(JPLAY,JPBAND)
26
REAL(KIND=JPRB)   ,INTENT(IN)    :: P_FAC00(JPLAY)
27
REAL(KIND=JPRB)   ,INTENT(IN)    :: P_FAC01(JPLAY)
28
REAL(KIND=JPRB)   ,INTENT(IN)    :: P_FAC10(JPLAY)
29
REAL(KIND=JPRB)   ,INTENT(IN)    :: P_FAC11(JPLAY)
30
INTEGER(KIND=JPIM),INTENT(IN)    :: K_JP(JPLAY)
31
INTEGER(KIND=JPIM),INTENT(IN)    :: K_JT(JPLAY)
32
INTEGER(KIND=JPIM),INTENT(IN)    :: K_JT1(JPLAY)
33
REAL(KIND=JPRB)   ,INTENT(IN)    :: P_ONEMINUS
34
REAL(KIND=JPRB)   ,INTENT(IN)    :: P_COLH2O(JPLAY)
35
REAL(KIND=JPRB)   ,INTENT(IN)    :: P_COLCO2(JPLAY)
36
REAL(KIND=JPRB)   ,INTENT(IN)    :: P_COLN2O(JPLAY)
37
INTEGER(KIND=JPIM),INTENT(IN)    :: K_LAYTROP
38
REAL(KIND=JPRB)   ,INTENT(IN)    :: P_SELFFAC(JPLAY)
39
REAL(KIND=JPRB)   ,INTENT(IN)    :: P_SELFFRAC(JPLAY)
40
INTEGER(KIND=JPIM),INTENT(IN)    :: K_INDSELF(JPLAY)
41
REAL(KIND=JPRB)   ,INTENT(OUT)   :: PFRAC(JPGPT,JPLAY)
42
!- from AER
43
!- from INTFAC
44
!- from INTIND
45
!- from PRECISE
46
!- from PROFDATA
47
!- from SELF
48
!- from SP
49
INTEGER(KIND=JPIM) :: IG, IND0, IND1, INDS, JS, I_LAY
50
51
REAL(KIND=JPRB) :: Z_FAC000, Z_FAC001, Z_FAC010, Z_FAC011, Z_FAC100, Z_FAC101,&
52
 & Z_FAC110, Z_FAC111, Z_FS, Z_SPECCOMB, Z_SPECMULT, Z_SPECPARM
53
REAL(KIND=JPRB) :: ZHOOK_HANDLE
54
55
!  Input
56
!#include "yoeratm.h"
57
58
!      REAL TAUAER(JPLAY)
59
!      EQUIVALENCE (TAUAERL(1,15),TAUAER)
60
61
!     Compute the optical depth by interpolating in ln(pressure),
62
!     temperature, and appropriate species.  Below LAYTROP, the water
63
!     vapor self-continuum is interpolated (in temperature) separately.
64
65
71568
IF (LHOOK) CALL DR_HOOK('RRTM_TAUMOL15',0,ZHOOK_HANDLE)
66
1574496
DO I_LAY = 1, K_LAYTROP
67
1502928
  Z_SPECCOMB = P_COLN2O(I_LAY) + STRRAT*P_COLCO2(I_LAY)
68
1502928
  Z_SPECPARM = P_COLN2O(I_LAY)/Z_SPECCOMB
69
1502928
  Z_SPECPARM = MIN(Z_SPECPARM,P_ONEMINUS)
70
1502928
  Z_SPECMULT = 8._JPRB*(Z_SPECPARM)
71
1502928
  JS = 1 + INT(Z_SPECMULT)
72
1502928
  Z_FS = MOD(Z_SPECMULT,1.0_JPRB)
73
!-----jjm
74
1502928
  Z_FAC000 = (1.0_JPRB - Z_FS) * P_FAC00(I_LAY)
75
1502928
  Z_FAC010 = (1.0_JPRB - Z_FS) * P_FAC10(I_LAY)
76
1502928
  Z_FAC100 = Z_FS * P_FAC00(I_LAY)
77
1502928
  Z_FAC110 = Z_FS * P_FAC10(I_LAY)
78
1502928
  Z_FAC001 = (1.0_JPRB - Z_FS) * P_FAC01(I_LAY)
79
1502928
  Z_FAC011 = (1.0_JPRB - Z_FS) * P_FAC11(I_LAY)
80
1502928
  Z_FAC101 = Z_FS * P_FAC01(I_LAY)
81
1502928
  Z_FAC111 = Z_FS * P_FAC11(I_LAY)
82
!------
83
1502928
  IND0 = ((K_JP(I_LAY)-1)*5+(K_JT(I_LAY)-1))*NSPA(15) + JS
84
1502928
  IND1 = (K_JP(I_LAY)*5+(K_JT1(I_LAY)-1))*NSPA(15) + JS
85
1502928
  INDS = K_INDSELF(I_LAY)
86
!-- DS_990714
87
!         DO IG = 1, NG15
88
  IG=1
89
  P_TAU (NGS14+IG,I_LAY) = Z_SPECCOMB *&
90
   !     &((1. - Z_FS)*(P_FAC00(I_LAY) * ABSA(IND0,IG) +
91
   !     &            P_FAC10(I_LAY) * ABSA(IND0+9,IG) +
92
   !     &            P_FAC01(I_LAY) * ABSA(IND1,IG) +
93
   !     &            P_FAC11(I_LAY) * ABSA(IND1+9,IG)) +
94
   !     &     Z_FS *  (P_FAC01(I_LAY) * ABSA(IND1+1,IG) +
95
   !     &            P_FAC10(I_LAY) * ABSA(IND0+10,IG) +
96
   !     &            P_FAC00(I_LAY) * ABSA(IND0+1,IG) +
97
   !     &            P_FAC11(I_LAY) * ABSA(IND1+10,IG))) +
98
   & (Z_FAC000 * ABSA(IND0   ,IG) +&
99
   & Z_FAC100 * ABSA(IND0+ 1,IG) +&
100
   & Z_FAC010 * ABSA(IND0+ 9,IG) +&
101
   & Z_FAC110 * ABSA(IND0+10,IG) +&
102
   & Z_FAC001 * ABSA(IND1   ,IG) +&
103
   & Z_FAC101 * ABSA(IND1+ 1,IG) +&
104
   & Z_FAC011 * ABSA(IND1+ 9,IG) +&
105
   & Z_FAC111 * ABSA(IND1+10,IG))+&
106
   & P_COLH2O(I_LAY) * &
107
   & P_SELFFAC(I_LAY) * (SELFREF(INDS,IG) + &
108
   & P_SELFFRAC(I_LAY) *&
109
   & (SELFREF(INDS+1,IG) - SELFREF(INDS,IG)))&
110
1502928
   & + P_TAUAERL(I_LAY,15)
111
  PFRAC(NGS14+IG,I_LAY) = FRACREFA(IG,JS) + Z_FS *&
112
1502928
   & (FRACREFA(IG,JS+1) - FRACREFA(IG,JS))
113
  IG=2
114
  P_TAU (NGS14+IG,I_LAY) = Z_SPECCOMB *&
115
   !     &((1. - Z_FS)*(P_FAC00(I_LAY) * ABSA(IND0,IG) +
116
   !     &            P_FAC10(I_LAY) * ABSA(IND0+9,IG) +
117
   !     &            P_FAC01(I_LAY) * ABSA(IND1,IG) +
118
   !     &            P_FAC11(I_LAY) * ABSA(IND1+9,IG)) +
119
   !     &     Z_FS *  (P_FAC01(I_LAY) * ABSA(IND1+1,IG) +
120
   !     &            P_FAC10(I_LAY) * ABSA(IND0+10,IG) +
121
   !     &            P_FAC00(I_LAY) * ABSA(IND0+1,IG) +
122
   !     &            P_FAC11(I_LAY) * ABSA(IND1+10,IG))) +
123
   & (Z_FAC000 * ABSA(IND0   ,IG) +&
124
   & Z_FAC100 * ABSA(IND0+ 1,IG) +&
125
   & Z_FAC010 * ABSA(IND0+ 9,IG) +&
126
   & Z_FAC110 * ABSA(IND0+10,IG) +&
127
   & Z_FAC001 * ABSA(IND1   ,IG) +&
128
   & Z_FAC101 * ABSA(IND1+ 1,IG) +&
129
   & Z_FAC011 * ABSA(IND1+ 9,IG) +&
130
   & Z_FAC111 * ABSA(IND1+10,IG))+&
131
   & P_COLH2O(I_LAY) *&
132
   & P_SELFFAC(I_LAY) * (SELFREF(INDS,IG) +&
133
   & P_SELFFRAC(I_LAY) *&
134
   & (SELFREF(INDS+1,IG) - SELFREF(INDS,IG)))&
135
1502928
   & + P_TAUAERL(I_LAY,15)
136
  PFRAC(NGS14+IG,I_LAY) = FRACREFA(IG,JS) + Z_FS *&
137
1574496
   & (FRACREFA(IG,JS+1) - FRACREFA(IG,JS))
138
139
!         END DO
140
!-- DS_990714
141
ENDDO
142
143
1359792
DO I_LAY = K_LAYTROP+1, KLEV
144
!         DO IG = 1, NG15
145
!-- DS_990714
146
  IG=1
147
1288224
  P_TAU (NGS14+IG,I_LAY) = P_TAUAERL(I_LAY,15)
148
1288224
  PFRAC(NGS14+IG,I_LAY) = 0.0_JPRB
149
  IG=2
150
1288224
  P_TAU (NGS14+IG,I_LAY) = P_TAUAERL(I_LAY,15)
151
1359792
  PFRAC(NGS14+IG,I_LAY) = 0.0_JPRB
152
!-- DS_990714
153
!         END DO
154
ENDDO
155
156
71568
IF (LHOOK) CALL DR_HOOK('RRTM_TAUMOL15',1,ZHOOK_HANDLE)
157
71568
END SUBROUTINE RRTM_TAUMOL15