1 | !----------------------------------------------------------------------- |
---|
2 | ! |
---|
3 | !NCEP_MESO:MODEL_LAYER: ACCUMULATION BUCKETS |
---|
4 | ! |
---|
5 | !----------------------------------------------------------------------- |
---|
6 | SUBROUTINE BUCKETS(NTSD,NPREC,NSRFC,NRDSW,NRDLW & |
---|
7 | & ,RESTART,TSTART & |
---|
8 | & ,NCLOD,NHEAT,NPHS,TSPH & |
---|
9 | & ,ACPREC,CUPREC,ACSNOW,ACSNOM,SSROFF,BGROFF & |
---|
10 | & ,SFCEVP,POTEVP,SFCSHX,SFCLHX,SUBSHX,SNOPCX & |
---|
11 | & ,SFCUVX,POTFLX & |
---|
12 | & ,ARDSW,ASWIN,ASWOUT,ASWTOA & |
---|
13 | & ,ARDLW,ALWIN,ALWOUT,ALWTOA & |
---|
14 | & ,ACFRST,NCFRST,ACFRCV,NCFRCV & |
---|
15 | & ,AVCNVC,AVRAIN,TCUCN,TRAIN & |
---|
16 | & ,ASRFC & |
---|
17 | & ,T,TLMAX,TLMIN & |
---|
18 | & ,IDS,IDE,JDS,JDE,KDS,KDE & |
---|
19 | & ,IMS,IME,JMS,JME,KMS,KME & |
---|
20 | & ,ITS,ITE,JTS,JTE,KTS,KTE) |
---|
21 | !----------------------------------------------------------------------- |
---|
22 | !$$$ SUBPROGRAM DOCUMENTATION BLOCK |
---|
23 | ! . . . |
---|
24 | ! SUBPROGRAM: BUCKETS EMPTY ACCUMULATION BUCKETS WHEN NEEDED |
---|
25 | ! PRGRMMR: BLACK ORG: W/NP22 DATE: 04-08-18 |
---|
26 | ! |
---|
27 | ! ABSTRACT: |
---|
28 | ! VARIOUS ACCUMULATING QUANTITIES NEED TO BE RESET TO ZERO AT |
---|
29 | ! SPECIFIED INTERVALS. |
---|
30 | ! |
---|
31 | ! USAGE: CALL BUCKETS FROM SOLVE_NMM |
---|
32 | ! INPUT ARGUMENT LIST: |
---|
33 | ! NTSD - CURRENT TIMESTEP |
---|
34 | ! NPREC - NUMBER OF TIMESTEPS BETWEEN EMPTYING BUCKETS FOR PRECIP |
---|
35 | ! NHEAT - NUMBER OF TIMESTEPS BETWEEN EMPTYING BUCKETS FOR |
---|
36 | ! LATENT HEATING |
---|
37 | ! NCNVC - NUMBER OF TIMESTEPS BETWEEN CALLS TO CONVECTION |
---|
38 | ! TSPH - NUMBER OF DYNAMICS TIMESTEPS PER HOUR |
---|
39 | ! ACPREC - ACCUMULATED TOTAL PRECIPITATION (M) |
---|
40 | ! CUPREC - ACCUMULATED CONVECTIVE PRECIPITATION (M) |
---|
41 | ! ACSNOW - ACCUMULATED SNOWFALL (M) |
---|
42 | ! ACSNOM - ACCUMULATED SNOWMELT (M) |
---|
43 | ! SSROFF - ACCUMULATED SURFACE RUNOFF |
---|
44 | ! BGROFF - ACCUMULATED BELOW GROUND RUNOFF |
---|
45 | ! SFCEVP - ACCUMULATED SURFACE EVAPORATION |
---|
46 | ! POTEVP - ACCUMULATED POTENTIAL EVAPORATION |
---|
47 | ! T - TEMPERATURE |
---|
48 | ! TLMAX - MAX TEMPERATURE EACH HOUR IN LOWEST LAYER |
---|
49 | ! TLMIN - MIN TEMPERATURE EACH HOUR IN LOWEST LAYER |
---|
50 | ! |
---|
51 | ! OUTPUT ARGUMENT LIST: THE ACCUMULATED QUANTITIES |
---|
52 | ! |
---|
53 | ! OUTPUT FILES: NONE |
---|
54 | ! |
---|
55 | ! SUBPROGRAMS CALLED: NONE |
---|
56 | ! |
---|
57 | ! UNIQUE: NONE |
---|
58 | ! |
---|
59 | ! LIBRARY: NONE |
---|
60 | ! |
---|
61 | ! ATTRIBUTES: |
---|
62 | ! LANGUAGE: FORTRAN 90 |
---|
63 | ! MACHINE : IBM SP |
---|
64 | !$$$ |
---|
65 | !----------------------------------------------------------------------- |
---|
66 | ! |
---|
67 | IMPLICIT NONE |
---|
68 | ! |
---|
69 | !----------------------------------------------------------------------- |
---|
70 | !*** ARGUMENTS |
---|
71 | !----------------------------------------------------------------------- |
---|
72 | ! |
---|
73 | INTEGER,INTENT(IN) :: NCLOD,NHEAT,NPHS,NPREC,NRDLW,NRDSW & |
---|
74 | ,NSRFC,NTSD & |
---|
75 | ,IDS,IDE,JDS,JDE,KDS,KDE & |
---|
76 | ,IMS,IME,JMS,JME,KMS,KME & |
---|
77 | ,ITS,ITE,JTS,JTE,KTS,KTE |
---|
78 | ! |
---|
79 | REAL,INTENT(IN) :: TSPH,TSTART |
---|
80 | REAL,INTENT(OUT) :: ARDLW,ARDSW,ASRFC,AVCNVC,AVRAIN |
---|
81 | ! |
---|
82 | REAL,DIMENSION(IMS:IME,JMS:JME),INTENT(OUT) :: ACPREC,ACSNOM & |
---|
83 | & ,ACSNOW,ALWIN & |
---|
84 | & ,ACFRST,ACFRCV & |
---|
85 | & ,ALWOUT,ALWTOA & |
---|
86 | & ,ASWIN,ASWOUT & |
---|
87 | & ,ASWTOA,BGROFF & |
---|
88 | & ,CUPREC,POTEVP & |
---|
89 | & ,POTFLX,SFCEVP & |
---|
90 | & ,SFCLHX,SFCSHX & |
---|
91 | & ,SFCUVX,SNOPCX & |
---|
92 | & ,SSROFF,SUBSHX |
---|
93 | ! |
---|
94 | INTEGER,DIMENSION(IMS:IME,JMS:JME),INTENT(OUT) :: NCFRST,NCFRCV |
---|
95 | REAL,DIMENSION(IMS:IME,JMS:JME),INTENT(INOUT) :: TLMAX,TLMIN |
---|
96 | ! |
---|
97 | REAL,DIMENSION(IMS:IME,KMS:KME,JMS:JME),INTENT(IN) :: T |
---|
98 | REAL,DIMENSION(IMS:IME,KMS:KME,JMS:JME),INTENT(OUT) :: TCUCN & |
---|
99 | & ,TRAIN |
---|
100 | ! |
---|
101 | LOGICAL,INTENT(IN) :: RESTART |
---|
102 | ! |
---|
103 | !----------------------------------------------------------------------- |
---|
104 | !*** LOCAL VARIABLES |
---|
105 | !----------------------------------------------------------------------- |
---|
106 | ! |
---|
107 | INTEGER :: I,J,K,NTSD_BUCKET,NTSPH |
---|
108 | LOGICAL WRF_DM_ON_MONITOR |
---|
109 | EXTERNAL WRF_DM_ON_MONITOR |
---|
110 | ! |
---|
111 | !----------------------------------------------------------------------- |
---|
112 | !*********************************************************************** |
---|
113 | !----------------------------------------------------------------------- |
---|
114 | ! |
---|
115 | NTSD_BUCKET=NTSD |
---|
116 | IF(RESTART.AND.TSTART>0.)THEN |
---|
117 | NTSD_BUCKET=NTSD-1 |
---|
118 | ENDIF |
---|
119 | ! |
---|
120 | !----------------------------------------------------------------------- |
---|
121 | !*** TOTAL AND CONVECTIVE PRECIPITATION ARRAYS. |
---|
122 | !*** TOTAL SNOW AND SNOW MELT ARRAYS. |
---|
123 | !*** STORM SURFACE AND BASE GROUND RUN OFF ARRAYS. |
---|
124 | !*** EVAPORATION ARRAYS. |
---|
125 | !----------------------------------------------------------------------- |
---|
126 | ! |
---|
127 | IF(MOD(NTSD_BUCKET,NPREC)==0)THEN |
---|
128 | DO J=JTS,JTE |
---|
129 | DO I=ITS,ITE |
---|
130 | ACPREC(I,J)=0. |
---|
131 | CUPREC(I,J)=0. |
---|
132 | ACSNOW(I,J)=0. |
---|
133 | ACSNOM(I,J)=0. |
---|
134 | SSROFF(I,J)=0. |
---|
135 | BGROFF(I,J)=0. |
---|
136 | SFCEVP(I,J)=0. |
---|
137 | POTEVP(I,J)=0. |
---|
138 | ENDDO |
---|
139 | ENDDO |
---|
140 | ! |
---|
141 | IF ( WRF_DM_ON_MONITOR() ) THEN |
---|
142 | CALL WRF_MESSAGE('ZEROED OUT PRECIP/RUNOFF ARRAYS') |
---|
143 | ENDIF |
---|
144 | ! |
---|
145 | ENDIF |
---|
146 | ! |
---|
147 | !----------------------------------------------------------------------- |
---|
148 | !*** SFC FLUX ARRAYS. |
---|
149 | !----------------------------------------------------------------------- |
---|
150 | ! |
---|
151 | IF(MOD(NTSD_BUCKET,NSRFC)==0)THEN |
---|
152 | ASRFC=0. |
---|
153 | DO J=JTS,JTE |
---|
154 | DO I=ITS,ITE |
---|
155 | SFCSHX(I,J)=0. |
---|
156 | SFCLHX(I,J)=0. |
---|
157 | SUBSHX(I,J)=0. |
---|
158 | SNOPCX(I,J)=0. |
---|
159 | SFCUVX(I,J)=0. |
---|
160 | POTFLX(I,J)=0. |
---|
161 | ENDDO |
---|
162 | ENDDO |
---|
163 | ! |
---|
164 | IF ( WRF_DM_ON_MONITOR() ) THEN |
---|
165 | CALL WRF_MESSAGE('ZEROED OUT SFC EVAP/FLUX ARRAYS') |
---|
166 | ENDIF |
---|
167 | ! |
---|
168 | ENDIF |
---|
169 | ! |
---|
170 | !----------------------------------------------------------------------- |
---|
171 | !*** SHORTWAVE FLUX ACCUMULATION ARRAYS. |
---|
172 | !----------------------------------------------------------------------- |
---|
173 | ! |
---|
174 | IF(MOD(NTSD_BUCKET,NRDSW)==0)THEN |
---|
175 | ARDSW=0. |
---|
176 | DO J=JTS,JTE |
---|
177 | DO I=ITS,ITE |
---|
178 | ASWIN(I,J) =0. |
---|
179 | ASWOUT(I,J)=0. |
---|
180 | ASWTOA(I,J)=0. |
---|
181 | ENDDO |
---|
182 | ENDDO |
---|
183 | ! |
---|
184 | IF ( WRF_DM_ON_MONITOR() ) THEN |
---|
185 | CALL WRF_MESSAGE('ZEROED OUT ACCUMULATED SHORTWAVE FLUX ARRAYS') |
---|
186 | ENDIF |
---|
187 | ! |
---|
188 | ENDIF |
---|
189 | ! |
---|
190 | !----------------------------------------------------------------------- |
---|
191 | !*** LONGWAVE FLUX ACCUMULATION ARRAYS. |
---|
192 | !----------------------------------------------------------------------- |
---|
193 | ! |
---|
194 | IF(MOD(NTSD_BUCKET,NRDLW)==0)THEN |
---|
195 | ARDLW=0. |
---|
196 | DO J=JTS,JTE |
---|
197 | DO I=ITS,ITE |
---|
198 | ALWIN(I,J) =0. |
---|
199 | ALWOUT(I,J)=0. |
---|
200 | ALWTOA(I,J)=0. |
---|
201 | ENDDO |
---|
202 | ENDDO |
---|
203 | ! |
---|
204 | IF ( WRF_DM_ON_MONITOR() ) THEN |
---|
205 | CALL WRF_MESSAGE('ZEROED OUT ACCUMULATED LONGWAVE FLUX ARRAYS') |
---|
206 | ENDIF |
---|
207 | ! |
---|
208 | ENDIF |
---|
209 | ! |
---|
210 | !----------------------------------------------------------------------- |
---|
211 | !*** TIME-AVERAGED CLOUD FRACTION ARRAYS. |
---|
212 | !----------------------------------------------------------------------- |
---|
213 | ! |
---|
214 | IF(MOD(NTSD_BUCKET,NCLOD)==0)THEN |
---|
215 | !*** |
---|
216 | !--- Ferrier 11/2/05: Right now no accumulator variable is used (e.g., |
---|
217 | ! "ACLOD"), but instead the 2D arrays NCFRST & NCFRCV are used. These |
---|
218 | ! can be removed later to streamline the code. |
---|
219 | !*** |
---|
220 | DO J=JTS,JTE |
---|
221 | DO I=ITS,ITE |
---|
222 | ACFRCV(I,J)=0. |
---|
223 | ACFRST(I,J)=0. |
---|
224 | NCFRCV(I,J)=0 |
---|
225 | NCFRST(I,J)=0 |
---|
226 | ENDDO |
---|
227 | ENDDO |
---|
228 | ! |
---|
229 | IF ( WRF_DM_ON_MONITOR() ) THEN |
---|
230 | CALL WRF_MESSAGE('ZEROED OUT ACCUMULATED CLOUD FRACTION ARRAYS') |
---|
231 | ENDIF |
---|
232 | ! |
---|
233 | ENDIF |
---|
234 | ! |
---|
235 | !----------------------------------------------------------------------- |
---|
236 | !*** GRID-SCALE AND CONVECTIVE (LATENT) HEATING ARRAYS. |
---|
237 | !----------------------------------------------------------------------- |
---|
238 | ! |
---|
239 | IF(MOD(NTSD_BUCKET,NHEAT)==0)THEN |
---|
240 | AVCNVC=0. |
---|
241 | AVRAIN=0. |
---|
242 | ! |
---|
243 | DO J=JTS,JTE |
---|
244 | DO K=KTS,KTE |
---|
245 | DO I=ITS,ITE |
---|
246 | TRAIN(I,K,J)=0. |
---|
247 | TCUCN(I,K,J)=0. |
---|
248 | ENDDO |
---|
249 | ENDDO |
---|
250 | ENDDO |
---|
251 | ! |
---|
252 | IF ( WRF_DM_ON_MONITOR() ) THEN |
---|
253 | CALL WRF_MESSAGE('ZEROED OUT ACCUMULATED LATENT HEATING ARRAYS') |
---|
254 | ENDIF |
---|
255 | ! |
---|
256 | ENDIF |
---|
257 | ! |
---|
258 | !----------------------------------------------------------------------- |
---|
259 | !*** MAX/MIN TEMPERATURES |
---|
260 | !----------------------------------------------------------------------- |
---|
261 | ! |
---|
262 | NTSPH=NINT(TSPH) |
---|
263 | IF(MOD(NTSD_BUCKET,NTSPH)==0)THEN |
---|
264 | DO J=JTS,JTE |
---|
265 | DO I=ITS,ITE |
---|
266 | TLMAX(I,J)=-999. |
---|
267 | TLMIN(I,J)=999. |
---|
268 | ENDDO |
---|
269 | ENDDO |
---|
270 | ! |
---|
271 | IF ( WRF_DM_ON_MONITOR() ) THEN |
---|
272 | CALL WRF_MESSAGE('RESET MAX/MIN TEMPERTURES') |
---|
273 | ENDIF |
---|
274 | ENDIF |
---|
275 | ! |
---|
276 | DO J=JTS,JTE |
---|
277 | DO I=ITS,ITE |
---|
278 | TLMAX(I,J)=MAX(TLMAX(I,J),T(I,1,J)) |
---|
279 | TLMIN(I,J)=MIN(TLMIN(I,J),T(I,1,J)) |
---|
280 | ENDDO |
---|
281 | ENDDO |
---|
282 | ! |
---|
283 | !----------------------------------------------------------------------- |
---|
284 | ! |
---|
285 | END SUBROUTINE BUCKETS |
---|
286 | ! |
---|
287 | !----------------------------------------------------------------------- |
---|