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

Last change on this file since 1111 was 1111, checked in by raasch, 11 years ago

New:
---

GPU porting of pres, swap_timelevel. Adjustments of openACC directives.
Further porting of poisfft, which now runs completely on GPU without any
host/device data transfer for serial an parallel runs (but parallel runs
require data transfer before and after the MPI transpositions).
GPU-porting of tridiagonal solver:
tridiagonal routines split into extermal subroutines (instead using CONTAINS),
no distinction between parallel/non-parallel in poisfft and tridia any more,
tridia routines moved to end of file because of probable bug in PGI compiler
(otherwise "invalid device function" is indicated during runtime).
(cuda_fft_interfaces, fft_xy, flow_statistics, init_3d_model, palm, poisfft, pres, prognostic_equations, swap_timelevel, time_integration, transpose)
output of accelerator board information. (header)

optimization of tridia routines: constant elements and coefficients of tri are
stored in seperate arrays ddzuw and tric, last dimension of tri reduced from 5 to 2,
(init_grid, init_3d_model, modules, palm, poisfft)

poisfft_init is now called internally from poisfft,
(Makefile, Makefile_check, init_pegrid, poisfft, poisfft_hybrid)

CPU-time per grid point and timestep is output to CPU_MEASURES file
(cpu_statistics, modules, time_integration)

Changed:


resorting from/to array work changed, work now has 4 dimensions instead of 1 (transpose)
array diss allocated only if required (init_3d_model)

pressure boundary condition "Neumann+inhomo" removed from the code
(check_parameters, header, poisfft, poisfft_hybrid, pres)

Errors:


bugfix: dependency added for cuda_fft_interfaces (Makefile)
bugfix: CUDA fft plans adjusted for domain decomposition (before they always
used total domain) (fft_xy)

  • Property svn:keywords set to Id
File size: 22.3 KB
Line 
1 SUBROUTINE time_integration
2
3!--------------------------------------------------------------------------------!
4! This file is part of PALM.
5!
6! PALM is free software: you can redistribute it and/or modify it under the terms
7! of the GNU General Public License as published by the Free Software Foundation,
8! either version 3 of the License, or (at your option) any later 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-2012  Leibniz University Hannover
18!--------------------------------------------------------------------------------!
19!
20! Current revisions:
21! ------------------
22! +internal timestep counter for cpu statistics added,
23! openACC directives updated
24!
25! Former revisions:
26! -----------------
27! $Id: time_integration.f90 1111 2013-03-08 23:54:10Z raasch $
28!
29! 1092 2013-02-02 11:24:22Z raasch
30! unused variables removed
31!
32! 1065 2012-11-22 17:42:36Z hoffmann
33! exchange of diss (dissipation rate) in case of turbulence = .TRUE. added
34!
35! 1053 2012-11-13 17:11:03Z hoffmann
36! exchange of ghost points for nr, qr added
37!
38! 1036 2012-10-22 13:43:42Z raasch
39! code put under GPL (PALM 3.9)
40!
41! 1019 2012-09-28 06:46:45Z raasch
42! non-optimized version of prognostic_equations removed
43!
44! 1015 2012-09-27 09:23:24Z raasch
45! +call of prognostic_equations_acc
46!
47! 1001 2012-09-13 14:08:46Z raasch
48! all actions concerning leapfrog- and upstream-spline-scheme removed
49!
50! 849 2012-03-15 10:35:09Z raasch
51! advec_particles renamed lpm, first_call_advec_particles renamed first_call_lpm
52!
53! 825 2012-02-19 03:03:44Z raasch
54! wang_collision_kernel renamed wang_kernel
55!
56! 790 2011-11-29 03:11:20Z raasch
57! exchange of ghostpoints for array diss
58!
59! 707 2011-03-29 11:39:40Z raasch
60! bc_lr/ns replaced by bc_lr/ns_cyc, calls of exchange_horiz are modified,
61! adaption to sloping surface
62!
63! 667  2010-12-23 12:06:00Z suehring/gryschka
64! Calls of exchange_horiz are modified.
65! Adaption to slooping surface.
66!
67! 449 2010-02-02 11:23:59Z raasch
68! Bugfix: exchange of ghost points for prho included
69!
70! 410 2009-12-04 17:05:40Z letzel
71! masked data output
72!
73! 388 2009-09-23 09:40:33Z raasch
74! Using prho instead of rho in diffusvities.
75! Coupling with independent precursor runs.
76! Bugfix: output of particle time series only if particle advection is switched
77!         on
78!
79! 151 2008-03-07 13:42:18Z raasch
80! inflow turbulence is imposed by calling new routine inflow_turbulence
81!
82! 108 2007-08-24 15:10:38Z letzel
83! Call of new routine surface_coupler,
84! presure solver is called after the first Runge-Kutta substep instead of the
85! last in case that call_psolver_at_all_substeps = .F.; for this case, the
86! random perturbation has to be added to the velocity fields also after the
87! first substep
88!
89! 97 2007-06-21 08:23:15Z raasch
90! diffusivities is called with argument rho in case of ocean runs,
91! new argument pt_/prho_reference in calls of diffusivities,
92! ghostpoint exchange for salinity and density
93!
94! 87 2007-05-22 15:46:47Z raasch
95! var_hom renamed pr_palm
96!
97! 75 2007-03-22 09:54:05Z raasch
98! Move call of user_actions( 'after_integration' ) below increment of times
99! and counters,
100! calls of prognostic_equations_.. changed to .._noopt, .._cache, and
101! .._vector, these calls are now controlled by switch loop_optimization,
102! uxrp, vynp eliminated, 2nd+3rd argument removed from exchange horiz,
103! moisture renamed humidity
104!
105! RCS Log replace by Id keyword, revision history cleaned up
106!
107! Revision 1.8  2006/08/22 14:16:05  raasch
108! Disturbances are imposed only for the last Runge-Kutta-substep
109!
110! Revision 1.2  2004/04/30 13:03:40  raasch
111! decalpha-specific warning removed, routine name changed to time_integration,
112! particle advection is carried out only once during the intermediate steps,
113! impulse_advec renamed momentum_advec
114!
115! Revision 1.1  1997/08/11 06:19:04  raasch
116! Initial revision
117!
118!
119! Description:
120! ------------
121! Integration in time of the model equations, statistical analysis and graphic
122! output
123!------------------------------------------------------------------------------!
124
125    USE arrays_3d
126    USE averaging
127    USE control_parameters
128    USE cpulog
129#if defined( __dvrp_graphics )
130    USE DVRP
131#endif
132    USE grid_variables
133    USE indices
134    USE interaction_droplets_ptq_mod
135    USE interfaces
136    USE particle_attributes
137    USE pegrid
138    USE prognostic_equations_mod
139    USE statistics
140    USE user_actions_mod
141
142    IMPLICIT NONE
143
144    CHARACTER (LEN=9) ::  time_to_string
145
146!
147!-- At the beginning of a simulation determine the time step as well as
148!-- determine and print out the run control parameters
149    IF ( simulated_time == 0.0 )  CALL timestep
150
151    CALL run_control
152
153
154!
155!-- Data exchange between coupled models in case that a call has been omitted
156!-- at the end of the previous run of a job chain.
157    IF ( coupling_mode /= 'uncoupled'  .AND.  run_coupled )  THEN
158!
159!--    In case of model termination initiated by the local model the coupler
160!--    must not be called because this would again cause an MPI hang.
161       DO WHILE ( time_coupling >= dt_coupling .AND. terminate_coupled == 0 )
162          CALL surface_coupler
163          time_coupling = time_coupling - dt_coupling
164       ENDDO
165       IF (time_coupling == 0.0 .AND. time_since_reference_point < dt_coupling)&
166       THEN
167          time_coupling = time_since_reference_point
168       ENDIF
169    ENDIF
170
171
172#if defined( __dvrp_graphics )
173!
174!-- Time measurement with dvrp software 
175    CALL DVRP_LOG_EVENT( 2, current_timestep_number )
176#endif
177
178!
179!-- Start of the time loop
180    DO  WHILE ( simulated_time < end_time  .AND.  .NOT. stop_dt  .AND. &
181                .NOT. terminate_run )
182
183       CALL cpu_log( log_point_s(10), 'timesteps', 'start' )
184!
185!--    Determine size of next time step
186       IF ( simulated_time /= 0.0 )  CALL timestep
187!
188!--    Execute the user-defined actions
189       CALL user_actions( 'before_timestep' )
190
191!
192!--    Start of intermediate step loop
193       intermediate_timestep_count = 0
194       DO  WHILE ( intermediate_timestep_count < &
195                   intermediate_timestep_count_max )
196
197          intermediate_timestep_count = intermediate_timestep_count + 1
198
199!
200!--       Set the steering factors for the prognostic equations which depend
201!--       on the timestep scheme
202          CALL timestep_scheme_steering
203
204!
205!--       Solve the prognostic equations. A fast cache optimized version with
206!--       only one single loop is used in case of Piascek-Williams advection
207!--       scheme. NEC vector machines use a different version, because
208!--       in the other versions a good vectorization is prohibited due to
209!--       inlining problems.
210          IF ( loop_optimization == 'cache' )  THEN
211             CALL prognostic_equations_cache
212          ELSEIF ( loop_optimization == 'vector' )  THEN
213             CALL prognostic_equations_vector
214          ELSEIF ( loop_optimization == 'acc' )  THEN
215             CALL prognostic_equations_acc
216          ENDIF
217
218!
219!--       Particle transport/physics with the Lagrangian particle model
220!--       (only once during intermediate steps, because it uses an Euler-step)
221          IF ( particle_advection  .AND.                         &
222               simulated_time >= particle_advection_start  .AND. &
223               intermediate_timestep_count == 1 )  THEN
224             CALL lpm
225             first_call_lpm = .FALSE.
226          ENDIF
227
228!
229!--       Interaction of droplets with temperature and specific humidity.
230!--       Droplet condensation and evaporation is calculated within
231!--       advec_particles.
232          IF ( cloud_droplets  .AND.  &
233               intermediate_timestep_count == intermediate_timestep_count_max )&
234          THEN
235             CALL interaction_droplets_ptq
236          ENDIF
237
238!
239!--       Exchange of ghost points (lateral boundary conditions)
240          CALL cpu_log( log_point(26), 'exchange-horiz-progn', 'start' )
241          !$acc update host( e_p, pt_p, u_p, v_p, w_p )
242          CALL exchange_horiz( u_p, nbgp )
243          CALL exchange_horiz( v_p, nbgp )
244          CALL exchange_horiz( w_p, nbgp )
245          CALL exchange_horiz( pt_p, nbgp )
246          IF ( .NOT. constant_diffusion )  CALL exchange_horiz( e_p, nbgp )
247          IF ( ocean )  THEN
248             CALL exchange_horiz( sa_p, nbgp )
249             CALL exchange_horiz( rho, nbgp )
250             CALL exchange_horiz( prho, nbgp )
251          ENDIF
252          IF (humidity  .OR.  passive_scalar)  THEN
253             CALL exchange_horiz( q_p, nbgp )
254             IF ( cloud_physics .AND. icloud_scheme == 0 )  THEN
255                CALL exchange_horiz( qr_p, nbgp )
256                CALL exchange_horiz( nr_p, nbgp )
257             ENDIF
258          ENDIF
259          IF ( cloud_droplets )  THEN
260             CALL exchange_horiz( ql, nbgp )
261             CALL exchange_horiz( ql_c, nbgp )
262             CALL exchange_horiz( ql_v, nbgp )
263             CALL exchange_horiz( ql_vp, nbgp )
264          ENDIF
265          IF ( wang_kernel  .OR.  turbulence )  CALL exchange_horiz( diss, nbgp )
266
267          CALL cpu_log( log_point(26), 'exchange-horiz-progn', 'stop' )
268
269!
270!--       Boundary conditions for the prognostic quantities (except of the
271!--       velocities at the outflow in case of a non-cyclic lateral wall)
272          CALL boundary_conds( 'main' )
273
274!
275!--       Swap the time levels in preparation for the next time step.
276          !$acc update device( e_p, pt_p, u_p, v_p, w_p )
277          CALL swap_timelevel
278
279!
280!--       Temperature offset must be imposed at cyclic boundaries in x-direction
281!--       when a sloping surface is used
282          IF ( sloping_surface )  THEN
283             IF ( nxl ==  0 )  pt(:,:,nxlg:nxl-1) = pt(:,:,nxlg:nxl-1) - &
284                                                    pt_slope_offset
285             IF ( nxr == nx )  pt(:,:,nxr+1:nxrg) = pt(:,:,nxr+1:nxrg) + &
286                                                    pt_slope_offset
287          ENDIF
288
289!
290!--       Impose a turbulent inflow using the recycling method
291          IF ( turbulent_inflow )  CALL  inflow_turbulence
292
293!
294!--       Impose a random perturbation on the horizontal velocity field
295          IF ( create_disturbances  .AND.                                      &
296               ( call_psolver_at_all_substeps  .AND.                           &
297               intermediate_timestep_count == intermediate_timestep_count_max )&
298          .OR. ( .NOT. call_psolver_at_all_substeps  .AND.                     &
299               intermediate_timestep_count == 1 ) )                            &
300          THEN
301             time_disturb = time_disturb + dt_3d
302             IF ( time_disturb >= dt_disturb )  THEN
303                !$acc update host( u, v )
304                IF ( hom(nzb+5,1,pr_palm,0) < disturbance_energy_limit )  THEN
305                   CALL disturb_field( nzb_u_inner, tend, u )
306                   CALL disturb_field( nzb_v_inner, tend, v )
307                ELSEIF ( .NOT. bc_lr_cyc  .OR.  .NOT. bc_ns_cyc )  THEN
308!
309!--                Runs with a non-cyclic lateral wall need perturbations
310!--                near the inflow throughout the whole simulation
311                   dist_range = 1
312                   CALL disturb_field( nzb_u_inner, tend, u )
313                   CALL disturb_field( nzb_v_inner, tend, v )
314                   dist_range = 0
315                ENDIF
316                !$acc update device( u, v )
317                time_disturb = time_disturb - dt_disturb
318             ENDIF
319          ENDIF
320
321!
322!--       Reduce the velocity divergence via the equation for perturbation
323!--       pressure.
324          IF ( intermediate_timestep_count == 1  .OR. &
325                call_psolver_at_all_substeps )  THEN
326             CALL pres
327          ENDIF
328
329!
330!--       If required, compute virtuell potential temperature
331          IF ( humidity )  THEN
332             CALL compute_vpt
333             !$acc update device( vpt )
334          ENDIF
335
336!
337!--       If required, compute liquid water content
338          IF ( cloud_physics )  THEN
339             CALL calc_liquid_water_content
340             !$acc update device( ql )
341          ENDIF
342
343!
344!--       Compute the diffusion quantities
345          IF ( .NOT. constant_diffusion )  THEN
346
347!
348!--          First the vertical fluxes in the Prandtl layer are being computed
349             IF ( prandtl_layer )  THEN
350                CALL cpu_log( log_point(19), 'prandtl_fluxes', 'start' )
351                CALL prandtl_fluxes
352                CALL cpu_log( log_point(19), 'prandtl_fluxes', 'stop' )
353             ENDIF
354
355!
356!--          Compute the diffusion coefficients
357             CALL cpu_log( log_point(17), 'diffusivities', 'start' )
358             IF ( .NOT. humidity ) THEN
359                IF ( ocean )  THEN
360                   CALL diffusivities( prho, prho_reference )
361                ELSE
362                   CALL diffusivities( pt, pt_reference )
363                ENDIF
364             ELSE
365                CALL diffusivities( vpt, pt_reference )
366             ENDIF
367             CALL cpu_log( log_point(17), 'diffusivities', 'stop' )
368
369          ENDIF
370
371       ENDDO   ! Intermediate step loop
372
373!
374!--    Increase simulation time and output times
375       nr_timesteps_this_run      = nr_timesteps_this_run + 1
376       current_timestep_number    = current_timestep_number + 1
377       simulated_time             = simulated_time   + dt_3d
378       simulated_time_chr         = time_to_string( simulated_time )
379       time_since_reference_point = simulated_time - coupling_start_time
380
381       IF ( simulated_time >= skip_time_data_output_av )  THEN
382          time_do_av         = time_do_av       + dt_3d
383       ENDIF
384       IF ( simulated_time >= skip_time_do2d_xy )  THEN
385          time_do2d_xy       = time_do2d_xy     + dt_3d
386       ENDIF
387       IF ( simulated_time >= skip_time_do2d_xz )  THEN
388          time_do2d_xz       = time_do2d_xz     + dt_3d
389       ENDIF
390       IF ( simulated_time >= skip_time_do2d_yz )  THEN
391          time_do2d_yz       = time_do2d_yz     + dt_3d
392       ENDIF
393       IF ( simulated_time >= skip_time_do3d    )  THEN
394          time_do3d          = time_do3d        + dt_3d
395       ENDIF
396       DO  mid = 1, masks
397          IF ( simulated_time >= skip_time_domask(mid) )  THEN
398             time_domask(mid)= time_domask(mid) + dt_3d
399          ENDIF
400       ENDDO
401       time_dvrp          = time_dvrp        + dt_3d
402       IF ( simulated_time >= skip_time_dosp )  THEN
403          time_dosp       = time_dosp        + dt_3d
404       ENDIF
405       time_dots          = time_dots        + dt_3d
406       IF ( .NOT. first_call_lpm )  THEN
407          time_dopts      = time_dopts       + dt_3d
408       ENDIF
409       IF ( simulated_time >= skip_time_dopr )  THEN
410          time_dopr       = time_dopr        + dt_3d
411       ENDIF
412       time_dopr_listing          = time_dopr_listing        + dt_3d
413       time_run_control   = time_run_control + dt_3d
414
415!
416!--    Data exchange between coupled models
417       IF ( coupling_mode /= 'uncoupled'  .AND.  run_coupled )  THEN
418          time_coupling = time_coupling + dt_3d
419
420!
421!--       In case of model termination initiated by the local model
422!--       (terminate_coupled > 0), the coupler must be skipped because it would
423!--       cause an MPI intercomminucation hang.
424!--       If necessary, the coupler will be called at the beginning of the
425!--       next restart run.
426          DO WHILE ( time_coupling >= dt_coupling .AND. terminate_coupled == 0 )
427             CALL surface_coupler
428             time_coupling = time_coupling - dt_coupling
429          ENDDO
430       ENDIF
431
432!
433!--    Execute user-defined actions
434       CALL user_actions( 'after_integration' )
435
436!
437!--    If Galilei transformation is used, determine the distance that the
438!--    model has moved so far
439       IF ( galilei_transformation )  THEN
440          advected_distance_x = advected_distance_x + u_gtrans * dt_3d
441          advected_distance_y = advected_distance_y + v_gtrans * dt_3d
442       ENDIF
443
444!
445!--    Check, if restart is necessary (because cpu-time is expiring or
446!--    because it is forced by user) and set stop flag
447!--    This call is skipped if the remote model has already initiated a restart.
448       IF ( .NOT. terminate_run )  CALL check_for_restart
449
450!
451!--    Carry out statistical analysis and output at the requested output times.
452!--    The MOD function is used for calculating the output time counters (like
453!--    time_dopr) in order to regard a possible decrease of the output time
454!--    interval in case of restart runs
455
456!
457!--    Set a flag indicating that so far no statistics have been created
458!--    for this time step
459       flow_statistics_called = .FALSE.
460
461!
462!--    If required, call flow_statistics for averaging in time
463       IF ( averaging_interval_pr /= 0.0  .AND.  &
464            ( dt_dopr - time_dopr ) <= averaging_interval_pr  .AND.  &
465            simulated_time >= skip_time_dopr )  THEN
466          time_dopr_av = time_dopr_av + dt_3d
467          IF ( time_dopr_av >= dt_averaging_input_pr )  THEN
468             do_sum = .TRUE.
469             time_dopr_av = MOD( time_dopr_av, &
470                                    MAX( dt_averaging_input_pr, dt_3d ) )
471          ENDIF
472       ENDIF
473       IF ( do_sum )  CALL flow_statistics
474
475!
476!--    Sum-up 3d-arrays for later output of time-averaged 2d/3d/masked data
477       IF ( averaging_interval /= 0.0  .AND.                                &
478            ( dt_data_output_av - time_do_av ) <= averaging_interval  .AND. &
479            simulated_time >= skip_time_data_output_av )                    &
480       THEN
481          time_do_sla = time_do_sla + dt_3d
482          IF ( time_do_sla >= dt_averaging_input )  THEN
483             CALL sum_up_3d_data
484             average_count_3d = average_count_3d + 1
485             time_do_sla = MOD( time_do_sla, MAX( dt_averaging_input, dt_3d ) )
486          ENDIF
487       ENDIF
488
489!
490!--    Calculate spectra for time averaging
491       IF ( averaging_interval_sp /= 0.0  .AND.  &
492            ( dt_dosp - time_dosp ) <= averaging_interval_sp  .AND.  &
493            simulated_time >= skip_time_dosp )  THEN
494          time_dosp_av = time_dosp_av + dt_3d
495          IF ( time_dosp_av >= dt_averaging_input_pr )  THEN
496             CALL calc_spectra
497             time_dosp_av = MOD( time_dosp_av, &
498                                 MAX( dt_averaging_input_pr, dt_3d ) )
499          ENDIF
500       ENDIF
501
502!
503!--    Computation and output of run control parameters.
504!--    This is also done whenever perturbations have been imposed
505       IF ( time_run_control >= dt_run_control  .OR.                     &
506            timestep_scheme(1:5) /= 'runge'  .OR.  disturbance_created ) &
507       THEN
508          CALL run_control
509          IF ( time_run_control >= dt_run_control )  THEN
510             time_run_control = MOD( time_run_control, &
511                                     MAX( dt_run_control, dt_3d ) )
512          ENDIF
513       ENDIF
514
515!
516!--    Profile output (ASCII) on file
517       IF ( time_dopr_listing >= dt_dopr_listing )  THEN
518          CALL print_1d
519          time_dopr_listing = MOD( time_dopr_listing, MAX( dt_dopr_listing, &
520                                                           dt_3d ) )
521       ENDIF
522
523!
524!--    Graphic output for PROFIL
525       IF ( time_dopr >= dt_dopr )  THEN
526          IF ( dopr_n /= 0 )  CALL data_output_profiles
527          time_dopr = MOD( time_dopr, MAX( dt_dopr, dt_3d ) )
528          time_dopr_av = 0.0    ! due to averaging (see above)
529       ENDIF
530
531!
532!--    Graphic output for time series
533       IF ( time_dots >= dt_dots )  THEN
534          CALL data_output_tseries
535          time_dots = MOD( time_dots, MAX( dt_dots, dt_3d ) )
536       ENDIF
537
538!
539!--    Output of spectra (formatted for use with PROFIL), in case of no
540!--    time averaging, spectra has to be calculated before
541       IF ( time_dosp >= dt_dosp )  THEN
542          IF ( average_count_sp == 0 )  CALL calc_spectra
543          CALL data_output_spectra
544          time_dosp = MOD( time_dosp, MAX( dt_dosp, dt_3d ) )
545       ENDIF
546
547!
548!--    2d-data output (cross-sections)
549       IF ( time_do2d_xy >= dt_do2d_xy )  THEN
550          CALL data_output_2d( 'xy', 0 )
551          time_do2d_xy = MOD( time_do2d_xy, MAX( dt_do2d_xy, dt_3d ) )
552       ENDIF
553       IF ( time_do2d_xz >= dt_do2d_xz )  THEN
554          CALL data_output_2d( 'xz', 0 )
555          time_do2d_xz = MOD( time_do2d_xz, MAX( dt_do2d_xz, dt_3d ) )
556       ENDIF
557       IF ( time_do2d_yz >= dt_do2d_yz )  THEN
558          CALL data_output_2d( 'yz', 0 )
559          time_do2d_yz = MOD( time_do2d_yz, MAX( dt_do2d_yz, dt_3d ) )
560       ENDIF
561
562!
563!--    3d-data output (volume data)
564       IF ( time_do3d >= dt_do3d )  THEN
565          CALL data_output_3d( 0 )
566          time_do3d = MOD( time_do3d, MAX( dt_do3d, dt_3d ) )
567       ENDIF
568
569!
570!--    masked data output
571       DO  mid = 1, masks
572          IF ( time_domask(mid) >= dt_domask(mid) )  THEN
573             CALL data_output_mask( 0 )
574             time_domask(mid) = MOD( time_domask(mid),  &
575                                     MAX( dt_domask(mid), dt_3d ) )
576          ENDIF
577       ENDDO
578
579!
580!--    Output of time-averaged 2d/3d/masked data
581       IF ( time_do_av >= dt_data_output_av )  THEN
582          CALL average_3d_data
583          CALL data_output_2d( 'xy', 1 )
584          CALL data_output_2d( 'xz', 1 )
585          CALL data_output_2d( 'yz', 1 )
586          CALL data_output_3d( 1 )
587          DO  mid = 1, masks
588             CALL data_output_mask( 1 )
589          ENDDO
590          time_do_av = MOD( time_do_av, MAX( dt_data_output_av, dt_3d ) )
591       ENDIF
592
593!
594!--    Output of particle time series
595       IF ( particle_advection )  THEN
596          IF ( time_dopts >= dt_dopts  .OR. &
597               ( simulated_time >= particle_advection_start  .AND. &
598                 first_call_lpm ) )  THEN
599             CALL data_output_ptseries
600             time_dopts = MOD( time_dopts, MAX( dt_dopts, dt_3d ) )
601          ENDIF
602       ENDIF
603
604!
605!--    Output of dvrp-graphics (isosurface, particles, slicer)
606#if defined( __dvrp_graphics )
607       CALL DVRP_LOG_EVENT( -2, current_timestep_number-1 )
608#endif
609       IF ( time_dvrp >= dt_dvrp )  THEN
610          CALL data_output_dvrp
611          time_dvrp = MOD( time_dvrp, MAX( dt_dvrp, dt_3d ) )
612       ENDIF
613#if defined( __dvrp_graphics )
614       CALL DVRP_LOG_EVENT( 2, current_timestep_number )
615#endif
616
617!
618!--    If required, set the heat flux for the next time step at a random value
619       IF ( constant_heatflux  .AND.  random_heatflux )  CALL disturb_heatflux
620
621!
622!--    Execute user-defined actions
623       CALL user_actions( 'after_timestep' )
624
625       CALL cpu_log( log_point_s(10), 'timesteps', 'stop' )
626
627
628    ENDDO   ! time loop
629
630#if defined( __dvrp_graphics )
631    CALL DVRP_LOG_EVENT( -2, current_timestep_number )
632#endif
633
634 END SUBROUTINE time_integration
Note: See TracBrowser for help on using the repository browser.