Changeset 2372 for palm/trunk


Ignore:
Timestamp:
Aug 25, 2017 12:37:32 PM (7 years ago)
Author:
sward
Message:

y_shift for periodic boundary conditions

Location:
palm/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • palm/trunk/SCRIPTS/testsuite

    r2349 r2372  
    6565      sed -i -e "s/<replace_with_your_hostname>/${HOSTNAME}/g" ${tester_prefix}/.mrun.config
    6666      sed -i -e "s/<replace_with_your_local_username>/${USER}/g" ${tester_prefix}/.mrun.config
    67       sed -i -e "s/<hi>/lcmuk/g" ${tester_prefix}/.mrun.config
     67      sed -i -e "s/<hi>/lclocal/g" ${tester_prefix}/.mrun.config
    6868      sed -i -e "s#%base_directory    \$HOME/palm/current_version#%base_directory    ${tester_prefix}#g" ${tester_prefix}/.mrun.config
    6969      sed -i -e "s#%base_data         ~/palm/current_version/JOBS#%base_data         ${tester_prefix}/JOBS#g" ${tester_prefix}/.mrun.config
     
    8181   rm -rf ${tester_prefix}/MAKE_DEPOSITORY*
    8282   rm -rf ${tester_prefix}/SOURCES_FOR_RUN_*
    83    bash ${trunk_dir}/SCRIPTS/mbuild -h "lcmuk" -K "parallel" -v -u
    84    bash ${trunk_dir}/SCRIPTS/mbuild -h "lcmuk" -K "parallel" -v
     83   bash ${trunk_dir}/SCRIPTS/mbuild -h "lclocal" -K "parallel" -v -u
     84   bash ${trunk_dir}/SCRIPTS/mbuild -h "lclocal" -K "parallel" -v
    8585}
    8686
     
    101101   cp ${test_dir}/${1}_rc ${monitoring_dir}/${1}_rc_reference
    102102   [[ -f ${test_dir}/${1}_topo ]] && cp ${test_dir}/${1}_topo ${input_dir}/
    103    bash ${trunk_dir}/SCRIPTS/mrun -d ${1} -r "d3#" -h "lcmuk" -K "parallel" -X "$NUM_PROC" -T "$NUM_PROC" -v -B > ${monitoring_dir}/${1}_stdout 2>&1
     103   bash ${trunk_dir}/SCRIPTS/mrun -d ${1} -r "d3#" -h "lclocal" -K "parallel" -X "$NUM_PROC" -T "$NUM_PROC" -v -B > ${monitoring_dir}/${1}_stdout 2>&1
    104104   grep -A 99999 "Run-control output" ${monitoring_dir}/${1}_rc 1> ${monitoring_dir}/RC 2> /dev/null
    105105   grep -A 99999 "Run-control output" ${monitoring_dir}/${1}_rc_reference 1> ${monitoring_dir}/RC_REF 2> /dev/null
  • palm/trunk/SOURCE/init_pegrid.f90

    r2365 r2372  
    2525! -----------------
    2626! $Id$
     27! Shifted cyclic boundary conditions implemented
     28!
     29! 2365 2017-08-21 14:59:59Z kanani
    2730! Vertical nesting implemented (SadiqHuq)
    2831!
     
    206209               psolver, outflow_l, outflow_n, outflow_r, outflow_s,            &
    207210               outflow_source_plane, recycling_width, scalar_advec,            &
    208                subdomain_size, turbulent_outflow
     211               subdomain_size, turbulent_outflow, y_shift
    209212
    210213    USE grid_variables,                                                        &
     
    271274    INTEGER(iwp), DIMENSION(:), ALLOCATABLE ::  nysf    !<
    272275
    273     INTEGER(iwp), DIMENSION(2) :: pdims_remote          !<
     276    INTEGER(iwp), DIMENSION(2) ::  pdims_remote         !<
     277    INTEGER(iwp)               ::  lcoord(2)            !< PE coordinates of left neighbor along x and y
     278    INTEGER(iwp)               ::  rcoord(2)            !< PE coordinates of right neighbor along x and y
    274279
    275280!
     
    339344    CALL MPI_CART_SHIFT( comm2d, 0, 1, pleft, pright, ierr )
    340345    CALL MPI_CART_SHIFT( comm2d, 1, 1, psouth, pnorth, ierr )
     346
     347!
     348!-- In case of cyclic boundary conditions, a y-shift at the boundaries in
     349!-- x-direction can be introduced via parameter y_shift. The shift is done
     350!-- by modifying the processor grid in such a way that processors located
     351!-- at the x-boundary communicate across it to processors with y-coordinate
     352!-- shifted by y_shift relative to their own. This feature can not be used
     353!-- in combination with an fft pressure solver. It has been implemented to
     354!-- counter the effect of streak structures in case of cyclic boundary
     355!-- conditions. For a description of these see Munters
     356!-- (2016; dx.doi.org/10.1063/1.4941912)
     357!--
     358!-- Get coordinates of left and right neighbor on PE grid
     359    IF ( y_shift /= 0 ) THEN
     360
     361       IF ( bc_lr /= 'cyclic'  .OR.  bc_ns /= 'cyclic' )  THEN
     362          message_string = 'y_shift /= 0 is only allowed for cyclic ' //       &
     363                           'boundary conditions in both directions '
     364          CALL message( 'check_parameters', 'PA0467', 1, 2, 0, 6, 0 )
     365       ENDIF
     366       IF ( TRIM( psolver ) /= 'multigrid' .AND.                               &
     367            TRIM( psolver ) /= 'multigrid_noopt')                              &
     368       THEN
     369          message_string = 'y_shift /= 0 requires a multigrid pressure solver '
     370          CALL message( 'check_parameters', 'PA0468', 1, 2, 0, 6, 0 )
     371       ENDIF
     372
     373       CALL MPI_CART_COORDS( comm2d, pright, ndim, rcoord, ierr )
     374       CALL MPI_CART_COORDS( comm2d, pleft, ndim, lcoord, ierr )
     375
     376!
     377!--    If the x(y)-coordinate of the right (left) neighbor is smaller (greater)
     378!--    than that of the calling process, then the calling process is located on
     379!--    the right (left) boundary of the processor grid. In that case,
     380!--    the y-coordinate of that neighbor is increased (decreased) by y_shift.
     381!--    The rank of the process with that coordinate is then inquired and the
     382!--    neighbor rank for MPI_SENDRECV, pright (pleft) is set to it.
     383!--    In this way, the calling process receives a new right (left) neighbor
     384!--    for all future MPI_SENDRECV calls. That neighbor has a y-coordinate
     385!--    of y+(-)y_shift, where y is the original right (left) neighbor's
     386!--    y-coordinate. The modulo-operation ensures that if the neighbor's
     387!--    y-coordinate exceeds the grid-boundary, it will be relocated to
     388!--    the opposite part of the grid cyclicly.
     389       IF ( rcoord(1) < pcoord(1) ) THEN
     390          rcoord(2) = MODULO( rcoord(2) + y_shift, pdims(2) )
     391          CALL MPI_CART_RANK( comm2d, rcoord, pright, ierr )
     392       ENDIF
     393
     394       IF ( lcoord(1) > pcoord(1) ) THEN
     395          lcoord(2) = MODULO( lcoord(2) - y_shift, pdims(2) )
     396          CALL MPI_CART_RANK( comm2d, lcoord, pleft, ierr )
     397       ENDIF
     398    ENDIF
    341399
    342400!
  • palm/trunk/SOURCE/modules.f90

    r2339 r2372  
    2525! -----------------
    2626! $Id$
     27! y_shift namelist parameter added
     28!
     29! 2339 2017-08-07 13:55:26Z gronemeier
    2730! corrected timestamp in header
    2831!
     
    10741077    INTEGER(iwp) ::  terminate_coupled_remote = 0      !< switch for steering termination in case of coupled runs (condition of the remote model)
    10751078    INTEGER(iwp) ::  timestep_count = 0                !< number of timesteps carried out since the beginning of the initial run
     1079    INTEGER(iwp) ::  y_shift = 0                       !< namelist parameter
    10761080    INTEGER(iwp) ::  dist_nxl(0:1)                               !< left boundary of disturbance region
    10771081    INTEGER(iwp) ::  dist_nxr(0:1)                               !< right boundary of disturbance region
  • palm/trunk/SOURCE/parin.f90

    r2365 r2372  
    2525! -----------------
    2626! $Id$
     27! y_shift added to namelist
     28!
     29! 2365 2017-08-21 14:59:59Z kanani
    2730! Vertical grid nesting: add vnest_start_time to d3par (SadiqHuq)
    2831!
     
    429432             vg_vertical_gradient_level, v_bulk, v_profile, ventilation_effect,&
    430433             wall_adjustment, wall_heatflux, wall_humidityflux,                &
    431              wall_salinityflux, wall_scalarflux, zeta_max, zeta_min, z0h_factor
     434             wall_salinityflux, wall_scalarflux, y_shift, zeta_max, zeta_min,  &
     435             z0h_factor
    432436     
    433437    NAMELIST /d3par/  averaging_interval, averaging_interval_pr,               &
  • palm/trunk/SOURCE/read_var_list.f90

    r2365 r2372  
    2525! -----------------
    2626! $Id$
     27! y_shift added to vars, version no. increased
     28!
     29! 2365 2017-08-21 14:59:59Z kanani
    2730! Vertical grid nesting implemented (SadiqHuq)
    2831!
     
    269272!-- Make version number check first
    270273    READ ( 13 )  version_on_file
    271     binary_version = '4.1'
     274    binary_version = '4.2'
    272275    IF ( TRIM( version_on_file ) /= TRIM( binary_version ) )  THEN
    273276       WRITE( message_string, * ) 'version mismatch concerning control ', &
     
    818821          CASE ( 'w_max_ijk' )
    819822             READ ( 13 )  w_max_ijk
     823          CASE ( 'y_shift' )
     824             READ ( 13 )  y_shift
    820825          CASE ( 'zeta_max' )
    821826             READ ( 13 )  zeta_max
  • palm/trunk/SOURCE/write_var_list.f90

    r2365 r2372  
    2525! -----------------
    2626! $Id$
     27! y_shift added to vars, version no. increased
     28!
     29! 2365 2017-08-21 14:59:59Z kanani
    2730! Vertical nesting implemented (SadiqHuq)
    2831!
     
    235238
    236239
    237     binary_version = '4.1'
     240    binary_version = '4.2'
    238241
    239242    WRITE ( 14 )  binary_version
     
    726729    WRITE ( 14 )  'w_max_ijk                     '
    727730    WRITE ( 14 )  w_max_ijk
     731    WRITE ( 14 )  'y_shift                       '
     732    WRITE ( 14 )  y_shift
    728733    WRITE ( 14 )  'zeta_max                      '
    729734    WRITE ( 14 )  zeta_max
Note: See TracChangeset for help on using the changeset viewer.