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

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

GPU porting of boundary conditions and routine pres; index bug removec from radiation boundary condition

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