Changeset 3761 for palm


Ignore:
Timestamp:
Feb 25, 2019 3:31:42 PM (5 years ago)
Author:
raasch
Message:

unused variables removed, OpenACC directives re-formatted, statements added to avoid compiler warnings

Location:
palm/trunk/SOURCE
Files:
21 edited

Legend:

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

    r3655 r3761  
    2525! -----------------
    2626! $Id$
     27! unused variables removed
     28!
     29! 3655 2019-01-07 16:51:22Z knoop
    2730! nopointer option removed
    2831!
     
    155158
    156159       USE indices,                                                               &
    157            ONLY:  nx, nxl, nxlg, nxr, nxrg, nyn, nyng, nys, nysg, nzb, nzt
     160           ONLY:  nx, nxl, nxr, nyn, nys, nzb, nzt
    158161
    159162       USE kinds
  • palm/trunk/SOURCE/check_parameters.f90

    r3735 r3761  
    2525! -----------------
    2626! $Id$
     27! unused variables removed
     28!
     29! 3735 2019-02-12 09:52:40Z dom_dwd_user
    2730! Passing variable j (averaged output?) to
    2831! module_interface.f90:chem_check_data_output.
     
    843846    INTEGER(iwp) ::  netcdf_data_format_save         !< initial value of netcdf_data_format
    844847    INTEGER(iwp) ::  position                        !< index position of string
    845     INTEGER(iwp) ::  lsp                             !< running index for chem spcs.
    846848
    847849    LOGICAL     ::  found                            !< flag, true if output variable is already marked for averaging
    848850
    849851    REAL(wp)    ::  dt_spinup_max                    !< maximum spinup timestep in nested domains
    850     REAL(wp)    ::  dum                              !< dummy variable
    851852    REAL(wp)    ::  gradient                         !< local gradient
    852853    REAL(wp)    ::  remote = 0.0_wp                  !< MPI id of remote processor
  • palm/trunk/SOURCE/diffusion_s.f90

    r3655 r3761  
    2525! -----------------
    2626! $Id$
     27! unused variables removed
     28!
     29! 3655 2019-01-07 16:51:22Z knoop
    2730! nopointer option removed
    2831!
     
    151154       
    152155       USE indices,                                                            &
    153            ONLY:  nxl, nxlg, nxr, nxrg, nyn, nyng, nys, nysg, nzb,             &
    154                   nzt, wall_flags_0
     156           ONLY:  nxl, nxr, nyn, nys, nzb, nzt, wall_flags_0
    155157       
    156158       USE kinds
     
    481483       
    482484       USE indices,                                                            &
    483            ONLY:  nxlg, nxrg, nyng, nysg, nzb, nzt, wall_flags_0
     485           ONLY:  nzb, nzt, wall_flags_0
    484486       
    485487       USE kinds
  • palm/trunk/SOURCE/disturb_heatflux.f90

    r3719 r3761  
    2525! -----------------
    2626! $Id$
     27! unsed variables removed
     28!
     29! 3719 2019-02-06 13:10:18Z kanani
    2730! Moved log_points out of subroutine into time_integration for better overview.
    2831!
     
    8689    USE control_parameters,                                                    &
    8790        ONLY:  iran, surface_heatflux, random_generator, wall_heatflux
    88        
    89     USE cpulog,                                                                &
    90         ONLY:  cpu_log, log_point
    9191       
    9292    USE kinds
  • palm/trunk/SOURCE/exchange_horiz.f90

    r3657 r3761  
    2525! -----------------
    2626! $Id$
     27! OpenACC directives re-formatted
     28!
     29! 3657 2019-01-07 20:14:18Z knoop
    2730! OpenACC port for SPEC
    2831!
     
    104107
    105108    USE control_parameters,                                                    &
    106         ONLY:  bc_lr_cyc, bc_ns_cyc, grid_level, mg_switch_to_pe0,             &
    107                synchronous_exchange
     109        ONLY:  bc_lr_cyc, bc_ns_cyc, grid_level, mg_switch_to_pe0, synchronous_exchange
    108110               
    109111    USE cpulog,                                                                &
     
    120122
    121123
    122 #ifdef _OPENACC
     124#if defined( _OPENACC )
    123125    INTEGER(iwp) ::  i           !<
    124126#endif
     127
    125128    INTEGER(iwp) ::  nbgp_local  !<
    126129   
     
    131134    CALL cpu_log( log_point_s(2), 'exchange_horiz', 'start' )
    132135
    133 #ifdef _OPENACC
     136#if defined( _OPENACC )
    134137    !$ACC UPDATE IF_PRESENT ASYNC(1) &
    135138    !$ACC HOST(ar(:,:,nxr-nbgp_local+1:nxr)) &
     
    308311#endif
    309312
    310 #ifdef _OPENACC
     313#if defined( _OPENACC )
    311314    DO i = nxl-nbgp_local, nxr+nbgp_local
    312315       !$ACC UPDATE IF_PRESENT ASYNC(2) &
  • palm/trunk/SOURCE/exchange_horiz_2d.f90

    r3655 r3761  
    2525! -----------------
    2626! $Id$
     27! variables moved to serial branch to avoid compiler warnings about unused variables
     28!
     29! 3655 2019-01-07 16:51:22Z knoop
    2730! - New routine for exchange of 8-bit integer arrays
    2831! - Set Neumann conditions also at radiation boundary
     
    9396    USE control_parameters,                                                    &
    9497        ONLY :  bc_dirichlet_l, bc_dirichlet_n, bc_dirichlet_r,                &
    95                 bc_dirichlet_s, bc_lr_cyc, bc_ns_cyc, bc_radiation_l,          &
     98                bc_dirichlet_s, bc_radiation_l,                                &
    9699                bc_radiation_n, bc_radiation_r, bc_radiation_s
    97100               
     
    108111    USE pmc_interface,                                                         &
    109112        ONLY : nesting_mode
     113
     114#if ! defined( __parallel )
     115    USE control_parameters,                                                    &
     116        ONLY:  bc_lr_cyc, bc_ns_cyc
     117#endif
    110118
    111119
     
    230238               bc_dirichlet_s, bc_radiation_l, bc_radiation_n, bc_radiation_r, &
    231239               bc_radiation_s, bc_lr_cyc, bc_ns_cyc, bc_radiation_l,           &
    232                bc_radiation_n, bc_radiation_r, bc_radiation_s, grid_level
     240               bc_radiation_n, bc_radiation_r, bc_radiation_s
    233241       
    234242    USE cpulog,                                                                &
  • palm/trunk/SOURCE/header.f90

    r3655 r3761  
    2525! -----------------
    2626! $Id$
     27! unused variable removed
     28!
     29! 3655 2019-01-07 16:51:22Z knoop
    2730! Implementation of the PALM module interface
    2831!
     
    421424
    422425    USE basic_constants_and_equations_mod,                                     &
    423         ONLY:  g, kappa, l_v
     426        ONLY:  g, kappa
    424427
    425428    USE bulk_cloud_model_mod,                                                  &
  • palm/trunk/SOURCE/init_3d_model.f90

    r3747 r3761  
    628628
    629629    USE netcdf_data_input_mod,                                                 &
    630         ONLY:  chem_emis, chem_emis_att, init_3d,                              &
     630        ONLY:  init_3d,                              &
    631631               netcdf_data_input_init_3d, netcdf_data_input_interpolate
    632632
     
    643643        ONLY:  nested_run
    644644#endif
    645 
    646     USE radiation_model_mod,                                                   &
    647         ONLY:  radiation, radiation_scheme
    648645
    649646    USE random_function_mod
     
    670667    USE surface_mod,                                                           &
    671668        ONLY :  init_surface_arrays, init_surfaces, surf_def_h, surf_lsm_h,    &
    672                 surf_usm_h, get_topography_top_index_ji, vertical_surfaces_exist
     669                surf_usm_h, get_topography_top_index_ji
    673670
    674671    USE surface_data_output_mod,                                               &
  • palm/trunk/SOURCE/init_grid.f90

    r3661 r3761  
    2525! -----------------
    2626! $Id$
     27! unused variables removed
     28!
     29! 3661 2019-01-08 18:22:50Z suehring
    2730! Remove setting of nzb_max to nzt at non-cyclic boundary PEs, instead,
    2831! order degradation of advection scheme is handeled directly in advec_ws
     
    361364       
    362365    USE control_parameters,                                                    &
    363         ONLY:  bc_dirichlet_l, bc_dirichlet_n, bc_dirichlet_r,                 &
    364                bc_dirichlet_s, bc_lr_cyc, bc_ns_cyc, bc_radiation_l,           &
    365                bc_radiation_n, bc_radiation_r, bc_radiation_s,                 &
     366        ONLY:  bc_lr_cyc, bc_ns_cyc,                                           &
    366367               constant_flux_layer, dz, dz_max, dz_stretch_factor,             &
    367368               dz_stretch_factor_array, dz_stretch_level, dz_stretch_level_end,&
  • palm/trunk/SOURCE/init_pegrid.f90

    r3655 r3761  
    2525! -----------------
    2626! $Id$
     27! unused variable removed
     28!
     29! 3655 2019-01-07 16:51:22Z knoop
    2730! variables documented
    2831!
     
    258261               bc_radiation_s, coupling_mode, coupling_topology, gathered_size,&
    259262               grid_level, grid_level_count, maximum_grid_level,               &
    260                message_string, mg_switch_to_pe0_level, momentum_advec, neutral,&
     263               message_string, mg_switch_to_pe0_level, momentum_advec,         &
    261264               psolver, outflow_source_plane, recycling_width, scalar_advec,   &
    262265               subdomain_size, turbulent_outflow, y_shift
  • palm/trunk/SOURCE/palm.f90

    r3719 r3761  
    2525! -----------------
    2626! $Id$
     27! unused variable removed
     28!
     29! 3719 2019-02-06 13:10:18Z kanani
    2730! Included cpu measurement for wall/soil spinup
    2831!
     
    281284
    282285    USE control_parameters,                                                    &
    283         ONLY:  air_chemistry, constant_diffusion, child_domain,                &
     286        ONLY:  constant_diffusion, child_domain,                               &
    284287               coupling_char, do2d_at_begin, do3d_at_begin, humidity,          &
    285288               initializing_actions, io_blocks, io_group, message_string,      &
  • palm/trunk/SOURCE/plant_canopy_model_mod.f90

    r3745 r3761  
    2727! -----------------
    2828! $Id$
     29! unsed variables removed
     30!
     31! 3745 2019-02-15 18:57:56Z suehring
    2932! Bugfix in transpiration, floating invalid when temperature
    3033! becomes > 40 degrees
     
    905908       INTEGER(iwp) ::  k   !< running index
    906909       INTEGER(iwp) ::  m   !< running index
    907        INTEGER(iwp) ::  pch_index_l
    908910
    909911       REAL(wp) ::  int_bpdf        !< vertical integral for lad-profile construction
  • palm/trunk/SOURCE/pmc_child_mod.f90

    r3655 r3761  
    2626! -----------------
    2727! $Id$
     28! statemnet added to avoid compiler warning
     29!
     30! 3655 2019-01-07 16:51:22Z knoop
    2831! explicit kind settings
    2932!
     
    291294!
    292295!-- Local variables
     296    INTEGER ::  idum  !<
    293297    INTEGER ::  mype  !<
    294298    TYPE(dA_namedef) ::  myname  !<
     
    303307
    304308    CALL pmc_bcast( myname%couple_index, mype, comm=m_to_parent_comm )
     309
     310!
     311!-- Next statement is just to avoid compiler warnings about unused variables
     312    IF ( PRESENT( lastentry ) )  idum = 1
    305313
    306314 END SUBROUTINE pmc_set_dataarray_name_lastentry
  • palm/trunk/SOURCE/prognostic_equations.f90

    r3719 r3761  
    2525! -----------------
    2626! $Id$
     27! unused variable removed
     28!
     29! 3719 2019-02-06 13:10:18Z kanani
    2730! Cleaned up chemistry cpu measurements
    2831!
     
    496499
    497500    LOGICAL      ::  loop_start          !<
    498     INTEGER(iwp) ::  n
    499     INTEGER(iwp) :: lsp
    500     INTEGER(iwp) :: lsp_usr              !< lsp running index for chem spcs
     501    INTEGER(iwp) ::  lsp
     502    INTEGER(iwp) ::  lsp_usr             !< lsp running index for chem spcs
    501503
    502504
  • palm/trunk/SOURCE/set_slicer_attributes_dvrp.f90

    r3655 r3761  
    2525! -----------------
    2626! $Id$
     27! statements added to avoid compiler warnings about unused variables
     28!
     29! 3655 2019-01-07 16:51:22Z knoop
    2730! Corrected "Former revisions" section
    2831!
     
    105108    dvrp_colortable_entries = 100
    106109
     110#else
     111!
     112!-- These statements are just to avoid compiler warnings about unused variables
     113    INTEGER ::  n_slicer  !<
     114
     115    IF ( n_slicer == 0 )  RETURN
     116
    107117#endif
    108118
  • palm/trunk/SOURCE/singleton_mod.f90

    r2001 r3761  
    88! -----------------
    99! $Id$
     10! statement added to prevent compiler warning about unused variables
     11!
     12! 2001 2016-08-20 18:41:22Z knoop
    1013!
    1114! 2000 2016-08-20 18:09:15Z knoop
     
    210213    COMPLEX(wp), DIMENSION(SIZE(array, 1)):: ft
    211214
     215    INTEGER(iwp)::  idum
    212216    INTEGER(iwp)::  ishape(1)
    213217
     
    219223    ishape = SHAPE( array )
    220224    CALL fftn(ft, ishape, inv = inv,  stat = stat)
     225!
     226!-- Next statement to prevent compiler warning about unused variable
     227    IF ( PRESENT( dim ) )  idum = 1
    221228
    222229 END FUNCTION fft1d
  • palm/trunk/SOURCE/sum_up_3d_data.f90

    r3655 r3761  
    2525! -----------------
    2626! $Id$
     27! unused variables removed
     28!
     29! 3655 2019-01-07 16:51:22Z knoop
    2730! Implementation of the PALM module interface
    2831!
     
    249252
    250253    USE arrays_3d,                                                             &
    251         ONLY:  dzw, d_exner, e, heatflux_output_conversion, nc, nr, p, prr,    &
    252                pt, q, qc, ql, ql_c, ql_v, qr, s, u, v, vpt, w,                 &
     254        ONLY:  dzw, d_exner, e, heatflux_output_conversion, p,    &
     255               pt, q, ql, ql_c, ql_v, s, u, v, vpt, w,                 &
    253256               waterflux_output_conversion
    254257
  • palm/trunk/SOURCE/surface_mod.f90

    r3745 r3761  
    2626! -----------------
    2727! $Id$
     28! OpenACC directives added to avoid compiler warnings about unused variables,
     29! unused variable removed
     30!
     31! 3745 2019-02-15 18:57:56Z suehring
    2832! +waste_heat
    2933!
     
    617621    END INTERFACE init_surface_arrays
    618622
    619     INTERFACE enter_surface_arrays
    620        MODULE PROCEDURE enter_surface_arrays
    621     END INTERFACE
    622 
    623     INTERFACE exit_surface_arrays
    624        MODULE PROCEDURE exit_surface_arrays
    625     END INTERFACE
    626 
    627623    INTERFACE surface_rrd_local
    628624       MODULE PROCEDURE surface_rrd_local
     
    642638    END INTERFACE surface_restore_elements
    643639
     640#if defined( _OPENACC )
     641    INTERFACE enter_surface_arrays
     642       MODULE PROCEDURE enter_surface_arrays
     643    END INTERFACE
     644
     645    INTERFACE exit_surface_arrays
     646       MODULE PROCEDURE exit_surface_arrays
     647    END INTERFACE
     648#endif
     649
    644650!
    645651!-- Public variables
    646     PUBLIC bc_h, ind_pav_green, ind_veg_wall, ind_wat_win, ns_h_on_file,       &
    647            ns_v_on_file, surf_def_h, surf_def_v, surf_lsm_h, surf_lsm_v,       &
    648            surf_usm_h, surf_usm_v, surf_type, vertical_surfaces_exist,         &
    649            surf_bulk_cloud_model, surf_microphysics_morrison, surf_microphysics_seifert
     652    PUBLIC bc_h, ind_pav_green, ind_veg_wall, ind_wat_win, ns_h_on_file, ns_v_on_file, surf_def_h, &
     653           surf_def_v, surf_lsm_h, surf_lsm_v, surf_usm_h, surf_usm_v, surf_type,                  &
     654           vertical_surfaces_exist, surf_bulk_cloud_model, surf_microphysics_morrison,             &
     655           surf_microphysics_seifert
    650656!
    651657!-- Public subroutines and functions
    652     PUBLIC get_topography_top_index, get_topography_top_index_ji, init_bc,     &
    653            init_surfaces, init_surface_arrays, enter_surface_arrays,           &
    654            exit_surface_arrays, surface_rrd_local, surface_restore_elements,   &
    655            surface_wrd_local, surface_last_actions
    656 
     658    PUBLIC get_topography_top_index, get_topography_top_index_ji, init_bc, init_surfaces,          &
     659           init_surface_arrays, surface_rrd_local, surface_restore_elements, surface_wrd_local,    &
     660           surface_last_actions
     661
     662#if defined( _OPENACC )
     663    PUBLIC enter_surface_arrays, exit_surface_arrays
     664#endif
    657665
    658666 CONTAINS
     
    11091117!> Enter horizontal and vertical surfaces.
    11101118!------------------------------------------------------------------------------!
     1119#if defined( _OPENACC )
    11111120    SUBROUTINE enter_surface_arrays
    11121121
     
    11461155
    11471156    END SUBROUTINE enter_surface_arrays
    1148 
     1157#endif
    11491158
    11501159!------------------------------------------------------------------------------!
     
    11531162!> Exit horizontal and vertical surfaces.
    11541163!------------------------------------------------------------------------------!
     1164#if defined( _OPENACC )
    11551165    SUBROUTINE exit_surface_arrays
    11561166
     
    11901200
    11911201    END SUBROUTINE exit_surface_arrays
    1192 
     1202#endif
    11931203
    11941204!------------------------------------------------------------------------------!
     
    14371447!> except for top fluxes.
    14381448!------------------------------------------------------------------------------!
     1449#if defined( _OPENACC )
    14391450    SUBROUTINE exit_surface_attributes_h( surfaces )
    14401451
     
    14701481   
    14711482    END SUBROUTINE exit_surface_attributes_h
    1472 
     1483#endif
    14731484
    14741485!------------------------------------------------------------------------------!
     
    14781489!> except for top fluxes.
    14791490!------------------------------------------------------------------------------!
     1491#if defined( _OPENACC )
    14801492    SUBROUTINE enter_surface_attributes_h( surfaces )
    14811493
     
    15111523
    15121524    END SUBROUTINE enter_surface_attributes_h
    1513 
     1525#endif
    15141526
    15151527!------------------------------------------------------------------------------!
     
    16551667!> Exit memory for model-top fluxes.
    16561668!------------------------------------------------------------------------------!
     1669#if defined( _OPENACC )
    16571670    SUBROUTINE exit_surface_attributes_h_top( surfaces )
    16581671
     
    16781691   
    16791692    END SUBROUTINE exit_surface_attributes_h_top
    1680 
     1693#endif
    16811694
    16821695!------------------------------------------------------------------------------!
     
    16851698!> Enter memory for model-top fluxes.
    16861699!------------------------------------------------------------------------------!
     1700#if defined( _OPENACC )
    16871701    SUBROUTINE enter_surface_attributes_h_top( surfaces )
    16881702
     
    17081722
    17091723    END SUBROUTINE enter_surface_attributes_h_top
    1710 
     1724#endif
    17111725
    17121726!------------------------------------------------------------------------------!
     
    19581972!> Exit memory for vertical surface types.
    19591973!------------------------------------------------------------------------------!
     1974#if defined( _OPENACC )
    19601975    SUBROUTINE exit_surface_attributes_v( surfaces )
    19611976
     
    19821997
    19831998    END SUBROUTINE exit_surface_attributes_v
    1984 
     1999#endif
    19852000
    19862001!------------------------------------------------------------------------------!
     
    19892004!> Enter memory for vertical surface types.
    19902005!------------------------------------------------------------------------------!
     2006#if defined( _OPENACC )
    19912007    SUBROUTINE enter_surface_attributes_v( surfaces )
    19922008   
     
    20132029   
    20142030    END SUBROUTINE enter_surface_attributes_v
    2015 
     2031#endif
    20162032
    20172033!------------------------------------------------------------------------------!
     
    27732789             INTEGER(iwp)  ::  j               !< running index x-direction
    27742790             INTEGER(iwp)  ::  k               !< running index x-direction
    2775              INTEGER(iwp)  ::  l               !< index variable for the surface type, indicating the facing
    27762791             INTEGER(iwp)  ::  num_v           !< current number of surface element
    27772792             INTEGER(iwp)  ::  num_v_kji       !< current number of surface element at (j,i)
  • palm/trunk/SOURCE/swap_timelevel.f90

    r3655 r3761  
    2525! -----------------
    2626! $Id$
     27! unused variables removed
     28!
     29! 3655 2019-01-07 16:51:22Z knoop
    2730! Implementation of the PALM module interface
    2831!
     
    148151 
    149152
    150     USE arrays_3d,                                                             &
    151         ONLY:  nc, nc_1, nc_2, nc_p, nr, nr_1, nr_2, nr_p, pt, pt_1, pt_2,     &
    152                pt_p, q, q_1, q_2, q_p, qc, qc_1, qc_2, qc_p, qr, qr_1, qr_2,   &
    153                qr_p, s, s_1, s_2, s_p, sa, sa_1, sa_2, sa_p, u, u_1, u_2, u_p, &
    154                v, v_1, v_2, v_p, w, w_1, w_2, w_p
    155 
    156     USE cpulog,                                                                &
     153    USE arrays_3d,                                                                                 &
     154        ONLY:  pt, pt_1, pt_2, pt_p, q, q_1, q_2, q_p, s, s_1, s_2, s_p, u, u_1, u_2, u_p, v, v_1, &
     155               v_2, v_p, w, w_1, w_2, w_p
     156
     157    USE cpulog,                                                                                    &
    157158        ONLY: cpu_log, log_point
    158159
    159     USE control_parameters,                                                    &
     160    USE control_parameters,                                                                        &
    160161        ONLY:  humidity, neutral, passive_scalar, timestep_count
    161162
    162163    USE kinds
    163164
    164     USE module_interface,                                                      &
     165    USE module_interface,                                                                          &
    165166        ONLY:  module_interface_swap_timelevel
    166167
    167     USE pmc_interface,                                                         &
     168    USE pmc_interface,                                                                             &
    168169        ONLY: nested_run, pmci_set_swaplevel
    169170
    170     USE turbulence_closure_mod,                                                &
     171    USE turbulence_closure_mod,                                                                    &
    171172        ONLY:  tcm_swap_timelevel
    172173
  • palm/trunk/SOURCE/time_integration.f90

    r3745 r3761  
    2525! -----------------
    2626! $Id$
     27! module section re-formatted and openacc required variables moved to separate section,
     28! re-formatting to 100 char line width
     29!
     30! 3745 2019-02-15 18:57:56Z suehring
    2731! Call indoor model after first timestep
    2832!
     
    456460 
    457461
    458     USE advec_ws,                                                              &
     462    USE advec_ws,                                                                                  &
    459463        ONLY:  ws_statistics
    460464
    461     USE arrays_3d,                                                             &
    462         ONLY:  d, diss, diss_p, ddzu, dd2zu, ddzw, drho_air, drho_air_zw, dzu, &
    463                dzw, e, e_p, kh, km, nc, nc_p, nr, nr_p, p, prho, pt, pt_p,     &
    464                pt_init, ptdf_x, ptdf_y, q_init, q, qc, qc_p, ql, ql_c, ql_v,   &
    465                ql_vp, qr, qr_p, q_p, rdf, rdf_sc, ref_state, rho_air,          &
    466                rho_air_zw, rho_ocean, s, s_p, sa_p, te_m, tend, tpt_m, tu_m,   &
    467                tv_m, tw_m, u, ug, u_init, u_p, u_stokes_zu, v, vg, v_init, vpt,&
    468                v_p, v_stokes_zu, w, w_p, zu, heatflux_output_conversion,       &
    469                momentumflux_output_conversion
    470 
    471     USE biometeorology_mod,                                                    &
    472         ONLY:  bio_calculate_thermal_index_maps,                               &
    473                thermal_comfort, uvem_calc_exposure, uv_exposure
    474 
    475     USE bulk_cloud_model_mod,                                                  &
    476         ONLY: bulk_cloud_model, calc_liquid_water_content,                     &
    477               collision_turbulence, microphysics_morrison, microphysics_seifert
    478 
    479     USE calc_mean_profile_mod,                                                 &
     465    USE arrays_3d,                                                                                 &
     466        ONLY:  diss, diss_p, dzu, e, e_p, nc, nc_p, nr, nr_p, prho, pt, pt_p, pt_init, q_init, q,  &
     467               qc, qc_p, ql, ql_c, ql_v, ql_vp, qr, qr_p, q_p, ref_state, rho_ocean, s, s_p, sa_p, &
     468               tend, u, u_p, v, vpt, v_p, w, w_p
     469
     470    USE biometeorology_mod,                                                                        &
     471        ONLY:  bio_calculate_thermal_index_maps, thermal_comfort, uvem_calc_exposure, uv_exposure
     472
     473    USE bulk_cloud_model_mod,                                                                      &
     474        ONLY: bulk_cloud_model, calc_liquid_water_content, collision_turbulence,                   &
     475              microphysics_morrison, microphysics_seifert
     476
     477    USE calc_mean_profile_mod,                                                                     &
    480478        ONLY:  calc_mean_profile
    481479
    482     USE chem_emissions_mod,                                                    &
     480    USE chem_emissions_mod,                                                                        &
    483481        ONLY:  chem_emissions_setup
    484482
    485     USE chem_modules,                                                          &
     483    USE chem_modules,                                                                              &
    486484        ONLY:  bc_cs_t_val, cs_name, do_emis, nspec, nspec_out
    487485
    488     USE chemistry_model_mod,                                                   &
     486    USE chemistry_model_mod,                                                                       &
    489487        ONLY:  chem_boundary_conds, chem_species
    490488
    491     USE control_parameters,                                                    &
    492         ONLY:  advected_distance_x, advected_distance_y, air_chemistry,        &
    493                average_count_3d, averaging_interval, averaging_interval_pr,    &
    494                bc_lr_cyc, bc_ns_cyc, bc_pt_t_val, bc_q_t_val, biometeorology,  &
    495                call_psolver_at_all_substeps,  child_domain, cloud_droplets,    &
    496                constant_flux_layer, constant_heatflux,                         &
    497                create_disturbances, dopr_n, constant_diffusion, coupling_mode, &
    498                coupling_start_time, current_timestep_number,                   &
    499                disturbance_created, disturbance_energy_limit, dist_range,      &
    500                do_sum, dt_3d, dt_averaging_input, dt_averaging_input_pr,       &
    501                dt_coupling, dt_data_output_av, dt_disturb, dt_do2d_xy,         &
    502                dt_do2d_xz, dt_do2d_yz, dt_do3d, dt_domask,dt_dopts, dt_dopr,   &
    503                dt_dopr_listing, dt_dots, dt_dvrp, dt_run_control, end_time,    &
    504                first_call_lpm, first_call_mas, galilei_transformation,         &
    505                humidity, indoor_model, intermediate_timestep_count,            &
    506                intermediate_timestep_count_max,                                &
    507                land_surface, large_scale_forcing,                              &
    508                loop_optimization, lsf_surf, lsf_vert, masks, mid,              &
    509                multi_agent_system_end, multi_agent_system_start,               &
    510                nesting_offline, neutral, nr_timesteps_this_run, nudging,       &
    511                ocean_mode, passive_scalar, pt_reference,                       &
    512                pt_slope_offset, random_heatflux, rans_mode,                    &
    513                rans_tke_e, run_coupled, salsa,                                 &
    514                simulated_time, simulated_time_chr,                             &
    515                skip_time_do2d_xy, skip_time_do2d_xz, skip_time_do2d_yz,        &
    516                skip_time_do3d, skip_time_domask, skip_time_dopr,               &
    517                skip_time_data_output_av, sloping_surface, stop_dt,             &
    518                surface_output, terminate_coupled, terminate_run,               &
    519                timestep_scheme,                                                &
    520                time_coupling, time_do2d_xy, time_do2d_xz, time_do2d_yz,        &
    521                time_do3d, time_domask, time_dopr, time_dopr_av,                &
    522                time_dopr_listing, time_dopts, time_dosp, time_dosp_av,         &
    523                time_dots, time_do_av, time_do_sla, time_disturb, time_dvrp,    &
    524                time_run_control, time_since_reference_point, tsc,              &
    525                turbulent_inflow, turbulent_outflow, urban_surface,             &
    526                use_initial_profile_as_reference,                               &
    527                use_single_reference_value, u_gtrans, v_gtrans,                 &
    528                virtual_flight, virtual_measurement, wind_turbine,              &
    529                ws_scheme_mom, ws_scheme_sca
    530 
    531     USE cpulog,                                                                &
     489    USE control_parameters,                                                                        &
     490        ONLY:  advected_distance_x, advected_distance_y, air_chemistry, average_count_3d,          &
     491               averaging_interval, averaging_interval_pr, bc_lr_cyc, bc_ns_cyc, bc_pt_t_val,       &
     492               bc_q_t_val, biometeorology, call_psolver_at_all_substeps,  child_domain,            &
     493               cloud_droplets, constant_flux_layer, constant_heatflux, create_disturbances,        &
     494               dopr_n, constant_diffusion, coupling_mode, coupling_start_time,                     &
     495               current_timestep_number, disturbance_created, disturbance_energy_limit, dist_range, &
     496               do_sum, dt_3d, dt_averaging_input, dt_averaging_input_pr, dt_coupling,              &
     497               dt_data_output_av, dt_disturb, dt_do2d_xy, dt_do2d_xz, dt_do2d_yz, dt_do3d,         &
     498               dt_domask,dt_dopts, dt_dopr, dt_dopr_listing, dt_dots, dt_dvrp, dt_run_control,     &
     499               end_time, first_call_lpm, first_call_mas, galilei_transformation, humidity,         &
     500               indoor_model, intermediate_timestep_count, intermediate_timestep_count_max,         &
     501               land_surface, large_scale_forcing, loop_optimization, lsf_surf, lsf_vert, masks,    &
     502               mid, multi_agent_system_end, multi_agent_system_start, nesting_offline, neutral,    &
     503               nr_timesteps_this_run, nudging, ocean_mode, passive_scalar, pt_reference,           &
     504               pt_slope_offset, random_heatflux, rans_mode, rans_tke_e, run_coupled, salsa,        &
     505               simulated_time, simulated_time_chr, skip_time_do2d_xy, skip_time_do2d_xz,           &
     506               skip_time_do2d_yz, skip_time_do3d, skip_time_domask, skip_time_dopr,                &
     507               skip_time_data_output_av, sloping_surface, stop_dt, surface_output,                 &
     508               terminate_coupled, terminate_run, timestep_scheme, time_coupling, time_do2d_xy,     &
     509               time_do2d_xz, time_do2d_yz, time_do3d, time_domask, time_dopr, time_dopr_av,        &
     510               time_dopr_listing, time_dopts, time_dosp, time_dosp_av, time_dots, time_do_av,      &
     511               time_do_sla, time_disturb, time_dvrp, time_run_control, time_since_reference_point, &
     512               turbulent_inflow, turbulent_outflow, urban_surface,                                 &
     513               use_initial_profile_as_reference, use_single_reference_value, u_gtrans, v_gtrans,   &
     514               virtual_flight, virtual_measurement, wind_turbine, ws_scheme_mom, ws_scheme_sca
     515
     516    USE cpulog,                                                                                    &
    532517        ONLY:  cpu_log, log_point, log_point_s
    533518
    534     USE date_and_time_mod,                                                     &
     519    USE date_and_time_mod,                                                                         &
    535520        ONLY:  calc_date_and_time, hour_call_emis, hour_of_year
    536521
    537     USE flight_mod,                                                            &
     522    USE flight_mod,                                                                                &
    538523        ONLY:  flight_measurement
    539524
    540     USE indices,                                                               &
    541         ONLY:  nbgp, nx, nxl, nxlg, nxr, nxrg, nyn, nyng, nys, nysg, nzb, nzt, &
    542                nz, nzb_max, advc_flags_1, advc_flags_2, wall_flags_0
    543 
    544     USE indoor_model_mod,                                                      &
    545         ONLY:  dt_indoor, im_main_heatcool, skip_time_do_indoor, time_indoor
    546 
    547     USE interaction_droplets_ptq_mod,                                          &
     525    USE indices,                                                                                   &
     526        ONLY:  nbgp, nx, nxl, nxlg, nxr, nxrg, nzb, nzt
     527
     528    USE indoor_model_mod,                                                                          &
     529        ONLY:  dt_indoor, im_main_heatcool, time_indoor
     530
     531    USE interaction_droplets_ptq_mod,                                                              &
    548532        ONLY:  interaction_droplets_ptq
    549533
     
    552536    USE kinds
    553537
    554     USE land_surface_model_mod,                                                &
    555         ONLY:  lsm_boundary_condition, lsm_energy_balance, lsm_soil_model,     &
    556                skip_time_do_lsm
    557 
    558     USE lsf_nudging_mod,                                                       &
     538    USE land_surface_model_mod,                                                                    &
     539        ONLY:  lsm_boundary_condition, lsm_energy_balance, lsm_soil_model, skip_time_do_lsm
     540
     541    USE lpm_mod,                                                                                   &
     542        ONLY:  lpm
     543
     544    USE lsf_nudging_mod,                                                                           &
    559545        ONLY:  calc_tnudge, ls_forcing_surf, ls_forcing_vert, nudge_ref
    560546
    561     USE module_interface,                                                      &
     547    USE module_interface,                                                                          &
    562548        ONLY:  module_interface_actions
    563549
    564     USE multi_agent_system_mod,                                                &
     550    USE multi_agent_system_mod,                                                                    &
    565551        ONLY:  agents_active, multi_agent_system
    566552
    567     USE nesting_offl_mod,                                                      &
     553    USE nesting_offl_mod,                                                                          &
    568554        ONLY:  nesting_offl_bc, nesting_offl_mass_conservation
    569555       
    570     USE netcdf_data_input_mod,                                                 &
    571         ONLY:  chem_emis, chem_emis_att, nest_offl,                            &
    572                netcdf_data_input_offline_nesting
    573 
    574     USE ocean_mod,                                                             &
     556    USE netcdf_data_input_mod,                                                                     &
     557        ONLY:  chem_emis, chem_emis_att, nest_offl, netcdf_data_input_offline_nesting
     558
     559    USE ocean_mod,                                                                                 &
    575560        ONLY:  prho_reference
    576561
    577     USE particle_attributes,                                                   &
    578         ONLY:  particle_advection, particle_advection_start,                   &
    579                use_sgs_for_particles, wang_kernel
     562    USE particle_attributes,                                                                       &
     563        ONLY:  particle_advection, particle_advection_start, use_sgs_for_particles, wang_kernel
    580564
    581565    USE pegrid
    582566
    583     USE pmc_interface,                                                         &
    584         ONLY:  nested_run, nesting_mode, pmci_boundary_conds, pmci_datatrans,  &
    585                pmci_synchronize
    586 
    587     USE progress_bar,                                                          &
     567    USE pmc_interface,                                                                             &
     568        ONLY:  nested_run, nesting_mode, pmci_boundary_conds, pmci_datatrans, pmci_synchronize
     569
     570    USE progress_bar,                                                                              &
    588571        ONLY:  finish_progress_bar, output_progress_bar
    589572
    590     USE prognostic_equations_mod,                                              &
     573    USE prognostic_equations_mod,                                                                  &
    591574        ONLY:  prognostic_equations_cache, prognostic_equations_vector
    592575
    593     USE radiation_model_mod,                                                   &
    594         ONLY: dt_radiation, force_radiation_call, radiation, radiation_control,&
    595               radiation_interaction, radiation_interactions,                   &
    596               skip_time_do_radiation, time_radiation
     576    USE radiation_model_mod,                                                                       &
     577        ONLY: dt_radiation, force_radiation_call, radiation, radiation_control,                    &
     578              radiation_interaction, radiation_interactions, skip_time_do_radiation, time_radiation
    597579         
    598     USE salsa_mod,                                                             &
    599         ONLY: aerosol_number, aerosol_mass, nbins, ncc_tot, ngast,             &
    600               salsa_boundary_conds, salsa_gas, salsa_gases_from_chem,          &
    601               skip_time_do_salsa                     
    602    
    603     USE salsa_util_mod,                                                        &
    604            ONLY:  sums_salsa_ws_l     
    605 
    606     USE spectra_mod,                                                           &
    607         ONLY: average_count_sp, averaging_interval_sp, calc_spectra, dt_dosp,  &
    608               skip_time_dosp
    609 
    610     USE statistics,                                                            &
    611         ONLY:  flow_statistics_called, hom, pr_palm, sums_ls_l,                &
    612                rmask, statistic_regions, weight_substep, sums_l, sums_l_l,     &
    613                sums_us2_ws_l, sums_wsus_ws_l, sums_vs2_ws_l, sums_wsvs_ws_l,   &
    614                sums_ws2_ws_l, sums_wspts_ws_l, sums_wsqs_ws_l, sums_wssas_ws_l,&
    615                sums_wsqcs_ws_l, sums_wsqrs_ws_l, sums_wsncs_ws_l,              &
    616                sums_wsnrs_ws_l, sums_wsss_ws_l
    617 
    618     USE surface_layer_fluxes_mod,                                              &
     580    USE salsa_mod,                                                                                 &
     581        ONLY: aerosol_number, aerosol_mass, nbins, ncc_tot, ngast, salsa_boundary_conds,           &
     582              salsa_gas, salsa_gases_from_chem, skip_time_do_salsa
     583
     584    USE spectra_mod,                                                                               &
     585        ONLY: average_count_sp, averaging_interval_sp, calc_spectra, dt_dosp, skip_time_dosp
     586
     587    USE statistics,                                                                                &
     588        ONLY:  flow_statistics_called, hom, pr_palm, sums_ls_l
     589
     590
     591    USE surface_layer_fluxes_mod,                                                                  &
    619592        ONLY:  surface_layer_fluxes
    620593
    621     USE surface_mod,                                                           &
    622         ONLY:  bc_h, surf_def_h, surf_lsm_h, surf_usm_h,                       &
    623                enter_surface_arrays, exit_surface_arrays
    624 
    625     USE surface_data_output_mod,                                               &
    626         ONLY:  average_count_surf, averaging_interval_surf, dt_dosurf,         &
    627                dt_dosurf_av, surface_data_output,                              &
    628                surface_data_output_averaging, skip_time_dosurf,                &
     594    USE surface_data_output_mod,                                                                   &
     595        ONLY:  average_count_surf, averaging_interval_surf, dt_dosurf, dt_dosurf_av,               &
     596               surface_data_output, surface_data_output_averaging, skip_time_dosurf,               &
    629597               skip_time_dosurf_av, time_dosurf, time_dosurf_av
    630598
    631     USE turbulence_closure_mod,                                                &
     599    USE surface_mod,                                                                               &
     600        ONLY:  surf_def_h, surf_lsm_h, surf_usm_h
     601
     602    USE synthetic_turbulence_generator_mod,                                                        &
     603        ONLY:  dt_stg_call, dt_stg_adjust, parametrize_inflow_turbulence, stg_adjust, stg_main,    &
     604               time_stg_adjust, time_stg_call, use_syn_turb_gen
     605
     606    USE turbulence_closure_mod,                                                                    &
    632607        ONLY:  tcm_diffusivities, production_e_init
    633608
    634     USE urban_surface_mod,                                                     &
    635         ONLY:  usm_boundary_condition, usm_material_heat_model,                &
    636                usm_material_model,                                             &
     609    USE urban_surface_mod,                                                                         &
     610        ONLY:  usm_boundary_condition, usm_material_heat_model, usm_material_model,                &
    637611               usm_surface_energy_balance, usm_green_heat_model
    638612
    639     USE synthetic_turbulence_generator_mod,                                    &
    640         ONLY:  dt_stg_call, dt_stg_adjust, parametrize_inflow_turbulence,      &
    641                stg_adjust, stg_main, time_stg_adjust, time_stg_call,           &
    642                use_syn_turb_gen
    643 
    644 
    645     USE wind_turbine_model_mod,                                                &
    646         ONLY:  wtm_forces
    647 
    648     USE lpm_mod,                                                               &
    649         ONLY:  lpm
    650 
    651     USE vertical_nesting_mod,                                                  &
    652         ONLY:  vnested, vnest_anterpolate, vnest_anterpolate_e,                &
    653                vnest_boundary_conds, vnest_boundary_conds_khkm,                &
    654                vnest_deallocate, vnest_init, vnest_init_fine,                  &
     613    USE vertical_nesting_mod,                                                                      &
     614        ONLY:  vnested, vnest_anterpolate, vnest_anterpolate_e, vnest_boundary_conds,              &
     615               vnest_boundary_conds_khkm, vnest_deallocate, vnest_init, vnest_init_fine,           &
    655616               vnest_start_time
    656617               
    657     USE virtual_measurement_mod,                                               &
     618    USE virtual_measurement_mod,                                                                   &
    658619        ONLY:  vm_data_output, vm_sampling, vm_time_start
     620
     621    USE wind_turbine_model_mod,                                                                    &
     622        ONLY:  wtm_forces
     623
     624
     625#if defined( _OPENACC )
     626    USE arrays_3d,                                                             &
     627        ONLY:  d, dd2zu, ddzu, ddzw, drho_air, drho_air_zw, dzw, heatflux_output_conversion, kh,   &
     628               km, momentumflux_output_conversion, p, ptdf_x, ptdf_y, rdf, rdf_sc, rho_air,        &
     629               rho_air_zw, te_m, tpt_m, tu_m, tv_m, tw_m, ug, u_init, u_stokes_zu, vg, v_init,     &
     630               v_stokes_zu, zu
     631
     632    USE control_parameters,                                                                        &
     633        ONLY:  tsc
     634
     635    USE indices,                                                                                   &
     636        ONLY:  advc_flags_1, advc_flags_2, nyn, nyng, nys, nysg, nz, nzb_max, wall_flags_0
     637
     638    USE statistics,                                                                                &
     639        ONLY:  rmask, statistic_regions, sums_l, sums_l_l, sums_us2_ws_l,                          &
     640               sums_wsus_ws_l, sums_vs2_ws_l, sums_wsvs_ws_l, sums_ws2_ws_l, sums_wspts_ws_l,      &
     641               sums_wsqs_ws_l, sums_wssas_ws_l, sums_wsqcs_ws_l, sums_wsqrs_ws_l, sums_wsncs_ws_l, &
     642               sums_wsnrs_ws_l, sums_wsss_ws_l, weight_substep
     643
     644    USE salsa_util_mod,                                                                            &
     645           ONLY:  sums_salsa_ws_l
     646
     647    USE surface_mod,                                                                               &
     648        ONLY:  bc_h, enter_surface_arrays, exit_surface_arrays
     649#endif
     650
    659651
    660652    IMPLICIT NONE
     
    675667
    676668
    677 ! Copy data from arrays_3d
     669!
     670!-- Copy data from arrays_3d
    678671!$ACC DATA &
    679672!$ACC COPY(d(nzb+1:nzt,nys:nyn,nxl:nxr)) &
     
    717710!$ACC COPYIN(ug(0:nz+1), vg(0:nz+1))
    718711
    719 ! Copy data from control_parameters
     712!
     713!-- Copy data from control_parameters
    720714!$ACC DATA &
    721715!$ACC COPYIN(tsc(1:5))
    722716
    723 ! Copy data from indices
     717!
     718!-- Copy data from indices
    724719!$ACC DATA &
    725720!$ACC COPYIN(advc_flags_1(nzb:nzt+1,nysg:nyng,nxlg:nxrg)) &
     
    727722!$ACC COPYIN(wall_flags_0(nzb:nzt+1,nysg:nyng,nxlg:nxrg))
    728723
    729 ! Copy data from surface_mod
     724!
     725!-- Copy data from surface_mod
    730726!$ACC DATA &
    731727!$ACC COPYIN(bc_h(0:1)) &
     
    737733!$ACC COPYIN(bc_h(1)%k(1:bc_h(1)%ns))
    738734
    739 ! Copy data from statistics
     735!
     736!-- Copy data from statistics
    740737!$ACC DATA &
    741738!$ACC COPYIN(hom(0:nz+1,1:2,1:4,0)) &
     
    759756!$ACC COPY(sums_salsa_ws_l(nzb:nzt+1,0))
    760757
    761 #ifdef _OPENACC
     758#if defined( _OPENACC )
    762759    CALL enter_surface_arrays
    763760#endif
     
    784781!-- Data exchange between coupled models in case that a call has been omitted
    785782!-- at the end of the previous run of a job chain.
    786     IF ( coupling_mode /= 'uncoupled'  .AND.  run_coupled .AND. .NOT. vnested)  THEN
     783    IF ( coupling_mode /= 'uncoupled'  .AND.  run_coupled  .AND. .NOT. vnested )  THEN
    787784!
    788785!--    In case of model termination initiated by the local model the coupler
     
    792789          time_coupling = time_coupling - dt_coupling
    793790       ENDDO
    794        IF (time_coupling == 0.0_wp  .AND.                                      &
    795            time_since_reference_point < dt_coupling )                          &
    796        THEN
     791       IF (time_coupling == 0.0_wp  .AND.  time_since_reference_point < dt_coupling )  THEN
    797792          time_coupling = time_since_reference_point
    798793       ENDIF
     
    806801
    807802    CALL location_message( 'starting timestep-sequence', .TRUE. )
     803
    808804!
    809805!-- Start of the time loop
    810     DO  WHILE ( simulated_time < end_time  .AND.  .NOT. stop_dt  .AND. &
    811                 .NOT. terminate_run )
     806    DO  WHILE ( simulated_time < end_time  .AND.  .NOT. stop_dt  .AND. .NOT. terminate_run )
    812807
    813808       CALL cpu_log( log_point_s(10), 'timesteps', 'start' )
     
    842837           IF ( air_chemistry )  THEN
    843838              DO  lsp = 1, nspec
    844                  bc_cs_t_val = (  chem_species(lsp)%conc_pr_init(nzt+1)       &
    845                                 - chem_species(lsp)%conc_pr_init(nzt) )       &
     839                 bc_cs_t_val = (  chem_species(lsp)%conc_pr_init(nzt+1)                            &
     840                                - chem_species(lsp)%conc_pr_init(nzt) )                            &
    846841                               / dzu(nzt+1)
    847842              ENDDO
     
    851846!--    If forcing by larger-scale models is applied, check if new data
    852847!--    at domain boundaries need to be read.
    853        IF ( nesting_offline )  THEN
    854           IF ( nest_offl%time(nest_offl%tind_p) <= time_since_reference_point )&
     848       IF ( nesting_offline .AND. nest_offl%time(nest_offl%tind_p) <= time_since_reference_point ) &
     849       THEN
    855850             CALL netcdf_data_input_offline_nesting
    856851       ENDIF
     
    867862!--    Start of intermediate step loop
    868863       intermediate_timestep_count = 0
    869        DO  WHILE ( intermediate_timestep_count < &
    870                    intermediate_timestep_count_max )
     864       DO  WHILE ( intermediate_timestep_count < intermediate_timestep_count_max )
    871865
    872866          intermediate_timestep_count = intermediate_timestep_count + 1
     
    880874!--       Calculate those variables needed in the tendency terms which need
    881875!--       global communication
    882           IF ( .NOT. use_single_reference_value  .AND. &
    883                .NOT. use_initial_profile_as_reference )  THEN
     876          IF ( .NOT. use_single_reference_value  .AND.  .NOT. use_initial_profile_as_reference )   &
     877          THEN
    884878!
    885879!--          Horizontally averaged profiles to be used as reference state in
     
    902896!--          ( might be the case if a vertical level is completely occupied
    903897!--            with topography ).
    904              ref_state = MERGE( MAXVAL(ref_state), ref_state,                  &
    905                                 ref_state == 0.0_wp )
     898             ref_state = MERGE( MAXVAL(ref_state), ref_state, ref_state == 0.0_wp )
    906899          ENDIF
    907900
    908901          IF ( .NOT. constant_diffusion )  CALL production_e_init
    909           IF ( ( ws_scheme_mom .OR. ws_scheme_sca )  .AND.  &
    910                intermediate_timestep_count == 1 )  CALL ws_statistics
     902          IF ( ( ws_scheme_mom .OR. ws_scheme_sca )  .AND.  intermediate_timestep_count == 1 )     &
     903          THEN
     904             CALL ws_statistics
     905          ENDIF
    911906!
    912907!--       In case of nudging calculate current nudging time scale and horizontal
     
    937932!--       ### particle model should be moved before prognostic_equations, in order
    938933!--       to regard droplet interactions directly
    939           IF ( particle_advection  .AND.                         &
    940                time_since_reference_point >= particle_advection_start  .AND. &
    941                intermediate_timestep_count == 1 )  THEN
     934          IF ( particle_advection  .AND.  time_since_reference_point >= particle_advection_start   &
     935               .AND.  intermediate_timestep_count == 1 )                                          &
     936          THEN
    942937             CALL lpm
    943938             first_call_lpm = .FALSE.
     
    948943!--       Droplet condensation and evaporation is calculated within
    949944!--       advec_particles.
    950           IF ( cloud_droplets  .AND.  &
    951                intermediate_timestep_count == intermediate_timestep_count_max )&
     945          IF ( cloud_droplets  .AND.  intermediate_timestep_count == intermediate_timestep_count_max ) &
    952946          THEN
    953947             CALL interaction_droplets_ptq
     
    956950!
    957951!--       Movement of agents in multi agent system
    958           IF ( agents_active  .AND.                                            &
    959                time_since_reference_point >= multi_agent_system_start  .AND.   &
    960                time_since_reference_point <= multi_agent_system_end    .AND.   &
    961                intermediate_timestep_count == 1 )  THEN
     952          IF ( agents_active  .AND.  time_since_reference_point >= multi_agent_system_start  .AND. &
     953               time_since_reference_point <= multi_agent_system_end  .AND.                         &
     954               intermediate_timestep_count == 1 )                                                  &
     955          THEN
    962956             CALL multi_agent_system
    963957             first_call_mas = .FALSE.
     
    973967          CALL exchange_horiz( pt_p, nbgp )
    974968          IF ( .NOT. constant_diffusion )  CALL exchange_horiz( e_p, nbgp )
    975           IF ( rans_tke_e  .OR.  wang_kernel  .OR.  collision_turbulence       &
     969          IF ( rans_tke_e  .OR.  wang_kernel  .OR.  collision_turbulence                           &
    976970               .OR.  use_sgs_for_particles )  THEN
    977971             IF ( rans_tke_e )  THEN
     
    10121006                DO WHILE ( TRIM( cs_name( lsp_usr ) ) /= 'novalue' )
    10131007                   IF ( TRIM(chem_species(lsp)%name) == TRIM(cs_name(lsp_usr)) )  THEN
    1014                       CALL chem_boundary_conds( chem_species(lsp)%conc_p,              &
     1008                      CALL chem_boundary_conds( chem_species(lsp)%conc_p,                          &
    10151009                                                chem_species(lsp)%conc_pr_init )
    10161010                   ENDIF
     
    10261020                CALL exchange_horiz( aerosol_number(b)%conc_p, nbgp )
    10271021                CALL cpu_log( log_point_s(93), 'salsa decycle', 'start' )
    1028                 CALL salsa_boundary_conds( aerosol_number(b)%conc_p,           &
    1029                                            aerosol_number(b)%init )
     1022                CALL salsa_boundary_conds( aerosol_number(b)%conc_p, aerosol_number(b)%init )
    10301023                CALL cpu_log( log_point_s(93), 'salsa decycle', 'stop' )
    10311024                DO  c = 1, ncc_tot
    1032                    CALL exchange_horiz( aerosol_mass((c-1)*nbins+b)%conc_p,    &
    1033                                         nbgp )
     1025                   CALL exchange_horiz( aerosol_mass((c-1)*nbins+b)%conc_p, nbgp )
    10341026                   CALL cpu_log( log_point_s(93), 'salsa decycle', 'start' )
    1035                    CALL salsa_boundary_conds( aerosol_mass((c-1)*nbins+b)%conc_p,&
     1027                   CALL salsa_boundary_conds( aerosol_mass((c-1)*nbins+b)%conc_p,                  &
    10361028                                              aerosol_mass((c-1)*nbins+b)%init )
    10371029                   CALL cpu_log( log_point_s(93), 'salsa decycle', 'stop' )
     
    10421034                   CALL exchange_horiz( salsa_gas(g)%conc_p, nbgp )
    10431035                   CALL cpu_log( log_point_s(93), 'salsa decycle', 'start' )
    1044                    CALL salsa_boundary_conds( salsa_gas(g)%conc_p,             &
    1045                                               salsa_gas(g)%init )
     1036                   CALL salsa_boundary_conds( salsa_gas(g)%conc_p, salsa_gas(g)%init )
    10461037                   CALL cpu_log( log_point_s(93), 'salsa decycle', 'stop' )
    10471038             ENDDO
     
    10781069             CALL pmci_datatrans( nesting_mode )
    10791070
    1080              IF ( TRIM( nesting_mode ) == 'two-way' .OR.                       &
    1081                   nesting_mode == 'vertical' )  THEN
     1071             IF ( TRIM( nesting_mode ) == 'two-way' .OR.  nesting_mode == 'vertical' )  THEN
    10821072!
    10831073!--             Exchange_horiz is needed for all parent-domains after the
     
    11071097                IF ( .NOT. constant_diffusion )  CALL exchange_horiz( e, nbgp )
    11081098
    1109                 IF ( .NOT. constant_diffusion  .AND.  rans_mode  .AND.         &
    1110                                                       rans_tke_e )             &
     1099                IF ( .NOT. constant_diffusion  .AND.  rans_mode  .AND.  rans_tke_e )  THEN
    11111100                   CALL exchange_horiz( diss, nbgp )
     1101                ENDIF
    11121102
    11131103                IF ( air_chemistry )  THEN
     
    11301120!--       when a sloping surface is used
    11311121          IF ( sloping_surface )  THEN
    1132              IF ( nxl ==  0 )  pt(:,:,nxlg:nxl-1) = pt(:,:,nxlg:nxl-1) - &
    1133                                                     pt_slope_offset
    1134              IF ( nxr == nx )  pt(:,:,nxr+1:nxrg) = pt(:,:,nxr+1:nxrg) + &
    1135                                                     pt_slope_offset
     1122             IF ( nxl ==  0 )  pt(:,:,nxlg:nxl-1) = pt(:,:,nxlg:nxl-1) - pt_slope_offset
     1123             IF ( nxr == nx )  pt(:,:,nxr+1:nxrg) = pt(:,:,nxr+1:nxrg) + pt_slope_offset
    11361124          ENDIF
    11371125
     
    11461134!
    11471135!--       Impose a random perturbation on the horizontal velocity field
    1148           IF ( create_disturbances  .AND.                                      &
    1149                ( call_psolver_at_all_substeps  .AND.                           &
    1150                intermediate_timestep_count == intermediate_timestep_count_max )&
    1151           .OR. ( .NOT. call_psolver_at_all_substeps  .AND.                     &
    1152                intermediate_timestep_count == 1 ) )                            &
     1136          IF ( create_disturbances  .AND.  ( call_psolver_at_all_substeps  .AND.                   &
     1137               intermediate_timestep_count == intermediate_timestep_count_max )                    &
     1138               .OR. ( .NOT. call_psolver_at_all_substeps  .AND.  intermediate_timestep_count == 1 ) ) &
    11531139          THEN
    11541140             time_disturb = time_disturb + dt_3d
    11551141             IF ( time_disturb >= dt_disturb )  THEN
    1156                 IF ( disturbance_energy_limit /= 0.0_wp  .AND.                 &
     1142                IF ( disturbance_energy_limit /= 0.0_wp  .AND.                                     &
    11571143                     hom(nzb+5,1,pr_palm,0) < disturbance_energy_limit )  THEN
    11581144                   CALL disturb_field( 'u', tend, u )
    11591145                   CALL disturb_field( 'v', tend, v )
    1160                 ELSEIF ( ( .NOT. bc_lr_cyc  .OR.  .NOT. bc_ns_cyc )            &
    1161                      .AND. .NOT. child_domain  .AND.  .NOT.  nesting_offline )  &
     1146                ELSEIF ( ( .NOT. bc_lr_cyc  .OR.  .NOT. bc_ns_cyc )                                &
     1147                         .AND. .NOT. child_domain  .AND.  .NOT.  nesting_offline )                 &
    11621148                THEN
    11631149!
     
    11761162!--       Map forcing data derived from larger scale model onto domain
    11771163!--       boundaries.
    1178           IF ( nesting_offline  .AND.  intermediate_timestep_count ==          &
    1179                                        intermediate_timestep_count_max  )      &
     1164          IF ( nesting_offline  .AND.  intermediate_timestep_count ==                              &
     1165                                       intermediate_timestep_count_max  )                          &
    11801166             CALL nesting_offl_bc
    11811167!
    11821168!--       Impose a turbulent inflow using synthetic generated turbulence,
    11831169!--       only once per time step.
    1184           IF ( use_syn_turb_gen  .AND.  time_stg_call >= dt_stg_call  .AND.    &
     1170          IF ( use_syn_turb_gen  .AND.  time_stg_call >= dt_stg_call  .AND.                        &
    11851171             intermediate_timestep_count == intermediate_timestep_count_max )  THEN
    11861172             CALL cpu_log( log_point(57), 'synthetic_turbulence_gen', 'start' )
     
    12441230!--          pt_surface and q_surface in dependence on data from external
    12451231!--          file LSF_DATA respectively
    1246              IF ( ( large_scale_forcing .AND. lsf_surf ) .AND. &
    1247                  intermediate_timestep_count == intermediate_timestep_count_max )&
     1232             IF ( ( large_scale_forcing .AND. lsf_surf ) .AND.                                     &
     1233                 intermediate_timestep_count == intermediate_timestep_count_max )                  &
    12481234             THEN
    12491235                CALL ls_forcing_surf( simulated_time )
     
    13351321!
    13361322!--       If required, calculate radiative fluxes and heating rates
    1337           IF ( radiation .AND. intermediate_timestep_count                     &
    1338                == intermediate_timestep_count_max .AND. time_since_reference_point >    &
    1339                skip_time_do_radiation )  THEN
     1323          IF ( radiation  .AND.  intermediate_timestep_count == intermediate_timestep_count_max    &
     1324               .AND. time_since_reference_point > skip_time_do_radiation )  THEN
    13401325
    13411326               time_radiation = time_radiation + dt_3d
    13421327
    1343              IF ( time_radiation >= dt_radiation .OR. force_radiation_call )   &
    1344              THEN
     1328             IF ( time_radiation >= dt_radiation  .OR.  force_radiation_call )  THEN
    13451329
    13461330                CALL cpu_log( log_point(50), 'radiation', 'start' )
     
    13551339!--             solar positions
    13561340                time_since_reference_point_save = time_since_reference_point
    1357                 time_since_reference_point =                                   &
    1358                                     REAL( FLOOR( time_since_reference_point /  &
    1359                                                  dt_radiation), wp )           &
    1360                                              * dt_radiation
     1341                time_since_reference_point = REAL( FLOOR( time_since_reference_point /             &
     1342                                                          dt_radiation), wp ) * dt_radiation
    13611343
    13621344                CALL radiation_control
    13631345
    1364                 IF ( ( urban_surface  .OR.  land_surface )  .AND.               &
    1365                      radiation_interactions )  THEN
     1346                IF ( ( urban_surface  .OR.  land_surface )  .AND.  radiation_interactions )  THEN
    13661347                   CALL cpu_log( log_point_s(46), 'radiation_interaction', 'start' )
    13671348                   CALL radiation_interaction
     
    14231404          time_indoor = time_indoor + dt_3d
    14241405
    1425           IF ( time_indoor >= dt_indoor  .OR.  current_timestep_number == 0 )  &
    1426           THEN
     1406          IF ( time_indoor >= dt_indoor  .OR.  current_timestep_number == 0 )  THEN
    14271407
    14281408             time_indoor = time_indoor - dt_indoor
     
    15061486!
    15071487!--    Data exchange between coupled models
    1508        IF ( coupling_mode /= 'uncoupled'  .AND.  run_coupled                   &
    1509                                           .AND. .NOT. vnested )  THEN
     1488       IF ( coupling_mode /= 'uncoupled'  .AND.  run_coupled  .AND.  .NOT. vnested )  THEN
    15101489          time_coupling = time_coupling + dt_3d
    15111490
     
    15161495!--       If necessary, the coupler will be called at the beginning of the
    15171496!--       next restart run.
    1518           DO WHILE ( time_coupling >= dt_coupling .AND. terminate_coupled == 0 )
     1497          DO WHILE ( time_coupling >= dt_coupling  .AND. terminate_coupled == 0 )
    15191498             CALL surface_coupler
    15201499             time_coupling = time_coupling - dt_coupling
     
    15281507!--                   and then we might get trouble with the biomet output,
    15291508!--                   because we can have 2d and/or 3d biomet output!!
    1530        IF (         biometeorology  &
    1531              .AND.  ( ( time_do3d >= dt_do3d  .AND.  time_since_reference_point >= skip_time_do3d )          &
    1532                       .OR.                                                                                   &
    1533                       ( time_do2d_xy >= dt_do2d_xy  .AND.  time_since_reference_point >= skip_time_do2d_xy ) &
     1509       IF ( biometeorology                                                                         &
     1510            .AND. ( ( time_do3d >= dt_do3d  .AND.  time_since_reference_point >= skip_time_do3d )  &
     1511                  .OR.                                                                             &
     1512            ( time_do2d_xy >= dt_do2d_xy  .AND.  time_since_reference_point >= skip_time_do2d_xy ) &
    15341513                    ) )  THEN
    15351514!
     
    15761555!
    15771556!--    If required, call flow_statistics for averaging in time
    1578        IF ( averaging_interval_pr /= 0.0_wp  .AND.  &
    1579             ( dt_dopr - time_dopr ) <= averaging_interval_pr  .AND.  &
     1557       IF ( averaging_interval_pr /= 0.0_wp  .AND.                                                 &
     1558            ( dt_dopr - time_dopr ) <= averaging_interval_pr  .AND.                                &
    15801559            time_since_reference_point >= skip_time_dopr )  THEN
    15811560          time_dopr_av = time_dopr_av + dt_3d
    15821561          IF ( time_dopr_av >= dt_averaging_input_pr )  THEN
    15831562             do_sum = .TRUE.
    1584              time_dopr_av = MOD( time_dopr_av, &
    1585                                     MAX( dt_averaging_input_pr, dt_3d ) )
     1563             time_dopr_av = MOD( time_dopr_av, MAX( dt_averaging_input_pr, dt_3d ) )
    15861564          ENDIF
    15871565       ENDIF
     
    15901568!
    15911569!--    Sum-up 3d-arrays for later output of time-averaged 2d/3d/masked data
    1592        IF ( averaging_interval /= 0.0_wp  .AND.                                &
    1593             ( dt_data_output_av - time_do_av ) <= averaging_interval  .AND.    &
    1594             time_since_reference_point >= skip_time_data_output_av )           &
     1570       IF ( averaging_interval /= 0.0_wp  .AND.                                                    &
     1571            ( dt_data_output_av - time_do_av ) <= averaging_interval  .AND.                        &
     1572            time_since_reference_point >= skip_time_data_output_av )                               &
    15951573       THEN
    15961574          time_do_sla = time_do_sla + dt_3d
     
    16041582!--    Average surface data
    16051583       IF ( surface_output )  THEN
    1606           IF (         averaging_interval_surf /= 0.0_wp                               &
    1607                 .AND.  ( dt_dosurf_av - time_dosurf_av ) <= averaging_interval_surf    &
     1584          IF ( averaging_interval_surf /= 0.0_wp                                                   &
     1585                .AND.  ( dt_dosurf_av - time_dosurf_av ) <= averaging_interval_surf                &
    16081586                .AND.  time_since_reference_point >= skip_time_dosurf_av )  THEN
    16091587             IF ( time_dosurf_av >= dt_averaging_input )  THEN       
     
    16161594!
    16171595!--    Calculate spectra for time averaging
    1618        IF ( averaging_interval_sp /= 0.0_wp  .AND.  &
    1619             ( dt_dosp - time_dosp ) <= averaging_interval_sp  .AND.  &
    1620             time_since_reference_point >= skip_time_dosp )  THEN
     1596       IF ( averaging_interval_sp /= 0.0_wp  .AND. ( dt_dosp - time_dosp ) <= averaging_interval_sp&
     1597            .AND.  time_since_reference_point >= skip_time_dosp )  THEN
    16211598          time_dosp_av = time_dosp_av + dt_3d
    16221599          IF ( time_dosp_av >= dt_averaging_input_pr )  THEN
    16231600             CALL calc_spectra
    1624              time_dosp_av = MOD( time_dosp_av, &
    1625                                  MAX( dt_averaging_input_pr, dt_3d ) )
     1601             time_dosp_av = MOD( time_dosp_av, MAX( dt_averaging_input_pr, dt_3d ) )
    16261602          ENDIF
    16271603       ENDIF
     
    16351611!
    16361612!--    Take virtual measurements
    1637        IF ( virtual_measurement  .AND.                                         &
    1638             vm_time_start <= time_since_reference_point )  THEN
     1613       IF ( virtual_measurement  .AND.  vm_time_start <= time_since_reference_point )  THEN
    16391614          CALL vm_sampling
    16401615          CALL vm_data_output
     
    16451620       IF ( time_dopr_listing >= dt_dopr_listing )  THEN
    16461621          CALL print_1d
    1647           time_dopr_listing = MOD( time_dopr_listing, MAX( dt_dopr_listing,    &
    1648                                                            dt_3d ) )
     1622          time_dopr_listing = MOD( time_dopr_listing, MAX( dt_dopr_listing, dt_3d ) )
    16491623       ENDIF
    16501624
    16511625!
    16521626!--    Graphic output for PROFIL
    1653        IF (        time_dopr >= dt_dopr                                        &
    1654             .AND.  time_since_reference_point >= skip_time_dopr )  THEN
     1627       IF ( time_dopr >= dt_dopr  .AND.  time_since_reference_point >= skip_time_dopr )  THEN
    16551628          IF ( dopr_n /= 0 )  CALL data_output_profiles
    16561629          time_dopr = MOD( time_dopr, MAX( dt_dopr, dt_3d ) )
     
    16681641!--    Output of spectra (formatted for use with PROFIL), in case of no
    16691642!--    time averaging, spectra has to be calculated before
    1670        IF (         time_dosp >= dt_dosp                                       &
    1671              .AND.  time_since_reference_point >= skip_time_dosp )  THEN
     1643       IF ( time_dosp >= dt_dosp  .AND.  time_since_reference_point >= skip_time_dosp )  THEN
    16721644          IF ( average_count_sp == 0 )  CALL calc_spectra
    16731645          CALL data_output_spectra
     
    16771649!
    16781650!--    2d-data output (cross-sections)
    1679        IF (         time_do2d_xy >= dt_do2d_xy                                 &
    1680              .AND.  time_since_reference_point >= skip_time_do2d_xy )  THEN
     1651       IF ( time_do2d_xy >= dt_do2d_xy  .AND.  time_since_reference_point >= skip_time_do2d_xy )  THEN
    16811652          CALL data_output_2d( 'xy', 0 )
    16821653          time_do2d_xy = MOD( time_do2d_xy, MAX( dt_do2d_xy, dt_3d ) )
    16831654       ENDIF
    1684        IF (         time_do2d_xz >= dt_do2d_xz                                 &
    1685              .AND.  time_since_reference_point >= skip_time_do2d_xz )  THEN
     1655       IF ( time_do2d_xz >= dt_do2d_xz  .AND.  time_since_reference_point >= skip_time_do2d_xz )  THEN
    16861656          CALL data_output_2d( 'xz', 0 )
    16871657          time_do2d_xz = MOD( time_do2d_xz, MAX( dt_do2d_xz, dt_3d ) )
    16881658       ENDIF
    1689        IF (         time_do2d_yz >= dt_do2d_yz                                 &
    1690              .AND.  time_since_reference_point >= skip_time_do2d_yz )  THEN
     1659       IF ( time_do2d_yz >= dt_do2d_yz  .AND.  time_since_reference_point >= skip_time_do2d_yz )  THEN
    16911660          CALL data_output_2d( 'yz', 0 )
    16921661          time_do2d_yz = MOD( time_do2d_yz, MAX( dt_do2d_yz, dt_3d ) )
     
    16951664!
    16961665!--    3d-data output (volume data)
    1697        IF (         time_do3d >= dt_do3d                                       &
    1698              .AND.  time_since_reference_point >= skip_time_do3d )  THEN
     1666       IF ( time_do3d >= dt_do3d  .AND.  time_since_reference_point >= skip_time_do3d )  THEN
    16991667          CALL data_output_3d( 0 )
    17001668          time_do3d = MOD( time_do3d, MAX( dt_do3d, dt_3d ) )
     
    17041672!--    Masked data output
    17051673       DO  mid = 1, masks
    1706           IF (         time_domask(mid) >= dt_domask(mid)                      &
    1707                 .AND.  time_since_reference_point >= skip_time_domask(mid) )  THEN
     1674          IF ( time_domask(mid) >= dt_domask(mid)                                                  &
     1675               .AND.  time_since_reference_point >= skip_time_domask(mid) )  THEN
    17081676             CALL data_output_mask( 0 )
    1709              time_domask(mid) = MOD( time_domask(mid),                         &
    1710                                      MAX( dt_domask(mid), dt_3d ) )
     1677             time_domask(mid) = MOD( time_domask(mid), MAX( dt_domask(mid), dt_3d ) )
    17111678          ENDIF
    17121679       ENDDO
     
    17141681!
    17151682!--    Output of time-averaged 2d/3d/masked data
    1716        IF (         time_do_av >= dt_data_output_av                            &
    1717              .AND.  time_since_reference_point >= skip_time_data_output_av )  THEN
     1683       IF ( time_do_av >= dt_data_output_av                                                        &
     1684            .AND.  time_since_reference_point >= skip_time_data_output_av )  THEN
    17181685          CALL average_3d_data
    17191686!
     
    17341701!--    Output of surface data, instantaneous and averaged data
    17351702       IF ( surface_output )  THEN
    1736           IF (         time_dosurf >= dt_dosurf                                &
    1737                 .AND.  time_since_reference_point >= skip_time_dosurf )  THEN
     1703          IF ( time_dosurf >= dt_dosurf  .AND.  time_since_reference_point >= skip_time_dosurf )  THEN
    17381704             CALL surface_data_output( 0 )
    17391705             time_dosurf = MOD( time_dosurf, MAX( dt_dosurf, dt_3d ) )
    17401706          ENDIF
    1741           IF (         time_dosurf_av >= dt_dosurf_av                          &
    1742                 .AND.  time_since_reference_point >= skip_time_dosurf_av )  THEN
     1707          IF ( time_dosurf_av >= dt_dosurf_av  .AND.  time_since_reference_point >= skip_time_dosurf_av )  THEN
    17431708             CALL surface_data_output( 1 )
    17441709             time_dosurf_av = MOD( time_dosurf_av, MAX( dt_dosurf_av, dt_3d ) )
     
    17491714!--    Output of particle time series
    17501715       IF ( particle_advection )  THEN
    1751           IF ( time_dopts >= dt_dopts  .OR.                                    &
    1752                ( time_since_reference_point >= particle_advection_start  .AND. &
     1716          IF ( time_dopts >= dt_dopts  .OR.                                                        &
     1717               ( time_since_reference_point >= particle_advection_start  .AND.                     &
    17531718                 first_call_lpm ) )  THEN
    17541719             CALL data_output_ptseries
     
    18131778!--    Computation and output of run control parameters.
    18141779!--    This is also done whenever perturbations have been imposed
    1815        IF ( time_run_control >= dt_run_control  .OR.                     &
    1816             timestep_scheme(1:5) /= 'runge'  .OR.  disturbance_created ) &
     1780       IF ( time_run_control >= dt_run_control  .OR.                                               &
     1781            timestep_scheme(1:5) /= 'runge'  .OR.  disturbance_created )                           &
    18171782       THEN
    18181783          CALL run_control
    18191784          IF ( time_run_control >= dt_run_control )  THEN
    1820              time_run_control = MOD( time_run_control, &
    1821                                      MAX( dt_run_control, dt_3d_old ) )
     1785             time_run_control = MOD( time_run_control, MAX( dt_run_control, dt_3d_old ) )
    18221786          ENDIF
    18231787       ENDIF
     
    18321796    ENDDO   ! time loop
    18331797
    1834 #ifdef _OPENACC
     1798#if defined( _OPENACC )
    18351799    CALL exit_surface_arrays
    18361800#endif
  • palm/trunk/SOURCE/tridia_solver_mod.f90

    r3690 r3761  
    2525! -----------------
    2626! $Id$
     27! OpenACC modification to prevent compiler warning about unused variable
     28!
     29! 3690 2019-01-22 22:56:42Z knoop
    2730! OpenACC port for SPEC
    2831!
     
    156159
    157160       USE arrays_3d,                                                          &
    158            ONLY:  ddzu_pres, ddzw, rho_air_zw, tri
     161           ONLY:  ddzu_pres, ddzw, rho_air_zw
     162
     163#if defined( _OPENACC )
     164       USE arrays_3d,                                                          &
     165           ONLY:  tri
     166#endif
    159167
    160168       IMPLICIT NONE
Note: See TracChangeset for help on using the changeset viewer.