Changeset 3646 for palm/trunk/SOURCE


Ignore:
Timestamp:
Dec 28, 2018 5:58:49 PM (5 years ago)
Author:
kanani
Message:

Bugfix: replace simulated_time by time_since_reference_point where required

Location:
palm/trunk/SOURCE
Files:
11 edited

Legend:

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

    r3614 r3646  
    2727! -----------------
    2828! $Id$
     29! Remove check for simulated_time > 0, it is not required since biometeorology
     30! is only called from time_integration and not during time_integration_spinup
     31!
     32! 3614 2018-12-10 07:05:46Z raasch
    2933! unused variables removed
    3034!
     
    101105       ONLY:  average_count_3d, biometeorology, dz, dz_stretch_factor,         &
    102106              dz_stretch_level, humidity, initializing_actions, nz_do3d,       &
    103               simulated_time, surface_pressure
     107              surface_pressure
    104108
    105109    USE date_and_time_mod,                                                                                                        &
     
    13431347!
    13441348!-- fill out the MRT 2D grid from appropriate source (RTM, RRTMG,...)
    1345     IF ( simulated_time > 0.0_wp ) THEN
    1346        CALL bio_calculate_mrt_grid ( av )
    1347     ENDIF
     1349    CALL bio_calculate_mrt_grid ( av )
    13481350
    13491351    DO i = nxl, nxr
     
    13551357!
    13561358!--       Determine input only if
    1357           IF ( simulated_time > 0.0_wp ) THEN
    1358              CALL bio_get_thermal_index_input_ij ( av, i, j, ta, vp,           &
    1359                 ws, pair, tmrt_ij )
    1360           END IF
     1359          CALL bio_get_thermal_index_input_ij ( av, i, j, ta, vp,           &
     1360                                                ws, pair, tmrt_ij )
    13611361!
    13621362!--       Only proceed if input is available
  • palm/trunk/SOURCE/check_parameters.f90

    r3637 r3646  
    2525! -----------------
    2626! $Id$
     27! Formatting
     28!
     29! 3637 2018-12-20 01:51:36Z knoop
    2730! Implementation of the PALM module interface
    2831!
     
    33153318       ntdim_3d(1) = do3d_time_count(1) + CEILING(                                    &
    33163319                     ( end_time - MAX(                                                &
    3317                          MERGE(skip_time_data_output_av, skip_time_data_output_av     &
    3318                               + spinup_time, data_output_during_spinup ),             &
     3320                         MERGE(   skip_time_data_output_av, skip_time_data_output_av  &
     3321                                + spinup_time, data_output_during_spinup ),           &
    33193322                         simulated_time_at_begin )                                    &
    33203323                     ) / dt_data_output_av )
     
    33233326                        ( end_time - MAX(                                             &
    33243327                           MERGE(skip_time_do2d_xy, skip_time_do2d_xy + spinup_time,  &
    3325                                data_output_during_spinup ),                           &
    3326                                           simulated_time_at_begin )                   &
     3328                                 data_output_during_spinup ),                         &
     3329                           simulated_time_at_begin )                                  &
    33273330                        ) / dt_do2d_xy )
    33283331
  • palm/trunk/SOURCE/chemistry_model_mod.f90

    r3643 r3646  
    2727! -----------------
    2828! $Id$
     29! Bugfix: use time_since_reference_point instead of simulated_time (relevant
     30! when using wall/soil spinup)
     31!
     32! 3643 2018-12-24 13:16:19Z knoop
    2933! Bugfix: set found logical correct in chem_data_output_2d
    3034!
     
    19231927    USE statistics,                                                          &
    19241928         ONLY:  weight_pres
    1925     USE control_parameters,                                                 &
    1926          ONLY:  dt_3d, intermediate_timestep_count, simulated_time
     1929    USE control_parameters,                                                  &
     1930         ONLY:  dt_3d, intermediate_timestep_count, time_since_reference_point
    19271931
    19281932    IMPLICIT NONE
     
    20142018
    20152019       IF(maxval(rcntrl) > 0.0)   THEN    ! Only if rcntrl is set
    2016           IF( simulated_time <= 2*dt_3d)  THEN
     2020          IF( time_since_reference_point <= 2*dt_3d)  THEN
    20172021             rcntrl_local = 0
    2018              !
    2019              !--   todo: remove (kanani)
    2020              !                  WRITE(9,'(a,2f10.3)') 'USE Default rcntrl in the first steps ',simulated_time,dt_3d
    20212022          ELSE
    20222023             rcntrl_local = rcntrl
  • palm/trunk/SOURCE/data_output_2d.f90

    r3637 r3646  
    2525! -----------------
    2626! $Id$
     27! Bugfix: use time_since_reference_point instead of simulated_time (relevant
     28! when using wall/soil spinup)
     29!
     30! 3637 2018-12-20 01:51:36Z knoop
    2731! Implementation of the PALM module interface
    2832!
     
    298302               ibc_uv_b, io_blocks, io_group, message_string,                  &
    299303               ntdim_2d_xy, ntdim_2d_xz, ntdim_2d_yz,                          &
    300                psolver, section, simulated_time,                               &
     304               psolver, section,                                               &
    301305               time_since_reference_point
    302306
     
    510514            ntdim_2d_xy(av) )  THEN
    511515          WRITE ( message_string, * ) 'Output of xy cross-sections is not ',   &
    512                           'given at t=', simulated_time, '&because the',       &
     516                          'given at t=', time_since_reference_point, 's because the',       &
    513517                          ' maximum number of output time levels is exceeded.'
    514518          CALL message( 'data_output_2d', 'PA0384', 0, 1, 0, 6, 0 )
     
    519523            ntdim_2d_xz(av) )  THEN
    520524          WRITE ( message_string, * ) 'Output of xz cross-sections is not ',   &
    521                           'given at t=', simulated_time, '&because the',       &
     525                          'given at t=', time_since_reference_point, 's because the',       &
    522526                          ' maximum number of output time levels is exceeded.'
    523527          CALL message( 'data_output_2d', 'PA0385', 0, 1, 0, 6, 0 )
     
    528532            ntdim_2d_yz(av) )  THEN
    529533          WRITE ( message_string, * ) 'Output of yz cross-sections is not ',   &
    530                           'given at t=', simulated_time, '&because the',       &
     534                          'given at t=', time_since_reference_point, 's because the',       &
    531535                          ' maximum number of output time levels is exceeded.'
    532536          CALL message( 'data_output_2d', 'PA0386', 0, 1, 0, 6, 0 )
     
    697701             CASE ( 'pc_xy', 'pc_xz', 'pc_yz' )  ! particle concentration
    698702                IF ( av == 0 )  THEN
    699                    IF ( simulated_time >= particle_advection_start )  THEN
     703                   IF ( time_since_reference_point >= particle_advection_start )  THEN
    700704                      tend = prt_count
    701705!                      CALL exchange_horiz( tend, nbgp )
     
    722726             CASE ( 'pr_xy', 'pr_xz', 'pr_yz' )  ! mean particle radius (effective radius)
    723727                IF ( av == 0 )  THEN
    724                    IF ( simulated_time >= particle_advection_start )  THEN
     728                   IF ( time_since_reference_point >= particle_advection_start )  THEN
    725729                      DO  i = nxl, nxr
    726730                         DO  j = nys, nyn
     
    844848             CASE ( 'ql_vp_xy', 'ql_vp_xz', 'ql_vp_yz' )
    845849                IF ( av == 0 )  THEN
    846                    IF ( simulated_time >= particle_advection_start )  THEN
     850                   IF ( time_since_reference_point >= particle_advection_start )  THEN
    847851                      DO  i = nxl, nxr
    848852                         DO  j = nys, nyn
     
    14221426!--                In case of parallel output, this is only done by PE0
    14231427!--                to increase the performance.
    1424                    IF ( simulated_time /= do2d_xy_last_time(av) )  THEN
     1428                   IF ( time_since_reference_point /= do2d_xy_last_time(av) )  THEN
    14251429                      do2d_xy_time_count(av) = do2d_xy_time_count(av) + 1
    1426                       do2d_xy_last_time(av)  = simulated_time
     1430                      do2d_xy_last_time(av)  = time_since_reference_point
    14271431                      IF ( myid == 0 )  THEN
    14281432                         IF ( .NOT. data_output_2d_on_each_pe  &
     
    16111615!--                In case of parallel output, this is only done by PE0
    16121616!--                to increase the performance.
    1613                    IF ( simulated_time /= do2d_xz_last_time(av) )  THEN
     1617                   IF ( time_since_reference_point /= do2d_xz_last_time(av) )  THEN
    16141618                      do2d_xz_time_count(av) = do2d_xz_time_count(av) + 1
    1615                       do2d_xz_last_time(av)  = simulated_time
     1619                      do2d_xz_last_time(av)  = time_since_reference_point
    16161620                      IF ( myid == 0 )  THEN
    16171621                         IF ( .NOT. data_output_2d_on_each_pe  &
     
    18291833!--                In case of parallel output, this is only done by PE0
    18301834!--                to increase the performance.
    1831                    IF ( simulated_time /= do2d_yz_last_time(av) )  THEN
     1835                   IF ( time_since_reference_point /= do2d_yz_last_time(av) )  THEN
    18321836                      do2d_yz_time_count(av) = do2d_yz_time_count(av) + 1
    1833                       do2d_yz_last_time(av)  = simulated_time
     1837                      do2d_yz_last_time(av)  = time_since_reference_point
    18341838                      IF ( myid == 0 )  THEN
    18351839                         IF ( .NOT. data_output_2d_on_each_pe  &
  • palm/trunk/SOURCE/data_output_3d.f90

    r3637 r3646  
    2525! -----------------
    2626! $Id$
     27! Bugfix: use time_since_reference_point instead of simulated_time (relevant
     28! when using wall/soil spinup)
     29!
     30! 3637 2018-12-20 01:51:36Z knoop
    2731! Implementation of the PALM module interface
    2832!
     
    255259               io_blocks, io_group, land_surface, message_string,              &
    256260               ntdim_3d, nz_do3d,  ocean_mode, plant_canopy,                   &
    257                psolver, salsa, simulated_time, time_since_reference_point,     &
     261               psolver, salsa, time_since_reference_point,                     &
    258262               urban_surface, varnamelength
    259263
     
    355359    IF ( netcdf_data_format > 4 )  THEN
    356360       IF ( do3d_time_count(av) + 1 > ntdim_3d(av) )  THEN
    357           WRITE ( message_string, * ) 'Output of 3d data is not given at t=',  &
    358                                       simulated_time, '&because the maximum ', &
    359                                       'number of output time levels is ',      &
     361          WRITE ( message_string, * ) 'Output of 3d data is not given at t=',               &
     362                                      time_since_reference_point, 's because the maximum ', &
     363                                      'number of output time levels is ',                   &
    360364                                      'exceeded.'
    361365          CALL message( 'data_output_3d', 'PA0387', 0, 1, 0, 6, 0 )
     
    447451          CASE ( 'pc' )  ! particle concentration (requires ghostpoint exchange)
    448452             IF ( av == 0 )  THEN
    449                 IF ( simulated_time >= particle_advection_start )  THEN
     453                IF ( time_since_reference_point >= particle_advection_start )  THEN
    450454                   tend = prt_count
    451455                ELSE
     
    470474          CASE ( 'pr' )  ! mean particle radius (effective radius)
    471475             IF ( av == 0 )  THEN
    472                 IF ( simulated_time >= particle_advection_start )  THEN
     476                IF ( time_since_reference_point >= particle_advection_start )  THEN
    473477                   DO  i = nxl, nxr
    474478                      DO  j = nys, nyn
     
    585589          CASE ( 'ql_vp' )
    586590             IF ( av == 0 )  THEN
    587                 IF ( simulated_time >= particle_advection_start )  THEN
     591                IF ( time_since_reference_point >= particle_advection_start )  THEN
    588592                   DO  i = nxl, nxr
    589593                      DO  j = nys, nyn
  • palm/trunk/SOURCE/parin.f90

    r3637 r3646  
    2525! -----------------
    2626! $Id$
     27! Bugfix: for restarts, reset data_output_during_spinup to FALSE to enable
     28! correct calculation of ntdim in check_parameters
     29!
     30! 3637 2018-12-20 01:51:36Z knoop
    2731! Implementation of the PALM module interface
    2832!
     
    893897             max_pr_user = max_pr_user_tmp
    894898          ENDIF
    895 
     899PRINT*, 'data_output_during_spinup 1: ', data_output_during_spinup
    896900!
    897901!--       Activate spinup
     
    904908                ENDIF
    905909                end_time = end_time + spinup_time
    906                 IF ( TRIM( initializing_actions ) /= 'read_restart_data' )     &
     910                IF ( TRIM( initializing_actions ) /= 'read_restart_data' )  THEN
    907911                   spinup = .TRUE.
     912                ELSEIF (        TRIM( initializing_actions ) == 'read_restart_data'      &
     913                         .AND.  time_since_reference_point > 0.0_wp )  THEN
     914                   data_output_during_spinup = .FALSE.  !< required for correct ntdim calculation
     915                                                        !< in check_parameters for restart run
     916                ENDIF
    908917             ENDIF
    909918          ENDIF
     919PRINT*, 'data_output_during_spinup 2: ', data_output_during_spinup
    910920
    911921!
  • palm/trunk/SOURCE/pmc_interface_mod.f90

    r3636 r3646  
    2525! -----------------
    2626! $Id$
     27! Remove unused variable simulated_time
     28!
     29! 3636 2018-12-19 13:48:34Z raasch
    2730! nopointer option removed
    2831!
     
    342345               coupling_char, dt_3d, dz, humidity, message_string,             &
    343346               neutral, passive_scalar, rans_mode, rans_tke_e,                 &
    344                roughness_length, simulated_time, topography, volume_flow
     347               roughness_length, topography, volume_flow
    345348
    346349    USE chem_modules,                                                          &
  • palm/trunk/SOURCE/surface_output_mod.f90

    r3614 r3646  
    2525! -----------------
    2626! $Id$
     27! Bugfix: use time_since_reference_point instead of simulated_time (relevant
     28! when using wall/soil spinup)
     29!
     30! 3614 2018-12-10 07:05:46Z raasch
    2731! unused variables removed
    2832!
     
    864868   
    865869      USE control_parameters,                                                  &
    866           ONLY:  io_blocks, io_group, simulated_time
     870          ONLY:  io_blocks, io_group, time_since_reference_point
    867871
    868872      USE pegrid,                                                              &
     
    22342238               WRITE ( 25+av )  LEN_TRIM( 'time' )
    22352239               WRITE ( 25+av )  'time'
    2236                WRITE ( 25+av )  simulated_time
     2240               WRITE ( 25+av )  time_since_reference_point
    22372241               WRITE ( 25+av )  LEN_TRIM( trimvar )
    22382242               WRITE ( 25+av )  TRIM( trimvar )
  • palm/trunk/SOURCE/synthetic_turbulence_generator_mod.f90

    r3579 r3646  
    2525! -----------------
    2626! $Id$
     27! Bugfix: use time_since_reference_point instead of simulated_time (relevant
     28! when using wall/soil spinup)
     29!
     30! 3579 2018-11-29 15:32:39Z suehring
    2731! - Bugfix in calculation of turbulence scaling parameters for turbulence
    2832!   generator in case of topography
     
    10541058    USE control_parameters,                                                    &
    10551059        ONLY:  child_domain, dt_3d, intermediate_timestep_count,               &
    1056                nesting_offline, rans_mode, simulated_time, volume_flow_initial
     1060               nesting_offline, rans_mode, time_since_reference_point,         &
     1061               volume_flow_initial
    10571062
    10581063    USE grid_variables,                                                        &
     
    10871092!
    10881093!-- Initial value of fu, fv, fw
    1089     IF ( simulated_time == 0.0_wp .AND. .NOT. velocity_seed_initialized )  THEN
     1094    IF ( time_since_reference_point == 0.0_wp .AND. .NOT. velocity_seed_initialized )  THEN
    10901095       CALL stg_generate_seed_yz( nuy, nuz, buy, buz, fu_yz, id_stg_left )
    10911096       CALL stg_generate_seed_yz( nvy, nvz, bvy, bvz, fv_yz, id_stg_left )
  • palm/trunk/SOURCE/time_integration.f90

    r3634 r3646  
    2525! -----------------
    2626! $Id$
     27! Bugfix: use time_since_reference_point instead of simulated_time where
     28! required (relevant when using wall/soil spinup)
     29!
     30! 3634 2018-12-18 12:31:28Z knoop
    2731! OpenACC port for SPEC
    2832!
     
    915919!--       to regard droplet interactions directly
    916920          IF ( particle_advection  .AND.                         &
    917                simulated_time >= particle_advection_start  .AND. &
     921               time_since_reference_point >= particle_advection_start  .AND. &
    918922               intermediate_timestep_count == 1 )  THEN
    919923             CALL lpm
     
    14241428
    14251429
    1426        IF ( simulated_time >= skip_time_data_output_av )  THEN
     1430       IF ( time_since_reference_point >= skip_time_data_output_av )  THEN
    14271431          time_do_av         = time_do_av       + dt_3d
    14281432       ENDIF
    1429        IF ( simulated_time >= skip_time_do2d_xy )  THEN
     1433       IF ( time_since_reference_point >= skip_time_do2d_xy )  THEN
    14301434          time_do2d_xy       = time_do2d_xy     + dt_3d
    14311435       ENDIF
    1432        IF ( simulated_time >= skip_time_do2d_xz )  THEN
     1436       IF ( time_since_reference_point >= skip_time_do2d_xz )  THEN
    14331437          time_do2d_xz       = time_do2d_xz     + dt_3d
    14341438       ENDIF
    1435        IF ( simulated_time >= skip_time_do2d_yz )  THEN
     1439       IF ( time_since_reference_point >= skip_time_do2d_yz )  THEN
    14361440          time_do2d_yz       = time_do2d_yz     + dt_3d
    14371441       ENDIF
    1438        IF ( simulated_time >= skip_time_do3d    )  THEN
     1442       IF ( time_since_reference_point >= skip_time_do3d    )  THEN
    14391443          time_do3d          = time_do3d        + dt_3d
    14401444       ENDIF
    14411445       DO  mid = 1, masks
    1442           IF ( simulated_time >= skip_time_domask(mid) )  THEN
     1446          IF ( time_since_reference_point >= skip_time_domask(mid) )  THEN
    14431447             time_domask(mid)= time_domask(mid) + dt_3d
    14441448          ENDIF
    14451449       ENDDO
    14461450       time_dvrp          = time_dvrp        + dt_3d
    1447        IF ( simulated_time >= skip_time_dosp )  THEN
     1451       IF ( time_since_reference_point >= skip_time_dosp )  THEN
    14481452          time_dosp       = time_dosp        + dt_3d
    14491453       ENDIF
     
    14521456          time_dopts      = time_dopts       + dt_3d
    14531457       ENDIF
    1454        IF ( simulated_time >= skip_time_dopr )  THEN
     1458       IF ( time_since_reference_point >= skip_time_dopr )  THEN
    14551459          time_dopr       = time_dopr        + dt_3d
    14561460       ENDIF
     
    14601464!--    Increment time-counter for surface output
    14611465       IF ( surface_data_output )  THEN
    1462           IF ( simulated_time >= skip_time_dosurf )  THEN
     1466          IF ( time_since_reference_point >= skip_time_dosurf )  THEN
    14631467             time_dosurf    = time_dosurf + dt_3d
    14641468          ENDIF
    1465           IF ( simulated_time >= skip_time_dosurf_av )  THEN
     1469          IF ( time_since_reference_point >= skip_time_dosurf_av )  THEN
    14661470             time_dosurf_av = time_dosurf_av + dt_3d
    14671471          ENDIF
     
    15521556       IF ( averaging_interval_pr /= 0.0_wp  .AND.  &
    15531557            ( dt_dopr - time_dopr ) <= averaging_interval_pr  .AND.  &
    1554             simulated_time >= skip_time_dopr )  THEN
     1558            time_since_reference_point >= skip_time_dopr )  THEN
    15551559          time_dopr_av = time_dopr_av + dt_3d
    15561560          IF ( time_dopr_av >= dt_averaging_input_pr )  THEN
     
    15661570       IF ( averaging_interval /= 0.0_wp  .AND.                                &
    15671571            ( dt_data_output_av - time_do_av ) <= averaging_interval  .AND. &
    1568             simulated_time >= skip_time_data_output_av )                    &
     1572            time_since_reference_point >= skip_time_data_output_av )                    &
    15691573       THEN
    15701574          time_do_sla = time_do_sla + dt_3d
     
    15801584          IF ( averaging_interval_surf /= 0.0_wp  .AND.                        &
    15811585               ( dt_dosurf_av - time_dosurf_av ) <= averaging_interval_surf    &
    1582           .AND.  simulated_time >= skip_time_dosurf_av )  THEN
     1586          .AND.  time_since_reference_point >= skip_time_dosurf_av )  THEN
    15831587             IF ( time_dosurf_av >= dt_averaging_input )  THEN       
    15841588                CALL surface_output_averaging
     
    15921596       IF ( averaging_interval_sp /= 0.0_wp  .AND.  &
    15931597            ( dt_dosp - time_dosp ) <= averaging_interval_sp  .AND.  &
    1594             simulated_time >= skip_time_dosp )  THEN
     1598            time_since_reference_point >= skip_time_dosp )  THEN
    15951599          time_dosp_av = time_dosp_av + dt_3d
    15961600          IF ( time_dosp_av >= dt_averaging_input_pr )  THEN
     
    17061710       IF ( particle_advection )  THEN
    17071711          IF ( time_dopts >= dt_dopts  .OR. &
    1708                ( simulated_time >= particle_advection_start  .AND. &
     1712               ( time_since_reference_point >= particle_advection_start  .AND. &
    17091713                 first_call_lpm ) )  THEN
    17101714             CALL data_output_ptseries
  • palm/trunk/SOURCE/turbulence_closure_mod.f90

    r3636 r3646  
    2525! -----------------
    2626! $Id$
     27! Remove unused variable simulated_time
     28!
     29! 3636 2018-12-19 13:48:34Z raasch
    2730! nopointer option removed
    2831!
     
    194197               les_dynamic, les_mw, ocean_mode, plant_canopy, prandtl_number,  &
    195198               pt_reference, rans_mode, rans_tke_e, rans_tke_l,                &
    196                simulated_time,timestep_scheme, turbulence_closure,             &
     199               timestep_scheme, turbulence_closure,                            &
    197200               turbulent_inflow, use_upstream_for_tke, vpt_reference,          &
    198201               ws_scheme_sca, current_timestep_number
Note: See TracChangeset for help on using the changeset viewer.