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

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

New diagnostic output for 10-m wind speed; Diagnostic output of 2-m potential temperature moved to diagnostic output

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