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