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