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