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