GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: phylmd/rrtm/su_aerw.F90 Lines: 46 71 64.8 %
Date: 2023-06-30 12:56:34 Branches: 7 30 23.3 %

Line Branch Exec Source
1
1
SUBROUTINE SU_AERW
2
3
!**** *SU_AERW*   - DEFINES INDICES AND PARAMETERS FOR VARIOUS AEROSOL VARIABLES
4
5
!     PURPOSE.
6
!     --------
7
!           INITIALIZE YOEAERATM, YOEAERSRC, YOEAERSNK, THE MODULES THAT CONTAINS INDICES
8
!           ALLOWING TO GET THE AEROSOL PARAMETERS RELEVANT FOR THE PROGNOSTIC AEROSOL
9
!           CONFIGURATION.
10
11
!**   INTERFACE.
12
!     ----------
13
!        *CALL* *SU_AERW
14
15
!        EXPLICIT ARGUMENTS :
16
!        --------------------
17
!        NONE
18
19
!        IMPLICIT ARGUMENTS :
20
!        --------------------
21
!        YOEAERW
22
23
!     METHOD.
24
!     -------
25
!        SEE DOCUMENTATION
26
27
!     EXTERNALS.
28
!     ----------
29
30
!     REFERENCE.
31
!     ----------
32
!        ECMWF RESEARCH DEPARTMENT DOCUMENTATION OF THE IFS
33
34
!     AUTHOR.
35
!     -------
36
!        JEAN-JACQUES MORCRETTE *ECMWF*
37
38
!     MODIFICATIONS.
39
!     --------------
40
!        ORIGINAL : 2005-07-08
41
42
!     ------------------------------------------------------------------
43
44
USE PARKIND1  ,ONLY : JPIM     ,JPRB
45
USE YOMHOOK   ,ONLY : LHOOK,   DR_HOOK
46
47
USE YOEAERATM, ONLY : LAERGBUD, LAERSCAV ,LAERSEDIM, LAERSURF, LAER6SDIA, &
48
 & LAERCLIMG, LAERCLIMZ, LAERCLIST, LAERDRYDP, LAERNGAT, LAERPRNT, &
49
 & REPSCAER , INDBG
50
51
USE YOEAERSRC, ONLY : JKBIN, JKTYP, LEPAERO  , &
52
 & NBINAER, NINDAER , NMAXTAER, NTAER  , NTYPAER, RGELAV , RGEMUV , &
53
 & RDGLAV , RDGMUV  , RCLONV  , RSLONV , RDCLONV, RDSLONV, LAEREXTR, &
54
 & RSSFLX , RLATVOL , RLONVOL , NDDUST
55
56
USE YOEPHY   , ONLY : LE4ALB
57
58
USE YOEDBUG  , ONLY : KSTPDBG
59
60
USE YOMCST   , ONLY : RPI
61
USE YOMGC    , ONLY : GELAM
62
USE YOMGEM   , ONLY : NGPTOT
63
USE YOMLEG   , ONLY : RMU
64
! Ce qui concerne NULNAM commente par MPL le 15.04.09
65
!USE YOMLUN   , ONLY : NULNAM, NULOUT
66
USE YOMLUN   , ONLY : NULOUT
67
68
USE YOM_YGFL, ONLY : NAERO
69
70
IMPLICIT NONE
71
72
INTEGER(KIND=JPIM) :: IAER, ICAER, ITAER
73
INTEGER(KIND=JPIM) :: J, JAER, JL
74
75
REAL(KIND=JPRB) :: ZHOOK_HANDLE
76
!     ----------------------------------------------------------------
77
78
#include "posnam.intfb.h"
79
80
#include "su_aerp.intfb.h"
81
#include "su_aerop.intfb.h"
82
!      ----------------------------------------------------------------
83
84
#include "naeaer.h"
85
86
!      ----------------------------------------------------------------
87
1
IF (LHOOK) CALL DR_HOOK('SU_AERW',0,ZHOOK_HANDLE)
88
89
!*         1.       DEFAULT VALUES OF PARAMETERS
90
!                   ----------------------------
91
92
1
print *,'DANS SU_AERW'
93
1
NBINAER(:) = (/ 3, 3, 2, 2, 1, 1, 1, 1, 1 /)
94
95
1
NMAXTAER=9
96
1
NTYPAER(:) = 0
97
1
JKBIN(:) = 0
98
1
JKTYP(:) = 0
99
100
1
LEPAERO=.FALSE.
101
1
LAERCLIMG=.FALSE.
102
1
LAERCLIMZ=.FALSE.
103
1
LAERCLIST=.FALSE.
104
1
LAERDRYDP=.FALSE.
105
1
LAEREXTR=.FALSE.
106
1
LAERGBUD=.FALSE.
107
1
LAERNGAT=.FALSE.
108
1
LAERPRNT=.FALSE.
109
1
LAERSCAV=.FALSE.
110
1
LAERSEDIM=.FALSE.
111
1
LAERSURF=.FALSE.
112
1
LAER6SDIA=.FALSE.
113
1
INDBG=1
114
1
NTAER  =0
115
1
NDDUST =2
116
117
! the 9 types and assumed number of bins are:
118
!  NTYPAER    bins  type
119
!     1       1- 3  sea-salt  0.03 - 0.5 -  5  - 20 microns
120
!     2       4- 6  dust      0.03 - 0.5 - 0.9 - 20 microns
121
!     3       7- 8  POM	    hydrophilic, hydrophobic
122
!     4       9-10  BC	    hydrophilic, hydrophobic
123
!     5      11     sulfate
124
!     6      12     fly ash
125
!     7      13     pseudo-prognostic stratospheric aerosols
126
!     8      14     pseudo-prognostic volcanic aerosols
127
!     9      15     prognostic stratospheric aerosols
128
129
10
DO JAER=1,NMAXTAER
130
10
  NTYPAER(JAER)=0
131
ENDDO
132
133
1
RLATVOL=-999._JPRB
134
1
RLONVOL=-999._JPRB
135
1
RGELAV =-999._JPRB
136
1
RGEMUV =-999._JPRB
137
1
RDGLAV = 999._JPRB
138
1
RDGMUV = 999._JPRB
139
1
RCLONV =-999._JPRB
140
1
RSLONV =-999._JPRB
141
1
RDCLONV= 999._JPRB
142
1
RDSLONV= 999._JPRB
143
4
DO J=1,3
144
4
  KSTPDBG(J)=-999
145
ENDDO
146
147
1
REPSCAER=1.E-15_JPRB
148
149
!     ------------------------------------------------------------------
150
151
!*         2.       READ VALUES OF PROGNOSTIC AEROSOL CONFIGURATION
152
!                   -----------------------------------------------
153
! Ce qui concerne NAEAER commente par MPL le 15.04.09
154
!IF(NAERO > 0) THEN
155
! CALL POSNAM(NULNAM,'NAEAER')
156
! READ (NULNAM,NAEAER)
157
!ENDIF
158
159
IF (.NOT.LE4ALB) THEN
160
  NDDUST=2
161
ENDIF
162
!     ------------------------------------------------------------------
163
164
!*       3.    INITIALIZE PROGNOSTIC AEROSOL PHYSICAL AND OPTICAL PARAMETERS
165
!              -------------------------------------------------------------
166
167
1
  CALL SU_AERP
168
1
print *,'SU_AERW: apres SU_AERP'
169
1
  CALL SU_AEROP
170
1
print *,'SU_AERW: apres SU_AEROP'
171
172
1
IF (LEPAERO) THEN
173
174
! define a composite index for each bin of each different aerosol type to be used
175
! in source, sedimentation and deposition routines
176
177
  ICAER=0
178
  DO JAER=1,NMAXTAER
179
    IF (NTYPAER(JAER) /= 0) THEN
180
      NTAER=NTAER+1
181
      ITAER=NTYPAER(JAER)
182
      DO IAER=1,ITAER
183
        ICAER=ICAER+1
184
        NINDAER(ICAER)=JAER*10+IAER
185
        JKTYP(ICAER)=JAER
186
        JKBIN(ICAER)=IAER
187
      ENDDO
188
    ENDIF
189
  ENDDO
190
191
!-- if volcanic aerosols, define the model coordinates
192
193
  IF (NTYPAER(9) /= 0) THEN
194
    RGEMUV=(RLATVOL+90._JPRB)*RPI/180._JPRB
195
    RGELAV=RLONVOL*RPI/180._JPRB
196
    RCLONV=COS(RGELAV)
197
    RSLONV=SIN(RGELAV)
198
    DO J=1,NGPTOT-1
199
      IF (RGELAV > GELAM(J) .AND. RGELAV <= GELAM(J+1) .AND. &
200
        & RGEMUV < RMU(JL) .AND. RGEMUV >= RMU(JL+1) ) THEN
201
        RDGMUV=ABS( RMU(J+1) - RMU(J))
202
        RDGLAV=ABS( GELAM(J+1)-GELAM(J) )
203
        RDSLONV=ABS( SIN(GELAM(JL+1))-SIN(GELAM(JL)) )
204
        RDCLONV=ABS( COS(GELAM(JL+1))-COS(GELAM(JL)) )
205
      ENDIF
206
    ENDDO
207
  ENDIF
208
209
!      ----------------------------------------------------------------
210
211
!*       4.    PRINT FINAL VALUES.
212
!              -------------------
213
214
  WRITE(UNIT=NULOUT,FMT='('' LEPAERO = '',L5 &
215
   & ,'' NTAER   = '',I2 ,'' NDDUST = '',I1,/&
216
   & ,'' NTYPAER = '',9I3,/ &
217
   & ,'' NBINAER = '',9I3,/ &
218
   & ,'' JKTYP   = '',15I3,/&
219
   & ,'' JKBIN   = '',15I3  &
220
   & )')&
221
   & LEPAERO,NTAER,(NTYPAER(JAER),JAER=1,9),(NBINAER(JAER),JAER=1,9), &
222
   & (JKTYP(JAER),JAER=1,15),(JKBIN(JAER),JAER=1,15)
223
  WRITE(UNIT=NULOUT,FMT='('' LAERGBUD = '',L3 &
224
   & ,'' LAERNGAT = '',L3 &
225
   & ,'' LAERDRYDP= '',L3 &
226
   & ,'' LAERSEDIM= '',L3 &
227
   & ,'' LAERSCAV = '',L3 &
228
   & ,'' LAER6SDIA= '',L3 &
229
   & ,'' LAERCLIMZ= '',L3 &
230
   & ,'' LAERCLIMG= '',L3 &
231
   & ,'' LAERCLIST= '',L3 &
232
   & )')&
233
   & LAERGBUD,LAERNGAT, LAERDRYDP,LAERSEDIM,LAERSCAV,LAER6SDIA,LAERCLIMZ,LAERCLIMG,LAERCLIST
234
  WRITE(UNIT=NULOUT,FMT='('' RSSFLX= '',10E10.3)') RSSFLX
235
  IF (NTYPAER(9) /= 0) THEN
236
    WRITE(UNIT=NULOUT,FMT='('' RLATVOL= '',F5.2 &
237
     & ,'' RLONVOL= '',F6.2,'' RGEMUV= '',F6.4,'' RGELAV= '',F6.4 &
238
     & ,'' RCLONV = '',F6.4,'' RSLONV= '',F6.4,'' RDGMUV= '',F6.4 &
239
     & ,'' RDGLAV = '',F6.4,'' RDCLONV= '',F6.4,'' RDSLONV= '',F6.4 &
240
     & )')&
241
     & RLATVOL,RLONVOL,RGEMUV,RGELAV,RCLONV,RSLONV,RDGMUV,RDGLAV,RDCLONV,RDSLONV
242
  ENDIF
243
ENDIF
244
245
!     ----------------------------------------------------------------
246
1
IF (LHOOK) CALL DR_HOOK('SU_AERW',1,ZHOOK_HANDLE)
247
1
END SUBROUTINE SU_AERW
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283