source: palm/trunk/SOURCE/time_integration.f90 @ 1852

Last change on this file since 1852 was 1852, checked in by hoffmann, 8 years ago

last commit documented

  • Property svn:keywords set to Id
File size: 43.9 KB
RevLine 
[1682]1!> @file time_integration.f90
[1036]2!--------------------------------------------------------------------------------!
3! This file is part of PALM.
4!
5! PALM is free software: you can redistribute it and/or modify it under the terms
6! of the GNU General Public License as published by the Free Software Foundation,
7! either version 3 of the License, or (at your option) any later version.
8!
9! PALM is distributed in the hope that it will be useful, but WITHOUT ANY
10! WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
11! A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
12!
13! You should have received a copy of the GNU General Public License along with
14! PALM. If not, see <http://www.gnu.org/licenses/>.
15!
[1818]16! Copyright 1997-2016 Leibniz Universitaet Hannover
[1036]17!--------------------------------------------------------------------------------!
18!
[484]19! Current revisions:
[1092]20! ------------------
[1852]21!
22!
[1366]23! Former revisions:
24! -----------------
25! $Id: time_integration.f90 1852 2016-04-08 14:07:36Z hoffmann $
26!
[1851]27! 1849 2016-04-08 11:33:18Z hoffmann
28! Adapted for modularization of microphysics
29!
[1834]30! 1833 2016-04-07 14:23:03Z raasch
31! spectrum renamed spectra_mod, spectra related variables moved to spectra_mod
32!
[1832]33! 1831 2016-04-07 13:15:51Z hoffmann
34! turbulence renamed collision_turbulence
35!
[1823]36! 1822 2016-04-07 07:49:42Z hoffmann
37! icloud_scheme replaced by microphysics_*
38!
[1809]39! 1808 2016-04-05 19:44:00Z raasch
40! output message in case unscheduled radiation calls removed
41!
[1798]42! 1797 2016-03-21 16:50:28Z raasch
43! introduction of different datatransfer modes
44!
[1792]45! 1791 2016-03-11 10:41:25Z raasch
46! call of pmci_update_new removed
47!
[1787]48! 1786 2016-03-08 05:49:27Z raasch
49! +module spectrum
50!
[1784]51! 1783 2016-03-06 18:36:17Z raasch
52! switch back of netcdf data format for mask output moved to the mask output
53! routine
54!
[1782]55! 1781 2016-03-03 15:12:23Z raasch
56! some pmc calls removed at the beginning (before timeloop),
57! pmc initialization moved to the main program
58!
[1765]59! 1764 2016-02-28 12:45:19Z raasch
60! PMC_ACTIVE flags removed,
61! bugfix: nest synchronization after first call of timestep
62!
[1763]63! 1762 2016-02-25 12:31:13Z hellstea
64! Introduction of nested domain feature
65!
[1737]66! 1736 2015-12-04 08:56:33Z raasch
67! no perturbations added to total domain if energy limit has been set zero
68!
[1692]69! 1691 2015-10-26 16:17:44Z maronga
70! Added option for spin-ups without land surface and radiation models. Moved calls
71! for radiation and lan surface schemes.
72!
[1683]73! 1682 2015-10-07 23:56:08Z knoop
74! Code annotations made doxygen readable
75!
[1672]76! 1671 2015-09-25 03:29:37Z raasch
77! bugfix: ghostpoint exchange for array diss in case that sgs velocities are used
78! for particles
79!
[1586]80! 1585 2015-04-30 07:05:52Z maronga
81! Moved call of radiation scheme. Added support for RRTM
82!
[1552]83! 1551 2015-03-03 14:18:16Z maronga
84! Added interface for different radiation schemes.
85!
[1497]86! 1496 2014-12-02 17:25:50Z maronga
87! Added calls for the land surface model and radiation scheme
88!
[1403]89! 1402 2014-05-09 14:25:13Z raasch
90! location messages modified
91!
[1385]92! 1384 2014-05-02 14:31:06Z raasch
93! location messages added
94!
[1381]95! 1380 2014-04-28 12:40:45Z heinze
96! CALL of nudge_ref added
97! bc_pt_t_val and bc_q_t_val are updated in case nudging is used
98!
[1366]99! 1365 2014-04-22 15:03:56Z boeske
[1365]100! Reset sums_ls_l to zero at each timestep
101! +sums_ls_l
102! Calculation of reference state (previously in subroutine calc_mean_profile)
103
[1343]104! 1342 2014-03-26 17:04:47Z kanani
105! REAL constants defined as wp-kind
106!
[1321]107! 1320 2014-03-20 08:40:49Z raasch
[1320]108! ONLY-attribute added to USE-statements,
109! kind-parameters added to all INTEGER and REAL declaration statements,
110! kinds are defined in new module kinds,
111! old module precision_kind is removed,
112! revision history before 2012 removed,
113! comment fields (!:) to be used for variable explanations added to
114! all variable declaration statements
[1319]115! 1318 2014-03-17 13:35:16Z raasch
116! module interfaces removed
117!
[1309]118! 1308 2014-03-13 14:58:42Z fricke
119! +netcdf_data_format_save
120! For masked data, parallel netcdf output is not tested so far, hence
121! netcdf_data_format is switched back to non-paralell output.
122!
[1277]123! 1276 2014-01-15 13:40:41Z heinze
124! Use LSF_DATA also in case of Dirichlet bottom boundary condition for scalars
125!
[1258]126! 1257 2013-11-08 15:18:40Z raasch
127! acc-update-host directive for timestep removed
128!
[1242]129! 1241 2013-10-30 11:36:58Z heinze
130! Generalize calc_mean_profile for wider use
131! Determine shf and qsws in dependence on data from LSF_DATA
132! Determine ug and vg in dependence on data from LSF_DATA
[1222]133! 1221 2013-09-10 08:59:13Z raasch
134! host update of arrays before timestep is called
135!
[1182]136! 1179 2013-06-14 05:57:58Z raasch
137! mean profiles for reference state are only calculated if required,
138! small bugfix for background communication
139!
[1172]140! 1171 2013-05-30 11:27:45Z raasch
141! split of prognostic_equations deactivated (comment lines), for the time being
142!
[1132]143! 1128 2013-04-12 06:19:32Z raasch
[1128]144! asynchronous transfer of ghost point data realized for acc-optimized version:
145! prognostic_equations are first called two times for those points required for
146! the left-right and north-south exchange, respectively, and then for the
147! remaining points,
148! those parts requiring global communication moved from prognostic_equations to
149! here
[392]150!
[1116]151! 1115 2013-03-26 18:16:16Z hoffmann
152! calculation of qr and nr is restricted to precipitation
153!
[1114]154! 1113 2013-03-10 02:48:14Z raasch
155! GPU-porting of boundary conditions,
156! openACC directives updated
157! formal parameter removed from routine boundary_conds
158!
[1112]159! 1111 2013-03-08 23:54:10Z raasch
160! +internal timestep counter for cpu statistics added,
161! openACC directives updated
162!
[1093]163! 1092 2013-02-02 11:24:22Z raasch
164! unused variables removed
165!
[1066]166! 1065 2012-11-22 17:42:36Z hoffmann
167! exchange of diss (dissipation rate) in case of turbulence = .TRUE. added
168!
[1054]169! 1053 2012-11-13 17:11:03Z hoffmann
170! exchange of ghost points for nr, qr added
171!
[1037]172! 1036 2012-10-22 13:43:42Z raasch
173! code put under GPL (PALM 3.9)
174!
[1020]175! 1019 2012-09-28 06:46:45Z raasch
176! non-optimized version of prognostic_equations removed
177!
[1017]178! 1015 2012-09-27 09:23:24Z raasch
179! +call of prognostic_equations_acc
180!
[1002]181! 1001 2012-09-13 14:08:46Z raasch
182! all actions concerning leapfrog- and upstream-spline-scheme removed
183!
[850]184! 849 2012-03-15 10:35:09Z raasch
185! advec_particles renamed lpm, first_call_advec_particles renamed first_call_lpm
186!
[826]187! 825 2012-02-19 03:03:44Z raasch
188! wang_collision_kernel renamed wang_kernel
189!
[1]190! Revision 1.1  1997/08/11 06:19:04  raasch
191! Initial revision
192!
193!
194! Description:
195! ------------
[1682]196!> Integration in time of the model equations, statistical analysis and graphic
197!> output
[1]198!------------------------------------------------------------------------------!
[1682]199 SUBROUTINE time_integration
200 
[1]201
[1320]202    USE advec_ws,                                                              &
203        ONLY:  ws_statistics
204
205    USE arrays_3d,                                                             &
[1762]206        ONLY:  diss, dzu, e, e_p, nr_p, prho, pt, pt_p, pt_init, q_init, q,    &
207               ql, ql_c, ql_v, ql_vp, qr_p, q_p, ref_state, rho, sa_p, tend,   &
208               u, u_p, v, vpt, v_p, w, w_p
[1320]209
[1365]210    USE calc_mean_profile_mod,                                                 &
[1320]211        ONLY:  calc_mean_profile
212
213    USE control_parameters,                                                    &
214        ONLY:  advected_distance_x, advected_distance_y, average_count_3d,     &
[1833]215               averaging_interval, averaging_interval_pr,                      &
216               bc_lr_cyc, bc_ns_cyc, bc_pt_t_val,                              &
[1380]217               bc_q_t_val, call_psolver_at_all_substeps, cloud_droplets,       &
[1691]218               cloud_physics, constant_flux_layer, constant_heatflux,          &
219               create_disturbances, dopr_n, constant_diffusion, coupling_mode, &
220               coupling_start_time, current_timestep_number,                   &
221               disturbance_created, disturbance_energy_limit, dist_range,      &
222               do_sum, dt_3d, dt_averaging_input, dt_averaging_input_pr,       &
223               dt_coupling, dt_data_output_av, dt_disturb, dt_do2d_xy,         &
224               dt_do2d_xz, dt_do2d_yz, dt_do3d, dt_domask,dt_dopts, dt_dopr,   &
[1833]225               dt_dopr_listing, dt_dots, dt_dvrp, dt_run_control,              &
[1320]226               end_time, first_call_lpm, galilei_transformation, humidity,     &
[1822]227               intermediate_timestep_count,                                    &
[1320]228               intermediate_timestep_count_max, large_scale_forcing,           &
[1822]229               loop_optimization, lsf_surf, lsf_vert, masks,                   &
230               microphysics_seifert, mid, nest_domain,                         &
[1783]231               neutral, nr_timesteps_this_run, nudging,                        &
[1822]232               ocean, on_device, passive_scalar,                               &
[1320]233               prho_reference, pt_reference, pt_slope_offset, random_heatflux, &
234               run_coupled, simulated_time, simulated_time_chr,                &
235               skip_time_do2d_xy, skip_time_do2d_xz, skip_time_do2d_yz,        &
236               skip_time_do3d, skip_time_domask, skip_time_dopr,               &
[1833]237               skip_time_data_output_av, sloping_surface,                      &
[1320]238               stop_dt, terminate_coupled, terminate_run, timestep_scheme,     &
239               time_coupling, time_do2d_xy, time_do2d_xz, time_do2d_yz,        &
240               time_do3d, time_domask, time_dopr, time_dopr_av,                &
241               time_dopr_listing, time_dopts, time_dosp, time_dosp_av,         &
242               time_dots, time_do_av, time_do_sla, time_disturb, time_dvrp,    &
[1496]243               time_run_control, time_since_reference_point,                   &
[1320]244               turbulent_inflow, use_initial_profile_as_reference,             &
245               use_single_reference_value, u_gtrans, v_gtrans, ws_scheme_mom,  &
246               ws_scheme_sca
247
248    USE cpulog,                                                                &
249        ONLY:  cpu_log, log_point, log_point_s
250
251    USE indices,                                                               &
252        ONLY:  i_left, i_right, j_north, j_south, nbgp, nx, nxl, nxlg, nxr,    &
[1380]253               nxrg, nyn, nys, nzb, nzt, nzb_u_inner, nzb_v_inner 
[1320]254
255    USE interaction_droplets_ptq_mod,                                          &
256        ONLY:  interaction_droplets_ptq
257
258    USE kinds
259
[1496]260    USE land_surface_model_mod,                                                &
[1691]261        ONLY:  land_surface, lsm_energy_balance, lsm_soil_model,               &
262               skip_time_do_lsm
[1496]263
[1320]264    USE ls_forcing_mod,                                                        &
265        ONLY:  ls_forcing_surf, ls_forcing_vert
266
[1849]267    USE microphysics_mod,                                                      &
268        ONLY: collision_turbulence
269
[1365]270    USE nudge_mod,                                                             &
[1380]271        ONLY:  calc_tnudge, nudge_ref
[1365]272
[1320]273    USE particle_attributes,                                                   &
[1671]274        ONLY:  particle_advection, particle_advection_start,                   &
275               use_sgs_for_particles, wang_kernel
[1320]276
[1]277    USE pegrid
278
[1762]279    USE pmc_interface,                                                         &
[1764]280        ONLY:  client_to_server, nested_run, nesting_mode,                     &
[1797]281               pmci_client_synchronize, pmci_datatrans,                        &
282               pmci_ensure_nest_mass_conservation,                             &
[1791]283               pmci_server_synchronize, server_to_client
[1762]284
[1320]285    USE production_e_mod,                                                      &
286        ONLY:  production_e_init
287
[1402]288    USE progress_bar,                                                          &
289        ONLY:  finish_progress_bar, output_progress_bar
290
[1320]291    USE prognostic_equations_mod,                                              &
292        ONLY:  prognostic_equations_acc, prognostic_equations_cache,           &
293               prognostic_equations_vector
294
[1496]295    USE radiation_model_mod,                                                   &
[1691]296        ONLY: dt_radiation, force_radiation_call, radiation,                   &
297              radiation_clearsky, radiation_rrtmg, radiation_scheme,           &
298              skip_time_do_radiation, time_radiation
[1496]299
[1833]300    USE spectra_mod,                                                           &
301        ONLY: average_count_sp, averaging_interval_sp, calc_spectra, dt_dosp,  &
302              skip_time_dosp
[1786]303
[1320]304    USE statistics,                                                            &
[1365]305        ONLY:  flow_statistics_called, hom, pr_palm, sums_ls_l
[1320]306
[1691]307    USE surface_layer_fluxes_mod,                                              &
308        ONLY:  surface_layer_fluxes
309
[1320]310    USE user_actions_mod,                                                      &
311        ONLY:  user_actions
312
[1]313    IMPLICIT NONE
314
[1682]315    CHARACTER (LEN=9) ::  time_to_string          !<
[1]316
317!
318!-- At the beginning of a simulation determine the time step as well as
319!-- determine and print out the run control parameters
[1342]320    IF ( simulated_time == 0.0_wp )  CALL timestep
[667]321
[1764]322!
323!-- Synchronize the timestep in case of nested run.
324!-- The server side must be called first
325    IF ( nested_run )  THEN
326       CALL pmci_server_synchronize
327       CALL pmci_client_synchronize
328    ENDIF
329
[1]330    CALL run_control
331
[108]332!
333!-- Data exchange between coupled models in case that a call has been omitted
334!-- at the end of the previous run of a job chain.
[291]335    IF ( coupling_mode /= 'uncoupled'  .AND.  run_coupled )  THEN
[108]336!
337!--    In case of model termination initiated by the local model the coupler
338!--    must not be called because this would again cause an MPI hang.
339       DO WHILE ( time_coupling >= dt_coupling .AND. terminate_coupled == 0 )
340          CALL surface_coupler
341          time_coupling = time_coupling - dt_coupling
342       ENDDO
[1342]343       IF (time_coupling == 0.0_wp .AND. time_since_reference_point < dt_coupling)&
[348]344       THEN
345          time_coupling = time_since_reference_point
346       ENDIF
[108]347    ENDIF
348
[1]349#if defined( __dvrp_graphics )
350!
351!-- Time measurement with dvrp software 
352    CALL DVRP_LOG_EVENT( 2, current_timestep_number )
353#endif
354
[1402]355    CALL location_message( 'start with time-stepping', .TRUE. )
[1]356!
357!-- Start of the time loop
358    DO  WHILE ( simulated_time < end_time  .AND.  .NOT. stop_dt  .AND. &
359                .NOT. terminate_run )
360
361       CALL cpu_log( log_point_s(10), 'timesteps', 'start' )
[1221]362
[1]363!
364!--    Determine size of next time step
[1342]365       IF ( simulated_time /= 0.0_wp )  THEN
[1221]366          CALL timestep
[1762]367
[1764]368          IF ( nested_run )  THEN
[1762]369!
[1764]370!--          TO_DO: try to give more detailed and meaningful comments here
371!--          Server side must be called first
372             CALL pmci_server_synchronize
373             CALL pmci_client_synchronize
374          ENDIF
[1221]375       ENDIF
376
[1762]377
[1]378!
[1241]379!--    Determine ug, vg and w_subs in dependence on data from external file
380!--    LSF_DATA
[1365]381       IF ( large_scale_forcing .AND. lsf_vert )  THEN
[1241]382           CALL ls_forcing_vert ( simulated_time )
[1365]383           sums_ls_l = 0.0_wp
[1241]384       ENDIF
385
386!
[1380]387!--    Set pt_init and q_init to the current profiles taken from
388!--    NUDGING_DATA
389       IF ( nudging )  THEN
390           CALL nudge_ref ( simulated_time )
391!
392!--        Store temperature gradient at the top boundary for possible Neumann
393!--        boundary condition
394           bc_pt_t_val = ( pt_init(nzt+1) - pt_init(nzt) ) / dzu(nzt+1)
395           bc_q_t_val  = ( q_init(nzt+1) - q_init(nzt) ) / dzu(nzt+1)
396       ENDIF
397
398!
[1]399!--    Execute the user-defined actions
400       CALL user_actions( 'before_timestep' )
401
402!
403!--    Start of intermediate step loop
404       intermediate_timestep_count = 0
405       DO  WHILE ( intermediate_timestep_count < &
406                   intermediate_timestep_count_max )
407
408          intermediate_timestep_count = intermediate_timestep_count + 1
409
410!
411!--       Set the steering factors for the prognostic equations which depend
412!--       on the timestep scheme
413          CALL timestep_scheme_steering
414
415!
[1128]416!--       Calculate those variables needed in the tendency terms which need
417!--       global communication
[1179]418          IF ( .NOT. use_single_reference_value  .AND. &
419               .NOT. use_initial_profile_as_reference )  THEN
420!
421!--          Horizontally averaged profiles to be used as reference state in
422!--          buoyancy terms (WARNING: only the respective last call of
423!--          calc_mean_profile defines the reference state!)
[1365]424             IF ( .NOT. neutral )  THEN
425                CALL calc_mean_profile( pt, 4 )
426                ref_state(:)  = hom(:,1,4,0) ! this is used in the buoyancy term
427             ENDIF
428             IF ( ocean )  THEN
429                CALL calc_mean_profile( rho, 64 )
430                ref_state(:)  = hom(:,1,64,0)
431             ENDIF
432             IF ( humidity )  THEN
433                CALL calc_mean_profile( vpt, 44 )
434                ref_state(:)  = hom(:,1,44,0)
435             ENDIF
436
[1179]437          ENDIF
438
[1128]439          IF ( .NOT. constant_diffusion )  CALL production_e_init
440          IF ( ( ws_scheme_mom .OR. ws_scheme_sca )  .AND.  &
441               intermediate_timestep_count == 1 )  CALL ws_statistics
[1365]442!
443!--       In case of nudging calculate current nudging time scale and horizontal
[1380]444!--       means of u, v, pt and q
[1365]445          IF ( nudging )  THEN
446             CALL calc_tnudge( simulated_time )
447             CALL calc_mean_profile( u, 1 )
448             CALL calc_mean_profile( v, 2 )
449             CALL calc_mean_profile( pt, 4 )
450             CALL calc_mean_profile( q, 41 )
451          ENDIF
[1128]452
453!
[1]454!--       Solve the prognostic equations. A fast cache optimized version with
455!--       only one single loop is used in case of Piascek-Williams advection
456!--       scheme. NEC vector machines use a different version, because
457!--       in the other versions a good vectorization is prohibited due to
458!--       inlining problems.
[1019]459          IF ( loop_optimization == 'cache' )  THEN
460             CALL prognostic_equations_cache
461          ELSEIF ( loop_optimization == 'vector' )  THEN
[63]462             CALL prognostic_equations_vector
[1015]463          ELSEIF ( loop_optimization == 'acc' )  THEN
[1171]464             i_left  = nxl;         i_right = nxr
465             j_south = nys;         j_north = nyn
466             CALL prognostic_equations_acc
467
468!             i_left  = nxl;         i_right = nxl+nbgp-1
[1128]469!             j_south = nys;         j_north = nyn
470!             CALL prognostic_equations_acc
[1171]471!             i_left  = nxr-nbgp+1;  i_right = nxr
472!             j_south = nys;         j_north = nyn
473!             CALL prognostic_equations_acc
[1128]474
475!
476!--          Exchange of ghost points (lateral boundary conditions)
477             IF ( background_communication )  THEN
478
479                CALL cpu_log( log_point(26), 'exchange-horiz-progn', 'start' )
480               
481                send_receive = 'lr'
482                sendrecv_in_background = .TRUE.
483                req          = 0
484                req_count    = 0
485
486                IF ( numprocs == 1 )  THEN    ! workaround for single-core GPU runs
487                   on_device = .TRUE.         ! to be removed after complete porting
488                ELSE                          ! of ghost point exchange
489                   !$acc update host( e_p, pt_p, u_p, v_p, w_p )
490                ENDIF
491
492                CALL exchange_horiz( u_p, nbgp )
493                CALL exchange_horiz( v_p, nbgp )
494                CALL exchange_horiz( w_p, nbgp )
495                CALL exchange_horiz( pt_p, nbgp )
496                IF ( .NOT. constant_diffusion )  CALL exchange_horiz( e_p, nbgp )
497                IF ( ocean )  THEN
498                   CALL exchange_horiz( sa_p, nbgp )
499                   CALL exchange_horiz( rho, nbgp )
500                  CALL exchange_horiz( prho, nbgp )
501                ENDIF
502                IF (humidity  .OR.  passive_scalar)  THEN
503                   CALL exchange_horiz( q_p, nbgp )
[1822]504                   IF ( cloud_physics .AND. microphysics_seifert )  THEN
[1128]505                      CALL exchange_horiz( qr_p, nbgp )
506                      CALL exchange_horiz( nr_p, nbgp )
507                   ENDIF
508                ENDIF
509                IF ( cloud_droplets )  THEN
510                   CALL exchange_horiz( ql, nbgp )
511                   CALL exchange_horiz( ql_c, nbgp )
512                   CALL exchange_horiz( ql_v, nbgp )
513                   CALL exchange_horiz( ql_vp, nbgp )
514                ENDIF
[1831]515                IF ( wang_kernel  .OR.  collision_turbulence  .OR.             &
516                     use_sgs_for_particles )  THEN
[1671]517                   CALL exchange_horiz( diss, nbgp )
518                ENDIF
[1128]519
520                IF ( numprocs == 1 )  THEN    ! workaround for single-core GPU runs
521                   on_device = .FALSE.        ! to be removed after complete porting
522                ELSE                          ! of ghost point exchange
523                   !$acc update device( e_p, pt_p, u_p, v_p, w_p )
524                ENDIF
525
526                sendrecv_in_background = .FALSE.
527
528                CALL cpu_log( log_point(26), 'exchange-horiz-progn', 'pause' )
529
530             ENDIF
531
[1171]532!             i_left  = nxl+nbgp;    i_right = nxr-nbgp
533!             j_south = nys;         j_north = nys+nbgp-1
534!             CALL prognostic_equations_acc
535!             i_left  = nxl+nbgp;    i_right = nxr-nbgp
536!             j_south = nyn-nbgp+1;  j_north = nyn
537!             CALL prognostic_equations_acc
[1128]538
539             IF ( background_communication )  THEN
540                CALL cpu_log( log_point(41), 'exchange-horiz-wait', 'start' )
541#if defined( __parallel )
542                CALL MPI_WAITALL( req_count, req, wait_stat, ierr )
543#endif
544                CALL cpu_log( log_point(41), 'exchange-horiz-wait', 'pause' )
545
546                CALL cpu_log( log_point(26), 'exchange-horiz-progn', 'continue' )
547
548                send_receive = 'ns'
549                sendrecv_in_background = .TRUE.
550                req          = 0
551                req_count    = 0
552
553                IF ( numprocs == 1 )  THEN    ! workaround for single-core GPU runs
554                   on_device = .TRUE.         ! to be removed after complete porting
555                ELSE                          ! of ghost point exchange
556                   !$acc update host( e_p, pt_p, u_p, v_p, w_p )
557                ENDIF
558
559                CALL exchange_horiz( u_p, nbgp )
560                CALL exchange_horiz( v_p, nbgp )
561                CALL exchange_horiz( w_p, nbgp )
562                CALL exchange_horiz( pt_p, nbgp )
563                IF ( .NOT. constant_diffusion )  CALL exchange_horiz( e_p, nbgp )
564                IF ( ocean )  THEN
565                   CALL exchange_horiz( sa_p, nbgp )
566                   CALL exchange_horiz( rho, nbgp )
567                  CALL exchange_horiz( prho, nbgp )
568                ENDIF
569                IF (humidity  .OR.  passive_scalar)  THEN
570                   CALL exchange_horiz( q_p, nbgp )
[1822]571                   IF ( cloud_physics .AND. microphysics_seifert )  THEN
[1128]572                      CALL exchange_horiz( qr_p, nbgp )
573                      CALL exchange_horiz( nr_p, nbgp )
574                   ENDIF
575                ENDIF
576                IF ( cloud_droplets )  THEN
577                   CALL exchange_horiz( ql, nbgp )
578                   CALL exchange_horiz( ql_c, nbgp )
579                   CALL exchange_horiz( ql_v, nbgp )
580                   CALL exchange_horiz( ql_vp, nbgp )
581                ENDIF
[1831]582                IF ( wang_kernel  .OR.  collision_turbulence  .OR.             &
583                     use_sgs_for_particles )  THEN
[1671]584                   CALL exchange_horiz( diss, nbgp )
585                ENDIF
[1128]586
587                IF ( numprocs == 1 )  THEN    ! workaround for single-core GPU runs
588                   on_device = .FALSE.        ! to be removed after complete porting
589                ELSE                          ! of ghost point exchange
590                   !$acc update device( e_p, pt_p, u_p, v_p, w_p )
591                ENDIF
592
593                sendrecv_in_background = .FALSE.
594
595                CALL cpu_log( log_point(26), 'exchange-horiz-progn', 'stop' )
596
597             ENDIF
598
[1171]599!             i_left  = nxl+nbgp;    i_right = nxr-nbgp
600!             j_south = nys+nbgp;    j_north = nyn-nbgp
601!             CALL prognostic_equations_acc
[1128]602
603             IF ( background_communication )  THEN
604                CALL cpu_log( log_point(41), 'exchange-horiz-wait', 'continue' )
605#if defined( __parallel )
606                CALL MPI_WAITALL( req_count, req, wait_stat, ierr )
607#endif
608                send_receive = 'al'
609                CALL cpu_log( log_point(41), 'exchange-horiz-wait', 'stop' )
610             ENDIF
611
[1]612          ENDIF
613
614!
[849]615!--       Particle transport/physics with the Lagrangian particle model
616!--       (only once during intermediate steps, because it uses an Euler-step)
[1128]617!--       ### particle model should be moved before prognostic_equations, in order
618!--       to regard droplet interactions directly
[63]619          IF ( particle_advection  .AND.                         &
620               simulated_time >= particle_advection_start  .AND. &
[1]621               intermediate_timestep_count == 1 )  THEN
[849]622             CALL lpm
623             first_call_lpm = .FALSE.
[1]624          ENDIF
625
626!
627!--       Interaction of droplets with temperature and specific humidity.
628!--       Droplet condensation and evaporation is calculated within
629!--       advec_particles.
630          IF ( cloud_droplets  .AND.  &
631               intermediate_timestep_count == intermediate_timestep_count_max )&
632          THEN
633             CALL interaction_droplets_ptq
634          ENDIF
635
636!
637!--       Exchange of ghost points (lateral boundary conditions)
[1128]638          IF ( .NOT. background_communication )  THEN
[1113]639
[1128]640             CALL cpu_log( log_point(26), 'exchange-horiz-progn', 'start' )
[1113]641
[1128]642             IF ( numprocs == 1 )  THEN    ! workaround for single-core GPU runs
643                on_device = .TRUE.         ! to be removed after complete porting
644             ELSE                          ! of ghost point exchange
645                !$acc update host( e_p, pt_p, u_p, v_p, w_p )
[1053]646             ENDIF
[1]647
[1128]648             CALL exchange_horiz( u_p, nbgp )
649             CALL exchange_horiz( v_p, nbgp )
650             CALL exchange_horiz( w_p, nbgp )
651             CALL exchange_horiz( pt_p, nbgp )
652             IF ( .NOT. constant_diffusion )  CALL exchange_horiz( e_p, nbgp )
653             IF ( ocean )  THEN
654                CALL exchange_horiz( sa_p, nbgp )
655                CALL exchange_horiz( rho, nbgp )
656                CALL exchange_horiz( prho, nbgp )
657             ENDIF
658             IF (humidity  .OR.  passive_scalar)  THEN
659                CALL exchange_horiz( q_p, nbgp )
[1822]660                IF ( cloud_physics .AND. microphysics_seifert )  THEN
[1128]661                   CALL exchange_horiz( qr_p, nbgp )
662                   CALL exchange_horiz( nr_p, nbgp )
663                ENDIF
664             ENDIF
665             IF ( cloud_droplets )  THEN
666                CALL exchange_horiz( ql, nbgp )
667                CALL exchange_horiz( ql_c, nbgp )
668                CALL exchange_horiz( ql_v, nbgp )
669                CALL exchange_horiz( ql_vp, nbgp )
670             ENDIF
[1831]671             IF ( wang_kernel  .OR.  collision_turbulence  .OR.                &
672                  use_sgs_for_particles )  THEN
[1671]673                CALL exchange_horiz( diss, nbgp )
674             ENDIF
[1128]675
676             IF ( numprocs == 1 )  THEN    ! workaround for single-core GPU runs
677                on_device = .FALSE.        ! to be removed after complete porting
678             ELSE                          ! of ghost point exchange
679                !$acc update device( e_p, pt_p, u_p, v_p, w_p )
680             ENDIF
681
682             CALL cpu_log( log_point(26), 'exchange-horiz-progn', 'stop' )
683
[1113]684          ENDIF
685
[1]686!
687!--       Boundary conditions for the prognostic quantities (except of the
688!--       velocities at the outflow in case of a non-cyclic lateral wall)
[1113]689          CALL boundary_conds
[1]690
691!
[73]692!--       Swap the time levels in preparation for the next time step.
693          CALL swap_timelevel
694
[1764]695          IF ( nested_run )  THEN
[1797]696
[1764]697             CALL cpu_log( log_point(60), 'nesting', 'start' )
[1762]698!
[1797]699!--          Domain nesting. The data transfer subroutines pmci_server_datatrans
700!--          and pmci_client_datatatrans are called inside the wrapper
701!--          subroutine pmci_datatrans according to the control parameters
702!--          nesting_mode and nesting_datatransfer_mode.
703!--          TO_DO: why is nesting_mode given as a parameter here?
704             CALL pmci_datatrans( nesting_mode )
[1762]705
[1764]706             IF ( nesting_mode == 'two-way' )  THEN
[1762]707!
[1764]708!--             Exchange_horiz is needed for all server-domains after the
709!--             anterpolation
710                CALL exchange_horiz( u, nbgp )
711                CALL exchange_horiz( v, nbgp )
712                CALL exchange_horiz( w, nbgp )
713                CALL exchange_horiz( pt, nbgp )
714                IF ( humidity  .OR.  passive_scalar )  THEN
715                   CALL exchange_horiz( q, nbgp )
716                ENDIF
717                IF ( .NOT. constant_diffusion )  CALL exchange_horiz( e, nbgp )
[1762]718             ENDIF
719!
[1764]720!--          Correct the w top-BC in nest domains to ensure mass conservation.
721!--          This action must never be done for the root domain.
722             IF ( nest_domain )  THEN
723                CALL pmci_ensure_nest_mass_conservation
724             ENDIF
725
726             CALL cpu_log( log_point(60), 'nesting', 'stop' )
727
[1762]728          ENDIF
729
730!
[1]731!--       Temperature offset must be imposed at cyclic boundaries in x-direction
732!--       when a sloping surface is used
733          IF ( sloping_surface )  THEN
[707]734             IF ( nxl ==  0 )  pt(:,:,nxlg:nxl-1) = pt(:,:,nxlg:nxl-1) - &
735                                                    pt_slope_offset
736             IF ( nxr == nx )  pt(:,:,nxr+1:nxrg) = pt(:,:,nxr+1:nxrg) + &
737                                                    pt_slope_offset
[1]738          ENDIF
739
740!
[151]741!--       Impose a turbulent inflow using the recycling method
742          IF ( turbulent_inflow )  CALL  inflow_turbulence
743
744!
[1]745!--       Impose a random perturbation on the horizontal velocity field
[106]746          IF ( create_disturbances  .AND.                                      &
747               ( call_psolver_at_all_substeps  .AND.                           &
[1]748               intermediate_timestep_count == intermediate_timestep_count_max )&
[106]749          .OR. ( .NOT. call_psolver_at_all_substeps  .AND.                     &
750               intermediate_timestep_count == 1 ) )                            &
[1]751          THEN
752             time_disturb = time_disturb + dt_3d
753             IF ( time_disturb >= dt_disturb )  THEN
[1111]754                !$acc update host( u, v )
[1113]755                IF ( numprocs == 1 )  on_device = .FALSE.  ! workaround, remove later
[1736]756                IF ( disturbance_energy_limit /= 0.0_wp  .AND.                 &
757                     hom(nzb+5,1,pr_palm,0) < disturbance_energy_limit )  THEN
[75]758                   CALL disturb_field( nzb_u_inner, tend, u )
759                   CALL disturb_field( nzb_v_inner, tend, v )
[707]760                ELSEIF ( .NOT. bc_lr_cyc  .OR.  .NOT. bc_ns_cyc )  THEN
[1]761!
762!--                Runs with a non-cyclic lateral wall need perturbations
763!--                near the inflow throughout the whole simulation
764                   dist_range = 1
[75]765                   CALL disturb_field( nzb_u_inner, tend, u )
766                   CALL disturb_field( nzb_v_inner, tend, v )
[1]767                   dist_range = 0
768                ENDIF
[1113]769                IF ( numprocs == 1 )  on_device = .TRUE.  ! workaround, remove later
[1111]770                !$acc update device( u, v )
[1]771                time_disturb = time_disturb - dt_disturb
772             ENDIF
773          ENDIF
774
775!
776!--       Reduce the velocity divergence via the equation for perturbation
777!--       pressure.
[106]778          IF ( intermediate_timestep_count == 1  .OR. &
779                call_psolver_at_all_substeps )  THEN
[1]780             CALL pres
781          ENDIF
782
783!
784!--       If required, compute liquid water content
[1015]785          IF ( cloud_physics )  THEN
786             CALL calc_liquid_water_content
787             !$acc update device( ql )
788          ENDIF
[1115]789!
790!--       If required, compute virtual potential temperature
791          IF ( humidity )  THEN
792             CALL compute_vpt 
793             !$acc update device( vpt )
794          ENDIF 
[1585]795
[1]796!
797!--       Compute the diffusion quantities
798          IF ( .NOT. constant_diffusion )  THEN
799
800!
[1276]801!--          Determine surface fluxes shf and qsws and surface values
802!--          pt_surface and q_surface in dependence on data from external
803!--          file LSF_DATA respectively
804             IF ( ( large_scale_forcing .AND. lsf_surf ) .AND. &
805                 intermediate_timestep_count == intermediate_timestep_count_max )&
806             THEN
807                CALL ls_forcing_surf ( simulated_time )
808             ENDIF
809
810!
[1691]811!--          First the vertical fluxes in the surface (constant flux) layer are computed
812             IF ( constant_flux_layer )  THEN
813                CALL cpu_log( log_point(19), 'surface_layer_fluxes', 'start' )
814                CALL surface_layer_fluxes
815                CALL cpu_log( log_point(19), 'surface_layer_fluxes', 'stop' )
[1]816             ENDIF
[1241]817
[1]818!
[1691]819!--          If required, solve the energy balance for the surface and run soil
820!--          model
821             IF ( land_surface .AND. simulated_time > skip_time_do_lsm)  THEN
822
823                CALL cpu_log( log_point(54), 'land_surface', 'start' )
824                CALL lsm_energy_balance
825                CALL lsm_soil_model
826                CALL cpu_log( log_point(54), 'land_surface', 'stop' )
827             ENDIF
828!
[1]829!--          Compute the diffusion coefficients
830             CALL cpu_log( log_point(17), 'diffusivities', 'start' )
[75]831             IF ( .NOT. humidity ) THEN
[97]832                IF ( ocean )  THEN
[388]833                   CALL diffusivities( prho, prho_reference )
[97]834                ELSE
835                   CALL diffusivities( pt, pt_reference )
836                ENDIF
[1]837             ELSE
[97]838                CALL diffusivities( vpt, pt_reference )
[1]839             ENDIF
840             CALL cpu_log( log_point(17), 'diffusivities', 'stop' )
841
842          ENDIF
843
[1691]844!
845!--       If required, calculate radiative fluxes and heating rates
846          IF ( radiation .AND. intermediate_timestep_count                     &
847               == intermediate_timestep_count_max .AND. simulated_time >    &
848               skip_time_do_radiation )  THEN
849
850               time_radiation = time_radiation + dt_3d
851
852             IF ( time_radiation >= dt_radiation .OR. force_radiation_call )   &
853             THEN
854
855                CALL cpu_log( log_point(50), 'radiation', 'start' )
856
857                IF ( .NOT. force_radiation_call )  THEN
858                   time_radiation = time_radiation - dt_radiation
859                ENDIF
860
861                IF ( radiation_scheme == 'clear-sky' )  THEN
862                   CALL radiation_clearsky
863                ELSEIF ( radiation_scheme == 'rrtmg' )  THEN
864                   CALL radiation_rrtmg
865                ENDIF
866
867                CALL cpu_log( log_point(50), 'radiation', 'stop' )
868             ENDIF
869          ENDIF
870
[1]871       ENDDO   ! Intermediate step loop
872
873!
874!--    Increase simulation time and output times
[1111]875       nr_timesteps_this_run      = nr_timesteps_this_run + 1
[291]876       current_timestep_number    = current_timestep_number + 1
877       simulated_time             = simulated_time   + dt_3d
878       simulated_time_chr         = time_to_string( simulated_time )
879       time_since_reference_point = simulated_time - coupling_start_time
880
[1]881       IF ( simulated_time >= skip_time_data_output_av )  THEN
882          time_do_av         = time_do_av       + dt_3d
883       ENDIF
884       IF ( simulated_time >= skip_time_do2d_xy )  THEN
885          time_do2d_xy       = time_do2d_xy     + dt_3d
886       ENDIF
887       IF ( simulated_time >= skip_time_do2d_xz )  THEN
888          time_do2d_xz       = time_do2d_xz     + dt_3d
889       ENDIF
890       IF ( simulated_time >= skip_time_do2d_yz )  THEN
891          time_do2d_yz       = time_do2d_yz     + dt_3d
892       ENDIF
893       IF ( simulated_time >= skip_time_do3d    )  THEN
894          time_do3d          = time_do3d        + dt_3d
895       ENDIF
[410]896       DO  mid = 1, masks
897          IF ( simulated_time >= skip_time_domask(mid) )  THEN
898             time_domask(mid)= time_domask(mid) + dt_3d
899          ENDIF
900       ENDDO
[1]901       time_dvrp          = time_dvrp        + dt_3d
902       IF ( simulated_time >= skip_time_dosp )  THEN
903          time_dosp       = time_dosp        + dt_3d
904       ENDIF
905       time_dots          = time_dots        + dt_3d
[849]906       IF ( .NOT. first_call_lpm )  THEN
[1]907          time_dopts      = time_dopts       + dt_3d
908       ENDIF
909       IF ( simulated_time >= skip_time_dopr )  THEN
910          time_dopr       = time_dopr        + dt_3d
911       ENDIF
912       time_dopr_listing          = time_dopr_listing        + dt_3d
913       time_run_control   = time_run_control + dt_3d
914
915!
[102]916!--    Data exchange between coupled models
[291]917       IF ( coupling_mode /= 'uncoupled'  .AND.  run_coupled )  THEN
[102]918          time_coupling = time_coupling + dt_3d
[343]919
[108]920!
921!--       In case of model termination initiated by the local model
922!--       (terminate_coupled > 0), the coupler must be skipped because it would
923!--       cause an MPI intercomminucation hang.
924!--       If necessary, the coupler will be called at the beginning of the
925!--       next restart run.
926          DO WHILE ( time_coupling >= dt_coupling .AND. terminate_coupled == 0 )
[102]927             CALL surface_coupler
928             time_coupling = time_coupling - dt_coupling
929          ENDDO
930       ENDIF
931
932!
[46]933!--    Execute user-defined actions
934       CALL user_actions( 'after_integration' )
935
936!
[1]937!--    If Galilei transformation is used, determine the distance that the
938!--    model has moved so far
939       IF ( galilei_transformation )  THEN
940          advected_distance_x = advected_distance_x + u_gtrans * dt_3d
941          advected_distance_y = advected_distance_y + v_gtrans * dt_3d
942       ENDIF
943
944!
945!--    Check, if restart is necessary (because cpu-time is expiring or
946!--    because it is forced by user) and set stop flag
[108]947!--    This call is skipped if the remote model has already initiated a restart.
948       IF ( .NOT. terminate_run )  CALL check_for_restart
[1]949
950!
951!--    Carry out statistical analysis and output at the requested output times.
952!--    The MOD function is used for calculating the output time counters (like
953!--    time_dopr) in order to regard a possible decrease of the output time
954!--    interval in case of restart runs
955
956!
957!--    Set a flag indicating that so far no statistics have been created
958!--    for this time step
959       flow_statistics_called = .FALSE.
960
961!
962!--    If required, call flow_statistics for averaging in time
[1342]963       IF ( averaging_interval_pr /= 0.0_wp  .AND.  &
[1]964            ( dt_dopr - time_dopr ) <= averaging_interval_pr  .AND.  &
965            simulated_time >= skip_time_dopr )  THEN
966          time_dopr_av = time_dopr_av + dt_3d
967          IF ( time_dopr_av >= dt_averaging_input_pr )  THEN
968             do_sum = .TRUE.
969             time_dopr_av = MOD( time_dopr_av, &
970                                    MAX( dt_averaging_input_pr, dt_3d ) )
971          ENDIF
972       ENDIF
973       IF ( do_sum )  CALL flow_statistics
974
975!
[410]976!--    Sum-up 3d-arrays for later output of time-averaged 2d/3d/masked data
[1342]977       IF ( averaging_interval /= 0.0_wp  .AND.                                &
[1]978            ( dt_data_output_av - time_do_av ) <= averaging_interval  .AND. &
979            simulated_time >= skip_time_data_output_av )                    &
980       THEN
981          time_do_sla = time_do_sla + dt_3d
982          IF ( time_do_sla >= dt_averaging_input )  THEN
983             CALL sum_up_3d_data
984             average_count_3d = average_count_3d + 1
985             time_do_sla = MOD( time_do_sla, MAX( dt_averaging_input, dt_3d ) )
986          ENDIF
987       ENDIF
988
989!
990!--    Calculate spectra for time averaging
[1342]991       IF ( averaging_interval_sp /= 0.0_wp  .AND.  &
[1]992            ( dt_dosp - time_dosp ) <= averaging_interval_sp  .AND.  &
993            simulated_time >= skip_time_dosp )  THEN
994          time_dosp_av = time_dosp_av + dt_3d
995          IF ( time_dosp_av >= dt_averaging_input_pr )  THEN
996             CALL calc_spectra
997             time_dosp_av = MOD( time_dosp_av, &
998                                 MAX( dt_averaging_input_pr, dt_3d ) )
999          ENDIF
1000       ENDIF
1001
1002!
1003!--    Computation and output of run control parameters.
[1001]1004!--    This is also done whenever perturbations have been imposed
[1]1005       IF ( time_run_control >= dt_run_control  .OR.                     &
[1001]1006            timestep_scheme(1:5) /= 'runge'  .OR.  disturbance_created ) &
[1]1007       THEN
1008          CALL run_control
1009          IF ( time_run_control >= dt_run_control )  THEN
1010             time_run_control = MOD( time_run_control, &
1011                                     MAX( dt_run_control, dt_3d ) )
1012          ENDIF
1013       ENDIF
1014
1015!
1016!--    Profile output (ASCII) on file
1017       IF ( time_dopr_listing >= dt_dopr_listing )  THEN
1018          CALL print_1d
1019          time_dopr_listing = MOD( time_dopr_listing, MAX( dt_dopr_listing, &
1020                                                           dt_3d ) )
1021       ENDIF
1022
1023!
1024!--    Graphic output for PROFIL
1025       IF ( time_dopr >= dt_dopr )  THEN
1026          IF ( dopr_n /= 0 )  CALL data_output_profiles
1027          time_dopr = MOD( time_dopr, MAX( dt_dopr, dt_3d ) )
[1342]1028          time_dopr_av = 0.0_wp    ! due to averaging (see above)
[1]1029       ENDIF
1030
1031!
1032!--    Graphic output for time series
1033       IF ( time_dots >= dt_dots )  THEN
[48]1034          CALL data_output_tseries
[1]1035          time_dots = MOD( time_dots, MAX( dt_dots, dt_3d ) )
1036       ENDIF
1037
1038!
1039!--    Output of spectra (formatted for use with PROFIL), in case of no
1040!--    time averaging, spectra has to be calculated before
1041       IF ( time_dosp >= dt_dosp )  THEN
1042          IF ( average_count_sp == 0 )  CALL calc_spectra
1043          CALL data_output_spectra
1044          time_dosp = MOD( time_dosp, MAX( dt_dosp, dt_3d ) )
1045       ENDIF
1046
1047!
1048!--    2d-data output (cross-sections)
1049       IF ( time_do2d_xy >= dt_do2d_xy )  THEN
1050          CALL data_output_2d( 'xy', 0 )
1051          time_do2d_xy = MOD( time_do2d_xy, MAX( dt_do2d_xy, dt_3d ) )
1052       ENDIF
1053       IF ( time_do2d_xz >= dt_do2d_xz )  THEN
1054          CALL data_output_2d( 'xz', 0 )
1055          time_do2d_xz = MOD( time_do2d_xz, MAX( dt_do2d_xz, dt_3d ) )
1056       ENDIF
1057       IF ( time_do2d_yz >= dt_do2d_yz )  THEN
1058          CALL data_output_2d( 'yz', 0 )
1059          time_do2d_yz = MOD( time_do2d_yz, MAX( dt_do2d_yz, dt_3d ) )
1060       ENDIF
1061
1062!
1063!--    3d-data output (volume data)
1064       IF ( time_do3d >= dt_do3d )  THEN
1065          CALL data_output_3d( 0 )
1066          time_do3d = MOD( time_do3d, MAX( dt_do3d, dt_3d ) )
1067       ENDIF
1068
1069!
[1783]1070!--    Masked data output
[410]1071       DO  mid = 1, masks
1072          IF ( time_domask(mid) >= dt_domask(mid) )  THEN
1073             CALL data_output_mask( 0 )
1074             time_domask(mid) = MOD( time_domask(mid),  &
1075                                     MAX( dt_domask(mid), dt_3d ) )
1076          ENDIF
1077       ENDDO
1078
1079!
1080!--    Output of time-averaged 2d/3d/masked data
[1]1081       IF ( time_do_av >= dt_data_output_av )  THEN
1082          CALL average_3d_data
1083          CALL data_output_2d( 'xy', 1 )
1084          CALL data_output_2d( 'xz', 1 )
1085          CALL data_output_2d( 'yz', 1 )
1086          CALL data_output_3d( 1 )
[410]1087          DO  mid = 1, masks
1088             CALL data_output_mask( 1 )
1089          ENDDO
[1]1090          time_do_av = MOD( time_do_av, MAX( dt_data_output_av, dt_3d ) )
1091       ENDIF
1092
1093!
1094!--    Output of particle time series
[253]1095       IF ( particle_advection )  THEN
1096          IF ( time_dopts >= dt_dopts  .OR. &
1097               ( simulated_time >= particle_advection_start  .AND. &
[849]1098                 first_call_lpm ) )  THEN
[253]1099             CALL data_output_ptseries
1100             time_dopts = MOD( time_dopts, MAX( dt_dopts, dt_3d ) )
1101          ENDIF
[1]1102       ENDIF
1103
1104!
1105!--    Output of dvrp-graphics (isosurface, particles, slicer)
1106#if defined( __dvrp_graphics )
1107       CALL DVRP_LOG_EVENT( -2, current_timestep_number-1 )
1108#endif
1109       IF ( time_dvrp >= dt_dvrp )  THEN
1110          CALL data_output_dvrp
1111          time_dvrp = MOD( time_dvrp, MAX( dt_dvrp, dt_3d ) )
1112       ENDIF
1113#if defined( __dvrp_graphics )
1114       CALL DVRP_LOG_EVENT( 2, current_timestep_number )
1115#endif
1116
1117!
1118!--    If required, set the heat flux for the next time step at a random value
1119       IF ( constant_heatflux  .AND.  random_heatflux )  CALL disturb_heatflux
1120
1121!
1122!--    Execute user-defined actions
1123       CALL user_actions( 'after_timestep' )
1124
[1402]1125!
1126!--    Output elapsed simulated time in form of a progress bar on stdout
1127       IF ( myid == 0 )  CALL output_progress_bar
1128
[1]1129       CALL cpu_log( log_point_s(10), 'timesteps', 'stop' )
1130
[667]1131
[1]1132    ENDDO   ! time loop
1133
[1402]1134    IF ( myid == 0 )  CALL finish_progress_bar
1135
[1]1136#if defined( __dvrp_graphics )
1137    CALL DVRP_LOG_EVENT( -2, current_timestep_number )
1138#endif
1139
[1402]1140    CALL location_message( 'finished time-stepping', .TRUE. )
[1384]1141
[1]1142 END SUBROUTINE time_integration
Note: See TracBrowser for help on using the repository browser.