Ignore:
Timestamp:
Mar 20, 2014 8:40:49 AM (10 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/poisfft.f90

    r1319 r1320  
    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:
     
    95101! (most of the code is unneeded by check_namelist_files).
    96102!
    97 ! 763 2011-10-06 09:32:09Z suehring
    98 ! Comment added concerning the last change.
    99 !
    100 ! 761 2011-10-05 17:58:52Z suehring
    101 ! Bugfix: Avoid divisions by zero in case of using a 'neumann' bc for the
    102 ! pressure at the top of the model domain.
    103 !
    104 ! 696 2011-03-18 07:03:49Z raasch
    105 ! work_fftx removed from PRIVATE clauses in fftx_tr_xy and tr_yx_fftx
    106 !
    107 ! 683 2011-02-09 14:25:15Z raasch
    108 ! openMP parallelization for 2d-domain-decomposition
    109 !
    110 ! 667 2010-12-23 12:06:00Z suehring/gryschka
    111 ! ddzu replaced by ddzu_pres due to changes in zu(0)
    112 !
    113 ! 622 2010-12-10 08:08:13Z raasch
    114 ! optional barriers included in order to speed up collective operations
    115 !
    116 ! 377 2009-09-04 11:09:00Z raasch
    117 ! __lcmuk changed to __lc to avoid problems with Intel compiler on sgi-ice
    118 !
    119 ! 164 2008-05-15 08:46:15Z raasch
    120 ! Arguments removed from transpose routines
    121 !
    122 ! 128 2007-10-26 13:11:14Z raasch
    123 ! Bugfix: wavenumber calculation for even nx in routines maketri
    124 !
    125 ! 85 2007-05-11 09:35:14Z raasch
    126 ! Bugfix: work_fft*_vec removed from some PRIVATE-declarations
    127 !
    128 ! 76 2007-03-29 00:58:32Z raasch
    129 ! Tridiagonal coefficients adjusted for Neumann boundary conditions both at
    130 ! the bottom and the top.
    131 !
    132 ! RCS Log replace by Id keyword, revision history cleaned up
    133 !
    134 ! Revision 1.24  2006/08/04 15:00:24  raasch
    135 ! Default setting of the thread number tn in case of not using OpenMP
    136 !
    137 ! Revision 1.23  2006/02/23 12:48:38  raasch
    138 ! Additional compiler directive in routine tridia_1dd for preventing loop
    139 ! exchange on NEC-SX6
    140 !
    141 ! Revision 1.20  2004/04/30 12:38:09  raasch
    142 ! Parts of former poisfft_hybrid moved to this subroutine,
    143 ! former subroutine changed to a module, renaming of FFT-subroutines and
    144 ! -module, FFTs completely substituted by calls of fft_x and fft_y,
    145 ! NAG fft used in the non-parallel case completely removed, l in maketri
    146 ! is now a 1d-array, variables passed by modules instead of using parameter
    147 ! lists, enlarged transposition arrays introduced
    148 !
    149103! Revision 1.1  1997/07/24 11:24:14  raasch
    150104! Initial revision
     
    167121!------------------------------------------------------------------------------!
    168122
    169     USE fft_xy
    170     USE indices
    171     USE transpose_indices
    172     USE tridia_solver
     123    USE fft_xy,                                                                &
     124        ONLY:  fft_init, fft_y, fft_y_1d, fft_y_m, fft_x, fft_x_1d, fft_x_m
     125
     126    USE indices,                                                               &
     127        ONLY:  nnx, nny, nx, nxl, nxr, ny, nys, nyn, nz
     128
     129    USE transpose_indices,                                                     &
     130        ONLY:  nxl_y, nxl_z, nxr_y, nxr_z, nys_x, nys_z, nyn_x, nyn_z, nzb_x,  &
     131               nzb_y, nzt_x, nzt_y
     132
     133    USE tridia_solver,                                                         &
     134        ONLY:  tridia_1dd, tridia_init, tridia_substi, tridia_substi_overlap
    173135
    174136    IMPLICIT NONE
     
    200162    SUBROUTINE poisfft_init
    201163
    202        USE arrays_3d,  ONLY:  ddzu_pres, ddzw
     164       USE arrays_3d,                                                          &
     165           ONLY:  ddzu_pres, ddzw
     166
     167       USE kinds
    203168
    204169       IMPLICIT NONE
    205170
    206        INTEGER ::  k
     171       INTEGER(iwp) ::  k  !:
    207172
    208173
     
    219184    SUBROUTINE poisfft( ar )
    220185
    221        USE control_parameters,  ONLY : fft_method, transpose_compute_overlap
    222        USE cpulog
     186       USE control_parameters,                                                 &
     187           ONLY:  fft_method, transpose_compute_overlap
     188
     189       USE cpulog,                                                             &
     190           ONLY:  cpu_log, cpu_log_nowait, log_point_s
     191
     192       USE kinds
     193
    223194       USE pegrid
    224195
    225196       IMPLICIT NONE
    226197
    227        INTEGER ::  ii, iind, inew, jj, jind, jnew, ki, kk, knew, n, nblk, &
    228                    nnx_y, nny_z, nnz_t, nnz_x, nxl_y_bound, nxr_y_bound
    229        INTEGER, DIMENSION(4) ::  isave
    230 
    231        REAL, DIMENSION(1:nz,nys:nyn,nxl:nxr) ::  ar
     198       INTEGER(iwp) ::  ii           !:
     199       INTEGER(iwp) ::  iind         !:
     200       INTEGER(iwp) ::  inew         !:
     201       INTEGER(iwp) ::  jj           !:
     202       INTEGER(iwp) ::  jind         !:
     203       INTEGER(iwp) ::  jnew         !:
     204       INTEGER(iwp) ::  ki           !:
     205       INTEGER(iwp) ::  kk           !:
     206       INTEGER(iwp) ::  knew         !:
     207       INTEGER(iwp) ::  n            !:
     208       INTEGER(iwp) ::  nblk         !:
     209       INTEGER(iwp) ::  nnx_y        !:
     210       INTEGER(iwp) ::  nny_z        !:
     211       INTEGER(iwp) ::  nnz_t        !:
     212       INTEGER(iwp) ::  nnz_x        !:
     213       INTEGER(iwp) ::  nxl_y_bound  !:
     214       INTEGER(iwp) ::  nxr_y_bound  !:
     215
     216       INTEGER(iwp), DIMENSION(4) ::  isave  !:
     217
     218       REAL(wp), DIMENSION(1:nz,nys:nyn,nxl:nxr) ::  ar      !:
    232219       !$acc declare create( ar_inv )
    233        REAL, DIMENSION(nys:nyn,nxl:nxr,1:nz) ::  ar_inv
    234 
    235        REAL, DIMENSION(:,:,:),   ALLOCATABLE ::  ar1, f_in, f_inv, f_out_y, &
    236                                                  f_out_z
     220       REAL(wp), DIMENSION(nys:nyn,nxl:nxr,1:nz) ::  ar_inv  !:
     221
     222       REAL(wp), DIMENSION(:,:,:),   ALLOCATABLE ::  ar1      !:
     223       REAL(wp), DIMENSION(:,:,:),   ALLOCATABLE ::  f_in     !:
     224       REAL(wp), DIMENSION(:,:,:),   ALLOCATABLE ::  f_inv    !:
     225       REAL(wp), DIMENSION(:,:,:),   ALLOCATABLE ::  f_out_y  !:
     226       REAL(wp), DIMENSION(:,:,:),   ALLOCATABLE ::  f_out_z  !:
    237227
    238228
     
    723713!------------------------------------------------------------------------------!
    724714
    725        USE control_parameters
    726        USE cpulog
    727        USE indices
     715       USE control_parameters,                                                 &
     716           ONLY:  host
     717
     718       USE cpulog,                                                             &
     719           ONLY:  cpu_log, log_point_s
     720
     721       USE kinds
     722
    728723       USE pegrid
    729        USE transpose_indices
    730724
    731725       IMPLICIT NONE
    732726
    733        INTEGER            ::  i, iend, iouter, ir, j, k
    734        INTEGER, PARAMETER ::  stridex = 4
    735 
    736        REAL, DIMENSION(0:ny,stridex)                    ::  work_ffty
     727       INTEGER(iwp)            ::  i            !:
     728       INTEGER(iwp)            ::  iend         !:
     729       INTEGER(iwp)            ::  iouter       !:
     730       INTEGER(iwp)            ::  ir           !:
     731       INTEGER(iwp)            ::  j            !:
     732       INTEGER(iwp)            ::  k            !:
     733
     734       INTEGER(iwp), PARAMETER ::  stridex = 4  !:
     735
     736       REAL(wp), DIMENSION(0:ny,stridex)        ::  work_ffty      !:
    737737#if defined( __nec )
    738        REAL, DIMENSION(0:ny+1,1:nz,nxl:nxr)             ::  work_ffty_vec
     738       REAL(wp), DIMENSION(0:ny+1,1:nz,nxl:nxr) ::  work_ffty_vec  !:
    739739#endif
    740        REAL, DIMENSION(1:nz,0:ny,nxl:nxr)            ::  f_in
    741        REAL, DIMENSION(nnx,1:nz,nys_x:nyn_x,pdims(1)) ::  f_out
    742        REAL, DIMENSION(nxl:nxr,1:nz,0:ny)            ::  work
     740       REAL(wp), DIMENSION(1:nz,0:ny,nxl:nxr)             ::  f_in   !:
     741       REAL(wp), DIMENSION(nnx,1:nz,nys_x:nyn_x,pdims(1)) ::  f_out  !:
     742       REAL(wp), DIMENSION(nxl:nxr,1:nz,0:ny)             ::  work   !:
    743743
    744744!
     
    840840!------------------------------------------------------------------------------!
    841841
    842        USE control_parameters
    843        USE cpulog
    844        USE indices
     842       USE control_parameters,                                                 &
     843           ONLY:  host
     844
     845       USE cpulog,                                                             &
     846           ONLY:  cpu_log, log_point_s
     847
     848       USE kinds
     849
    845850       USE pegrid
    846        USE transpose_indices
    847851
    848852       IMPLICIT NONE
    849853
    850        INTEGER            ::  i, iend, iouter, ir, j, k
    851        INTEGER, PARAMETER ::  stridex = 4
    852 
    853        REAL, DIMENSION(0:ny,stridex)                    ::  work_ffty
     854       INTEGER(iwp)            ::  i            !:
     855       INTEGER(iwp)            ::  iend         !:
     856       INTEGER(iwp)            ::  iouter       !:
     857       INTEGER(iwp)            ::  ir           !:
     858       INTEGER(iwp)            ::  j            !:
     859       INTEGER(iwp)            ::  k            !:
     860
     861       INTEGER(iwp), PARAMETER ::  stridex = 4  !:
     862
     863       REAL(wp), DIMENSION(0:ny,stridex)        ::  work_ffty      !:
    854864#if defined( __nec )
    855        REAL, DIMENSION(0:ny+1,1:nz,nxl:nxr)             ::  work_ffty_vec
     865       REAL(wp), DIMENSION(0:ny+1,1:nz,nxl:nxr) ::  work_ffty_vec  !:
    856866#endif
    857        REAL, DIMENSION(nnx,1:nz,nys_x:nyn_x,pdims(1)) ::  f_in
    858        REAL, DIMENSION(1:nz,0:ny,nxl:nxr)             ::  f_out
    859        REAL, DIMENSION(nxl:nxr,1:nz,0:ny)             ::  work
     867       REAL(wp), DIMENSION(nnx,1:nz,nys_x:nyn_x,pdims(1)) ::  f_in   !:
     868       REAL(wp), DIMENSION(1:nz,0:ny,nxl:nxr)             ::  f_out  !:
     869       REAL(wp), DIMENSION(nxl:nxr,1:nz,0:ny)             ::  work   !:
    860870
    861871!
     
    960970!------------------------------------------------------------------------------!
    961971
    962        USE control_parameters
    963        USE cpulog
    964        USE grid_variables
    965        USE indices
     972       USE control_parameters,                                                 &
     973           ONLY:  host
     974
     975       USE cpulog,                                                             &
     976           ONLY:  cpu_log, log_point_s
     977
     978       USE grid_variables,                                                     &
     979           ONLY:  ddx2, ddy2
     980
     981       USE kinds
     982
    966983       USE pegrid
    967        USE transpose_indices
    968984
    969985       IMPLICIT NONE
    970986
    971        INTEGER ::  i, j, k, m, n, omp_get_thread_num, tn
    972 
    973        REAL, DIMENSION(0:nx)                          ::  work_fftx
    974        REAL, DIMENSION(0:nx,1:nz)                     ::  work_trix
    975        REAL, DIMENSION(nnx,1:nz,nys_x:nyn_x,pdims(1)) ::  ar
    976        REAL, DIMENSION(:,:,:,:), ALLOCATABLE          ::  tri
     987       INTEGER(iwp) ::  i                   !:
     988       INTEGER(iwp) ::  j                   !:
     989       INTEGER(iwp) ::  k                   !:
     990       INTEGER(iwp) ::  m                   !:
     991       INTEGER(iwp) ::  n                   !:
     992       INTEGER(iwp) ::  omp_get_thread_num  !:
     993       INTEGER(iwp) ::  tn                  !:
     994
     995       REAL(wp), DIMENSION(0:nx)                          ::  work_fftx  !:
     996       REAL(wp), DIMENSION(0:nx,1:nz)                     ::  work_trix  !:
     997       REAL(wp), DIMENSION(nnx,1:nz,nys_x:nyn_x,pdims(1)) ::  ar         !:
     998       REAL(wp), DIMENSION(:,:,:,:), ALLOCATABLE          ::  tri        !:
    977999
    9781000
     
    10911113!------------------------------------------------------------------------------!
    10921114
    1093        USE control_parameters
    1094        USE cpulog
    1095        USE indices
     1115       USE control_parameters,                                                 &
     1116           ONLY:  host
     1117
     1118       USE cpulog,                                                             &
     1119           ONLY:  cpu_log, log_point_s
     1120
     1121       USE kinds
     1122
    10961123       USE pegrid
    1097        USE transpose_indices
    10981124
    10991125       IMPLICIT NONE
    11001126
    1101        INTEGER            ::  i, j, k
    1102 
    1103        REAL, DIMENSION(0:nx,1:nz,nys:nyn)             ::  work_fftx
    1104        REAL, DIMENSION(1:nz,nys:nyn,0:nx)             ::  f_in
    1105        REAL, DIMENSION(nny,1:nz,nxl_y:nxr_y,pdims(2)) ::  f_out
    1106        REAL, DIMENSION(nys:nyn,1:nz,0:nx)             ::  work
     1127       INTEGER(iwp) ::  i  !:
     1128       INTEGER(iwp) ::  j  !:
     1129       INTEGER(iwp) ::  k  !:
     1130
     1131       REAL(wp), DIMENSION(0:nx,1:nz,nys:nyn)             ::  work_fftx  !:
     1132       REAL(wp), DIMENSION(1:nz,nys:nyn,0:nx)             ::  f_in       !:
     1133       REAL(wp), DIMENSION(nny,1:nz,nxl_y:nxr_y,pdims(2)) ::  f_out      !:
     1134       REAL(wp), DIMENSION(nys:nyn,1:nz,0:nx)             ::  work       !:
    11071135
    11081136!
     
    11961224!------------------------------------------------------------------------------!
    11971225
    1198        USE control_parameters
    1199        USE cpulog
    1200        USE indices
     1226       USE control_parameters,                                                 &
     1227           ONLY:  host
     1228
     1229       USE cpulog,                                                             &
     1230           ONLY:  cpu_log, log_point_s
     1231
     1232       USE kinds
     1233
    12011234       USE pegrid
    1202        USE transpose_indices
    12031235
    12041236       IMPLICIT NONE
    12051237
    1206        INTEGER            ::  i, j, k
    1207 
    1208        REAL, DIMENSION(0:nx,1:nz,nys:nyn)             ::  work_fftx
    1209        REAL, DIMENSION(nny,1:nz,nxl_y:nxr_y,pdims(2)) ::  f_in
    1210        REAL, DIMENSION(1:nz,nys:nyn,0:nx)             ::  f_out
    1211        REAL, DIMENSION(nys:nyn,1:nz,0:nx)             ::  work
     1238       INTEGER(iwp) ::  i  !:
     1239       INTEGER(iwp) ::  j  !:
     1240       INTEGER(iwp) ::  k  !:
     1241
     1242       REAL(wp), DIMENSION(0:nx,1:nz,nys:nyn)             ::  work_fftx  !:
     1243       REAL(wp), DIMENSION(nny,1:nz,nxl_y:nxr_y,pdims(2)) ::  f_in       !:
     1244       REAL(wp), DIMENSION(1:nz,nys:nyn,0:nx)             ::  f_out      !:
     1245       REAL(wp), DIMENSION(nys:nyn,1:nz,0:nx)             ::  work       !:
    12121246
    12131247!
     
    13011335!------------------------------------------------------------------------------!
    13021336
    1303        USE control_parameters
    1304        USE cpulog
    1305        USE grid_variables
    1306        USE indices
     1337       USE control_parameters,                                                 &
     1338           ONLY:  host
     1339
     1340       USE cpulog,                                                             &
     1341           ONLY:  cpu_log, log_point_s
     1342
     1343       USE grid_variables,                                                     &
     1344           ONLY:  ddx2, ddy2
     1345
     1346       USE kinds
     1347
    13071348       USE pegrid
    1308        USE transpose_indices
    13091349
    13101350       IMPLICIT NONE
    13111351
    1312        INTEGER ::  i, j, k, m, n, omp_get_thread_num, tn
    1313 
    1314        REAL, DIMENSION(0:ny)                          ::  work_ffty
    1315        REAL, DIMENSION(0:ny,1:nz)                     ::  work_triy
    1316        REAL, DIMENSION(nny,1:nz,nxl_y:nxr_y,pdims(2)) ::  ar
    1317        REAL, DIMENSION(:,:,:,:), ALLOCATABLE          ::  tri
     1352       INTEGER(iwp) ::  i                   !:
     1353       INTEGER(iwp) ::  j                   !:
     1354       INTEGER(iwp) ::  k                   !:
     1355       INTEGER(iwp) ::  m                   !:
     1356       INTEGER(iwp) ::  n                   !:
     1357       INTEGER(iwp) ::  omp_get_thread_num  !:
     1358       INTEGER(iwp) ::  tn                  !:
     1359
     1360       REAL(wp), DIMENSION(0:ny)                          ::  work_ffty  !:
     1361       REAL(wp), DIMENSION(0:ny,1:nz)                     ::  work_triy  !:
     1362       REAL(wp), DIMENSION(nny,1:nz,nxl_y:nxr_y,pdims(2)) ::  ar         !:
     1363       REAL(wp), DIMENSION(:,:,:,:), ALLOCATABLE          ::  tri        !:
    13181364
    13191365
Note: See TracChangeset for help on using the changeset viewer.