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

Last change on this file since 4757 was 4757, checked in by schwenkel, 4 years ago

implement relative humidity as diagnostic output quantity

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