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