Ignore:
Timestamp:
May 27, 2016 2:35:57 PM (5 years ago)
Author:
raasch
Message:

bugfixes for calculating run control quantities, bugfix for calculating pressure with fft-method in case of Neumann conditions both at bottom and top, steering of pres modified, ocean mode now uses initial density profile as reference in the buoyancy term

File:
1 edited

Legend:

Unmodified
Added
Removed
  • palm/trunk/SOURCE/time_integration.f90

    r1917 r1918  
    1919! Current revisions:
    2020! ------------------
    21 !
     21! determination of time step moved to the end of the time step loop,
     22! the first time step is now always calculated before the time step loop (i.e.
     23! also in case of restart runs)
    2224!
    2325! Former revisions:
     
    260262    USE indices,                                                               &
    261263        ONLY:  i_left, i_right, j_north, j_south, nbgp, nx, nxl, nxlg, nxr,    &
    262                nxrg, nyn, nys, nzb, nzt, nzb_u_inner, nzb_v_inner
     264               nxrg, nyn, nyng, nys, nysg, nzb, nzt, nzb_u_inner, nzb_v_inner
    263265
    264266    USE interaction_droplets_ptq_mod,                                          &
    265267        ONLY:  interaction_droplets_ptq
     268
     269    USE interfaces
    266270
    267271    USE kinds
     
    311315
    312316    USE statistics,                                                            &
    313         ONLY:  flow_statistics_called, hom, pr_palm, sums_ls_l
     317        ONLY:  flow_statistics_called, hom, pr_palm, sums_ls_l, u_max,         &
     318               u_max_ijk, v_max, v_max_ijk, w_max, w_max_ijk
    314319
    315320    USE surface_layer_fluxes_mod,                                              &
     
    326331    CHARACTER (LEN=9) ::  time_to_string          !<
    327332
    328 !
    329 !-- At the beginning of a simulation determine the time step as well as
    330 !-- determine and print out the run control parameters
    331     IF ( simulated_time == 0.0_wp )  CALL timestep
     333    REAL(wp) ::  dt_3d_old  !< temporary storage of timestep to be used for
     334                            !< steering of run control output interval
     335
     336!
     337!-- At beginning determine the first time step
     338    CALL timestep
    332339
    333340!
     
    340347    ENDIF
    341348
     349!
     350!-- Determine and print out the run control quantities before the first time
     351!-- step of this run. For the initial run, some statistics (e.g. divergence)
     352!-- need to be determined first.
     353    IF ( simulated_time == 0.0_wp )  CALL flow_statistics
    342354    CALL run_control
    343355
     
    349361!--    In case of model termination initiated by the local model the coupler
    350362!--    must not be called because this would again cause an MPI hang.
    351        DO WHILE ( time_coupling >= dt_coupling .AND. terminate_coupled == 0 )
     363       DO WHILE ( time_coupling >= dt_coupling  .AND. terminate_coupled == 0 )
    352364          CALL surface_coupler
    353365          time_coupling = time_coupling - dt_coupling
    354366       ENDDO
    355        IF (time_coupling == 0.0_wp .AND. time_since_reference_point < dt_coupling)&
     367       IF (time_coupling == 0.0_wp  .AND.                                      &
     368           time_since_reference_point < dt_coupling )                          &
    356369       THEN
    357370          time_coupling = time_since_reference_point
     
    372385
    373386       CALL cpu_log( log_point_s(10), 'timesteps', 'start' )
    374 
    375 !
    376 !--    Determine size of next time step
    377        IF ( simulated_time /= 0.0_wp )  THEN
    378           CALL timestep
    379 !
    380 !--       Synchronize the timestep in case of nested run.
    381           IF ( nested_run )  THEN
    382 !
    383 !--          Synchronize by unifying the time step.
    384 !--          Global minimum of all time-steps is used for all.     
    385              CALL pmci_synchronize
    386           ENDIF
    387        ENDIF
    388387
    389388!
     
    10261025
    10271026!
    1028 !--    Computation and output of run control parameters.
    1029 !--    This is also done whenever perturbations have been imposed
    1030        IF ( time_run_control >= dt_run_control  .OR.                     &
    1031             timestep_scheme(1:5) /= 'runge'  .OR.  disturbance_created ) &
    1032        THEN
    1033           CALL run_control
    1034           IF ( time_run_control >= dt_run_control )  THEN
    1035              time_run_control = MOD( time_run_control, &
    1036                                      MAX( dt_run_control, dt_3d ) )
    1037           ENDIF
    1038        ENDIF
    1039 
    1040 !
    10411027!--    Profile output (ASCII) on file
    10421028       IF ( time_dopr_listing >= dt_dopr_listing )  THEN
     
    11491135
    11501136!
     1137!--    Determine size of next time step. Save timestep dt_3d because it is
     1138!--    newly calculated in routine timestep, but required further below for
     1139!--    steering the run control output interval
     1140       dt_3d_old = dt_3d
     1141       CALL timestep
     1142
     1143!
     1144!--    Computation and output of run control parameters.
     1145!--    This is also done whenever perturbations have been imposed
     1146       IF ( time_run_control >= dt_run_control  .OR.                     &
     1147            timestep_scheme(1:5) /= 'runge'  .OR.  disturbance_created ) &
     1148       THEN
     1149!          IF ( current_timestep_number == 1 )  THEN
     1150!             IF ( nxl < 7 .AND.  nxr > 7 .AND. nys < 7 .AND. nyn > 7 )  THEN
     1151!                u(10,7,7) = 0.55
     1152!             ENDIF
     1153!             PRINT*, 'calculating minmax'
     1154!             CALL global_min_max( nzb, nzt+1, nysg, nyng, nxlg, nxrg, u,       &
     1155!                                  'abs', 0.0_wp, u_max, u_max_ijk )
     1156!             CALL global_min_max( nzb, nzt+1, nysg, nyng, nxlg, nxrg, v,       &
     1157!                                  'abs', 0.0_wp, v_max, v_max_ijk )
     1158!             CALL global_min_max( nzb, nzt+1, nysg, nyng, nxlg, nxrg, w,       &
     1159!                                  'abs', 0.0_wp, w_max, w_max_ijk )
     1160!             PRINT*, 'calculated u_max = ', u_max, '  myid = ', myid
     1161!          ENDIF
     1162          CALL run_control
     1163          IF ( time_run_control >= dt_run_control )  THEN
     1164             time_run_control = MOD( time_run_control, &
     1165                                     MAX( dt_run_control, dt_3d_old ) )
     1166          ENDIF
     1167       ENDIF
     1168
     1169!
     1170!--    Synchronize the timestep in case of nested run.
     1171       IF ( nested_run )  THEN
     1172!
     1173!--       Synchronize by unifying the time step.
     1174!--       Global minimum of all time-steps is used for all.
     1175          CALL pmci_synchronize
     1176       ENDIF
     1177
     1178!
    11511179!--    Output elapsed simulated time in form of a progress bar on stdout
    11521180       IF ( myid == 0 )  CALL output_progress_bar
Note: See TracChangeset for help on using the changeset viewer.