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