Changeset 1320 for palm/trunk/SOURCE/calc_spectra.f90
- Timestamp:
- Mar 20, 2014 8:40:49 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/calc_spectra.f90
r1319 r1320 20 20 ! Current revisions: 21 21 ! ----------------- 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 ! revision history before 2012 removed, 26 ! comment fields (!:) to be used for variable explanations added to 27 ! all variable declaration statements 23 28 ! 24 29 ! Former revisions: … … 41 46 ! 1003 2012-09-14 14:35:53Z raasch 42 47 ! adjustment of array tend for cases with unequal subdomain sizes removed 43 !44 ! 707 2011-03-29 11:39:40Z raasch45 ! bc_lr/ns replaced by bc_lr/ns_cyc46 !47 ! 667 2010-12-23 12:06:00Z suehring/gryschka48 ! nxl-1, nxr+1, nys-1, nyn+1 replaced by nxlg, nxrg, nysg, nyng for allocation49 ! of tend50 !51 ! 274 2009-03-26 15:11:21Z heinze52 ! Output of messages replaced by message handling routine53 !54 ! 225 2009-01-26 14:44:20Z raasch55 ! Bugfix: array d is reallocated in case that multigrid is used56 !57 ! 192 2008-08-27 16:51:49Z letzel58 ! bugfix in calc_spectra_x: exponent = 1.0 / ( ny + 1.0 )59 ! allow 100 spectra levels instead of 10 for consistency with60 ! define_netcdf_header61 ! user-defined spectra, arguments removed from transpose routines62 !63 ! February 200764 ! RCS Log replace by Id keyword, revision history cleaned up65 !66 ! Revision 1.9 2006/04/11 14:56:00 raasch67 ! pl_spectra renamed data_output_sp68 48 ! 69 49 ! Revision 1.1 2001/01/05 15:08:07 raasch … … 81 61 82 62 #if defined( __spectra ) 83 USE arrays_3d 84 USE control_parameters 85 USE cpulog 86 USE fft_xy 87 USE indices 63 USE arrays_3d, & 64 ONLY: d, tend 65 66 USE control_parameters, & 67 ONLY: average_count_sp, bc_lr_cyc, bc_ns_cyc, message_string, psolver 68 69 USE cpulog, & 70 ONLY: cpu_log, log_point 71 72 USE fft_xy, & 73 ONLY: fft_init 74 75 USE indices, & 76 ONLY: nxl, nxr, nyn, nys, nzb, nzt, nzt_x, nzt_yd 77 78 USE kinds 79 88 80 USE pegrid 89 USE spectrum 81 82 USE spectrum, & 83 ONLY: data_output_sp, spectra_direction 84 90 85 91 86 IMPLICIT NONE 92 87 93 INTEGER :: m, pr 88 INTEGER(iwp) :: m !: 89 INTEGER(iwp) :: pr !: 94 90 95 91 … … 163 159 CALL calc_spectra_y( d, pr, m ) 164 160 #else 165 message_string = 'sorry, calculation of spectra in non parallel' // &161 message_string = 'sorry, calculation of spectra in non parallel' // & 166 162 'mode& is still not realized' 167 163 CALL message( 'calc_spectra', 'PA0161', 1, 2, 0, 6, 0 ) … … 189 185 SUBROUTINE preprocess_spectra( m, pr ) 190 186 191 USE arrays_3d 192 USE indices 187 USE arrays_3d, & 188 ONLY: d, pt, q, u, v, w 189 190 USE indices, & 191 ONLY: nxl, nxr, nyn, nys, nzb, nzt 192 193 USE kinds 194 193 195 USE pegrid 194 USE spectrum 195 USE statistics 196 197 USE spectrum, & 198 ONLY: data_output_sp 199 200 USE statistics, & 201 ONLY: sums 202 196 203 197 204 IMPLICIT NONE 198 205 199 INTEGER :: i, j, k, m, pr 206 INTEGER(iwp) :: i !: 207 INTEGER(iwp) :: j !: 208 INTEGER(iwp) :: k !: 209 INTEGER(iwp) :: m !: 210 INTEGER(iwp) :: pr !: 200 211 201 212 SELECT CASE ( TRIM( data_output_sp(m) ) ) … … 247 258 SUBROUTINE calc_spectra_x( ddd, pr, m ) 248 259 249 USE arrays_3d 250 USE constants 251 USE control_parameters 252 USE fft_xy 253 USE grid_variables 254 USE indices 260 USE arrays_3d, & 261 ONLY: 262 263 USE control_parameters, & 264 ONLY: fft_method 265 266 USE fft_xy, & 267 ONLY: fft_x_1d 268 269 USE grid_variables, & 270 ONLY: dx 271 272 USE indices, & 273 ONLY: nx, ny, nyn_x, nys_x, nzb_x, nzt_x 274 275 USE kinds 276 255 277 USE pegrid 256 USE spectrum 257 USE statistics 278 279 USE spectrum, & 280 ONLY: comp_spectra_level, n_sp_x 281 282 USE statistics, & 283 ONLY: spectrum_x 284 258 285 USE transpose_indices 259 286 287 260 288 IMPLICIT NONE 261 289 262 INTEGER :: i, ishape(1), j, k, m, n, pr 263 264 REAL :: fac, exponent 265 REAL, DIMENSION(0:nx) :: work 266 REAL, DIMENSION(0:nx/2) :: sums_spectra_l 267 REAL, DIMENSION(0:nx/2,100):: sums_spectra 268 269 REAL, DIMENSION(0:nx,nys_x:nyn_x,nzb_x:nzt_x) :: ddd 290 INTEGER(iwp) :: i !: 291 INTEGER(iwp) :: ishape(1) !: 292 INTEGER(iwp) :: j !: 293 INTEGER(iwp) :: k !: 294 INTEGER(iwp) :: m !: 295 INTEGER(iwp) :: n !: 296 INTEGER(iwp) :: pr !: 297 298 REAL(wp) :: fac !: 299 REAL(wp) :: exponent !: 300 301 REAL(wp), DIMENSION(0:nx) :: work !: 302 303 REAL(wp), DIMENSION(0:nx/2) :: sums_spectra_l !: 304 305 REAL(wp), DIMENSION(0:nx/2,100) :: sums_spectra !: 306 307 REAL(wp), DIMENSION(0:nx,nys_x:nyn_x,nzb_x:nzt_x) :: ddd !: 270 308 271 309 ! … … 320 358 #if defined( __parallel ) 321 359 CALL MPI_BARRIER( comm2d, ierr ) ! Necessary? 322 CALL MPI_REDUCE( sums_spectra_l(0), sums_spectra(0,n), nx/2+1, &360 CALL MPI_REDUCE( sums_spectra_l(0), sums_spectra(0,n), nx/2+1, & 323 361 MPI_REAL, MPI_PROD, 0, comm2d, ierr ) 324 362 #else … … 357 395 SUBROUTINE calc_spectra_y( ddd, pr, m ) 358 396 359 USE arrays_3d 360 USE constants 361 USE control_parameters 362 USE fft_xy 363 USE grid_variables 364 USE indices 397 USE arrays_3d, & 398 ONLY: 399 400 USE control_parameters, & 401 ONLY: fft_method 402 403 USE fft_xy, & 404 ONLY: fft_y_1d 405 406 USE grid_variables, & 407 ONLY: dy 408 409 USE indices, & 410 ONLY: nx, ny, nxl_yd, nxr_yd, nzb_yd, nzt_yd 411 412 USE kinds 413 365 414 USE pegrid 366 USE spectrum 367 USE statistics 415 416 USE spectrum, & 417 ONLY: comp_spectra_level, n_sp_y 418 419 USE statistics, & 420 ONLY: spectrum_y 421 368 422 USE transpose_indices 369 423 424 370 425 IMPLICIT NONE 371 426 372 INTEGER :: i, j, jshape(1), k, m, n, pr 373 374 REAL :: fac, exponent 375 REAL, DIMENSION(0:ny) :: work 376 REAL, DIMENSION(0:ny/2) :: sums_spectra_l 377 REAL, DIMENSION(0:ny/2,100):: sums_spectra 378 379 REAL, DIMENSION(0:ny,nxl_yd:nxr_yd,nzb_yd:nzt_yd) :: ddd 427 INTEGER(iwp) :: i !: 428 INTEGER(iwp) :: j !: 429 INTEGER(iwp) :: jshape(1) !: 430 INTEGER(iwp) :: k !: 431 INTEGER(iwp) :: m !: 432 INTEGER(iwp) :: n !: 433 INTEGER(iwp) :: pr !: 434 435 REAL(wp) :: fac !: 436 REAL(wp) :: exponent !: 437 438 REAL(wp), DIMENSION(0:ny) :: work !: 439 440 REAL(wp), DIMENSION(0:ny/2) :: sums_spectra_l !: 441 442 REAL(wp), DIMENSION(0:ny/2,100) :: sums_spectra !: 443 444 REAL(wp), DIMENSION(0:ny,nxl_yd:nxr_yd,nzb_yd:nzt_yd) :: ddd !: 380 445 381 446 … … 431 496 #if defined( __parallel ) 432 497 CALL MPI_BARRIER( comm2d, ierr ) ! Necessary? 433 CALL MPI_REDUCE( sums_spectra_l(0), sums_spectra(0,n), ny/2+1, &498 CALL MPI_REDUCE( sums_spectra_l(0), sums_spectra(0,n), ny/2+1, & 434 499 MPI_REAL, MPI_PROD, 0, comm2d, ierr ) 435 500 #else
Note: See TracChangeset
for help on using the changeset viewer.