source: palm/trunk/SOURCE/module_interface.f90 @ 4776

Last change on this file since 4776 was 4768, checked in by suehring, 4 years ago

Enable 3D data output also with 64-bit precision

  • Property svn:keywords set to Id
File size: 102.7 KB
RevLine 
[3637]1!> @file module_interface.f90
[4753]2!--------------------------------------------------------------------------------------------------!
3! This file is part of the PALM model system.
[3637]4!
[4753]5! PALM is free software: you can redistribute it and/or modify it under the terms of the GNU General
6! Public License as published by the Free Software Foundation, either version 3 of the License, or
7! (at your option) any later version.
[3637]8!
[4753]9! PALM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
10! implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
11! Public License for more details.
[3637]12!
[4753]13! You should have received a copy of the GNU General Public License along with PALM. If not, see
14! <http://www.gnu.org/licenses/>.
[3637]15!
[4360]16! Copyright 1997-2020 Leibniz Universitaet Hannover
[4753]17!--------------------------------------------------------------------------------------------------!
[3637]18!
19! Current revisions:
20! -----------------
[4590]21!
22!
[3637]23! Former revisions:
24! -----------------
[3770]25! $Id: module_interface.f90 4768 2020-11-02 19:11:23Z suehring $
[4768]26! Enable 3D data output also with 64-bit precision
27!
28! 4757 2020-10-26 10:23:38Z schwenkel
[4757]29! Implement doq calls
30!
31! 4753 2020-10-21 14:55:41Z raasch
[4753]32! file re-formatted to follow the PALM coding standard
33!
34! 4731 2020-10-07 13:25:11Z schwenkel
[4731]35! Move exchange_horiz from time_integration to modules
36!
37! 4708 2020-09-28 17:42:58Z suehring
[4708]38! pass fillvalue attribute to radiation output
39!
40! 4590 2020-07-06 14:34:59Z suehring
[4590]41! Enable mpi-io for biomet
[4753]42!
[4590]43! 4525 2020-05-10 17:05:07Z raasch
[4525]44! added restart I/O for global salsa data,
45! added restart with MPI-IO for salsa
[4753]46!
[4525]47! 4518 2020-05-04 15:44:28Z suehring
[4518]48! Call of doq_rrd_local enabled
[4753]49!
[4518]50! 4517 2020-05-03 14:29:30Z raasch
[4517]51! added restart with MPI-IO for reading local arrays
[4753]52!
[4517]53! 4514 2020-04-30 16:29:59Z suehring
[4514]54! Added global restart routines for plant-canopy model
[4753]55!
[4514]56! 4495 2020-04-13 20:11:20Z raasch
[4495]57! restart data handling with MPI-IO added
[4753]58!
[4495]59! 4414 2020-02-19 20:16:04Z suehring
[4414]60! Add module interface for basic initialization of numerics.
[4753]61!
[4414]62! 4411 2020-02-18 14:28:02Z maronga
[4411]63! Added output routines for WTM
[4753]64!
[4411]65! 4407 2020-02-13 20:31:44Z knoop
[4407]66! Changed program_debug_output_unit to 9 in dom_init call
[4753]67!
[4407]68! 4400 2020-02-10 20:32:41Z suehring
[4400]69! - Use data-output module for virtual measurement output
70! - Remove deprecated routines for virtual measurement module
[4753]71!
[4400]72! 4361 2020-01-07 12:22:38Z suehring
[4361]73! Remove unused arrays in pmc_rrd_local
[4753]74!
[4361]75! 4360 2020-01-07 11:25:50Z suehring
[4360]76! Add pcm_rrd_local and pcm_wrd_local
[4753]77!
[4360]78! 4331 2019-12-10 18:25:02Z suehring
[4753]79! Change interface for doq_check_data_output, in order to perform further output checks.
80!
[4331]81! 4281 2019-10-29 15:15:39Z schwenkel
[4281]82! Added dynamics boundary conditions
[4753]83!
[4281]84! 4272 2019-10-23 15:18:57Z schwenkel
[4753]85! Further modularization of boundary conditions: moved boundary conditions to respective modules
[4272]86!
87! 4268 2019-10-17 11:29:38Z schwenkel
[4268]88! Introduction of module_interface_boundary_conditions
[4753]89!
[4268]90! 4182 2019-08-22 15:20:23Z scharf
[4182]91! Corrected "Former revisions" section
[4753]92!
[4182]93! 4173 2019-08-20 12:04:06Z gronemeier
[4173]94! add vdi_internal_controls
[4753]95!
[4173]96! 4157 2019-08-14 09:19:12Z suehring
[4157]97! Call doq_init from module interface
[4753]98!
[4157]99! 4132 2019-08-02 12:34:17Z suehring
[4132]100! Bugfix in masked data output for diagnostic quantities
[4753]101!
[4132]102! 4131 2019-08-02 11:06:18Z monakurppa
[4127]103! Add output of 3D plant-canopy outputs (merge from branch resler)
[4753]104!
[4127]105! 4048 2019-06-21 21:00:21Z knoop
[4048]106! Moved turbulence_closure_mod calls into this module_interface
[4753]107!
[4048]108! 4047 2019-06-21 18:58:09Z knoop
[4047]109! Introduction of the dynamics module
110!
111! 4039 2019-06-18 10:32:41Z suehring
[4039]112! Introduce diagnostic output
[4047]113!
[4039]114! 4028 2019-06-13 12:21:37Z schwenkel
[4028]115! Further modularization of particle code components
[4047]116!
[4028]117! 4017 2019-06-06 12:16:46Z schwenkel
[4753]118! local_pf need INTENT(INOUT) attribute rather than INTENT(OUT). This is because INTENT(OUT) sets
119! the array to not-defined. Especially for outputs that are not defined everywhere, e.g.
120! land-surface outputs, this will be problematic as NaN will be output.
[4047]121!
[4004]122! 3987 2019-05-22 09:52:13Z kanani
[3987]123! Introduce switchable DEBUG file output via debug_message routine
[4047]124!
[3987]125! 3956 2019-05-07 12:32:52Z monakurppa
[4753]126! - Added calls for salsa_non_advective_processes and salsa_exchange_horiz_bounds
127! - Moved the call for salsa_data_output_2d/3d before that of radiation_data_output_2d/3d.
128!   radiation_data_output_2d/3d tries to read a salsa output variable and encounters a segmentation
129!   fault for "Ntot" due to the shortoutput name
[4047]130!
[3956]131! 3931 2019-04-24 16:34:28Z schwenkel
[3931]132! Changed non_transport_physics to non_advective_processes
[4047]133!
[3931]134! 3930 2019-04-24 14:57:18Z forkel
[3929]135! Correct/complete module_interface introduction for chemistry model
136!
137! 3887 2019 -04-12 08:47:41Z schwenkel
[4753]138! Changes related to global restructuring of location messages and introduction of additional debug
139! messages
[4047]140!
[3929]141! 3880 2019 -04-08 21:43:02Z knoop
[3864]142! Add a call for salsa_prognostic_equations
[4047]143!
[3864]144! 3840 2019-03-29 10:35:52Z knoop
[3806]145! bugfix: intent of dummy arguments changed to inout
[4047]146!
[3806]147! 3770 2019-02-28 11:22:32Z moh.hefny
[3769]148! removed unused variables in module_interface_check_data_output_ts
[3770]149!
[3769]150! 3767 08:18:02Z raasch
[3767]151! unused variable file_index removed from subroutine parameter list
[4047]152!
[3767]153! 3766 2019-02-26 16:23:41Z raasch
[4753]154! first argument removed from module_interface_rrd_*, statement added to avoid compiler warning
155! about unused variable, file reformatted with respect to coding standards
[4047]156!
[3766]157! 3762 2019-02-25 16:54:16Z suehring
[3762]158! only pass required arguments to surface_data_output_rrd_local
[4047]159!
[3762]160! 3747 2019-02-16 15:15:23Z gronemeier
[3747]161! Call user_init_arrays
[4047]162!
[3747]163! 3745 2019-02-15 18:57:56Z suehring
[3745]164! Add indoor model
[4047]165!
[3745]166! 3744 2019-02-15 18:38:58Z suehring
[3739]167! Removed bio_check_parameters as the method is empty.
[4047]168!
[3739]169! 3735 2019-02-12 09:52:40Z dom_dwd_user
[4753]170! Accepting variable j from check_parameters and passing it to bio_check_data_output
[3735]171! Add required restart data for surface output module
[4047]172!
[3735]173! 3731 2019-02-11 13:06:27Z suehring
[3717]174! Add check_parameters routine for virtual measurements
[4047]175!
[3717]176! 3711 2019-01-31 13:44:26Z knoop
[3711]177! Introduced module_interface_init_checks for post-init checks
[4047]178!
[3711]179! 3705 2019-01-29 19:56:39Z suehring
[3705]180! Add last_actions for virtual measurements
[4047]181!
[3705]182! 3704 2019-01-29 19:51:41Z suehring
[3685]183! Some interface calls moved to module_interface + cleanup
[4047]184!
[3685]185! 3684 2019-01-20 20:20:58Z knoop
[3655]186! Bugfix: made unit intend INOUT
[4047]187!
[3655]188! 3650 2019-01-04 13:01:33Z kanani
[3650]189! Add restart routines for biometeorology
[4047]190!
[3650]191! 3649 2019-01-02 16:52:21Z suehring
[4753]192! Initialize strings, in order to avoid compiler warnings for non-initialized characters with
193! intent(out) attribute
[4047]194!
[3649]195! 3648 2019-01-02 16:35:46Z suehring
[4182]196! 3641 2018-12-23 22:10:01Z knoop
197! Initial implementation of the PALM module interface
[4047]198!
[3637]199!
200! Description:
201! ------------
202!> This is the interface between the PALM model core and all its modules.
203!>
[3731]204!> @todo Re-format module to be consistent with coding standard
[4753]205!--------------------------------------------------------------------------------------------------!
[3766]206 MODULE module_interface
[3637]207
[4753]208    USE indices,                                                                                   &
[3766]209        ONLY:  nbgp, nxl, nxlg, nxr, nxrg, nys, nysg, nyn, nyng, nzb, nzt
[3637]210
[3766]211    USE kinds
[3637]212
[4753]213    USE pegrid,                                                                                    &
[4400]214        ONLY:  comm2d
215
[3766]216!
217!-- load module-specific control parameters.
218!-- ToDo: move all of them to respective module or a dedicated central module
[4753]219    USE data_output_module,                                                                        &
220        ONLY:  dom_def_end,                                                                        &
221               dom_finalize_output,                                                                &
[4400]222               dom_init
[4047]223
[4753]224    USE dynamics_mod,                                                                              &
225        ONLY:  dynamics_3d_data_averaging,                                                         &
226               dynamics_actions,                                                                   &
227               dynamics_boundary_conditions,                                                       &
228               dynamics_check_data_output,                                                         &
229               dynamics_check_data_output_pr,                                                      &
230               dynamics_check_data_output_ts,                                                      &
231               dynamics_check_parameters,                                                          &
232               dynamics_data_output_2d,                                                            &
233               dynamics_data_output_3d,                                                            &
234               dynamics_define_netcdf_grid,                                                        &
235               dynamics_exchange_horiz,                                                            &
236               dynamics_header,                                                                    &
237               dynamics_init,                                                                      &
238               dynamics_init_arrays,                                                               &
239               dynamics_init_checks,                                                               &
240               dynamics_init_masks,                                                                &
241               dynamics_last_actions,                                                              &
242               dynamics_non_advective_processes,                                                   &
243               dynamics_parin,                                                                     &
244               dynamics_prognostic_equations,                                                      &
245               dynamics_rrd_global,                                                                &
246               dynamics_rrd_local,                                                                 &
247               dynamics_statistics,                                                                &
248               dynamics_swap_timelevel,                                                            &
249               dynamics_wrd_global,                                                                &
250               dynamics_wrd_local
[4047]251
[4753]252    USE turbulence_closure_mod,                                                                    &
253        ONLY:  tcm_3d_data_averaging,                                                              &
254               tcm_actions,                                                                        &
255               tcm_boundary_conds,                                                                 &
256               tcm_check_data_output,                                                              &
257               tcm_check_parameters,                                                               &
258               tcm_data_output_2d,                                                                 &
259               tcm_data_output_3d,                                                                 &
260               tcm_init,                                                                           &
261               tcm_init_arrays,                                                                    &
262               tcm_prognostic_equations,                                                           &
263               tcm_swap_timelevel
[4047]264
[4753]265    USE control_parameters,                                                                        &
266        ONLY:  air_chemistry,                                                                      &
267               biometeorology,                                                                     &
268               coupling_char,                                                                      &
269               debug_output,                                                                       &
270               debug_output_timestep,                                                              &
271               indoor_model,                                                                       &
272               land_surface,                                                                       &
273               large_scale_forcing,                                                                &
274               nesting_offline,                                                                    &
275               nudging,                                                                            &
276               ocean_mode,                                                                         &
277               plant_canopy,                                                                       &
278               salsa,                                                                              &
279               surface_output,                                                                     &
280               syn_turb_gen,                                                                       &
281               urban_surface,                                                                      &
282               vdi_checks,                                                                         &
283               virtual_flight,                                                                     &
284               virtual_measurement,                                                                &
[3766]285               wind_turbine
[3637]286
[3766]287!
[4753]288!-- Load interface routines of all PALM modules
289    USE biometeorology_mod,                                                                        &
290        ONLY:  bio_3d_data_averaging,                                                              &
291               bio_check_data_output,                                                              &
292               bio_data_output_2d,                                                                 &
293               bio_data_output_3d,                                                                 &
294               bio_init,                                                                           &
295               bio_init_checks,                                                                    &
296               bio_header,                                                                         &
297               bio_parin,                                                                          &
298               bio_rrd_global,                                                                     &
299               bio_rrd_local,                                                                      &
300               bio_wrd_global,                                                                     &
[3766]301               bio_wrd_local
[3637]302
[4753]303    USE bulk_cloud_model_mod,                                                                      &
304        ONLY:  bcm_3d_data_averaging,                                                              &
305               bcm_actions,                                                                        &
306               bcm_boundary_conditions,                                                            &
307               bcm_check_data_output_pr,                                                           &
308               bcm_check_data_output,                                                              &
309               bcm_check_parameters,                                                               &
310               bcm_data_output_2d,                                                                 &
311               bcm_data_output_3d,                                                                 &
312               bcm_exchange_horiz,                                                                 &
313               bcm_header,                                                                         &
314               bcm_init_arrays,                                                                    &
315               bcm_init,                                                                           &
316               bcm_non_advective_processes,                                                        &
317               bcm_parin,                                                                          &
318               bcm_prognostic_equations,                                                           &
319               bcm_rrd_global,                                                                     &
320               bcm_rrd_local,                                                                      &
321               bcm_swap_timelevel,                                                                 &
322               bcm_wrd_global,                                                                     &
323               bcm_wrd_local,                                                                      &
324               bulk_cloud_model
[3637]325
[4753]326   USE chemistry_model_mod,                                                                        &
327       ONLY:  chem_3d_data_averaging,                                                              &
328              chem_actions,                                                                        &
329              chem_boundary_conditions,                                                            &
330              chem_check_data_output,                                                              &
331              chem_check_data_output_pr,                                                           &
332              chem_check_parameters,                                                               &
333              chem_data_output_2d,                                                                 &
334              chem_data_output_3d,                                                                 &
335              chem_exchange_horiz_bounds,                                                          &
336              chem_header,                                                                         &
337              chem_init,                                                                           &
338              chem_init_arrays,                                                                    &
339              chem_non_advective_processes,                                                        &
340              chem_parin,                                                                          &
341              chem_prognostic_equations,                                                           &
342              chem_rrd_local,                                                                      &
343              chem_statistics,                                                                     &
344              chem_swap_timelevel,                                                                 &
[3887]345              chem_wrd_local
[4047]346
[4753]347    USE diagnostic_output_quantities_mod,                                                          &
348        ONLY:  doq_3d_data_averaging,                                                              &
349               doq_check_data_output,                                                              &
[4757]350               doq_check_data_output_pr,                                                           &
[4753]351               doq_define_netcdf_grid,                                                             &
352               doq_init,                                                                           &
353               doq_output_2d,                                                                      &
354               doq_output_3d,                                                                      &
[4757]355               doq_statistics,                                                                     &
[4753]356               doq_rrd_local,                                                                      &
[4039]357               doq_wrd_local
[3637]358
[4753]359    USE flight_mod,                                                                                &
360        ONLY:  flight_header,                                                                      &
361               flight_init,                                                                        &
362               flight_parin,                                                                       &
363               flight_rrd_global,                                                                  &
[3766]364               flight_wrd_global
[3637]365
[4753]366    USE gust_mod,                                                                                  &
367        ONLY:  gust_3d_data_averaging,                                                             &
368               gust_actions,                                                                       &
369               gust_check_parameters,                                                              &
370               gust_check_data_output,                                                             &
371               gust_check_data_output_pr,                                                          &
372               gust_data_output_2d,                                                                &
373               gust_data_output_3d,                                                                &
374               gust_header,                                                                        &
375               gust_init,                                                                          &
376               gust_init_arrays,                                                                   &
377               gust_module_enabled,                                                                &
378               gust_parin,                                                                         &
379               gust_prognostic_equations,                                                          &
380               gust_rrd_global,                                                                    &
381               gust_rrd_local,                                                                     &
382               gust_statistics,                                                                    &
383               gust_swap_timelevel,                                                                &
384               gust_wrd_global,                                                                    &
[3766]385               gust_wrd_local
[3637]386
[4753]387    USE indoor_model_mod,                                                                          &
388        ONLY:  im_check_data_output,                                                               &
389               im_check_parameters,                                                                &
390               im_data_output_3d,                                                                  &
391               im_init,                                                                            &
392               im_parin
[4047]393
[4753]394    USE lagrangian_particle_model_mod,                                                             &
395        ONLY:  lpm_actions,                                                                        &
396               lpm_check_parameters,                                                               &
397               lpm_exchange_horiz_bounds,                                                          &
398               lpm_header,                                                                         &
399               lpm_init,                                                                           &
400               lpm_init_arrays,                                                                    &
401               lpm_parin,                                                                          &
402               lpm_rrd_global,                                                                     &
403               lpm_rrd_local,                                                                      &
404               lpm_wrd_local,                                                                      &
[4017]405               lpm_wrd_global
[4047]406
[4753]407    USE land_surface_model_mod,                                                                    &
408        ONLY:  lsm_3d_data_averaging,                                                              &
409               lsm_check_parameters,                                                               &
410               lsm_check_data_output,                                                              &
411               lsm_check_data_output_pr,                                                           &
412               lsm_data_output_2d,                                                                 &
413               lsm_header,                                                                         &
414               lsm_init,                                                                           &
415               lsm_init_arrays,                                                                    &
416               lsm_parin,                                                                          &
417               lsm_rrd_local,                                                                      &
418               lsm_swap_timelevel,                                                                 &
[3766]419               lsm_wrd_local
[3637]420
[4753]421    USE lsf_nudging_mod,                                                                           &
422        ONLY:  lsf_nudging_check_parameters,                                                       &
423               lsf_nudging_check_data_output_pr,                                                   &
424               lsf_nudging_header,                                                                 &
425               lsf_init,                                                                           &
426               nudge_init
[3637]427
[4753]428    USE multi_agent_system_mod,                                                                    &
[3766]429        ONLY:  mas_parin
[3637]430
[4753]431    USE nesting_offl_mod,                                                                          &
432        ONLY:  nesting_offl_check_parameters,                                                      &
433               nesting_offl_header,                                                                &
434               nesting_offl_parin
[3637]435
[4753]436    USE ocean_mod,                                                                                 &
437        ONLY:  ocean_3d_data_averaging,                                                            &
438               ocean_actions,                                                                      &
439               ocean_boundary_conditions,                                                          &
440               ocean_check_parameters,                                                             &
441               ocean_check_data_output,                                                            &
442               ocean_check_data_output_pr,                                                         &
443               ocean_data_output_2d,                                                               &
444               ocean_data_output_3d,                                                               &
445               ocean_exchange_horiz,                                                               &
446               ocean_init_arrays,                                                                  &
447               ocean_init,                                                                         &
448               ocean_header,                                                                       &
449               ocean_parin,                                                                        &
450               ocean_prognostic_equations,                                                         &
451               ocean_rrd_global,                                                                   &
452               ocean_rrd_local,                                                                    &
453               ocean_swap_timelevel,                                                               &
454               ocean_wrd_global,                                                                   &
[3766]455               ocean_wrd_local
[4047]456
[4753]457    USE particle_attributes,                                                                       &
[4047]458        ONLY:  particle_advection
[3637]459
[4753]460    USE poismg_noopt_mod,                                                                          &
[4414]461        ONLY:  poismg_noopt_init
462
[4753]463    USE plant_canopy_model_mod,                                                                    &
464         ONLY: pcm_3d_data_averaging,                                                              &
465               pcm_check_parameters,                                                               &
466               pcm_check_data_output,                                                              &
467               pcm_data_output_3d,                                                                 &
468               pcm_header,                                                                         &
469               pcm_init,                                                                           &
470               pcm_parin,                                                                          &
471               pcm_rrd_global,                                                                     &
472               pcm_rrd_local,                                                                      &
473               pcm_wrd_global,                                                                     &
[4360]474               pcm_wrd_local
[3637]475
[4753]476    USE radiation_model_mod,                                                                       &
477        ONLY:  radiation,                                                                          &
478               radiation_3d_data_averaging,                                                        &
479               radiation_check_parameters,                                                         &
480               radiation_check_data_output,                                                        &
481               radiation_check_data_output_pr,                                                     &
482               radiation_check_data_output_ts,                                                     &
483               radiation_data_output_2d,                                                           &
484               radiation_data_output_3d,                                                           &
485               radiation_header,                                                                   &
486               radiation_init,                                                                     &
487               radiation_parin,                                                                    &
488               radiation_rrd_local,                                                                &
[3766]489               radiation_wrd_local
[3637]490
[4753]491    USE salsa_mod,                                                                                 &
492        ONLY:  salsa_3d_data_averaging,                                                            &
493               salsa_actions,                                                                      &
494               salsa_boundary_conditions,                                                          &
495               salsa_check_data_output,                                                            &
496               salsa_check_data_output_pr,                                                         &
497               salsa_check_parameters,                                                             &
498               salsa_data_output_2d,                                                               &
499               salsa_data_output_3d,                                                               &
500               salsa_exchange_horiz_bounds,                                                        &
501               salsa_header,                                                                       &
502               salsa_init,                                                                         &
503               salsa_init_arrays,                                                                  &
504               salsa_non_advective_processes,                                                      &
505               salsa_parin,                                                                        &
506               salsa_prognostic_equations,                                                         &
507               salsa_rrd_global,                                                                   &
508               salsa_rrd_local,                                                                    &
509               salsa_statistics,                                                                   &
510               salsa_swap_timelevel,                                                               &
511               salsa_wrd_global,                                                                   &
[3766]512               salsa_wrd_local
[3637]513
[4753]514    USE spectra_mod,                                                                               &
515        ONLY:  calculate_spectra,                                                                  &
516               spectra_check_parameters,                                                           &
517               spectra_header,                                                                     &
518               spectra_parin
[3637]519
[4753]520    USE surface_data_output_mod,                                                                   &
521        ONLY:  surface_data_output_check_parameters,                                               &
522               surface_data_output_init_arrays,                                                    &
523               surface_data_output_parin,                                                          &
524               surface_data_output_rrd_global,                                                     &
525               surface_data_output_rrd_local,                                                      &
526               surface_data_output_wrd_global,                                                     &
527               surface_data_output_wrd_local
[3637]528
[4753]529    USE surface_mod,                                                                               &
[4414]530        ONLY:  init_bc
531
[4753]532    USE synthetic_turbulence_generator_mod,                                                        &
533        ONLY:  stg_check_parameters,                                                               &
534               stg_header,                                                                         &
535               stg_parin,                                                                          &
536               stg_rrd_global,                                                                     &
[3766]537               stg_wrd_global
[3637]538
[4753]539    USE urban_surface_mod,                                                                         &
540        ONLY:  usm_3d_data_averaging,                                                              &
541               usm_check_data_output,                                                              &
542               usm_check_parameters,                                                               &
543               usm_init,                                                                           &
544               usm_init_arrays,                                                                    &
545               usm_parin,                                                                          &
546               usm_swap_timelevel,                                                                 &
547               usm_rrd_local,                                                                      &
[3766]548               usm_wrd_local
[3637]549
[4753]550    USE vdi_internal_controls,                                                                     &
[4173]551        ONLY:  vdi_actions
[4753]552
553    USE virtual_measurement_mod,                                                                   &
554        ONLY:  vm_check_parameters,                                                                &
555               vm_init,                                                                            &
556               vm_init_output,                                                                     &
[4047]557               vm_parin
558
[4753]559    USE wind_turbine_model_mod,                                                                    &
560        ONLY:  wtm_actions,                                                                        &
561               wtm_check_parameters,                                                               &
562               wtm_init,                                                                           &
563               wtm_init_arrays,                                                                    &
564               wtm_init_output,                                                                    &
565               wtm_parin,                                                                          &
566               wtm_rrd_global,                                                                     &
[4047]567               wtm_wrd_global
568
[4753]569    USE user,                                                                                      &
570        ONLY:  user_3d_data_averaging,                                                             &
571               user_actions,                                                                       &
572               user_check_data_output,                                                             &
573               user_check_data_output_pr,                                                          &
574               user_check_data_output_ts,                                                          &
575               user_check_parameters,                                                              &
576               user_data_output_2d,                                                                &
577               user_data_output_3d,                                                                &
578               user_header,                                                                        &
579               user_init,                                                                          &
580               user_init_arrays,                                                                   &
581               user_last_actions,                                                                  &
582               user_module_enabled,                                                                &
583               user_parin,                                                                         &
584               user_statistics,                                                                    &
585               user_rrd_global,                                                                    &
586               user_rrd_local,                                                                     &
587               user_wrd_global,                                                                    &
588               user_wrd_local
[3684]589
[3766]590    IMPLICIT NONE
[3637]591
[3766]592    PRIVATE
[3637]593
594!
[3766]595!-- Public functions
[4753]596    PUBLIC                                                                                         &
597       module_interface_parin,                                                                     &
598       module_interface_check_parameters,                                                          &
599       module_interface_check_data_output_ts,                                                      &
600       module_interface_check_data_output_pr,                                                      &
601       module_interface_check_data_output,                                                         &
602       module_interface_init_masks,                                                                &
603       module_interface_define_netcdf_grid,                                                        &
604       module_interface_init_arrays,                                                               &
605       module_interface_init,                                                                      &
606       module_interface_init_checks,                                                               &
607       module_interface_init_numerics,                                                             &
608       module_interface_init_output,                                                               &
609       module_interface_header,                                                                    &
610       module_interface_actions,                                                                   &
611       module_interface_non_advective_processes,                                                   &
612       module_interface_exchange_horiz,                                                            &
613       module_interface_prognostic_equations,                                                      &
614       module_interface_boundary_conditions,                                                       &
615       module_interface_swap_timelevel,                                                            &
616       module_interface_3d_data_averaging,                                                         &
617       module_interface_data_output_2d,                                                            &
618       module_interface_data_output_3d,                                                            &
619       module_interface_statistics,                                                                &
620       module_interface_rrd_global,                                                                &
621       module_interface_wrd_global,                                                                &
622       module_interface_rrd_local,                                                                 &
623       module_interface_wrd_local,                                                                 &
[3766]624       module_interface_last_actions
[3637]625
626
[3766]627    INTERFACE module_interface_parin
628       MODULE PROCEDURE module_interface_parin
629    END INTERFACE module_interface_parin
[3637]630
[3766]631    INTERFACE module_interface_check_parameters
632       MODULE PROCEDURE module_interface_check_parameters
633    END INTERFACE module_interface_check_parameters
[3637]634
[3766]635    INTERFACE module_interface_check_data_output_ts
636       MODULE PROCEDURE module_interface_check_data_output_ts
637    END INTERFACE module_interface_check_data_output_ts
[3700]638
[3766]639    INTERFACE module_interface_check_data_output_pr
640       MODULE PROCEDURE module_interface_check_data_output_pr
641    END INTERFACE module_interface_check_data_output_pr
[3637]642
[3766]643    INTERFACE module_interface_check_data_output
644       MODULE PROCEDURE module_interface_check_data_output
645    END INTERFACE module_interface_check_data_output
[3637]646
[3766]647    INTERFACE module_interface_init_masks
648       MODULE PROCEDURE module_interface_init_masks
649    END INTERFACE module_interface_init_masks
[3687]650
[3766]651    INTERFACE module_interface_define_netcdf_grid
652       MODULE PROCEDURE module_interface_define_netcdf_grid
653    END INTERFACE module_interface_define_netcdf_grid
[3637]654
[3766]655    INTERFACE module_interface_init_arrays
656       MODULE PROCEDURE module_interface_init_arrays
657    END INTERFACE module_interface_init_arrays
[3637]658
[3766]659    INTERFACE module_interface_init
660       MODULE PROCEDURE module_interface_init
661    END INTERFACE module_interface_init
[3637]662
[3766]663    INTERFACE module_interface_init_checks
664       MODULE PROCEDURE module_interface_init_checks
665    END INTERFACE module_interface_init_checks
[3711]666
[4414]667    INTERFACE module_interface_init_numerics
668       MODULE PROCEDURE module_interface_init_numerics
669    END INTERFACE module_interface_init_numerics
670
[4400]671    INTERFACE module_interface_init_output
672       MODULE PROCEDURE module_interface_init_output
673    END INTERFACE module_interface_init_output
674
[3766]675    INTERFACE module_interface_header
676       MODULE PROCEDURE module_interface_header
677    END INTERFACE module_interface_header
[3637]678
[3766]679    INTERFACE module_interface_actions
680       MODULE PROCEDURE module_interface_actions
681       MODULE PROCEDURE module_interface_actions_ij
682    END INTERFACE module_interface_actions
[3637]683
[3931]684    INTERFACE module_interface_non_advective_processes
685       MODULE PROCEDURE module_interface_non_advective_processes
686       MODULE PROCEDURE module_interface_non_advective_processes_ij
687    END INTERFACE module_interface_non_advective_processes
[4047]688
[3887]689    INTERFACE module_interface_exchange_horiz
690       MODULE PROCEDURE module_interface_exchange_horiz
691    END INTERFACE module_interface_exchange_horiz
[4047]692
[3837]693    INTERFACE module_interface_prognostic_equations
694       MODULE PROCEDURE module_interface_prognostic_equations
695       MODULE PROCEDURE module_interface_prognostic_equations_ij
696    END INTERFACE module_interface_prognostic_equations
697
[3766]698    INTERFACE module_interface_swap_timelevel
699       MODULE PROCEDURE module_interface_swap_timelevel
700    END INTERFACE module_interface_swap_timelevel
[3637]701
[4268]702    INTERFACE module_interface_boundary_conditions
703       MODULE PROCEDURE module_interface_boundary_conditions
704    END INTERFACE module_interface_boundary_conditions
705
[3766]706    INTERFACE module_interface_3d_data_averaging
707       MODULE PROCEDURE module_interface_3d_data_averaging
708    END INTERFACE module_interface_3d_data_averaging
[3637]709
[3766]710    INTERFACE module_interface_data_output_2d
711       MODULE PROCEDURE module_interface_data_output_2d
712    END INTERFACE module_interface_data_output_2d
[3637]713
[3766]714    INTERFACE module_interface_data_output_3d
715       MODULE PROCEDURE module_interface_data_output_3d
716    END INTERFACE module_interface_data_output_3d
[3637]717
[3766]718    INTERFACE module_interface_statistics
719       MODULE PROCEDURE module_interface_statistics
720    END INTERFACE module_interface_statistics
[3637]721
[3766]722    INTERFACE module_interface_rrd_global
[4495]723       MODULE PROCEDURE module_interface_rrd_global_ftn
724       MODULE PROCEDURE module_interface_rrd_global_mpi
[3766]725    END INTERFACE module_interface_rrd_global
[3637]726
[3766]727    INTERFACE module_interface_wrd_global
728       MODULE PROCEDURE module_interface_wrd_global
729    END INTERFACE module_interface_wrd_global
[3637]730
[3766]731    INTERFACE module_interface_rrd_local
[4517]732       MODULE PROCEDURE module_interface_rrd_local_ftn
733       MODULE PROCEDURE module_interface_rrd_local_mpi
[3766]734    END INTERFACE module_interface_rrd_local
[3637]735
[3766]736    INTERFACE module_interface_wrd_local
737       MODULE PROCEDURE module_interface_wrd_local
738    END INTERFACE module_interface_wrd_local
[3637]739
[3766]740    INTERFACE module_interface_last_actions
741       MODULE PROCEDURE module_interface_last_actions
742    END INTERFACE module_interface_last_actions
[3637]743
[3687]744
[3766]745 CONTAINS
[3637]746
747
[4753]748!--------------------------------------------------------------------------------------------------!
[3637]749! Description:
750! ------------
751!> Read module-specific parameter namelists
[4753]752!------------------------------------------------------------------------------                    !
[3766]753 SUBROUTINE module_interface_parin
[3637]754
755
[3987]756    IF ( debug_output )  CALL debug_message( 'reading module-specific parameters', 'start' )
757
[4047]758    CALL dynamics_parin
759
[3766]760    CALL bio_parin
761    CALL bcm_parin
762    CALL chem_parin
763    CALL flight_parin ! ToDo: rename module to match filename
764    CALL gust_parin
765    CALL im_parin
[4047]766    CALL lpm_parin
[3766]767    CALL lsm_parin
768    ! ToDo: create parin routine for large_scale_forcing and nudging (should be seperate modules or new module switch)
769    CALL mas_parin
770    CALL nesting_offl_parin
771    CALL ocean_parin
772    CALL pcm_parin
773    CALL radiation_parin
774    CALL salsa_parin
775    CALL spectra_parin
776    CALL surface_data_output_parin
777    CALL stg_parin
778    CALL usm_parin
779    CALL vm_parin
780    CALL wtm_parin
[3637]781
[4047]782    CALL user_parin
783
[3987]784    IF ( debug_output )  CALL debug_message( 'reading module-specific parameters', 'end' )
[3637]785
[3987]786
[3766]787 END SUBROUTINE module_interface_parin
[3637]788
789
[4753]790!--------------------------------------------------------------------------------------------------!
[3637]791! Description:
792! ------------
793!> Perform module-specific initialization checks
[4753]794!--------------------------------------------------------------------------------------------------!
[3766]795 SUBROUTINE module_interface_check_parameters
[3637]796
797
[3987]798    IF ( debug_output )  CALL debug_message( 'checking module-specific parameters', 'start' )
799
[4047]800    CALL dynamics_check_parameters
[4048]801    CALL tcm_check_parameters
[4047]802
[3766]803    IF ( bulk_cloud_model )     CALL bcm_check_parameters
804    IF ( air_chemistry )        CALL chem_check_parameters
805    IF ( gust_module_enabled )  CALL gust_check_parameters
806    IF ( indoor_model )         CALL im_check_parameters
[4047]807    IF ( particle_advection )   CALL lpm_check_parameters
[3766]808    IF ( land_surface )         CALL lsm_check_parameters
809    IF ( large_scale_forcing  .OR.  nudging )  CALL lsf_nudging_check_parameters ! ToDo: create single module switch
810    IF ( nesting_offline )      CALL nesting_offl_check_parameters
811    IF ( ocean_mode )           CALL ocean_check_parameters
812    IF ( plant_canopy )         CALL pcm_check_parameters
813    IF ( radiation )            CALL radiation_check_parameters
814    IF ( salsa )                CALL salsa_check_parameters
815    IF ( calculate_spectra )    CALL spectra_check_parameters
816    IF ( surface_output )       CALL surface_data_output_check_parameters
817    IF ( syn_turb_gen )         CALL stg_check_parameters
818    IF ( urban_surface )        CALL usm_check_parameters
819    IF ( virtual_measurement )  CALL vm_check_parameters
820    IF ( wind_turbine )         CALL wtm_check_parameters
[4047]821
[3766]822    IF ( user_module_enabled )  CALL user_check_parameters
[3637]823
[3987]824    IF ( debug_output )  CALL debug_message( 'checking module-specific parameters', 'end' )
[3637]825
[3987]826
[3766]827 END SUBROUTINE module_interface_check_parameters
[3637]828
829
[4753]830!--------------------------------------------------------------------------------------------------!
[3637]831! Description:
832! ------------
[3700]833!> Check module-specific data output of timeseries
[4753]834!--------------------------------------------------------------------------------------------------!
[3766]835 SUBROUTINE module_interface_check_data_output_ts( dots_max, dots_num, dots_label, dots_unit )
[3700]836
[4753]837    INTEGER(iwp),      INTENT(IN)       ::  dots_max !< variable output array index
838    INTEGER(iwp),      INTENT(INOUT)    ::  dots_num !< variable output array index
[3700]839
[3766]840    CHARACTER (LEN=*), DIMENSION(dots_max), INTENT(INOUT) :: dots_label
841    CHARACTER (LEN=*), DIMENSION(dots_max), INTENT(INOUT) :: dots_unit
[3700]842
843
[3987]844    IF ( debug_output )  CALL debug_message( 'checking module-specific data output ts', 'start' )
845
[4047]846    CALL dynamics_check_data_output_ts( dots_max, dots_num, dots_label, dots_unit )
847
[3766]848    IF ( radiation )  THEN
[3769]849       CALL radiation_check_data_output_ts( dots_max, dots_num )
[3766]850    ENDIF
[3700]851
[3766]852    IF ( user_module_enabled )  THEN
853       CALL user_check_data_output_ts( dots_max, dots_num, dots_label, dots_unit )
854    ENDIF
[3700]855
[3987]856    IF ( debug_output )  CALL debug_message( 'checking module-specific data output ts', 'end' )
[3700]857
[3987]858
[3766]859 END SUBROUTINE module_interface_check_data_output_ts
[3700]860
861
[4753]862!--------------------------------------------------------------------------------------------------!
[3700]863! Description:
864! ------------
[3637]865!> Check module-specific data output of profiles
[4753]866!--------------------------------------------------------------------------------------------------!
867 SUBROUTINE module_interface_check_data_output_pr( variable, var_count, unit, dopr_unit )
[3637]868
869
[3766]870    CHARACTER (LEN=*), INTENT(IN)    ::  variable  !< variable name
871    CHARACTER (LEN=*), INTENT(INOUT) ::  unit      !< physical unit of variable
872    CHARACTER (LEN=*), INTENT(OUT)   ::  dopr_unit !< local value of dopr_unit
[3637]873
[4753]874    INTEGER(iwp),      INTENT(IN)    ::  var_count !< variable output array index
[3987]875
[4753]876
[3987]877    IF ( debug_output )  CALL debug_message( 'checking module-specific data output pr', 'start' )
878
[4047]879    CALL dynamics_check_data_output_pr( variable, var_count, unit, dopr_unit )
[4757]880    CALL doq_check_data_output_pr( variable, var_count, unit, dopr_unit )
[4047]881
[4753]882    IF ( unit == 'illegal'  .AND.  bulk_cloud_model )  THEN
[3766]883       CALL bcm_check_data_output_pr( variable, var_count, unit, dopr_unit )
884    ENDIF
[3637]885
[4753]886    IF ( unit == 'illegal'  .AND.  air_chemistry )  THEN
[3766]887       CALL chem_check_data_output_pr( variable, var_count, unit, dopr_unit )
888    ENDIF
[3637]889
[3766]890    IF ( unit == 'illegal'  .AND.  gust_module_enabled  )  THEN
891       CALL gust_check_data_output_pr( variable, var_count, unit, dopr_unit )
892    ENDIF
[3637]893
[3766]894    IF ( unit == 'illegal' )  THEN ! ToDo: add module switch if possible
895       CALL lsm_check_data_output_pr( variable, var_count, unit, dopr_unit )
896    ENDIF
[3637]897
[3766]898    IF ( unit == 'illegal' )  THEN ! ToDo: add module switch if possible
899       CALL lsf_nudging_check_data_output_pr( variable, var_count, unit, dopr_unit )
900    ENDIF
[3637]901
[3766]902    IF ( unit == 'illegal'  .AND.  ocean_mode )  THEN
903       CALL ocean_check_data_output_pr( variable, var_count, unit, dopr_unit )
904    ENDIF
[3637]905
[3766]906    IF ( unit == 'illegal'  .AND.  radiation )  THEN
907       CALL radiation_check_data_output_pr( variable, var_count, unit, dopr_unit )
908    ENDIF
[3637]909
[4131]910    IF ( unit == 'illegal'  .AND.  salsa )  THEN
911       CALL salsa_check_data_output_pr( variable, var_count, unit, dopr_unit )
912    ENDIF
913
[3766]914    IF ( unit == 'illegal'  .AND.  user_module_enabled )  THEN
915       unit = '' ! ToDo: Seems like a hack. Find a general soultion!
916       CALL user_check_data_output_pr( variable, var_count, unit, dopr_unit )
917    ENDIF
[3637]918
[3987]919    IF ( debug_output )  CALL debug_message( 'checking module-specific data output pr', 'end' )
[3637]920
[3987]921
[3766]922 END SUBROUTINE module_interface_check_data_output_pr
[3637]923
[4753]924!--------------------------------------------------------------------------------------------------!
[3637]925! Description:
926! ------------
927!> Check module-specific 2D and 3D data output
[4753]928!--------------------------------------------------------------------------------------------------!
[3766]929 SUBROUTINE module_interface_check_data_output( variable, unit, i, j, ilen, k )
[3637]930
931
[3766]932    CHARACTER (LEN=*), INTENT(IN)    ::  variable !< variable name
933    CHARACTER (LEN=*), INTENT(INOUT) ::  unit     !< physical unit of variable
[3637]934
[3766]935    INTEGER(iwp),      INTENT(IN)    :: i         !< ToDo: remove dummy argument, instead pass string from data_output
936    INTEGER(iwp),      INTENT(IN)    :: j         !< average quantity? 0 = no, 1 = yes
937    INTEGER(iwp),      INTENT(IN)    :: ilen      !< ToDo: remove dummy argument, instead pass string from data_output
938    INTEGER(iwp),      INTENT(IN)    :: k         !< ToDo: remove dummy argument, instead pass string from data_output
[3637]939
[3987]940
941    IF ( debug_output )  CALL debug_message( 'checking module-specific data output 2d/3d', 'start' )
942
[4047]943    CALL dynamics_check_data_output( variable, unit )
944
[4048]945    CALL tcm_check_data_output( variable, unit )
946
[3766]947    IF ( unit == 'illegal'  .AND.  biometeorology )  THEN
948       CALL bio_check_data_output( variable, unit, i, j, ilen, k )
949    ENDIF
[3637]950
[3766]951    IF ( unit == 'illegal'  .AND.  bulk_cloud_model  )  THEN
952       CALL bcm_check_data_output( variable, unit )
953    ENDIF
[3637]954
[4753]955    IF ( unit == 'illegal'  .AND.  air_chemistry  .AND.  (variable(1:3) == 'kc_'  .OR.             &
956         variable(1:3) == 'em_') )  THEN  ! ToDo: remove aditional conditions
[3766]957       CALL chem_check_data_output( variable, unit, i, ilen, k )
958    ENDIF
[4047]959
[4039]960    IF ( unit == 'illegal' )  THEN
[4331]961       CALL doq_check_data_output( variable, unit, i, ilen, k )
[4039]962    ENDIF
[3637]963
[3766]964    IF ( unit == 'illegal'  .AND.  gust_module_enabled  )  THEN
965       CALL gust_check_data_output( variable, unit )
966    ENDIF
[3637]967
[3766]968    IF ( unit == 'illegal' )  THEN  ! ToDo: add module switch if possible
969       CALL lsm_check_data_output( variable, unit, i, ilen, k )
970    ENDIF
[3637]971
[3766]972    IF ( unit == 'illegal'  .AND.  ocean_mode )  THEN
973       CALL ocean_check_data_output( variable, unit )
974    ENDIF
[3637]975
[4753]976    IF ( unit == 'illegal'  .AND.  plant_canopy  .AND.  variable(1:4) == 'pcm_' )  THEN  ! ToDo: remove aditional conditions
[3766]977       CALL pcm_check_data_output( variable, unit )
978    ENDIF
[3637]979
[3766]980    IF ( unit == 'illegal'  .AND.  radiation )  THEN
981       CALL radiation_check_data_output( variable, unit, i, ilen, k )
982    ENDIF
[3637]983
[3766]984    IF ( unit == 'illegal' .AND. salsa ) THEN
[3637]985       CALL salsa_check_data_output( variable, unit )
[3766]986    ENDIF
[3637]987
[3766]988    IF ( unit == 'illegal' .AND. indoor_model ) THEN
[3744]989       CALL im_check_data_output( variable, unit )
[3766]990    ENDIF
[4047]991
[4753]992    IF ( unit == 'illegal'  .AND.  urban_surface  .AND.  variable(1:4) == 'usm_' )  THEN  ! ToDo: remove aditional conditions
[3637]993       CALL usm_check_data_output( variable, unit )
[3766]994    ENDIF
[3637]995
[3766]996    IF ( unit == 'illegal'  .AND.  user_module_enabled )  THEN
997       unit = ''
998       CALL user_check_data_output( variable, unit )
999    ENDIF
[3637]1000
[3987]1001    IF ( debug_output )  CALL debug_message( 'checking module-specific data output 2d/3d', 'end' )
[3637]1002
[3987]1003
[3766]1004 END SUBROUTINE module_interface_check_data_output
[3637]1005
1006
[4753]1007!--------------------------------------------------------------------------------------------------!
[3637]1008!
1009! Description:
1010! ------------
[3687]1011!> Interface for init_masks. ToDo: get rid of these redundant calls!
[4753]1012!--------------------------------------------------------------------------------------------------!
[3766]1013 SUBROUTINE module_interface_init_masks( variable, unit )
[3687]1014
1015
[3766]1016    CHARACTER (LEN=*), INTENT(IN)    ::  variable !< variable name
1017    CHARACTER (LEN=*), INTENT(INOUT) ::  unit     !< physical unit of variable
[3687]1018
[3987]1019
1020    IF ( debug_output )  CALL debug_message( 'initializing module-specific masks', 'start' )
1021
[4047]1022    CALL dynamics_init_masks( variable, unit )
1023
[4753]1024    IF ( unit == 'illegal'  .AND.  air_chemistry  .AND.  (variable(1:3) == 'kc_'  .OR.             &
1025         variable(1:3) == 'em_') )  THEN  ! ToDo: remove aditional conditions
[3766]1026       CALL chem_check_data_output( variable, unit, 0, 0, 0 )
1027    ENDIF
[4753]1028
[4132]1029    IF ( unit == 'illegal' )  THEN
1030       CALL doq_check_data_output( variable, unit )
1031    ENDIF
[3687]1032
[3766]1033    IF ( unit == 'illegal'  .AND.  radiation )  THEN
1034       CALL radiation_check_data_output( variable, unit, 0, 0, 0 )
1035    ENDIF
[3687]1036
[3766]1037    IF ( unit == 'illegal'  .AND.  salsa )  THEN
1038       CALL salsa_check_data_output( variable, unit )
1039    ENDIF
[3687]1040
[3766]1041    IF ( unit == 'illegal'  .AND.  user_module_enabled )  THEN
1042       unit = ''
1043       CALL user_check_data_output( variable, unit )
1044    ENDIF
[3687]1045
[3987]1046    IF ( debug_output )  CALL debug_message( 'initializing module-specific masks', 'end' )
[3687]1047
[3987]1048
[3766]1049 END SUBROUTINE module_interface_init_masks
[3687]1050
1051
[4753]1052!--------------------------------------------------------------------------------------------------!
[3687]1053!
1054! Description:
1055! ------------
[3637]1056!> Define appropriate grid for module-specific netcdf output variables.
[4753]1057!--------------------------------------------------------------------------------------------------!
1058 SUBROUTINE module_interface_define_netcdf_grid( var, found, grid_x, grid_y, grid_z )
[3637]1059
1060
[3766]1061    CHARACTER (LEN=*), INTENT(IN)  ::  var    !< variable name
1062    CHARACTER (LEN=*), INTENT(OUT) ::  grid_x !< netcdf dimension in x-direction
1063    CHARACTER (LEN=*), INTENT(OUT) ::  grid_y !< netcdf dimension in y-direction
1064    CHARACTER (LEN=*), INTENT(OUT) ::  grid_z !< netcdf dimension in z-direction
[3987]1065
[4753]1066    LOGICAL,           INTENT(OUT) ::  found  !< indicates if variable was found
[3987]1067
[4753]1068
[3987]1069    IF ( debug_output )  CALL debug_message( 'defining module-specific netcdf grids', 'start' )
[3649]1070!
[4753]1071!-- As long as no action is done in this subroutine, initialize strings with intent(out) attribute,
1072!-- in order to avoid compiler warnings.
[3766]1073    found  = .FALSE.
1074    grid_x = 'none'
1075    grid_y = 'none'
1076    grid_z = 'none'
1077!
1078!-- Use var to avoid compiler warning about unused variable
1079    IF ( var == ' ' )  RETURN
[3637]1080
[3987]1081    IF ( debug_output )  CALL debug_message( 'defining module-specific netcdf grids', 'end' )
1082
1083
[3766]1084 END SUBROUTINE module_interface_define_netcdf_grid
[3637]1085
1086
[4753]1087!--------------------------------------------------------------------------------------------------!
[3637]1088! Description:
1089! ------------
1090!> Allocate module-specific arrays and pointers
[4753]1091!--------------------------------------------------------------------------------------------------!
[3766]1092 SUBROUTINE module_interface_init_arrays
[3637]1093
1094
[3987]1095    IF ( debug_output )  CALL debug_message( 'initializing module-specific arrays', 'start' )
[3885]1096
[4047]1097    CALL dynamics_init_arrays
[4048]1098    CALL tcm_init_arrays
[4047]1099
[3766]1100    IF ( bulk_cloud_model    )  CALL bcm_init_arrays
1101    IF ( air_chemistry       )  CALL chem_init_arrays
1102    IF ( gust_module_enabled )  CALL gust_init_arrays
[4047]1103    IF ( particle_advection  )  CALL lpm_init_arrays
[3766]1104    IF ( land_surface        )  CALL lsm_init_arrays
1105    IF ( ocean_mode          )  CALL ocean_init_arrays
1106    IF ( salsa               )  CALL salsa_init_arrays
1107    IF ( urban_surface       )  CALL usm_init_arrays
1108    IF ( surface_output      )  CALL surface_data_output_init_arrays
1109    IF ( wind_turbine        )  CALL wtm_init_arrays
[4047]1110
[3766]1111    IF ( user_module_enabled )  CALL user_init_arrays
[3685]1112
[3987]1113    IF ( debug_output )  CALL debug_message( 'initializing module-specific arrays', 'end' )
[3685]1114
[3885]1115
[3766]1116 END SUBROUTINE module_interface_init_arrays
[3637]1117
1118
[4753]1119!--------------------------------------------------------------------------------------------------!
[3637]1120! Description:
1121! ------------
1122!> Perform module-specific initialization
[4753]1123!--------------------------------------------------------------------------------------------------!
[3766]1124 SUBROUTINE module_interface_init
[3637]1125
1126
[3987]1127    IF ( debug_output )  CALL debug_message( 'module-specific initialization', 'start' )
[3885]1128
[4047]1129    CALL dynamics_init
[4048]1130    CALL tcm_init
[4047]1131
[3766]1132    IF ( biometeorology      )  CALL bio_init
1133    IF ( bulk_cloud_model    )  CALL bcm_init
1134    IF ( air_chemistry       )  CALL chem_init
1135    IF ( virtual_flight      )  CALL flight_init
1136    IF ( gust_module_enabled )  CALL gust_init
1137    IF ( indoor_model        )  CALL im_init
[4047]1138    IF ( particle_advection  )  CALL lpm_init
[3766]1139    IF ( large_scale_forcing )  CALL lsf_init
1140    IF ( land_surface        )  CALL lsm_init
1141    IF ( nudging             )  CALL nudge_init
1142    IF ( ocean_mode          )  CALL ocean_init
1143    IF ( plant_canopy        )  CALL pcm_init
1144    IF ( salsa               )  CALL salsa_init
1145    IF ( urban_surface       )  CALL usm_init
1146    IF ( virtual_measurement )  CALL vm_init
1147    IF ( wind_turbine        )  CALL wtm_init
1148    IF ( radiation           )  CALL radiation_init
[4047]1149
[4157]1150    CALL doq_init
1151
[3766]1152    IF ( user_module_enabled )  CALL user_init
[3685]1153
[3987]1154    IF ( debug_output )  CALL debug_message( 'module-specific initialization', 'end' )
[3685]1155
[3766]1156 END SUBROUTINE module_interface_init
[3637]1157
[4753]1158!--------------------------------------------------------------------------------------------------!
[4400]1159! Description:
1160! ------------
[4414]1161!> Initialize boundary conditions and numerical schemes.
[4753]1162!--------------------------------------------------------------------------------------------------!
[4414]1163 SUBROUTINE module_interface_init_numerics
1164
1165!
1166!-- Initialize boundary conditions via surface type
1167    CALL init_bc
1168!
1169!-- Calculate wall flag arrays for the multigrid method.
1170!-- Please note, wall flags are only applied in the non-optimized version.
1171    CALL poismg_noopt_init
[4753]1172
[4414]1173 END SUBROUTINE module_interface_init_numerics
1174
[4753]1175
1176!--------------------------------------------------------------------------------------------------!
[4414]1177! Description:
1178! ------------
[4400]1179!> Initialize data output
[4753]1180!--------------------------------------------------------------------------------------------------!
[4400]1181 SUBROUTINE module_interface_init_output
[3637]1182
[4400]1183    INTEGER(iwp) ::  return_value  !< returned status value of called function
1184
1185!
1186!-- Initialize data-output module
[4753]1187    CALL dom_init( file_suffix_of_output_group=coupling_char,                                      &
1188                   mpi_comm_of_output_group=comm2d,                                                &
1189                   program_debug_output_unit=9,                                                    &
[4400]1190                   debug_output=debug_output )
1191!
1192!-- Define module-specific output quantities
1193    IF ( virtual_measurement )  CALL vm_init_output
[4411]1194    IF ( wind_turbine )         CALL wtm_init_output
[4400]1195!
1196!-- Leave output-definition state
1197    return_value = dom_def_end()
1198
1199 END SUBROUTINE module_interface_init_output
1200
[4753]1201!--------------------------------------------------------------------------------------------------!
[3637]1202! Description:
1203! ------------
[3711]1204!> Perform module-specific post-initialization checks
[4753]1205!--------------------------------------------------------------------------------------------------!
[3766]1206 SUBROUTINE module_interface_init_checks
[3711]1207
1208
[3987]1209    IF ( debug_output )  CALL debug_message( 'module-specific post-initialization checks', 'start' )
1210
[4047]1211    CALL dynamics_init_checks
1212
[4753]1213    IF ( biometeorology )  CALL bio_init_checks
[3711]1214
[3987]1215    IF ( debug_output )  CALL debug_message( 'module-specific post-initialization checks', 'end' )
[3711]1216
[3987]1217
[3766]1218 END SUBROUTINE module_interface_init_checks
[3711]1219
1220
[4753]1221!--------------------------------------------------------------------------------------------------!
[3711]1222! Description:
1223! ------------
[3637]1224!> Gather module-specific header output
[4753]1225!--------------------------------------------------------------------------------------------------!
[3766]1226 SUBROUTINE module_interface_header( io )
[3637]1227
1228
[3766]1229    INTEGER(iwp), INTENT(IN) ::  io  !< unit of the output file
[3637]1230
1231
[3987]1232    IF ( debug_output )  CALL debug_message( 'module-specific header output', 'start' )
1233
[4047]1234    CALL dynamics_header( io )
1235
[3766]1236    IF ( biometeorology      )  CALL bio_header ( io )
1237    IF ( bulk_cloud_model    )  CALL bcm_header( io )
1238    IF ( air_chemistry       )  CALL chem_header ( io )
1239    IF ( virtual_flight      )  CALL flight_header( io )
1240    IF ( gust_module_enabled )  CALL gust_header( io )
[4047]1241    IF ( particle_advection  )  CALL lpm_header( io )
[3766]1242    IF ( land_surface        )  CALL lsm_header( io )
1243    IF ( large_scale_forcing )  CALL lsf_nudging_header( io )
1244    IF ( nesting_offline     )  CALL nesting_offl_header( io )
1245    IF ( ocean_mode          )  CALL ocean_header( io )
1246    IF ( plant_canopy        )  CALL pcm_header( io )
1247    IF ( radiation           )  CALL radiation_header( io )
1248    IF ( salsa               )  CALL salsa_header( io )
1249    IF ( calculate_spectra   )  CALL spectra_header( io )
1250    IF ( syn_turb_gen        )  CALL stg_header( io )
[4047]1251
[3766]1252    IF ( user_module_enabled )  CALL user_header( io )
[3637]1253
[3987]1254    IF ( debug_output )  CALL debug_message( 'module-specific header output', 'end' )
[3637]1255
[3987]1256
[3766]1257 END SUBROUTINE module_interface_header
[3637]1258
1259
[4753]1260!--------------------------------------------------------------------------------------------------!
[3637]1261! Description:
1262! ------------
[3874]1263!> Perform module-specific actions while in time-integration (vector-optimized)
[4753]1264!--------------------------------------------------------------------------------------------------!
[3766]1265 SUBROUTINE module_interface_actions( location )
[3637]1266
1267
[3766]1268    CHARACTER (LEN=*), INTENT(IN) ::  location !< call location string
[3637]1269
[4047]1270    CALL dynamics_actions( location )
[4048]1271    CALL tcm_actions( location )
[3637]1272
[3870]1273    IF ( bulk_cloud_model    )  CALL bcm_actions( location )
[3877]1274    IF ( air_chemistry       )  CALL chem_actions( location )
[3766]1275    IF ( gust_module_enabled )  CALL gust_actions( location )
[4047]1276    IF ( particle_advection  )  CALL lpm_actions( location )
[3873]1277    IF ( ocean_mode          )  CALL ocean_actions( location )
[3871]1278    IF ( salsa               )  CALL salsa_actions( location )
[3875]1279    IF ( wind_turbine        )  CALL wtm_actions( location )
[4047]1280
[3766]1281    IF ( user_module_enabled )  CALL user_actions( location )
[4173]1282    IF ( vdi_checks          )  CALL vdi_actions( location )
[3684]1283
1284
[3766]1285 END SUBROUTINE module_interface_actions
[3637]1286
1287
[4753]1288!--------------------------------------------------------------------------------------------------!
[3637]1289! Description:
1290! ------------
[3874]1291!> Perform module-specific actions while in time-integration (cache-optimized)
[4753]1292!--------------------------------------------------------------------------------------------------!
[3766]1293 SUBROUTINE module_interface_actions_ij( i, j, location )
[3637]1294
[4753]1295    CHARACTER (LEN=*), INTENT(IN) ::  location  !< call location string
[3637]1296
[3766]1297    INTEGER(iwp),      INTENT(IN) ::  i         !< grid index in x-direction
1298    INTEGER(iwp),      INTENT(IN) ::  j         !< grid index in y-direction
[3637]1299
[4047]1300    CALL dynamics_actions( i, j, location )
[4048]1301    CALL tcm_actions( i, j, location )
[3637]1302
[3870]1303    IF ( bulk_cloud_model    )  CALL bcm_actions( i, j, location )
[3877]1304    IF ( air_chemistry       )  CALL chem_actions( i, j, location )
[3766]1305    IF ( gust_module_enabled )  CALL gust_actions( i, j, location )
[3873]1306    IF ( ocean_mode          )  CALL ocean_actions( i, j, location )
[3871]1307    IF ( salsa               )  CALL salsa_actions( i, j, location )
[3875]1308    IF ( wind_turbine        )  CALL wtm_actions( i, j, location )
[4047]1309
[3766]1310    IF ( user_module_enabled )  CALL user_actions( i, j, location )
[3684]1311
1312
[3766]1313 END SUBROUTINE module_interface_actions_ij
[3637]1314
1315
[4753]1316!--------------------------------------------------------------------------------------------------!
[3637]1317! Description:
1318! ------------
[3987]1319!> Compute module-specific non_advective_processes (vector-optimized)
[4753]1320!--------------------------------------------------------------------------------------------------!
[4047]1321 SUBROUTINE module_interface_non_advective_processes
[3874]1322
1323
[4047]1324    CALL dynamics_non_advective_processes
[3874]1325
[4047]1326    IF ( bulk_cloud_model    )  CALL bcm_non_advective_processes
1327    IF ( air_chemistry       )  CALL chem_non_advective_processes
1328    IF ( salsa               )  CALL salsa_non_advective_processes
[3874]1329
[4047]1330
[3931]1331 END SUBROUTINE module_interface_non_advective_processes
[3874]1332
1333
[4753]1334!--------------------------------------------------------------------------------------------------!
[3874]1335! Description:
1336! ------------
[3931]1337!> Compute module-specific non_advective_processes (cache-optimized)
[4753]1338!--------------------------------------------------------------------------------------------------!
[3931]1339 SUBROUTINE module_interface_non_advective_processes_ij( i, j )
[3874]1340
1341
1342    INTEGER(iwp), INTENT(IN) ::  i            !< grid index in x-direction
1343    INTEGER(iwp), INTENT(IN) ::  j            !< grid index in y-direction
1344
[4047]1345    CALL dynamics_non_advective_processes( i, j )
[3874]1346
[3956]1347    IF ( bulk_cloud_model    )  CALL bcm_non_advective_processes( i, j )
[3930]1348    IF ( air_chemistry       )  CALL chem_non_advective_processes( i, j )
[3956]1349    IF ( salsa               )  CALL salsa_non_advective_processes( i, j )
[3874]1350
1351
[3931]1352 END SUBROUTINE module_interface_non_advective_processes_ij
[4047]1353
[4753]1354!--------------------------------------------------------------------------------------------------!
[3887]1355! Description:
1356! ------------
[4047]1357!> Exchange horiz for module-specific quantities
[4753]1358!--------------------------------------------------------------------------------------------------!
[4731]1359 SUBROUTINE module_interface_exchange_horiz( location )
[3874]1360
[4731]1361    CHARACTER (LEN=*), INTENT(IN) ::  location !< call location string
[3874]1362
[4753]1363
[3987]1364    IF ( debug_output_timestep )  CALL debug_message( 'module-specific exchange_horiz', 'start' )
1365
[4731]1366    CALL dynamics_exchange_horiz( location )
[3887]1367
[4731]1368    IF ( bulk_cloud_model    )  CALL bcm_exchange_horiz( location )
1369    IF ( air_chemistry       )  CALL chem_exchange_horiz_bounds( location )
1370    IF ( ocean_mode          )  CALL ocean_exchange_horiz( location )
[4753]1371    IF ( particle_advection  )  CALL lpm_exchange_horiz_bounds( location )
[4731]1372    IF ( salsa               )  CALL salsa_exchange_horiz_bounds( location )
[4047]1373
[3987]1374    IF ( debug_output_timestep )  CALL debug_message( 'module-specific exchange_horiz', 'end' )
1375
1376
[3887]1377 END SUBROUTINE module_interface_exchange_horiz
1378
1379
[4753]1380!--------------------------------------------------------------------------------------------------!
[3874]1381! Description:
1382! ------------
1383!> Compute module-specific prognostic_equations (vector-optimized)
[4753]1384!--------------------------------------------------------------------------------------------------!
[4047]1385 SUBROUTINE module_interface_prognostic_equations
[3837]1386
1387
[4047]1388    CALL dynamics_prognostic_equations
[4048]1389    CALL tcm_prognostic_equations
[3837]1390
[4047]1391    IF ( bulk_cloud_model    )  CALL bcm_prognostic_equations
1392    IF ( air_chemistry       )  CALL chem_prognostic_equations
1393    IF ( gust_module_enabled )  CALL gust_prognostic_equations
1394    IF ( ocean_mode          )  CALL ocean_prognostic_equations
1395    IF ( salsa               )  CALL salsa_prognostic_equations
[3837]1396
[4047]1397
[3837]1398 END SUBROUTINE module_interface_prognostic_equations
1399
1400
[4753]1401!--------------------------------------------------------------------------------------------------!
[3837]1402! Description:
1403! ------------
[3874]1404!> Compute module-specific prognostic_equations (cache-optimized)
[4753]1405!--------------------------------------------------------------------------------------------------!
[3837]1406 SUBROUTINE module_interface_prognostic_equations_ij( i, j, i_omp_start, tn )
1407
1408
1409    INTEGER(iwp), INTENT(IN) ::  i            !< grid index in x-direction
1410    INTEGER(iwp), INTENT(IN) ::  j            !< grid index in y-direction
1411    INTEGER(iwp), INTENT(IN) ::  i_omp_start  !< first loop index of i-loop in prognostic_equations
1412    INTEGER(iwp), INTENT(IN) ::  tn           !< task number of openmp task
1413
[4047]1414    CALL dynamics_prognostic_equations( i, j, i_omp_start, tn )
[4048]1415    CALL tcm_prognostic_equations( i, j, i_omp_start, tn )
[3837]1416
[3870]1417    IF ( bulk_cloud_model    )  CALL bcm_prognostic_equations( i, j, i_omp_start, tn )
[3880]1418    IF ( air_chemistry       )  CALL chem_prognostic_equations( i, j, i_omp_start, tn )
[3837]1419    IF ( gust_module_enabled )  CALL gust_prognostic_equations( i, j, i_omp_start, tn )
[3840]1420    IF ( ocean_mode          )  CALL ocean_prognostic_equations( i, j, i_omp_start, tn )
[3864]1421    IF ( salsa               )  CALL salsa_prognostic_equations( i, j, i_omp_start, tn )
[3837]1422
1423
1424 END SUBROUTINE module_interface_prognostic_equations_ij
1425
[4753]1426!--------------------------------------------------------------------------------------------------!
[4268]1427! Description:
1428! ------------
1429!> Compute module-specific boundary conditions
[4753]1430!--------------------------------------------------------------------------------------------------!
[4268]1431 SUBROUTINE module_interface_boundary_conditions
[3837]1432
[4268]1433
1434    IF ( debug_output_timestep )  CALL debug_message( 'module-specific boundary_conditions', 'start' )
1435
[4281]1436    CALL dynamics_boundary_conditions
1437    CALL tcm_boundary_conds
1438
[4268]1439    IF ( bulk_cloud_model    )  CALL bcm_boundary_conditions
1440    IF ( air_chemistry       )  CALL chem_boundary_conditions
[4272]1441    IF ( ocean_mode          )  CALL ocean_boundary_conditions
[4268]1442    IF ( salsa               )  CALL salsa_boundary_conditions
1443
1444    IF ( debug_output_timestep )  CALL debug_message( 'module-specific boundary_conditions', 'end' )
1445
1446
1447 END SUBROUTINE module_interface_boundary_conditions
1448
[4753]1449!--------------------------------------------------------------------------------------------------!
[3837]1450! Description:
1451! ------------
[3637]1452!> Swap the timelevel pointers for module-specific arrays
[4753]1453!--------------------------------------------------------------------------------------------------!
[3766]1454 SUBROUTINE module_interface_swap_timelevel ( swap_mode )
[3637]1455
1456
[3766]1457    INTEGER(iwp), INTENT(IN) :: swap_mode !< determines procedure of pointer swap
[3637]1458
[3987]1459
1460    IF ( debug_output_timestep )  CALL debug_message( 'module-specific swap timelevel', 'start' )
1461
[4047]1462    CALL dynamics_swap_timelevel( swap_mode )
1463    CALL tcm_swap_timelevel( swap_mode )
1464
[3766]1465    IF ( bulk_cloud_model    )  CALL bcm_swap_timelevel( swap_mode )
1466    IF ( air_chemistry       )  CALL chem_swap_timelevel( swap_mode )
1467    IF ( gust_module_enabled )  CALL gust_swap_timelevel( swap_mode )
1468    IF ( land_surface        )  CALL lsm_swap_timelevel( swap_mode )
1469    IF ( ocean_mode          )  CALL ocean_swap_timelevel( swap_mode )
1470    IF ( salsa               )  CALL salsa_swap_timelevel( swap_mode )
1471    IF ( urban_surface       )  CALL usm_swap_timelevel( swap_mode )
[3637]1472
[3987]1473    IF ( debug_output_timestep )  CALL debug_message( 'module-specific swap timelevel', 'end' )
[3637]1474
[3987]1475
[3766]1476 END SUBROUTINE module_interface_swap_timelevel
[3637]1477
1478
[4753]1479!--------------------------------------------------------------------------------------------------!
[3637]1480!
1481! Description:
1482! ------------
1483!> Perform module-specific averaging of 3D data
[4753]1484!--------------------------------------------------------------------------------------------------!
[3766]1485 SUBROUTINE module_interface_3d_data_averaging( mode, variable )
[3637]1486
1487
[3766]1488    CHARACTER (LEN=*), INTENT(IN) ::  mode     !< averaging interface mode
1489    CHARACTER (LEN=*), INTENT(IN) ::  variable !< variable name
[3637]1490
[3987]1491
1492    IF ( debug_output_timestep )  CALL debug_message( 'module-specific 3d data averaging', 'start' )
1493
[4047]1494    CALL dynamics_3d_data_averaging( mode, variable )
[4048]1495    CALL tcm_3d_data_averaging( mode, variable )
[4047]1496
[3766]1497    IF ( biometeorology      )  CALL bio_3d_data_averaging( mode, variable )
1498    IF ( bulk_cloud_model    )  CALL bcm_3d_data_averaging( mode, variable )
1499    IF ( air_chemistry       )  CALL chem_3d_data_averaging( mode, variable )
[4047]1500    CALL doq_3d_data_averaging( mode, variable )  ! ToDo: this seems to be not according to the design
[3766]1501    IF ( gust_module_enabled )  CALL gust_3d_data_averaging( mode, variable )
1502    IF ( land_surface        )  CALL lsm_3d_data_averaging( mode, variable )
1503    IF ( ocean_mode          )  CALL ocean_3d_data_averaging( mode, variable )
[4127]1504    IF ( plant_canopy        )  CALL pcm_3d_data_averaging( mode, variable )
[3766]1505    IF ( radiation           )  CALL radiation_3d_data_averaging( mode, variable )
1506    IF ( salsa               )  CALL salsa_3d_data_averaging( mode, variable )
1507    IF ( urban_surface       )  CALL usm_3d_data_averaging( mode, variable )
[4047]1508
[3766]1509    IF ( user_module_enabled )  CALL user_3d_data_averaging( mode, variable )
[3637]1510
[3987]1511    IF ( debug_output_timestep )  CALL debug_message( 'module-specific 3d data averaging', 'end' )
[3637]1512
[3987]1513
[3766]1514 END SUBROUTINE module_interface_3d_data_averaging
[3637]1515
[4753]1516!--------------------------------------------------------------------------------------------------!
[3637]1517!
1518! Description:
1519! ------------
1520!> Define module-specific 2D output variables
[4753]1521!--------------------------------------------------------------------------------------------------!
1522 SUBROUTINE module_interface_data_output_2d( av, variable, found, grid, mode, local_pf, two_d,     &
1523                                             nzb_do, nzt_do, fill_value )
[3637]1524
[4753]1525    CHARACTER (LEN=*), INTENT(IN)    ::  mode       !< either 'xy', 'xz' or 'yz'
[3766]1526    CHARACTER (LEN=*), INTENT(IN)    ::  variable   !< variable name
1527    CHARACTER (LEN=*), INTENT(INOUT) ::  grid       !< name of vertical grid
[4753]1528
1529    INTEGER(iwp),      INTENT(IN)    ::  av         !< flag for (non-)average output
[3766]1530    INTEGER(iwp),      INTENT(IN)    ::  nzb_do     !< vertical output index (bottom) (usually 0)
1531    INTEGER(iwp),      INTENT(IN)    ::  nzt_do     !< vertical output index (top) (usually nz_do3d)
[4753]1532
1533    LOGICAL,           INTENT(INOUT) ::  found      !< flag if output variable is found
1534    LOGICAL,           INTENT(OUT)   ::  two_d      !< flag for 2D variables
1535
[3766]1536    REAL(wp),          INTENT(IN)    ::  fill_value !< to be removed
[3637]1537
[4004]1538    REAL(wp), DIMENSION(nxl:nxr,nys:nyn,nzb_do:nzt_do), INTENT(INOUT) ::  local_pf !< ToDo: can also be kind=sp
[3637]1539
1540
[3987]1541    IF ( debug_output_timestep )  CALL debug_message( 'module-specific 2d data output', 'start' )
1542
[4753]1543    CALL dynamics_data_output_2d( av, variable, found, grid, mode, local_pf, two_d, nzb_do, nzt_do,&
1544                                  fill_value )
[4047]1545
[4048]1546    IF ( .NOT. found )  THEN
[4753]1547       CALL tcm_data_output_2d( av, variable, found, grid, mode, local_pf, nzb_do, nzt_do )
[4048]1548    ENDIF
1549
[3766]1550    IF ( .NOT. found  .AND.  biometeorology )  THEN
[4753]1551       CALL bio_data_output_2d( av, variable, found, grid, local_pf, two_d, nzb_do, nzt_do )
[3766]1552    ENDIF
[3637]1553
[3766]1554    IF ( .NOT. found  .AND.  bulk_cloud_model )  THEN
[4753]1555       CALL bcm_data_output_2d( av, variable, found, grid, mode, local_pf, two_d, nzb_do, nzt_do )
[3766]1556    ENDIF
[3637]1557
[3766]1558    IF ( .NOT. found  .AND.  air_chemistry )  THEN
[4753]1559       CALL chem_data_output_2d( av, variable, found, grid, mode, local_pf, two_d, nzb_do, nzt_do, &
1560                                 fill_value )
[3766]1561    ENDIF
[4047]1562
[4039]1563    IF ( .NOT. found )  THEN
[4753]1564       CALL doq_output_2d( av, variable, found, grid, mode, local_pf, two_d, nzb_do, nzt_do,       &
1565                           fill_value )
[4039]1566    ENDIF
[3637]1567
[3766]1568    IF ( .NOT. found  .AND.  gust_module_enabled )  THEN
[4753]1569       CALL gust_data_output_2d( av, variable, found, grid, mode, local_pf, two_d, nzb_do, nzt_do, &
1570                                 fill_value )
[3766]1571    ENDIF
[3637]1572
[3766]1573    IF ( .NOT. found  .AND.  land_surface )  THEN
[4753]1574       CALL lsm_data_output_2d( av, variable, found, grid, mode, local_pf, two_d, nzb_do, nzt_do )
[3766]1575    ENDIF
[3637]1576
[3766]1577    IF ( .NOT. found  .AND.  ocean_mode )  THEN
[4753]1578       CALL ocean_data_output_2d( av, variable, found, grid, mode, local_pf, nzb_do, nzt_do )
[3766]1579    ENDIF
[3637]1580
[4008]1581    IF ( .NOT. found  .AND.  radiation )  THEN
[4753]1582       CALL radiation_data_output_2d( av, variable, found, grid, mode, local_pf, two_d, nzb_do,    &
1583                                      nzt_do, fill_value )
[3766]1584    ENDIF
[3637]1585
[4008]1586    IF ( .NOT. found  .AND.  salsa )  THEN
[4753]1587       CALL salsa_data_output_2d( av, variable, found, grid, mode, local_pf, two_d, nzb_do, nzt_do )
[3766]1588    ENDIF
[3637]1589
[3766]1590    IF ( .NOT. found  .AND.  user_module_enabled )  THEN
[4753]1591       CALL user_data_output_2d( av, variable, found, grid, local_pf, two_d, nzb_do, nzt_do )
[3766]1592    ENDIF
[3637]1593
[3987]1594    IF ( debug_output_timestep )  CALL debug_message( 'module-specific 2d data output', 'end' )
1595
1596
[3766]1597 END SUBROUTINE module_interface_data_output_2d
[3637]1598
1599
[4753]1600!--------------------------------------------------------------------------------------------------!
[3637]1601!
1602! Description:
1603! ------------
1604!> Define module-specific 3D output variables
[4753]1605!--------------------------------------------------------------------------------------------------!
1606 SUBROUTINE module_interface_data_output_3d( av, variable, found, local_pf, fill_value, resorted,  &
1607                                             nzb_do, nzt_do )
[3637]1608
[4753]1609    CHARACTER (LEN=*), INTENT(IN)    ::  variable   !< variable name
[3637]1610
[3766]1611    INTEGER(iwp),      INTENT(IN)    ::  av         !< flag for (non-)average output
1612    INTEGER(iwp),      INTENT(IN)    ::  nzb_do     !< vertical output index (bottom) (usually 0)
1613    INTEGER(iwp),      INTENT(IN)    ::  nzt_do     !< vertical output index (top) (usually nz_do3d)
[3637]1614
[4753]1615    LOGICAL,           INTENT(INOUT) ::  found      !< flag if output variable is found
1616    LOGICAL,           INTENT(OUT)   ::  resorted   !< flag if output has been resorted
1617
1618    REAL(wp),          INTENT(IN)    ::  fill_value !< ToDo: refactor
1619
[4768]1620    REAL(wp), DIMENSION(nxl:nxr,nys:nyn,nzb_do:nzt_do), INTENT(INOUT) ::  local_pf
[3637]1621
1622
[3987]1623    IF ( debug_output_timestep )  CALL debug_message( 'module-specific 3d data output', 'start' )
1624
[4047]1625    CALL dynamics_data_output_3d( av, variable, found, local_pf, fill_value, nzb_do, nzt_do )
1626    resorted = .FALSE.
1627
[4048]1628    IF ( .NOT. found )  THEN
1629       CALL tcm_data_output_3d( av, variable, found, local_pf, nzb_do, nzt_do )
1630       resorted = .TRUE.
1631    ENDIF
1632
[3766]1633    IF ( .NOT. found  .AND.  biometeorology )  THEN
1634       CALL bio_data_output_3d( av, variable, found, local_pf, nzb_do, nzt_do )
1635       resorted = .FALSE.
1636    ENDIF
[3637]1637
[3766]1638    IF ( .NOT. found  .AND.  bulk_cloud_model )  THEN
1639       CALL bcm_data_output_3d( av, variable, found, local_pf, nzb_do, nzt_do )
1640       resorted = .TRUE.
1641    ENDIF
[3637]1642
[3766]1643    IF ( .NOT. found  .AND.  air_chemistry )  THEN
1644       CALL chem_data_output_3d( av, variable, found, local_pf, fill_value, nzb_do, nzt_do )
1645       resorted = .TRUE.
1646    ENDIF
[4047]1647
[4039]1648    IF ( .NOT. found )  THEN
1649       CALL doq_output_3d( av, variable, found, local_pf, fill_value, nzb_do, nzt_do )
1650       resorted = .TRUE.
1651    ENDIF
[4047]1652
[3766]1653    IF ( .NOT. found  .AND.  gust_module_enabled )  THEN
1654       CALL gust_data_output_3d( av, variable, found, local_pf, fill_value, nzb_do, nzt_do )
1655       resorted = .TRUE.
1656    ENDIF
[4047]1657
[3766]1658    IF ( .NOT. found  .AND.  indoor_model )  THEN
1659       CALL im_data_output_3d( av, variable, found, local_pf, fill_value, nzb_do, nzt_do )
1660       resorted = .TRUE.
1661    ENDIF
[3637]1662
[3766]1663    IF ( .NOT. found  .AND.  ocean_mode )  THEN
1664       CALL ocean_data_output_3d( av, variable, found, local_pf, nzb_do, nzt_do )
1665       resorted = .TRUE.
1666    ENDIF
[3637]1667
[3766]1668    IF ( .NOT. found  .AND.  plant_canopy )  THEN
1669       CALL pcm_data_output_3d( av, variable, found, local_pf, fill_value, nzb_do, nzt_do )
1670       resorted = .TRUE.
1671    ENDIF
[3637]1672
[4008]1673    IF ( .NOT. found  .AND.  radiation )  THEN
[4708]1674       CALL radiation_data_output_3d( av, variable, found, local_pf, fill_value, nzb_do, nzt_do )
[3766]1675       resorted = .TRUE.
1676    ENDIF
[3637]1677
[4008]1678    IF ( .NOT. found  .AND.  salsa )  THEN
1679       CALL salsa_data_output_3d( av, variable, found, local_pf, nzb_do, nzt_do )
[3766]1680       resorted = .TRUE.
1681    ENDIF
[3637]1682
[3766]1683    IF ( .NOT. found  .AND.  user_module_enabled )  THEN
1684       CALL user_data_output_3d( av, variable, found, local_pf, nzb_do, nzt_do )
1685       resorted = .TRUE.
1686    ENDIF
[3637]1687
[3987]1688    IF ( debug_output_timestep )  CALL debug_message( 'module-specific 3d data output', 'end' )
[3637]1689
[3987]1690
[3766]1691 END SUBROUTINE module_interface_data_output_3d
[3637]1692
1693
[4753]1694!--------------------------------------------------------------------------------------------------!
[3637]1695! Description:
1696! ------------
1697!> Compute module-specific profile and timeseries data
[4753]1698!--------------------------------------------------------------------------------------------------!
[3766]1699 SUBROUTINE module_interface_statistics( mode, sr, tn, dots_max )
[3637]1700
1701
[3766]1702    CHARACTER (LEN=*), INTENT(IN) ::  mode     !< statistical analysis mode
[4753]1703
1704    INTEGER(iwp),      INTENT(IN) ::  dots_max !< maximum number of timeseries
[3766]1705    INTEGER(iwp),      INTENT(IN) ::  sr       !<
1706    INTEGER(iwp),      INTENT(IN) ::  tn       !<
[3637]1707
[3987]1708
1709    IF ( debug_output_timestep )  CALL debug_message( 'module-specific statistics', 'start' )
1710
[4047]1711    CALL dynamics_statistics( mode, sr, tn )
[4757]1712    CALL doq_statistics( mode, sr, tn )
[4047]1713
[3766]1714    IF ( gust_module_enabled )  CALL gust_statistics( mode, sr, tn, dots_max )
1715    IF ( air_chemistry       )  CALL chem_statistics( mode, sr, tn )
[4131]1716    IF ( salsa               )  CALL salsa_statistics( mode, sr, tn )
[4047]1717
[3766]1718    IF ( user_module_enabled )  CALL user_statistics( mode, sr, tn )
[3637]1719
[3987]1720    IF ( debug_output_timestep )  CALL debug_message( 'module-specific statistics', 'end' )
[3637]1721
[3987]1722
[3766]1723 END SUBROUTINE module_interface_statistics
[3637]1724
1725
[4495]1726!--------------------------------------------------------------------------------------------------!
[3637]1727! Description:
1728! ------------
[4495]1729!> Read module-specific restart data in Fortran binary format globaly shared by all MPI ranks
1730!--------------------------------------------------------------------------------------------------!
1731 SUBROUTINE module_interface_rrd_global_ftn( found )
[3637]1732
1733
[3806]1734    LOGICAL, INTENT(INOUT) ::  found    !< flag if variable was found
[3637]1735
[3987]1736
1737    IF ( debug_output )  CALL debug_message( 'module-specific read global restart data', 'start' )
1738
[4047]1739    CALL dynamics_rrd_global( found ) ! ToDo: change interface to pass variable
1740
[3766]1741    IF ( .NOT. found )  CALL bio_rrd_global( found ) ! ToDo: change interface to pass variable
1742    IF ( .NOT. found )  CALL bcm_rrd_global( found ) ! ToDo: change interface to pass variable
1743    IF ( .NOT. found )  CALL flight_rrd_global( found ) ! ToDo: change interface to pass variable
1744    IF ( .NOT. found )  CALL gust_rrd_global( found ) ! ToDo: change interface to pass variable
[4047]1745    IF ( .NOT. found )  CALL lpm_rrd_global( found ) ! ToDo: change interface to pass variable
[4514]1746    IF ( .NOT. found )  CALL pcm_rrd_global( found )
[3766]1747    IF ( .NOT. found )  CALL ocean_rrd_global( found ) ! ToDo: change interface to pass variable
[4525]1748    IF ( .NOT. found )  CALL salsa_rrd_global( found )
[3766]1749    IF ( .NOT. found )  CALL stg_rrd_global ( found ) ! ToDo: change interface to pass variable
1750    IF ( .NOT. found )  CALL wtm_rrd_global( found ) ! ToDo: change interface to pass variable
1751    IF ( .NOT. found )  CALL surface_data_output_rrd_global( found )
[4047]1752
[3766]1753    IF ( .NOT. found )  CALL user_rrd_global( found ) ! ToDo: change interface to pass variable
[3637]1754
[3987]1755    IF ( debug_output )  CALL debug_message( 'module-specific read global restart data', 'end' )
[3637]1756
[3987]1757
[4495]1758 END SUBROUTINE module_interface_rrd_global_ftn
[3637]1759
1760
[4495]1761!--------------------------------------------------------------------------------------------------!
1762! Description:
1763! ------------
1764!> Read module-specific restart data in MPI format globaly shared by all MPI ranks
1765!--------------------------------------------------------------------------------------------------!
1766 SUBROUTINE module_interface_rrd_global_mpi
1767
1768
1769    IF ( debug_output )  CALL debug_message( 'module-specific read global restart data', 'start' )
1770
1771    CALL dynamics_rrd_global
1772
1773    IF ( biometeorology )       CALL bio_rrd_global
1774    IF ( bulk_cloud_model )     CALL bcm_rrd_global
1775    IF ( virtual_flight )       CALL flight_rrd_global
1776    IF ( gust_module_enabled )  CALL gust_rrd_global
1777    IF ( particle_advection )   CALL lpm_rrd_global
[4514]1778    IF ( plant_canopy )         CALL pcm_rrd_global
[4495]1779    IF ( ocean_mode )           CALL ocean_rrd_global
[4525]1780    IF ( salsa )                CALL salsa_rrd_global
[4495]1781    IF ( syn_turb_gen )         CALL stg_rrd_global
1782    IF ( wind_turbine )         CALL wtm_rrd_global
1783    IF ( surface_output )       CALL surface_data_output_rrd_global
1784
1785    IF ( user_module_enabled )  CALL user_rrd_global
1786
1787    IF ( debug_output )  CALL debug_message( 'module-specific read global restart data', 'end' )
1788
1789
1790 END SUBROUTINE module_interface_rrd_global_mpi
1791
1792
[4753]1793!--------------------------------------------------------------------------------------------------!
[3637]1794! Description:
1795! ------------
1796!> Write module-specific restart data globaly shared by all MPI ranks
[4753]1797!--------------------------------------------------------------------------------------------------!
[3766]1798 SUBROUTINE module_interface_wrd_global
[3637]1799
1800
[3987]1801    IF ( debug_output )  CALL debug_message( 'module-specific write global restart data', 'start' )
1802
[4047]1803    CALL dynamics_wrd_global
1804
[3766]1805    IF ( biometeorology )       CALL bio_wrd_global
1806    IF ( bulk_cloud_model )     CALL bcm_wrd_global
1807    IF ( virtual_flight )       CALL flight_wrd_global
1808    IF ( gust_module_enabled )  CALL gust_wrd_global
[4495]1809    IF ( particle_advection )   CALL lpm_wrd_global
[4514]1810    IF ( plant_canopy )         CALL pcm_wrd_global
[3766]1811    IF ( ocean_mode )           CALL ocean_wrd_global
[4525]1812    IF ( salsa )                CALL salsa_wrd_global
[3766]1813    IF ( syn_turb_gen )         CALL stg_wrd_global
1814    IF ( wind_turbine )         CALL wtm_wrd_global
1815    IF ( surface_output )       CALL surface_data_output_wrd_global
[4047]1816
[3766]1817    IF ( user_module_enabled )  CALL user_wrd_global
[3637]1818
[3987]1819    IF ( debug_output )  CALL debug_message( 'module-specific write global restart data', 'end' )
[3637]1820
[3987]1821
[3766]1822 END SUBROUTINE module_interface_wrd_global
[3637]1823
1824
[4753]1825!--------------------------------------------------------------------------------------------------!
[3637]1826! Description:
1827! ------------
[4517]1828!> Read module-specific local restart data arrays (Fortran binary format).
[4753]1829!--------------------------------------------------------------------------------------------------!
1830 SUBROUTINE module_interface_rrd_local_ftn( map_index,                                             &
1831                                            nxlf, nxlc, nxl_on_file,                               &
1832                                            nxrf, nxrc, nxr_on_file,                               &
1833                                            nynf, nync, nyn_on_file,                               &
1834                                            nysf, nysc, nys_on_file,                               &
1835                                            tmp_2d, tmp_3d, found )
[3637]1836
1837
[3806]1838    INTEGER(iwp), INTENT(IN)  ::  map_index    !<
1839    INTEGER(iwp), INTENT(IN)  ::  nxlc         !<
1840    INTEGER(iwp), INTENT(IN)  ::  nxlf         !<
1841    INTEGER(iwp), INTENT(IN)  ::  nxl_on_file  !<
1842    INTEGER(iwp), INTENT(IN)  ::  nxrc         !<
1843    INTEGER(iwp), INTENT(IN)  ::  nxrf         !<
1844    INTEGER(iwp), INTENT(IN)  ::  nxr_on_file  !<
1845    INTEGER(iwp), INTENT(IN)  ::  nync         !<
1846    INTEGER(iwp), INTENT(IN)  ::  nynf         !<
1847    INTEGER(iwp), INTENT(IN)  ::  nyn_on_file  !<
1848    INTEGER(iwp), INTENT(IN)  ::  nysc         !<
1849    INTEGER(iwp), INTENT(IN)  ::  nysf         !<
1850    INTEGER(iwp), INTENT(IN)  ::  nys_on_file  !<
[4753]1851
[3806]1852    LOGICAL,      INTENT(INOUT) ::  found        !< flag if variable was found
[3637]1853
[4753]1854    REAL(wp),                                                                                      &
1855       DIMENSION(nys_on_file-nbgp:nyn_on_file+nbgp,nxl_on_file-nbgp:nxr_on_file+nbgp),             &
[4039]1856       INTENT(OUT) :: tmp_2d   !<
[4753]1857    REAL(wp),                                                                                      &
1858       DIMENSION(nzb:nzt+1,nys_on_file-nbgp:nyn_on_file+nbgp,nxl_on_file-nbgp:nxr_on_file+nbgp),   &
[4039]1859       INTENT(OUT) :: tmp_3d   !<
[3637]1860
1861
[4517]1862    IF ( debug_output )  THEN
1863       CALL debug_message( 'module-specific read local restart data (Fortran binary)', 'start' )
1864    ENDIF
[3987]1865
[4753]1866    CALL dynamics_rrd_local( map_index,                                                            &
1867                             nxlf, nxlc, nxl_on_file,                                              &
1868                             nxrf, nxrc, nxr_on_file,                                              &
1869                             nynf, nync, nyn_on_file,                                              &
1870                             nysf, nysc, nys_on_file,                                              &
1871                             tmp_2d, tmp_3d, found                                                 &
1872                           ) ! ToDo: change interface to pass variable
[4047]1873
[4753]1874    IF ( .NOT. found )  CALL bio_rrd_local( found )
[3650]1875
[4753]1876    IF ( .NOT. found )  CALL bcm_rrd_local( map_index,                                             &
1877                                            nxlf, nxlc, nxl_on_file,                               &
1878                                            nxrf, nxrc, nxr_on_file,                               &
1879                                            nynf, nync, nyn_on_file,                               &
1880                                            nysf, nysc, nys_on_file,                               &
1881                                            tmp_2d, tmp_3d, found                                  &
1882                                          ) ! ToDo: change interface to pass variable
[3637]1883
[4753]1884    IF ( .NOT. found )  CALL chem_rrd_local( map_index,                                            &
1885                                             nxlf, nxlc, nxl_on_file,                              &
1886                                             nxrf, nxrc, nxr_on_file,                              &
1887                                             nynf, nync, nyn_on_file,                              &
1888                                             nysf, nysc, nys_on_file,                              &
1889                                             tmp_3d, found                                         &
1890                                           ) ! ToDo: change interface to pass variable
[4047]1891
[4753]1892    IF ( .NOT. found )  CALL doq_rrd_local( map_index,                                             &
1893                                            nxlf, nxlc, nxl_on_file,                               &
1894                                            nxrf, nxrc, nxr_on_file,                               &
1895                                            nynf, nync, nyn_on_file,                               &
1896                                            nysf, nysc, nys_on_file,                               &
1897                                            tmp_2d, tmp_3d, found                                  &
1898                                          ) ! ToDo: change interface to pass variable
[3637]1899
[4753]1900    IF ( .NOT. found )  CALL gust_rrd_local( map_index,                                            &
1901                                             nxlf, nxlc, nxl_on_file,                              &
1902                                             nxrf, nxrc, nxr_on_file,                              &
1903                                             nynf, nync, nyn_on_file,                              &
1904                                             nysf, nysc, nys_on_file,                              &
1905                                             tmp_2d, tmp_3d, found                                 &
1906                                           ) ! ToDo: change interface to pass variable
[3637]1907
[4753]1908    IF ( .NOT. found )  CALL lpm_rrd_local( map_index,                                             &
1909                                            nxlf, nxlc, nxl_on_file,                               &
1910                                            nxrf, nxrc, nxr_on_file,                               &
1911                                            nynf, nync, nyn_on_file,                               &
1912                                            nysf, nysc, nys_on_file,                               &
1913                                            tmp_3d, found                                          &
1914                                          ) ! ToDo: change interface to pass variable
[4017]1915
[4753]1916    IF ( .NOT. found )  CALL lsm_rrd_local( map_index,                                             &
1917                                            nxlf, nxlc, nxl_on_file,                               &
1918                                            nxrf, nxrc, nxr_on_file,                               &
1919                                            nynf, nync, nyn_on_file,                               &
1920                                            nysf, nysc, nys_on_file,                               &
1921                                            tmp_2d, found                                          &
1922                                          ) ! ToDo: change interface to pass variable
[3637]1923
[4753]1924     IF ( .NOT. found )  CALL pcm_rrd_local( map_index,                                            &
1925                                             nxlf, nxlc, nxl_on_file,                              &
1926                                             nxrf, nxrc, nxr_on_file,                              &
1927                                             nynf, nync, nyn_on_file,                              &
1928                                             nysf, nysc, nys_on_file,                              &
1929                                             found                                                 &
[4360]1930                                           )
1931
[4753]1932    IF ( .NOT. found )  CALL ocean_rrd_local( map_index,                                           &
1933                                              nxlf, nxlc, nxl_on_file,                             &
1934                                              nxrf, nxrc, nxr_on_file,                             &
1935                                              nynf, nync, nyn_on_file,                             &
1936                                              nysf, nysc, nys_on_file,                             &
1937                                              tmp_3d, found                                        &
1938                                            ) ! ToDo: change interface to pass variable
[3637]1939
[4753]1940    IF ( .NOT. found )  CALL radiation_rrd_local( map_index,                                       &
1941                                                  nxlf, nxlc, nxl_on_file,                         &
1942                                                  nxrf, nxrc, nxr_on_file,                         &
1943                                                  nynf, nync, nyn_on_file,                         &
1944                                                  nysf, nysc, nys_on_file,                         &
1945                                                  tmp_2d, tmp_3d, found                            &
1946                                                ) ! ToDo: change interface to pass variable
[3637]1947
[4753]1948    IF ( .NOT. found )  CALL salsa_rrd_local( map_index,                                           &
1949                                              nxlf, nxlc, nxl_on_file,                             &
1950                                              nxrf, nxrc, nxr_on_file,                             &
1951                                              nynf, nync, nyn_on_file,                             &
1952                                              nysf, nysc, nys_on_file,                             &
1953                                              tmp_3d, found                                        &
1954                                            ) ! ToDo: change interface to pass variable
[3637]1955
[4753]1956    IF ( .NOT. found )  CALL usm_rrd_local( map_index,                                             &
1957                                            nxlf, nxlc, nxl_on_file,                               &
1958                                            nxrf, nxr_on_file,                                     &
1959                                            nynf, nyn_on_file,                                     &
1960                                            nysf, nysc, nys_on_file,                               &
1961                                            found                                                  &
1962                                          ) ! ToDo: change interface to pass variable
[3762]1963!
[3766]1964!-- Surface data do not need overlap data, so do not pass these information.
[4039]1965    IF ( .NOT. found )  CALL surface_data_output_rrd_local( found )
[4047]1966
[4753]1967    IF ( .NOT. found )  CALL user_rrd_local( map_index,                                            &
1968                                             nxlf, nxlc, nxl_on_file,                              &
1969                                             nxrf, nxrc, nxr_on_file,                              &
1970                                             nynf, nync, nyn_on_file,                              &
1971                                             nysf, nysc, nys_on_file,                              &
1972                                             tmp_3d, found                                         &
1973                                           ) ! ToDo: change interface to pass variable
[3637]1974
[4517]1975    IF ( debug_output )  THEN
1976       CALL debug_message( 'module-specific read local restart data (Fortran binary)', 'end' )
1977    ENDIF
[3637]1978
[4517]1979 END SUBROUTINE module_interface_rrd_local_ftn
[3987]1980
[3637]1981
[4753]1982!--------------------------------------------------------------------------------------------------!
[4517]1983! Description:
1984! ------------
1985!> Read module-specific local restart data arrays (MPI-IO).
[4753]1986!--------------------------------------------------------------------------------------------------!
[4517]1987 SUBROUTINE module_interface_rrd_local_mpi
[3637]1988
[4517]1989    IF ( debug_output )  THEN
1990       CALL debug_message( 'module-specific read local restart data (MPI-IO)', 'start' )
1991    ENDIF
1992
1993    CALL dynamics_rrd_local
1994
[4590]1995    IF ( biometeorology )       CALL bio_rrd_local
[4517]1996    IF ( bulk_cloud_model )     CALL bcm_rrd_local
1997    IF ( air_chemistry )        CALL chem_rrd_local
[4518]1998    CALL doq_rrd_local
[4517]1999    IF ( gust_module_enabled )  CALL gust_rrd_local
2000    IF ( particle_advection )   CALL lpm_rrd_local
2001    IF ( land_surface )         CALL lsm_rrd_local
2002    IF ( plant_canopy )         CALL pcm_rrd_local
2003    IF ( ocean_mode )           CALL ocean_rrd_local
2004    IF ( radiation )            CALL radiation_rrd_local
[4525]2005    IF ( salsa )                CALL salsa_rrd_local
[4517]2006    IF ( urban_surface )        CALL usm_rrd_local
2007    IF ( surface_output )       CALL surface_data_output_rrd_local
2008
2009    IF ( user_module_enabled )  CALL user_rrd_local
2010
2011    IF ( debug_output )  THEN
2012       CALL debug_message( 'module-specific read local restart data (Fortran binary)', 'end' )
2013    ENDIF
2014
2015 END SUBROUTINE module_interface_rrd_local_mpi
2016
2017
[4753]2018!--------------------------------------------------------------------------------------------------!
[3637]2019! Description:
2020! ------------
2021!> Write module-specific restart data specific to local MPI ranks
[4753]2022!--------------------------------------------------------------------------------------------------!
[3766]2023 SUBROUTINE module_interface_wrd_local
[3637]2024
2025
[3987]2026    IF ( debug_output )  CALL debug_message( 'module-specific write local restart data', 'start' )
2027
[4047]2028    CALL dynamics_wrd_local
2029
[3766]2030    IF ( biometeorology )       CALL bio_wrd_local
2031    IF ( bulk_cloud_model )     CALL bcm_wrd_local
2032    IF ( air_chemistry )        CALL chem_wrd_local
[4039]2033    CALL doq_wrd_local
[3766]2034    IF ( gust_module_enabled )  CALL gust_wrd_local
[4047]2035    IF ( particle_advection )   CALL lpm_wrd_local
[3766]2036    IF ( land_surface )         CALL lsm_wrd_local
[4360]2037    IF ( plant_canopy )         CALL pcm_wrd_local
[3766]2038    IF ( ocean_mode )           CALL ocean_wrd_local
2039    IF ( radiation )            CALL radiation_wrd_local
2040    IF ( salsa )                CALL salsa_wrd_local
2041    IF ( urban_surface )        CALL usm_wrd_local
2042    IF ( surface_output )       CALL surface_data_output_wrd_local
[4047]2043
[3766]2044    IF ( user_module_enabled )  CALL user_wrd_local
[3637]2045
[3987]2046    IF ( debug_output )  CALL debug_message( 'module-specific write local restart data', 'end' )
[3637]2047
[3987]2048
[3766]2049 END SUBROUTINE module_interface_wrd_local
[3637]2050
2051
[4753]2052!--------------------------------------------------------------------------------------------------!
[3687]2053! Description:
2054! ------------
2055!> Perform module-specific last actions before the program terminates
[4753]2056!--------------------------------------------------------------------------------------------------!
[3766]2057 SUBROUTINE module_interface_last_actions
[3687]2058
[4400]2059    INTEGER ::  return_value  !< returned status value of a called function
[3687]2060
[4400]2061
[3987]2062    IF ( debug_output )  CALL debug_message( 'module-specific last actions', 'start' )
2063
[4400]2064    return_value = dom_finalize_output()
2065
[4047]2066    CALL dynamics_last_actions
2067
[3766]2068    IF ( user_module_enabled )  CALL user_last_actions
[3687]2069
[3987]2070    IF ( debug_output )  CALL debug_message( 'module-specific last actions', 'end' )
[3687]2071
[3987]2072
[3766]2073 END SUBROUTINE module_interface_last_actions
[3687]2074
[3766]2075
2076 END MODULE module_interface
Note: See TracBrowser for help on using the repository browser.