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

Last change on this file since 4360 was 4360, checked in by suehring, 5 years ago

Bugfix in output of time-averaged plant-canopy quanities; Output of plant-canopy data only where tall canopy is defined; land-surface model: fix wrong location strings; tests: update urban test case; all source code files: copyright update

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