1 | !> @file surface_data_output_mod.f90 |
---|
2 | !------------------------------------------------------------------------------! |
---|
3 | ! This file is part of the PALM model system. |
---|
4 | ! |
---|
5 | ! PALM is free software: you can redistribute it and/or modify it under the |
---|
6 | ! terms of the GNU General Public License as published by the Free Software |
---|
7 | ! Foundation, either version 3 of the License, or (at your option) any later |
---|
8 | ! version. |
---|
9 | ! |
---|
10 | ! PALM is distributed in the hope that it will be useful, but WITHOUT ANY |
---|
11 | ! WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR |
---|
12 | ! A PARTICULAR PURPOSE. See the GNU General Public License for more details. |
---|
13 | ! |
---|
14 | ! You should have received a copy of the GNU General Public License along with |
---|
15 | ! PALM. If not, see <http://www.gnu.org/licenses/>. |
---|
16 | ! |
---|
17 | ! Copyright 1997-2019 Leibniz Universitaet Hannover |
---|
18 | !------------------------------------------------------------------------------! |
---|
19 | ! |
---|
20 | ! Current revisions: |
---|
21 | ! ------------------ |
---|
22 | ! |
---|
23 | ! |
---|
24 | ! Former revisions: |
---|
25 | ! ----------------- |
---|
26 | ! $Id: surface_data_output_mod.f90 3691 2019-01-23 09:57:04Z maronga $ |
---|
27 | ! Add output of surface-parallel flow speed |
---|
28 | ! |
---|
29 | ! 3648 2019-01-02 16:35:46Z suehring |
---|
30 | ! Rename module and subroutines |
---|
31 | ! |
---|
32 | ! 3646 2018-12-28 17:58:49Z kanani |
---|
33 | ! Bugfix: use time_since_reference_point instead of simulated_time (relevant |
---|
34 | ! when using wall/soil spinup) |
---|
35 | ! |
---|
36 | ! 3614 2018-12-10 07:05:46Z raasch |
---|
37 | ! unused variables removed |
---|
38 | ! |
---|
39 | ! 3572 2018-11-28 11:40:28Z suehring |
---|
40 | ! Added short- and longwave radiation flux arrays (e.g. diffuse, direct, |
---|
41 | ! reflected, resedual) for all surfaces (M. Salim) |
---|
42 | ! |
---|
43 | ! 3494 2018-11-06 14:51:27Z suehring |
---|
44 | ! Bugfix in gathering surface data from different types and orientation. |
---|
45 | ! Output of total number of surfaces and vertices added. |
---|
46 | ! String length is output, for more convinient post-processing. |
---|
47 | ! Last actions added. |
---|
48 | ! |
---|
49 | ! 3483 2018-11-02 14:19:26Z raasch |
---|
50 | ! bugfix: missed directives for MPI added |
---|
51 | ! |
---|
52 | ! 3421 2018-10-24 18:39:32Z gronemeier |
---|
53 | ! Add output variables |
---|
54 | ! Write data into binary file |
---|
55 | ! |
---|
56 | ! 3420 2018-10-24 17:30:08Z gronemeier |
---|
57 | ! Initial implementation from Klaus Ketelsen and Matthias Suehring |
---|
58 | ! |
---|
59 | ! |
---|
60 | ! Authors: |
---|
61 | ! -------- |
---|
62 | ! @author Klaus Ketelsen, Matthias Suehring |
---|
63 | ! |
---|
64 | ! Description: |
---|
65 | ! ------------ |
---|
66 | !> Generate output for surface data. |
---|
67 | !> |
---|
68 | !> @todo Create namelist file for post-processing tool. |
---|
69 | !------------------------------------------------------------------------------! |
---|
70 | |
---|
71 | MODULE surface_data_output_mod |
---|
72 | |
---|
73 | USE kinds |
---|
74 | |
---|
75 | USE arrays_3d, & |
---|
76 | ONLY: zu, zw |
---|
77 | |
---|
78 | USE control_parameters, & |
---|
79 | ONLY: surface_output |
---|
80 | |
---|
81 | USE grid_variables, & |
---|
82 | ONLY: dx,dy |
---|
83 | |
---|
84 | USE indices, & |
---|
85 | ONLY: nxl, nxr, nys, nyn, nzb, nzt |
---|
86 | |
---|
87 | USE pegrid |
---|
88 | |
---|
89 | USE surface_mod, & |
---|
90 | ONLY: surf_def_h, surf_def_v, surf_lsm_h, surf_lsm_v, & |
---|
91 | surf_usm_h, surf_usm_v |
---|
92 | |
---|
93 | IMPLICIT NONE |
---|
94 | |
---|
95 | TYPE surf_out !< data structure which contains all surfaces elements of all types on subdomain |
---|
96 | |
---|
97 | INTEGER(iwp) :: ns !< number of surface elements on subdomain |
---|
98 | INTEGER(iwp) :: ns_total !< total number of surface elements |
---|
99 | INTEGER(iwp) :: npoints !< number of points / vertices which define a surface element (on subdomain) |
---|
100 | INTEGER(iwp) :: npoints_total !< total number of points / vertices which define a surface element |
---|
101 | |
---|
102 | REAL(wp) :: fillvalue = -9999.9_wp !< fillvalue for surface elements which are not defined |
---|
103 | |
---|
104 | REAL(wp), DIMENSION(:), ALLOCATABLE :: var_out !< output variables |
---|
105 | REAL(wp), DIMENSION(:,:), ALLOCATABLE :: var_av !< variables used for averaging |
---|
106 | REAL(wp), DIMENSION(:,:), ALLOCATABLE :: points !< points / vertices of a surface element |
---|
107 | REAL(wp), DIMENSION(:,:), ALLOCATABLE :: polygons !< polygon data of a surface element |
---|
108 | END TYPE surf_out |
---|
109 | |
---|
110 | CHARACTER(LEN=100), DIMENSION(300) :: data_output_surf = ' ' !< namelist variable which describes the output variables |
---|
111 | CHARACTER(LEN=100), DIMENSION(0:1,300) :: dosurf = ' ' !< internal variable which describes the output variables and separates |
---|
112 | !< averaged from non-averaged output |
---|
113 | |
---|
114 | INTEGER(iwp) :: average_count_surf = 0 !< number of ensemble members used for averaging |
---|
115 | INTEGER(iwp) :: dosurf_no(0:1) = 0 !< number of surface output quantities |
---|
116 | |
---|
117 | LOGICAL :: first_output(0:1) = .FALSE. !< true if first output was already called |
---|
118 | |
---|
119 | REAL(wp) :: averaging_interval_surf = 9999999.9_wp !< averaging interval |
---|
120 | REAL(wp) :: dt_dosurf = 9999999.9_wp !< time interval for instantaneous data output |
---|
121 | REAL(wp) :: dt_dosurf_av = 9999999.9_wp !< time interval for averaged data output |
---|
122 | REAL(wp) :: skip_time_dosurf = 0.0_wp !< skip time for instantaneous data output |
---|
123 | REAL(wp) :: skip_time_dosurf_av = 0.0_wp !< skip time for averaged data output |
---|
124 | REAL(wp) :: time_dosurf = 0.0_wp !< internal counter variable to check for instantaneous data output |
---|
125 | REAL(wp) :: time_dosurf_av = 0.0_wp !< internal counter variable to check for averaged data output |
---|
126 | |
---|
127 | |
---|
128 | TYPE(surf_out) :: surfaces !< variable which contains all required output information |
---|
129 | |
---|
130 | SAVE |
---|
131 | |
---|
132 | PRIVATE |
---|
133 | |
---|
134 | INTERFACE surface_data_output |
---|
135 | MODULE PROCEDURE surface_data_output |
---|
136 | END INTERFACE surface_data_output |
---|
137 | |
---|
138 | INTERFACE surface_data_output_averaging |
---|
139 | MODULE PROCEDURE surface_data_output_averaging |
---|
140 | END INTERFACE surface_data_output_averaging |
---|
141 | |
---|
142 | INTERFACE surface_data_output_check_parameters |
---|
143 | MODULE PROCEDURE surface_data_output_check_parameters |
---|
144 | END INTERFACE surface_data_output_check_parameters |
---|
145 | |
---|
146 | INTERFACE surface_data_output_init |
---|
147 | MODULE PROCEDURE surface_data_output_init |
---|
148 | END INTERFACE surface_data_output_init |
---|
149 | |
---|
150 | INTERFACE surface_data_output_last_action |
---|
151 | MODULE PROCEDURE surface_data_output_last_action |
---|
152 | END INTERFACE surface_data_output_last_action |
---|
153 | |
---|
154 | INTERFACE surface_data_output_parin |
---|
155 | MODULE PROCEDURE surface_data_output_parin |
---|
156 | END INTERFACE surface_data_output_parin |
---|
157 | |
---|
158 | ! |
---|
159 | !--Public subroutines |
---|
160 | PUBLIC surface_data_output, surface_data_output_averaging, & |
---|
161 | surface_data_output_check_parameters, surface_data_output_init, & |
---|
162 | surface_data_output_last_action, surface_data_output_parin |
---|
163 | ! |
---|
164 | !--Public variables |
---|
165 | PUBLIC average_count_surf, averaging_interval_surf, dt_dosurf, dt_dosurf_av,& |
---|
166 | skip_time_dosurf, skip_time_dosurf_av, time_dosurf, time_dosurf_av |
---|
167 | |
---|
168 | CONTAINS |
---|
169 | |
---|
170 | !------------------------------------------------------------------------------! |
---|
171 | ! Description: |
---|
172 | ! ------------ |
---|
173 | !> Initialization surface-data output data structure: calculation of vertices |
---|
174 | !> and polygon data for the surface elements, allocation of required arrays. |
---|
175 | !------------------------------------------------------------------------------! |
---|
176 | SUBROUTINE surface_data_output_init |
---|
177 | |
---|
178 | IMPLICIT NONE |
---|
179 | |
---|
180 | INTEGER(iwp) :: i !< grid index in x-direction, also running variable for counting non-average data output |
---|
181 | INTEGER(iwp) :: j !< grid index in y-direction, also running variable for counting average data output |
---|
182 | INTEGER(iwp) :: k !< grid index in z-direction |
---|
183 | INTEGER(iwp) :: l !< running index for surface-element orientation |
---|
184 | INTEGER(iwp) :: m !< running index for surface elements |
---|
185 | INTEGER(iwp) :: npg !< counter variable for all surface elements ( or polygons ) |
---|
186 | INTEGER(iwp) :: point_index_count !< local counter variable for point index |
---|
187 | |
---|
188 | INTEGER(iwp), DIMENSION(0:numprocs-1) :: num_points_on_pe !< array which contains the number of points on all mpi ranks |
---|
189 | INTEGER(iwp), ALLOCATABLE, DIMENSION(:,:,:) :: point_index !< dummy array used to check where the reference points for surface polygons are located |
---|
190 | |
---|
191 | ! |
---|
192 | !-- Determine the number of surface elements on subdomain |
---|
193 | surfaces%ns = surf_def_h(0)%ns + surf_lsm_h%ns + surf_usm_h%ns & !horizontal upward-facing |
---|
194 | + surf_def_h(1)%ns & !horizontal downard-facing |
---|
195 | + surf_def_v(0)%ns + surf_lsm_v(0)%ns + surf_usm_v(0)%ns & !northward-facing |
---|
196 | + surf_def_v(1)%ns + surf_lsm_v(1)%ns + surf_usm_v(1)%ns & !southward-facing |
---|
197 | + surf_def_v(2)%ns + surf_lsm_v(2)%ns + surf_usm_v(2)%ns & !westward-facing |
---|
198 | + surf_def_v(3)%ns + surf_lsm_v(3)%ns + surf_usm_v(3)%ns !eastward-facing |
---|
199 | ! |
---|
200 | !-- Allocate output variable and set to _FillValue attribute |
---|
201 | ALLOCATE ( surfaces%var_out(1:surfaces%ns) ) |
---|
202 | surfaces%var_out = surfaces%fillvalue |
---|
203 | ! |
---|
204 | !-- If there is an output of time average output variables, allocate the |
---|
205 | !-- required array. |
---|
206 | IF ( dosurf_no(1) > 0 ) THEN |
---|
207 | ALLOCATE ( surfaces%var_av(1:surfaces%ns,1:dosurf_no(1)) ) |
---|
208 | surfaces%var_av = 0.0_wp |
---|
209 | ENDIF |
---|
210 | ! |
---|
211 | !-- Initialize points and polygon data. |
---|
212 | !-- In a first step, count the number of points which are defining |
---|
213 | !-- the surfaces and the polygons. |
---|
214 | ALLOCATE( point_index(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1) ) |
---|
215 | point_index = -1 |
---|
216 | ! |
---|
217 | !-- Horizontal default surfaces |
---|
218 | surfaces%npoints = 0 |
---|
219 | DO l = 0, 1 |
---|
220 | DO m = 1, surf_def_h(0)%ns |
---|
221 | ! |
---|
222 | !-- Determine the indices of the respective grid cell inside the topography |
---|
223 | i = surf_def_h(0)%i(m) + surf_def_h(0)%ioff |
---|
224 | j = surf_def_h(0)%j(m) + surf_def_h(0)%joff |
---|
225 | k = surf_def_h(0)%k(m) + surf_def_h(0)%koff |
---|
226 | ! |
---|
227 | !-- Check if the vertices that define the surface element are already |
---|
228 | !-- defined, if not, increment the counter. |
---|
229 | IF ( point_index(k,j,i) < 0 ) THEN |
---|
230 | surfaces%npoints = surfaces%npoints + 1 |
---|
231 | point_index(k,j,i) = surfaces%npoints - 1 |
---|
232 | ENDIF |
---|
233 | IF ( point_index(k,j,i+1) < 0 ) THEN |
---|
234 | surfaces%npoints = surfaces%npoints + 1 |
---|
235 | point_index(k,j,i+1) = surfaces%npoints - 1 |
---|
236 | ENDIF |
---|
237 | IF ( point_index(k,j+1,i+1) < 0 ) THEN |
---|
238 | surfaces%npoints = surfaces%npoints + 1 |
---|
239 | point_index(k,j+1,i+1) = surfaces%npoints - 1 |
---|
240 | ENDIF |
---|
241 | IF ( point_index(k,j+1,i) < 0 ) THEN |
---|
242 | surfaces%npoints = surfaces%npoints + 1 |
---|
243 | point_index(k,j+1,i) = surfaces%npoints - 1 |
---|
244 | ENDIF |
---|
245 | ENDDO |
---|
246 | ENDDO |
---|
247 | DO m = 1, surf_lsm_h%ns |
---|
248 | i = surf_lsm_h%i(m) + surf_lsm_h%ioff |
---|
249 | j = surf_lsm_h%j(m) + surf_lsm_h%joff |
---|
250 | k = surf_lsm_h%k(m) + surf_lsm_h%koff |
---|
251 | |
---|
252 | IF ( point_index(k,j,i) < 0 ) THEN |
---|
253 | surfaces%npoints = surfaces%npoints + 1 |
---|
254 | point_index(k,j,i) = surfaces%npoints - 1 |
---|
255 | ENDIF |
---|
256 | IF ( point_index(k,j,i+1) < 0 ) THEN |
---|
257 | surfaces%npoints = surfaces%npoints + 1 |
---|
258 | point_index(k,j,i+1) = surfaces%npoints - 1 |
---|
259 | ENDIF |
---|
260 | IF ( point_index(k,j+1,i+1) < 0 ) THEN |
---|
261 | surfaces%npoints = surfaces%npoints + 1 |
---|
262 | point_index(k,j+1,i+1) = surfaces%npoints - 1 |
---|
263 | ENDIF |
---|
264 | IF ( point_index(k,j+1,i) < 0 ) THEN |
---|
265 | surfaces%npoints = surfaces%npoints + 1 |
---|
266 | point_index(k,j+1,i) = surfaces%npoints - 1 |
---|
267 | ENDIF |
---|
268 | ENDDO |
---|
269 | DO m = 1, surf_usm_h%ns |
---|
270 | i = surf_usm_h%i(m) + surf_usm_h%ioff |
---|
271 | j = surf_usm_h%j(m) + surf_usm_h%joff |
---|
272 | k = surf_usm_h%k(m) + surf_usm_h%koff |
---|
273 | |
---|
274 | IF ( point_index(k,j,i) < 0 ) THEN |
---|
275 | surfaces%npoints = surfaces%npoints + 1 |
---|
276 | point_index(k,j,i) = surfaces%npoints - 1 |
---|
277 | ENDIF |
---|
278 | IF ( point_index(k,j,i+1) < 0 ) THEN |
---|
279 | surfaces%npoints = surfaces%npoints + 1 |
---|
280 | point_index(k,j,i+1) = surfaces%npoints - 1 |
---|
281 | ENDIF |
---|
282 | IF ( point_index(k,j+1,i+1) < 0 ) THEN |
---|
283 | surfaces%npoints = surfaces%npoints + 1 |
---|
284 | point_index(k,j+1,i+1) = surfaces%npoints - 1 |
---|
285 | ENDIF |
---|
286 | IF ( point_index(k,j+1,i) < 0 ) THEN |
---|
287 | surfaces%npoints = surfaces%npoints + 1 |
---|
288 | point_index(k,j+1,i) = surfaces%npoints - 1 |
---|
289 | ENDIF |
---|
290 | ENDDO |
---|
291 | ! |
---|
292 | !-- Vertical surfaces |
---|
293 | DO l = 0, 3 |
---|
294 | DO m = 1, surf_def_v(l)%ns |
---|
295 | ! |
---|
296 | !-- Determine the indices of the respective grid cell inside the topography. |
---|
297 | !-- Please note, j-index for north-facing surfaces ( l==0 ) is |
---|
298 | !-- identical to the reference j-index outside the grid box. |
---|
299 | !-- Equivalent for east-facing surfaces and i-index. |
---|
300 | i = surf_def_v(l)%i(m) + MERGE( surf_def_v(l)%ioff, 0, l == 3 ) |
---|
301 | j = surf_def_v(l)%j(m) + MERGE( surf_def_v(l)%joff, 0, l == 1 ) |
---|
302 | k = surf_def_v(l)%k(m) + surf_def_v(l)%koff |
---|
303 | ! |
---|
304 | !-- Lower left /front vertex |
---|
305 | IF ( point_index(k,j,i) < 0 ) THEN |
---|
306 | surfaces%npoints = surfaces%npoints + 1 |
---|
307 | point_index(k,j,i) = surfaces%npoints - 1 |
---|
308 | ENDIF |
---|
309 | ! |
---|
310 | !-- Upper / lower right index for north- and south-facing surfaces |
---|
311 | IF ( l == 0 .OR. l == 1 ) THEN |
---|
312 | IF ( point_index(k,j,i+1) < 0 ) THEN |
---|
313 | surfaces%npoints = surfaces%npoints + 1 |
---|
314 | point_index(k,j,i+1) = surfaces%npoints - 1 |
---|
315 | ENDIF |
---|
316 | IF ( point_index(k+1,j,i+1) < 0 ) THEN |
---|
317 | surfaces%npoints = surfaces%npoints + 1 |
---|
318 | point_index(k+1,j,i+1) = surfaces%npoints - 1 |
---|
319 | ENDIF |
---|
320 | ! |
---|
321 | !-- Upper / lower front index for east- and west-facing surfaces |
---|
322 | ELSEIF ( l == 2 .OR. l == 3 ) THEN |
---|
323 | IF ( point_index(k,j+1,i) < 0 ) THEN |
---|
324 | surfaces%npoints = surfaces%npoints + 1 |
---|
325 | point_index(k,j+1,i) = surfaces%npoints - 1 |
---|
326 | ENDIF |
---|
327 | IF ( point_index(k+1,j+1,i) < 0 ) THEN |
---|
328 | surfaces%npoints = surfaces%npoints + 1 |
---|
329 | point_index(k+1,j+1,i) = surfaces%npoints - 1 |
---|
330 | ENDIF |
---|
331 | ENDIF |
---|
332 | ! |
---|
333 | !-- Upper left / front vertex |
---|
334 | IF ( point_index(k+1,j,i) < 0 ) THEN |
---|
335 | surfaces%npoints = surfaces%npoints + 1 |
---|
336 | point_index(k+1,j,i) = surfaces%npoints - 1 |
---|
337 | ENDIF |
---|
338 | ENDDO |
---|
339 | DO m = 1, surf_lsm_v(l)%ns |
---|
340 | i = surf_lsm_v(l)%i(m) + MERGE( surf_lsm_v(l)%ioff, 0, l == 3 ) |
---|
341 | j = surf_lsm_v(l)%j(m) + MERGE( surf_lsm_v(l)%joff, 0, l == 1 ) |
---|
342 | k = surf_lsm_v(l)%k(m) + surf_lsm_v(l)%koff |
---|
343 | ! |
---|
344 | !-- Lower left /front vertex |
---|
345 | IF ( point_index(k,j,i) < 0 ) THEN |
---|
346 | surfaces%npoints = surfaces%npoints + 1 |
---|
347 | point_index(k,j,i) = surfaces%npoints - 1 |
---|
348 | ENDIF |
---|
349 | ! |
---|
350 | !-- Upper / lower right index for north- and south-facing surfaces |
---|
351 | IF ( l == 0 .OR. l == 1 ) THEN |
---|
352 | IF ( point_index(k,j,i+1) < 0 ) THEN |
---|
353 | surfaces%npoints = surfaces%npoints + 1 |
---|
354 | point_index(k,j,i+1) = surfaces%npoints - 1 |
---|
355 | ENDIF |
---|
356 | IF ( point_index(k+1,j,i+1) < 0 ) THEN |
---|
357 | surfaces%npoints = surfaces%npoints + 1 |
---|
358 | point_index(k+1,j,i+1) = surfaces%npoints - 1 |
---|
359 | ENDIF |
---|
360 | ! |
---|
361 | !-- Upper / lower front index for east- and west-facing surfaces |
---|
362 | ELSEIF ( l == 2 .OR. l == 3 ) THEN |
---|
363 | IF ( point_index(k,j+1,i) < 0 ) THEN |
---|
364 | surfaces%npoints = surfaces%npoints + 1 |
---|
365 | point_index(k,j+1,i) = surfaces%npoints - 1 |
---|
366 | ENDIF |
---|
367 | IF ( point_index(k+1,j+1,i) < 0 ) THEN |
---|
368 | surfaces%npoints = surfaces%npoints + 1 |
---|
369 | point_index(k+1,j+1,i) = surfaces%npoints - 1 |
---|
370 | ENDIF |
---|
371 | ENDIF |
---|
372 | ! |
---|
373 | !-- Upper left / front vertex |
---|
374 | IF ( point_index(k+1,j,i) < 0 ) THEN |
---|
375 | surfaces%npoints = surfaces%npoints + 1 |
---|
376 | point_index(k+1,j,i) = surfaces%npoints - 1 |
---|
377 | ENDIF |
---|
378 | ENDDO |
---|
379 | |
---|
380 | DO m = 1, surf_usm_v(l)%ns |
---|
381 | i = surf_usm_v(l)%i(m) + MERGE( surf_usm_v(l)%ioff, 0, l == 3 ) |
---|
382 | j = surf_usm_v(l)%j(m) + MERGE( surf_usm_v(l)%joff, 0, l == 1 ) |
---|
383 | k = surf_usm_v(l)%k(m) + surf_usm_v(l)%koff |
---|
384 | ! |
---|
385 | !-- Lower left /front vertex |
---|
386 | IF ( point_index(k,j,i) < 0 ) THEN |
---|
387 | surfaces%npoints = surfaces%npoints + 1 |
---|
388 | point_index(k,j,i) = surfaces%npoints - 1 |
---|
389 | ENDIF |
---|
390 | ! |
---|
391 | !-- Upper / lower right index for north- and south-facing surfaces |
---|
392 | IF ( l == 0 .OR. l == 1 ) THEN |
---|
393 | IF ( point_index(k,j,i+1) < 0 ) THEN |
---|
394 | surfaces%npoints = surfaces%npoints + 1 |
---|
395 | point_index(k,j,i+1) = surfaces%npoints - 1 |
---|
396 | ENDIF |
---|
397 | IF ( point_index(k+1,j,i+1) < 0 ) THEN |
---|
398 | surfaces%npoints = surfaces%npoints + 1 |
---|
399 | point_index(k+1,j,i+1) = surfaces%npoints - 1 |
---|
400 | ENDIF |
---|
401 | ! |
---|
402 | !-- Upper / lower front index for east- and west-facing surfaces |
---|
403 | ELSEIF ( l == 2 .OR. l == 3 ) THEN |
---|
404 | IF ( point_index(k,j+1,i) < 0 ) THEN |
---|
405 | surfaces%npoints = surfaces%npoints + 1 |
---|
406 | point_index(k,j+1,i) = surfaces%npoints - 1 |
---|
407 | ENDIF |
---|
408 | IF ( point_index(k+1,j+1,i) < 0 ) THEN |
---|
409 | surfaces%npoints = surfaces%npoints + 1 |
---|
410 | point_index(k+1,j+1,i) = surfaces%npoints - 1 |
---|
411 | ENDIF |
---|
412 | ENDIF |
---|
413 | ! |
---|
414 | !-- Upper left / front vertex |
---|
415 | IF ( point_index(k+1,j,i) < 0 ) THEN |
---|
416 | surfaces%npoints = surfaces%npoints + 1 |
---|
417 | point_index(k+1,j,i) = surfaces%npoints - 1 |
---|
418 | ENDIF |
---|
419 | ENDDO |
---|
420 | |
---|
421 | ENDDO |
---|
422 | ! |
---|
423 | !-- Allocate the number of points and polygons. Note, the number of polygons |
---|
424 | !-- is identical to the number of surfaces elements, whereas the number |
---|
425 | !-- of points (vertices) which define the polygons can be larger. |
---|
426 | ALLOCATE( surfaces%points(3,1:surfaces%npoints) ) |
---|
427 | ALLOCATE( surfaces%polygons(5,1:surfaces%ns) ) |
---|
428 | ! |
---|
429 | !-- Note, PARAVIEW expects consecutively ordered points which can be |
---|
430 | !-- unambiguously identified. |
---|
431 | !-- Hence, all PEs know where they should start counting, depending on the |
---|
432 | !-- number of points on the other PE's with lower MPI rank. |
---|
433 | #if defined( __parallel ) |
---|
434 | CALL MPI_ALLGATHER( surfaces%npoints, 1, MPI_INTEGER, & |
---|
435 | num_points_on_pe, 1, MPI_INTEGER, comm2d, ierr ) |
---|
436 | #else |
---|
437 | num_points_on_pe = surfaces%npoints |
---|
438 | #endif |
---|
439 | |
---|
440 | ! |
---|
441 | !-- After the number of vertices is counted, repeat the loops and define the |
---|
442 | !-- vertices. Start with the horizontal default surfaces |
---|
443 | !-- First, however, determine the offset where couting of points should be |
---|
444 | !-- started, which is the sum of points of all PE's with lower MPI rank. |
---|
445 | i = 0 |
---|
446 | point_index_count = 0 |
---|
447 | DO WHILE ( i < myid .AND. i <= SIZE( num_points_on_pe ) ) |
---|
448 | point_index_count = point_index_count + num_points_on_pe(i) |
---|
449 | i = i + 1 |
---|
450 | ENDDO |
---|
451 | |
---|
452 | |
---|
453 | surfaces%npoints = 0 |
---|
454 | point_index = -1 |
---|
455 | npg = 0 |
---|
456 | |
---|
457 | DO l = 0, 1 |
---|
458 | DO m = 1, surf_def_h(0)%ns |
---|
459 | ! |
---|
460 | !-- Determine the indices of the respective grid cell inside the topography |
---|
461 | i = surf_def_h(0)%i(m) + surf_def_h(0)%ioff |
---|
462 | j = surf_def_h(0)%j(m) + surf_def_h(0)%joff |
---|
463 | k = surf_def_h(0)%k(m) + surf_def_h(0)%koff |
---|
464 | ! |
---|
465 | !-- Check if the vertices that define the surface element are already |
---|
466 | !-- defined, if not, increment the counter. |
---|
467 | IF ( point_index(k,j,i) < 0 ) THEN |
---|
468 | surfaces%npoints = surfaces%npoints + 1 |
---|
469 | point_index(k,j,i) = point_index_count |
---|
470 | point_index_count = point_index_count + 1 |
---|
471 | surfaces%points(1,surfaces%npoints) = ( i - 0.5_wp ) * dx |
---|
472 | surfaces%points(2,surfaces%npoints) = ( j - 0.5_wp ) * dy |
---|
473 | surfaces%points(3,surfaces%npoints) = zw(k) |
---|
474 | ENDIF |
---|
475 | IF ( point_index(k,j,i+1) < 0 ) THEN |
---|
476 | surfaces%npoints = surfaces%npoints + 1 |
---|
477 | point_index(k,j,i+1) = point_index_count |
---|
478 | point_index_count = point_index_count + 1 |
---|
479 | surfaces%points(1,surfaces%npoints) = ( i + 1 - 0.5_wp ) * dx |
---|
480 | surfaces%points(2,surfaces%npoints) = ( j - 0.5_wp ) * dy |
---|
481 | surfaces%points(3,surfaces%npoints) = zw(k) |
---|
482 | ENDIF |
---|
483 | IF ( point_index(k,j+1,i+1) < 0 ) THEN |
---|
484 | surfaces%npoints = surfaces%npoints + 1 |
---|
485 | point_index(k,j+1,i+1) = point_index_count |
---|
486 | point_index_count = point_index_count + 1 |
---|
487 | surfaces%points(1,surfaces%npoints) = ( i + 1 - 0.5_wp ) * dx |
---|
488 | surfaces%points(2,surfaces%npoints) = ( j + 1 - 0.5_wp ) * dy |
---|
489 | surfaces%points(3,surfaces%npoints) = zw(k) |
---|
490 | ENDIF |
---|
491 | IF ( point_index(k,j+1,i) < 0 ) THEN |
---|
492 | surfaces%npoints = surfaces%npoints + 1 |
---|
493 | point_index(k,j+1,i) = point_index_count |
---|
494 | point_index_count = point_index_count + 1 |
---|
495 | surfaces%points(1,surfaces%npoints) = ( i - 0.5_wp ) * dx |
---|
496 | surfaces%points(2,surfaces%npoints) = ( j + 1 - 0.5_wp ) * dy |
---|
497 | surfaces%points(3,surfaces%npoints) = zw(k) |
---|
498 | ENDIF |
---|
499 | |
---|
500 | npg = npg + 1 |
---|
501 | surfaces%polygons(1,npg) = 4 |
---|
502 | surfaces%polygons(2,npg) = point_index(k,j,i) |
---|
503 | surfaces%polygons(3,npg) = point_index(k,j,i+1) |
---|
504 | surfaces%polygons(4,npg) = point_index(k,j+1,i+1) |
---|
505 | surfaces%polygons(5,npg) = point_index(k,j+1,i) |
---|
506 | ENDDO |
---|
507 | ENDDO |
---|
508 | DO m = 1, surf_lsm_h%ns |
---|
509 | i = surf_lsm_h%i(m) + surf_lsm_h%ioff |
---|
510 | j = surf_lsm_h%j(m) + surf_lsm_h%joff |
---|
511 | k = surf_lsm_h%k(m) + surf_lsm_h%koff |
---|
512 | IF ( point_index(k,j,i) < 0 ) THEN |
---|
513 | surfaces%npoints = surfaces%npoints + 1 |
---|
514 | point_index(k,j,i) = point_index_count |
---|
515 | point_index_count = point_index_count + 1 |
---|
516 | surfaces%points(1,surfaces%npoints) = ( i - 0.5_wp ) * dx |
---|
517 | surfaces%points(2,surfaces%npoints) = ( j - 0.5_wp ) * dy |
---|
518 | surfaces%points(3,surfaces%npoints) = zw(k) |
---|
519 | ENDIF |
---|
520 | IF ( point_index(k,j,i+1) < 0 ) THEN |
---|
521 | surfaces%npoints = surfaces%npoints + 1 |
---|
522 | point_index(k,j,i+1) = point_index_count |
---|
523 | point_index_count = point_index_count + 1 |
---|
524 | surfaces%points(1,surfaces%npoints) = ( i + 1 - 0.5_wp ) * dx |
---|
525 | surfaces%points(2,surfaces%npoints) = ( j - 0.5_wp ) * dy |
---|
526 | surfaces%points(3,surfaces%npoints) = zw(k) |
---|
527 | ENDIF |
---|
528 | IF ( point_index(k,j+1,i+1) < 0 ) THEN |
---|
529 | surfaces%npoints = surfaces%npoints + 1 |
---|
530 | point_index(k,j+1,i+1) = point_index_count |
---|
531 | point_index_count = point_index_count + 1 |
---|
532 | surfaces%points(1,surfaces%npoints) = ( i + 1 - 0.5_wp ) * dx |
---|
533 | surfaces%points(2,surfaces%npoints) = ( j + 1 - 0.5_wp ) * dy |
---|
534 | surfaces%points(3,surfaces%npoints) = zw(k) |
---|
535 | ENDIF |
---|
536 | IF ( point_index(k,j+1,i) < 0 ) THEN |
---|
537 | surfaces%npoints = surfaces%npoints + 1 |
---|
538 | point_index(k,j+1,i) = point_index_count |
---|
539 | point_index_count = point_index_count + 1 |
---|
540 | surfaces%points(1,surfaces%npoints) = ( i - 0.5_wp ) * dx |
---|
541 | surfaces%points(2,surfaces%npoints) = ( j + 1 - 0.5_wp ) * dy |
---|
542 | surfaces%points(3,surfaces%npoints) = zw(k) |
---|
543 | ENDIF |
---|
544 | |
---|
545 | npg = npg + 1 |
---|
546 | surfaces%polygons(1,npg) = 4 |
---|
547 | surfaces%polygons(2,npg) = point_index(k,j,i) |
---|
548 | surfaces%polygons(3,npg) = point_index(k,j,i+1) |
---|
549 | surfaces%polygons(4,npg) = point_index(k,j+1,i+1) |
---|
550 | surfaces%polygons(5,npg) = point_index(k,j+1,i) |
---|
551 | ENDDO |
---|
552 | |
---|
553 | DO m = 1, surf_usm_h%ns |
---|
554 | i = surf_usm_h%i(m) + surf_usm_h%ioff |
---|
555 | j = surf_usm_h%j(m) + surf_usm_h%joff |
---|
556 | k = surf_usm_h%k(m) + surf_usm_h%koff |
---|
557 | |
---|
558 | IF ( point_index(k,j,i) < 0 ) THEN |
---|
559 | surfaces%npoints = surfaces%npoints + 1 |
---|
560 | point_index(k,j,i) = point_index_count |
---|
561 | point_index_count = point_index_count + 1 |
---|
562 | surfaces%points(1,surfaces%npoints) = ( i - 0.5_wp ) * dx |
---|
563 | surfaces%points(2,surfaces%npoints) = ( j - 0.5_wp ) * dy |
---|
564 | surfaces%points(3,surfaces%npoints) = zw(k) |
---|
565 | ENDIF |
---|
566 | IF ( point_index(k,j,i+1) < 0 ) THEN |
---|
567 | surfaces%npoints = surfaces%npoints + 1 |
---|
568 | point_index(k,j,i+1) = point_index_count |
---|
569 | point_index_count = point_index_count + 1 |
---|
570 | surfaces%points(1,surfaces%npoints) = ( i + 1 - 0.5_wp ) * dx |
---|
571 | surfaces%points(2,surfaces%npoints) = ( j - 0.5_wp ) * dy |
---|
572 | surfaces%points(3,surfaces%npoints) = zw(k) |
---|
573 | ENDIF |
---|
574 | IF ( point_index(k,j+1,i+1) < 0 ) THEN |
---|
575 | surfaces%npoints = surfaces%npoints + 1 |
---|
576 | point_index(k,j+1,i+1) = point_index_count |
---|
577 | point_index_count = point_index_count + 1 |
---|
578 | surfaces%points(1,surfaces%npoints) = ( i + 1 - 0.5_wp ) * dx |
---|
579 | surfaces%points(2,surfaces%npoints) = ( j + 1 - 0.5_wp ) * dy |
---|
580 | surfaces%points(3,surfaces%npoints) = zw(k) |
---|
581 | ENDIF |
---|
582 | IF ( point_index(k,j+1,i) < 0 ) THEN |
---|
583 | surfaces%npoints = surfaces%npoints + 1 |
---|
584 | point_index(k,j+1,i) = point_index_count |
---|
585 | point_index_count = point_index_count + 1 |
---|
586 | surfaces%points(1,surfaces%npoints) = ( i - 0.5_wp ) * dx |
---|
587 | surfaces%points(2,surfaces%npoints) = ( j + 1 - 0.5_wp ) * dy |
---|
588 | surfaces%points(3,surfaces%npoints) = zw(k) |
---|
589 | ENDIF |
---|
590 | |
---|
591 | npg = npg + 1 |
---|
592 | surfaces%polygons(1,npg) = 4 |
---|
593 | surfaces%polygons(2,npg) = point_index(k,j,i) |
---|
594 | surfaces%polygons(3,npg) = point_index(k,j,i+1) |
---|
595 | surfaces%polygons(4,npg) = point_index(k,j+1,i+1) |
---|
596 | surfaces%polygons(5,npg) = point_index(k,j+1,i) |
---|
597 | ENDDO |
---|
598 | |
---|
599 | DO l = 0, 3 |
---|
600 | DO m = 1, surf_def_v(l)%ns |
---|
601 | ! |
---|
602 | !-- Determine the indices of the respective grid cell inside the topography. |
---|
603 | !-- Please note, j-index for north-facing surfaces ( l==0 ) is |
---|
604 | !-- identical to the reference j-index outside the grid box. |
---|
605 | !-- Equivalent for east-facing surfaces and i-index. |
---|
606 | i = surf_def_v(l)%i(m) + MERGE( surf_def_v(l)%ioff, 0, l == 3 ) |
---|
607 | j = surf_def_v(l)%j(m) + MERGE( surf_def_v(l)%joff, 0, l == 1 ) |
---|
608 | k = surf_def_v(l)%k(m) + surf_def_v(l)%koff |
---|
609 | ! |
---|
610 | !-- Lower left /front vertex |
---|
611 | IF ( point_index(k,j,i) < 0 ) THEN |
---|
612 | surfaces%npoints = surfaces%npoints + 1 |
---|
613 | point_index(k,j,i) = point_index_count |
---|
614 | point_index_count = point_index_count + 1 |
---|
615 | surfaces%points(1,surfaces%npoints) = ( i - 0.5_wp ) * dx |
---|
616 | surfaces%points(2,surfaces%npoints) = ( j - 0.5_wp ) * dy |
---|
617 | surfaces%points(3,surfaces%npoints) = zw(k-1) |
---|
618 | ENDIF |
---|
619 | ! |
---|
620 | !-- Upper / lower right index for north- and south-facing surfaces |
---|
621 | IF ( l == 0 .OR. l == 1 ) THEN |
---|
622 | IF ( point_index(k,j,i+1) < 0 ) THEN |
---|
623 | surfaces%npoints = surfaces%npoints + 1 |
---|
624 | point_index(k,j,i+1) = point_index_count |
---|
625 | point_index_count = point_index_count + 1 |
---|
626 | surfaces%points(1,surfaces%npoints) = ( i + 1 - 0.5_wp ) * dx |
---|
627 | surfaces%points(2,surfaces%npoints) = ( j - 0.5_wp ) * dy |
---|
628 | surfaces%points(3,surfaces%npoints) = zw(k-1) |
---|
629 | ENDIF |
---|
630 | IF ( point_index(k+1,j,i+1) < 0 ) THEN |
---|
631 | surfaces%npoints = surfaces%npoints + 1 |
---|
632 | point_index(k+1,j,i+1) = point_index_count |
---|
633 | point_index_count = point_index_count + 1 |
---|
634 | surfaces%points(1,surfaces%npoints) = ( i + 1 - 0.5_wp ) * dx |
---|
635 | surfaces%points(2,surfaces%npoints) = ( j - 0.5_wp ) * dy |
---|
636 | surfaces%points(3,surfaces%npoints) = zw(k) |
---|
637 | ENDIF |
---|
638 | ! |
---|
639 | !-- Upper / lower front index for east- and west-facing surfaces |
---|
640 | ELSEIF ( l == 2 .OR. l == 3 ) THEN |
---|
641 | IF ( point_index(k,j+1,i) < 0 ) THEN |
---|
642 | surfaces%npoints = surfaces%npoints + 1 |
---|
643 | point_index(k,j+1,i) = point_index_count |
---|
644 | point_index_count = point_index_count + 1 |
---|
645 | surfaces%points(1,surfaces%npoints) = ( i - 0.5_wp ) * dx |
---|
646 | surfaces%points(2,surfaces%npoints) = ( j + 1 - 0.5_wp ) * dy |
---|
647 | surfaces%points(3,surfaces%npoints) = zw(k-1) |
---|
648 | ENDIF |
---|
649 | IF ( point_index(k+1,j+1,i) < 0 ) THEN |
---|
650 | surfaces%npoints = surfaces%npoints + 1 |
---|
651 | point_index(k+1,j+1,i) = point_index_count |
---|
652 | point_index_count = point_index_count + 1 |
---|
653 | surfaces%points(1,surfaces%npoints) = ( i - 0.5_wp ) * dx |
---|
654 | surfaces%points(2,surfaces%npoints) = ( j + 1 - 0.5_wp ) * dy |
---|
655 | surfaces%points(3,surfaces%npoints) = zw(k) |
---|
656 | ENDIF |
---|
657 | ENDIF |
---|
658 | ! |
---|
659 | !-- Upper left / front vertex |
---|
660 | IF ( point_index(k+1,j,i) < 0 ) THEN |
---|
661 | surfaces%npoints = surfaces%npoints + 1 |
---|
662 | point_index(k+1,j,i) = point_index_count |
---|
663 | point_index_count = point_index_count + 1 |
---|
664 | surfaces%points(1,surfaces%npoints) = ( i - 0.5_wp ) * dx |
---|
665 | surfaces%points(2,surfaces%npoints) = ( j - 0.5_wp ) * dy |
---|
666 | surfaces%points(3,surfaces%npoints) = zw(k) |
---|
667 | ENDIF |
---|
668 | |
---|
669 | npg = npg + 1 |
---|
670 | IF ( l == 0 .OR. l == 1 ) THEN |
---|
671 | surfaces%polygons(1,npg) = 4 |
---|
672 | surfaces%polygons(2,npg) = point_index(k,j,i) |
---|
673 | surfaces%polygons(3,npg) = point_index(k,j,i+1) |
---|
674 | surfaces%polygons(4,npg) = point_index(k+1,j,i+1) |
---|
675 | surfaces%polygons(5,npg) = point_index(k+1,j,i) |
---|
676 | ELSE |
---|
677 | surfaces%polygons(1,npg) = 4 |
---|
678 | surfaces%polygons(2,npg) = point_index(k,j,i) |
---|
679 | surfaces%polygons(3,npg) = point_index(k,j+1,i) |
---|
680 | surfaces%polygons(4,npg) = point_index(k+1,j+1,i) |
---|
681 | surfaces%polygons(5,npg) = point_index(k+1,j,i) |
---|
682 | ENDIF |
---|
683 | |
---|
684 | ENDDO |
---|
685 | |
---|
686 | DO m = 1, surf_lsm_v(l)%ns |
---|
687 | i = surf_lsm_v(l)%i(m) + MERGE( surf_lsm_v(l)%ioff, 0, l == 3 ) |
---|
688 | j = surf_lsm_v(l)%j(m) + MERGE( surf_lsm_v(l)%joff, 0, l == 1 ) |
---|
689 | k = surf_lsm_v(l)%k(m) + surf_lsm_v(l)%koff |
---|
690 | ! |
---|
691 | !-- Lower left /front vertex |
---|
692 | IF ( point_index(k,j,i) < 0 ) THEN |
---|
693 | surfaces%npoints = surfaces%npoints + 1 |
---|
694 | point_index(k,j,i) = point_index_count |
---|
695 | point_index_count = point_index_count + 1 |
---|
696 | surfaces%points(1,surfaces%npoints) = ( i - 0.5_wp ) * dx |
---|
697 | surfaces%points(2,surfaces%npoints) = ( j - 0.5_wp ) * dy |
---|
698 | surfaces%points(3,surfaces%npoints) = zw(k-1) |
---|
699 | ENDIF |
---|
700 | ! |
---|
701 | !-- Upper / lower right index for north- and south-facing surfaces |
---|
702 | IF ( l == 0 .OR. l == 1 ) THEN |
---|
703 | IF ( point_index(k,j,i+1) < 0 ) THEN |
---|
704 | surfaces%npoints = surfaces%npoints + 1 |
---|
705 | point_index(k,j,i+1) = point_index_count |
---|
706 | point_index_count = point_index_count + 1 |
---|
707 | surfaces%points(1,surfaces%npoints) = ( i + 1 - 0.5_wp ) * dx |
---|
708 | surfaces%points(2,surfaces%npoints) = ( j - 0.5_wp ) * dy |
---|
709 | surfaces%points(3,surfaces%npoints) = zw(k-1) |
---|
710 | ENDIF |
---|
711 | IF ( point_index(k+1,j,i+1) < 0 ) THEN |
---|
712 | surfaces%npoints = surfaces%npoints + 1 |
---|
713 | point_index(k+1,j,i+1) = point_index_count |
---|
714 | point_index_count = point_index_count + 1 |
---|
715 | surfaces%points(1,surfaces%npoints) = ( i + 1 - 0.5_wp ) * dx |
---|
716 | surfaces%points(2,surfaces%npoints) = ( j - 0.5_wp ) * dy |
---|
717 | surfaces%points(3,surfaces%npoints) = zw(k) |
---|
718 | ENDIF |
---|
719 | ! |
---|
720 | !-- Upper / lower front index for east- and west-facing surfaces |
---|
721 | ELSEIF ( l == 2 .OR. l == 3 ) THEN |
---|
722 | IF ( point_index(k,j+1,i) < 0 ) THEN |
---|
723 | surfaces%npoints = surfaces%npoints + 1 |
---|
724 | point_index(k,j+1,i) = point_index_count |
---|
725 | point_index_count = point_index_count + 1 |
---|
726 | surfaces%points(1,surfaces%npoints) = ( i - 0.5_wp ) * dx |
---|
727 | surfaces%points(2,surfaces%npoints) = ( j + 1 - 0.5_wp ) * dy |
---|
728 | surfaces%points(3,surfaces%npoints) = zw(k-1) |
---|
729 | ENDIF |
---|
730 | IF ( point_index(k+1,j+1,i) < 0 ) THEN |
---|
731 | surfaces%npoints = surfaces%npoints + 1 |
---|
732 | point_index(k+1,j+1,i) = point_index_count |
---|
733 | point_index_count = point_index_count + 1 |
---|
734 | surfaces%points(1,surfaces%npoints) = ( i - 0.5_wp ) * dx |
---|
735 | surfaces%points(2,surfaces%npoints) = ( j + 1 - 0.5_wp ) * dy |
---|
736 | surfaces%points(3,surfaces%npoints) = zw(k) |
---|
737 | ENDIF |
---|
738 | ENDIF |
---|
739 | ! |
---|
740 | !-- Upper left / front vertex |
---|
741 | IF ( point_index(k+1,j,i) < 0 ) THEN |
---|
742 | surfaces%npoints = surfaces%npoints + 1 |
---|
743 | point_index(k+1,j,i) = point_index_count |
---|
744 | point_index_count = point_index_count + 1 |
---|
745 | surfaces%points(1,surfaces%npoints) = ( i - 0.5_wp ) * dx |
---|
746 | surfaces%points(2,surfaces%npoints) = ( j - 0.5_wp ) * dy |
---|
747 | surfaces%points(3,surfaces%npoints) = zw(k) |
---|
748 | ENDIF |
---|
749 | |
---|
750 | npg = npg + 1 |
---|
751 | IF ( l == 0 .OR. l == 1 ) THEN |
---|
752 | surfaces%polygons(1,npg) = 4 |
---|
753 | surfaces%polygons(2,npg) = point_index(k,j,i) |
---|
754 | surfaces%polygons(3,npg) = point_index(k,j,i+1) |
---|
755 | surfaces%polygons(4,npg) = point_index(k+1,j,i+1) |
---|
756 | surfaces%polygons(5,npg) = point_index(k+1,j,i) |
---|
757 | ELSE |
---|
758 | surfaces%polygons(1,npg) = 4 |
---|
759 | surfaces%polygons(2,npg) = point_index(k,j,i) |
---|
760 | surfaces%polygons(3,npg) = point_index(k,j+1,i) |
---|
761 | surfaces%polygons(4,npg) = point_index(k+1,j+1,i) |
---|
762 | surfaces%polygons(5,npg) = point_index(k+1,j,i) |
---|
763 | ENDIF |
---|
764 | ENDDO |
---|
765 | DO m = 1, surf_usm_v(l)%ns |
---|
766 | i = surf_usm_v(l)%i(m) + MERGE( surf_usm_v(l)%ioff, 0, l == 3 ) |
---|
767 | j = surf_usm_v(l)%j(m) + MERGE( surf_usm_v(l)%joff, 0, l == 1 ) |
---|
768 | k = surf_usm_v(l)%k(m) + surf_usm_v(l)%koff |
---|
769 | ! |
---|
770 | !-- Lower left /front vertex |
---|
771 | IF ( point_index(k,j,i) < 0 ) THEN |
---|
772 | surfaces%npoints = surfaces%npoints + 1 |
---|
773 | point_index(k,j,i) = point_index_count |
---|
774 | point_index_count = point_index_count + 1 |
---|
775 | surfaces%points(1,surfaces%npoints) = ( i - 0.5_wp ) * dx |
---|
776 | surfaces%points(2,surfaces%npoints) = ( j - 0.5_wp ) * dy |
---|
777 | surfaces%points(3,surfaces%npoints) = zw(k-1) |
---|
778 | ENDIF |
---|
779 | ! |
---|
780 | !-- Upper / lower right index for north- and south-facing surfaces |
---|
781 | IF ( l == 0 .OR. l == 1 ) THEN |
---|
782 | IF ( point_index(k,j,i+1) < 0 ) THEN |
---|
783 | surfaces%npoints = surfaces%npoints + 1 |
---|
784 | point_index(k,j,i+1) = point_index_count |
---|
785 | point_index_count = point_index_count + 1 |
---|
786 | surfaces%points(1,surfaces%npoints) = ( i + 1 - 0.5_wp ) * dx |
---|
787 | surfaces%points(2,surfaces%npoints) = ( j - 0.5_wp ) * dy |
---|
788 | surfaces%points(3,surfaces%npoints) = zw(k-1) |
---|
789 | ENDIF |
---|
790 | IF ( point_index(k+1,j,i+1) < 0 ) THEN |
---|
791 | surfaces%npoints = surfaces%npoints + 1 |
---|
792 | point_index(k+1,j,i+1) = point_index_count |
---|
793 | point_index_count = point_index_count + 1 |
---|
794 | surfaces%points(1,surfaces%npoints) = ( i + 1 - 0.5_wp ) * dx |
---|
795 | surfaces%points(2,surfaces%npoints) = ( j - 0.5_wp ) * dy |
---|
796 | surfaces%points(3,surfaces%npoints) = zw(k) |
---|
797 | ENDIF |
---|
798 | ! |
---|
799 | !-- Upper / lower front index for east- and west-facing surfaces |
---|
800 | ELSEIF ( l == 2 .OR. l == 3 ) THEN |
---|
801 | IF ( point_index(k,j+1,i) < 0 ) THEN |
---|
802 | surfaces%npoints = surfaces%npoints + 1 |
---|
803 | point_index(k,j+1,i) = point_index_count |
---|
804 | point_index_count = point_index_count + 1 |
---|
805 | surfaces%points(1,surfaces%npoints) = ( i - 0.5_wp ) * dx |
---|
806 | surfaces%points(2,surfaces%npoints) = ( j + 1 - 0.5_wp ) * dy |
---|
807 | surfaces%points(3,surfaces%npoints) = zw(k-1) |
---|
808 | ENDIF |
---|
809 | IF ( point_index(k+1,j+1,i) < 0 ) THEN |
---|
810 | surfaces%npoints = surfaces%npoints + 1 |
---|
811 | point_index(k+1,j+1,i) = point_index_count |
---|
812 | point_index_count = point_index_count + 1 |
---|
813 | surfaces%points(1,surfaces%npoints) = ( i - 0.5_wp ) * dx |
---|
814 | surfaces%points(2,surfaces%npoints) = ( j + 1 - 0.5_wp ) * dy |
---|
815 | surfaces%points(3,surfaces%npoints) = zw(k) |
---|
816 | ENDIF |
---|
817 | ENDIF |
---|
818 | ! |
---|
819 | !-- Upper left / front vertex |
---|
820 | IF ( point_index(k+1,j,i) < 0 ) THEN |
---|
821 | surfaces%npoints = surfaces%npoints + 1 |
---|
822 | point_index(k+1,j,i) = point_index_count |
---|
823 | point_index_count = point_index_count + 1 |
---|
824 | surfaces%points(1,surfaces%npoints) = ( i - 0.5_wp ) * dx |
---|
825 | surfaces%points(2,surfaces%npoints) = ( j - 0.5_wp ) * dy |
---|
826 | surfaces%points(3,surfaces%npoints) = zw(k) |
---|
827 | ENDIF |
---|
828 | |
---|
829 | npg = npg + 1 |
---|
830 | IF ( l == 0 .OR. l == 1 ) THEN |
---|
831 | surfaces%polygons(1,npg) = 4 |
---|
832 | surfaces%polygons(2,npg) = point_index(k,j,i) |
---|
833 | surfaces%polygons(3,npg) = point_index(k,j,i+1) |
---|
834 | surfaces%polygons(4,npg) = point_index(k+1,j,i+1) |
---|
835 | surfaces%polygons(5,npg) = point_index(k+1,j,i) |
---|
836 | ELSE |
---|
837 | surfaces%polygons(1,npg) = 4 |
---|
838 | surfaces%polygons(2,npg) = point_index(k,j,i) |
---|
839 | surfaces%polygons(3,npg) = point_index(k,j+1,i) |
---|
840 | surfaces%polygons(4,npg) = point_index(k+1,j+1,i) |
---|
841 | surfaces%polygons(5,npg) = point_index(k+1,j,i) |
---|
842 | ENDIF |
---|
843 | ENDDO |
---|
844 | |
---|
845 | ENDDO |
---|
846 | ! |
---|
847 | !-- Deallocate temporary dummy variable |
---|
848 | DEALLOCATE ( point_index ) |
---|
849 | ! |
---|
850 | !-- Sum-up total number of surface elements and vertices on domain. This |
---|
851 | !-- will be needed for post-processing. |
---|
852 | surfaces%npoints_total = 0 |
---|
853 | #if defined( __parallel ) |
---|
854 | CALL MPI_ALLREDUCE( surfaces%npoints, surfaces%npoints_total, 1, & |
---|
855 | MPI_INTEGER, MPI_SUM, comm2d, ierr ) |
---|
856 | CALL MPI_ALLREDUCE( surfaces%ns, surfaces%ns_total, 1, & |
---|
857 | MPI_INTEGER, MPI_SUM, comm2d, ierr ) |
---|
858 | #else |
---|
859 | surfaces%npoints_total = surfaces%npoints |
---|
860 | surfaces%ns_total = surfaces%ns |
---|
861 | #endif |
---|
862 | |
---|
863 | END SUBROUTINE surface_data_output_init |
---|
864 | |
---|
865 | !------------------------------------------------------------------------------! |
---|
866 | ! Description: |
---|
867 | ! ------------ |
---|
868 | !> Routine for controlling the data output. Surface data is collected from |
---|
869 | !> different types of surfaces (default, natural, urban) and different |
---|
870 | !> orientation and written to one 1D-output array. Further, NetCDF routines |
---|
871 | !> are called to write the surface data in the respective NetCDF files. |
---|
872 | !------------------------------------------------------------------------------! |
---|
873 | SUBROUTINE surface_data_output( av ) |
---|
874 | |
---|
875 | USE control_parameters, & |
---|
876 | ONLY: io_blocks, io_group, time_since_reference_point |
---|
877 | |
---|
878 | USE pegrid, & |
---|
879 | ONLY: comm2d, ierr |
---|
880 | |
---|
881 | |
---|
882 | IMPLICIT NONE |
---|
883 | |
---|
884 | CHARACTER(LEN=100) :: trimvar = ' ' !< dummy for single output variable |
---|
885 | |
---|
886 | INTEGER(iwp) :: av !< id indicating average or non-average data output |
---|
887 | INTEGER(iwp) :: i !< loop index |
---|
888 | INTEGER(iwp) :: n_out !< counter variables for surface output |
---|
889 | |
---|
890 | ! |
---|
891 | !-- Return, if nothing to output |
---|
892 | IF ( dosurf_no(av) == 0 ) RETURN |
---|
893 | ! |
---|
894 | !-- Open files |
---|
895 | CALL check_open( 25+av ) |
---|
896 | ! |
---|
897 | !-- Write coordinates |
---|
898 | IF ( .NOT. first_output(av) ) THEN |
---|
899 | DO i = 0, io_blocks-1 |
---|
900 | IF ( i == io_group ) THEN |
---|
901 | WRITE ( 25+av ) surfaces%npoints |
---|
902 | WRITE ( 25+av ) surfaces%npoints_total |
---|
903 | WRITE ( 25+av ) surfaces%ns |
---|
904 | WRITE ( 25+av ) surfaces%ns_total |
---|
905 | WRITE ( 25+av ) surfaces%points |
---|
906 | WRITE ( 25+av ) surfaces%polygons |
---|
907 | ENDIF |
---|
908 | #if defined( __parallel ) |
---|
909 | CALL MPI_BARRIER( comm2d, ierr ) |
---|
910 | #endif |
---|
911 | first_output(av) = .TRUE. |
---|
912 | ENDDO |
---|
913 | ENDIF |
---|
914 | |
---|
915 | n_out = 0 |
---|
916 | DO WHILE ( dosurf(av,n_out+1)(1:1) /= ' ' ) |
---|
917 | |
---|
918 | n_out = n_out + 1 |
---|
919 | trimvar = TRIM( dosurf(av,n_out) ) |
---|
920 | ! |
---|
921 | !-- Set the output array to the _FillValue in case it is not |
---|
922 | !-- defined for each type of surface. |
---|
923 | surfaces%var_out = surfaces%fillvalue |
---|
924 | SELECT CASE ( trimvar ) |
---|
925 | |
---|
926 | CASE ( 'us' ) |
---|
927 | ! |
---|
928 | !-- Output of instantaneous data |
---|
929 | IF ( av == 0 ) THEN |
---|
930 | CALL surface_data_output_collect( surf_def_h(0)%us, & |
---|
931 | surf_def_h(1)%us, & |
---|
932 | surf_lsm_h%us, & |
---|
933 | surf_usm_h%us, & |
---|
934 | surf_def_v(0)%us, & |
---|
935 | surf_lsm_v(0)%us, & |
---|
936 | surf_usm_v(0)%us, & |
---|
937 | surf_def_v(1)%us, & |
---|
938 | surf_lsm_v(1)%us, & |
---|
939 | surf_usm_v(1)%us, & |
---|
940 | surf_def_v(2)%us, & |
---|
941 | surf_lsm_v(2)%us, & |
---|
942 | surf_usm_v(2)%us, & |
---|
943 | surf_def_v(3)%us, & |
---|
944 | surf_lsm_v(3)%us, & |
---|
945 | surf_usm_v(3)%us ) |
---|
946 | ELSE |
---|
947 | ! |
---|
948 | !-- Output of averaged data |
---|
949 | surfaces%var_out(:) = surfaces%var_av(:,n_out) / & |
---|
950 | REAL( average_count_surf, KIND=wp ) |
---|
951 | surfaces%var_av(:,n_out) = 0.0_wp |
---|
952 | |
---|
953 | ENDIF |
---|
954 | |
---|
955 | CASE ( 'ts' ) |
---|
956 | ! |
---|
957 | !-- Output of instantaneous data |
---|
958 | IF ( av == 0 ) THEN |
---|
959 | CALL surface_data_output_collect( surf_def_h(0)%ts, & |
---|
960 | surf_def_h(1)%ts, & |
---|
961 | surf_lsm_h%ts, & |
---|
962 | surf_usm_h%ts, & |
---|
963 | surf_def_v(0)%ts, & |
---|
964 | surf_lsm_v(0)%ts, & |
---|
965 | surf_usm_v(0)%ts, & |
---|
966 | surf_def_v(1)%ts, & |
---|
967 | surf_lsm_v(1)%ts, & |
---|
968 | surf_usm_v(1)%ts, & |
---|
969 | surf_def_v(2)%ts, & |
---|
970 | surf_lsm_v(2)%ts, & |
---|
971 | surf_usm_v(2)%ts, & |
---|
972 | surf_def_v(3)%ts, & |
---|
973 | surf_lsm_v(3)%ts, & |
---|
974 | surf_usm_v(3)%ts ) |
---|
975 | ELSE |
---|
976 | ! |
---|
977 | !-- Output of averaged data |
---|
978 | surfaces%var_out(:) = surfaces%var_av(:,n_out) / & |
---|
979 | REAL( average_count_surf, KIND=wp ) |
---|
980 | surfaces%var_av(:,n_out) = 0.0_wp |
---|
981 | |
---|
982 | ENDIF |
---|
983 | |
---|
984 | CASE ( 'qs' ) |
---|
985 | ! |
---|
986 | !-- Output of instantaneous data |
---|
987 | IF ( av == 0 ) THEN |
---|
988 | CALL surface_data_output_collect( surf_def_h(0)%qs, & |
---|
989 | surf_def_h(1)%qs, & |
---|
990 | surf_lsm_h%qs, & |
---|
991 | surf_usm_h%qs, & |
---|
992 | surf_def_v(0)%qs, & |
---|
993 | surf_lsm_v(0)%qs, & |
---|
994 | surf_usm_v(0)%qs, & |
---|
995 | surf_def_v(1)%qs, & |
---|
996 | surf_lsm_v(1)%qs, & |
---|
997 | surf_usm_v(1)%qs, & |
---|
998 | surf_def_v(2)%qs, & |
---|
999 | surf_lsm_v(2)%qs, & |
---|
1000 | surf_usm_v(2)%qs, & |
---|
1001 | surf_def_v(3)%qs, & |
---|
1002 | surf_lsm_v(3)%qs, & |
---|
1003 | surf_usm_v(3)%qs ) |
---|
1004 | ELSE |
---|
1005 | ! |
---|
1006 | !-- Output of averaged data |
---|
1007 | surfaces%var_out(:) = surfaces%var_av(:,n_out) / & |
---|
1008 | REAL( average_count_surf, KIND=wp ) |
---|
1009 | surfaces%var_av(:,n_out) = 0.0_wp |
---|
1010 | |
---|
1011 | ENDIF |
---|
1012 | |
---|
1013 | CASE ( 'ss' ) |
---|
1014 | ! |
---|
1015 | !-- Output of instantaneous data |
---|
1016 | IF ( av == 0 ) THEN |
---|
1017 | CALL surface_data_output_collect( surf_def_h(0)%ss, & |
---|
1018 | surf_def_h(1)%ss, & |
---|
1019 | surf_lsm_h%ss, & |
---|
1020 | surf_usm_h%ss, & |
---|
1021 | surf_def_v(0)%ss, & |
---|
1022 | surf_lsm_v(0)%ss, & |
---|
1023 | surf_usm_v(0)%ss, & |
---|
1024 | surf_def_v(1)%ss, & |
---|
1025 | surf_lsm_v(1)%ss, & |
---|
1026 | surf_usm_v(1)%ss, & |
---|
1027 | surf_def_v(2)%ss, & |
---|
1028 | surf_lsm_v(2)%ss, & |
---|
1029 | surf_usm_v(2)%ss, & |
---|
1030 | surf_def_v(3)%ss, & |
---|
1031 | surf_lsm_v(3)%ss, & |
---|
1032 | surf_usm_v(3)%ss ) |
---|
1033 | ELSE |
---|
1034 | ! |
---|
1035 | !-- Output of averaged data |
---|
1036 | surfaces%var_out(:) = surfaces%var_av(:,n_out) / & |
---|
1037 | REAL( average_count_surf, KIND=wp ) |
---|
1038 | surfaces%var_av(:,n_out) = 0.0_wp |
---|
1039 | |
---|
1040 | ENDIF |
---|
1041 | |
---|
1042 | CASE ( 'qcs' ) |
---|
1043 | ! |
---|
1044 | !-- Output of instantaneous data |
---|
1045 | IF ( av == 0 ) THEN |
---|
1046 | CALL surface_data_output_collect( surf_def_h(0)%qcs, & |
---|
1047 | surf_def_h(1)%qcs, & |
---|
1048 | surf_lsm_h%qcs, & |
---|
1049 | surf_usm_h%qcs, & |
---|
1050 | surf_def_v(0)%qcs, & |
---|
1051 | surf_lsm_v(0)%qcs, & |
---|
1052 | surf_usm_v(0)%qcs, & |
---|
1053 | surf_def_v(1)%qcs, & |
---|
1054 | surf_lsm_v(1)%qcs, & |
---|
1055 | surf_usm_v(1)%qcs, & |
---|
1056 | surf_def_v(2)%qcs, & |
---|
1057 | surf_lsm_v(2)%qcs, & |
---|
1058 | surf_usm_v(2)%qcs, & |
---|
1059 | surf_def_v(3)%qcs, & |
---|
1060 | surf_lsm_v(3)%qcs, & |
---|
1061 | surf_usm_v(3)%qcs ) |
---|
1062 | ELSE |
---|
1063 | ! |
---|
1064 | !-- Output of averaged data |
---|
1065 | surfaces%var_out(:) = surfaces%var_av(:,n_out) / & |
---|
1066 | REAL( average_count_surf, KIND=wp ) |
---|
1067 | surfaces%var_av(:,n_out) = 0.0_wp |
---|
1068 | |
---|
1069 | ENDIF |
---|
1070 | |
---|
1071 | CASE ( 'ncs' ) |
---|
1072 | ! |
---|
1073 | !-- Output of instantaneous data |
---|
1074 | IF ( av == 0 ) THEN |
---|
1075 | CALL surface_data_output_collect( surf_def_h(0)%ncs, & |
---|
1076 | surf_def_h(1)%ncs, & |
---|
1077 | surf_lsm_h%ncs, & |
---|
1078 | surf_usm_h%ncs, & |
---|
1079 | surf_def_v(0)%ncs, & |
---|
1080 | surf_lsm_v(0)%ncs, & |
---|
1081 | surf_usm_v(0)%ncs, & |
---|
1082 | surf_def_v(1)%ncs, & |
---|
1083 | surf_lsm_v(1)%ncs, & |
---|
1084 | surf_usm_v(1)%ncs, & |
---|
1085 | surf_def_v(2)%ncs, & |
---|
1086 | surf_lsm_v(2)%ncs, & |
---|
1087 | surf_usm_v(2)%ncs, & |
---|
1088 | surf_def_v(3)%ncs, & |
---|
1089 | surf_lsm_v(3)%ncs, & |
---|
1090 | surf_usm_v(3)%ncs ) |
---|
1091 | ELSE |
---|
1092 | ! |
---|
1093 | !-- Output of averaged data |
---|
1094 | surfaces%var_out(:) = surfaces%var_av(:,n_out) / & |
---|
1095 | REAL( average_count_surf, KIND=wp ) |
---|
1096 | surfaces%var_av(:,n_out) = 0.0_wp |
---|
1097 | |
---|
1098 | ENDIF |
---|
1099 | |
---|
1100 | CASE ( 'qrs' ) |
---|
1101 | ! |
---|
1102 | !-- Output of instantaneous data |
---|
1103 | IF ( av == 0 ) THEN |
---|
1104 | CALL surface_data_output_collect( surf_def_h(0)%qrs, & |
---|
1105 | surf_def_h(1)%qrs, & |
---|
1106 | surf_lsm_h%qrs, & |
---|
1107 | surf_usm_h%qrs, & |
---|
1108 | surf_def_v(0)%qrs, & |
---|
1109 | surf_lsm_v(0)%qrs, & |
---|
1110 | surf_usm_v(0)%qrs, & |
---|
1111 | surf_def_v(1)%qrs, & |
---|
1112 | surf_lsm_v(1)%qrs, & |
---|
1113 | surf_usm_v(1)%qrs, & |
---|
1114 | surf_def_v(2)%qrs, & |
---|
1115 | surf_lsm_v(2)%qrs, & |
---|
1116 | surf_usm_v(2)%qrs, & |
---|
1117 | surf_def_v(3)%qrs, & |
---|
1118 | surf_lsm_v(3)%qrs, & |
---|
1119 | surf_usm_v(3)%qrs ) |
---|
1120 | ELSE |
---|
1121 | ! |
---|
1122 | !-- Output of averaged data |
---|
1123 | surfaces%var_out(:) = surfaces%var_av(:,n_out) / & |
---|
1124 | REAL( average_count_surf, KIND=wp ) |
---|
1125 | surfaces%var_av(:,n_out) = 0.0_wp |
---|
1126 | |
---|
1127 | ENDIF |
---|
1128 | |
---|
1129 | CASE ( 'nrs' ) |
---|
1130 | ! |
---|
1131 | !-- Output of instantaneous data |
---|
1132 | IF ( av == 0 ) THEN |
---|
1133 | CALL surface_data_output_collect( surf_def_h(0)%nrs, & |
---|
1134 | surf_def_h(1)%nrs, & |
---|
1135 | surf_lsm_h%nrs, & |
---|
1136 | surf_usm_h%nrs, & |
---|
1137 | surf_def_v(0)%nrs, & |
---|
1138 | surf_lsm_v(0)%nrs, & |
---|
1139 | surf_usm_v(0)%nrs, & |
---|
1140 | surf_def_v(1)%nrs, & |
---|
1141 | surf_lsm_v(1)%nrs, & |
---|
1142 | surf_usm_v(1)%nrs, & |
---|
1143 | surf_def_v(2)%nrs, & |
---|
1144 | surf_lsm_v(2)%nrs, & |
---|
1145 | surf_usm_v(2)%nrs, & |
---|
1146 | surf_def_v(3)%nrs, & |
---|
1147 | surf_lsm_v(3)%nrs, & |
---|
1148 | surf_usm_v(3)%nrs ) |
---|
1149 | ELSE |
---|
1150 | ! |
---|
1151 | !-- Output of averaged data |
---|
1152 | surfaces%var_out(:) = surfaces%var_av(:,n_out) / & |
---|
1153 | REAL( average_count_surf, KIND=wp ) |
---|
1154 | surfaces%var_av(:,n_out) = 0.0_wp |
---|
1155 | |
---|
1156 | ENDIF |
---|
1157 | |
---|
1158 | CASE ( 'ol' ) |
---|
1159 | ! |
---|
1160 | !-- Output of instantaneous data |
---|
1161 | IF ( av == 0 ) THEN |
---|
1162 | CALL surface_data_output_collect( surf_def_h(0)%ol, & |
---|
1163 | surf_def_h(1)%ol, & |
---|
1164 | surf_lsm_h%ol, & |
---|
1165 | surf_usm_h%ol, & |
---|
1166 | surf_def_v(0)%ol, & |
---|
1167 | surf_lsm_v(0)%ol, & |
---|
1168 | surf_usm_v(0)%ol, & |
---|
1169 | surf_def_v(1)%ol, & |
---|
1170 | surf_lsm_v(1)%ol, & |
---|
1171 | surf_usm_v(1)%ol, & |
---|
1172 | surf_def_v(2)%ol, & |
---|
1173 | surf_lsm_v(2)%ol, & |
---|
1174 | surf_usm_v(2)%ol, & |
---|
1175 | surf_def_v(3)%ol, & |
---|
1176 | surf_lsm_v(3)%ol, & |
---|
1177 | surf_usm_v(3)%ol ) |
---|
1178 | ELSE |
---|
1179 | ! |
---|
1180 | !-- Output of averaged data |
---|
1181 | surfaces%var_out(:) = surfaces%var_av(:,n_out) / & |
---|
1182 | REAL( average_count_surf, KIND=wp ) |
---|
1183 | surfaces%var_av(:,n_out) = 0.0_wp |
---|
1184 | |
---|
1185 | ENDIF |
---|
1186 | |
---|
1187 | CASE ( 'z0' ) |
---|
1188 | ! |
---|
1189 | !-- Output of instantaneous data |
---|
1190 | IF ( av == 0 ) THEN |
---|
1191 | CALL surface_data_output_collect( surf_def_h(0)%z0, & |
---|
1192 | surf_def_h(1)%z0, & |
---|
1193 | surf_lsm_h%z0, & |
---|
1194 | surf_usm_h%z0, & |
---|
1195 | surf_def_v(0)%z0, & |
---|
1196 | surf_lsm_v(0)%z0, & |
---|
1197 | surf_usm_v(0)%z0, & |
---|
1198 | surf_def_v(1)%z0, & |
---|
1199 | surf_lsm_v(1)%z0, & |
---|
1200 | surf_usm_v(1)%z0, & |
---|
1201 | surf_def_v(2)%z0, & |
---|
1202 | surf_lsm_v(2)%z0, & |
---|
1203 | surf_usm_v(2)%z0, & |
---|
1204 | surf_def_v(3)%z0, & |
---|
1205 | surf_lsm_v(3)%z0, & |
---|
1206 | surf_usm_v(3)%z0 ) |
---|
1207 | ELSE |
---|
1208 | ! |
---|
1209 | !-- Output of averaged data |
---|
1210 | surfaces%var_out(:) = surfaces%var_av(:,n_out) / & |
---|
1211 | REAL( average_count_surf, KIND=wp ) |
---|
1212 | surfaces%var_av(:,n_out) = 0.0_wp |
---|
1213 | |
---|
1214 | ENDIF |
---|
1215 | |
---|
1216 | CASE ( 'z0h' ) |
---|
1217 | ! |
---|
1218 | !-- Output of instantaneous data |
---|
1219 | IF ( av == 0 ) THEN |
---|
1220 | CALL surface_data_output_collect( surf_def_h(0)%z0h, & |
---|
1221 | surf_def_h(1)%z0h, & |
---|
1222 | surf_lsm_h%z0h, & |
---|
1223 | surf_usm_h%z0h, & |
---|
1224 | surf_def_v(0)%z0h, & |
---|
1225 | surf_lsm_v(0)%z0h, & |
---|
1226 | surf_usm_v(0)%z0h, & |
---|
1227 | surf_def_v(1)%z0h, & |
---|
1228 | surf_lsm_v(1)%z0h, & |
---|
1229 | surf_usm_v(1)%z0h, & |
---|
1230 | surf_def_v(2)%z0h, & |
---|
1231 | surf_lsm_v(2)%z0h, & |
---|
1232 | surf_usm_v(2)%z0h, & |
---|
1233 | surf_def_v(3)%z0h, & |
---|
1234 | surf_lsm_v(3)%z0h, & |
---|
1235 | surf_usm_v(3)%z0h ) |
---|
1236 | ELSE |
---|
1237 | ! |
---|
1238 | !-- Output of averaged data |
---|
1239 | surfaces%var_out(:) = surfaces%var_av(:,n_out) / & |
---|
1240 | REAL( average_count_surf, KIND=wp ) |
---|
1241 | surfaces%var_av(:,n_out) = 0.0_wp |
---|
1242 | |
---|
1243 | ENDIF |
---|
1244 | |
---|
1245 | CASE ( 'z0q' ) |
---|
1246 | ! |
---|
1247 | !-- Output of instantaneous data |
---|
1248 | IF ( av == 0 ) THEN |
---|
1249 | CALL surface_data_output_collect( surf_def_h(0)%z0q, & |
---|
1250 | surf_def_h(1)%z0q, & |
---|
1251 | surf_lsm_h%z0q, & |
---|
1252 | surf_usm_h%z0q, & |
---|
1253 | surf_def_v(0)%z0q, & |
---|
1254 | surf_lsm_v(0)%z0q, & |
---|
1255 | surf_usm_v(0)%z0q, & |
---|
1256 | surf_def_v(1)%z0q, & |
---|
1257 | surf_lsm_v(1)%z0q, & |
---|
1258 | surf_usm_v(1)%z0q, & |
---|
1259 | surf_def_v(2)%z0q, & |
---|
1260 | surf_lsm_v(2)%z0q, & |
---|
1261 | surf_usm_v(2)%z0q, & |
---|
1262 | surf_def_v(3)%z0q, & |
---|
1263 | surf_lsm_v(3)%z0q, & |
---|
1264 | surf_usm_v(3)%z0q ) |
---|
1265 | ELSE |
---|
1266 | ! |
---|
1267 | !-- Output of averaged data |
---|
1268 | surfaces%var_out(:) = surfaces%var_av(:,n_out) / & |
---|
1269 | REAL( average_count_surf, KIND=wp ) |
---|
1270 | surfaces%var_av(:,n_out) = 0.0_wp |
---|
1271 | |
---|
1272 | ENDIF |
---|
1273 | |
---|
1274 | CASE ( 'theta1' ) |
---|
1275 | ! |
---|
1276 | !-- Output of instantaneous data |
---|
1277 | IF ( av == 0 ) THEN |
---|
1278 | CALL surface_data_output_collect( surf_def_h(0)%pt1, & |
---|
1279 | surf_def_h(1)%pt1, & |
---|
1280 | surf_lsm_h%pt1, & |
---|
1281 | surf_usm_h%pt1, & |
---|
1282 | surf_def_v(0)%pt1, & |
---|
1283 | surf_lsm_v(0)%pt1, & |
---|
1284 | surf_usm_v(0)%pt1, & |
---|
1285 | surf_def_v(1)%pt1, & |
---|
1286 | surf_lsm_v(1)%pt1, & |
---|
1287 | surf_usm_v(1)%pt1, & |
---|
1288 | surf_def_v(2)%pt1, & |
---|
1289 | surf_lsm_v(2)%pt1, & |
---|
1290 | surf_usm_v(2)%pt1, & |
---|
1291 | surf_def_v(3)%pt1, & |
---|
1292 | surf_lsm_v(3)%pt1, & |
---|
1293 | surf_usm_v(3)%pt1 ) |
---|
1294 | ELSE |
---|
1295 | ! |
---|
1296 | !-- Output of averaged data |
---|
1297 | surfaces%var_out(:) = surfaces%var_av(:,n_out) / & |
---|
1298 | REAL( average_count_surf, KIND=wp ) |
---|
1299 | surfaces%var_av(:,n_out) = 0.0_wp |
---|
1300 | |
---|
1301 | ENDIF |
---|
1302 | |
---|
1303 | CASE ( 'qv1' ) |
---|
1304 | ! |
---|
1305 | !-- Output of instantaneous data |
---|
1306 | IF ( av == 0 ) THEN |
---|
1307 | CALL surface_data_output_collect( surf_def_h(0)%qv1, & |
---|
1308 | surf_def_h(1)%qv1, & |
---|
1309 | surf_lsm_h%qv1, & |
---|
1310 | surf_usm_h%qv1, & |
---|
1311 | surf_def_v(0)%qv1, & |
---|
1312 | surf_lsm_v(0)%qv1, & |
---|
1313 | surf_usm_v(0)%qv1, & |
---|
1314 | surf_def_v(1)%qv1, & |
---|
1315 | surf_lsm_v(1)%qv1, & |
---|
1316 | surf_usm_v(1)%qv1, & |
---|
1317 | surf_def_v(2)%qv1, & |
---|
1318 | surf_lsm_v(2)%qv1, & |
---|
1319 | surf_usm_v(2)%qv1, & |
---|
1320 | surf_def_v(3)%qv1, & |
---|
1321 | surf_lsm_v(3)%qv1, & |
---|
1322 | surf_usm_v(3)%qv1 ) |
---|
1323 | ELSE |
---|
1324 | ! |
---|
1325 | !-- Output of averaged data |
---|
1326 | surfaces%var_out(:) = surfaces%var_av(:,n_out) / & |
---|
1327 | REAL( average_count_surf, KIND=wp ) |
---|
1328 | surfaces%var_av(:,n_out) = 0.0_wp |
---|
1329 | |
---|
1330 | ENDIF |
---|
1331 | |
---|
1332 | CASE ( 'thetav1' ) |
---|
1333 | ! |
---|
1334 | !-- Output of instantaneous data |
---|
1335 | IF ( av == 0 ) THEN |
---|
1336 | CALL surface_data_output_collect( surf_def_h(0)%vpt1, & |
---|
1337 | surf_def_h(1)%vpt1, & |
---|
1338 | surf_lsm_h%vpt1, & |
---|
1339 | surf_usm_h%vpt1, & |
---|
1340 | surf_def_v(0)%vpt1, & |
---|
1341 | surf_lsm_v(0)%vpt1, & |
---|
1342 | surf_usm_v(0)%vpt1, & |
---|
1343 | surf_def_v(1)%vpt1, & |
---|
1344 | surf_lsm_v(1)%vpt1, & |
---|
1345 | surf_usm_v(1)%vpt1, & |
---|
1346 | surf_def_v(2)%vpt1, & |
---|
1347 | surf_lsm_v(2)%vpt1, & |
---|
1348 | surf_usm_v(2)%vpt1, & |
---|
1349 | surf_def_v(3)%vpt1, & |
---|
1350 | surf_lsm_v(3)%vpt1, & |
---|
1351 | surf_usm_v(3)%vpt1 ) |
---|
1352 | ELSE |
---|
1353 | ! |
---|
1354 | !-- Output of averaged data |
---|
1355 | surfaces%var_out(:) = surfaces%var_av(:,n_out) / & |
---|
1356 | REAL( average_count_surf, KIND=wp ) |
---|
1357 | surfaces%var_av(:,n_out) = 0.0_wp |
---|
1358 | |
---|
1359 | ENDIF |
---|
1360 | |
---|
1361 | CASE ( 'usws' ) |
---|
1362 | ! |
---|
1363 | !-- Output of instantaneous data |
---|
1364 | IF ( av == 0 ) THEN |
---|
1365 | CALL surface_data_output_collect( surf_def_h(0)%usws, & |
---|
1366 | surf_def_h(1)%usws, & |
---|
1367 | surf_lsm_h%usws, & |
---|
1368 | surf_usm_h%usws, & |
---|
1369 | surf_def_v(0)%usws, & |
---|
1370 | surf_lsm_v(0)%usws, & |
---|
1371 | surf_usm_v(0)%usws, & |
---|
1372 | surf_def_v(1)%usws, & |
---|
1373 | surf_lsm_v(1)%usws, & |
---|
1374 | surf_usm_v(1)%usws, & |
---|
1375 | surf_def_v(2)%usws, & |
---|
1376 | surf_lsm_v(2)%usws, & |
---|
1377 | surf_usm_v(2)%usws, & |
---|
1378 | surf_def_v(3)%usws, & |
---|
1379 | surf_lsm_v(3)%usws, & |
---|
1380 | surf_usm_v(3)%usws ) |
---|
1381 | ELSE |
---|
1382 | ! |
---|
1383 | !-- Output of averaged data |
---|
1384 | surfaces%var_out(:) = surfaces%var_av(:,n_out) / & |
---|
1385 | REAL( average_count_surf, KIND=wp ) |
---|
1386 | surfaces%var_av(:,n_out) = 0.0_wp |
---|
1387 | |
---|
1388 | ENDIF |
---|
1389 | |
---|
1390 | CASE ( 'vsws' ) |
---|
1391 | ! |
---|
1392 | !-- Output of instantaneous data |
---|
1393 | IF ( av == 0 ) THEN |
---|
1394 | CALL surface_data_output_collect( surf_def_h(0)%vsws, & |
---|
1395 | surf_def_h(1)%vsws, & |
---|
1396 | surf_lsm_h%vsws, & |
---|
1397 | surf_usm_h%vsws, & |
---|
1398 | surf_def_v(0)%vsws, & |
---|
1399 | surf_lsm_v(0)%vsws, & |
---|
1400 | surf_usm_v(0)%vsws, & |
---|
1401 | surf_def_v(1)%vsws, & |
---|
1402 | surf_lsm_v(1)%vsws, & |
---|
1403 | surf_usm_v(1)%vsws, & |
---|
1404 | surf_def_v(2)%vsws, & |
---|
1405 | surf_lsm_v(2)%vsws, & |
---|
1406 | surf_usm_v(2)%vsws, & |
---|
1407 | surf_def_v(3)%vsws, & |
---|
1408 | surf_lsm_v(3)%vsws, & |
---|
1409 | surf_usm_v(3)%vsws ) |
---|
1410 | ELSE |
---|
1411 | ! |
---|
1412 | !-- Output of averaged data |
---|
1413 | surfaces%var_out(:) = surfaces%var_av(:,n_out) / & |
---|
1414 | REAL( average_count_surf, KIND=wp ) |
---|
1415 | surfaces%var_av(:,n_out) = 0.0_wp |
---|
1416 | |
---|
1417 | ENDIF |
---|
1418 | |
---|
1419 | CASE ( 'shf' ) |
---|
1420 | ! |
---|
1421 | !-- Output of instantaneous data |
---|
1422 | IF ( av == 0 ) THEN |
---|
1423 | CALL surface_data_output_collect( surf_def_h(0)%shf, & |
---|
1424 | surf_def_h(1)%shf, & |
---|
1425 | surf_lsm_h%shf, & |
---|
1426 | surf_usm_h%shf, & |
---|
1427 | surf_def_v(0)%shf, & |
---|
1428 | surf_lsm_v(0)%shf, & |
---|
1429 | surf_usm_v(0)%shf, & |
---|
1430 | surf_def_v(1)%shf, & |
---|
1431 | surf_lsm_v(1)%shf, & |
---|
1432 | surf_usm_v(1)%shf, & |
---|
1433 | surf_def_v(2)%shf, & |
---|
1434 | surf_lsm_v(2)%shf, & |
---|
1435 | surf_usm_v(2)%shf, & |
---|
1436 | surf_def_v(3)%shf, & |
---|
1437 | surf_lsm_v(3)%shf, & |
---|
1438 | surf_usm_v(3)%shf ) |
---|
1439 | ELSE |
---|
1440 | ! |
---|
1441 | !-- Output of averaged data |
---|
1442 | surfaces%var_out(:) = surfaces%var_av(:,n_out) / & |
---|
1443 | REAL( average_count_surf, KIND=wp ) |
---|
1444 | surfaces%var_av(:,n_out) = 0.0_wp |
---|
1445 | ENDIF |
---|
1446 | |
---|
1447 | CASE ( 'qsws' ) |
---|
1448 | ! |
---|
1449 | !-- Output of instantaneous data |
---|
1450 | IF ( av == 0 ) THEN |
---|
1451 | CALL surface_data_output_collect( surf_def_h(0)%qsws, & |
---|
1452 | surf_def_h(1)%qsws, & |
---|
1453 | surf_lsm_h%qsws, & |
---|
1454 | surf_usm_h%qsws, & |
---|
1455 | surf_def_v(0)%qsws, & |
---|
1456 | surf_lsm_v(0)%qsws, & |
---|
1457 | surf_usm_v(0)%qsws, & |
---|
1458 | surf_def_v(1)%qsws, & |
---|
1459 | surf_lsm_v(1)%qsws, & |
---|
1460 | surf_usm_v(1)%qsws, & |
---|
1461 | surf_def_v(2)%qsws, & |
---|
1462 | surf_lsm_v(2)%qsws, & |
---|
1463 | surf_usm_v(2)%qsws, & |
---|
1464 | surf_def_v(3)%qsws, & |
---|
1465 | surf_lsm_v(3)%qsws, & |
---|
1466 | surf_usm_v(3)%qsws ) |
---|
1467 | ELSE |
---|
1468 | ! |
---|
1469 | !-- Output of averaged data |
---|
1470 | surfaces%var_out(:) = surfaces%var_av(:,n_out) / & |
---|
1471 | REAL( average_count_surf, KIND=wp ) |
---|
1472 | surfaces%var_av(:,n_out) = 0.0_wp |
---|
1473 | |
---|
1474 | ENDIF |
---|
1475 | |
---|
1476 | CASE ( 'ssws' ) |
---|
1477 | ! |
---|
1478 | !-- Output of instantaneous data |
---|
1479 | IF ( av == 0 ) THEN |
---|
1480 | CALL surface_data_output_collect( surf_def_h(0)%ssws, & |
---|
1481 | surf_def_h(1)%ssws, & |
---|
1482 | surf_lsm_h%ssws, & |
---|
1483 | surf_usm_h%ssws, & |
---|
1484 | surf_def_v(0)%ssws, & |
---|
1485 | surf_lsm_v(0)%ssws, & |
---|
1486 | surf_usm_v(0)%ssws, & |
---|
1487 | surf_def_v(1)%ssws, & |
---|
1488 | surf_lsm_v(1)%ssws, & |
---|
1489 | surf_usm_v(1)%ssws, & |
---|
1490 | surf_def_v(2)%ssws, & |
---|
1491 | surf_lsm_v(2)%ssws, & |
---|
1492 | surf_usm_v(2)%ssws, & |
---|
1493 | surf_def_v(3)%ssws, & |
---|
1494 | surf_lsm_v(3)%ssws, & |
---|
1495 | surf_usm_v(3)%ssws ) |
---|
1496 | ELSE |
---|
1497 | ! |
---|
1498 | !-- Output of averaged data |
---|
1499 | surfaces%var_out(:) = surfaces%var_av(:,n_out) / & |
---|
1500 | REAL( average_count_surf, KIND=wp ) |
---|
1501 | surfaces%var_av(:,n_out) = 0.0_wp |
---|
1502 | |
---|
1503 | ENDIF |
---|
1504 | |
---|
1505 | CASE ( 'qcsws' ) |
---|
1506 | ! |
---|
1507 | !-- Output of instantaneous data |
---|
1508 | IF ( av == 0 ) THEN |
---|
1509 | CALL surface_data_output_collect( surf_def_h(0)%qcsws, & |
---|
1510 | surf_def_h(1)%qcsws, & |
---|
1511 | surf_lsm_h%qcsws, & |
---|
1512 | surf_usm_h%qcsws, & |
---|
1513 | surf_def_v(0)%qcsws, & |
---|
1514 | surf_lsm_v(0)%qcsws, & |
---|
1515 | surf_usm_v(0)%qcsws, & |
---|
1516 | surf_def_v(1)%qcsws, & |
---|
1517 | surf_lsm_v(1)%qcsws, & |
---|
1518 | surf_usm_v(1)%qcsws, & |
---|
1519 | surf_def_v(2)%qcsws, & |
---|
1520 | surf_lsm_v(2)%qcsws, & |
---|
1521 | surf_usm_v(2)%qcsws, & |
---|
1522 | surf_def_v(3)%qcsws, & |
---|
1523 | surf_lsm_v(3)%qcsws, & |
---|
1524 | surf_usm_v(3)%qcsws ) |
---|
1525 | ELSE |
---|
1526 | ! |
---|
1527 | !-- Output of averaged data |
---|
1528 | surfaces%var_out(:) = surfaces%var_av(:,n_out) / & |
---|
1529 | REAL( average_count_surf, KIND=wp ) |
---|
1530 | surfaces%var_av(:,n_out) = 0.0_wp |
---|
1531 | |
---|
1532 | ENDIF |
---|
1533 | |
---|
1534 | CASE ( 'ncsws' ) |
---|
1535 | ! |
---|
1536 | !-- Output of instantaneous data |
---|
1537 | IF ( av == 0 ) THEN |
---|
1538 | CALL surface_data_output_collect( surf_def_h(0)%ncsws, & |
---|
1539 | surf_def_h(1)%ncsws, & |
---|
1540 | surf_lsm_h%ncsws, & |
---|
1541 | surf_usm_h%ncsws, & |
---|
1542 | surf_def_v(0)%ncsws, & |
---|
1543 | surf_lsm_v(0)%ncsws, & |
---|
1544 | surf_usm_v(0)%ncsws, & |
---|
1545 | surf_def_v(1)%ncsws, & |
---|
1546 | surf_lsm_v(1)%ncsws, & |
---|
1547 | surf_usm_v(1)%ncsws, & |
---|
1548 | surf_def_v(2)%ncsws, & |
---|
1549 | surf_lsm_v(2)%ncsws, & |
---|
1550 | surf_usm_v(2)%ncsws, & |
---|
1551 | surf_def_v(3)%ncsws, & |
---|
1552 | surf_lsm_v(3)%ncsws, & |
---|
1553 | surf_usm_v(3)%ncsws ) |
---|
1554 | ELSE |
---|
1555 | ! |
---|
1556 | !-- Output of averaged data |
---|
1557 | surfaces%var_out(:) = surfaces%var_av(:,n_out) / & |
---|
1558 | REAL( average_count_surf, KIND=wp ) |
---|
1559 | surfaces%var_av(:,n_out) = 0.0_wp |
---|
1560 | |
---|
1561 | ENDIF |
---|
1562 | |
---|
1563 | CASE ( 'qrsws' ) |
---|
1564 | ! |
---|
1565 | !-- Output of instantaneous data |
---|
1566 | IF ( av == 0 ) THEN |
---|
1567 | CALL surface_data_output_collect( surf_def_h(0)%qrsws, & |
---|
1568 | surf_def_h(1)%qrsws, & |
---|
1569 | surf_lsm_h%qrsws, & |
---|
1570 | surf_usm_h%qrsws, & |
---|
1571 | surf_def_v(0)%qrsws, & |
---|
1572 | surf_lsm_v(0)%qrsws, & |
---|
1573 | surf_usm_v(0)%qrsws, & |
---|
1574 | surf_def_v(1)%qrsws, & |
---|
1575 | surf_lsm_v(1)%qrsws, & |
---|
1576 | surf_usm_v(1)%qrsws, & |
---|
1577 | surf_def_v(2)%qrsws, & |
---|
1578 | surf_lsm_v(2)%qrsws, & |
---|
1579 | surf_usm_v(2)%qrsws, & |
---|
1580 | surf_def_v(3)%qrsws, & |
---|
1581 | surf_lsm_v(3)%qrsws, & |
---|
1582 | surf_usm_v(3)%qrsws ) |
---|
1583 | ELSE |
---|
1584 | ! |
---|
1585 | !-- Output of averaged data |
---|
1586 | surfaces%var_out(:) = surfaces%var_av(:,n_out) / & |
---|
1587 | REAL( average_count_surf, KIND=wp ) |
---|
1588 | surfaces%var_av(:,n_out) = 0.0_wp |
---|
1589 | |
---|
1590 | ENDIF |
---|
1591 | |
---|
1592 | CASE ( 'nrsws' ) |
---|
1593 | ! |
---|
1594 | !-- Output of instantaneous data |
---|
1595 | IF ( av == 0 ) THEN |
---|
1596 | CALL surface_data_output_collect( surf_def_h(0)%nrsws, & |
---|
1597 | surf_def_h(1)%nrsws, & |
---|
1598 | surf_lsm_h%nrsws, & |
---|
1599 | surf_usm_h%nrsws, & |
---|
1600 | surf_def_v(0)%nrsws, & |
---|
1601 | surf_lsm_v(0)%nrsws, & |
---|
1602 | surf_usm_v(0)%nrsws, & |
---|
1603 | surf_def_v(1)%nrsws, & |
---|
1604 | surf_lsm_v(1)%nrsws, & |
---|
1605 | surf_usm_v(1)%nrsws, & |
---|
1606 | surf_def_v(2)%nrsws, & |
---|
1607 | surf_lsm_v(2)%nrsws, & |
---|
1608 | surf_usm_v(2)%nrsws, & |
---|
1609 | surf_def_v(3)%nrsws, & |
---|
1610 | surf_lsm_v(3)%nrsws, & |
---|
1611 | surf_usm_v(3)%nrsws ) |
---|
1612 | ELSE |
---|
1613 | ! |
---|
1614 | !-- Output of averaged data |
---|
1615 | surfaces%var_out(:) = surfaces%var_av(:,n_out) / & |
---|
1616 | REAL( average_count_surf, KIND=wp ) |
---|
1617 | surfaces%var_av(:,n_out) = 0.0_wp |
---|
1618 | |
---|
1619 | ENDIF |
---|
1620 | |
---|
1621 | CASE ( 'sasws' ) |
---|
1622 | ! |
---|
1623 | !-- Output of instantaneous data |
---|
1624 | IF ( av == 0 ) THEN |
---|
1625 | CALL surface_data_output_collect( surf_def_h(0)%sasws, & |
---|
1626 | surf_def_h(1)%sasws, & |
---|
1627 | surf_lsm_h%sasws, & |
---|
1628 | surf_usm_h%sasws, & |
---|
1629 | surf_def_v(0)%sasws, & |
---|
1630 | surf_lsm_v(0)%sasws, & |
---|
1631 | surf_usm_v(0)%sasws, & |
---|
1632 | surf_def_v(1)%sasws, & |
---|
1633 | surf_lsm_v(1)%sasws, & |
---|
1634 | surf_usm_v(1)%sasws, & |
---|
1635 | surf_def_v(2)%sasws, & |
---|
1636 | surf_lsm_v(2)%sasws, & |
---|
1637 | surf_usm_v(2)%sasws, & |
---|
1638 | surf_def_v(3)%sasws, & |
---|
1639 | surf_lsm_v(3)%sasws, & |
---|
1640 | surf_usm_v(3)%sasws ) |
---|
1641 | ELSE |
---|
1642 | ! |
---|
1643 | !-- Output of averaged data |
---|
1644 | surfaces%var_out(:) = surfaces%var_av(:,n_out) / & |
---|
1645 | REAL( average_count_surf, KIND=wp ) |
---|
1646 | surfaces%var_av(:,n_out) = 0.0_wp |
---|
1647 | |
---|
1648 | ENDIF |
---|
1649 | |
---|
1650 | CASE ( 'q_surface' ) |
---|
1651 | ! |
---|
1652 | !-- Output of instantaneous data |
---|
1653 | IF ( av == 0 ) THEN |
---|
1654 | CALL surface_data_output_collect( surf_def_h(0)%q_surface, & |
---|
1655 | surf_def_h(1)%q_surface, & |
---|
1656 | surf_lsm_h%q_surface, & |
---|
1657 | surf_usm_h%q_surface, & |
---|
1658 | surf_def_v(0)%q_surface, & |
---|
1659 | surf_lsm_v(0)%q_surface, & |
---|
1660 | surf_usm_v(0)%q_surface, & |
---|
1661 | surf_def_v(1)%q_surface, & |
---|
1662 | surf_lsm_v(1)%q_surface, & |
---|
1663 | surf_usm_v(1)%q_surface, & |
---|
1664 | surf_def_v(2)%q_surface, & |
---|
1665 | surf_lsm_v(2)%q_surface, & |
---|
1666 | surf_usm_v(2)%q_surface, & |
---|
1667 | surf_def_v(3)%q_surface, & |
---|
1668 | surf_lsm_v(3)%q_surface, & |
---|
1669 | surf_usm_v(3)%q_surface ) |
---|
1670 | ELSE |
---|
1671 | ! |
---|
1672 | !-- Output of averaged data |
---|
1673 | surfaces%var_out(:) = surfaces%var_av(:,n_out) / & |
---|
1674 | REAL( average_count_surf, KIND=wp ) |
---|
1675 | surfaces%var_av(:,n_out) = 0.0_wp |
---|
1676 | |
---|
1677 | ENDIF |
---|
1678 | |
---|
1679 | CASE ( 'theta_surface' ) |
---|
1680 | ! |
---|
1681 | !-- Output of instantaneous data |
---|
1682 | IF ( av == 0 ) THEN |
---|
1683 | CALL surface_data_output_collect( surf_def_h(0)%pt_surface, & |
---|
1684 | surf_def_h(1)%pt_surface, & |
---|
1685 | surf_lsm_h%pt_surface, & |
---|
1686 | surf_usm_h%pt_surface, & |
---|
1687 | surf_def_v(0)%pt_surface, & |
---|
1688 | surf_lsm_v(0)%pt_surface, & |
---|
1689 | surf_usm_v(0)%pt_surface, & |
---|
1690 | surf_def_v(1)%pt_surface, & |
---|
1691 | surf_lsm_v(1)%pt_surface, & |
---|
1692 | surf_usm_v(1)%pt_surface, & |
---|
1693 | surf_def_v(2)%pt_surface, & |
---|
1694 | surf_lsm_v(2)%pt_surface, & |
---|
1695 | surf_usm_v(2)%pt_surface, & |
---|
1696 | surf_def_v(3)%pt_surface, & |
---|
1697 | surf_lsm_v(3)%pt_surface, & |
---|
1698 | surf_usm_v(3)%pt_surface ) |
---|
1699 | ELSE |
---|
1700 | ! |
---|
1701 | !-- Output of averaged data |
---|
1702 | surfaces%var_out(:) = surfaces%var_av(:,n_out) / & |
---|
1703 | REAL( average_count_surf, KIND=wp ) |
---|
1704 | surfaces%var_av(:,n_out) = 0.0_wp |
---|
1705 | |
---|
1706 | ENDIF |
---|
1707 | |
---|
1708 | CASE ( 'thetav_surface' ) |
---|
1709 | ! |
---|
1710 | !-- Output of instantaneous data |
---|
1711 | IF ( av == 0 ) THEN |
---|
1712 | CALL surface_data_output_collect( surf_def_h(0)%vpt_surface, & |
---|
1713 | surf_def_h(1)%vpt_surface, & |
---|
1714 | surf_lsm_h%vpt_surface, & |
---|
1715 | surf_usm_h%vpt_surface, & |
---|
1716 | surf_def_v(0)%vpt_surface, & |
---|
1717 | surf_lsm_v(0)%vpt_surface, & |
---|
1718 | surf_usm_v(0)%vpt_surface, & |
---|
1719 | surf_def_v(1)%vpt_surface, & |
---|
1720 | surf_lsm_v(1)%vpt_surface, & |
---|
1721 | surf_usm_v(1)%vpt_surface, & |
---|
1722 | surf_def_v(2)%vpt_surface, & |
---|
1723 | surf_lsm_v(2)%vpt_surface, & |
---|
1724 | surf_usm_v(2)%vpt_surface, & |
---|
1725 | surf_def_v(3)%vpt_surface, & |
---|
1726 | surf_lsm_v(3)%vpt_surface, & |
---|
1727 | surf_usm_v(3)%vpt_surface) |
---|
1728 | ELSE |
---|
1729 | ! |
---|
1730 | !-- Output of averaged data |
---|
1731 | surfaces%var_out(:) = surfaces%var_av(:,n_out) / & |
---|
1732 | REAL( average_count_surf, KIND=wp ) |
---|
1733 | surfaces%var_av(:,n_out) = 0.0_wp |
---|
1734 | |
---|
1735 | ENDIF |
---|
1736 | |
---|
1737 | CASE ( 'rad_net' ) |
---|
1738 | ! |
---|
1739 | !-- Output of instantaneous data |
---|
1740 | IF ( av == 0 ) THEN |
---|
1741 | CALL surface_data_output_collect( surf_def_h(0)%rad_net, & |
---|
1742 | surf_def_h(1)%rad_net, & |
---|
1743 | surf_lsm_h%rad_net, & |
---|
1744 | surf_usm_h%rad_net, & |
---|
1745 | surf_def_v(0)%rad_net, & |
---|
1746 | surf_lsm_v(0)%rad_net, & |
---|
1747 | surf_usm_v(0)%rad_net, & |
---|
1748 | surf_def_v(1)%rad_net, & |
---|
1749 | surf_lsm_v(1)%rad_net, & |
---|
1750 | surf_usm_v(1)%rad_net, & |
---|
1751 | surf_def_v(2)%rad_net, & |
---|
1752 | surf_lsm_v(2)%rad_net, & |
---|
1753 | surf_usm_v(2)%rad_net, & |
---|
1754 | surf_def_v(3)%rad_net, & |
---|
1755 | surf_lsm_v(3)%rad_net, & |
---|
1756 | surf_usm_v(3)%rad_net ) |
---|
1757 | ELSE |
---|
1758 | ! |
---|
1759 | !-- Output of averaged data |
---|
1760 | surfaces%var_out(:) = surfaces%var_av(:,n_out) / & |
---|
1761 | REAL( average_count_surf, KIND=wp ) |
---|
1762 | surfaces%var_av(:,n_out) = 0.0_wp |
---|
1763 | |
---|
1764 | ENDIF |
---|
1765 | |
---|
1766 | CASE ( 'rad_lw_in' ) |
---|
1767 | ! |
---|
1768 | !-- Output of instantaneous data |
---|
1769 | IF ( av == 0 ) THEN |
---|
1770 | CALL surface_data_output_collect( surf_def_h(0)%rad_lw_in, & |
---|
1771 | surf_def_h(1)%rad_lw_in, & |
---|
1772 | surf_lsm_h%rad_lw_in, & |
---|
1773 | surf_usm_h%rad_lw_in, & |
---|
1774 | surf_def_v(0)%rad_lw_in, & |
---|
1775 | surf_lsm_v(0)%rad_lw_in, & |
---|
1776 | surf_usm_v(0)%rad_lw_in, & |
---|
1777 | surf_def_v(1)%rad_lw_in, & |
---|
1778 | surf_lsm_v(1)%rad_lw_in, & |
---|
1779 | surf_usm_v(1)%rad_lw_in, & |
---|
1780 | surf_def_v(2)%rad_lw_in, & |
---|
1781 | surf_lsm_v(2)%rad_lw_in, & |
---|
1782 | surf_usm_v(2)%rad_lw_in, & |
---|
1783 | surf_def_v(3)%rad_lw_in, & |
---|
1784 | surf_lsm_v(3)%rad_lw_in, & |
---|
1785 | surf_usm_v(3)%rad_lw_in ) |
---|
1786 | ELSE |
---|
1787 | ! |
---|
1788 | !-- Output of averaged data |
---|
1789 | surfaces%var_out(:) = surfaces%var_av(:,n_out) / & |
---|
1790 | REAL( average_count_surf, KIND=wp ) |
---|
1791 | surfaces%var_av(:,n_out) = 0.0_wp |
---|
1792 | |
---|
1793 | ENDIF |
---|
1794 | |
---|
1795 | CASE ( 'rad_lw_out' ) |
---|
1796 | ! |
---|
1797 | !-- Output of instantaneous data |
---|
1798 | IF ( av == 0 ) THEN |
---|
1799 | CALL surface_data_output_collect( surf_def_h(0)%rad_lw_out, & |
---|
1800 | surf_def_h(1)%rad_lw_out, & |
---|
1801 | surf_lsm_h%rad_lw_out, & |
---|
1802 | surf_usm_h%rad_lw_out, & |
---|
1803 | surf_def_v(0)%rad_lw_out, & |
---|
1804 | surf_lsm_v(0)%rad_lw_out, & |
---|
1805 | surf_usm_v(0)%rad_lw_out, & |
---|
1806 | surf_def_v(1)%rad_lw_out, & |
---|
1807 | surf_lsm_v(1)%rad_lw_out, & |
---|
1808 | surf_usm_v(1)%rad_lw_out, & |
---|
1809 | surf_def_v(2)%rad_lw_out, & |
---|
1810 | surf_lsm_v(2)%rad_lw_out, & |
---|
1811 | surf_usm_v(2)%rad_lw_out, & |
---|
1812 | surf_def_v(3)%rad_lw_out, & |
---|
1813 | surf_lsm_v(3)%rad_lw_out, & |
---|
1814 | surf_usm_v(3)%rad_lw_out ) |
---|
1815 | ELSE |
---|
1816 | ! |
---|
1817 | !-- Output of averaged data |
---|
1818 | surfaces%var_out(:) = surfaces%var_av(:,n_out) / & |
---|
1819 | REAL( average_count_surf, KIND=wp ) |
---|
1820 | surfaces%var_av(:,n_out) = 0.0_wp |
---|
1821 | |
---|
1822 | ENDIF |
---|
1823 | |
---|
1824 | CASE ( 'rad_sw_in' ) |
---|
1825 | ! |
---|
1826 | !-- Output of instantaneous data |
---|
1827 | IF ( av == 0 ) THEN |
---|
1828 | CALL surface_data_output_collect( surf_def_h(0)%rad_sw_in, & |
---|
1829 | surf_def_h(1)%rad_sw_in, & |
---|
1830 | surf_lsm_h%rad_sw_in, & |
---|
1831 | surf_usm_h%rad_sw_in, & |
---|
1832 | surf_def_v(0)%rad_sw_in, & |
---|
1833 | surf_lsm_v(0)%rad_sw_in, & |
---|
1834 | surf_usm_v(0)%rad_sw_in, & |
---|
1835 | surf_def_v(1)%rad_sw_in, & |
---|
1836 | surf_lsm_v(1)%rad_sw_in, & |
---|
1837 | surf_usm_v(1)%rad_sw_in, & |
---|
1838 | surf_def_v(2)%rad_sw_in, & |
---|
1839 | surf_lsm_v(2)%rad_sw_in, & |
---|
1840 | surf_usm_v(2)%rad_sw_in, & |
---|
1841 | surf_def_v(3)%rad_sw_in, & |
---|
1842 | surf_lsm_v(3)%rad_sw_in, & |
---|
1843 | surf_usm_v(3)%rad_sw_in ) |
---|
1844 | ELSE |
---|
1845 | ! |
---|
1846 | !-- Output of averaged data |
---|
1847 | surfaces%var_out(:) = surfaces%var_av(:,n_out) / & |
---|
1848 | REAL( average_count_surf, KIND=wp ) |
---|
1849 | surfaces%var_av(:,n_out) = 0.0_wp |
---|
1850 | |
---|
1851 | ENDIF |
---|
1852 | |
---|
1853 | CASE ( 'rad_sw_out' ) |
---|
1854 | ! |
---|
1855 | !-- Output of instantaneous data |
---|
1856 | IF ( av == 0 ) THEN |
---|
1857 | CALL surface_data_output_collect( surf_def_h(0)%rad_sw_out, & |
---|
1858 | surf_def_h(1)%rad_sw_out, & |
---|
1859 | surf_lsm_h%rad_sw_out, & |
---|
1860 | surf_usm_h%rad_sw_out, & |
---|
1861 | surf_def_v(0)%rad_sw_out, & |
---|
1862 | surf_lsm_v(0)%rad_sw_out, & |
---|
1863 | surf_usm_v(0)%rad_sw_out, & |
---|
1864 | surf_def_v(1)%rad_sw_out, & |
---|
1865 | surf_lsm_v(1)%rad_sw_out, & |
---|
1866 | surf_usm_v(1)%rad_sw_out, & |
---|
1867 | surf_def_v(2)%rad_sw_out, & |
---|
1868 | surf_lsm_v(2)%rad_sw_out, & |
---|
1869 | surf_usm_v(2)%rad_sw_out, & |
---|
1870 | surf_def_v(3)%rad_sw_out, & |
---|
1871 | surf_lsm_v(3)%rad_sw_out, & |
---|
1872 | surf_usm_v(3)%rad_sw_out ) |
---|
1873 | ELSE |
---|
1874 | ! |
---|
1875 | !-- Output of averaged data |
---|
1876 | surfaces%var_out(:) = surfaces%var_av(:,n_out) / & |
---|
1877 | REAL( average_count_surf, KIND=wp ) |
---|
1878 | surfaces%var_av(:,n_out) = 0.0_wp |
---|
1879 | |
---|
1880 | ENDIF |
---|
1881 | |
---|
1882 | CASE ( 'ghf' ) |
---|
1883 | ! |
---|
1884 | !-- Output of instantaneous data |
---|
1885 | IF ( av == 0 ) THEN |
---|
1886 | CALL surface_data_output_collect( surf_def_h(0)%ghf, & |
---|
1887 | surf_def_h(1)%ghf, & |
---|
1888 | surf_lsm_h%ghf, & |
---|
1889 | surf_usm_h%ghf, & |
---|
1890 | surf_def_v(0)%ghf, & |
---|
1891 | surf_lsm_v(0)%ghf, & |
---|
1892 | surf_usm_v(0)%ghf, & |
---|
1893 | surf_def_v(1)%ghf, & |
---|
1894 | surf_lsm_v(1)%ghf, & |
---|
1895 | surf_usm_v(1)%ghf, & |
---|
1896 | surf_def_v(2)%ghf, & |
---|
1897 | surf_lsm_v(2)%ghf, & |
---|
1898 | surf_usm_v(2)%ghf, & |
---|
1899 | surf_def_v(3)%ghf, & |
---|
1900 | surf_lsm_v(3)%ghf, & |
---|
1901 | surf_usm_v(3)%ghf ) |
---|
1902 | ELSE |
---|
1903 | ! |
---|
1904 | !-- Output of averaged data |
---|
1905 | surfaces%var_out(:) = surfaces%var_av(:,n_out) / & |
---|
1906 | REAL( average_count_surf, KIND=wp ) |
---|
1907 | surfaces%var_av(:,n_out) = 0.0_wp |
---|
1908 | |
---|
1909 | ENDIF |
---|
1910 | |
---|
1911 | CASE ( 'r_a' ) |
---|
1912 | ! |
---|
1913 | !-- Output of instantaneous data |
---|
1914 | IF ( av == 0 ) THEN |
---|
1915 | CALL surface_data_output_collect( surf_def_h(0)%r_a, & |
---|
1916 | surf_def_h(1)%r_a, & |
---|
1917 | surf_lsm_h%r_a, & |
---|
1918 | surf_usm_h%r_a, & |
---|
1919 | surf_def_v(0)%r_a, & |
---|
1920 | surf_lsm_v(0)%r_a, & |
---|
1921 | surf_usm_v(0)%r_a, & |
---|
1922 | surf_def_v(1)%r_a, & |
---|
1923 | surf_lsm_v(1)%r_a, & |
---|
1924 | surf_usm_v(1)%r_a, & |
---|
1925 | surf_def_v(2)%r_a, & |
---|
1926 | surf_lsm_v(2)%r_a, & |
---|
1927 | surf_usm_v(2)%r_a, & |
---|
1928 | surf_def_v(3)%r_a, & |
---|
1929 | surf_lsm_v(3)%r_a, & |
---|
1930 | surf_usm_v(3)%r_a ) |
---|
1931 | ELSE |
---|
1932 | ! |
---|
1933 | !-- Output of averaged data |
---|
1934 | surfaces%var_out(:) = surfaces%var_av(:,n_out) / & |
---|
1935 | REAL( average_count_surf, KIND=wp ) |
---|
1936 | surfaces%var_av(:,n_out) = 0.0_wp |
---|
1937 | |
---|
1938 | ENDIF |
---|
1939 | |
---|
1940 | CASE ( 'r_soil' ) |
---|
1941 | ! |
---|
1942 | !-- Output of instantaneous data |
---|
1943 | IF ( av == 0 ) THEN |
---|
1944 | CALL surface_data_output_collect( surf_def_h(0)%r_soil, & |
---|
1945 | surf_def_h(1)%r_soil, & |
---|
1946 | surf_lsm_h%r_soil, & |
---|
1947 | surf_usm_h%r_soil, & |
---|
1948 | surf_def_v(0)%r_soil, & |
---|
1949 | surf_lsm_v(0)%r_soil, & |
---|
1950 | surf_usm_v(0)%r_soil, & |
---|
1951 | surf_def_v(1)%r_soil, & |
---|
1952 | surf_lsm_v(1)%r_soil, & |
---|
1953 | surf_usm_v(1)%r_soil, & |
---|
1954 | surf_def_v(2)%r_soil, & |
---|
1955 | surf_lsm_v(2)%r_soil, & |
---|
1956 | surf_usm_v(2)%r_soil, & |
---|
1957 | surf_def_v(3)%r_soil, & |
---|
1958 | surf_lsm_v(3)%r_soil, & |
---|
1959 | surf_usm_v(3)%r_soil ) |
---|
1960 | ELSE |
---|
1961 | ! |
---|
1962 | !-- Output of averaged data |
---|
1963 | surfaces%var_out(:) = surfaces%var_av(:,n_out) / & |
---|
1964 | REAL( average_count_surf, KIND=wp ) |
---|
1965 | surfaces%var_av(:,n_out) = 0.0_wp |
---|
1966 | |
---|
1967 | ENDIF |
---|
1968 | |
---|
1969 | CASE ( 'r_canopy' ) |
---|
1970 | ! |
---|
1971 | !-- Output of instantaneous data |
---|
1972 | IF ( av == 0 ) THEN |
---|
1973 | CALL surface_data_output_collect( surf_def_h(0)%r_canopy, & |
---|
1974 | surf_def_h(1)%r_canopy, & |
---|
1975 | surf_lsm_h%r_canopy, & |
---|
1976 | surf_usm_h%r_canopy, & |
---|
1977 | surf_def_v(0)%r_canopy, & |
---|
1978 | surf_lsm_v(0)%r_canopy, & |
---|
1979 | surf_usm_v(0)%r_canopy, & |
---|
1980 | surf_def_v(1)%r_canopy, & |
---|
1981 | surf_lsm_v(1)%r_canopy, & |
---|
1982 | surf_usm_v(1)%r_canopy, & |
---|
1983 | surf_def_v(2)%r_canopy, & |
---|
1984 | surf_lsm_v(2)%r_canopy, & |
---|
1985 | surf_usm_v(2)%r_canopy, & |
---|
1986 | surf_def_v(3)%r_canopy, & |
---|
1987 | surf_lsm_v(3)%r_canopy, & |
---|
1988 | surf_usm_v(3)%r_canopy ) |
---|
1989 | ELSE |
---|
1990 | ! |
---|
1991 | !-- Output of averaged data |
---|
1992 | surfaces%var_out(:) = surfaces%var_av(:,n_out) / & |
---|
1993 | REAL( average_count_surf, KIND=wp ) |
---|
1994 | surfaces%var_av(:,n_out) = 0.0_wp |
---|
1995 | |
---|
1996 | ENDIF |
---|
1997 | |
---|
1998 | CASE ( 'r_s' ) |
---|
1999 | ! |
---|
2000 | !-- Output of instantaneous data |
---|
2001 | IF ( av == 0 ) THEN |
---|
2002 | CALL surface_data_output_collect( surf_def_h(0)%r_s, & |
---|
2003 | surf_def_h(1)%r_s, & |
---|
2004 | surf_lsm_h%r_s, & |
---|
2005 | surf_usm_h%r_s, & |
---|
2006 | surf_def_v(0)%r_s, & |
---|
2007 | surf_lsm_v(0)%r_s, & |
---|
2008 | surf_usm_v(0)%r_s, & |
---|
2009 | surf_def_v(1)%r_s, & |
---|
2010 | surf_lsm_v(1)%r_s, & |
---|
2011 | surf_usm_v(1)%r_s, & |
---|
2012 | surf_def_v(2)%r_s, & |
---|
2013 | surf_lsm_v(2)%r_s, & |
---|
2014 | surf_usm_v(2)%r_s, & |
---|
2015 | surf_def_v(3)%r_s, & |
---|
2016 | surf_lsm_v(3)%r_s, & |
---|
2017 | surf_usm_v(3)%r_s ) |
---|
2018 | ELSE |
---|
2019 | ! |
---|
2020 | !-- Output of averaged data |
---|
2021 | surfaces%var_out(:) = surfaces%var_av(:,n_out) / & |
---|
2022 | REAL( average_count_surf, KIND=wp ) |
---|
2023 | surfaces%var_av(:,n_out) = 0.0_wp |
---|
2024 | |
---|
2025 | ENDIF |
---|
2026 | |
---|
2027 | CASE ( 'rad_sw_dir' ) |
---|
2028 | ! |
---|
2029 | !-- Output of instantaneous data |
---|
2030 | IF ( av == 0 ) THEN |
---|
2031 | CALL surface_data_output_collect( surf_def_h(0)%rad_sw_dir, & |
---|
2032 | surf_def_h(1)%rad_sw_dir, & |
---|
2033 | surf_lsm_h%rad_sw_dir, & |
---|
2034 | surf_usm_h%rad_sw_dir, & |
---|
2035 | surf_def_v(0)%rad_sw_dir, & |
---|
2036 | surf_lsm_v(0)%rad_sw_dir, & |
---|
2037 | surf_usm_v(0)%rad_sw_dir, & |
---|
2038 | surf_def_v(1)%rad_sw_dir, & |
---|
2039 | surf_lsm_v(1)%rad_sw_dir, & |
---|
2040 | surf_usm_v(1)%rad_sw_dir, & |
---|
2041 | surf_def_v(2)%rad_sw_dir, & |
---|
2042 | surf_lsm_v(2)%rad_sw_dir, & |
---|
2043 | surf_usm_v(2)%rad_sw_dir, & |
---|
2044 | surf_def_v(3)%rad_sw_dir, & |
---|
2045 | surf_lsm_v(3)%rad_sw_dir, & |
---|
2046 | surf_usm_v(3)%rad_sw_dir ) |
---|
2047 | ELSE |
---|
2048 | ! |
---|
2049 | !-- Output of averaged data |
---|
2050 | surfaces%var_out(:) = surfaces%var_av(:,n_out) / & |
---|
2051 | REAL( average_count_surf, KIND=wp ) |
---|
2052 | surfaces%var_av(:,n_out) = 0.0_wp |
---|
2053 | |
---|
2054 | ENDIF |
---|
2055 | |
---|
2056 | CASE ( 'rad_sw_dif' ) |
---|
2057 | ! |
---|
2058 | !-- Output of instantaneous data |
---|
2059 | IF ( av == 0 ) THEN |
---|
2060 | CALL surface_data_output_collect( surf_def_h(0)%rad_sw_dif, & |
---|
2061 | surf_def_h(1)%rad_sw_dif, & |
---|
2062 | surf_lsm_h%rad_sw_dif, & |
---|
2063 | surf_usm_h%rad_sw_dif, & |
---|
2064 | surf_def_v(0)%rad_sw_dif, & |
---|
2065 | surf_lsm_v(0)%rad_sw_dif, & |
---|
2066 | surf_usm_v(0)%rad_sw_dif, & |
---|
2067 | surf_def_v(1)%rad_sw_dif, & |
---|
2068 | surf_lsm_v(1)%rad_sw_dif, & |
---|
2069 | surf_usm_v(1)%rad_sw_dif, & |
---|
2070 | surf_def_v(2)%rad_sw_dif, & |
---|
2071 | surf_lsm_v(2)%rad_sw_dif, & |
---|
2072 | surf_usm_v(2)%rad_sw_dif, & |
---|
2073 | surf_def_v(3)%rad_sw_dif, & |
---|
2074 | surf_lsm_v(3)%rad_sw_dif, & |
---|
2075 | surf_usm_v(3)%rad_sw_dif ) |
---|
2076 | ELSE |
---|
2077 | ! |
---|
2078 | !-- Output of averaged data |
---|
2079 | surfaces%var_out(:) = surfaces%var_av(:,n_out) / & |
---|
2080 | REAL( average_count_surf, KIND=wp ) |
---|
2081 | surfaces%var_av(:,n_out) = 0.0_wp |
---|
2082 | |
---|
2083 | ENDIF |
---|
2084 | |
---|
2085 | CASE ( 'rad_sw_ref' ) |
---|
2086 | ! |
---|
2087 | !-- Output of instantaneous data |
---|
2088 | IF ( av == 0 ) THEN |
---|
2089 | CALL surface_data_output_collect( surf_def_h(0)%rad_sw_ref, & |
---|
2090 | surf_def_h(1)%rad_sw_ref, & |
---|
2091 | surf_lsm_h%rad_sw_ref, & |
---|
2092 | surf_usm_h%rad_sw_ref, & |
---|
2093 | surf_def_v(0)%rad_sw_ref, & |
---|
2094 | surf_lsm_v(0)%rad_sw_ref, & |
---|
2095 | surf_usm_v(0)%rad_sw_ref, & |
---|
2096 | surf_def_v(1)%rad_sw_ref, & |
---|
2097 | surf_lsm_v(1)%rad_sw_ref, & |
---|
2098 | surf_usm_v(1)%rad_sw_ref, & |
---|
2099 | surf_def_v(2)%rad_sw_ref, & |
---|
2100 | surf_lsm_v(2)%rad_sw_ref, & |
---|
2101 | surf_usm_v(2)%rad_sw_ref, & |
---|
2102 | surf_def_v(3)%rad_sw_ref, & |
---|
2103 | surf_lsm_v(3)%rad_sw_ref, & |
---|
2104 | surf_usm_v(3)%rad_sw_ref ) |
---|
2105 | ELSE |
---|
2106 | ! |
---|
2107 | !-- Output of averaged data |
---|
2108 | surfaces%var_out(:) = surfaces%var_av(:,n_out) / & |
---|
2109 | REAL( average_count_surf, KIND=wp ) |
---|
2110 | surfaces%var_av(:,n_out) = 0.0_wp |
---|
2111 | |
---|
2112 | ENDIF |
---|
2113 | |
---|
2114 | CASE ( 'rad_sw_res' ) |
---|
2115 | ! |
---|
2116 | !-- Output of instantaneous data |
---|
2117 | IF ( av == 0 ) THEN |
---|
2118 | CALL surface_data_output_collect( surf_def_h(0)%rad_sw_res, & |
---|
2119 | surf_def_h(1)%rad_sw_res, & |
---|
2120 | surf_lsm_h%rad_sw_res, & |
---|
2121 | surf_usm_h%rad_sw_res, & |
---|
2122 | surf_def_v(0)%rad_sw_res, & |
---|
2123 | surf_lsm_v(0)%rad_sw_res, & |
---|
2124 | surf_usm_v(0)%rad_sw_res, & |
---|
2125 | surf_def_v(1)%rad_sw_res, & |
---|
2126 | surf_lsm_v(1)%rad_sw_res, & |
---|
2127 | surf_usm_v(1)%rad_sw_res, & |
---|
2128 | surf_def_v(2)%rad_sw_res, & |
---|
2129 | surf_lsm_v(2)%rad_sw_res, & |
---|
2130 | surf_usm_v(2)%rad_sw_res, & |
---|
2131 | surf_def_v(3)%rad_sw_res, & |
---|
2132 | surf_lsm_v(3)%rad_sw_res, & |
---|
2133 | surf_usm_v(3)%rad_sw_res ) |
---|
2134 | ELSE |
---|
2135 | ! |
---|
2136 | !-- Output of averaged data |
---|
2137 | surfaces%var_out(:) = surfaces%var_av(:,n_out) / & |
---|
2138 | REAL( average_count_surf, KIND=wp ) |
---|
2139 | surfaces%var_av(:,n_out) = 0.0_wp |
---|
2140 | |
---|
2141 | ENDIF |
---|
2142 | |
---|
2143 | CASE ( 'rad_lw_dif' ) |
---|
2144 | ! |
---|
2145 | !-- Output of instantaneous data |
---|
2146 | IF ( av == 0 ) THEN |
---|
2147 | CALL surface_data_output_collect( surf_def_h(0)%rad_lw_dif, & |
---|
2148 | surf_def_h(1)%rad_lw_dif, & |
---|
2149 | surf_lsm_h%rad_lw_dif, & |
---|
2150 | surf_usm_h%rad_lw_dif, & |
---|
2151 | surf_def_v(0)%rad_lw_dif, & |
---|
2152 | surf_lsm_v(0)%rad_lw_dif, & |
---|
2153 | surf_usm_v(0)%rad_lw_dif, & |
---|
2154 | surf_def_v(1)%rad_lw_dif, & |
---|
2155 | surf_lsm_v(1)%rad_lw_dif, & |
---|
2156 | surf_usm_v(1)%rad_lw_dif, & |
---|
2157 | surf_def_v(2)%rad_lw_dif, & |
---|
2158 | surf_lsm_v(2)%rad_lw_dif, & |
---|
2159 | surf_usm_v(2)%rad_lw_dif, & |
---|
2160 | surf_def_v(3)%rad_lw_dif, & |
---|
2161 | surf_lsm_v(3)%rad_lw_dif, & |
---|
2162 | surf_usm_v(3)%rad_lw_dif ) |
---|
2163 | ELSE |
---|
2164 | ! |
---|
2165 | !-- Output of averaged data |
---|
2166 | surfaces%var_out(:) = surfaces%var_av(:,n_out) / & |
---|
2167 | REAL( average_count_surf, KIND=wp ) |
---|
2168 | surfaces%var_av(:,n_out) = 0.0_wp |
---|
2169 | |
---|
2170 | ENDIF |
---|
2171 | |
---|
2172 | CASE ( 'rad_lw_ref' ) |
---|
2173 | ! |
---|
2174 | !-- Output of instantaneous data |
---|
2175 | IF ( av == 0 ) THEN |
---|
2176 | CALL surface_data_output_collect( surf_def_h(0)%rad_lw_ref, & |
---|
2177 | surf_def_h(1)%rad_lw_ref, & |
---|
2178 | surf_lsm_h%rad_lw_ref, & |
---|
2179 | surf_usm_h%rad_lw_ref, & |
---|
2180 | surf_def_v(0)%rad_lw_ref, & |
---|
2181 | surf_lsm_v(0)%rad_lw_ref, & |
---|
2182 | surf_usm_v(0)%rad_lw_ref, & |
---|
2183 | surf_def_v(1)%rad_lw_ref, & |
---|
2184 | surf_lsm_v(1)%rad_lw_ref, & |
---|
2185 | surf_usm_v(1)%rad_lw_ref, & |
---|
2186 | surf_def_v(2)%rad_lw_ref, & |
---|
2187 | surf_lsm_v(2)%rad_lw_ref, & |
---|
2188 | surf_usm_v(2)%rad_lw_ref, & |
---|
2189 | surf_def_v(3)%rad_lw_ref, & |
---|
2190 | surf_lsm_v(3)%rad_lw_ref, & |
---|
2191 | surf_usm_v(3)%rad_lw_ref ) |
---|
2192 | ELSE |
---|
2193 | ! |
---|
2194 | !-- Output of averaged data |
---|
2195 | surfaces%var_out(:) = surfaces%var_av(:,n_out) / & |
---|
2196 | REAL( average_count_surf, KIND=wp ) |
---|
2197 | surfaces%var_av(:,n_out) = 0.0_wp |
---|
2198 | |
---|
2199 | ENDIF |
---|
2200 | |
---|
2201 | CASE ( 'rad_lw_res' ) |
---|
2202 | ! |
---|
2203 | !-- Output of instantaneous data |
---|
2204 | IF ( av == 0 ) THEN |
---|
2205 | CALL surface_data_output_collect( surf_def_h(0)%rad_lw_res, & |
---|
2206 | surf_def_h(1)%rad_lw_res, & |
---|
2207 | surf_lsm_h%rad_lw_res, & |
---|
2208 | surf_usm_h%rad_lw_res, & |
---|
2209 | surf_def_v(0)%rad_lw_res, & |
---|
2210 | surf_lsm_v(0)%rad_lw_res, & |
---|
2211 | surf_usm_v(0)%rad_lw_res, & |
---|
2212 | surf_def_v(1)%rad_lw_res, & |
---|
2213 | surf_lsm_v(1)%rad_lw_res, & |
---|
2214 | surf_usm_v(1)%rad_lw_res, & |
---|
2215 | surf_def_v(2)%rad_lw_res, & |
---|
2216 | surf_lsm_v(2)%rad_lw_res, & |
---|
2217 | surf_usm_v(2)%rad_lw_res, & |
---|
2218 | surf_def_v(3)%rad_lw_res, & |
---|
2219 | surf_lsm_v(3)%rad_lw_res, & |
---|
2220 | surf_usm_v(3)%rad_lw_res ) |
---|
2221 | ELSE |
---|
2222 | ! |
---|
2223 | !-- Output of averaged data |
---|
2224 | surfaces%var_out(:) = surfaces%var_av(:,n_out) / & |
---|
2225 | REAL( average_count_surf, KIND=wp ) |
---|
2226 | surfaces%var_av(:,n_out) = 0.0_wp |
---|
2227 | |
---|
2228 | ENDIF |
---|
2229 | |
---|
2230 | CASE ( 'uvw1' ) |
---|
2231 | ! |
---|
2232 | !-- Output of instantaneous data |
---|
2233 | IF ( av == 0 ) THEN |
---|
2234 | CALL surface_data_output_collect( surf_def_h(0)%uvw_abs, & |
---|
2235 | surf_def_h(1)%uvw_abs, & |
---|
2236 | surf_lsm_h%uvw_abs, & |
---|
2237 | surf_usm_h%uvw_abs, & |
---|
2238 | surf_def_v(0)%uvw_abs, & |
---|
2239 | surf_lsm_v(0)%uvw_abs, & |
---|
2240 | surf_usm_v(0)%uvw_abs, & |
---|
2241 | surf_def_v(1)%uvw_abs, & |
---|
2242 | surf_lsm_v(1)%uvw_abs, & |
---|
2243 | surf_usm_v(1)%uvw_abs, & |
---|
2244 | surf_def_v(2)%uvw_abs, & |
---|
2245 | surf_lsm_v(2)%uvw_abs, & |
---|
2246 | surf_usm_v(2)%uvw_abs, & |
---|
2247 | surf_def_v(3)%uvw_abs, & |
---|
2248 | surf_lsm_v(3)%uvw_abs, & |
---|
2249 | surf_usm_v(3)%uvw_abs ) |
---|
2250 | ELSE |
---|
2251 | ! |
---|
2252 | !-- Output of averaged data |
---|
2253 | surfaces%var_out(:) = surfaces%var_av(:,n_out) / & |
---|
2254 | REAL( average_count_surf, KIND=wp ) |
---|
2255 | surfaces%var_av(:,n_out) = 0.0_wp |
---|
2256 | |
---|
2257 | ENDIF |
---|
2258 | |
---|
2259 | ! |
---|
2260 | !-- Add further variables: |
---|
2261 | !-- 'css', 'cssws', 'qsws_liq', 'qsws_soil', 'qsws_veg' |
---|
2262 | |
---|
2263 | END SELECT |
---|
2264 | ! |
---|
2265 | !-- Write to binary file: |
---|
2266 | !-- - surfaces%points ( 3, 1-npoints ) |
---|
2267 | !-- - surfaces%polygons ( 5, 1-ns ) |
---|
2268 | !-- - surfaces%var_out ( 1-ns, time ) |
---|
2269 | !-- - Dimension: 1-nsurfaces, 1-npoints - can be ordered consecutively |
---|
2270 | !-- - Distinguish between average and non-average data |
---|
2271 | DO i = 0, io_blocks-1 |
---|
2272 | IF ( i == io_group ) THEN |
---|
2273 | WRITE ( 25+av ) LEN_TRIM( 'time' ) |
---|
2274 | WRITE ( 25+av ) 'time' |
---|
2275 | WRITE ( 25+av ) time_since_reference_point |
---|
2276 | WRITE ( 25+av ) LEN_TRIM( trimvar ) |
---|
2277 | WRITE ( 25+av ) TRIM( trimvar ) |
---|
2278 | WRITE ( 25+av ) surfaces%var_out |
---|
2279 | ENDIF |
---|
2280 | #if defined( __parallel ) |
---|
2281 | CALL MPI_BARRIER( comm2d, ierr ) |
---|
2282 | #endif |
---|
2283 | ENDDO |
---|
2284 | |
---|
2285 | ENDDO |
---|
2286 | |
---|
2287 | ! |
---|
2288 | !-- If averaged output was written to NetCDF file, set the counter to zero |
---|
2289 | IF ( av == 1 ) average_count_surf = 0 |
---|
2290 | |
---|
2291 | END SUBROUTINE surface_data_output |
---|
2292 | |
---|
2293 | !------------------------------------------------------------------------------! |
---|
2294 | ! Description: |
---|
2295 | ! ------------ |
---|
2296 | !> Routine for controlling the data averaging. |
---|
2297 | !------------------------------------------------------------------------------! |
---|
2298 | SUBROUTINE surface_data_output_averaging |
---|
2299 | |
---|
2300 | IMPLICIT NONE |
---|
2301 | |
---|
2302 | CHARACTER(LEN=100) :: trimvar !< dummy variable for current output variable |
---|
2303 | |
---|
2304 | INTEGER(iwp) :: n_out !< counter variables for surface output |
---|
2305 | |
---|
2306 | n_out = 0 |
---|
2307 | DO WHILE ( dosurf(1,n_out+1)(1:1) /= ' ' ) |
---|
2308 | |
---|
2309 | n_out = n_out + 1 |
---|
2310 | trimvar = TRIM( dosurf(1,n_out) ) |
---|
2311 | |
---|
2312 | SELECT CASE ( trimvar ) |
---|
2313 | |
---|
2314 | CASE ( 'us' ) |
---|
2315 | CALL surface_data_output_sum_up( surf_def_h(0)%us, & |
---|
2316 | surf_def_h(1)%us, & |
---|
2317 | surf_lsm_h%us, & |
---|
2318 | surf_usm_h%us, & |
---|
2319 | surf_def_v(0)%us, & |
---|
2320 | surf_lsm_v(0)%us, & |
---|
2321 | surf_usm_v(0)%us, & |
---|
2322 | surf_def_v(1)%us, & |
---|
2323 | surf_lsm_v(1)%us, & |
---|
2324 | surf_usm_v(1)%us, & |
---|
2325 | surf_def_v(2)%us, & |
---|
2326 | surf_lsm_v(2)%us, & |
---|
2327 | surf_usm_v(2)%us, & |
---|
2328 | surf_def_v(3)%us, & |
---|
2329 | surf_lsm_v(3)%us, & |
---|
2330 | surf_usm_v(3)%us, n_out ) |
---|
2331 | |
---|
2332 | CASE ( 'ts' ) |
---|
2333 | CALL surface_data_output_sum_up( surf_def_h(0)%ts, & |
---|
2334 | surf_def_h(1)%ts, & |
---|
2335 | surf_lsm_h%ts, & |
---|
2336 | surf_usm_h%ts, & |
---|
2337 | surf_def_v(0)%ts, & |
---|
2338 | surf_lsm_v(0)%ts, & |
---|
2339 | surf_usm_v(0)%ts, & |
---|
2340 | surf_def_v(1)%ts, & |
---|
2341 | surf_lsm_v(1)%ts, & |
---|
2342 | surf_usm_v(1)%ts, & |
---|
2343 | surf_def_v(2)%ts, & |
---|
2344 | surf_lsm_v(2)%ts, & |
---|
2345 | surf_usm_v(2)%ts, & |
---|
2346 | surf_def_v(3)%ts, & |
---|
2347 | surf_lsm_v(3)%ts, & |
---|
2348 | surf_usm_v(3)%ts, n_out ) |
---|
2349 | |
---|
2350 | CASE ( 'qs' ) |
---|
2351 | CALL surface_data_output_sum_up( surf_def_h(0)%qs, & |
---|
2352 | surf_def_h(1)%qs, & |
---|
2353 | surf_lsm_h%qs, & |
---|
2354 | surf_usm_h%qs, & |
---|
2355 | surf_def_v(0)%qs, & |
---|
2356 | surf_lsm_v(0)%qs, & |
---|
2357 | surf_usm_v(0)%qs, & |
---|
2358 | surf_def_v(1)%qs, & |
---|
2359 | surf_lsm_v(1)%qs, & |
---|
2360 | surf_usm_v(1)%qs, & |
---|
2361 | surf_def_v(2)%qs, & |
---|
2362 | surf_lsm_v(2)%qs, & |
---|
2363 | surf_usm_v(2)%qs, & |
---|
2364 | surf_def_v(3)%qs, & |
---|
2365 | surf_lsm_v(3)%qs, & |
---|
2366 | surf_usm_v(3)%qs, n_out ) |
---|
2367 | |
---|
2368 | CASE ( 'ss' ) |
---|
2369 | CALL surface_data_output_sum_up( surf_def_h(0)%ss, & |
---|
2370 | surf_def_h(1)%ss, & |
---|
2371 | surf_lsm_h%ss, & |
---|
2372 | surf_usm_h%ss, & |
---|
2373 | surf_def_v(0)%ss, & |
---|
2374 | surf_lsm_v(0)%ss, & |
---|
2375 | surf_usm_v(0)%ss, & |
---|
2376 | surf_def_v(1)%ss, & |
---|
2377 | surf_lsm_v(1)%ss, & |
---|
2378 | surf_usm_v(1)%ss, & |
---|
2379 | surf_def_v(2)%ss, & |
---|
2380 | surf_lsm_v(2)%ss, & |
---|
2381 | surf_usm_v(2)%ss, & |
---|
2382 | surf_def_v(3)%ss, & |
---|
2383 | surf_lsm_v(3)%ss, & |
---|
2384 | surf_usm_v(3)%ss, n_out ) |
---|
2385 | |
---|
2386 | CASE ( 'qcs' ) |
---|
2387 | CALL surface_data_output_sum_up( surf_def_h(0)%qcs, & |
---|
2388 | surf_def_h(1)%qcs, & |
---|
2389 | surf_lsm_h%qcs, & |
---|
2390 | surf_usm_h%qcs, & |
---|
2391 | surf_def_v(0)%qcs, & |
---|
2392 | surf_lsm_v(0)%qcs, & |
---|
2393 | surf_usm_v(0)%qcs, & |
---|
2394 | surf_def_v(1)%qcs, & |
---|
2395 | surf_lsm_v(1)%qcs, & |
---|
2396 | surf_usm_v(1)%qcs, & |
---|
2397 | surf_def_v(2)%qcs, & |
---|
2398 | surf_lsm_v(2)%qcs, & |
---|
2399 | surf_usm_v(2)%qcs, & |
---|
2400 | surf_def_v(3)%qcs, & |
---|
2401 | surf_lsm_v(3)%qcs, & |
---|
2402 | surf_usm_v(3)%qcs, n_out ) |
---|
2403 | |
---|
2404 | CASE ( 'ncs' ) |
---|
2405 | CALL surface_data_output_sum_up( surf_def_h(0)%ncs, & |
---|
2406 | surf_def_h(1)%ncs, & |
---|
2407 | surf_lsm_h%ncs, & |
---|
2408 | surf_usm_h%ncs, & |
---|
2409 | surf_def_v(0)%ncs, & |
---|
2410 | surf_lsm_v(0)%ncs, & |
---|
2411 | surf_usm_v(0)%ncs, & |
---|
2412 | surf_def_v(1)%ncs, & |
---|
2413 | surf_lsm_v(1)%ncs, & |
---|
2414 | surf_usm_v(1)%ncs, & |
---|
2415 | surf_def_v(2)%ncs, & |
---|
2416 | surf_lsm_v(2)%ncs, & |
---|
2417 | surf_usm_v(2)%ncs, & |
---|
2418 | surf_def_v(3)%ncs, & |
---|
2419 | surf_lsm_v(3)%ncs, & |
---|
2420 | surf_usm_v(3)%ncs, n_out ) |
---|
2421 | |
---|
2422 | CASE ( 'qrs' ) |
---|
2423 | CALL surface_data_output_sum_up( surf_def_h(0)%qrs, & |
---|
2424 | surf_def_h(1)%qrs, & |
---|
2425 | surf_lsm_h%qrs, & |
---|
2426 | surf_usm_h%qrs, & |
---|
2427 | surf_def_v(0)%qrs, & |
---|
2428 | surf_lsm_v(0)%qrs, & |
---|
2429 | surf_usm_v(0)%qrs, & |
---|
2430 | surf_def_v(1)%qrs, & |
---|
2431 | surf_lsm_v(1)%qrs, & |
---|
2432 | surf_usm_v(1)%qrs, & |
---|
2433 | surf_def_v(2)%qrs, & |
---|
2434 | surf_lsm_v(2)%qrs, & |
---|
2435 | surf_usm_v(2)%qrs, & |
---|
2436 | surf_def_v(3)%qrs, & |
---|
2437 | surf_lsm_v(3)%qrs, & |
---|
2438 | surf_usm_v(3)%qrs, n_out ) |
---|
2439 | |
---|
2440 | CASE ( 'nrs' ) |
---|
2441 | CALL surface_data_output_sum_up( surf_def_h(0)%nrs, & |
---|
2442 | surf_def_h(1)%nrs, & |
---|
2443 | surf_lsm_h%nrs, & |
---|
2444 | surf_usm_h%nrs, & |
---|
2445 | surf_def_v(0)%nrs, & |
---|
2446 | surf_lsm_v(0)%nrs, & |
---|
2447 | surf_usm_v(0)%nrs, & |
---|
2448 | surf_def_v(1)%nrs, & |
---|
2449 | surf_lsm_v(1)%nrs, & |
---|
2450 | surf_usm_v(1)%nrs, & |
---|
2451 | surf_def_v(2)%nrs, & |
---|
2452 | surf_lsm_v(2)%nrs, & |
---|
2453 | surf_usm_v(2)%nrs, & |
---|
2454 | surf_def_v(3)%nrs, & |
---|
2455 | surf_lsm_v(3)%nrs, & |
---|
2456 | surf_usm_v(3)%nrs, n_out ) |
---|
2457 | |
---|
2458 | CASE ( 'ol' ) |
---|
2459 | CALL surface_data_output_sum_up( surf_def_h(0)%ol, & |
---|
2460 | surf_def_h(1)%ol, & |
---|
2461 | surf_lsm_h%ol, & |
---|
2462 | surf_usm_h%ol, & |
---|
2463 | surf_def_v(0)%ol, & |
---|
2464 | surf_lsm_v(0)%ol, & |
---|
2465 | surf_usm_v(0)%ol, & |
---|
2466 | surf_def_v(1)%ol, & |
---|
2467 | surf_lsm_v(1)%ol, & |
---|
2468 | surf_usm_v(1)%ol, & |
---|
2469 | surf_def_v(2)%ol, & |
---|
2470 | surf_lsm_v(2)%ol, & |
---|
2471 | surf_usm_v(2)%ol, & |
---|
2472 | surf_def_v(3)%ol, & |
---|
2473 | surf_lsm_v(3)%ol, & |
---|
2474 | surf_usm_v(3)%ol, n_out ) |
---|
2475 | |
---|
2476 | CASE ( 'z0' ) |
---|
2477 | CALL surface_data_output_sum_up( surf_def_h(0)%z0, & |
---|
2478 | surf_def_h(1)%z0, & |
---|
2479 | surf_lsm_h%z0, & |
---|
2480 | surf_usm_h%z0, & |
---|
2481 | surf_def_v(0)%z0, & |
---|
2482 | surf_lsm_v(0)%z0, & |
---|
2483 | surf_usm_v(0)%z0, & |
---|
2484 | surf_def_v(1)%z0, & |
---|
2485 | surf_lsm_v(1)%z0, & |
---|
2486 | surf_usm_v(1)%z0, & |
---|
2487 | surf_def_v(2)%z0, & |
---|
2488 | surf_lsm_v(2)%z0, & |
---|
2489 | surf_usm_v(2)%z0, & |
---|
2490 | surf_def_v(3)%z0, & |
---|
2491 | surf_lsm_v(3)%z0, & |
---|
2492 | surf_usm_v(3)%z0, n_out ) |
---|
2493 | |
---|
2494 | CASE ( 'z0h' ) |
---|
2495 | CALL surface_data_output_sum_up( surf_def_h(0)%z0h, & |
---|
2496 | surf_def_h(1)%z0h, & |
---|
2497 | surf_lsm_h%z0h, & |
---|
2498 | surf_usm_h%z0h, & |
---|
2499 | surf_def_v(0)%z0h, & |
---|
2500 | surf_lsm_v(0)%z0h, & |
---|
2501 | surf_usm_v(0)%z0h, & |
---|
2502 | surf_def_v(1)%z0h, & |
---|
2503 | surf_lsm_v(1)%z0h, & |
---|
2504 | surf_usm_v(1)%z0h, & |
---|
2505 | surf_def_v(2)%z0h, & |
---|
2506 | surf_lsm_v(2)%z0h, & |
---|
2507 | surf_usm_v(2)%z0h, & |
---|
2508 | surf_def_v(3)%z0h, & |
---|
2509 | surf_lsm_v(3)%z0h, & |
---|
2510 | surf_usm_v(3)%z0h, n_out ) |
---|
2511 | |
---|
2512 | CASE ( 'z0q' ) |
---|
2513 | CALL surface_data_output_sum_up( surf_def_h(0)%z0q, & |
---|
2514 | surf_def_h(1)%z0q, & |
---|
2515 | surf_lsm_h%z0q, & |
---|
2516 | surf_usm_h%z0q, & |
---|
2517 | surf_def_v(0)%z0q, & |
---|
2518 | surf_lsm_v(0)%z0q, & |
---|
2519 | surf_usm_v(0)%z0q, & |
---|
2520 | surf_def_v(1)%z0q, & |
---|
2521 | surf_lsm_v(1)%z0q, & |
---|
2522 | surf_usm_v(1)%z0q, & |
---|
2523 | surf_def_v(2)%z0q, & |
---|
2524 | surf_lsm_v(2)%z0q, & |
---|
2525 | surf_usm_v(2)%z0q, & |
---|
2526 | surf_def_v(3)%z0q, & |
---|
2527 | surf_lsm_v(3)%z0q, & |
---|
2528 | surf_usm_v(3)%z0q, n_out ) |
---|
2529 | |
---|
2530 | CASE ( 'theta1' ) |
---|
2531 | CALL surface_data_output_sum_up( surf_def_h(0)%pt1, & |
---|
2532 | surf_def_h(1)%pt1, & |
---|
2533 | surf_lsm_h%pt1, & |
---|
2534 | surf_usm_h%pt1, & |
---|
2535 | surf_def_v(0)%pt1, & |
---|
2536 | surf_lsm_v(0)%pt1, & |
---|
2537 | surf_usm_v(0)%pt1, & |
---|
2538 | surf_def_v(1)%pt1, & |
---|
2539 | surf_lsm_v(1)%pt1, & |
---|
2540 | surf_usm_v(1)%pt1, & |
---|
2541 | surf_def_v(2)%pt1, & |
---|
2542 | surf_lsm_v(2)%pt1, & |
---|
2543 | surf_usm_v(2)%pt1, & |
---|
2544 | surf_def_v(3)%pt1, & |
---|
2545 | surf_lsm_v(3)%pt1, & |
---|
2546 | surf_usm_v(3)%pt1, n_out ) |
---|
2547 | |
---|
2548 | CASE ( 'qv1' ) |
---|
2549 | CALL surface_data_output_sum_up( surf_def_h(0)%qv1, & |
---|
2550 | surf_def_h(1)%qv1, & |
---|
2551 | surf_lsm_h%qv1, & |
---|
2552 | surf_usm_h%qv1, & |
---|
2553 | surf_def_v(0)%qv1, & |
---|
2554 | surf_lsm_v(0)%qv1, & |
---|
2555 | surf_usm_v(0)%qv1, & |
---|
2556 | surf_def_v(1)%qv1, & |
---|
2557 | surf_lsm_v(1)%qv1, & |
---|
2558 | surf_usm_v(1)%qv1, & |
---|
2559 | surf_def_v(2)%qv1, & |
---|
2560 | surf_lsm_v(2)%qv1, & |
---|
2561 | surf_usm_v(2)%qv1, & |
---|
2562 | surf_def_v(3)%qv1, & |
---|
2563 | surf_lsm_v(3)%qv1, & |
---|
2564 | surf_usm_v(3)%qv1, n_out ) |
---|
2565 | |
---|
2566 | CASE ( 'thetav1' ) |
---|
2567 | CALL surface_data_output_sum_up( surf_def_h(0)%vpt1, & |
---|
2568 | surf_def_h(1)%vpt1, & |
---|
2569 | surf_lsm_h%vpt1, & |
---|
2570 | surf_usm_h%vpt1, & |
---|
2571 | surf_def_v(0)%vpt1, & |
---|
2572 | surf_lsm_v(0)%vpt1, & |
---|
2573 | surf_usm_v(0)%vpt1, & |
---|
2574 | surf_def_v(1)%vpt1, & |
---|
2575 | surf_lsm_v(1)%vpt1, & |
---|
2576 | surf_usm_v(1)%vpt1, & |
---|
2577 | surf_def_v(2)%vpt1, & |
---|
2578 | surf_lsm_v(2)%vpt1, & |
---|
2579 | surf_usm_v(2)%vpt1, & |
---|
2580 | surf_def_v(3)%vpt1, & |
---|
2581 | surf_lsm_v(3)%vpt1, & |
---|
2582 | surf_usm_v(3)%vpt1, n_out ) |
---|
2583 | |
---|
2584 | CASE ( 'usws' ) |
---|
2585 | CALL surface_data_output_sum_up( surf_def_h(0)%usws, & |
---|
2586 | surf_def_h(1)%usws, & |
---|
2587 | surf_lsm_h%usws, & |
---|
2588 | surf_usm_h%usws, & |
---|
2589 | surf_def_v(0)%usws, & |
---|
2590 | surf_lsm_v(0)%usws, & |
---|
2591 | surf_usm_v(0)%usws, & |
---|
2592 | surf_def_v(1)%usws, & |
---|
2593 | surf_lsm_v(1)%usws, & |
---|
2594 | surf_usm_v(1)%usws, & |
---|
2595 | surf_def_v(2)%usws, & |
---|
2596 | surf_lsm_v(2)%usws, & |
---|
2597 | surf_usm_v(2)%usws, & |
---|
2598 | surf_def_v(3)%usws, & |
---|
2599 | surf_lsm_v(3)%usws, & |
---|
2600 | surf_usm_v(3)%usws, n_out ) |
---|
2601 | |
---|
2602 | CASE ( 'vsws' ) |
---|
2603 | CALL surface_data_output_sum_up( surf_def_h(0)%vsws, & |
---|
2604 | surf_def_h(1)%vsws, & |
---|
2605 | surf_lsm_h%vsws, & |
---|
2606 | surf_usm_h%vsws, & |
---|
2607 | surf_def_v(0)%vsws, & |
---|
2608 | surf_lsm_v(0)%vsws, & |
---|
2609 | surf_usm_v(0)%vsws, & |
---|
2610 | surf_def_v(1)%vsws, & |
---|
2611 | surf_lsm_v(1)%vsws, & |
---|
2612 | surf_usm_v(1)%vsws, & |
---|
2613 | surf_def_v(2)%vsws, & |
---|
2614 | surf_lsm_v(2)%vsws, & |
---|
2615 | surf_usm_v(2)%vsws, & |
---|
2616 | surf_def_v(3)%vsws, & |
---|
2617 | surf_lsm_v(3)%vsws, & |
---|
2618 | surf_usm_v(3)%vsws, n_out ) |
---|
2619 | |
---|
2620 | CASE ( 'shf' ) |
---|
2621 | CALL surface_data_output_sum_up( surf_def_h(0)%shf, & |
---|
2622 | surf_def_h(1)%shf, & |
---|
2623 | surf_lsm_h%shf, & |
---|
2624 | surf_usm_h%shf, & |
---|
2625 | surf_def_v(0)%shf, & |
---|
2626 | surf_lsm_v(0)%shf, & |
---|
2627 | surf_usm_v(0)%shf, & |
---|
2628 | surf_def_v(1)%shf, & |
---|
2629 | surf_lsm_v(1)%shf, & |
---|
2630 | surf_usm_v(1)%shf, & |
---|
2631 | surf_def_v(2)%shf, & |
---|
2632 | surf_lsm_v(2)%shf, & |
---|
2633 | surf_usm_v(2)%shf, & |
---|
2634 | surf_def_v(3)%shf, & |
---|
2635 | surf_lsm_v(3)%shf, & |
---|
2636 | surf_usm_v(3)%shf, n_out ) |
---|
2637 | |
---|
2638 | CASE ( 'qsws' ) |
---|
2639 | CALL surface_data_output_sum_up( surf_def_h(0)%qsws, & |
---|
2640 | surf_def_h(1)%qsws, & |
---|
2641 | surf_lsm_h%qsws, & |
---|
2642 | surf_usm_h%qsws, & |
---|
2643 | surf_def_v(0)%qsws, & |
---|
2644 | surf_lsm_v(0)%qsws, & |
---|
2645 | surf_usm_v(0)%qsws, & |
---|
2646 | surf_def_v(1)%qsws, & |
---|
2647 | surf_lsm_v(1)%qsws, & |
---|
2648 | surf_usm_v(1)%qsws, & |
---|
2649 | surf_def_v(2)%qsws, & |
---|
2650 | surf_lsm_v(2)%qsws, & |
---|
2651 | surf_usm_v(2)%qsws, & |
---|
2652 | surf_def_v(3)%qsws, & |
---|
2653 | surf_lsm_v(3)%qsws, & |
---|
2654 | surf_usm_v(3)%qsws, n_out ) |
---|
2655 | |
---|
2656 | CASE ( 'ssws' ) |
---|
2657 | CALL surface_data_output_sum_up( surf_def_h(0)%ssws, & |
---|
2658 | surf_def_h(1)%ssws, & |
---|
2659 | surf_lsm_h%ssws, & |
---|
2660 | surf_usm_h%ssws, & |
---|
2661 | surf_def_v(0)%ssws, & |
---|
2662 | surf_lsm_v(0)%ssws, & |
---|
2663 | surf_usm_v(0)%ssws, & |
---|
2664 | surf_def_v(1)%ssws, & |
---|
2665 | surf_lsm_v(1)%ssws, & |
---|
2666 | surf_usm_v(1)%ssws, & |
---|
2667 | surf_def_v(2)%ssws, & |
---|
2668 | surf_lsm_v(2)%ssws, & |
---|
2669 | surf_usm_v(2)%ssws, & |
---|
2670 | surf_def_v(3)%ssws, & |
---|
2671 | surf_lsm_v(3)%ssws, & |
---|
2672 | surf_usm_v(3)%ssws, n_out ) |
---|
2673 | |
---|
2674 | CASE ( 'qcsws' ) |
---|
2675 | CALL surface_data_output_sum_up( surf_def_h(0)%qcsws, & |
---|
2676 | surf_def_h(1)%qcsws, & |
---|
2677 | surf_lsm_h%qcsws, & |
---|
2678 | surf_usm_h%qcsws, & |
---|
2679 | surf_def_v(0)%qcsws, & |
---|
2680 | surf_lsm_v(0)%qcsws, & |
---|
2681 | surf_usm_v(0)%qcsws, & |
---|
2682 | surf_def_v(1)%qcsws, & |
---|
2683 | surf_lsm_v(1)%qcsws, & |
---|
2684 | surf_usm_v(1)%qcsws, & |
---|
2685 | surf_def_v(2)%qcsws, & |
---|
2686 | surf_lsm_v(2)%qcsws, & |
---|
2687 | surf_usm_v(2)%qcsws, & |
---|
2688 | surf_def_v(3)%qcsws, & |
---|
2689 | surf_lsm_v(3)%qcsws, & |
---|
2690 | surf_usm_v(3)%qcsws, n_out ) |
---|
2691 | |
---|
2692 | CASE ( 'ncsws' ) |
---|
2693 | CALL surface_data_output_sum_up( surf_def_h(0)%ncsws, & |
---|
2694 | surf_def_h(1)%ncsws, & |
---|
2695 | surf_lsm_h%ncsws, & |
---|
2696 | surf_usm_h%ncsws, & |
---|
2697 | surf_def_v(0)%ncsws, & |
---|
2698 | surf_lsm_v(0)%ncsws, & |
---|
2699 | surf_usm_v(0)%ncsws, & |
---|
2700 | surf_def_v(1)%ncsws, & |
---|
2701 | surf_lsm_v(1)%ncsws, & |
---|
2702 | surf_usm_v(1)%ncsws, & |
---|
2703 | surf_def_v(2)%ncsws, & |
---|
2704 | surf_lsm_v(2)%ncsws, & |
---|
2705 | surf_usm_v(2)%ncsws, & |
---|
2706 | surf_def_v(3)%ncsws, & |
---|
2707 | surf_lsm_v(3)%ncsws, & |
---|
2708 | surf_usm_v(3)%ncsws, n_out ) |
---|
2709 | |
---|
2710 | CASE ( 'qrsws' ) |
---|
2711 | CALL surface_data_output_sum_up( surf_def_h(0)%qrsws, & |
---|
2712 | surf_def_h(1)%qrsws, & |
---|
2713 | surf_lsm_h%qrsws, & |
---|
2714 | surf_usm_h%qrsws, & |
---|
2715 | surf_def_v(0)%qrsws, & |
---|
2716 | surf_lsm_v(0)%qrsws, & |
---|
2717 | surf_usm_v(0)%qrsws, & |
---|
2718 | surf_def_v(1)%qrsws, & |
---|
2719 | surf_lsm_v(1)%qrsws, & |
---|
2720 | surf_usm_v(1)%qrsws, & |
---|
2721 | surf_def_v(2)%qrsws, & |
---|
2722 | surf_lsm_v(2)%qrsws, & |
---|
2723 | surf_usm_v(2)%qrsws, & |
---|
2724 | surf_def_v(3)%qrsws, & |
---|
2725 | surf_lsm_v(3)%qrsws, & |
---|
2726 | surf_usm_v(3)%qrsws, n_out ) |
---|
2727 | |
---|
2728 | CASE ( 'nrsws' ) |
---|
2729 | CALL surface_data_output_sum_up( surf_def_h(0)%nrsws, & |
---|
2730 | surf_def_h(1)%nrsws, & |
---|
2731 | surf_lsm_h%nrsws, & |
---|
2732 | surf_usm_h%nrsws, & |
---|
2733 | surf_def_v(0)%nrsws, & |
---|
2734 | surf_lsm_v(0)%nrsws, & |
---|
2735 | surf_usm_v(0)%nrsws, & |
---|
2736 | surf_def_v(1)%nrsws, & |
---|
2737 | surf_lsm_v(1)%nrsws, & |
---|
2738 | surf_usm_v(1)%nrsws, & |
---|
2739 | surf_def_v(2)%nrsws, & |
---|
2740 | surf_lsm_v(2)%nrsws, & |
---|
2741 | surf_usm_v(2)%nrsws, & |
---|
2742 | surf_def_v(3)%nrsws, & |
---|
2743 | surf_lsm_v(3)%nrsws, & |
---|
2744 | surf_usm_v(3)%nrsws, n_out ) |
---|
2745 | |
---|
2746 | CASE ( 'sasws' ) |
---|
2747 | CALL surface_data_output_sum_up( surf_def_h(0)%sasws, & |
---|
2748 | surf_def_h(1)%sasws, & |
---|
2749 | surf_lsm_h%sasws, & |
---|
2750 | surf_usm_h%sasws, & |
---|
2751 | surf_def_v(0)%sasws, & |
---|
2752 | surf_lsm_v(0)%sasws, & |
---|
2753 | surf_usm_v(0)%sasws, & |
---|
2754 | surf_def_v(1)%sasws, & |
---|
2755 | surf_lsm_v(1)%sasws, & |
---|
2756 | surf_usm_v(1)%sasws, & |
---|
2757 | surf_def_v(2)%sasws, & |
---|
2758 | surf_lsm_v(2)%sasws, & |
---|
2759 | surf_usm_v(2)%sasws, & |
---|
2760 | surf_def_v(3)%sasws, & |
---|
2761 | surf_lsm_v(3)%sasws, & |
---|
2762 | surf_usm_v(3)%sasws, n_out ) |
---|
2763 | |
---|
2764 | CASE ( 'q_surface' ) |
---|
2765 | CALL surface_data_output_sum_up( surf_def_h(0)%q_surface, & |
---|
2766 | surf_def_h(1)%q_surface, & |
---|
2767 | surf_lsm_h%q_surface, & |
---|
2768 | surf_usm_h%q_surface, & |
---|
2769 | surf_def_v(0)%q_surface, & |
---|
2770 | surf_lsm_v(0)%q_surface, & |
---|
2771 | surf_usm_v(0)%q_surface, & |
---|
2772 | surf_def_v(1)%q_surface, & |
---|
2773 | surf_lsm_v(1)%q_surface, & |
---|
2774 | surf_usm_v(1)%q_surface, & |
---|
2775 | surf_def_v(2)%q_surface, & |
---|
2776 | surf_lsm_v(2)%q_surface, & |
---|
2777 | surf_usm_v(2)%q_surface, & |
---|
2778 | surf_def_v(3)%q_surface, & |
---|
2779 | surf_lsm_v(3)%q_surface, & |
---|
2780 | surf_usm_v(3)%q_surface, n_out ) |
---|
2781 | |
---|
2782 | |
---|
2783 | CASE ( 'theta_surface' ) |
---|
2784 | CALL surface_data_output_sum_up( surf_def_h(0)%pt_surface, & |
---|
2785 | surf_def_h(1)%pt_surface, & |
---|
2786 | surf_lsm_h%pt_surface, & |
---|
2787 | surf_usm_h%pt_surface, & |
---|
2788 | surf_def_v(0)%pt_surface, & |
---|
2789 | surf_lsm_v(0)%pt_surface, & |
---|
2790 | surf_usm_v(0)%pt_surface, & |
---|
2791 | surf_def_v(1)%pt_surface, & |
---|
2792 | surf_lsm_v(1)%pt_surface, & |
---|
2793 | surf_usm_v(1)%pt_surface, & |
---|
2794 | surf_def_v(2)%pt_surface, & |
---|
2795 | surf_lsm_v(2)%pt_surface, & |
---|
2796 | surf_usm_v(2)%pt_surface, & |
---|
2797 | surf_def_v(3)%pt_surface, & |
---|
2798 | surf_lsm_v(3)%pt_surface, & |
---|
2799 | surf_usm_v(3)%pt_surface, n_out ) |
---|
2800 | |
---|
2801 | CASE ( 'thetav_surface' ) |
---|
2802 | CALL surface_data_output_sum_up( surf_def_h(0)%vpt_surface, & |
---|
2803 | surf_def_h(1)%vpt_surface, & |
---|
2804 | surf_lsm_h%vpt_surface, & |
---|
2805 | surf_usm_h%vpt_surface, & |
---|
2806 | surf_def_v(0)%vpt_surface, & |
---|
2807 | surf_lsm_v(0)%vpt_surface, & |
---|
2808 | surf_usm_v(0)%vpt_surface, & |
---|
2809 | surf_def_v(1)%vpt_surface, & |
---|
2810 | surf_lsm_v(1)%vpt_surface, & |
---|
2811 | surf_usm_v(1)%vpt_surface, & |
---|
2812 | surf_def_v(2)%vpt_surface, & |
---|
2813 | surf_lsm_v(2)%vpt_surface, & |
---|
2814 | surf_usm_v(2)%vpt_surface, & |
---|
2815 | surf_def_v(3)%vpt_surface, & |
---|
2816 | surf_lsm_v(3)%vpt_surface, & |
---|
2817 | surf_usm_v(3)%vpt_surface, n_out ) |
---|
2818 | |
---|
2819 | CASE ( 'rad_net' ) |
---|
2820 | CALL surface_data_output_sum_up( surf_def_h(0)%rad_net, & |
---|
2821 | surf_def_h(1)%rad_net, & |
---|
2822 | surf_lsm_h%rad_net, & |
---|
2823 | surf_usm_h%rad_net, & |
---|
2824 | surf_def_v(0)%rad_net, & |
---|
2825 | surf_lsm_v(0)%rad_net, & |
---|
2826 | surf_usm_v(0)%rad_net, & |
---|
2827 | surf_def_v(1)%rad_net, & |
---|
2828 | surf_lsm_v(1)%rad_net, & |
---|
2829 | surf_usm_v(1)%rad_net, & |
---|
2830 | surf_def_v(2)%rad_net, & |
---|
2831 | surf_lsm_v(2)%rad_net, & |
---|
2832 | surf_usm_v(2)%rad_net, & |
---|
2833 | surf_def_v(3)%rad_net, & |
---|
2834 | surf_lsm_v(3)%rad_net, & |
---|
2835 | surf_usm_v(3)%rad_net, n_out ) |
---|
2836 | |
---|
2837 | CASE ( 'rad_lw_in' ) |
---|
2838 | CALL surface_data_output_sum_up( surf_def_h(0)%rad_lw_in, & |
---|
2839 | surf_def_h(1)%rad_lw_in, & |
---|
2840 | surf_lsm_h%rad_lw_in, & |
---|
2841 | surf_usm_h%rad_lw_in, & |
---|
2842 | surf_def_v(0)%rad_lw_in, & |
---|
2843 | surf_lsm_v(0)%rad_lw_in, & |
---|
2844 | surf_usm_v(0)%rad_lw_in, & |
---|
2845 | surf_def_v(1)%rad_lw_in, & |
---|
2846 | surf_lsm_v(1)%rad_lw_in, & |
---|
2847 | surf_usm_v(1)%rad_lw_in, & |
---|
2848 | surf_def_v(2)%rad_lw_in, & |
---|
2849 | surf_lsm_v(2)%rad_lw_in, & |
---|
2850 | surf_usm_v(2)%rad_lw_in, & |
---|
2851 | surf_def_v(3)%rad_lw_in, & |
---|
2852 | surf_lsm_v(3)%rad_lw_in, & |
---|
2853 | surf_usm_v(3)%rad_lw_in, n_out ) |
---|
2854 | |
---|
2855 | CASE ( 'rad_lw_out' ) |
---|
2856 | CALL surface_data_output_sum_up( surf_def_h(0)%rad_lw_out, & |
---|
2857 | surf_def_h(1)%rad_lw_out, & |
---|
2858 | surf_lsm_h%rad_lw_out, & |
---|
2859 | surf_usm_h%rad_lw_out, & |
---|
2860 | surf_def_v(0)%rad_lw_out, & |
---|
2861 | surf_lsm_v(0)%rad_lw_out, & |
---|
2862 | surf_usm_v(0)%rad_lw_out, & |
---|
2863 | surf_def_v(1)%rad_lw_out, & |
---|
2864 | surf_lsm_v(1)%rad_lw_out, & |
---|
2865 | surf_usm_v(1)%rad_lw_out, & |
---|
2866 | surf_def_v(2)%rad_lw_out, & |
---|
2867 | surf_lsm_v(2)%rad_lw_out, & |
---|
2868 | surf_usm_v(2)%rad_lw_out, & |
---|
2869 | surf_def_v(3)%rad_lw_out, & |
---|
2870 | surf_lsm_v(3)%rad_lw_out, & |
---|
2871 | surf_usm_v(3)%rad_lw_out, n_out ) |
---|
2872 | |
---|
2873 | CASE ( 'rad_sw_in' ) |
---|
2874 | CALL surface_data_output_sum_up( surf_def_h(0)%rad_sw_in, & |
---|
2875 | surf_def_h(1)%rad_sw_in, & |
---|
2876 | surf_lsm_h%rad_sw_in, & |
---|
2877 | surf_usm_h%rad_sw_in, & |
---|
2878 | surf_def_v(0)%rad_sw_in, & |
---|
2879 | surf_lsm_v(0)%rad_sw_in, & |
---|
2880 | surf_usm_v(0)%rad_sw_in, & |
---|
2881 | surf_def_v(1)%rad_sw_in, & |
---|
2882 | surf_lsm_v(1)%rad_sw_in, & |
---|
2883 | surf_usm_v(1)%rad_sw_in, & |
---|
2884 | surf_def_v(2)%rad_sw_in, & |
---|
2885 | surf_lsm_v(2)%rad_sw_in, & |
---|
2886 | surf_usm_v(2)%rad_sw_in, & |
---|
2887 | surf_def_v(3)%rad_sw_in, & |
---|
2888 | surf_lsm_v(3)%rad_sw_in, & |
---|
2889 | surf_usm_v(3)%rad_sw_in, n_out ) |
---|
2890 | |
---|
2891 | CASE ( 'rad_sw_out' ) |
---|
2892 | CALL surface_data_output_sum_up( surf_def_h(0)%rad_sw_out, & |
---|
2893 | surf_def_h(1)%rad_sw_out, & |
---|
2894 | surf_lsm_h%rad_sw_out, & |
---|
2895 | surf_usm_h%rad_sw_out, & |
---|
2896 | surf_def_v(0)%rad_sw_out, & |
---|
2897 | surf_lsm_v(0)%rad_sw_out, & |
---|
2898 | surf_usm_v(0)%rad_sw_out, & |
---|
2899 | surf_def_v(1)%rad_sw_out, & |
---|
2900 | surf_lsm_v(1)%rad_sw_out, & |
---|
2901 | surf_usm_v(1)%rad_sw_out, & |
---|
2902 | surf_def_v(2)%rad_sw_out, & |
---|
2903 | surf_lsm_v(2)%rad_sw_out, & |
---|
2904 | surf_usm_v(2)%rad_sw_out, & |
---|
2905 | surf_def_v(3)%rad_sw_out, & |
---|
2906 | surf_lsm_v(3)%rad_sw_out, & |
---|
2907 | surf_usm_v(3)%rad_sw_out, n_out ) |
---|
2908 | |
---|
2909 | CASE ( 'ghf' ) |
---|
2910 | CALL surface_data_output_sum_up( surf_def_h(0)%ghf, & |
---|
2911 | surf_def_h(1)%ghf, & |
---|
2912 | surf_lsm_h%ghf, & |
---|
2913 | surf_usm_h%ghf, & |
---|
2914 | surf_def_v(0)%ghf, & |
---|
2915 | surf_lsm_v(0)%ghf, & |
---|
2916 | surf_usm_v(0)%ghf, & |
---|
2917 | surf_def_v(1)%ghf, & |
---|
2918 | surf_lsm_v(1)%ghf, & |
---|
2919 | surf_usm_v(1)%ghf, & |
---|
2920 | surf_def_v(2)%ghf, & |
---|
2921 | surf_lsm_v(2)%ghf, & |
---|
2922 | surf_usm_v(2)%ghf, & |
---|
2923 | surf_def_v(3)%ghf, & |
---|
2924 | surf_lsm_v(3)%ghf, & |
---|
2925 | surf_usm_v(3)%ghf, n_out ) |
---|
2926 | |
---|
2927 | CASE ( 'r_a' ) |
---|
2928 | CALL surface_data_output_sum_up( surf_def_h(0)%r_a, & |
---|
2929 | surf_def_h(1)%r_a, & |
---|
2930 | surf_lsm_h%r_a, & |
---|
2931 | surf_usm_h%r_a, & |
---|
2932 | surf_def_v(0)%r_a, & |
---|
2933 | surf_lsm_v(0)%r_a, & |
---|
2934 | surf_usm_v(0)%r_a, & |
---|
2935 | surf_def_v(1)%r_a, & |
---|
2936 | surf_lsm_v(1)%r_a, & |
---|
2937 | surf_usm_v(1)%r_a, & |
---|
2938 | surf_def_v(2)%r_a, & |
---|
2939 | surf_lsm_v(2)%r_a, & |
---|
2940 | surf_usm_v(2)%r_a, & |
---|
2941 | surf_def_v(3)%r_a, & |
---|
2942 | surf_lsm_v(3)%r_a, & |
---|
2943 | surf_usm_v(3)%r_a, n_out ) |
---|
2944 | |
---|
2945 | CASE ( 'r_soil' ) |
---|
2946 | CALL surface_data_output_sum_up( surf_def_h(0)%r_soil, & |
---|
2947 | surf_def_h(1)%r_soil, & |
---|
2948 | surf_lsm_h%r_soil, & |
---|
2949 | surf_usm_h%r_soil, & |
---|
2950 | surf_def_v(0)%r_soil, & |
---|
2951 | surf_lsm_v(0)%r_soil, & |
---|
2952 | surf_usm_v(0)%r_soil, & |
---|
2953 | surf_def_v(1)%r_soil, & |
---|
2954 | surf_lsm_v(1)%r_soil, & |
---|
2955 | surf_usm_v(1)%r_soil, & |
---|
2956 | surf_def_v(2)%r_soil, & |
---|
2957 | surf_lsm_v(2)%r_soil, & |
---|
2958 | surf_usm_v(2)%r_soil, & |
---|
2959 | surf_def_v(3)%r_soil, & |
---|
2960 | surf_lsm_v(3)%r_soil, & |
---|
2961 | surf_usm_v(3)%r_soil, n_out ) |
---|
2962 | |
---|
2963 | CASE ( 'r_canopy' ) |
---|
2964 | CALL surface_data_output_sum_up( surf_def_h(0)%r_canopy, & |
---|
2965 | surf_def_h(1)%r_canopy, & |
---|
2966 | surf_lsm_h%r_canopy, & |
---|
2967 | surf_usm_h%r_canopy, & |
---|
2968 | surf_def_v(0)%r_canopy, & |
---|
2969 | surf_lsm_v(0)%r_canopy, & |
---|
2970 | surf_usm_v(0)%r_canopy, & |
---|
2971 | surf_def_v(1)%r_canopy, & |
---|
2972 | surf_lsm_v(1)%r_canopy, & |
---|
2973 | surf_usm_v(1)%r_canopy, & |
---|
2974 | surf_def_v(2)%r_canopy, & |
---|
2975 | surf_lsm_v(2)%r_canopy, & |
---|
2976 | surf_usm_v(2)%r_canopy, & |
---|
2977 | surf_def_v(3)%r_canopy, & |
---|
2978 | surf_lsm_v(3)%r_canopy, & |
---|
2979 | surf_usm_v(3)%r_canopy, n_out ) |
---|
2980 | |
---|
2981 | CASE ( 'r_s' ) |
---|
2982 | CALL surface_data_output_sum_up( surf_def_h(0)%r_s, & |
---|
2983 | surf_def_h(1)%r_s, & |
---|
2984 | surf_lsm_h%r_s, & |
---|
2985 | surf_usm_h%r_s, & |
---|
2986 | surf_def_v(0)%r_s, & |
---|
2987 | surf_lsm_v(0)%r_s, & |
---|
2988 | surf_usm_v(0)%r_s, & |
---|
2989 | surf_def_v(1)%r_s, & |
---|
2990 | surf_lsm_v(1)%r_s, & |
---|
2991 | surf_usm_v(1)%r_s, & |
---|
2992 | surf_def_v(2)%r_s, & |
---|
2993 | surf_lsm_v(2)%r_s, & |
---|
2994 | surf_usm_v(2)%r_s, & |
---|
2995 | surf_def_v(3)%r_s, & |
---|
2996 | surf_lsm_v(3)%r_s, & |
---|
2997 | surf_usm_v(3)%r_s, n_out ) |
---|
2998 | |
---|
2999 | |
---|
3000 | CASE ( 'rad_sw_dir' ) |
---|
3001 | CALL surface_data_output_sum_up( surf_def_h(0)%rad_sw_dir, & |
---|
3002 | surf_def_h(1)%rad_sw_dir, & |
---|
3003 | surf_lsm_h%rad_sw_dir, & |
---|
3004 | surf_usm_h%rad_sw_dir, & |
---|
3005 | surf_def_v(0)%rad_sw_dir, & |
---|
3006 | surf_lsm_v(0)%rad_sw_dir, & |
---|
3007 | surf_usm_v(0)%rad_sw_dir, & |
---|
3008 | surf_def_v(1)%rad_sw_dir, & |
---|
3009 | surf_lsm_v(1)%rad_sw_dir, & |
---|
3010 | surf_usm_v(1)%rad_sw_dir, & |
---|
3011 | surf_def_v(2)%rad_sw_dir, & |
---|
3012 | surf_lsm_v(2)%rad_sw_dir, & |
---|
3013 | surf_usm_v(2)%rad_sw_dir, & |
---|
3014 | surf_def_v(3)%rad_sw_dir, & |
---|
3015 | surf_lsm_v(3)%rad_sw_dir, & |
---|
3016 | surf_usm_v(3)%rad_sw_dir, n_out ) |
---|
3017 | CASE ( 'rad_sw_dif' ) |
---|
3018 | CALL surface_data_output_sum_up( surf_def_h(0)%rad_sw_dif, & |
---|
3019 | surf_def_h(1)%rad_sw_dif, & |
---|
3020 | surf_lsm_h%rad_sw_dif, & |
---|
3021 | surf_usm_h%rad_sw_dif, & |
---|
3022 | surf_def_v(0)%rad_sw_dif, & |
---|
3023 | surf_lsm_v(0)%rad_sw_dif, & |
---|
3024 | surf_usm_v(0)%rad_sw_dif, & |
---|
3025 | surf_def_v(1)%rad_sw_dif, & |
---|
3026 | surf_lsm_v(1)%rad_sw_dif, & |
---|
3027 | surf_usm_v(1)%rad_sw_dif, & |
---|
3028 | surf_def_v(2)%rad_sw_dif, & |
---|
3029 | surf_lsm_v(2)%rad_sw_dif, & |
---|
3030 | surf_usm_v(2)%rad_sw_dif, & |
---|
3031 | surf_def_v(3)%rad_sw_dif, & |
---|
3032 | surf_lsm_v(3)%rad_sw_dif, & |
---|
3033 | surf_usm_v(3)%rad_sw_dif, n_out ) |
---|
3034 | |
---|
3035 | CASE ( 'rad_sw_ref' ) |
---|
3036 | CALL surface_data_output_sum_up( surf_def_h(0)%rad_sw_ref, & |
---|
3037 | surf_def_h(1)%rad_sw_ref, & |
---|
3038 | surf_lsm_h%rad_sw_ref, & |
---|
3039 | surf_usm_h%rad_sw_ref, & |
---|
3040 | surf_def_v(0)%rad_sw_ref, & |
---|
3041 | surf_lsm_v(0)%rad_sw_ref, & |
---|
3042 | surf_usm_v(0)%rad_sw_ref, & |
---|
3043 | surf_def_v(1)%rad_sw_ref, & |
---|
3044 | surf_lsm_v(1)%rad_sw_ref, & |
---|
3045 | surf_usm_v(1)%rad_sw_ref, & |
---|
3046 | surf_def_v(2)%rad_sw_ref, & |
---|
3047 | surf_lsm_v(2)%rad_sw_ref, & |
---|
3048 | surf_usm_v(2)%rad_sw_ref, & |
---|
3049 | surf_def_v(3)%rad_sw_ref, & |
---|
3050 | surf_lsm_v(3)%rad_sw_ref, & |
---|
3051 | surf_usm_v(3)%rad_sw_ref, n_out ) |
---|
3052 | |
---|
3053 | CASE ( 'rad_sw_res' ) |
---|
3054 | CALL surface_data_output_sum_up( surf_def_h(0)%rad_sw_res, & |
---|
3055 | surf_def_h(1)%rad_sw_res, & |
---|
3056 | surf_lsm_h%rad_sw_res, & |
---|
3057 | surf_usm_h%rad_sw_res, & |
---|
3058 | surf_def_v(0)%rad_sw_res, & |
---|
3059 | surf_lsm_v(0)%rad_sw_res, & |
---|
3060 | surf_usm_v(0)%rad_sw_res, & |
---|
3061 | surf_def_v(1)%rad_sw_res, & |
---|
3062 | surf_lsm_v(1)%rad_sw_res, & |
---|
3063 | surf_usm_v(1)%rad_sw_res, & |
---|
3064 | surf_def_v(2)%rad_sw_res, & |
---|
3065 | surf_lsm_v(2)%rad_sw_res, & |
---|
3066 | surf_usm_v(2)%rad_sw_res, & |
---|
3067 | surf_def_v(3)%rad_sw_res, & |
---|
3068 | surf_lsm_v(3)%rad_sw_res, & |
---|
3069 | surf_usm_v(3)%rad_sw_res, n_out ) |
---|
3070 | |
---|
3071 | CASE ( 'rad_lw_dif' ) |
---|
3072 | CALL surface_data_output_sum_up( surf_def_h(0)%rad_lw_dif, & |
---|
3073 | surf_def_h(1)%rad_lw_dif, & |
---|
3074 | surf_lsm_h%rad_lw_dif, & |
---|
3075 | surf_usm_h%rad_lw_dif, & |
---|
3076 | surf_def_v(0)%rad_lw_dif, & |
---|
3077 | surf_lsm_v(0)%rad_lw_dif, & |
---|
3078 | surf_usm_v(0)%rad_lw_dif, & |
---|
3079 | surf_def_v(1)%rad_lw_dif, & |
---|
3080 | surf_lsm_v(1)%rad_lw_dif, & |
---|
3081 | surf_usm_v(1)%rad_lw_dif, & |
---|
3082 | surf_def_v(2)%rad_lw_dif, & |
---|
3083 | surf_lsm_v(2)%rad_lw_dif, & |
---|
3084 | surf_usm_v(2)%rad_lw_dif, & |
---|
3085 | surf_def_v(3)%rad_lw_dif, & |
---|
3086 | surf_lsm_v(3)%rad_lw_dif, & |
---|
3087 | surf_usm_v(3)%rad_lw_dif, n_out ) |
---|
3088 | |
---|
3089 | CASE ( 'rad_lw_ref' ) |
---|
3090 | CALL surface_data_output_sum_up( surf_def_h(0)%rad_lw_ref, & |
---|
3091 | surf_def_h(1)%rad_lw_ref, & |
---|
3092 | surf_lsm_h%rad_lw_ref, & |
---|
3093 | surf_usm_h%rad_lw_ref, & |
---|
3094 | surf_def_v(0)%rad_lw_ref, & |
---|
3095 | surf_lsm_v(0)%rad_lw_ref, & |
---|
3096 | surf_usm_v(0)%rad_lw_ref, & |
---|
3097 | surf_def_v(1)%rad_lw_ref, & |
---|
3098 | surf_lsm_v(1)%rad_lw_ref, & |
---|
3099 | surf_usm_v(1)%rad_lw_ref, & |
---|
3100 | surf_def_v(2)%rad_lw_ref, & |
---|
3101 | surf_lsm_v(2)%rad_lw_ref, & |
---|
3102 | surf_usm_v(2)%rad_lw_ref, & |
---|
3103 | surf_def_v(3)%rad_lw_ref, & |
---|
3104 | surf_lsm_v(3)%rad_lw_ref, & |
---|
3105 | surf_usm_v(3)%rad_lw_ref, n_out ) |
---|
3106 | |
---|
3107 | CASE ( 'rad_lw_res' ) |
---|
3108 | CALL surface_data_output_sum_up( surf_def_h(0)%rad_lw_res, & |
---|
3109 | surf_def_h(1)%rad_lw_res, & |
---|
3110 | surf_lsm_h%rad_lw_res, & |
---|
3111 | surf_usm_h%rad_lw_res, & |
---|
3112 | surf_def_v(0)%rad_lw_res, & |
---|
3113 | surf_lsm_v(0)%rad_lw_res, & |
---|
3114 | surf_usm_v(0)%rad_lw_res, & |
---|
3115 | surf_def_v(1)%rad_lw_res, & |
---|
3116 | surf_lsm_v(1)%rad_lw_res, & |
---|
3117 | surf_usm_v(1)%rad_lw_res, & |
---|
3118 | surf_def_v(2)%rad_lw_res, & |
---|
3119 | surf_lsm_v(2)%rad_lw_res, & |
---|
3120 | surf_usm_v(2)%rad_lw_res, & |
---|
3121 | surf_def_v(3)%rad_lw_res, & |
---|
3122 | surf_lsm_v(3)%rad_lw_res, & |
---|
3123 | surf_usm_v(3)%rad_lw_res, n_out ) |
---|
3124 | |
---|
3125 | CASE ( 'uvw1' ) |
---|
3126 | CALL surface_data_output_sum_up( surf_def_h(0)%uvw_abs, & |
---|
3127 | surf_def_h(1)%uvw_abs, & |
---|
3128 | surf_lsm_h%uvw_abs, & |
---|
3129 | surf_usm_h%uvw_abs, & |
---|
3130 | surf_def_v(0)%uvw_abs, & |
---|
3131 | surf_lsm_v(0)%uvw_abs, & |
---|
3132 | surf_usm_v(0)%uvw_abs, & |
---|
3133 | surf_def_v(1)%uvw_abs, & |
---|
3134 | surf_lsm_v(1)%uvw_abs, & |
---|
3135 | surf_usm_v(1)%uvw_abs, & |
---|
3136 | surf_def_v(2)%uvw_abs, & |
---|
3137 | surf_lsm_v(2)%uvw_abs, & |
---|
3138 | surf_usm_v(2)%uvw_abs, & |
---|
3139 | surf_def_v(3)%uvw_abs, & |
---|
3140 | surf_lsm_v(3)%uvw_abs, & |
---|
3141 | surf_usm_v(3)%uvw_abs, n_out ) |
---|
3142 | |
---|
3143 | END SELECT |
---|
3144 | ENDDO |
---|
3145 | |
---|
3146 | |
---|
3147 | END SUBROUTINE surface_data_output_averaging |
---|
3148 | |
---|
3149 | !------------------------------------------------------------------------------! |
---|
3150 | ! Description: |
---|
3151 | ! ------------ |
---|
3152 | !> Sum-up the surface data for average output variables. |
---|
3153 | !------------------------------------------------------------------------------! |
---|
3154 | SUBROUTINE surface_data_output_sum_up( var_def_h0, var_def_h1, & |
---|
3155 | var_lsm_h, var_usm_h, & |
---|
3156 | var_def_v0, var_lsm_v0, var_usm_v0, & |
---|
3157 | var_def_v1, var_lsm_v1, var_usm_v1, & |
---|
3158 | var_def_v2, var_lsm_v2, var_usm_v2, & |
---|
3159 | var_def_v3, var_lsm_v3, var_usm_v3, n_out ) |
---|
3160 | |
---|
3161 | IMPLICIT NONE |
---|
3162 | |
---|
3163 | INTEGER(iwp) :: m !< running index for surface elements |
---|
3164 | INTEGER(iwp) :: n_out !< index for output variable |
---|
3165 | INTEGER(iwp) :: n_surf !< running index for surface elements |
---|
3166 | |
---|
3167 | REAL(wp), DIMENSION(:), ALLOCATABLE, INTENT(IN) :: var_def_h0 !< output variable at upward-facing default-type surfaces |
---|
3168 | REAL(wp), DIMENSION(:), ALLOCATABLE, INTENT(IN) :: var_def_h1 !< output variable at downward-facing default-type surfaces |
---|
3169 | REAL(wp), DIMENSION(:), ALLOCATABLE, INTENT(IN) :: var_lsm_h !< output variable at upward-facing natural-type surfaces |
---|
3170 | REAL(wp), DIMENSION(:), ALLOCATABLE, INTENT(IN) :: var_usm_h !< output variable at upward-facing urban-type surfaces |
---|
3171 | REAL(wp), DIMENSION(:), ALLOCATABLE, INTENT(IN) :: var_def_v0 !< output variable at northward-facing default-type surfaces |
---|
3172 | REAL(wp), DIMENSION(:), ALLOCATABLE, INTENT(IN) :: var_def_v1 !< output variable at southward-facing default-type surfaces |
---|
3173 | REAL(wp), DIMENSION(:), ALLOCATABLE, INTENT(IN) :: var_def_v2 !< output variable at eastward-facing default-type surfaces |
---|
3174 | REAL(wp), DIMENSION(:), ALLOCATABLE, INTENT(IN) :: var_def_v3 !< output variable at westward-facing default-type surfaces |
---|
3175 | REAL(wp), DIMENSION(:), ALLOCATABLE, INTENT(IN) :: var_lsm_v0 !< output variable at northward-facing natural-type surfaces |
---|
3176 | REAL(wp), DIMENSION(:), ALLOCATABLE, INTENT(IN) :: var_lsm_v1 !< output variable at southward-facing natural-type surfaces |
---|
3177 | REAL(wp), DIMENSION(:), ALLOCATABLE, INTENT(IN) :: var_lsm_v2 !< output variable at eastward-facing natural-type surfaces |
---|
3178 | REAL(wp), DIMENSION(:), ALLOCATABLE, INTENT(IN) :: var_lsm_v3 !< output variable at westward-facing natural-type surfaces |
---|
3179 | REAL(wp), DIMENSION(:), ALLOCATABLE, INTENT(IN) :: var_usm_v0 !< output variable at northward-facing urban-type surfaces |
---|
3180 | REAL(wp), DIMENSION(:), ALLOCATABLE, INTENT(IN) :: var_usm_v1 !< output variable at southward-facing urban-type surfaces |
---|
3181 | REAL(wp), DIMENSION(:), ALLOCATABLE, INTENT(IN) :: var_usm_v2 !< output variable at eastward-facing urban-type surfaces |
---|
3182 | REAL(wp), DIMENSION(:), ALLOCATABLE, INTENT(IN) :: var_usm_v3 !< output variable at westward-facing urban-type surfaces |
---|
3183 | |
---|
3184 | ! |
---|
3185 | !-- Set counter variable to zero before the variable is written to |
---|
3186 | !-- the output array. |
---|
3187 | n_surf = 0 |
---|
3188 | |
---|
3189 | ! |
---|
3190 | !-- Write the horizontal surfaces. |
---|
3191 | !-- Before each the variable is written to the output data structure, first |
---|
3192 | !-- check if the variable for the respective surface type is defined. |
---|
3193 | !-- If a variable is not defined, skip the block and increment the counter |
---|
3194 | !-- variable by the number of surface elements of this type. Usually this |
---|
3195 | !-- is zere, however, there might be the situation that e.g. urban surfaces |
---|
3196 | !-- are defined but the respective variable is not allocated for this surface |
---|
3197 | !-- type. To write the data on the exact position, increment the counter. |
---|
3198 | IF ( ALLOCATED( var_def_h0 ) ) THEN |
---|
3199 | DO m = 1, surf_def_h(0)%ns |
---|
3200 | n_surf = n_surf + 1 |
---|
3201 | surfaces%var_av(n_surf,n_out) = surfaces%var_av(n_surf,n_out) & |
---|
3202 | + var_def_h0(m) |
---|
3203 | ENDDO |
---|
3204 | ELSE |
---|
3205 | n_surf = n_surf + surf_def_h(0)%ns |
---|
3206 | ENDIF |
---|
3207 | IF ( ALLOCATED( var_def_h1 ) ) THEN |
---|
3208 | DO m = 1, surf_def_h(1)%ns |
---|
3209 | n_surf = n_surf + 1 |
---|
3210 | surfaces%var_av(n_surf,n_out) = surfaces%var_av(n_surf,n_out) & |
---|
3211 | + var_def_h1(m) |
---|
3212 | ENDDO |
---|
3213 | ELSE |
---|
3214 | n_surf = n_surf + surf_def_h(1)%ns |
---|
3215 | ENDIF |
---|
3216 | IF ( ALLOCATED( var_lsm_h ) ) THEN |
---|
3217 | DO m = 1, surf_lsm_h%ns |
---|
3218 | n_surf = n_surf + 1 |
---|
3219 | surfaces%var_av(n_surf,n_out) = surfaces%var_av(n_surf,n_out) & |
---|
3220 | + var_lsm_h(m) |
---|
3221 | ENDDO |
---|
3222 | ELSE |
---|
3223 | n_surf = n_surf + surf_lsm_h%ns |
---|
3224 | ENDIF |
---|
3225 | IF ( ALLOCATED( var_usm_h ) ) THEN |
---|
3226 | DO m = 1, surf_usm_h%ns |
---|
3227 | n_surf = n_surf + 1 |
---|
3228 | surfaces%var_av(n_surf,n_out) = surfaces%var_av(n_surf,n_out) & |
---|
3229 | + var_usm_h(m) |
---|
3230 | ENDDO |
---|
3231 | ELSE |
---|
3232 | n_surf = n_surf + surf_usm_h%ns |
---|
3233 | ENDIF |
---|
3234 | ! |
---|
3235 | !-- Write northward-facing |
---|
3236 | IF ( ALLOCATED( var_def_v0 ) ) THEN |
---|
3237 | DO m = 1, surf_def_v(0)%ns |
---|
3238 | n_surf = n_surf + 1 |
---|
3239 | surfaces%var_av(n_surf,n_out) = surfaces%var_av(n_surf,n_out) & |
---|
3240 | + var_def_v0(m) |
---|
3241 | ENDDO |
---|
3242 | ELSE |
---|
3243 | n_surf = n_surf + surf_def_v(0)%ns |
---|
3244 | ENDIF |
---|
3245 | IF ( ALLOCATED( var_lsm_v0 ) ) THEN |
---|
3246 | DO m = 1, surf_lsm_v(0)%ns |
---|
3247 | n_surf = n_surf + 1 |
---|
3248 | surfaces%var_av(n_surf,n_out) = surfaces%var_av(n_surf,n_out) & |
---|
3249 | + var_lsm_v0(m) |
---|
3250 | ENDDO |
---|
3251 | ELSE |
---|
3252 | n_surf = n_surf + surf_lsm_v(0)%ns |
---|
3253 | ENDIF |
---|
3254 | IF ( ALLOCATED( var_usm_v0 ) ) THEN |
---|
3255 | DO m = 1, surf_usm_v(0)%ns |
---|
3256 | n_surf = n_surf + 1 |
---|
3257 | surfaces%var_av(n_surf,n_out) = surfaces%var_av(n_surf,n_out) & |
---|
3258 | + var_usm_v0(m) |
---|
3259 | ENDDO |
---|
3260 | ELSE |
---|
3261 | n_surf = n_surf + surf_usm_v(0)%ns |
---|
3262 | ENDIF |
---|
3263 | ! |
---|
3264 | !-- Write southward-facing |
---|
3265 | IF ( ALLOCATED( var_def_v1 ) ) THEN |
---|
3266 | DO m = 1, surf_def_v(1)%ns |
---|
3267 | n_surf = n_surf + 1 |
---|
3268 | surfaces%var_av(n_surf,n_out) = surfaces%var_av(n_surf,n_out) & |
---|
3269 | + var_def_v1(m) |
---|
3270 | ENDDO |
---|
3271 | ELSE |
---|
3272 | n_surf = n_surf + surf_def_v(1)%ns |
---|
3273 | ENDIF |
---|
3274 | IF ( ALLOCATED( var_lsm_v1 ) ) THEN |
---|
3275 | DO m = 1, surf_lsm_v(1)%ns |
---|
3276 | n_surf = n_surf + 1 |
---|
3277 | surfaces%var_av(n_surf,n_out) = surfaces%var_av(n_surf,n_out) & |
---|
3278 | + var_lsm_v1(m) |
---|
3279 | ENDDO |
---|
3280 | ELSE |
---|
3281 | n_surf = n_surf + surf_lsm_v(1)%ns |
---|
3282 | ENDIF |
---|
3283 | IF ( ALLOCATED( var_usm_v1 ) ) THEN |
---|
3284 | DO m = 1, surf_usm_v(1)%ns |
---|
3285 | n_surf = n_surf + 1 |
---|
3286 | surfaces%var_av(n_surf,n_out) = surfaces%var_av(n_surf,n_out) & |
---|
3287 | + var_usm_v1(m) |
---|
3288 | ENDDO |
---|
3289 | ELSE |
---|
3290 | n_surf = n_surf + surf_usm_v(1)%ns |
---|
3291 | ENDIF |
---|
3292 | ! |
---|
3293 | !-- Write eastward-facing |
---|
3294 | IF ( ALLOCATED( var_def_v2 ) ) THEN |
---|
3295 | DO m = 1, surf_def_v(2)%ns |
---|
3296 | n_surf = n_surf + 1 |
---|
3297 | surfaces%var_av(n_surf,n_out) = surfaces%var_av(n_surf,n_out) & |
---|
3298 | + var_def_v2(m) |
---|
3299 | ENDDO |
---|
3300 | ELSE |
---|
3301 | n_surf = n_surf + surf_def_v(2)%ns |
---|
3302 | ENDIF |
---|
3303 | IF ( ALLOCATED( var_lsm_v2 ) ) THEN |
---|
3304 | DO m = 1, surf_lsm_v(2)%ns |
---|
3305 | n_surf = n_surf + 1 |
---|
3306 | surfaces%var_av(n_surf,n_out) = surfaces%var_av(n_surf,n_out) & |
---|
3307 | + var_lsm_v2(m) |
---|
3308 | ENDDO |
---|
3309 | ELSE |
---|
3310 | n_surf = n_surf + surf_lsm_v(2)%ns |
---|
3311 | ENDIF |
---|
3312 | IF ( ALLOCATED( var_usm_v2 ) ) THEN |
---|
3313 | DO m = 1, surf_usm_v(2)%ns |
---|
3314 | n_surf = n_surf + 1 |
---|
3315 | surfaces%var_av(n_surf,n_out) = surfaces%var_av(n_surf,n_out) & |
---|
3316 | + var_usm_v2(m) |
---|
3317 | ENDDO |
---|
3318 | ELSE |
---|
3319 | n_surf = n_surf + surf_usm_v(2)%ns |
---|
3320 | ENDIF |
---|
3321 | ! |
---|
3322 | !-- Write westward-facing |
---|
3323 | IF ( ALLOCATED( var_def_v3 ) ) THEN |
---|
3324 | DO m = 1, surf_def_v(3)%ns |
---|
3325 | n_surf = n_surf + 1 |
---|
3326 | surfaces%var_av(n_surf,n_out) = surfaces%var_av(n_surf,n_out) & |
---|
3327 | + var_def_v3(m) |
---|
3328 | ENDDO |
---|
3329 | ELSE |
---|
3330 | n_surf = n_surf + surf_def_v(3)%ns |
---|
3331 | ENDIF |
---|
3332 | IF ( ALLOCATED( var_lsm_v3 ) ) THEN |
---|
3333 | DO m = 1, surf_lsm_v(3)%ns |
---|
3334 | n_surf = n_surf + 1 |
---|
3335 | surfaces%var_av(n_surf,n_out) = surfaces%var_av(n_surf,n_out) & |
---|
3336 | + var_lsm_v3(m) |
---|
3337 | ENDDO |
---|
3338 | ELSE |
---|
3339 | n_surf = n_surf + surf_lsm_v(3)%ns |
---|
3340 | ENDIF |
---|
3341 | IF ( ALLOCATED( var_usm_v3 ) ) THEN |
---|
3342 | DO m = 1, surf_usm_v(3)%ns |
---|
3343 | n_surf = n_surf + 1 |
---|
3344 | surfaces%var_av(n_surf,n_out) = surfaces%var_av(n_surf,n_out) & |
---|
3345 | + var_usm_v3(m) |
---|
3346 | ENDDO |
---|
3347 | ELSE |
---|
3348 | n_surf = n_surf + surf_usm_v(3)%ns |
---|
3349 | ENDIF |
---|
3350 | |
---|
3351 | END SUBROUTINE surface_data_output_sum_up |
---|
3352 | |
---|
3353 | !------------------------------------------------------------------------------! |
---|
3354 | ! Description: |
---|
3355 | ! ------------ |
---|
3356 | !> Collect the surface data from different types and different orientation. |
---|
3357 | !------------------------------------------------------------------------------! |
---|
3358 | SUBROUTINE surface_data_output_collect( var_def_h0, var_def_h1, & |
---|
3359 | var_lsm_h, var_usm_h, & |
---|
3360 | var_def_v0, var_lsm_v0, var_usm_v0, & |
---|
3361 | var_def_v1, var_lsm_v1, var_usm_v1, & |
---|
3362 | var_def_v2, var_lsm_v2, var_usm_v2, & |
---|
3363 | var_def_v3, var_lsm_v3, var_usm_v3 ) |
---|
3364 | |
---|
3365 | IMPLICIT NONE |
---|
3366 | |
---|
3367 | INTEGER(iwp) :: m !< running index for surface elements |
---|
3368 | INTEGER(iwp) :: n_surf !< running index for surface elements |
---|
3369 | |
---|
3370 | REAL(wp), DIMENSION(:), ALLOCATABLE, INTENT(IN) :: var_def_h0 !< output variable at upward-facing default-type surfaces |
---|
3371 | REAL(wp), DIMENSION(:), ALLOCATABLE, INTENT(IN) :: var_def_h1 !< output variable at downward-facing default-type surfaces |
---|
3372 | REAL(wp), DIMENSION(:), ALLOCATABLE, INTENT(IN) :: var_lsm_h !< output variable at upward-facing natural-type surfaces |
---|
3373 | REAL(wp), DIMENSION(:), ALLOCATABLE, INTENT(IN) :: var_usm_h !< output variable at upward-facing urban-type surfaces |
---|
3374 | REAL(wp), DIMENSION(:), ALLOCATABLE, INTENT(IN) :: var_def_v0 !< output variable at northward-facing default-type surfaces |
---|
3375 | REAL(wp), DIMENSION(:), ALLOCATABLE, INTENT(IN) :: var_def_v1 !< output variable at southward-facing default-type surfaces |
---|
3376 | REAL(wp), DIMENSION(:), ALLOCATABLE, INTENT(IN) :: var_def_v2 !< output variable at eastward-facing default-type surfaces |
---|
3377 | REAL(wp), DIMENSION(:), ALLOCATABLE, INTENT(IN) :: var_def_v3 !< output variable at westward-facing default-type surfaces |
---|
3378 | REAL(wp), DIMENSION(:), ALLOCATABLE, INTENT(IN) :: var_lsm_v0 !< output variable at northward-facing natural-type surfaces |
---|
3379 | REAL(wp), DIMENSION(:), ALLOCATABLE, INTENT(IN) :: var_lsm_v1 !< output variable at southward-facing natural-type surfaces |
---|
3380 | REAL(wp), DIMENSION(:), ALLOCATABLE, INTENT(IN) :: var_lsm_v2 !< output variable at eastward-facing natural-type surfaces |
---|
3381 | REAL(wp), DIMENSION(:), ALLOCATABLE, INTENT(IN) :: var_lsm_v3 !< output variable at westward-facing natural-type surfaces |
---|
3382 | REAL(wp), DIMENSION(:), ALLOCATABLE, INTENT(IN) :: var_usm_v0 !< output variable at northward-facing urban-type surfaces |
---|
3383 | REAL(wp), DIMENSION(:), ALLOCATABLE, INTENT(IN) :: var_usm_v1 !< output variable at southward-facing urban-type surfaces |
---|
3384 | REAL(wp), DIMENSION(:), ALLOCATABLE, INTENT(IN) :: var_usm_v2 !< output variable at eastward-facing urban-type surfaces |
---|
3385 | REAL(wp), DIMENSION(:), ALLOCATABLE, INTENT(IN) :: var_usm_v3 !< output variable at westward-facing urban-type surfaces |
---|
3386 | |
---|
3387 | ! |
---|
3388 | !-- Set counter variable to zero before the variable is written to |
---|
3389 | !-- the output array. |
---|
3390 | n_surf = 0 |
---|
3391 | |
---|
3392 | ! |
---|
3393 | !-- Write the horizontal surfaces. |
---|
3394 | !-- Before each the variable is written to the output data structure, first |
---|
3395 | !-- check if the variable for the respective surface type is defined. |
---|
3396 | !-- If a variable is not defined, skip the block and increment the counter |
---|
3397 | !-- variable by the number of surface elements of this type. Usually this |
---|
3398 | !-- is zere, however, there might be the situation that e.g. urban surfaces |
---|
3399 | !-- are defined but the respective variable is not allocated for this surface |
---|
3400 | !-- type. To write the data on the exact position, increment the counter. |
---|
3401 | IF ( ALLOCATED( var_def_h0 ) ) THEN |
---|
3402 | DO m = 1, surf_def_h(0)%ns |
---|
3403 | n_surf = n_surf + 1 |
---|
3404 | surfaces%var_out(n_surf) = var_def_h0(m) |
---|
3405 | ENDDO |
---|
3406 | ELSE |
---|
3407 | n_surf = n_surf + surf_def_h(0)%ns |
---|
3408 | ENDIF |
---|
3409 | IF ( ALLOCATED( var_def_h1 ) ) THEN |
---|
3410 | DO m = 1, surf_def_h(1)%ns |
---|
3411 | n_surf = n_surf + 1 |
---|
3412 | surfaces%var_out(n_surf) = var_def_h1(m) |
---|
3413 | ENDDO |
---|
3414 | ELSE |
---|
3415 | n_surf = n_surf + surf_def_h(1)%ns |
---|
3416 | ENDIF |
---|
3417 | IF ( ALLOCATED( var_lsm_h ) ) THEN |
---|
3418 | DO m = 1, surf_lsm_h%ns |
---|
3419 | n_surf = n_surf + 1 |
---|
3420 | surfaces%var_out(n_surf) = var_lsm_h(m) |
---|
3421 | ENDDO |
---|
3422 | ELSE |
---|
3423 | n_surf = n_surf + surf_lsm_h%ns |
---|
3424 | ENDIF |
---|
3425 | IF ( ALLOCATED( var_usm_h ) ) THEN |
---|
3426 | DO m = 1, surf_usm_h%ns |
---|
3427 | n_surf = n_surf + 1 |
---|
3428 | surfaces%var_out(n_surf) = var_usm_h(m) |
---|
3429 | ENDDO |
---|
3430 | ELSE |
---|
3431 | n_surf = n_surf + surf_usm_h%ns |
---|
3432 | ENDIF |
---|
3433 | ! |
---|
3434 | !-- Write northward-facing |
---|
3435 | IF ( ALLOCATED( var_def_v0 ) ) THEN |
---|
3436 | DO m = 1, surf_def_v(0)%ns |
---|
3437 | n_surf = n_surf + 1 |
---|
3438 | surfaces%var_out(n_surf) = var_def_v0(m) |
---|
3439 | ENDDO |
---|
3440 | ELSE |
---|
3441 | n_surf = n_surf + surf_def_v(0)%ns |
---|
3442 | ENDIF |
---|
3443 | IF ( ALLOCATED( var_lsm_v0 ) ) THEN |
---|
3444 | DO m = 1, surf_lsm_v(0)%ns |
---|
3445 | n_surf = n_surf + 1 |
---|
3446 | surfaces%var_out(n_surf) = var_lsm_v0(m) |
---|
3447 | ENDDO |
---|
3448 | ELSE |
---|
3449 | n_surf = n_surf + surf_lsm_v(0)%ns |
---|
3450 | ENDIF |
---|
3451 | IF ( ALLOCATED( var_usm_v0 ) ) THEN |
---|
3452 | DO m = 1, surf_usm_v(0)%ns |
---|
3453 | n_surf = n_surf + 1 |
---|
3454 | surfaces%var_out(n_surf) = var_usm_v0(m) |
---|
3455 | ENDDO |
---|
3456 | ELSE |
---|
3457 | n_surf = n_surf + surf_usm_v(0)%ns |
---|
3458 | ENDIF |
---|
3459 | ! |
---|
3460 | !-- Write southward-facing |
---|
3461 | IF ( ALLOCATED( var_def_v1 ) ) THEN |
---|
3462 | DO m = 1, surf_def_v(1)%ns |
---|
3463 | n_surf = n_surf + 1 |
---|
3464 | surfaces%var_out(n_surf) = var_def_v1(m) |
---|
3465 | ENDDO |
---|
3466 | ELSE |
---|
3467 | n_surf = n_surf + surf_def_v(1)%ns |
---|
3468 | ENDIF |
---|
3469 | IF ( ALLOCATED( var_lsm_v1 ) ) THEN |
---|
3470 | DO m = 1, surf_lsm_v(1)%ns |
---|
3471 | n_surf = n_surf + 1 |
---|
3472 | surfaces%var_out(n_surf) = var_lsm_v1(m) |
---|
3473 | ENDDO |
---|
3474 | ELSE |
---|
3475 | n_surf = n_surf + surf_lsm_v(1)%ns |
---|
3476 | ENDIF |
---|
3477 | IF ( ALLOCATED( var_usm_v1 ) ) THEN |
---|
3478 | DO m = 1, surf_usm_v(1)%ns |
---|
3479 | n_surf = n_surf + 1 |
---|
3480 | surfaces%var_out(n_surf) = var_usm_v1(m) |
---|
3481 | ENDDO |
---|
3482 | ELSE |
---|
3483 | n_surf = n_surf + surf_usm_v(1)%ns |
---|
3484 | ENDIF |
---|
3485 | ! |
---|
3486 | !-- Write eastward-facing |
---|
3487 | IF ( ALLOCATED( var_def_v2 ) ) THEN |
---|
3488 | DO m = 1, surf_def_v(2)%ns |
---|
3489 | n_surf = n_surf + 1 |
---|
3490 | surfaces%var_out(n_surf) = var_def_v2(m) |
---|
3491 | ENDDO |
---|
3492 | ELSE |
---|
3493 | n_surf = n_surf + surf_def_v(2)%ns |
---|
3494 | ENDIF |
---|
3495 | IF ( ALLOCATED( var_lsm_v2 ) ) THEN |
---|
3496 | DO m = 1, surf_lsm_v(2)%ns |
---|
3497 | n_surf = n_surf + 1 |
---|
3498 | surfaces%var_out(n_surf) = var_lsm_v2(m) |
---|
3499 | ENDDO |
---|
3500 | ELSE |
---|
3501 | n_surf = n_surf + surf_lsm_v(2)%ns |
---|
3502 | ENDIF |
---|
3503 | IF ( ALLOCATED( var_usm_v2 ) ) THEN |
---|
3504 | DO m = 1, surf_usm_v(2)%ns |
---|
3505 | n_surf = n_surf + 1 |
---|
3506 | surfaces%var_out(n_surf) = var_usm_v2(m) |
---|
3507 | ENDDO |
---|
3508 | ELSE |
---|
3509 | n_surf = n_surf + surf_usm_v(2)%ns |
---|
3510 | ENDIF |
---|
3511 | ! |
---|
3512 | !-- Write westward-facing |
---|
3513 | IF ( ALLOCATED( var_def_v3 ) ) THEN |
---|
3514 | DO m = 1, surf_def_v(3)%ns |
---|
3515 | n_surf = n_surf + 1 |
---|
3516 | surfaces%var_out(n_surf) = var_def_v3(m) |
---|
3517 | ENDDO |
---|
3518 | ELSE |
---|
3519 | n_surf = n_surf + surf_def_v(3)%ns |
---|
3520 | ENDIF |
---|
3521 | IF ( ALLOCATED( var_lsm_v3 ) ) THEN |
---|
3522 | DO m = 1, surf_lsm_v(3)%ns |
---|
3523 | n_surf = n_surf + 1 |
---|
3524 | surfaces%var_out(n_surf) = var_lsm_v3(m) |
---|
3525 | ENDDO |
---|
3526 | ELSE |
---|
3527 | n_surf = n_surf + surf_lsm_v(3)%ns |
---|
3528 | ENDIF |
---|
3529 | IF ( ALLOCATED( var_usm_v3 ) ) THEN |
---|
3530 | DO m = 1, surf_usm_v(3)%ns |
---|
3531 | n_surf = n_surf + 1 |
---|
3532 | surfaces%var_out(n_surf) = var_usm_v3(m) |
---|
3533 | ENDDO |
---|
3534 | ELSE |
---|
3535 | n_surf = n_surf + surf_usm_v(3)%ns |
---|
3536 | ENDIF |
---|
3537 | |
---|
3538 | END SUBROUTINE surface_data_output_collect |
---|
3539 | |
---|
3540 | !------------------------------------------------------------------------------! |
---|
3541 | ! Description: |
---|
3542 | ! ------------ |
---|
3543 | !> Parin for output of surface parameters |
---|
3544 | !------------------------------------------------------------------------------! |
---|
3545 | SUBROUTINE surface_data_output_parin |
---|
3546 | |
---|
3547 | IMPLICIT NONE |
---|
3548 | |
---|
3549 | CHARACTER (LEN=80) :: line !< dummy string that contains the current line of the parameter file |
---|
3550 | |
---|
3551 | |
---|
3552 | NAMELIST /surface_data_output_parameters/ & |
---|
3553 | averaging_interval_surf, data_output_surf, & |
---|
3554 | dt_dosurf, dt_dosurf_av, & |
---|
3555 | skip_time_dosurf, skip_time_dosurf_av |
---|
3556 | |
---|
3557 | line = ' ' |
---|
3558 | |
---|
3559 | ! |
---|
3560 | !-- Try to find the namelist |
---|
3561 | REWIND ( 11 ) |
---|
3562 | line = ' ' |
---|
3563 | DO WHILE ( INDEX( line, '&surface_data_output_parameters' ) == 0 ) |
---|
3564 | READ ( 11, '(A)', END=14 ) line |
---|
3565 | ENDDO |
---|
3566 | BACKSPACE ( 11 ) |
---|
3567 | |
---|
3568 | ! |
---|
3569 | !-- Read namelist |
---|
3570 | READ ( 11, surface_data_output_parameters, ERR = 10 ) |
---|
3571 | ! |
---|
3572 | !-- Set flag that indicates that surface data output is switched on |
---|
3573 | surface_output = .TRUE. |
---|
3574 | GOTO 14 |
---|
3575 | |
---|
3576 | 10 BACKSPACE( 11 ) |
---|
3577 | READ( 11 , '(A)') line |
---|
3578 | CALL parin_fail_message( 'surface_data_output_parameters', line ) |
---|
3579 | |
---|
3580 | 14 CONTINUE |
---|
3581 | |
---|
3582 | |
---|
3583 | END SUBROUTINE surface_data_output_parin |
---|
3584 | |
---|
3585 | |
---|
3586 | !------------------------------------------------------------------------------! |
---|
3587 | ! Description: |
---|
3588 | ! ------------ |
---|
3589 | !> Check the input parameters for consistency. Further pre-process the given |
---|
3590 | !> output variables, i.e. separate them into average and non-average output |
---|
3591 | !> variables and map them onto internal output array. |
---|
3592 | !------------------------------------------------------------------------------! |
---|
3593 | SUBROUTINE surface_data_output_check_parameters |
---|
3594 | |
---|
3595 | USE control_parameters, & |
---|
3596 | ONLY: averaging_interval, dt_data_output, message_string |
---|
3597 | |
---|
3598 | IMPLICIT NONE |
---|
3599 | |
---|
3600 | CHARACTER(LEN=100) :: trimvar !< dummy for single output variable |
---|
3601 | |
---|
3602 | INTEGER(iwp) :: av !< id indicating average or non-average data output |
---|
3603 | INTEGER(iwp) :: ilen !< string length |
---|
3604 | INTEGER(iwp) :: n_out !< running index for number of output variables |
---|
3605 | |
---|
3606 | ! |
---|
3607 | !-- Check the average interval |
---|
3608 | IF ( averaging_interval_surf == 9999999.9_wp ) THEN |
---|
3609 | averaging_interval_surf = averaging_interval |
---|
3610 | ENDIF |
---|
3611 | ! |
---|
3612 | !-- Set the default data-output interval dt_data_output if necessary |
---|
3613 | IF ( dt_dosurf == 9999999.9_wp ) dt_dosurf = dt_data_output |
---|
3614 | IF ( dt_dosurf_av == 9999999.9_wp ) dt_dosurf_av = dt_data_output |
---|
3615 | |
---|
3616 | IF ( averaging_interval_surf > dt_dosurf_av ) THEN |
---|
3617 | WRITE( message_string, * ) 'averaging_interval_surf = ', & |
---|
3618 | averaging_interval_surf, ' must be <= dt_dosurf_av = ', & |
---|
3619 | dt_dosurf_av |
---|
3620 | CALL message( 'surface_data_output_check_parameters', & |
---|
3621 | 'PA0087', 1, 2, 0, 6, 0 ) |
---|
3622 | ENDIF |
---|
3623 | |
---|
3624 | ! |
---|
3625 | !-- Count number of output variables and separate output strings for |
---|
3626 | !-- average and non-average output variables. |
---|
3627 | n_out = 0 |
---|
3628 | DO WHILE ( data_output_surf(n_out+1)(1:1) /= ' ' ) |
---|
3629 | |
---|
3630 | n_out = n_out + 1 |
---|
3631 | ilen = LEN_TRIM( data_output_surf(n_out) ) |
---|
3632 | trimvar = TRIM( data_output_surf(n_out) ) |
---|
3633 | |
---|
3634 | ! |
---|
3635 | !-- Check for data averaging |
---|
3636 | av = 0 |
---|
3637 | IF ( ilen > 3 ) THEN |
---|
3638 | IF ( data_output_surf(n_out)(ilen-2:ilen) == '_av' ) THEN |
---|
3639 | trimvar = data_output_surf(n_out)(1:ilen-3) |
---|
3640 | av = 1 |
---|
3641 | ENDIF |
---|
3642 | ENDIF |
---|
3643 | |
---|
3644 | dosurf_no(av) = dosurf_no(av) + 1 |
---|
3645 | dosurf(av,dosurf_no(av)) = TRIM( trimvar ) |
---|
3646 | |
---|
3647 | ! |
---|
3648 | !-- Check if all output variables are known |
---|
3649 | SELECT CASE ( TRIM( trimvar ) ) |
---|
3650 | |
---|
3651 | CASE ( 'css', 'cssws', 'qsws_liq', 'qsws_soil', 'qsws_veg' ) |
---|
3652 | message_string = TRIM( trimvar ) // & |
---|
3653 | ' is not yet implemented in the surface output' |
---|
3654 | CALL message( 'surface_data_output_check_parameters', & |
---|
3655 | 'PA0087', 1, 2, 0, 6, 0 ) |
---|
3656 | |
---|
3657 | CASE ( 'us', 'ts', 'qs', 'ss', 'qcs', 'ncs', 'qrs', 'nrs', 'ol' ) |
---|
3658 | |
---|
3659 | CASE ( 'z0', 'z0h', 'z0q' ) |
---|
3660 | |
---|
3661 | CASE ( 'theta1', 'qv1', 'thetav1' ) |
---|
3662 | |
---|
3663 | CASE ( 'usws', 'vsws' ) |
---|
3664 | |
---|
3665 | CASE ( 'uvw1' ) |
---|
3666 | |
---|
3667 | CASE ( 'qcsws', 'ncsws', 'qrsws', 'nrsws', 'sasws' ) |
---|
3668 | |
---|
3669 | CASE ( 'shf', 'qsws', 'ssws' ) |
---|
3670 | |
---|
3671 | CASE ( 'q_surface', 'theta_surface', 'thetav_surface' ) |
---|
3672 | |
---|
3673 | CASE ( 'rad_net' ) |
---|
3674 | |
---|
3675 | CASE ( 'rad_lw_in', 'rad_lw_out', 'rad_lw_dif', 'rad_lw_ref', & |
---|
3676 | 'rad_lw_res' ) |
---|
3677 | |
---|
3678 | CASE ( 'rad_sw_in', 'rad_sw_out', 'rad_sw_dif', 'rad_sw_ref', & |
---|
3679 | 'rad_sw_res', 'rad_sw_dir' ) |
---|
3680 | |
---|
3681 | CASE ( 'ghf' ) |
---|
3682 | |
---|
3683 | CASE ( 'r_a', 'r_canopy', 'r_soil', 'r_s' ) |
---|
3684 | |
---|
3685 | CASE DEFAULT |
---|
3686 | message_string = TRIM( trimvar ) // & |
---|
3687 | ' is not part of the surface output' |
---|
3688 | CALL message( 'surface_data_output_check_parameters', & |
---|
3689 | 'PA0087', 1, 2, 0, 6, 0 ) |
---|
3690 | END SELECT |
---|
3691 | |
---|
3692 | ENDDO |
---|
3693 | |
---|
3694 | END SUBROUTINE surface_data_output_check_parameters |
---|
3695 | |
---|
3696 | |
---|
3697 | !------------------------------------------------------------------------------! |
---|
3698 | ! Description: |
---|
3699 | ! ------------ |
---|
3700 | !> Last action. |
---|
3701 | !------------------------------------------------------------------------------! |
---|
3702 | SUBROUTINE surface_data_output_last_action( av ) |
---|
3703 | |
---|
3704 | USE control_parameters, & |
---|
3705 | ONLY: io_blocks, io_group |
---|
3706 | |
---|
3707 | USE pegrid, & |
---|
3708 | ONLY: comm2d, ierr |
---|
3709 | |
---|
3710 | IMPLICIT NONE |
---|
3711 | |
---|
3712 | INTEGER(iwp) :: av !< id indicating average or non-average data output |
---|
3713 | INTEGER(iwp) :: i !< loop index |
---|
3714 | |
---|
3715 | ! |
---|
3716 | !-- Return, if nothing to output |
---|
3717 | IF ( dosurf_no(av) == 0 ) RETURN |
---|
3718 | ! |
---|
3719 | !-- Open files |
---|
3720 | CALL check_open( 25+av ) |
---|
3721 | ! |
---|
3722 | !-- Write time coordinate |
---|
3723 | DO i = 0, io_blocks-1 |
---|
3724 | IF ( i == io_group ) THEN |
---|
3725 | WRITE ( 25+av ) LEN_TRIM( 'END' ) |
---|
3726 | WRITE ( 25+av ) 'END' |
---|
3727 | ENDIF |
---|
3728 | #if defined( __parallel ) |
---|
3729 | CALL MPI_BARRIER( comm2d, ierr ) |
---|
3730 | #endif |
---|
3731 | ENDDO |
---|
3732 | |
---|
3733 | END SUBROUTINE surface_data_output_last_action |
---|
3734 | |
---|
3735 | |
---|
3736 | END MODULE surface_data_output_mod |
---|