1 | !> @file module_interface.f90 |
---|
2 | !------------------------------------------------------------------------------! |
---|
3 | ! This file is part of PALM. |
---|
4 | ! |
---|
5 | ! PALM is free software: you can redistribute it and/or modify it under the |
---|
6 | ! terms of the GNU General Public License as published by the Free Software |
---|
7 | ! Foundation, either version 3 of the License, or (at your option) any later |
---|
8 | ! version. |
---|
9 | ! |
---|
10 | ! PALM is distributed in the hope that it will be useful, but WITHOUT ANY |
---|
11 | ! WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR |
---|
12 | ! A PARTICULAR PURPOSE. See the GNU General Public License for more details. |
---|
13 | ! |
---|
14 | ! You should have received a copy of the GNU General Public License along with |
---|
15 | ! PALM. If not, see <http://www.gnu.org/licenses/>. |
---|
16 | ! |
---|
17 | ! Copyright 1997-2019 Leibniz Universitaet Hannover |
---|
18 | !------------------------------------------------------------------------------! |
---|
19 | ! |
---|
20 | ! Current revisions: |
---|
21 | ! ----------------- |
---|
22 | ! |
---|
23 | ! |
---|
24 | ! Former revisions: |
---|
25 | ! ----------------- |
---|
26 | ! $Id: module_interface.f90 3747 2019-02-16 15:15:23Z dom_dwd_user $ |
---|
27 | ! Call user_init_arrays |
---|
28 | ! |
---|
29 | ! 3745 2019-02-15 18:57:56Z suehring |
---|
30 | ! Add indoor model |
---|
31 | ! |
---|
32 | ! 3744 2019-02-15 18:38:58Z suehring |
---|
33 | ! Removed bio_check_parameters as the method is empty. |
---|
34 | ! |
---|
35 | ! 3735 2019-02-12 09:52:40Z dom_dwd_user |
---|
36 | ! Accepting variable j from check_parameters and passing it to |
---|
37 | ! bio_check_data_output |
---|
38 | ! Add required restart data for surface output module |
---|
39 | ! |
---|
40 | ! 3731 2019-02-11 13:06:27Z suehring |
---|
41 | ! Add check_parameters routine for virtual measurements |
---|
42 | ! |
---|
43 | ! 3711 2019-01-31 13:44:26Z knoop |
---|
44 | ! Introduced module_interface_init_checks for post-init checks |
---|
45 | ! |
---|
46 | ! 3705 2019-01-29 19:56:39Z suehring |
---|
47 | ! Add last_actions for virtual measurements |
---|
48 | ! |
---|
49 | ! 3704 2019-01-29 19:51:41Z suehring |
---|
50 | ! Some interface calls moved to module_interface + cleanup |
---|
51 | ! |
---|
52 | ! 3684 2019-01-20 20:20:58Z knoop |
---|
53 | ! Bugfix: made unit intend INOUT |
---|
54 | ! |
---|
55 | ! 3650 2019-01-04 13:01:33Z kanani |
---|
56 | ! Add restart routines for biometeorology |
---|
57 | ! |
---|
58 | ! 3649 2019-01-02 16:52:21Z suehring |
---|
59 | ! Initialize strings, in order to avoid compiler warnings for non-initialized |
---|
60 | ! characters with intent(out) attribute |
---|
61 | ! |
---|
62 | ! 3648 2019-01-02 16:35:46Z suehring |
---|
63 | ! Rename subroutines for surface-data output |
---|
64 | ! |
---|
65 | ! 3641 2018-12-23 22:10:01Z knoop |
---|
66 | ! Initial implementation of the PALM module interface |
---|
67 | ! |
---|
68 | ! |
---|
69 | ! Description: |
---|
70 | ! ------------ |
---|
71 | !> This is the interface between the PALM model core and all its modules. |
---|
72 | !> |
---|
73 | !> @todo Re-format module to be consistent with coding standard |
---|
74 | !------------------------------------------------------------------------------! |
---|
75 | MODULE module_interface |
---|
76 | |
---|
77 | USE indices, & |
---|
78 | ONLY: nbgp, nxl, nxlg, nxr, nxrg, nys, nysg, nyn, nyng, nzb, nzt |
---|
79 | |
---|
80 | USE kinds |
---|
81 | |
---|
82 | !- load module-specific control parameters. |
---|
83 | !- ToDo: move all of them to respective module or a dedicated central module |
---|
84 | |
---|
85 | USE control_parameters, & |
---|
86 | ONLY: biometeorology, & |
---|
87 | air_chemistry, & |
---|
88 | indoor_model, & |
---|
89 | land_surface, & |
---|
90 | large_scale_forcing, & |
---|
91 | nesting_offline, & |
---|
92 | nudging, & |
---|
93 | ocean_mode, & |
---|
94 | plant_canopy, & |
---|
95 | salsa, & |
---|
96 | surface_output, & |
---|
97 | syn_turb_gen, & |
---|
98 | urban_surface, & |
---|
99 | virtual_flight, & |
---|
100 | virtual_measurement, & |
---|
101 | wind_turbine |
---|
102 | |
---|
103 | !- load interface routines of all PALM modules |
---|
104 | |
---|
105 | USE biometeorology_mod, & |
---|
106 | ONLY: bio_parin, & |
---|
107 | bio_check_data_output, & |
---|
108 | bio_init, & |
---|
109 | bio_init_checks, & |
---|
110 | bio_header, & |
---|
111 | bio_3d_data_averaging, & |
---|
112 | bio_data_output_2d, & |
---|
113 | bio_data_output_3d, & |
---|
114 | bio_rrd_global, & |
---|
115 | bio_rrd_local, & |
---|
116 | bio_wrd_global, & |
---|
117 | bio_wrd_local |
---|
118 | |
---|
119 | USE bulk_cloud_model_mod, & |
---|
120 | ONLY: bulk_cloud_model, & |
---|
121 | bcm_parin, & |
---|
122 | bcm_check_parameters, & |
---|
123 | bcm_check_data_output_pr, & |
---|
124 | bcm_check_data_output, & |
---|
125 | bcm_init_arrays, & |
---|
126 | bcm_init, & |
---|
127 | bcm_header, & |
---|
128 | bcm_swap_timelevel, & |
---|
129 | bcm_3d_data_averaging, & |
---|
130 | bcm_data_output_2d, & |
---|
131 | bcm_data_output_3d, & |
---|
132 | bcm_rrd_global, & |
---|
133 | bcm_wrd_global, & |
---|
134 | bcm_rrd_local, & |
---|
135 | bcm_wrd_local |
---|
136 | |
---|
137 | USE chemistry_model_mod, & |
---|
138 | ONLY: chem_parin, & |
---|
139 | chem_check_parameters, & |
---|
140 | chem_check_data_output_pr, & |
---|
141 | chem_check_data_output, & |
---|
142 | chem_init_arrays, & |
---|
143 | chem_init, & |
---|
144 | chem_header, & |
---|
145 | chem_swap_timelevel, & |
---|
146 | chem_3d_data_averaging, & |
---|
147 | chem_data_output_2d, & |
---|
148 | chem_data_output_3d, & |
---|
149 | chem_statistics, & |
---|
150 | chem_rrd_local, & |
---|
151 | chem_wrd_local |
---|
152 | |
---|
153 | USE flight_mod, & |
---|
154 | ONLY: flight_parin, & |
---|
155 | flight_header, & |
---|
156 | flight_init, & |
---|
157 | flight_rrd_global, & |
---|
158 | flight_wrd_global |
---|
159 | |
---|
160 | USE gust_mod, & |
---|
161 | ONLY: gust_module_enabled, & |
---|
162 | gust_parin, & |
---|
163 | gust_check_parameters, & |
---|
164 | gust_check_data_output_pr, & |
---|
165 | gust_check_data_output, & |
---|
166 | gust_init_arrays, & |
---|
167 | gust_init, & |
---|
168 | gust_header, & |
---|
169 | gust_actions, & |
---|
170 | gust_swap_timelevel, & |
---|
171 | gust_3d_data_averaging, & |
---|
172 | gust_data_output_2d, & |
---|
173 | gust_data_output_3d, & |
---|
174 | gust_statistics, & |
---|
175 | gust_rrd_global, & |
---|
176 | gust_wrd_global, & |
---|
177 | gust_rrd_local, & |
---|
178 | gust_wrd_local |
---|
179 | |
---|
180 | USE indoor_model_mod, & |
---|
181 | ONLY: im_parin, & |
---|
182 | im_check_data_output, & |
---|
183 | im_check_parameters, & |
---|
184 | im_data_output_3d, & |
---|
185 | im_init |
---|
186 | |
---|
187 | USE land_surface_model_mod, & |
---|
188 | ONLY: lsm_parin, & |
---|
189 | lsm_check_parameters, & |
---|
190 | lsm_check_data_output_pr, & |
---|
191 | lsm_check_data_output, & |
---|
192 | lsm_init_arrays, & |
---|
193 | lsm_init, & |
---|
194 | lsm_header, & |
---|
195 | lsm_swap_timelevel, & |
---|
196 | lsm_3d_data_averaging, & |
---|
197 | lsm_data_output_2d, & |
---|
198 | lsm_rrd_local, & |
---|
199 | lsm_wrd_local |
---|
200 | |
---|
201 | USE lsf_nudging_mod, & |
---|
202 | ONLY: lsf_nudging_check_parameters, & |
---|
203 | lsf_nudging_check_data_output_pr, & |
---|
204 | lsf_init, & |
---|
205 | nudge_init, & |
---|
206 | lsf_nudging_header |
---|
207 | |
---|
208 | USE multi_agent_system_mod, & |
---|
209 | ONLY: mas_parin |
---|
210 | |
---|
211 | USE nesting_offl_mod, & |
---|
212 | ONLY: nesting_offl_parin, & |
---|
213 | nesting_offl_check_parameters, & |
---|
214 | nesting_offl_header |
---|
215 | |
---|
216 | USE ocean_mod, & |
---|
217 | ONLY: ocean_parin, & |
---|
218 | ocean_check_parameters, & |
---|
219 | ocean_check_data_output_pr, & |
---|
220 | ocean_check_data_output, & |
---|
221 | ocean_init_arrays, & |
---|
222 | ocean_init, & |
---|
223 | ocean_header, & |
---|
224 | ocean_swap_timelevel, & |
---|
225 | ocean_3d_data_averaging, & |
---|
226 | ocean_data_output_2d, & |
---|
227 | ocean_data_output_3d, & |
---|
228 | ocean_rrd_global, & |
---|
229 | ocean_wrd_global, & |
---|
230 | ocean_rrd_local, & |
---|
231 | ocean_wrd_local |
---|
232 | |
---|
233 | USE plant_canopy_model_mod, & |
---|
234 | ONLY: pcm_parin, & |
---|
235 | pcm_check_parameters, & |
---|
236 | pcm_check_data_output, & |
---|
237 | pcm_init, & |
---|
238 | pcm_header, & |
---|
239 | pcm_data_output_3d |
---|
240 | |
---|
241 | USE radiation_model_mod, & |
---|
242 | ONLY: radiation, & |
---|
243 | radiation_parin, & |
---|
244 | radiation_check_parameters, & |
---|
245 | radiation_check_data_output_ts, & |
---|
246 | radiation_check_data_output_pr, & |
---|
247 | radiation_check_data_output, & |
---|
248 | radiation_init, & |
---|
249 | radiation_header, & |
---|
250 | radiation_3d_data_averaging, & |
---|
251 | radiation_data_output_2d, & |
---|
252 | radiation_data_output_3d, & |
---|
253 | radiation_rrd_local, & |
---|
254 | radiation_wrd_local |
---|
255 | |
---|
256 | USE salsa_mod, & |
---|
257 | ONLY: salsa_parin, & |
---|
258 | salsa_check_parameters, & |
---|
259 | salsa_check_data_output, & |
---|
260 | salsa_init_arrays, & |
---|
261 | salsa_init, & |
---|
262 | salsa_header, & |
---|
263 | salsa_swap_timelevel, & |
---|
264 | salsa_3d_data_averaging, & |
---|
265 | salsa_data_output_2d, & |
---|
266 | salsa_data_output_3d, & |
---|
267 | salsa_rrd_local, & |
---|
268 | salsa_wrd_local |
---|
269 | |
---|
270 | USE spectra_mod, & |
---|
271 | ONLY: calculate_spectra, & |
---|
272 | spectra_parin, & |
---|
273 | spectra_check_parameters, & |
---|
274 | spectra_header |
---|
275 | |
---|
276 | USE surface_data_output_mod, & |
---|
277 | ONLY: surface_data_output_parin, & |
---|
278 | surface_data_output_check_parameters, & |
---|
279 | surface_data_output_init_arrays, & |
---|
280 | surface_data_output_rrd_local, & |
---|
281 | surface_data_output_rrd_global, & |
---|
282 | surface_data_output_wrd_local, & |
---|
283 | surface_data_output_wrd_global |
---|
284 | |
---|
285 | USE synthetic_turbulence_generator_mod, & |
---|
286 | ONLY: stg_parin, & |
---|
287 | stg_check_parameters, & |
---|
288 | stg_header, & |
---|
289 | stg_rrd_global, & |
---|
290 | stg_wrd_global |
---|
291 | |
---|
292 | USE urban_surface_mod, & |
---|
293 | ONLY: usm_parin, & |
---|
294 | usm_check_parameters, & |
---|
295 | usm_check_data_output, & |
---|
296 | usm_init_arrays, & |
---|
297 | usm_init, & |
---|
298 | usm_swap_timelevel, & |
---|
299 | usm_3d_data_averaging, & |
---|
300 | usm_rrd_local, & |
---|
301 | usm_wrd_local |
---|
302 | |
---|
303 | USE user, & |
---|
304 | ONLY: user_module_enabled, & |
---|
305 | user_parin, & |
---|
306 | user_check_parameters, & |
---|
307 | user_check_data_output_ts, & |
---|
308 | user_check_data_output_pr, & |
---|
309 | user_check_data_output, & |
---|
310 | user_init, & |
---|
311 | user_init_arrays, & |
---|
312 | user_header, & |
---|
313 | user_actions, & |
---|
314 | user_3d_data_averaging, & |
---|
315 | user_data_output_2d, & |
---|
316 | user_data_output_3d, & |
---|
317 | user_statistics, & |
---|
318 | user_rrd_global, & |
---|
319 | user_rrd_local, & |
---|
320 | user_wrd_global, & |
---|
321 | user_wrd_local, & |
---|
322 | user_last_actions |
---|
323 | |
---|
324 | USE virtual_measurement_mod, & |
---|
325 | ONLY: vm_check_parameters, & |
---|
326 | vm_init, & |
---|
327 | vm_last_actions, & |
---|
328 | vm_parin |
---|
329 | |
---|
330 | USE wind_turbine_model_mod, & |
---|
331 | ONLY: wtm_parin, & |
---|
332 | wtm_check_parameters, & |
---|
333 | wtm_init_arrays, & |
---|
334 | wtm_init, & |
---|
335 | wtm_rrd_global, & |
---|
336 | wtm_wrd_global |
---|
337 | |
---|
338 | IMPLICIT NONE |
---|
339 | |
---|
340 | PRIVATE |
---|
341 | |
---|
342 | ! |
---|
343 | !- Public functions |
---|
344 | PUBLIC & |
---|
345 | module_interface_parin, & |
---|
346 | module_interface_check_parameters, & |
---|
347 | module_interface_check_data_output_ts, & |
---|
348 | module_interface_check_data_output_pr, & |
---|
349 | module_interface_check_data_output, & |
---|
350 | module_interface_init_masks, & |
---|
351 | module_interface_define_netcdf_grid, & |
---|
352 | module_interface_init_arrays, & |
---|
353 | module_interface_init, & |
---|
354 | module_interface_init_checks, & |
---|
355 | module_interface_header, & |
---|
356 | module_interface_actions, & |
---|
357 | module_interface_swap_timelevel, & |
---|
358 | module_interface_3d_data_averaging, & |
---|
359 | module_interface_data_output_2d, & |
---|
360 | module_interface_data_output_3d, & |
---|
361 | module_interface_statistics, & |
---|
362 | module_interface_rrd_global, & |
---|
363 | module_interface_wrd_global, & |
---|
364 | module_interface_rrd_local, & |
---|
365 | module_interface_wrd_local, & |
---|
366 | module_interface_last_actions |
---|
367 | |
---|
368 | |
---|
369 | INTERFACE module_interface_parin |
---|
370 | MODULE PROCEDURE module_interface_parin |
---|
371 | END INTERFACE module_interface_parin |
---|
372 | |
---|
373 | INTERFACE module_interface_check_parameters |
---|
374 | MODULE PROCEDURE module_interface_check_parameters |
---|
375 | END INTERFACE module_interface_check_parameters |
---|
376 | |
---|
377 | INTERFACE module_interface_check_data_output_ts |
---|
378 | MODULE PROCEDURE module_interface_check_data_output_ts |
---|
379 | END INTERFACE module_interface_check_data_output_ts |
---|
380 | |
---|
381 | INTERFACE module_interface_check_data_output_pr |
---|
382 | MODULE PROCEDURE module_interface_check_data_output_pr |
---|
383 | END INTERFACE module_interface_check_data_output_pr |
---|
384 | |
---|
385 | INTERFACE module_interface_check_data_output |
---|
386 | MODULE PROCEDURE module_interface_check_data_output |
---|
387 | END INTERFACE module_interface_check_data_output |
---|
388 | |
---|
389 | INTERFACE module_interface_init_masks |
---|
390 | MODULE PROCEDURE module_interface_init_masks |
---|
391 | END INTERFACE module_interface_init_masks |
---|
392 | |
---|
393 | INTERFACE module_interface_define_netcdf_grid |
---|
394 | MODULE PROCEDURE module_interface_define_netcdf_grid |
---|
395 | END INTERFACE module_interface_define_netcdf_grid |
---|
396 | |
---|
397 | INTERFACE module_interface_init_arrays |
---|
398 | MODULE PROCEDURE module_interface_init_arrays |
---|
399 | END INTERFACE module_interface_init_arrays |
---|
400 | |
---|
401 | INTERFACE module_interface_init |
---|
402 | MODULE PROCEDURE module_interface_init |
---|
403 | END INTERFACE module_interface_init |
---|
404 | |
---|
405 | INTERFACE module_interface_init_checks |
---|
406 | MODULE PROCEDURE module_interface_init_checks |
---|
407 | END INTERFACE module_interface_init_checks |
---|
408 | |
---|
409 | INTERFACE module_interface_header |
---|
410 | MODULE PROCEDURE module_interface_header |
---|
411 | END INTERFACE module_interface_header |
---|
412 | |
---|
413 | INTERFACE module_interface_actions |
---|
414 | MODULE PROCEDURE module_interface_actions |
---|
415 | MODULE PROCEDURE module_interface_actions_ij |
---|
416 | END INTERFACE module_interface_actions |
---|
417 | |
---|
418 | INTERFACE module_interface_swap_timelevel |
---|
419 | MODULE PROCEDURE module_interface_swap_timelevel |
---|
420 | END INTERFACE module_interface_swap_timelevel |
---|
421 | |
---|
422 | INTERFACE module_interface_3d_data_averaging |
---|
423 | MODULE PROCEDURE module_interface_3d_data_averaging |
---|
424 | END INTERFACE module_interface_3d_data_averaging |
---|
425 | |
---|
426 | INTERFACE module_interface_data_output_2d |
---|
427 | MODULE PROCEDURE module_interface_data_output_2d |
---|
428 | END INTERFACE module_interface_data_output_2d |
---|
429 | |
---|
430 | INTERFACE module_interface_data_output_3d |
---|
431 | MODULE PROCEDURE module_interface_data_output_3d |
---|
432 | END INTERFACE module_interface_data_output_3d |
---|
433 | |
---|
434 | INTERFACE module_interface_statistics |
---|
435 | MODULE PROCEDURE module_interface_statistics |
---|
436 | END INTERFACE module_interface_statistics |
---|
437 | |
---|
438 | INTERFACE module_interface_rrd_global |
---|
439 | MODULE PROCEDURE module_interface_rrd_global |
---|
440 | END INTERFACE module_interface_rrd_global |
---|
441 | |
---|
442 | INTERFACE module_interface_wrd_global |
---|
443 | MODULE PROCEDURE module_interface_wrd_global |
---|
444 | END INTERFACE module_interface_wrd_global |
---|
445 | |
---|
446 | INTERFACE module_interface_rrd_local |
---|
447 | MODULE PROCEDURE module_interface_rrd_local |
---|
448 | END INTERFACE module_interface_rrd_local |
---|
449 | |
---|
450 | INTERFACE module_interface_wrd_local |
---|
451 | MODULE PROCEDURE module_interface_wrd_local |
---|
452 | END INTERFACE module_interface_wrd_local |
---|
453 | |
---|
454 | INTERFACE module_interface_last_actions |
---|
455 | MODULE PROCEDURE module_interface_last_actions |
---|
456 | END INTERFACE module_interface_last_actions |
---|
457 | |
---|
458 | |
---|
459 | CONTAINS |
---|
460 | |
---|
461 | |
---|
462 | !------------------------------------------------------------------------------! |
---|
463 | ! Description: |
---|
464 | ! ------------ |
---|
465 | !> Read module-specific parameter namelists |
---|
466 | !------------------------------------------------------------------------------! |
---|
467 | SUBROUTINE module_interface_parin |
---|
468 | |
---|
469 | |
---|
470 | CALL bio_parin |
---|
471 | CALL bcm_parin |
---|
472 | CALL chem_parin |
---|
473 | CALL flight_parin ! ToDo: rename module to match filename |
---|
474 | CALL gust_parin |
---|
475 | CALL im_parin |
---|
476 | CALL lsm_parin |
---|
477 | ! ToDo: create parin routine for large_scale_forcing and nudging (should be seperate modules or new module switch) |
---|
478 | CALL mas_parin |
---|
479 | CALL nesting_offl_parin |
---|
480 | CALL ocean_parin |
---|
481 | CALL pcm_parin |
---|
482 | CALL radiation_parin |
---|
483 | CALL salsa_parin |
---|
484 | CALL spectra_parin |
---|
485 | CALL surface_data_output_parin |
---|
486 | CALL stg_parin |
---|
487 | CALL user_parin ! ToDo: make user code a single Fortran module |
---|
488 | CALL usm_parin |
---|
489 | CALL vm_parin |
---|
490 | CALL wtm_parin |
---|
491 | |
---|
492 | CALL package_parin ! ToDo: deprecated, needs to be dissolved |
---|
493 | |
---|
494 | |
---|
495 | END SUBROUTINE module_interface_parin |
---|
496 | |
---|
497 | |
---|
498 | !------------------------------------------------------------------------------! |
---|
499 | ! Description: |
---|
500 | ! ------------ |
---|
501 | !> Perform module-specific initialization checks |
---|
502 | !------------------------------------------------------------------------------! |
---|
503 | SUBROUTINE module_interface_check_parameters |
---|
504 | |
---|
505 | |
---|
506 | IF ( bulk_cloud_model ) CALL bcm_check_parameters |
---|
507 | IF ( air_chemistry ) CALL chem_check_parameters |
---|
508 | IF ( gust_module_enabled ) CALL gust_check_parameters |
---|
509 | IF ( indoor_model ) CALL im_check_parameters |
---|
510 | IF ( land_surface ) CALL lsm_check_parameters |
---|
511 | IF ( large_scale_forcing .OR. nudging ) CALL lsf_nudging_check_parameters ! ToDo: create single module switch |
---|
512 | IF ( nesting_offline ) CALL nesting_offl_check_parameters |
---|
513 | IF ( ocean_mode ) CALL ocean_check_parameters |
---|
514 | IF ( plant_canopy ) CALL pcm_check_parameters |
---|
515 | IF ( radiation ) CALL radiation_check_parameters |
---|
516 | IF ( salsa ) CALL salsa_check_parameters |
---|
517 | IF ( calculate_spectra ) CALL spectra_check_parameters |
---|
518 | IF ( surface_output ) CALL surface_data_output_check_parameters |
---|
519 | IF ( syn_turb_gen ) CALL stg_check_parameters |
---|
520 | IF ( urban_surface ) CALL usm_check_parameters |
---|
521 | IF ( virtual_measurement ) CALL vm_check_parameters |
---|
522 | IF ( wind_turbine ) CALL wtm_check_parameters |
---|
523 | IF ( user_module_enabled ) CALL user_check_parameters |
---|
524 | |
---|
525 | |
---|
526 | END SUBROUTINE module_interface_check_parameters |
---|
527 | |
---|
528 | |
---|
529 | !------------------------------------------------------------------------------! |
---|
530 | ! Description: |
---|
531 | ! ------------ |
---|
532 | !> Check module-specific data output of timeseries |
---|
533 | !------------------------------------------------------------------------------! |
---|
534 | SUBROUTINE module_interface_check_data_output_ts( dots_max, dots_num, dots_label, dots_unit ) |
---|
535 | |
---|
536 | |
---|
537 | INTEGER(iwp), INTENT(IN) :: dots_max !< variable output array index |
---|
538 | INTEGER(iwp), INTENT(INOUT) :: dots_num !< variable output array index |
---|
539 | CHARACTER (LEN=*), DIMENSION(dots_max), INTENT(INOUT) :: dots_label |
---|
540 | CHARACTER (LEN=*), DIMENSION(dots_max), INTENT(INOUT) :: dots_unit |
---|
541 | |
---|
542 | |
---|
543 | IF ( radiation ) THEN |
---|
544 | CALL radiation_check_data_output_ts( dots_max, dots_num, dots_label, dots_unit ) |
---|
545 | ENDIF |
---|
546 | |
---|
547 | IF ( user_module_enabled ) THEN |
---|
548 | CALL user_check_data_output_ts( dots_max, dots_num, dots_label, dots_unit ) |
---|
549 | ENDIF |
---|
550 | |
---|
551 | |
---|
552 | END SUBROUTINE module_interface_check_data_output_ts |
---|
553 | |
---|
554 | |
---|
555 | !------------------------------------------------------------------------------! |
---|
556 | ! Description: |
---|
557 | ! ------------ |
---|
558 | !> Check module-specific data output of profiles |
---|
559 | !------------------------------------------------------------------------------! |
---|
560 | SUBROUTINE module_interface_check_data_output_pr( variable, var_count, unit, & |
---|
561 | dopr_unit ) |
---|
562 | |
---|
563 | |
---|
564 | CHARACTER (LEN=*), INTENT(IN) :: variable !< variable name |
---|
565 | INTEGER(iwp), INTENT(IN) :: var_count !< variable output array index |
---|
566 | CHARACTER (LEN=*), INTENT(INOUT) :: unit !< physical unit of variable |
---|
567 | CHARACTER (LEN=*), INTENT(OUT) :: dopr_unit !< local value of dopr_unit |
---|
568 | |
---|
569 | IF ( unit == 'illegal' .AND. bulk_cloud_model ) THEN |
---|
570 | CALL bcm_check_data_output_pr( variable, var_count, unit, dopr_unit ) |
---|
571 | ENDIF |
---|
572 | |
---|
573 | IF ( unit == 'illegal' .AND. air_chemistry ) THEN |
---|
574 | CALL chem_check_data_output_pr( variable, var_count, unit, dopr_unit ) |
---|
575 | ENDIF |
---|
576 | |
---|
577 | IF ( unit == 'illegal' .AND. gust_module_enabled ) THEN |
---|
578 | CALL gust_check_data_output_pr( variable, var_count, unit, dopr_unit ) |
---|
579 | ENDIF |
---|
580 | |
---|
581 | IF ( unit == 'illegal' ) THEN ! ToDo: add module switch if possible |
---|
582 | CALL lsm_check_data_output_pr( variable, var_count, unit, dopr_unit ) |
---|
583 | ENDIF |
---|
584 | |
---|
585 | IF ( unit == 'illegal' ) THEN ! ToDo: add module switch if possible |
---|
586 | CALL lsf_nudging_check_data_output_pr( variable, var_count, unit, dopr_unit ) |
---|
587 | ENDIF |
---|
588 | |
---|
589 | IF ( unit == 'illegal' .AND. ocean_mode ) THEN |
---|
590 | CALL ocean_check_data_output_pr( variable, var_count, unit, dopr_unit ) |
---|
591 | ENDIF |
---|
592 | |
---|
593 | IF ( unit == 'illegal' .AND. radiation ) THEN |
---|
594 | CALL radiation_check_data_output_pr( variable, var_count, unit, dopr_unit ) |
---|
595 | ENDIF |
---|
596 | |
---|
597 | IF ( unit == 'illegal' .AND. user_module_enabled ) THEN |
---|
598 | unit = '' ! ToDo: Seems like a hack. Find a general soultion! |
---|
599 | CALL user_check_data_output_pr( variable, var_count, unit, dopr_unit ) |
---|
600 | ENDIF |
---|
601 | |
---|
602 | |
---|
603 | |
---|
604 | END SUBROUTINE module_interface_check_data_output_pr |
---|
605 | |
---|
606 | !------------------------------------------------------------------------------! |
---|
607 | ! Description: |
---|
608 | ! ------------ |
---|
609 | !> Check module-specific 2D and 3D data output |
---|
610 | !------------------------------------------------------------------------------! |
---|
611 | SUBROUTINE module_interface_check_data_output( variable, unit, i, j, ilen, k ) |
---|
612 | |
---|
613 | |
---|
614 | CHARACTER (LEN=*), INTENT(IN) :: variable !< variable name |
---|
615 | CHARACTER (LEN=*), INTENT(INOUT) :: unit !< physical unit of variable |
---|
616 | |
---|
617 | INTEGER(iwp), INTENT(IN) :: i !< ToDo: remove dummy argument, instead pass string from data_output |
---|
618 | INTEGER(iwp), INTENT(IN) :: j !< average quantity? 0 = no, 1 = yes |
---|
619 | INTEGER(iwp), INTENT(IN) :: ilen !< ToDo: remove dummy argument, instead pass string from data_output |
---|
620 | INTEGER(iwp), INTENT(IN) :: k !< ToDo: remove dummy argument, instead pass string from data_output |
---|
621 | |
---|
622 | IF ( unit == 'illegal' .AND. biometeorology ) THEN |
---|
623 | CALL bio_check_data_output( variable, unit, i, j, ilen, k ) |
---|
624 | ENDIF |
---|
625 | |
---|
626 | IF ( unit == 'illegal' .AND. bulk_cloud_model ) THEN |
---|
627 | CALL bcm_check_data_output( variable, unit ) |
---|
628 | ENDIF |
---|
629 | |
---|
630 | IF ( unit == 'illegal' .AND. air_chemistry & |
---|
631 | .AND. (variable(1:3) == 'kc_' .OR. variable(1:3) == 'em_') ) THEN ! ToDo: remove aditional conditions |
---|
632 | CALL chem_check_data_output( variable, unit, i, ilen, k ) |
---|
633 | ENDIF |
---|
634 | |
---|
635 | IF ( unit == 'illegal' .AND. gust_module_enabled ) THEN |
---|
636 | CALL gust_check_data_output( variable, unit ) |
---|
637 | ENDIF |
---|
638 | |
---|
639 | IF ( unit == 'illegal' ) THEN ! ToDo: add module switch if possible |
---|
640 | CALL lsm_check_data_output( variable, unit, i, ilen, k ) |
---|
641 | ENDIF |
---|
642 | |
---|
643 | IF ( unit == 'illegal' .AND. ocean_mode ) THEN |
---|
644 | CALL ocean_check_data_output( variable, unit ) |
---|
645 | ENDIF |
---|
646 | |
---|
647 | IF ( unit == 'illegal' .AND. plant_canopy & |
---|
648 | .AND. variable(1:4) == 'pcm_' ) THEN ! ToDo: remove aditional conditions |
---|
649 | CALL pcm_check_data_output( variable, unit ) |
---|
650 | ENDIF |
---|
651 | |
---|
652 | IF ( unit == 'illegal' .AND. radiation ) THEN |
---|
653 | CALL radiation_check_data_output( variable, unit, i, ilen, k ) |
---|
654 | ENDIF |
---|
655 | |
---|
656 | IF ( unit == 'illegal' .AND. salsa ) THEN |
---|
657 | CALL salsa_check_data_output( variable, unit ) |
---|
658 | ENDIF |
---|
659 | |
---|
660 | IF ( unit == 'illegal' .AND. indoor_model ) THEN |
---|
661 | CALL im_check_data_output( variable, unit ) |
---|
662 | ENDIF |
---|
663 | |
---|
664 | IF ( unit == 'illegal' .AND. urban_surface & |
---|
665 | .AND. variable(1:4) == 'usm_' ) THEN ! ToDo: remove aditional conditions |
---|
666 | CALL usm_check_data_output( variable, unit ) |
---|
667 | ENDIF |
---|
668 | |
---|
669 | IF ( unit == 'illegal' .AND. user_module_enabled ) THEN |
---|
670 | unit = '' |
---|
671 | CALL user_check_data_output( variable, unit ) |
---|
672 | ENDIF |
---|
673 | |
---|
674 | |
---|
675 | END SUBROUTINE module_interface_check_data_output |
---|
676 | |
---|
677 | |
---|
678 | !------------------------------------------------------------------------------! |
---|
679 | ! |
---|
680 | ! Description: |
---|
681 | ! ------------ |
---|
682 | !> Interface for init_masks. ToDo: get rid of these redundant calls! |
---|
683 | !------------------------------------------------------------------------------! |
---|
684 | SUBROUTINE module_interface_init_masks( variable, unit ) |
---|
685 | |
---|
686 | |
---|
687 | CHARACTER (LEN=*), INTENT(IN) :: variable !< variable name |
---|
688 | CHARACTER (LEN=*), INTENT(INOUT) :: unit !< physical unit of variable |
---|
689 | |
---|
690 | IF ( unit == 'illegal' .AND. air_chemistry & |
---|
691 | .AND. (variable(1:3) == 'kc_' .OR. variable(1:3) == 'em_') ) THEN ! ToDo: remove aditional conditions |
---|
692 | CALL chem_check_data_output( variable, unit, 0, 0, 0 ) |
---|
693 | ENDIF |
---|
694 | |
---|
695 | IF ( unit == 'illegal' .AND. radiation ) THEN |
---|
696 | CALL radiation_check_data_output( variable, unit, 0, 0, 0 ) |
---|
697 | ENDIF |
---|
698 | |
---|
699 | IF ( unit == 'illegal' .AND. salsa ) THEN |
---|
700 | CALL salsa_check_data_output( variable, unit ) |
---|
701 | ENDIF |
---|
702 | |
---|
703 | IF ( unit == 'illegal' .AND. user_module_enabled ) THEN |
---|
704 | unit = '' |
---|
705 | CALL user_check_data_output( variable, unit ) |
---|
706 | ENDIF |
---|
707 | |
---|
708 | |
---|
709 | END SUBROUTINE module_interface_init_masks |
---|
710 | |
---|
711 | |
---|
712 | !------------------------------------------------------------------------------! |
---|
713 | ! |
---|
714 | ! Description: |
---|
715 | ! ------------ |
---|
716 | !> Define appropriate grid for module-specific netcdf output variables. |
---|
717 | !------------------------------------------------------------------------------! |
---|
718 | SUBROUTINE module_interface_define_netcdf_grid( var, found, & |
---|
719 | grid_x, grid_y, grid_z ) |
---|
720 | |
---|
721 | |
---|
722 | CHARACTER (LEN=*), INTENT(IN) :: var !< variable name |
---|
723 | LOGICAL, INTENT(OUT) :: found !< indicates if variable was found |
---|
724 | CHARACTER (LEN=*), INTENT(OUT) :: grid_x !< netcdf dimension in x-direction |
---|
725 | CHARACTER (LEN=*), INTENT(OUT) :: grid_y !< netcdf dimension in y-direction |
---|
726 | CHARACTER (LEN=*), INTENT(OUT) :: grid_z !< netcdf dimension in z-direction |
---|
727 | ! |
---|
728 | !--As long as no action is done in this subroutine, initialize strings with |
---|
729 | !--intent(out) attribute, in order to avoid compiler warnings. |
---|
730 | found = .FALSE. |
---|
731 | grid_x = 'none' |
---|
732 | grid_y = 'none' |
---|
733 | grid_z = 'none' |
---|
734 | |
---|
735 | END SUBROUTINE module_interface_define_netcdf_grid |
---|
736 | |
---|
737 | |
---|
738 | !------------------------------------------------------------------------------! |
---|
739 | ! Description: |
---|
740 | ! ------------ |
---|
741 | !> Allocate module-specific arrays and pointers |
---|
742 | !------------------------------------------------------------------------------! |
---|
743 | SUBROUTINE module_interface_init_arrays |
---|
744 | |
---|
745 | |
---|
746 | IF ( bulk_cloud_model ) CALL bcm_init_arrays |
---|
747 | IF ( air_chemistry ) CALL chem_init_arrays |
---|
748 | IF ( gust_module_enabled ) CALL gust_init_arrays |
---|
749 | IF ( land_surface ) CALL lsm_init_arrays |
---|
750 | IF ( ocean_mode ) CALL ocean_init_arrays |
---|
751 | IF ( salsa ) CALL salsa_init_arrays |
---|
752 | IF ( urban_surface ) CALL usm_init_arrays |
---|
753 | IF ( surface_output ) CALL surface_data_output_init_arrays |
---|
754 | IF ( wind_turbine ) CALL wtm_init_arrays |
---|
755 | IF ( user_module_enabled ) CALL user_init_arrays |
---|
756 | |
---|
757 | |
---|
758 | END SUBROUTINE module_interface_init_arrays |
---|
759 | |
---|
760 | |
---|
761 | !------------------------------------------------------------------------------! |
---|
762 | ! Description: |
---|
763 | ! ------------ |
---|
764 | !> Perform module-specific initialization |
---|
765 | !------------------------------------------------------------------------------! |
---|
766 | SUBROUTINE module_interface_init |
---|
767 | |
---|
768 | |
---|
769 | IF ( biometeorology ) CALL bio_init |
---|
770 | IF ( bulk_cloud_model ) CALL bcm_init |
---|
771 | IF ( air_chemistry ) CALL chem_init |
---|
772 | IF ( virtual_flight ) CALL flight_init |
---|
773 | IF ( gust_module_enabled ) CALL gust_init |
---|
774 | IF ( indoor_model ) CALL im_init |
---|
775 | IF ( large_scale_forcing ) CALL lsf_init |
---|
776 | IF ( land_surface ) CALL lsm_init |
---|
777 | IF ( nudging ) CALL nudge_init |
---|
778 | IF ( ocean_mode ) CALL ocean_init |
---|
779 | IF ( plant_canopy ) CALL pcm_init |
---|
780 | IF ( salsa ) CALL salsa_init |
---|
781 | IF ( urban_surface ) CALL usm_init |
---|
782 | IF ( virtual_measurement ) CALL vm_init |
---|
783 | IF ( wind_turbine ) CALL wtm_init |
---|
784 | IF ( radiation ) CALL radiation_init |
---|
785 | IF ( user_module_enabled ) CALL user_init |
---|
786 | |
---|
787 | |
---|
788 | END SUBROUTINE module_interface_init |
---|
789 | |
---|
790 | |
---|
791 | !------------------------------------------------------------------------------! |
---|
792 | ! Description: |
---|
793 | ! ------------ |
---|
794 | !> Perform module-specific post-initialization checks |
---|
795 | !------------------------------------------------------------------------------! |
---|
796 | SUBROUTINE module_interface_init_checks |
---|
797 | |
---|
798 | |
---|
799 | IF ( biometeorology ) CALL bio_init_checks |
---|
800 | |
---|
801 | |
---|
802 | END SUBROUTINE module_interface_init_checks |
---|
803 | |
---|
804 | |
---|
805 | !------------------------------------------------------------------------------! |
---|
806 | ! Description: |
---|
807 | ! ------------ |
---|
808 | !> Gather module-specific header output |
---|
809 | !------------------------------------------------------------------------------! |
---|
810 | SUBROUTINE module_interface_header( io ) |
---|
811 | |
---|
812 | |
---|
813 | INTEGER(iwp), INTENT(IN) :: io !< unit of the output file |
---|
814 | |
---|
815 | |
---|
816 | IF ( biometeorology ) CALL bio_header ( io ) |
---|
817 | IF ( bulk_cloud_model ) CALL bcm_header( io ) |
---|
818 | IF ( air_chemistry ) CALL chem_header ( io ) |
---|
819 | IF ( virtual_flight ) CALL flight_header( io ) |
---|
820 | IF ( gust_module_enabled ) CALL gust_header( io ) |
---|
821 | IF ( land_surface ) CALL lsm_header( io ) |
---|
822 | IF ( large_scale_forcing ) CALL lsf_nudging_header( io ) |
---|
823 | IF ( nesting_offline ) CALL nesting_offl_header( io ) |
---|
824 | IF ( ocean_mode ) CALL ocean_header( io ) |
---|
825 | IF ( plant_canopy ) CALL pcm_header( io ) |
---|
826 | IF ( radiation ) CALL radiation_header( io ) |
---|
827 | IF ( salsa ) CALL salsa_header( io ) |
---|
828 | IF ( calculate_spectra ) CALL spectra_header( io ) |
---|
829 | IF ( syn_turb_gen ) CALL stg_header( io ) |
---|
830 | IF ( user_module_enabled ) CALL user_header( io ) |
---|
831 | |
---|
832 | |
---|
833 | END SUBROUTINE module_interface_header |
---|
834 | |
---|
835 | |
---|
836 | !------------------------------------------------------------------------------! |
---|
837 | ! Description: |
---|
838 | ! ------------ |
---|
839 | !> Perform module-specific actions while in time-integration (cache-optimized) |
---|
840 | !------------------------------------------------------------------------------! |
---|
841 | SUBROUTINE module_interface_actions( location ) |
---|
842 | |
---|
843 | |
---|
844 | CHARACTER (LEN=*), INTENT(IN) :: location !< call location string |
---|
845 | |
---|
846 | |
---|
847 | IF ( gust_module_enabled ) CALL gust_actions( location ) |
---|
848 | IF ( user_module_enabled ) CALL user_actions( location ) |
---|
849 | |
---|
850 | |
---|
851 | END SUBROUTINE module_interface_actions |
---|
852 | |
---|
853 | |
---|
854 | !------------------------------------------------------------------------------! |
---|
855 | ! Description: |
---|
856 | ! ------------ |
---|
857 | !> Perform module-specific actions while in time-integration (vector-optimized) |
---|
858 | !------------------------------------------------------------------------------! |
---|
859 | SUBROUTINE module_interface_actions_ij( i, j, location ) |
---|
860 | |
---|
861 | |
---|
862 | INTEGER(iwp), INTENT(IN) :: i !< grid index in x-direction |
---|
863 | INTEGER(iwp), INTENT(IN) :: j !< grid index in y-direction |
---|
864 | CHARACTER (LEN=*), INTENT(IN) :: location !< call location string |
---|
865 | |
---|
866 | |
---|
867 | IF ( gust_module_enabled ) CALL gust_actions( i, j, location ) |
---|
868 | IF ( user_module_enabled ) CALL user_actions( i, j, location ) |
---|
869 | |
---|
870 | |
---|
871 | END SUBROUTINE module_interface_actions_ij |
---|
872 | |
---|
873 | |
---|
874 | !------------------------------------------------------------------------------! |
---|
875 | ! Description: |
---|
876 | ! ------------ |
---|
877 | !> Swap the timelevel pointers for module-specific arrays |
---|
878 | !------------------------------------------------------------------------------! |
---|
879 | SUBROUTINE module_interface_swap_timelevel ( swap_mode ) |
---|
880 | |
---|
881 | |
---|
882 | INTEGER(iwp), INTENT(IN) :: swap_mode !< determines procedure of pointer swap |
---|
883 | |
---|
884 | IF ( bulk_cloud_model ) CALL bcm_swap_timelevel( swap_mode ) |
---|
885 | IF ( air_chemistry ) CALL chem_swap_timelevel( swap_mode ) |
---|
886 | IF ( gust_module_enabled ) CALL gust_swap_timelevel( swap_mode ) |
---|
887 | IF ( land_surface ) CALL lsm_swap_timelevel( swap_mode ) |
---|
888 | IF ( ocean_mode ) CALL ocean_swap_timelevel( swap_mode ) |
---|
889 | IF ( salsa ) CALL salsa_swap_timelevel( swap_mode ) |
---|
890 | IF ( urban_surface ) CALL usm_swap_timelevel( swap_mode ) |
---|
891 | |
---|
892 | |
---|
893 | END SUBROUTINE module_interface_swap_timelevel |
---|
894 | |
---|
895 | |
---|
896 | !------------------------------------------------------------------------------! |
---|
897 | ! |
---|
898 | ! Description: |
---|
899 | ! ------------ |
---|
900 | !> Perform module-specific averaging of 3D data |
---|
901 | !------------------------------------------------------------------------------! |
---|
902 | SUBROUTINE module_interface_3d_data_averaging( mode, variable ) |
---|
903 | |
---|
904 | |
---|
905 | CHARACTER (LEN=*), INTENT(IN) :: mode !< averaging interface mode |
---|
906 | CHARACTER (LEN=*), INTENT(IN) :: variable !< variable name |
---|
907 | |
---|
908 | IF ( biometeorology ) CALL bio_3d_data_averaging( mode, variable ) |
---|
909 | IF ( bulk_cloud_model ) CALL bcm_3d_data_averaging( mode, variable ) |
---|
910 | IF ( air_chemistry ) CALL chem_3d_data_averaging( mode, variable ) |
---|
911 | IF ( gust_module_enabled ) CALL gust_3d_data_averaging( mode, variable ) |
---|
912 | IF ( land_surface ) CALL lsm_3d_data_averaging( mode, variable ) |
---|
913 | IF ( ocean_mode ) CALL ocean_3d_data_averaging( mode, variable ) |
---|
914 | IF ( radiation ) CALL radiation_3d_data_averaging( mode, variable ) |
---|
915 | IF ( salsa ) CALL salsa_3d_data_averaging( mode, variable ) |
---|
916 | IF ( urban_surface ) CALL usm_3d_data_averaging( mode, variable ) |
---|
917 | IF ( user_module_enabled ) CALL user_3d_data_averaging( mode, variable ) |
---|
918 | |
---|
919 | |
---|
920 | END SUBROUTINE module_interface_3d_data_averaging |
---|
921 | |
---|
922 | !------------------------------------------------------------------------------! |
---|
923 | ! |
---|
924 | ! Description: |
---|
925 | ! ------------ |
---|
926 | !> Define module-specific 2D output variables |
---|
927 | !------------------------------------------------------------------------------! |
---|
928 | SUBROUTINE module_interface_data_output_2d( av, variable, found, grid, mode, & |
---|
929 | local_pf, two_d, nzb_do, nzt_do, & |
---|
930 | fill_value ) |
---|
931 | |
---|
932 | INTEGER(iwp), INTENT(IN) :: av !< flag for (non-)average output |
---|
933 | CHARACTER (LEN=*), INTENT(IN) :: variable !< variable name |
---|
934 | LOGICAL, INTENT(INOUT) :: found !< flag if output variable is found |
---|
935 | CHARACTER (LEN=*), INTENT(INOUT) :: grid !< name of vertical grid |
---|
936 | CHARACTER (LEN=*), INTENT(IN) :: mode !< either 'xy', 'xz' or 'yz' |
---|
937 | LOGICAL, INTENT(OUT) :: two_d !< flag for 2D variables |
---|
938 | INTEGER(iwp), INTENT(IN) :: nzb_do !< vertical output index (bottom) (usually 0) |
---|
939 | INTEGER(iwp), INTENT(IN) :: nzt_do !< vertical output index (top) (usually nz_do3d) |
---|
940 | REAL(wp), INTENT(IN) :: fill_value !< to be removed |
---|
941 | |
---|
942 | REAL(wp), DIMENSION(nxl:nxr,nys:nyn,nzb_do:nzt_do), INTENT(OUT) :: local_pf !< ToDo: can also be kind=sp |
---|
943 | |
---|
944 | |
---|
945 | IF ( .NOT. found .AND. biometeorology ) THEN |
---|
946 | CALL bio_data_output_2d( & |
---|
947 | av, variable, found, grid, local_pf, two_d, nzb_do, nzt_do & |
---|
948 | ) |
---|
949 | ENDIF |
---|
950 | |
---|
951 | IF ( .NOT. found .AND. bulk_cloud_model ) THEN |
---|
952 | CALL bcm_data_output_2d( & |
---|
953 | av, variable, found, grid, mode, local_pf, two_d, nzb_do, nzt_do & |
---|
954 | ) |
---|
955 | ENDIF |
---|
956 | |
---|
957 | IF ( .NOT. found .AND. air_chemistry ) THEN |
---|
958 | CALL chem_data_output_2d( & |
---|
959 | av, variable, found, grid, mode, local_pf, two_d, nzb_do, nzt_do, fill_value & |
---|
960 | ) |
---|
961 | ENDIF |
---|
962 | |
---|
963 | IF ( .NOT. found .AND. gust_module_enabled ) THEN |
---|
964 | CALL gust_data_output_2d( & |
---|
965 | av, variable, found, grid, mode, local_pf, two_d, nzb_do, nzt_do, fill_value & |
---|
966 | ) |
---|
967 | ENDIF |
---|
968 | |
---|
969 | IF ( .NOT. found .AND. land_surface ) THEN |
---|
970 | CALL lsm_data_output_2d( & |
---|
971 | av, variable, found, grid, mode, local_pf, two_d, nzb_do, nzt_do & |
---|
972 | ) |
---|
973 | ENDIF |
---|
974 | |
---|
975 | IF ( .NOT. found .AND. ocean_mode ) THEN |
---|
976 | CALL ocean_data_output_2d( & |
---|
977 | av, variable, found, grid, mode, local_pf, nzb_do, nzt_do & |
---|
978 | ) |
---|
979 | ENDIF |
---|
980 | |
---|
981 | IF ( .NOT. found .AND. radiation ) THEN |
---|
982 | CALL radiation_data_output_2d( & |
---|
983 | av, variable, found, grid, mode, local_pf, two_d, nzb_do, nzt_do & |
---|
984 | ) |
---|
985 | ENDIF |
---|
986 | |
---|
987 | IF ( .NOT. found .AND. salsa ) THEN |
---|
988 | CALL salsa_data_output_2d( & |
---|
989 | av, variable, found, grid, mode, local_pf, two_d, nzb_do, nzt_do & |
---|
990 | ) |
---|
991 | ENDIF |
---|
992 | |
---|
993 | IF ( .NOT. found .AND. user_module_enabled ) THEN |
---|
994 | CALL user_data_output_2d( & |
---|
995 | av, variable, found, grid, local_pf, two_d, nzb_do, nzt_do & |
---|
996 | ) |
---|
997 | ENDIF |
---|
998 | |
---|
999 | END SUBROUTINE module_interface_data_output_2d |
---|
1000 | |
---|
1001 | |
---|
1002 | !------------------------------------------------------------------------------! |
---|
1003 | ! |
---|
1004 | ! Description: |
---|
1005 | ! ------------ |
---|
1006 | !> Define module-specific 3D output variables |
---|
1007 | !------------------------------------------------------------------------------! |
---|
1008 | SUBROUTINE module_interface_data_output_3d( av, variable, found, local_pf, & |
---|
1009 | fill_value, resorted, nzb_do, nzt_do ) |
---|
1010 | |
---|
1011 | |
---|
1012 | INTEGER(iwp), INTENT(IN) :: av !< flag for (non-)average output |
---|
1013 | CHARACTER (LEN=*), INTENT(IN) :: variable !< variable name |
---|
1014 | LOGICAL, INTENT(INOUT) :: found !< flag if output variable is found |
---|
1015 | REAL(wp), INTENT(IN) :: fill_value !< ToDo: refactor |
---|
1016 | LOGICAL, INTENT(OUT) :: resorted !< flag if output has been resorted |
---|
1017 | INTEGER(iwp), INTENT(IN) :: nzb_do !< vertical output index (bottom) (usually 0) |
---|
1018 | INTEGER(iwp), INTENT(IN) :: nzt_do !< vertical output index (top) (usually nz_do3d) |
---|
1019 | |
---|
1020 | REAL(sp), DIMENSION(nxl:nxr,nys:nyn,nzb_do:nzt_do), INTENT(OUT) :: local_pf |
---|
1021 | |
---|
1022 | |
---|
1023 | IF ( .NOT. found .AND. biometeorology ) THEN |
---|
1024 | CALL bio_data_output_3d( av, variable, found, local_pf, nzb_do, nzt_do ) |
---|
1025 | resorted = .FALSE. |
---|
1026 | ENDIF |
---|
1027 | |
---|
1028 | IF ( .NOT. found .AND. bulk_cloud_model ) THEN |
---|
1029 | CALL bcm_data_output_3d( av, variable, found, local_pf, nzb_do, nzt_do ) |
---|
1030 | resorted = .TRUE. |
---|
1031 | ENDIF |
---|
1032 | |
---|
1033 | IF ( .NOT. found .AND. air_chemistry ) THEN |
---|
1034 | CALL chem_data_output_3d( av, variable, found, local_pf, fill_value, nzb_do, nzt_do ) |
---|
1035 | resorted = .TRUE. |
---|
1036 | ENDIF |
---|
1037 | |
---|
1038 | IF ( .NOT. found .AND. gust_module_enabled ) THEN |
---|
1039 | CALL gust_data_output_3d( av, variable, found, local_pf, fill_value, nzb_do, nzt_do ) |
---|
1040 | resorted = .TRUE. |
---|
1041 | ENDIF |
---|
1042 | |
---|
1043 | IF ( .NOT. found .AND. indoor_model ) THEN |
---|
1044 | CALL im_data_output_3d( av, variable, found, local_pf, fill_value, nzb_do, nzt_do ) |
---|
1045 | resorted = .TRUE. |
---|
1046 | ENDIF |
---|
1047 | |
---|
1048 | IF ( .NOT. found .AND. ocean_mode ) THEN |
---|
1049 | CALL ocean_data_output_3d( av, variable, found, local_pf, nzb_do, nzt_do ) |
---|
1050 | resorted = .TRUE. |
---|
1051 | ENDIF |
---|
1052 | |
---|
1053 | IF ( .NOT. found .AND. plant_canopy ) THEN |
---|
1054 | CALL pcm_data_output_3d( av, variable, found, local_pf, fill_value, nzb_do, nzt_do ) |
---|
1055 | resorted = .TRUE. |
---|
1056 | ENDIF |
---|
1057 | |
---|
1058 | IF ( .NOT. found .AND. radiation ) THEN |
---|
1059 | CALL radiation_data_output_3d( av, variable, found, local_pf, nzb_do, nzt_do ) |
---|
1060 | resorted = .TRUE. |
---|
1061 | ENDIF |
---|
1062 | |
---|
1063 | IF ( .NOT. found .AND. salsa ) THEN |
---|
1064 | CALL salsa_data_output_3d( av, variable, found, local_pf, nzb_do, nzt_do ) |
---|
1065 | resorted = .TRUE. |
---|
1066 | ENDIF |
---|
1067 | |
---|
1068 | IF ( .NOT. found .AND. user_module_enabled ) THEN |
---|
1069 | CALL user_data_output_3d( av, variable, found, local_pf, nzb_do, nzt_do ) |
---|
1070 | resorted = .TRUE. |
---|
1071 | ENDIF |
---|
1072 | |
---|
1073 | |
---|
1074 | END SUBROUTINE module_interface_data_output_3d |
---|
1075 | |
---|
1076 | |
---|
1077 | !------------------------------------------------------------------------------! |
---|
1078 | ! Description: |
---|
1079 | ! ------------ |
---|
1080 | !> Compute module-specific profile and timeseries data |
---|
1081 | !------------------------------------------------------------------------------! |
---|
1082 | SUBROUTINE module_interface_statistics( mode, sr, tn, dots_max ) |
---|
1083 | |
---|
1084 | |
---|
1085 | CHARACTER (LEN=*), INTENT(IN) :: mode !< statistical analysis mode |
---|
1086 | INTEGER(iwp), INTENT(IN) :: sr !< |
---|
1087 | INTEGER(iwp), INTENT(IN) :: tn !< |
---|
1088 | INTEGER(iwp), INTENT(IN) :: dots_max !< maximum number of timeseries |
---|
1089 | |
---|
1090 | IF ( gust_module_enabled ) CALL gust_statistics( mode, sr, tn, dots_max ) |
---|
1091 | IF ( air_chemistry ) CALL chem_statistics( mode, sr, tn ) |
---|
1092 | IF ( user_module_enabled ) CALL user_statistics( mode, sr, tn ) |
---|
1093 | |
---|
1094 | |
---|
1095 | END SUBROUTINE module_interface_statistics |
---|
1096 | |
---|
1097 | |
---|
1098 | !------------------------------------------------------------------------------! |
---|
1099 | ! Description: |
---|
1100 | ! ------------ |
---|
1101 | !> Read module-specific restart data globaly shared by all MPI ranks |
---|
1102 | !------------------------------------------------------------------------------! |
---|
1103 | SUBROUTINE module_interface_rrd_global( variable, found ) |
---|
1104 | |
---|
1105 | |
---|
1106 | CHARACTER (LEN=*), INTENT(IN) :: variable !< name of global variable |
---|
1107 | LOGICAL, INTENT(OUT) :: found !< flag if variable was found |
---|
1108 | |
---|
1109 | IF ( .NOT. found ) CALL bio_rrd_global( found ) ! ToDo: change interface to pass variable |
---|
1110 | IF ( .NOT. found ) CALL bcm_rrd_global( found ) ! ToDo: change interface to pass variable |
---|
1111 | IF ( .NOT. found ) CALL flight_rrd_global( found ) ! ToDo: change interface to pass variable |
---|
1112 | IF ( .NOT. found ) CALL gust_rrd_global( found ) ! ToDo: change interface to pass variable |
---|
1113 | IF ( .NOT. found ) CALL ocean_rrd_global( found ) ! ToDo: change interface to pass variable |
---|
1114 | IF ( .NOT. found ) CALL stg_rrd_global ( found ) ! ToDo: change interface to pass variable |
---|
1115 | IF ( .NOT. found ) CALL wtm_rrd_global( found ) ! ToDo: change interface to pass variable |
---|
1116 | IF ( .NOT. found ) CALL surface_data_output_rrd_global( found ) |
---|
1117 | IF ( .NOT. found ) CALL user_rrd_global( found ) ! ToDo: change interface to pass variable |
---|
1118 | |
---|
1119 | |
---|
1120 | END SUBROUTINE module_interface_rrd_global |
---|
1121 | |
---|
1122 | |
---|
1123 | !------------------------------------------------------------------------------! |
---|
1124 | ! Description: |
---|
1125 | ! ------------ |
---|
1126 | !> Write module-specific restart data globaly shared by all MPI ranks |
---|
1127 | !------------------------------------------------------------------------------! |
---|
1128 | SUBROUTINE module_interface_wrd_global |
---|
1129 | |
---|
1130 | |
---|
1131 | IF ( biometeorology ) CALL bio_wrd_global |
---|
1132 | IF ( bulk_cloud_model ) CALL bcm_wrd_global |
---|
1133 | IF ( virtual_flight ) CALL flight_wrd_global |
---|
1134 | IF ( gust_module_enabled ) CALL gust_wrd_global |
---|
1135 | IF ( ocean_mode ) CALL ocean_wrd_global |
---|
1136 | IF ( syn_turb_gen ) CALL stg_wrd_global |
---|
1137 | IF ( wind_turbine ) CALL wtm_wrd_global |
---|
1138 | IF ( surface_output ) CALL surface_data_output_wrd_global |
---|
1139 | IF ( user_module_enabled ) CALL user_wrd_global |
---|
1140 | |
---|
1141 | |
---|
1142 | END SUBROUTINE module_interface_wrd_global |
---|
1143 | |
---|
1144 | |
---|
1145 | !------------------------------------------------------------------------------! |
---|
1146 | ! Description: |
---|
1147 | ! ------------ |
---|
1148 | !> Read module-specific restart data specific to local MPI ranks |
---|
1149 | !------------------------------------------------------------------------------! |
---|
1150 | SUBROUTINE module_interface_rrd_local( variable, file_index, map_index, & |
---|
1151 | nxlf, nxlc, nxl_on_file, & |
---|
1152 | nxrf, nxrc, nxr_on_file, & |
---|
1153 | nynf, nync, nyn_on_file, & |
---|
1154 | nysf, nysc, nys_on_file, & |
---|
1155 | tmp_2d, tmp_3d, found ) |
---|
1156 | |
---|
1157 | |
---|
1158 | CHARACTER (LEN=*), INTENT(IN) :: variable !< name of global variable |
---|
1159 | INTEGER(iwp), INTENT(IN) :: file_index !< |
---|
1160 | INTEGER(iwp), INTENT(IN) :: map_index !< |
---|
1161 | INTEGER(iwp), INTENT(IN) :: nxlc !< |
---|
1162 | INTEGER(iwp), INTENT(IN) :: nxlf !< |
---|
1163 | INTEGER(iwp), INTENT(IN) :: nxl_on_file !< |
---|
1164 | INTEGER(iwp), INTENT(IN) :: nxrc !< |
---|
1165 | INTEGER(iwp), INTENT(IN) :: nxrf !< |
---|
1166 | INTEGER(iwp), INTENT(IN) :: nxr_on_file !< |
---|
1167 | INTEGER(iwp), INTENT(IN) :: nync !< |
---|
1168 | INTEGER(iwp), INTENT(IN) :: nynf !< |
---|
1169 | INTEGER(iwp), INTENT(IN) :: nyn_on_file !< |
---|
1170 | INTEGER(iwp), INTENT(IN) :: nysc !< |
---|
1171 | INTEGER(iwp), INTENT(IN) :: nysf !< |
---|
1172 | INTEGER(iwp), INTENT(IN) :: nys_on_file !< |
---|
1173 | LOGICAL, INTENT(OUT) :: found !< flag if variable was found |
---|
1174 | |
---|
1175 | REAL(wp), DIMENSION(nys_on_file-nbgp:nyn_on_file+nbgp,nxl_on_file-nbgp:nxr_on_file+nbgp), INTENT(OUT) :: tmp_2d !< |
---|
1176 | REAL(wp), DIMENSION(nzb:nzt+1,nys_on_file-nbgp:nyn_on_file+nbgp,nxl_on_file-nbgp:nxr_on_file+nbgp), INTENT(OUT) :: tmp_3d !< |
---|
1177 | |
---|
1178 | |
---|
1179 | IF ( .NOT. found ) CALL bio_rrd_local( & |
---|
1180 | found & |
---|
1181 | ) |
---|
1182 | |
---|
1183 | IF ( .NOT. found ) CALL bcm_rrd_local( & |
---|
1184 | file_index, map_index, & |
---|
1185 | nxlf, nxlc, nxl_on_file, & |
---|
1186 | nxrf, nxrc, nxr_on_file, & |
---|
1187 | nynf, nync, nyn_on_file, & |
---|
1188 | nysf, nysc, nys_on_file, & |
---|
1189 | tmp_2d, tmp_3d, found & |
---|
1190 | ) ! ToDo: change interface to pass variable |
---|
1191 | |
---|
1192 | IF ( .NOT. found ) CALL chem_rrd_local( & |
---|
1193 | file_index, map_index, & |
---|
1194 | nxlf, nxlc, nxl_on_file, & |
---|
1195 | nxrf, nxrc, nxr_on_file, & |
---|
1196 | nynf, nync, nyn_on_file, & |
---|
1197 | nysf, nysc, nys_on_file, & |
---|
1198 | tmp_3d, found & |
---|
1199 | ) ! ToDo: change interface to pass variable |
---|
1200 | |
---|
1201 | IF ( .NOT. found ) CALL gust_rrd_local( & |
---|
1202 | file_index, map_index, & |
---|
1203 | nxlf, nxlc, nxl_on_file, & |
---|
1204 | nxrf, nxrc, nxr_on_file, & |
---|
1205 | nynf, nync, nyn_on_file, & |
---|
1206 | nysf, nysc, nys_on_file, & |
---|
1207 | tmp_2d, tmp_3d, found & |
---|
1208 | ) ! ToDo: change interface to pass variable |
---|
1209 | |
---|
1210 | IF ( .NOT. found ) CALL lsm_rrd_local( & |
---|
1211 | file_index, map_index, & |
---|
1212 | nxlf, nxlc, nxl_on_file, & |
---|
1213 | nxrf, nxrc, nxr_on_file, & |
---|
1214 | nynf, nync, nyn_on_file, & |
---|
1215 | nysf, nysc, nys_on_file, & |
---|
1216 | tmp_2d, found & |
---|
1217 | ) ! ToDo: change interface to pass variable |
---|
1218 | |
---|
1219 | IF ( .NOT. found ) CALL ocean_rrd_local( & |
---|
1220 | file_index, map_index, & |
---|
1221 | nxlf, nxlc, nxl_on_file, & |
---|
1222 | nxrf, nxrc, nxr_on_file, & |
---|
1223 | nynf, nync, nyn_on_file, & |
---|
1224 | nysf, nysc, nys_on_file, & |
---|
1225 | tmp_2d, tmp_3d, found & |
---|
1226 | ) ! ToDo: change interface to pass variable |
---|
1227 | |
---|
1228 | IF ( .NOT. found ) CALL radiation_rrd_local( & |
---|
1229 | file_index, map_index, & |
---|
1230 | nxlf, nxlc, nxl_on_file, & |
---|
1231 | nxrf, nxrc, nxr_on_file, & |
---|
1232 | nynf, nync, nyn_on_file, & |
---|
1233 | nysf, nysc, nys_on_file, & |
---|
1234 | tmp_2d, tmp_3d, found & |
---|
1235 | ) ! ToDo: change interface to pass variable |
---|
1236 | |
---|
1237 | IF ( .NOT. found ) CALL salsa_rrd_local( & |
---|
1238 | file_index, map_index, & |
---|
1239 | nxlf, nxlc, nxl_on_file, & |
---|
1240 | nxrf, nxrc, nxr_on_file, & |
---|
1241 | nynf, nync, nyn_on_file, & |
---|
1242 | nysf, nysc, nys_on_file, & |
---|
1243 | tmp_3d, found & |
---|
1244 | ) ! ToDo: change interface to pass variable |
---|
1245 | |
---|
1246 | IF ( .NOT. found ) CALL usm_rrd_local( & |
---|
1247 | file_index, map_index, & |
---|
1248 | nxlf, nxlc, nxl_on_file, & |
---|
1249 | nxrf, nxrc, nxr_on_file, & |
---|
1250 | nynf, nync, nyn_on_file, & |
---|
1251 | nysf, nysc, nys_on_file, & |
---|
1252 | found & |
---|
1253 | ) ! ToDo: change interface to pass variable |
---|
1254 | |
---|
1255 | IF ( .NOT. found ) CALL surface_data_output_rrd_local( & |
---|
1256 | file_index, map_index, & |
---|
1257 | nxlf, nxlc, nxl_on_file, & |
---|
1258 | nxrf, nxrc, nxr_on_file, & |
---|
1259 | nynf, nync, nyn_on_file, & |
---|
1260 | nysf, nysc, nys_on_file, & |
---|
1261 | found & |
---|
1262 | ) ! ToDo: change interface to pass variable |
---|
1263 | |
---|
1264 | IF ( .NOT. found ) CALL user_rrd_local( & |
---|
1265 | file_index, map_index, & |
---|
1266 | nxlf, nxlc, nxl_on_file, & |
---|
1267 | nxrf, nxrc, nxr_on_file, & |
---|
1268 | nynf, nync, nyn_on_file, & |
---|
1269 | nysf, nysc, nys_on_file, & |
---|
1270 | tmp_3d, found & |
---|
1271 | ) ! ToDo: change interface to pass variable |
---|
1272 | |
---|
1273 | |
---|
1274 | END SUBROUTINE module_interface_rrd_local |
---|
1275 | |
---|
1276 | |
---|
1277 | !------------------------------------------------------------------------------! |
---|
1278 | ! Description: |
---|
1279 | ! ------------ |
---|
1280 | !> Write module-specific restart data specific to local MPI ranks |
---|
1281 | !------------------------------------------------------------------------------! |
---|
1282 | SUBROUTINE module_interface_wrd_local |
---|
1283 | |
---|
1284 | |
---|
1285 | IF ( biometeorology ) CALL bio_wrd_local |
---|
1286 | IF ( bulk_cloud_model ) CALL bcm_wrd_local |
---|
1287 | IF ( air_chemistry ) CALL chem_wrd_local |
---|
1288 | IF ( gust_module_enabled ) CALL gust_wrd_local |
---|
1289 | IF ( land_surface ) CALL lsm_wrd_local |
---|
1290 | IF ( ocean_mode ) CALL ocean_wrd_local |
---|
1291 | IF ( radiation ) CALL radiation_wrd_local |
---|
1292 | IF ( salsa ) CALL salsa_wrd_local |
---|
1293 | IF ( urban_surface ) CALL usm_wrd_local |
---|
1294 | IF ( surface_output ) CALL surface_data_output_wrd_local |
---|
1295 | IF ( user_module_enabled ) CALL user_wrd_local |
---|
1296 | |
---|
1297 | |
---|
1298 | END SUBROUTINE module_interface_wrd_local |
---|
1299 | |
---|
1300 | |
---|
1301 | !------------------------------------------------------------------------------! |
---|
1302 | ! Description: |
---|
1303 | ! ------------ |
---|
1304 | !> Perform module-specific last actions before the program terminates |
---|
1305 | !------------------------------------------------------------------------------! |
---|
1306 | SUBROUTINE module_interface_last_actions |
---|
1307 | |
---|
1308 | IF ( virtual_measurement ) CALL vm_last_actions |
---|
1309 | IF ( user_module_enabled ) CALL user_last_actions |
---|
1310 | |
---|
1311 | |
---|
1312 | END SUBROUTINE module_interface_last_actions |
---|
1313 | |
---|
1314 | |
---|
1315 | END MODULE module_interface |
---|