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

Last change on this file since 4339 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
Line 
1!> @file module_interface.f90
2!------------------------------------------------------------------------------!
3! This file is part of PALM.
4!
5! PALM is free software: you can redistribute it and/or modify it under the
6! terms of the GNU General Public License as published by the Free Software
7! Foundation, either version 3 of the License, or (at your option) any later
8! version.
9!
10! PALM is distributed in the hope that it will be useful, but WITHOUT ANY
11! WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
12! A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
13!
14! You should have received a copy of the GNU General Public License along with
15! PALM. If not, see <http://www.gnu.org/licenses/>.
16!
17! Copyright 1997-2019 Leibniz Universitaet Hannover
18!------------------------------------------------------------------------------!
19!
20! Current revisions:
21! -----------------
22!
23!
24! Former revisions:
25! -----------------
26! $Id: module_interface.f90 4331 2019-12-10 18:25:02Z suehring $
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
31! Added dynamics boundary conditions
32!
33! 4272 2019-10-23 15:18:57Z schwenkel
34! Further modularization of boundary conditions: moved boundary conditions to
35! respective modules
36!
37! 4268 2019-10-17 11:29:38Z schwenkel
38! Introduction of module_interface_boundary_conditions
39!
40! 4182 2019-08-22 15:20:23Z scharf
41! Corrected "Former revisions" section
42!
43! 4173 2019-08-20 12:04:06Z gronemeier
44! add vdi_internal_controls
45!
46! 4157 2019-08-14 09:19:12Z suehring
47! Call doq_init from module interface
48!
49! 4132 2019-08-02 12:34:17Z suehring
50! Bugfix in masked data output for diagnostic quantities
51!
52! 4131 2019-08-02 11:06:18Z monakurppa
53! Add output of 3D plant-canopy outputs (merge from branch resler)
54!
55! 4048 2019-06-21 21:00:21Z knoop
56! Moved turbulence_closure_mod calls into this module_interface
57!
58! 4047 2019-06-21 18:58:09Z knoop
59! Introduction of the dynamics module
60!
61! 4039 2019-06-18 10:32:41Z suehring
62! Introduce diagnostic output
63!
64! 4028 2019-06-13 12:21:37Z schwenkel
65! Further modularization of particle code components
66!
67! 4017 2019-06-06 12:16:46Z schwenkel
68! local_pf need INTENT(INOUT) attribute rather than INTENT(OUT). This is
69! because INTENT(OUT) sets the array to not-defined. Especially for outputs that
70! are not defined everywhere, e.g. land-surface outputs, this will be
71! problematic as NaN will be output.
72!
73! 3987 2019-05-22 09:52:13Z kanani
74! Introduce switchable DEBUG file output via debug_message routine
75!
76! 3956 2019-05-07 12:32:52Z monakurppa
77! - Added calls for salsa_non_advective_processes and
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
83!
84! 3931 2019-04-24 16:34:28Z schwenkel
85! Changed non_transport_physics to non_advective_processes
86!
87! 3930 2019-04-24 14:57:18Z forkel
88! Correct/complete module_interface introduction for chemistry model
89!
90! 3887 2019 -04-12 08:47:41Z schwenkel
91! Changes related to global restructuring of location messages and introduction
92! of additional debug messages
93!
94! 3880 2019 -04-08 21:43:02Z knoop
95! Add a call for salsa_prognostic_equations
96!
97! 3840 2019-03-29 10:35:52Z knoop
98! bugfix: intent of dummy arguments changed to inout
99!
100! 3770 2019-02-28 11:22:32Z moh.hefny
101! removed unused variables in module_interface_check_data_output_ts
102!
103! 3767 08:18:02Z raasch
104! unused variable file_index removed from subroutine parameter list
105!
106! 3766 2019-02-26 16:23:41Z raasch
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
110!
111! 3762 2019-02-25 16:54:16Z suehring
112! only pass required arguments to surface_data_output_rrd_local
113!
114! 3747 2019-02-16 15:15:23Z gronemeier
115! Call user_init_arrays
116!
117! 3745 2019-02-15 18:57:56Z suehring
118! Add indoor model
119!
120! 3744 2019-02-15 18:38:58Z suehring
121! Removed bio_check_parameters as the method is empty.
122!
123! 3735 2019-02-12 09:52:40Z dom_dwd_user
124! Accepting variable j from check_parameters and passing it to
125! bio_check_data_output
126! Add required restart data for surface output module
127!
128! 3731 2019-02-11 13:06:27Z suehring
129! Add check_parameters routine for virtual measurements
130!
131! 3711 2019-01-31 13:44:26Z knoop
132! Introduced module_interface_init_checks for post-init checks
133!
134! 3705 2019-01-29 19:56:39Z suehring
135! Add last_actions for virtual measurements
136!
137! 3704 2019-01-29 19:51:41Z suehring
138! Some interface calls moved to module_interface + cleanup
139!
140! 3684 2019-01-20 20:20:58Z knoop
141! Bugfix: made unit intend INOUT
142!
143! 3650 2019-01-04 13:01:33Z kanani
144! Add restart routines for biometeorology
145!
146! 3649 2019-01-02 16:52:21Z suehring
147! Initialize strings, in order to avoid compiler warnings for non-initialized
148! characters with intent(out) attribute
149!
150! 3648 2019-01-02 16:35:46Z suehring
151! 3641 2018-12-23 22:10:01Z knoop
152! Initial implementation of the PALM module interface
153!
154!
155! Description:
156! ------------
157!> This is the interface between the PALM model core and all its modules.
158!>
159!> @todo Re-format module to be consistent with coding standard
160!------------------------------------------------------------------------------!
161 MODULE module_interface
162
163    USE indices,                                                               &
164        ONLY:  nbgp, nxl, nxlg, nxr, nxrg, nys, nysg, nyn, nyng, nzb, nzt
165
166    USE kinds
167
168!
169!-- load module-specific control parameters.
170!-- ToDo: move all of them to respective module or a dedicated central module
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, &
188               dynamics_boundary_conditions, &
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, &
201        ONLY:  tcm_check_parameters, &
202               tcm_check_data_output, &
203               tcm_init_arrays, &
204               tcm_init, &
205               tcm_actions, &
206               tcm_prognostic_equations, &
207               tcm_boundary_conds, &
208               tcm_swap_timelevel, &
209               tcm_3d_data_averaging, &
210               tcm_data_output_2d, &
211               tcm_data_output_3d
212
213    USE control_parameters,                                                    &
214        ONLY:  air_chemistry,                                                  &
215               biometeorology,                                                 &
216               debug_output,                                                   &
217               debug_output_timestep,                                          &
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,                                                  &
229               vdi_checks,                                                     &
230               virtual_flight,                                                 &
231               virtual_measurement,                                            &
232               wind_turbine
233
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
249
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,                                                     &
259               bcm_actions,                                                    &
260               bcm_non_advective_processes,                                    &
261               bcm_exchange_horiz,                                             &
262               bcm_prognostic_equations,                                       &
263               bcm_boundary_conditions,                                        &
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
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,                                          &
278              chem_exchange_horiz_bounds,                                      &
279              chem_init_arrays,                                                &
280              chem_init,                                                       &
281              chem_header,                                                     &
282              chem_actions,                                                    &
283              chem_non_advective_processes,                                    &
284              chem_prognostic_equations,                                       &
285              chem_boundary_conditions,                                        &
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,                                                  &
292              chem_wrd_local
293
294    USE diagnostic_output_quantities_mod,                                      &
295        ONLY:  doq_3d_data_averaging,                                          &
296               doq_check_data_output,                                          &
297               doq_define_netcdf_grid,                                         &
298               doq_init,                                                       &
299               doq_output_2d,                                                  &
300               doq_output_3d,                                                  &
301               doq_wrd_local
302!                doq_rrd_local,                                                  &
303
304    USE flight_mod,                                                            &
305        ONLY:  flight_parin,                                                   &
306               flight_header,                                                  &
307               flight_init,                                                    &
308               flight_rrd_global,                                              &
309               flight_wrd_global
310
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,                                                   &
321               gust_prognostic_equations,                                      &
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
331
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
338
339    USE lagrangian_particle_model_mod,                                         &
340        ONLY:  lpm_parin,                                                      &
341               lpm_header,                                                     &
342               lpm_check_parameters,                                           &
343               lpm_init_arrays,                                                &
344               lpm_init,                                                       &
345               lpm_actions,                                                    &
346               lpm_rrd_global,                                                 &
347               lpm_rrd_local,                                                  &
348               lpm_wrd_local,                                                  &
349               lpm_wrd_global
350
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
364
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
371
372    USE multi_agent_system_mod,                                                &
373        ONLY:  mas_parin
374
375    USE nesting_offl_mod,                                                      &
376        ONLY:  nesting_offl_parin,                                             &
377               nesting_offl_check_parameters,                                  &
378               nesting_offl_header
379
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,                                                   &
388               ocean_actions,                                                  &
389               ocean_prognostic_equations,                                     &
390               ocean_boundary_conditions,                                      &
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
399
400    USE particle_attributes,                                                   &
401        ONLY:  particle_advection
402
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,                                                     &
409               pcm_3d_data_averaging,                                          &
410               pcm_data_output_3d
411
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
426
427    USE salsa_mod,                                                             &
428        ONLY:  salsa_parin,                                                    &
429               salsa_check_parameters,                                         &
430               salsa_check_data_output_pr,                                     &
431               salsa_check_data_output,                                        &
432               salsa_init_arrays,                                              &
433               salsa_init,                                                     &
434               salsa_header,                                                   &
435               salsa_actions,                                                  &
436               salsa_non_advective_processes,                                  &
437               salsa_exchange_horiz_bounds,                                    &
438               salsa_prognostic_equations,                                     &
439               salsa_boundary_conditions,                                      &
440               salsa_swap_timelevel,                                           &
441               salsa_3d_data_averaging,                                        &
442               salsa_data_output_2d,                                           &
443               salsa_data_output_3d,                                           &
444               salsa_statistics,                                               &
445               salsa_rrd_local,                                                &
446               salsa_wrd_local
447
448    USE spectra_mod,                                                           &
449        ONLY:  calculate_spectra,                                              &
450               spectra_parin,                                                  &
451               spectra_check_parameters,                                       &
452               spectra_header
453
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
462
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
469
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
480
481    USE vdi_internal_controls,                                                 &
482        ONLY:  vdi_actions
483               
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
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
519
520    IMPLICIT NONE
521
522    PRIVATE
523
524!
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,                                               &
539       module_interface_non_advective_processes,                               &
540       module_interface_exchange_horiz,                                        &
541       module_interface_prognostic_equations,                                  &
542       module_interface_boundary_conditions,                                   &
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
553
554
555    INTERFACE module_interface_parin
556       MODULE PROCEDURE module_interface_parin
557    END INTERFACE module_interface_parin
558
559    INTERFACE module_interface_check_parameters
560       MODULE PROCEDURE module_interface_check_parameters
561    END INTERFACE module_interface_check_parameters
562
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
566
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
570
571    INTERFACE module_interface_check_data_output
572       MODULE PROCEDURE module_interface_check_data_output
573    END INTERFACE module_interface_check_data_output
574
575    INTERFACE module_interface_init_masks
576       MODULE PROCEDURE module_interface_init_masks
577    END INTERFACE module_interface_init_masks
578
579    INTERFACE module_interface_define_netcdf_grid
580       MODULE PROCEDURE module_interface_define_netcdf_grid
581    END INTERFACE module_interface_define_netcdf_grid
582
583    INTERFACE module_interface_init_arrays
584       MODULE PROCEDURE module_interface_init_arrays
585    END INTERFACE module_interface_init_arrays
586
587    INTERFACE module_interface_init
588       MODULE PROCEDURE module_interface_init
589    END INTERFACE module_interface_init
590
591    INTERFACE module_interface_init_checks
592       MODULE PROCEDURE module_interface_init_checks
593    END INTERFACE module_interface_init_checks
594
595    INTERFACE module_interface_header
596       MODULE PROCEDURE module_interface_header
597    END INTERFACE module_interface_header
598
599    INTERFACE module_interface_actions
600       MODULE PROCEDURE module_interface_actions
601       MODULE PROCEDURE module_interface_actions_ij
602    END INTERFACE module_interface_actions
603
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
608
609    INTERFACE module_interface_exchange_horiz
610       MODULE PROCEDURE module_interface_exchange_horiz
611    END INTERFACE module_interface_exchange_horiz
612
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
618    INTERFACE module_interface_swap_timelevel
619       MODULE PROCEDURE module_interface_swap_timelevel
620    END INTERFACE module_interface_swap_timelevel
621
622    INTERFACE module_interface_boundary_conditions
623       MODULE PROCEDURE module_interface_boundary_conditions
624    END INTERFACE module_interface_boundary_conditions
625
626    INTERFACE module_interface_3d_data_averaging
627       MODULE PROCEDURE module_interface_3d_data_averaging
628    END INTERFACE module_interface_3d_data_averaging
629
630    INTERFACE module_interface_data_output_2d
631       MODULE PROCEDURE module_interface_data_output_2d
632    END INTERFACE module_interface_data_output_2d
633
634    INTERFACE module_interface_data_output_3d
635       MODULE PROCEDURE module_interface_data_output_3d
636    END INTERFACE module_interface_data_output_3d
637
638    INTERFACE module_interface_statistics
639       MODULE PROCEDURE module_interface_statistics
640    END INTERFACE module_interface_statistics
641
642    INTERFACE module_interface_rrd_global
643       MODULE PROCEDURE module_interface_rrd_global
644    END INTERFACE module_interface_rrd_global
645
646    INTERFACE module_interface_wrd_global
647       MODULE PROCEDURE module_interface_wrd_global
648    END INTERFACE module_interface_wrd_global
649
650    INTERFACE module_interface_rrd_local
651       MODULE PROCEDURE module_interface_rrd_local
652    END INTERFACE module_interface_rrd_local
653
654    INTERFACE module_interface_wrd_local
655       MODULE PROCEDURE module_interface_wrd_local
656    END INTERFACE module_interface_wrd_local
657
658    INTERFACE module_interface_last_actions
659       MODULE PROCEDURE module_interface_last_actions
660    END INTERFACE module_interface_last_actions
661
662
663 CONTAINS
664
665
666!------------------------------------------------------------------------------!
667! Description:
668! ------------
669!> Read module-specific parameter namelists
670!------------------------------------------------------------------------------!
671 SUBROUTINE module_interface_parin
672
673
674    IF ( debug_output )  CALL debug_message( 'reading module-specific parameters', 'start' )
675
676    CALL dynamics_parin
677
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
684    CALL lpm_parin
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
699
700    CALL user_parin
701
702    IF ( debug_output )  CALL debug_message( 'reading module-specific parameters', 'end' )
703
704
705 END SUBROUTINE module_interface_parin
706
707
708!------------------------------------------------------------------------------!
709! Description:
710! ------------
711!> Perform module-specific initialization checks
712!------------------------------------------------------------------------------!
713 SUBROUTINE module_interface_check_parameters
714
715
716    IF ( debug_output )  CALL debug_message( 'checking module-specific parameters', 'start' )
717
718    CALL dynamics_check_parameters
719    CALL tcm_check_parameters
720
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
725    IF ( particle_advection )   CALL lpm_check_parameters
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
739
740    IF ( user_module_enabled )  CALL user_check_parameters
741
742    IF ( debug_output )  CALL debug_message( 'checking module-specific parameters', 'end' )
743
744
745 END SUBROUTINE module_interface_check_parameters
746
747
748!------------------------------------------------------------------------------!
749! Description:
750! ------------
751!> Check module-specific data output of timeseries
752!------------------------------------------------------------------------------!
753 SUBROUTINE module_interface_check_data_output_ts( dots_max, dots_num, dots_label, dots_unit )
754
755
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
760
761
762    IF ( debug_output )  CALL debug_message( 'checking module-specific data output ts', 'start' )
763
764    CALL dynamics_check_data_output_ts( dots_max, dots_num, dots_label, dots_unit )
765
766    IF ( radiation )  THEN
767       CALL radiation_check_data_output_ts( dots_max, dots_num )
768    ENDIF
769
770    IF ( user_module_enabled )  THEN
771       CALL user_check_data_output_ts( dots_max, dots_num, dots_label, dots_unit )
772    ENDIF
773
774    IF ( debug_output )  CALL debug_message( 'checking module-specific data output ts', 'end' )
775
776
777 END SUBROUTINE module_interface_check_data_output_ts
778
779
780!------------------------------------------------------------------------------!
781! Description:
782! ------------
783!> Check module-specific data output of profiles
784!------------------------------------------------------------------------------!
785 SUBROUTINE module_interface_check_data_output_pr( variable, var_count, unit,  &
786                                                   dopr_unit )
787
788
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
793
794
795    IF ( debug_output )  CALL debug_message( 'checking module-specific data output pr', 'start' )
796
797    CALL dynamics_check_data_output_pr( variable, var_count, unit, dopr_unit )
798
799    IF ( unit == 'illegal' .AND.  bulk_cloud_model )  THEN
800       CALL bcm_check_data_output_pr( variable, var_count, unit, dopr_unit )
801    ENDIF
802
803    IF ( unit == 'illegal' .AND.  air_chemistry )  THEN
804       CALL chem_check_data_output_pr( variable, var_count, unit, dopr_unit )
805    ENDIF
806
807    IF ( unit == 'illegal'  .AND.  gust_module_enabled  )  THEN
808       CALL gust_check_data_output_pr( variable, var_count, unit, dopr_unit )
809    ENDIF
810
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
814
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
818
819    IF ( unit == 'illegal'  .AND.  ocean_mode )  THEN
820       CALL ocean_check_data_output_pr( variable, var_count, unit, dopr_unit )
821    ENDIF
822
823    IF ( unit == 'illegal'  .AND.  radiation )  THEN
824       CALL radiation_check_data_output_pr( variable, var_count, unit, dopr_unit )
825    ENDIF
826
827    IF ( unit == 'illegal'  .AND.  salsa )  THEN
828       CALL salsa_check_data_output_pr( variable, var_count, unit, dopr_unit )
829    ENDIF
830
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
835
836    IF ( debug_output )  CALL debug_message( 'checking module-specific data output pr', 'end' )
837
838
839 END SUBROUTINE module_interface_check_data_output_pr
840
841!------------------------------------------------------------------------------!
842! Description:
843! ------------
844!> Check module-specific 2D and 3D data output
845!------------------------------------------------------------------------------!
846 SUBROUTINE module_interface_check_data_output( variable, unit, i, j, ilen, k )
847
848
849    CHARACTER (LEN=*), INTENT(IN)    ::  variable !< variable name
850    CHARACTER (LEN=*), INTENT(INOUT) ::  unit     !< physical unit of variable
851
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
856
857
858    IF ( debug_output )  CALL debug_message( 'checking module-specific data output 2d/3d', 'start' )
859
860    CALL dynamics_check_data_output( variable, unit )
861
862    CALL tcm_check_data_output( variable, unit )
863
864    IF ( unit == 'illegal'  .AND.  biometeorology )  THEN
865       CALL bio_check_data_output( variable, unit, i, j, ilen, k )
866    ENDIF
867
868    IF ( unit == 'illegal'  .AND.  bulk_cloud_model  )  THEN
869       CALL bcm_check_data_output( variable, unit )
870    ENDIF
871
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
876
877    IF ( unit == 'illegal' )  THEN
878       CALL doq_check_data_output( variable, unit, i, ilen, k )
879    ENDIF
880
881    IF ( unit == 'illegal'  .AND.  gust_module_enabled  )  THEN
882       CALL gust_check_data_output( variable, unit )
883    ENDIF
884
885    IF ( unit == 'illegal' )  THEN  ! ToDo: add module switch if possible
886       CALL lsm_check_data_output( variable, unit, i, ilen, k )
887    ENDIF
888
889    IF ( unit == 'illegal'  .AND.  ocean_mode )  THEN
890       CALL ocean_check_data_output( variable, unit )
891    ENDIF
892
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
897
898    IF ( unit == 'illegal'  .AND.  radiation )  THEN
899       CALL radiation_check_data_output( variable, unit, i, ilen, k )
900    ENDIF
901
902    IF ( unit == 'illegal' .AND. salsa ) THEN
903       CALL salsa_check_data_output( variable, unit )
904    ENDIF
905
906    IF ( unit == 'illegal' .AND. indoor_model ) THEN
907       CALL im_check_data_output( variable, unit )
908    ENDIF
909
910    IF ( unit == 'illegal'  .AND.  urban_surface                      &
911        .AND.  variable(1:4) == 'usm_' )  THEN  ! ToDo: remove aditional conditions
912       CALL usm_check_data_output( variable, unit )
913    ENDIF
914
915    IF ( unit == 'illegal'  .AND.  user_module_enabled )  THEN
916       unit = ''
917       CALL user_check_data_output( variable, unit )
918    ENDIF
919
920    IF ( debug_output )  CALL debug_message( 'checking module-specific data output 2d/3d', 'end' )
921
922
923 END SUBROUTINE module_interface_check_data_output
924
925
926!------------------------------------------------------------------------------!
927!
928! Description:
929! ------------
930!> Interface for init_masks. ToDo: get rid of these redundant calls!
931!------------------------------------------------------------------------------!
932 SUBROUTINE module_interface_init_masks( variable, unit )
933
934
935    CHARACTER (LEN=*), INTENT(IN)    ::  variable !< variable name
936    CHARACTER (LEN=*), INTENT(INOUT) ::  unit     !< physical unit of variable
937
938
939    IF ( debug_output )  CALL debug_message( 'initializing module-specific masks', 'start' )
940
941    CALL dynamics_init_masks( variable, unit )
942
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
947   
948    IF ( unit == 'illegal' )  THEN
949       CALL doq_check_data_output( variable, unit )
950    ENDIF
951
952    IF ( unit == 'illegal'  .AND.  radiation )  THEN
953       CALL radiation_check_data_output( variable, unit, 0, 0, 0 )
954    ENDIF
955
956    IF ( unit == 'illegal'  .AND.  salsa )  THEN
957       CALL salsa_check_data_output( variable, unit )
958    ENDIF
959
960    IF ( unit == 'illegal'  .AND.  user_module_enabled )  THEN
961       unit = ''
962       CALL user_check_data_output( variable, unit )
963    ENDIF
964
965    IF ( debug_output )  CALL debug_message( 'initializing module-specific masks', 'end' )
966
967
968 END SUBROUTINE module_interface_init_masks
969
970
971!------------------------------------------------------------------------------!
972!
973! Description:
974! ------------
975!> Define appropriate grid for module-specific netcdf output variables.
976!------------------------------------------------------------------------------!
977 SUBROUTINE module_interface_define_netcdf_grid( var, found,                   &
978                                                 grid_x, grid_y, grid_z )
979
980
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
986
987
988    IF ( debug_output )  CALL debug_message( 'defining module-specific netcdf grids', 'start' )
989!
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
999
1000    IF ( debug_output )  CALL debug_message( 'defining module-specific netcdf grids', 'end' )
1001
1002
1003 END SUBROUTINE module_interface_define_netcdf_grid
1004
1005
1006!------------------------------------------------------------------------------!
1007! Description:
1008! ------------
1009!> Allocate module-specific arrays and pointers
1010!------------------------------------------------------------------------------!
1011 SUBROUTINE module_interface_init_arrays
1012
1013
1014    IF ( debug_output )  CALL debug_message( 'initializing module-specific arrays', 'start' )
1015
1016    CALL dynamics_init_arrays
1017    CALL tcm_init_arrays
1018
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
1022    IF ( particle_advection  )  CALL lpm_init_arrays
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
1029
1030    IF ( user_module_enabled )  CALL user_init_arrays
1031
1032    IF ( debug_output )  CALL debug_message( 'initializing module-specific arrays', 'end' )
1033
1034
1035 END SUBROUTINE module_interface_init_arrays
1036
1037
1038!------------------------------------------------------------------------------!
1039! Description:
1040! ------------
1041!> Perform module-specific initialization
1042!------------------------------------------------------------------------------!
1043 SUBROUTINE module_interface_init
1044
1045
1046    IF ( debug_output )  CALL debug_message( 'module-specific initialization', 'start' )
1047
1048    CALL dynamics_init
1049    CALL tcm_init
1050
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
1057    IF ( particle_advection  )  CALL lpm_init
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
1068
1069    CALL doq_init
1070
1071    IF ( user_module_enabled )  CALL user_init
1072
1073    IF ( debug_output )  CALL debug_message( 'module-specific initialization', 'end' )
1074
1075
1076 END SUBROUTINE module_interface_init
1077
1078
1079!------------------------------------------------------------------------------!
1080! Description:
1081! ------------
1082!> Perform module-specific post-initialization checks
1083!------------------------------------------------------------------------------!
1084 SUBROUTINE module_interface_init_checks
1085
1086
1087    IF ( debug_output )  CALL debug_message( 'module-specific post-initialization checks', 'start' )
1088
1089    CALL dynamics_init_checks
1090
1091    IF ( biometeorology      )  CALL bio_init_checks
1092
1093    IF ( debug_output )  CALL debug_message( 'module-specific post-initialization checks', 'end' )
1094
1095
1096 END SUBROUTINE module_interface_init_checks
1097
1098
1099!------------------------------------------------------------------------------!
1100! Description:
1101! ------------
1102!> Gather module-specific header output
1103!------------------------------------------------------------------------------!
1104 SUBROUTINE module_interface_header( io )
1105
1106
1107    INTEGER(iwp), INTENT(IN) ::  io  !< unit of the output file
1108
1109
1110    IF ( debug_output )  CALL debug_message( 'module-specific header output', 'start' )
1111
1112    CALL dynamics_header( io )
1113
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 )
1119    IF ( particle_advection  )  CALL lpm_header( io )
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 )
1129
1130    IF ( user_module_enabled )  CALL user_header( io )
1131
1132    IF ( debug_output )  CALL debug_message( 'module-specific header output', 'end' )
1133
1134
1135 END SUBROUTINE module_interface_header
1136
1137
1138!------------------------------------------------------------------------------!
1139! Description:
1140! ------------
1141!> Perform module-specific actions while in time-integration (vector-optimized)
1142!------------------------------------------------------------------------------!
1143 SUBROUTINE module_interface_actions( location )
1144
1145
1146    CHARACTER (LEN=*), INTENT(IN) ::  location !< call location string
1147
1148    CALL dynamics_actions( location )
1149    CALL tcm_actions( location )
1150
1151    IF ( bulk_cloud_model    )  CALL bcm_actions( location )
1152    IF ( air_chemistry       )  CALL chem_actions( location )
1153    IF ( gust_module_enabled )  CALL gust_actions( location )
1154    IF ( particle_advection  )  CALL lpm_actions( location )
1155    IF ( ocean_mode          )  CALL ocean_actions( location )
1156    IF ( salsa               )  CALL salsa_actions( location )
1157    IF ( wind_turbine        )  CALL wtm_actions( location )
1158
1159    IF ( user_module_enabled )  CALL user_actions( location )
1160    IF ( vdi_checks          )  CALL vdi_actions( location )
1161
1162
1163 END SUBROUTINE module_interface_actions
1164
1165
1166!------------------------------------------------------------------------------!
1167! Description:
1168! ------------
1169!> Perform module-specific actions while in time-integration (cache-optimized)
1170!------------------------------------------------------------------------------!
1171 SUBROUTINE module_interface_actions_ij( i, j, location )
1172
1173
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
1177
1178    CALL dynamics_actions( i, j, location )
1179    CALL tcm_actions( i, j, location )
1180
1181    IF ( bulk_cloud_model    )  CALL bcm_actions( i, j, location )
1182    IF ( air_chemistry       )  CALL chem_actions( i, j, location )
1183    IF ( gust_module_enabled )  CALL gust_actions( i, j, location )
1184    IF ( ocean_mode          )  CALL ocean_actions( i, j, location )
1185    IF ( salsa               )  CALL salsa_actions( i, j, location )
1186    IF ( wind_turbine        )  CALL wtm_actions( i, j, location )
1187
1188    IF ( user_module_enabled )  CALL user_actions( i, j, location )
1189
1190
1191 END SUBROUTINE module_interface_actions_ij
1192
1193
1194!------------------------------------------------------------------------------!
1195! Description:
1196! ------------
1197!> Compute module-specific non_advective_processes (vector-optimized)
1198!------------------------------------------------------------------------------!
1199 SUBROUTINE module_interface_non_advective_processes
1200
1201
1202    CALL dynamics_non_advective_processes
1203
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
1207
1208
1209 END SUBROUTINE module_interface_non_advective_processes
1210
1211
1212!------------------------------------------------------------------------------!
1213! Description:
1214! ------------
1215!> Compute module-specific non_advective_processes (cache-optimized)
1216!------------------------------------------------------------------------------!
1217 SUBROUTINE module_interface_non_advective_processes_ij( i, j )
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
1223    CALL dynamics_non_advective_processes( i, j )
1224
1225    IF ( bulk_cloud_model    )  CALL bcm_non_advective_processes( i, j )
1226    IF ( air_chemistry       )  CALL chem_non_advective_processes( i, j )
1227    IF ( salsa               )  CALL salsa_non_advective_processes( i, j )
1228
1229
1230 END SUBROUTINE module_interface_non_advective_processes_ij
1231
1232!------------------------------------------------------------------------------!
1233! Description:
1234! ------------
1235!> Exchange horiz for module-specific quantities
1236!------------------------------------------------------------------------------!
1237 SUBROUTINE module_interface_exchange_horiz
1238
1239
1240    IF ( debug_output_timestep )  CALL debug_message( 'module-specific exchange_horiz', 'start' )
1241
1242    CALL dynamics_exchange_horiz
1243
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
1248    IF ( debug_output_timestep )  CALL debug_message( 'module-specific exchange_horiz', 'end' )
1249
1250
1251 END SUBROUTINE module_interface_exchange_horiz
1252
1253
1254!------------------------------------------------------------------------------!
1255! Description:
1256! ------------
1257!> Compute module-specific prognostic_equations (vector-optimized)
1258!------------------------------------------------------------------------------!
1259 SUBROUTINE module_interface_prognostic_equations
1260
1261
1262    CALL dynamics_prognostic_equations
1263    CALL tcm_prognostic_equations
1264
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
1270
1271
1272 END SUBROUTINE module_interface_prognostic_equations
1273
1274
1275!------------------------------------------------------------------------------!
1276! Description:
1277! ------------
1278!> Compute module-specific prognostic_equations (cache-optimized)
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
1288    CALL dynamics_prognostic_equations( i, j, i_omp_start, tn )
1289    CALL tcm_prognostic_equations( i, j, i_omp_start, tn )
1290
1291    IF ( bulk_cloud_model    )  CALL bcm_prognostic_equations( i, j, i_omp_start, tn )
1292    IF ( air_chemistry       )  CALL chem_prognostic_equations( i, j, i_omp_start, tn )
1293    IF ( gust_module_enabled )  CALL gust_prognostic_equations( i, j, i_omp_start, tn )
1294    IF ( ocean_mode          )  CALL ocean_prognostic_equations( i, j, i_omp_start, tn )
1295    IF ( salsa               )  CALL salsa_prognostic_equations( i, j, i_omp_start, tn )
1296
1297
1298 END SUBROUTINE module_interface_prognostic_equations_ij
1299
1300!------------------------------------------------------------------------------!
1301! Description:
1302! ------------
1303!> Compute module-specific boundary conditions
1304!------------------------------------------------------------------------------!
1305 SUBROUTINE module_interface_boundary_conditions
1306
1307
1308    IF ( debug_output_timestep )  CALL debug_message( 'module-specific boundary_conditions', 'start' )
1309
1310    CALL dynamics_boundary_conditions
1311    CALL tcm_boundary_conds
1312
1313    IF ( bulk_cloud_model    )  CALL bcm_boundary_conditions
1314    IF ( air_chemistry       )  CALL chem_boundary_conditions
1315    IF ( ocean_mode          )  CALL ocean_boundary_conditions
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
1323!------------------------------------------------------------------------------!
1324! Description:
1325! ------------
1326!> Swap the timelevel pointers for module-specific arrays
1327!------------------------------------------------------------------------------!
1328 SUBROUTINE module_interface_swap_timelevel ( swap_mode )
1329
1330
1331    INTEGER(iwp), INTENT(IN) :: swap_mode !< determines procedure of pointer swap
1332
1333
1334    IF ( debug_output_timestep )  CALL debug_message( 'module-specific swap timelevel', 'start' )
1335
1336    CALL dynamics_swap_timelevel( swap_mode )
1337    CALL tcm_swap_timelevel( swap_mode )
1338
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 )
1346
1347    IF ( debug_output_timestep )  CALL debug_message( 'module-specific swap timelevel', 'end' )
1348
1349
1350 END SUBROUTINE module_interface_swap_timelevel
1351
1352
1353!------------------------------------------------------------------------------!
1354!
1355! Description:
1356! ------------
1357!> Perform module-specific averaging of 3D data
1358!------------------------------------------------------------------------------!
1359 SUBROUTINE module_interface_3d_data_averaging( mode, variable )
1360
1361
1362    CHARACTER (LEN=*), INTENT(IN) ::  mode     !< averaging interface mode
1363    CHARACTER (LEN=*), INTENT(IN) ::  variable !< variable name
1364
1365
1366    IF ( debug_output_timestep )  CALL debug_message( 'module-specific 3d data averaging', 'start' )
1367
1368    CALL dynamics_3d_data_averaging( mode, variable )
1369    CALL tcm_3d_data_averaging( mode, variable )
1370
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 )
1374    CALL doq_3d_data_averaging( mode, variable )  ! ToDo: this seems to be not according to the design
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 )
1378    IF ( plant_canopy        )  CALL pcm_3d_data_averaging( mode, variable )
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 )
1382
1383    IF ( user_module_enabled )  CALL user_3d_data_averaging( mode, variable )
1384
1385    IF ( debug_output_timestep )  CALL debug_message( 'module-specific 3d data averaging', 'end' )
1386
1387
1388 END SUBROUTINE module_interface_3d_data_averaging
1389
1390!------------------------------------------------------------------------------!
1391!
1392! Description:
1393! ------------
1394!> Define module-specific 2D output variables
1395!------------------------------------------------------------------------------!
1396 SUBROUTINE module_interface_data_output_2d( av, variable, found, grid, mode,  &
1397                                             local_pf, two_d, nzb_do, nzt_do,  &
1398                                             fill_value )
1399
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
1409
1410    REAL(wp), DIMENSION(nxl:nxr,nys:nyn,nzb_do:nzt_do), INTENT(INOUT) ::  local_pf !< ToDo: can also be kind=sp
1411
1412
1413    IF ( debug_output_timestep )  CALL debug_message( 'module-specific 2d data output', 'start' )
1414
1415    CALL dynamics_data_output_2d(                                                  &
1416               av, variable, found, grid, mode, local_pf, two_d, nzb_do, nzt_do, fill_value &
1417            )
1418
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
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
1430
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
1436
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
1442
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
1448
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
1454
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
1460
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
1466
1467    IF ( .NOT. found  .AND.  radiation )  THEN
1468       CALL radiation_data_output_2d(                                          &
1469               av, variable, found, grid, mode, local_pf, two_d, nzb_do, nzt_do&
1470            )
1471    ENDIF
1472
1473    IF ( .NOT. found  .AND.  salsa )  THEN
1474       CALL salsa_data_output_2d(                                              &
1475               av, variable, found, grid, mode, local_pf, two_d, nzb_do, nzt_do&
1476            )
1477    ENDIF
1478
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
1484
1485    IF ( debug_output_timestep )  CALL debug_message( 'module-specific 2d data output', 'end' )
1486
1487
1488 END SUBROUTINE module_interface_data_output_2d
1489
1490
1491!------------------------------------------------------------------------------!
1492!
1493! Description:
1494! ------------
1495!> Define module-specific 3D output variables
1496!------------------------------------------------------------------------------!
1497 SUBROUTINE module_interface_data_output_3d( av, variable, found, local_pf,    &
1498                                             fill_value, resorted, nzb_do, nzt_do )
1499
1500
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)
1508
1509    REAL(sp), DIMENSION(nxl:nxr,nys:nyn,nzb_do:nzt_do), INTENT(INOUT) ::  local_pf
1510
1511
1512    IF ( debug_output_timestep )  CALL debug_message( 'module-specific 3d data output', 'start' )
1513
1514    CALL dynamics_data_output_3d( av, variable, found, local_pf, fill_value, nzb_do, nzt_do )
1515    resorted = .FALSE.
1516
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
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
1526
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
1531
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
1536
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
1541
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
1546
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
1551
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
1556
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
1561
1562    IF ( .NOT. found  .AND.  radiation )  THEN
1563       CALL radiation_data_output_3d( av, variable, found, local_pf, nzb_do, nzt_do )
1564       resorted = .TRUE.
1565    ENDIF
1566
1567    IF ( .NOT. found  .AND.  salsa )  THEN
1568       CALL salsa_data_output_3d( av, variable, found, local_pf, nzb_do, nzt_do )
1569       resorted = .TRUE.
1570    ENDIF
1571
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
1576
1577    IF ( debug_output_timestep )  CALL debug_message( 'module-specific 3d data output', 'end' )
1578
1579
1580 END SUBROUTINE module_interface_data_output_3d
1581
1582
1583!------------------------------------------------------------------------------!
1584! Description:
1585! ------------
1586!> Compute module-specific profile and timeseries data
1587!------------------------------------------------------------------------------!
1588 SUBROUTINE module_interface_statistics( mode, sr, tn, dots_max )
1589
1590
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
1595
1596
1597    IF ( debug_output_timestep )  CALL debug_message( 'module-specific statistics', 'start' )
1598
1599    CALL dynamics_statistics( mode, sr, tn )
1600
1601    IF ( gust_module_enabled )  CALL gust_statistics( mode, sr, tn, dots_max )
1602    IF ( air_chemistry       )  CALL chem_statistics( mode, sr, tn )
1603    IF ( salsa               )  CALL salsa_statistics( mode, sr, tn )
1604
1605    IF ( user_module_enabled )  CALL user_statistics( mode, sr, tn )
1606
1607    IF ( debug_output_timestep )  CALL debug_message( 'module-specific statistics', 'end' )
1608
1609
1610 END SUBROUTINE module_interface_statistics
1611
1612
1613!------------------------------------------------------------------------------!
1614! Description:
1615! ------------
1616!> Read module-specific restart data globaly shared by all MPI ranks
1617!------------------------------------------------------------------------------!
1618 SUBROUTINE module_interface_rrd_global( found )
1619
1620
1621    LOGICAL, INTENT(INOUT) ::  found    !< flag if variable was found
1622
1623
1624    IF ( debug_output )  CALL debug_message( 'module-specific read global restart data', 'start' )
1625
1626    CALL dynamics_rrd_global( found ) ! ToDo: change interface to pass variable
1627
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
1632    IF ( .NOT. found )  CALL lpm_rrd_global( found ) ! ToDo: change interface to pass variable
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 )
1637
1638    IF ( .NOT. found )  CALL user_rrd_global( found ) ! ToDo: change interface to pass variable
1639
1640    IF ( debug_output )  CALL debug_message( 'module-specific read global restart data', 'end' )
1641
1642
1643 END SUBROUTINE module_interface_rrd_global
1644
1645
1646!------------------------------------------------------------------------------!
1647! Description:
1648! ------------
1649!> Write module-specific restart data globaly shared by all MPI ranks
1650!------------------------------------------------------------------------------!
1651 SUBROUTINE module_interface_wrd_global
1652
1653
1654    IF ( debug_output )  CALL debug_message( 'module-specific write global restart data', 'start' )
1655
1656    CALL dynamics_wrd_global
1657
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
1666
1667    IF ( user_module_enabled )  CALL user_wrd_global
1668
1669    IF ( debug_output )  CALL debug_message( 'module-specific write global restart data', 'end' )
1670
1671
1672 END SUBROUTINE module_interface_wrd_global
1673
1674
1675!------------------------------------------------------------------------------!
1676! Description:
1677! ------------
1678!> Read module-specific restart data specific to local MPI ranks
1679!------------------------------------------------------------------------------!
1680 SUBROUTINE module_interface_rrd_local( map_index,                             &
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 )
1686
1687
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
1702
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   !<
1709
1710
1711    IF ( debug_output )  CALL debug_message( 'module-specific read local restart data', 'start' )
1712
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
1722    IF ( .NOT. found )  CALL bio_rrd_local(                                    &
1723                               found                                           &
1724                            )
1725
1726    IF ( .NOT. found )  CALL bcm_rrd_local(                                    &
1727                               map_index,                                      &
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
1734
1735    IF ( .NOT. found )  CALL chem_rrd_local(                                   &
1736                               map_index,                                      &
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
1743
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
1752
1753    IF ( .NOT. found )  CALL gust_rrd_local(                                   &
1754                               map_index,                                      &
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
1761
1762    IF ( .NOT. found )  CALL lpm_rrd_local(                                    &
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
1771    IF ( .NOT. found )  CALL lsm_rrd_local(                                    &
1772                               map_index,                                      &
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
1779
1780    IF ( .NOT. found )  CALL ocean_rrd_local(                                  &
1781                               map_index,                                      &
1782                               nxlf, nxlc, nxl_on_file,                        &
1783                               nxrf, nxrc, nxr_on_file,                        &
1784                               nynf, nync, nyn_on_file,                        &
1785                               nysf, nysc, nys_on_file,                        &
1786                               tmp_3d, found                                   &
1787                            ) ! ToDo: change interface to pass variable
1788
1789    IF ( .NOT. found )  CALL radiation_rrd_local(                              &
1790                               map_index,                                      &
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
1797
1798    IF ( .NOT. found )  CALL salsa_rrd_local(                                  &
1799                               map_index,                                      &
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
1806
1807    IF ( .NOT. found )  CALL usm_rrd_local(                                    &
1808                               map_index,                                      &
1809                               nxlf, nxlc, nxl_on_file,                        &
1810                               nxrf, nxr_on_file,                              &
1811                               nynf, nyn_on_file,                              &
1812                               nysf, nysc, nys_on_file,                        &
1813                               found                                           &
1814                            ) ! ToDo: change interface to pass variable
1815!
1816!-- Surface data do not need overlap data, so do not pass these information.
1817    IF ( .NOT. found )  CALL surface_data_output_rrd_local( found )
1818
1819    IF ( .NOT. found )  CALL user_rrd_local(                                   &
1820                               map_index,                                      &
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
1827
1828    IF ( debug_output )  CALL debug_message( 'module-specific read local restart data', 'end' )
1829
1830
1831 END SUBROUTINE module_interface_rrd_local
1832
1833
1834!------------------------------------------------------------------------------!
1835! Description:
1836! ------------
1837!> Write module-specific restart data specific to local MPI ranks
1838!------------------------------------------------------------------------------!
1839 SUBROUTINE module_interface_wrd_local
1840
1841
1842    IF ( debug_output )  CALL debug_message( 'module-specific write local restart data', 'start' )
1843
1844    CALL dynamics_wrd_local
1845
1846    IF ( biometeorology )       CALL bio_wrd_local
1847    IF ( bulk_cloud_model )     CALL bcm_wrd_local
1848    IF ( air_chemistry )        CALL chem_wrd_local
1849    CALL doq_wrd_local
1850    IF ( gust_module_enabled )  CALL gust_wrd_local
1851    IF ( particle_advection )   CALL lpm_wrd_local
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
1858
1859    IF ( user_module_enabled )  CALL user_wrd_local
1860
1861    IF ( debug_output )  CALL debug_message( 'module-specific write local restart data', 'end' )
1862
1863
1864 END SUBROUTINE module_interface_wrd_local
1865
1866
1867!------------------------------------------------------------------------------!
1868! Description:
1869! ------------
1870!> Perform module-specific last actions before the program terminates
1871!------------------------------------------------------------------------------!
1872 SUBROUTINE module_interface_last_actions
1873
1874
1875    IF ( debug_output )  CALL debug_message( 'module-specific last actions', 'start' )
1876
1877    CALL dynamics_last_actions
1878
1879    IF ( virtual_measurement )  CALL vm_last_actions
1880
1881    IF ( user_module_enabled )  CALL user_last_actions
1882
1883    IF ( debug_output )  CALL debug_message( 'module-specific last actions', 'end' )
1884
1885
1886 END SUBROUTINE module_interface_last_actions
1887
1888
1889 END MODULE module_interface
Note: See TracBrowser for help on using the repository browser.