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