Ignore:
Timestamp:
Mar 20, 2014 8:40:49 AM (8 years ago)
Author:
raasch
Message:

ONLY-attribute added to USE-statements,
kind-parameters added to all INTEGER and REAL declaration statements,
kinds are defined in new module kinds,
old module precision_kind is removed,
revision history before 2012 removed,
comment fields (!:) to be used for variable explanations added to all variable declaration statements

File:
1 edited

Legend:

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

    r1319 r1320  
    11 SUBROUTINE exchange_horiz( ar, nbgp_local)
    22
    3 !--------------------------------------------------------------------------------!
     3!------------------------------------------------------------------------------!
    44! This file is part of PALM.
    55!
     
    1616!
    1717! Copyright 1997-2014 Leibniz Universitaet Hannover
    18 !--------------------------------------------------------------------------------!
     18!------------------------------------------------------------------------------!
    1919!
    2020! Current revisions:
    2121! -----------------
    22 !
     22! ONLY-attribute added to USE-statements,
     23! kind-parameters added to all INTEGER and REAL declaration statements,
     24! kinds are defined in new module kinds,
     25! old module precision_kind is removed,
     26! revision history before 2012 removed,
     27! comment fields (!:) to be used for variable explanations added to
     28! all variable declaration statements
    2329!
    2430! Former revisions:
    2531! -----------------
    2632! $Id$
    27 !
    28 ! 1318 2014-03-17 13:35:16Z raasch
    29 ! module interfaces removed
    3033!
    3134! 1257 2013-11-08 15:18:40Z raasch
     
    4548! 841 2012-02-28 12:29:49Z maronga
    4649! Excluded routine from compilation of namelist_file_check
    47 !
    48 ! 709 2011-03-30 09:31:40Z raasch
    49 ! formatting adjustments
    50 !
    51 ! 707 2011-03-29 11:39:40Z raasch
    52 ! grid_level directly used as index for MPI data type arrays,
    53 ! bc_lr/ns replaced by bc_lr/ns_cyc
    54 !
    55 ! 689 2011-02-20 19:31:12z gryschka
    56 ! Bugfix for some logical expressions
    57 ! (syntax was not compatible with all compilers)
    58 !
    59 ! 683 2011-02-09 14:25:15Z raasch
    60 ! optional synchronous exchange (sendrecv) implemented, code partly reformatted
    61 !
    62 ! 667 2010-12-23 12:06:00Z suehring/gryschka
    63 ! Dynamic exchange of ghost points with nbgp_local to ensure that no useless
    64 ! ghost points exchanged in case of multigrid. type_yz(0) and type_xz(0)
    65 ! used for normal grid, the remaining types used for the several grid levels.
    66 ! Exchange is done via MPI-Vectors with a dynamic value of ghost points which
    67 ! depend on the advection scheme. Exchange of left and right PEs is 10% faster
    68 ! with MPI-Vectors than without.
    69 !
    70 ! 75 2007-03-22 09:54:05Z raasch
    71 ! Special cases for additional gridpoints along x or y in case of non-cyclic
    72 ! boundary conditions are not regarded any more
    73 !
    74 ! RCS Log replace by Id keyword, revision history cleaned up
    75 !
    76 ! Revision 1.16  2006/02/23 12:19:08  raasch
    77 ! anz_yz renamed ngp_yz
    7850!
    7951! Revision 1.1  1997/07/24 11:13:29  raasch
     
    8759!------------------------------------------------------------------------------!
    8860
    89     USE control_parameters
    90     USE cpulog
    91     USE indices
     61    USE control_parameters,                                                    &
     62        ONLY:  bc_lr_cyc, bc_ns_cyc, grid_level, mg_switch_to_pe0,             &
     63               synchronous_exchange
     64               
     65    USE cpulog,                                                                &
     66        ONLY:  cpu_log, log_point_s
     67       
     68    USE indices,                                                               &
     69        ONLY:  nxl, nxr, nyn, nys, nzb, nzt
     70       
     71    USE kinds
     72   
    9273    USE pegrid
    9374
     
    9576
    9677
    97     INTEGER ::  i, j, k, nbgp_local
    98     REAL, DIMENSION(nzb:nzt+1,nys-nbgp_local:nyn+nbgp_local, &
    99                     nxl-nbgp_local:nxr+nbgp_local) ::  ar
     78    INTEGER(iwp) ::  i           !:
     79    INTEGER(iwp) ::  j           !:
     80    INTEGER(iwp) ::  k           !:
     81    INTEGER(iwp) ::  nbgp_local  !:
     82   
     83    REAL(wp), DIMENSION(nzb:nzt+1,nys-nbgp_local:nyn+nbgp_local,               &
     84                        nxl-nbgp_local:nxr+nbgp_local) ::  ar  !:
     85                       
    10086
    10187#if ! defined( __check )
     
    127113!
    128114!--       Send right boundary, receive left one (synchronous)
    129           CALL MPI_SENDRECV( ar(nzb,nys-nbgp_local,nxr+1-nbgp_local), 1, &
    130                              type_yz(grid_level), pright, 1,             &
    131                              ar(nzb,nys-nbgp_local,nxl-nbgp_local), 1,   &
    132                              type_yz(grid_level), pleft,  1,             &
     115          CALL MPI_SENDRECV( ar(nzb,nys-nbgp_local,nxr+1-nbgp_local), 1,       &
     116                             type_yz(grid_level), pright, 1,                   &
     117                             ar(nzb,nys-nbgp_local,nxl-nbgp_local), 1,         &
     118                             type_yz(grid_level), pleft,  1,                   &
    133119                             comm2d, status, ierr )
    134120
     
    152138!
    153139!--          Send right boundary, receive left one (asynchronous)
    154              CALL MPI_ISEND( ar(nzb,nys-nbgp_local,nxr+1-nbgp_local), 1,          &
    155                              type_yz(grid_level), pright, req_count+1, comm2d,    &
     140             CALL MPI_ISEND( ar(nzb,nys-nbgp_local,nxr+1-nbgp_local), 1,       &
     141                             type_yz(grid_level), pright, req_count+1, comm2d, &
    156142                             req(req_count+3), ierr )
    157              CALL MPI_IRECV( ar(nzb,nys-nbgp_local,nxl-nbgp_local),   1,          &
    158                              type_yz(grid_level), pleft,  req_count+1, comm2d,    &
     143             CALL MPI_IRECV( ar(nzb,nys-nbgp_local,nxl-nbgp_local),   1,       &
     144                             type_yz(grid_level), pleft,  req_count+1, comm2d, &
    159145                             req(req_count+4), ierr )
    160146
     
    192178!
    193179!--       Send rear boundary, receive front one (synchronous)
    194           CALL MPI_SENDRECV( ar(nzb,nyn-nbgp_local+1,nxl-nbgp_local), 1, &
    195                              type_xz(grid_level), pnorth, 1,             &
    196                              ar(nzb,nys-nbgp_local,nxl-nbgp_local),   1, &
    197                              type_xz(grid_level), psouth, 1,             &
     180          CALL MPI_SENDRECV( ar(nzb,nyn-nbgp_local+1,nxl-nbgp_local), 1,       &
     181                             type_xz(grid_level), pnorth, 1,                   &
     182                             ar(nzb,nys-nbgp_local,nxl-nbgp_local),   1,       &
     183                             type_xz(grid_level), psouth, 1,                   &
    198184                             comm2d, status, ierr )
    199185
     
    218204!
    219205!--          Send rear boundary, receive front one (asynchronous)
    220              CALL MPI_ISEND( ar(nzb,nyn-nbgp_local+1,nxl-nbgp_local), 1,          &
    221                              type_xz(grid_level), pnorth, req_count+1, comm2d,    &
     206             CALL MPI_ISEND( ar(nzb,nyn-nbgp_local+1,nxl-nbgp_local), 1,       &
     207                             type_xz(grid_level), pnorth, req_count+1, comm2d, &
    222208                             req(req_count+3), ierr )
    223              CALL MPI_IRECV( ar(nzb,nys-nbgp_local,nxl-nbgp_local),   1,          &
    224                              type_xz(grid_level), psouth, req_count+1, comm2d,    &
     209             CALL MPI_IRECV( ar(nzb,nys-nbgp_local,nxl-nbgp_local),   1,       &
     210                             type_xz(grid_level), psouth, req_count+1, comm2d, &
    225211                             req(req_count+4), ierr )
    226212
Note: See TracChangeset for help on using the changeset viewer.