[1833] | 1 | !> @file spectra_mod.f90 |
---|
[2000] | 2 | !------------------------------------------------------------------------------! |
---|
[1036] | 3 | ! This file is part of PALM. |
---|
| 4 | ! |
---|
[2000] | 5 | ! PALM is free software: you can redistribute it and/or modify it under the |
---|
| 6 | ! terms of the GNU General Public License as published by the Free Software |
---|
| 7 | ! Foundation, either version 3 of the License, or (at your option) any later |
---|
| 8 | ! version. |
---|
[1036] | 9 | ! |
---|
| 10 | ! PALM is distributed in the hope that it will be useful, but WITHOUT ANY |
---|
| 11 | ! WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR |
---|
| 12 | ! A PARTICULAR PURPOSE. See the GNU General Public License for more details. |
---|
| 13 | ! |
---|
| 14 | ! You should have received a copy of the GNU General Public License along with |
---|
| 15 | ! PALM. If not, see <http://www.gnu.org/licenses/>. |
---|
| 16 | ! |
---|
[2101] | 17 | ! Copyright 1997-2017 Leibniz Universitaet Hannover |
---|
[2000] | 18 | !------------------------------------------------------------------------------! |
---|
[1036] | 19 | ! |
---|
[247] | 20 | ! Current revisions: |
---|
[1] | 21 | ! ----------------- |
---|
[2216] | 22 | ! |
---|
| 23 | ! |
---|
[1787] | 24 | ! Former revisions: |
---|
| 25 | ! ----------------- |
---|
| 26 | ! $Id: spectra_mod.f90 2216 2017-04-28 12:54:20Z sward $ |
---|
| 27 | ! |
---|
[2216] | 28 | ! 2193 2017-03-22 04:21:28Z raasch |
---|
| 29 | ! Normalization of spectra output adjusted |
---|
| 30 | ! |
---|
[2193] | 31 | ! 2192 2017-03-22 04:14:10Z raasch |
---|
| 32 | ! bugfix for index bounds of arrays spectrum_x and spectrum_y |
---|
| 33 | ! |
---|
[2001] | 34 | ! 2000 2016-08-20 18:09:15Z knoop |
---|
| 35 | ! Forced header and separation lines into 80 columns |
---|
| 36 | ! |
---|
[1961] | 37 | ! 1960 2016-07-12 16:34:24Z suehring |
---|
| 38 | ! Additional default spectra for passive scalar |
---|
| 39 | ! |
---|
[1834] | 40 | ! 1833 2016-04-07 14:23:03Z raasch |
---|
| 41 | ! file renamed, reading the spectra_par NAMELIST moved from package_parin to |
---|
| 42 | ! here |
---|
| 43 | ! |
---|
[1816] | 44 | ! 1815 2016-04-06 13:49:59Z raasch |
---|
| 45 | ! bugfix: preprocessor directives included for the non-parallel case |
---|
| 46 | ! |
---|
[1809] | 47 | ! 1808 2016-04-05 19:44:00Z raasch |
---|
| 48 | ! MPI module used by default on all machines |
---|
| 49 | ! |
---|
[1787] | 50 | ! 1786 2016-03-08 05:49:27Z raasch |
---|
[1786] | 51 | ! routine is modularized, filename renamed from calc_spectra to spectrum, |
---|
| 52 | ! privious data module spectrum moved from modules.f90 to here, |
---|
| 53 | ! cpp-direktives for spectra removed, immediate return if no spectra levels are |
---|
| 54 | ! given |
---|
[1321] | 55 | ! |
---|
[1683] | 56 | ! 1682 2015-10-07 23:56:08Z knoop |
---|
| 57 | ! Code annotations made doxygen readable |
---|
| 58 | ! |
---|
[1576] | 59 | ! 1575 2015-03-27 09:56:27Z raasch |
---|
| 60 | ! adjustments for psolver-queries |
---|
| 61 | ! |
---|
[1512] | 62 | ! 1511 2014-12-16 15:54:16Z suehring |
---|
| 63 | ! Bugfix concerning spectra normalization |
---|
| 64 | ! |
---|
[1432] | 65 | ! 1431 2014-07-15 14:47:17Z suehring |
---|
| 66 | ! Wavenumber-integrated spectra coincide with respective variance. |
---|
| 67 | ! |
---|
[1343] | 68 | ! 1342 2014-03-26 17:04:47Z kanani |
---|
| 69 | ! REAL constants defined as wp-kinds |
---|
| 70 | ! |
---|
[1325] | 71 | ! 1324 2014-03-21 09:13:16Z suehring |
---|
| 72 | ! Bugfix: nzb_x, nzb_yd, nyn_x, nyn_x, nzt_x, nzt_yd belong to transpose_indices |
---|
| 73 | ! |
---|
[1321] | 74 | ! 1320 2014-03-20 08:40:49Z raasch |
---|
[1320] | 75 | ! ONLY-attribute added to USE-statements, |
---|
| 76 | ! kind-parameters added to all INTEGER and REAL declaration statements, |
---|
| 77 | ! kinds are defined in new module kinds, |
---|
| 78 | ! revision history before 2012 removed, |
---|
| 79 | ! comment fields (!:) to be used for variable explanations added to |
---|
| 80 | ! all variable declaration statements |
---|
[198] | 81 | ! |
---|
[1319] | 82 | ! 1318 2014-03-17 13:35:16Z raasch |
---|
| 83 | ! module interfaces removed |
---|
| 84 | ! |
---|
[1217] | 85 | ! 1216 2013-08-26 09:31:42Z raasch |
---|
| 86 | ! resorting of array moved to separate routine resort_for_zx, |
---|
| 87 | ! one argument removed from the transpose_..d routines |
---|
| 88 | ! |
---|
[1121] | 89 | ! 1120 2013-04-05 15:11:35Z raasch |
---|
| 90 | ! bugfix: calls of fft_x|y replaced by fft_x|y_1d |
---|
| 91 | ! |
---|
[1037] | 92 | ! 1036 2012-10-22 13:43:42Z raasch |
---|
| 93 | ! code put under GPL (PALM 3.9) |
---|
| 94 | ! |
---|
[1004] | 95 | ! 1003 2012-09-14 14:35:53Z raasch |
---|
| 96 | ! adjustment of array tend for cases with unequal subdomain sizes removed |
---|
| 97 | ! |
---|
[1] | 98 | ! Revision 1.1 2001/01/05 15:08:07 raasch |
---|
| 99 | ! Initial revision |
---|
| 100 | ! |
---|
| 101 | ! |
---|
| 102 | ! Description: |
---|
| 103 | ! ------------ |
---|
[1682] | 104 | !> Calculate horizontal spectra along x and y. |
---|
| 105 | !> ATTENTION: 1d-decomposition along y still needs improvement, because in that |
---|
| 106 | !> case the gridpoint number along z still depends on the PE number |
---|
| 107 | !> because transpose_xz has to be used (and possibly also |
---|
| 108 | !> transpose_zyd needs modification). |
---|
[1] | 109 | !------------------------------------------------------------------------------! |
---|
[1833] | 110 | MODULE spectra_mod |
---|
[1] | 111 | |
---|
[1786] | 112 | USE kinds |
---|
[1320] | 113 | |
---|
[1786] | 114 | PRIVATE |
---|
[1320] | 115 | |
---|
[1833] | 116 | CHARACTER (LEN=2), DIMENSION(10) :: spectra_direction = 'x' |
---|
| 117 | CHARACTER (LEN=10), DIMENSION(10) :: data_output_sp = ' ' |
---|
[1320] | 118 | |
---|
[1833] | 119 | INTEGER(iwp) :: average_count_sp = 0 |
---|
| 120 | INTEGER(iwp) :: dosp_time_count = 0 |
---|
| 121 | INTEGER(iwp) :: n_sp_x = 0, n_sp_y = 0 |
---|
[1320] | 122 | |
---|
[1833] | 123 | INTEGER(iwp) :: comp_spectra_level(100) = 999999 |
---|
[1320] | 124 | |
---|
[1833] | 125 | LOGICAL :: calculate_spectra = .FALSE. !< internal switch that spectra are calculated |
---|
| 126 | LOGICAL :: spectra_initialized = .FALSE. !< internal switch that spectra related quantities are initialized |
---|
[1320] | 127 | |
---|
[1833] | 128 | REAL(wp) :: averaging_interval_sp = 9999999.9_wp !< averaging interval for spectra output |
---|
| 129 | REAL(wp) :: dt_dosp = 9999999.9_wp !< time interval for spectra output |
---|
| 130 | REAL(wp) :: skip_time_dosp = 9999999.9_wp !< no output of spectra data before this interval has passed |
---|
[1] | 131 | |
---|
[1833] | 132 | REAL(wp), DIMENSION(:), ALLOCATABLE :: var_d |
---|
| 133 | |
---|
| 134 | REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: spectrum_x, spectrum_y |
---|
| 135 | |
---|
[1786] | 136 | SAVE |
---|
[1320] | 137 | |
---|
[1786] | 138 | INTERFACE calc_spectra |
---|
| 139 | MODULE PROCEDURE calc_spectra |
---|
| 140 | END INTERFACE calc_spectra |
---|
[1320] | 141 | |
---|
[1786] | 142 | INTERFACE preprocess_spectra |
---|
| 143 | MODULE PROCEDURE preprocess_spectra |
---|
| 144 | END INTERFACE preprocess_spectra |
---|
[1] | 145 | |
---|
[1786] | 146 | INTERFACE calc_spectra_x |
---|
| 147 | MODULE PROCEDURE calc_spectra_x |
---|
| 148 | END INTERFACE calc_spectra_x |
---|
[1] | 149 | |
---|
[1786] | 150 | INTERFACE calc_spectra_y |
---|
| 151 | MODULE PROCEDURE calc_spectra_y |
---|
| 152 | END INTERFACE calc_spectra_y |
---|
[1] | 153 | |
---|
[1833] | 154 | INTERFACE spectra_check_parameters |
---|
| 155 | MODULE PROCEDURE spectra_check_parameters |
---|
| 156 | END INTERFACE spectra_check_parameters |
---|
[1] | 157 | |
---|
[1833] | 158 | INTERFACE spectra_header |
---|
| 159 | MODULE PROCEDURE spectra_header |
---|
| 160 | END INTERFACE spectra_header |
---|
[1786] | 161 | |
---|
[1833] | 162 | INTERFACE spectra_init |
---|
| 163 | MODULE PROCEDURE spectra_init |
---|
| 164 | END INTERFACE spectra_init |
---|
| 165 | |
---|
| 166 | INTERFACE spectra_parin |
---|
| 167 | MODULE PROCEDURE spectra_parin |
---|
| 168 | END INTERFACE spectra_parin |
---|
| 169 | |
---|
| 170 | PUBLIC average_count_sp, averaging_interval_sp, calc_spectra, & |
---|
| 171 | calculate_spectra, comp_spectra_level, data_output_sp, & |
---|
| 172 | dosp_time_count, dt_dosp, n_sp_x, n_sp_y, plot_spectra_level, & |
---|
| 173 | skip_time_dosp, spectra_check_parameters, spectra_direction, & |
---|
| 174 | spectra_header, spectra_init, spectra_parin, spectrum_x, & |
---|
| 175 | spectrum_y, var_d |
---|
| 176 | |
---|
| 177 | |
---|
[1786] | 178 | CONTAINS |
---|
| 179 | |
---|
[1833] | 180 | !------------------------------------------------------------------------------! |
---|
| 181 | ! Description: |
---|
| 182 | ! ------------ |
---|
| 183 | !> Parin for &spectra_par for calculating spectra |
---|
| 184 | !------------------------------------------------------------------------------! |
---|
| 185 | SUBROUTINE spectra_parin |
---|
| 186 | |
---|
| 187 | USE control_parameters, & |
---|
| 188 | ONLY: dt_data_output |
---|
| 189 | |
---|
| 190 | IMPLICIT NONE |
---|
| 191 | |
---|
| 192 | CHARACTER (LEN=80) :: line !< dummy string that contains the current & |
---|
| 193 | !< line of the parameter file |
---|
| 194 | |
---|
| 195 | NAMELIST /spectra_par/ averaging_interval_sp, comp_spectra_level, & |
---|
| 196 | data_output_sp, dt_dosp, skip_time_dosp, & |
---|
| 197 | spectra_direction |
---|
| 198 | |
---|
| 199 | |
---|
| 200 | ! |
---|
| 201 | !-- Position the namelist-file at the beginning (it was already opened in |
---|
| 202 | !-- parin), search for the namelist-group of the package and position the |
---|
| 203 | !-- file at this line. |
---|
| 204 | line = ' ' |
---|
| 205 | |
---|
| 206 | ! |
---|
| 207 | !-- Try to find the spectra package |
---|
| 208 | REWIND ( 11 ) |
---|
| 209 | line = ' ' |
---|
| 210 | DO WHILE ( INDEX( line, '&spectra_par' ) == 0 ) |
---|
| 211 | READ ( 11, '(A)', END=10 ) line |
---|
| 212 | ENDDO |
---|
| 213 | BACKSPACE ( 11 ) |
---|
| 214 | |
---|
| 215 | ! |
---|
| 216 | !-- Read namelist |
---|
| 217 | READ ( 11, spectra_par ) |
---|
| 218 | |
---|
| 219 | ! |
---|
| 220 | !-- Default setting of dt_dosp here (instead of check_parameters), because |
---|
| 221 | !-- its current value is needed in init_pegrid |
---|
| 222 | IF ( dt_dosp == 9999999.9_wp ) dt_dosp = dt_data_output |
---|
| 223 | |
---|
| 224 | ! |
---|
| 225 | !-- Set general switch that spectra shall be calculated |
---|
| 226 | calculate_spectra = .TRUE. |
---|
| 227 | |
---|
| 228 | 10 CONTINUE |
---|
| 229 | |
---|
| 230 | END SUBROUTINE spectra_parin |
---|
| 231 | |
---|
| 232 | |
---|
| 233 | |
---|
| 234 | !------------------------------------------------------------------------------! |
---|
| 235 | ! Description: |
---|
| 236 | ! ------------ |
---|
| 237 | !> Initialization of spectra related variables |
---|
| 238 | !------------------------------------------------------------------------------! |
---|
| 239 | SUBROUTINE spectra_init |
---|
| 240 | |
---|
| 241 | USE indices, & |
---|
| 242 | ONLY: nx, ny, nzb, nzt |
---|
| 243 | |
---|
| 244 | IMPLICIT NONE |
---|
| 245 | |
---|
| 246 | IF ( spectra_initialized ) RETURN |
---|
| 247 | |
---|
| 248 | IF ( dt_dosp /= 9999999.9_wp ) THEN |
---|
[2192] | 249 | ALLOCATE( spectrum_x( 1:nx/2, 1:100, 1:10 ), & |
---|
| 250 | spectrum_y( 1:ny/2, 1:100, 1:10 ) ) |
---|
[1833] | 251 | spectrum_x = 0.0_wp |
---|
| 252 | spectrum_y = 0.0_wp |
---|
| 253 | |
---|
| 254 | ALLOCATE( var_d(nzb:nzt+1) ) |
---|
| 255 | var_d = 0.0_wp |
---|
| 256 | ENDIF |
---|
| 257 | |
---|
| 258 | spectra_initialized = .TRUE. |
---|
| 259 | |
---|
| 260 | END SUBROUTINE spectra_init |
---|
| 261 | |
---|
| 262 | |
---|
| 263 | |
---|
| 264 | !------------------------------------------------------------------------------! |
---|
| 265 | ! Description: |
---|
| 266 | ! ------------ |
---|
| 267 | !> Check spectra related quantities |
---|
| 268 | !------------------------------------------------------------------------------! |
---|
| 269 | SUBROUTINE spectra_check_parameters |
---|
| 270 | |
---|
| 271 | USE control_parameters, & |
---|
| 272 | ONLY: averaging_interval, message_string, skip_time_data_output |
---|
| 273 | |
---|
| 274 | IMPLICIT NONE |
---|
| 275 | |
---|
| 276 | ! |
---|
| 277 | !-- Check the average interval |
---|
| 278 | IF ( averaging_interval_sp == 9999999.9_wp ) THEN |
---|
| 279 | averaging_interval_sp = averaging_interval |
---|
| 280 | ENDIF |
---|
| 281 | |
---|
| 282 | IF ( averaging_interval_sp > dt_dosp ) THEN |
---|
| 283 | WRITE( message_string, * ) 'averaging_interval_sp = ', & |
---|
| 284 | averaging_interval_sp, ' must be <= dt_dosp = ', dt_dosp |
---|
| 285 | CALL message( 'spectra_check_parameters', 'PA0087', 1, 2, 0, 6, 0 ) |
---|
| 286 | ENDIF |
---|
| 287 | |
---|
| 288 | ! |
---|
| 289 | !-- Set the default skip time interval for data output, if necessary |
---|
| 290 | IF ( skip_time_dosp == 9999999.9_wp ) & |
---|
| 291 | skip_time_dosp = skip_time_data_output |
---|
| 292 | |
---|
| 293 | END SUBROUTINE spectra_check_parameters |
---|
| 294 | |
---|
| 295 | |
---|
| 296 | |
---|
| 297 | !------------------------------------------------------------------------------! |
---|
| 298 | ! Description: |
---|
| 299 | ! ------------ |
---|
| 300 | !> Header output for spectra |
---|
| 301 | !> |
---|
| 302 | !> @todo Output of netcdf data format and compression level |
---|
| 303 | !------------------------------------------------------------------------------! |
---|
| 304 | SUBROUTINE spectra_header ( io ) |
---|
| 305 | |
---|
| 306 | USE control_parameters, & |
---|
| 307 | ONLY: dt_averaging_input_pr |
---|
| 308 | |
---|
| 309 | ! USE netcdf_interface, & |
---|
| 310 | ! ONLY: netcdf_data_format_string, netcdf_deflate |
---|
| 311 | |
---|
| 312 | IMPLICIT NONE |
---|
| 313 | |
---|
| 314 | CHARACTER (LEN=40) :: output_format !< internal string |
---|
| 315 | |
---|
| 316 | INTEGER(iwp) :: i !< internal counter |
---|
| 317 | INTEGER(iwp), INTENT(IN) :: io !< Unit of the output file |
---|
| 318 | |
---|
| 319 | ! |
---|
| 320 | !-- Spectra output |
---|
| 321 | IF ( dt_dosp /= 9999999.9_wp ) THEN |
---|
| 322 | WRITE ( io, 1 ) |
---|
| 323 | |
---|
| 324 | ! output_format = netcdf_data_format_string |
---|
| 325 | ! IF ( netcdf_deflate == 0 ) THEN |
---|
| 326 | ! WRITE ( io, 2 ) output_format |
---|
| 327 | ! ELSE |
---|
| 328 | ! WRITE ( io, 3 ) TRIM( output_format ), netcdf_deflate |
---|
| 329 | ! ENDIF |
---|
| 330 | WRITE ( io, 2 ) 'see profiles or other quantities' |
---|
| 331 | WRITE ( io, 4 ) dt_dosp |
---|
| 332 | IF ( skip_time_dosp /= 0.0_wp ) WRITE ( io, 5 ) skip_time_dosp |
---|
| 333 | WRITE ( io, 6 ) ( data_output_sp(i), i = 1,10 ), & |
---|
| 334 | ( spectra_direction(i), i = 1,10 ), & |
---|
| 335 | ( comp_spectra_level(i), i = 1,100 ), & |
---|
| 336 | averaging_interval_sp, dt_averaging_input_pr |
---|
| 337 | ENDIF |
---|
| 338 | |
---|
| 339 | 1 FORMAT (' Spectra:') |
---|
| 340 | 2 FORMAT (' Output format: ',A/) |
---|
| 341 | 3 FORMAT (' Output format: ',A, ' compressed with level: ',I1/) |
---|
| 342 | 4 FORMAT (' Output every ',F7.1,' s'/) |
---|
| 343 | 5 FORMAT (' No output during initial ',F8.2,' s') |
---|
| 344 | 6 FORMAT (' Arrays: ', 10(A5,',')/ & |
---|
| 345 | ' Directions: ', 10(A5,',')/ & |
---|
| 346 | ' height levels k = ', 20(I3,',')/ & |
---|
| 347 | ' ', 20(I3,',')/ & |
---|
| 348 | ' ', 20(I3,',')/ & |
---|
| 349 | ' ', 20(I3,',')/ & |
---|
| 350 | ' ', 19(I3,','),I3,'.'/ & |
---|
| 351 | ' Time averaged over ', F7.1, ' s,' / & |
---|
| 352 | ' Profiles for the time averaging are taken every ', & |
---|
| 353 | F6.1,' s') |
---|
| 354 | |
---|
| 355 | END SUBROUTINE spectra_header |
---|
| 356 | |
---|
| 357 | |
---|
| 358 | |
---|
[1786] | 359 | SUBROUTINE calc_spectra |
---|
| 360 | |
---|
| 361 | USE arrays_3d, & |
---|
| 362 | ONLY: d, tend |
---|
| 363 | |
---|
| 364 | USE control_parameters, & |
---|
[1833] | 365 | ONLY: bc_lr_cyc, bc_ns_cyc, message_string, psolver |
---|
[1786] | 366 | |
---|
| 367 | USE cpulog, & |
---|
| 368 | ONLY: cpu_log, log_point |
---|
| 369 | |
---|
| 370 | USE fft_xy, & |
---|
| 371 | ONLY: fft_init |
---|
| 372 | |
---|
| 373 | USE indices, & |
---|
| 374 | ONLY: nxl, nxr, nyn, nys, nzb, nzt |
---|
| 375 | |
---|
| 376 | USE kinds |
---|
| 377 | |
---|
| 378 | USE pegrid, & |
---|
| 379 | ONLY: myid, pdims |
---|
| 380 | |
---|
| 381 | IMPLICIT NONE |
---|
| 382 | |
---|
| 383 | INTEGER(iwp) :: m !< |
---|
| 384 | INTEGER(iwp) :: pr !< |
---|
| 385 | |
---|
| 386 | |
---|
[1] | 387 | ! |
---|
[1786] | 388 | !-- Check if user gave any levels for spectra to be calculated |
---|
| 389 | IF ( comp_spectra_level(1) == 999999 ) RETURN |
---|
[1] | 390 | |
---|
[1786] | 391 | CALL cpu_log( log_point(30), 'calc_spectra', 'start' ) |
---|
| 392 | |
---|
[1] | 393 | ! |
---|
[1833] | 394 | !-- Initialize spectra related quantities |
---|
| 395 | CALL spectra_init |
---|
| 396 | |
---|
| 397 | ! |
---|
[1786] | 398 | !-- Initialize ffts |
---|
| 399 | CALL fft_init |
---|
[225] | 400 | |
---|
[1] | 401 | ! |
---|
[1786] | 402 | !-- Reallocate array d in required size |
---|
| 403 | IF ( psolver(1:9) == 'multigrid' ) THEN |
---|
| 404 | DEALLOCATE( d ) |
---|
| 405 | ALLOCATE( d(nzb+1:nzt,nys:nyn,nxl:nxr) ) |
---|
| 406 | ENDIF |
---|
[1] | 407 | |
---|
[1786] | 408 | m = 1 |
---|
| 409 | DO WHILE ( data_output_sp(m) /= ' ' .AND. m <= 10 ) |
---|
[1] | 410 | ! |
---|
[1786] | 411 | !-- Transposition from z --> x ( y --> x in case of a 1d-decomposition |
---|
| 412 | !-- along x) |
---|
| 413 | IF ( INDEX( spectra_direction(m), 'x' ) /= 0 ) THEN |
---|
[247] | 414 | |
---|
[1786] | 415 | ! |
---|
| 416 | !-- Calculation of spectra works for cyclic boundary conditions only |
---|
| 417 | IF ( .NOT. bc_lr_cyc ) THEN |
---|
[1] | 418 | |
---|
[1786] | 419 | message_string = 'non-cyclic lateral boundaries along x do'// & |
---|
| 420 | ' not & allow calculation of spectra along x' |
---|
| 421 | CALL message( 'calc_spectra', 'PA0160', 1, 2, 0, 6, 0 ) |
---|
| 422 | ENDIF |
---|
[1] | 423 | |
---|
[1786] | 424 | CALL preprocess_spectra( m, pr ) |
---|
| 425 | |
---|
[1] | 426 | #if defined( __parallel ) |
---|
[1786] | 427 | IF ( pdims(2) /= 1 ) THEN |
---|
| 428 | CALL resort_for_zx( d, tend ) |
---|
| 429 | CALL transpose_zx( tend, d ) |
---|
| 430 | ELSE |
---|
| 431 | CALL transpose_yxd( d, d ) |
---|
| 432 | ENDIF |
---|
| 433 | CALL calc_spectra_x( d, pr, m ) |
---|
[1] | 434 | #else |
---|
[1786] | 435 | message_string = 'sorry, calculation of spectra in non paral' // & |
---|
| 436 | 'lel mode& is still not realized' |
---|
| 437 | CALL message( 'calc_spectra', 'PA0161', 1, 2, 0, 6, 0 ) |
---|
[1] | 438 | #endif |
---|
| 439 | |
---|
[1786] | 440 | ENDIF |
---|
[1] | 441 | |
---|
| 442 | ! |
---|
[1786] | 443 | !-- Transposition from z --> y (d is rearranged only in case of a |
---|
| 444 | !-- 1d-decomposition along x) |
---|
| 445 | IF ( INDEX( spectra_direction(m), 'y' ) /= 0 ) THEN |
---|
[1] | 446 | |
---|
| 447 | ! |
---|
[1786] | 448 | !-- Calculation of spectra works for cyclic boundary conditions only |
---|
| 449 | IF ( .NOT. bc_ns_cyc ) THEN |
---|
| 450 | IF ( myid == 0 ) THEN |
---|
| 451 | message_string = 'non-cyclic lateral boundaries along y' // & |
---|
| 452 | ' do not & allow calculation of spectr' // & |
---|
| 453 | 'a along y' |
---|
| 454 | CALL message( 'calc_spectra', 'PA0162', 1, 2, 0, 6, 0 ) |
---|
| 455 | ENDIF |
---|
| 456 | CALL local_stop |
---|
[1] | 457 | ENDIF |
---|
| 458 | |
---|
[1786] | 459 | CALL preprocess_spectra( m, pr ) |
---|
[1] | 460 | |
---|
| 461 | #if defined( __parallel ) |
---|
[1786] | 462 | CALL transpose_zyd( d, d ) |
---|
| 463 | CALL calc_spectra_y( d, pr, m ) |
---|
[1] | 464 | #else |
---|
[1786] | 465 | message_string = 'sorry, calculation of spectra in non paral' // & |
---|
| 466 | 'lel mode& is still not realized' |
---|
| 467 | CALL message( 'calc_spectra', 'PA0161', 1, 2, 0, 6, 0 ) |
---|
[1] | 468 | #endif |
---|
| 469 | |
---|
[1786] | 470 | ENDIF |
---|
[1] | 471 | |
---|
| 472 | ! |
---|
[1786] | 473 | !-- Increase counter for next spectrum |
---|
| 474 | m = m + 1 |
---|
[1] | 475 | |
---|
[1786] | 476 | ENDDO |
---|
[1] | 477 | |
---|
| 478 | ! |
---|
[1786] | 479 | !-- Increase counter for averaging process in routine plot_spectra |
---|
| 480 | average_count_sp = average_count_sp + 1 |
---|
[1] | 481 | |
---|
[1786] | 482 | CALL cpu_log( log_point(30), 'calc_spectra', 'stop' ) |
---|
[1] | 483 | |
---|
[1786] | 484 | END SUBROUTINE calc_spectra |
---|
[1] | 485 | |
---|
| 486 | |
---|
[1682] | 487 | !------------------------------------------------------------------------------! |
---|
| 488 | ! Description: |
---|
| 489 | ! ------------ |
---|
| 490 | !> @todo Missing subroutine description. |
---|
| 491 | !------------------------------------------------------------------------------! |
---|
[1786] | 492 | SUBROUTINE preprocess_spectra( m, pr ) |
---|
[1] | 493 | |
---|
[1786] | 494 | USE arrays_3d, & |
---|
[1960] | 495 | ONLY: d, pt, q, s, u, v, w |
---|
[1320] | 496 | |
---|
[1786] | 497 | USE indices, & |
---|
| 498 | ONLY: ngp_2dh, nxl, nxr, nyn, nys, nzb, nzt |
---|
[1320] | 499 | |
---|
[1786] | 500 | USE kinds |
---|
[1320] | 501 | |
---|
[1815] | 502 | #if defined( __parallel ) |
---|
[1808] | 503 | #if defined( __mpifh ) |
---|
| 504 | INCLUDE "mpif.h" |
---|
| 505 | #else |
---|
[1786] | 506 | USE MPI |
---|
| 507 | #endif |
---|
[1815] | 508 | #endif |
---|
[1786] | 509 | USE pegrid, & |
---|
| 510 | ONLY: collective_wait, comm2d, ierr |
---|
[1] | 511 | |
---|
[1786] | 512 | USE statistics, & |
---|
[1833] | 513 | ONLY: hom |
---|
[1320] | 514 | |
---|
| 515 | |
---|
[1786] | 516 | IMPLICIT NONE |
---|
[1320] | 517 | |
---|
[1786] | 518 | INTEGER(iwp) :: i !< |
---|
| 519 | INTEGER(iwp) :: j !< |
---|
| 520 | INTEGER(iwp) :: k !< |
---|
| 521 | INTEGER(iwp) :: m !< |
---|
| 522 | INTEGER(iwp) :: pr !< |
---|
[1] | 523 | |
---|
[1786] | 524 | REAL(wp), DIMENSION(nzb:nzt+1) :: var_d_l |
---|
[1] | 525 | |
---|
[1786] | 526 | SELECT CASE ( TRIM( data_output_sp(m) ) ) |
---|
[1] | 527 | |
---|
[1786] | 528 | CASE ( 'u' ) |
---|
| 529 | pr = 1 |
---|
| 530 | d(nzb+1:nzt,nys:nyn,nxl:nxr) = u(nzb+1:nzt,nys:nyn,nxl:nxr) |
---|
[1] | 531 | |
---|
[1786] | 532 | CASE ( 'v' ) |
---|
| 533 | pr = 2 |
---|
| 534 | d(nzb+1:nzt,nys:nyn,nxl:nxr) = v(nzb+1:nzt,nys:nyn,nxl:nxr) |
---|
[1] | 535 | |
---|
[1786] | 536 | CASE ( 'w' ) |
---|
| 537 | pr = 3 |
---|
| 538 | d(nzb+1:nzt,nys:nyn,nxl:nxr) = w(nzb+1:nzt,nys:nyn,nxl:nxr) |
---|
[1] | 539 | |
---|
[1786] | 540 | CASE ( 'pt' ) |
---|
| 541 | pr = 4 |
---|
| 542 | d(nzb+1:nzt,nys:nyn,nxl:nxr) = pt(nzb+1:nzt,nys:nyn,nxl:nxr) |
---|
[1] | 543 | |
---|
[1786] | 544 | CASE ( 'q' ) |
---|
| 545 | pr = 41 |
---|
| 546 | d(nzb+1:nzt,nys:nyn,nxl:nxr) = q(nzb+1:nzt,nys:nyn,nxl:nxr) |
---|
[1960] | 547 | |
---|
| 548 | CASE ( 's' ) |
---|
| 549 | pr = 117 |
---|
| 550 | d(nzb+1:nzt,nys:nyn,nxl:nxr) = s(nzb+1:nzt,nys:nyn,nxl:nxr) |
---|
[1] | 551 | |
---|
[1786] | 552 | CASE DEFAULT |
---|
[144] | 553 | ! |
---|
[1786] | 554 | !-- The DEFAULT case is reached either if the parameter data_output_sp(m) |
---|
| 555 | !-- contains a wrong character string or if the user has coded a special |
---|
| 556 | !-- case in the user interface. There, the subroutine user_spectra |
---|
| 557 | !-- checks which of these two conditions applies. |
---|
| 558 | CALL user_spectra( 'preprocess', m, pr ) |
---|
[1] | 559 | |
---|
[1786] | 560 | END SELECT |
---|
[1] | 561 | |
---|
| 562 | ! |
---|
[1786] | 563 | !-- Subtract horizontal mean from the array, for which spectra have to be |
---|
[2215] | 564 | !-- calculated. Moreover, calculate variance of the respective quantitiy, |
---|
| 565 | !-- later used for normalizing spectra output. |
---|
[1786] | 566 | var_d_l(:) = 0.0_wp |
---|
| 567 | DO i = nxl, nxr |
---|
| 568 | DO j = nys, nyn |
---|
| 569 | DO k = nzb+1, nzt |
---|
| 570 | d(k,j,i) = d(k,j,i) - hom(k,1,pr,0) |
---|
| 571 | var_d_l(k) = var_d_l(k) + d(k,j,i) * d(k,j,i) |
---|
| 572 | ENDDO |
---|
[1] | 573 | ENDDO |
---|
| 574 | ENDDO |
---|
[1431] | 575 | ! |
---|
[1786] | 576 | !-- Compute total variance from local variances |
---|
| 577 | var_d(:) = 0.0_wp |
---|
[1431] | 578 | #if defined( __parallel ) |
---|
[1786] | 579 | IF ( collective_wait ) CALL MPI_BARRIER( comm2d, ierr ) |
---|
| 580 | CALL MPI_ALLREDUCE( var_d_l(0), var_d(0), nzt+1-nzb, MPI_REAL, MPI_SUM, & |
---|
| 581 | comm2d, ierr ) |
---|
[1431] | 582 | #else |
---|
[1786] | 583 | var_d(:) = var_d_l(:) |
---|
[1431] | 584 | #endif |
---|
[1786] | 585 | var_d(:) = var_d(:) / ngp_2dh(0) |
---|
[1] | 586 | |
---|
[1786] | 587 | END SUBROUTINE preprocess_spectra |
---|
[1] | 588 | |
---|
| 589 | |
---|
[1682] | 590 | !------------------------------------------------------------------------------! |
---|
| 591 | ! Description: |
---|
| 592 | ! ------------ |
---|
| 593 | !> @todo Missing subroutine description. |
---|
| 594 | !------------------------------------------------------------------------------! |
---|
[1786] | 595 | SUBROUTINE calc_spectra_x( ddd, pr, m ) |
---|
[1] | 596 | |
---|
[1786] | 597 | USE control_parameters, & |
---|
| 598 | ONLY: fft_method |
---|
[1320] | 599 | |
---|
[1786] | 600 | USE fft_xy, & |
---|
| 601 | ONLY: fft_x_1d |
---|
[1320] | 602 | |
---|
[1786] | 603 | USE grid_variables, & |
---|
| 604 | ONLY: dx |
---|
[1320] | 605 | |
---|
[1786] | 606 | USE indices, & |
---|
| 607 | ONLY: nx, ny |
---|
[1320] | 608 | |
---|
[1786] | 609 | USE kinds |
---|
[1320] | 610 | |
---|
[1816] | 611 | #if defined( __parallel ) |
---|
[1808] | 612 | #if defined( __mpifh ) |
---|
| 613 | INCLUDE "mpif.h" |
---|
| 614 | #else |
---|
[1786] | 615 | USE MPI |
---|
| 616 | #endif |
---|
[1815] | 617 | #endif |
---|
[1786] | 618 | USE pegrid, & |
---|
| 619 | ONLY: comm2d, ierr, myid |
---|
[1320] | 620 | |
---|
[1786] | 621 | USE transpose_indices, & |
---|
| 622 | ONLY: nyn_x, nys_x, nzb_x, nzt_x |
---|
[1320] | 623 | |
---|
| 624 | |
---|
[1786] | 625 | IMPLICIT NONE |
---|
[1] | 626 | |
---|
[1786] | 627 | INTEGER(iwp) :: i !< |
---|
| 628 | INTEGER(iwp) :: ishape(1) !< |
---|
| 629 | INTEGER(iwp) :: j !< |
---|
| 630 | INTEGER(iwp) :: k !< |
---|
| 631 | INTEGER(iwp) :: m !< |
---|
| 632 | INTEGER(iwp) :: n !< |
---|
| 633 | INTEGER(iwp) :: pr !< |
---|
[1320] | 634 | |
---|
[1786] | 635 | REAL(wp) :: exponent !< |
---|
| 636 | REAL(wp) :: sum_spec_dum !< wavenumber-integrated spectrum |
---|
[1320] | 637 | |
---|
[1786] | 638 | REAL(wp), DIMENSION(0:nx) :: work !< |
---|
[1320] | 639 | |
---|
[1786] | 640 | REAL(wp), DIMENSION(0:nx/2) :: sums_spectra_l !< |
---|
[1320] | 641 | |
---|
[1786] | 642 | REAL(wp), DIMENSION(0:nx/2,100) :: sums_spectra !< |
---|
[1320] | 643 | |
---|
[1786] | 644 | REAL(wp), DIMENSION(0:nx,nys_x:nyn_x,nzb_x:nzt_x) :: ddd !< |
---|
[1] | 645 | |
---|
| 646 | ! |
---|
[1786] | 647 | !-- Exponent for geometric average |
---|
| 648 | exponent = 1.0_wp / ( ny + 1.0_wp ) |
---|
[1] | 649 | |
---|
| 650 | ! |
---|
[1786] | 651 | !-- Loop over all levels defined by the user |
---|
| 652 | n = 1 |
---|
| 653 | DO WHILE ( comp_spectra_level(n) /= 999999 .AND. n <= 100 ) |
---|
[1] | 654 | |
---|
[1786] | 655 | k = comp_spectra_level(n) |
---|
[1] | 656 | |
---|
| 657 | ! |
---|
[1786] | 658 | !-- Calculate FFT only if the corresponding level is situated on this PE |
---|
| 659 | IF ( k >= nzb_x .AND. k <= nzt_x ) THEN |
---|
[1] | 660 | |
---|
[1786] | 661 | DO j = nys_x, nyn_x |
---|
[1] | 662 | |
---|
[1786] | 663 | work = ddd(0:nx,j,k) |
---|
| 664 | CALL fft_x_1d( work, 'forward' ) |
---|
[1] | 665 | |
---|
[1786] | 666 | ddd(0,j,k) = dx * work(0)**2 |
---|
| 667 | DO i = 1, nx/2 |
---|
| 668 | ddd(i,j,k) = dx * ( work(i)**2 + work(nx+1-i)**2 ) |
---|
| 669 | ENDDO |
---|
| 670 | |
---|
[1] | 671 | ENDDO |
---|
| 672 | |
---|
| 673 | ! |
---|
[1786] | 674 | !-- Local sum and geometric average of these spectra |
---|
| 675 | !-- (WARNING: no global sum should be performed, because floating |
---|
| 676 | !-- point overflow may occur) |
---|
| 677 | DO i = 0, nx/2 |
---|
[1] | 678 | |
---|
[1786] | 679 | sums_spectra_l(i) = 1.0_wp |
---|
| 680 | DO j = nys_x, nyn_x |
---|
| 681 | sums_spectra_l(i) = sums_spectra_l(i) * ddd(i,j,k)**exponent |
---|
| 682 | ENDDO |
---|
| 683 | |
---|
[1] | 684 | ENDDO |
---|
| 685 | |
---|
[1786] | 686 | ELSE |
---|
[1] | 687 | |
---|
[1786] | 688 | sums_spectra_l = 1.0_wp |
---|
[1] | 689 | |
---|
[1786] | 690 | ENDIF |
---|
[1] | 691 | |
---|
| 692 | ! |
---|
[1786] | 693 | !-- Global sum of spectra on PE0 (from where they are written on file) |
---|
| 694 | sums_spectra(:,n) = 0.0_wp |
---|
[1] | 695 | #if defined( __parallel ) |
---|
[1786] | 696 | CALL MPI_BARRIER( comm2d, ierr ) ! Necessary? |
---|
| 697 | CALL MPI_REDUCE( sums_spectra_l(0), sums_spectra(0,n), nx/2+1, & |
---|
| 698 | MPI_REAL, MPI_PROD, 0, comm2d, ierr ) |
---|
[1] | 699 | #else |
---|
[1786] | 700 | sums_spectra(:,n) = sums_spectra_l |
---|
[1] | 701 | #endif |
---|
[1431] | 702 | ! |
---|
[1786] | 703 | !-- Normalize spectra by variance |
---|
[2215] | 704 | sum_spec_dum = SUM( sums_spectra(1:nx/2,n) ) |
---|
| 705 | |
---|
[1786] | 706 | IF ( sum_spec_dum /= 0.0_wp ) THEN |
---|
[2215] | 707 | sums_spectra(1:nx/2,n) = sums_spectra(1:nx/2,n) * & |
---|
| 708 | var_d(k) / sum_spec_dum |
---|
[1786] | 709 | ENDIF |
---|
| 710 | n = n + 1 |
---|
[1] | 711 | |
---|
[1786] | 712 | ENDDO |
---|
| 713 | n = n - 1 |
---|
[1] | 714 | |
---|
[1786] | 715 | IF ( myid == 0 ) THEN |
---|
[1] | 716 | ! |
---|
[1786] | 717 | !-- Sum of spectra for later averaging (see routine data_output_spectra) |
---|
| 718 | DO i = 1, nx/2 |
---|
| 719 | DO k = 1, n |
---|
| 720 | spectrum_x(i,k,m) = spectrum_x(i,k,m) + sums_spectra(i,k) |
---|
| 721 | ENDDO |
---|
[1] | 722 | ENDDO |
---|
| 723 | |
---|
[1786] | 724 | ENDIF |
---|
[1] | 725 | ! |
---|
[1786] | 726 | !-- n_sp_x is needed by data_output_spectra_x |
---|
| 727 | n_sp_x = n |
---|
[1] | 728 | |
---|
[1786] | 729 | END SUBROUTINE calc_spectra_x |
---|
[1] | 730 | |
---|
| 731 | |
---|
[1682] | 732 | !------------------------------------------------------------------------------! |
---|
| 733 | ! Description: |
---|
| 734 | ! ------------ |
---|
| 735 | !> @todo Missing subroutine description. |
---|
| 736 | !------------------------------------------------------------------------------! |
---|
[1786] | 737 | SUBROUTINE calc_spectra_y( ddd, pr, m ) |
---|
[1] | 738 | |
---|
[1786] | 739 | USE control_parameters, & |
---|
| 740 | ONLY: fft_method |
---|
[1320] | 741 | |
---|
[1786] | 742 | USE fft_xy, & |
---|
| 743 | ONLY: fft_y_1d |
---|
[1320] | 744 | |
---|
[1786] | 745 | USE grid_variables, & |
---|
| 746 | ONLY: dy |
---|
[1320] | 747 | |
---|
[1786] | 748 | USE indices, & |
---|
| 749 | ONLY: nx, ny |
---|
[1320] | 750 | |
---|
[1786] | 751 | USE kinds |
---|
[1320] | 752 | |
---|
[1815] | 753 | #if defined( __parallel ) |
---|
[1808] | 754 | #if defined( __mpifh ) |
---|
| 755 | INCLUDE "mpif.h" |
---|
| 756 | #else |
---|
[1786] | 757 | USE MPI |
---|
| 758 | #endif |
---|
[1815] | 759 | #endif |
---|
[1786] | 760 | USE pegrid, & |
---|
| 761 | ONLY: comm2d, ierr, myid |
---|
[1320] | 762 | |
---|
[1786] | 763 | USE transpose_indices, & |
---|
| 764 | ONLY: nxl_yd, nxr_yd, nzb_yd, nzt_yd |
---|
[1320] | 765 | |
---|
| 766 | |
---|
[1786] | 767 | IMPLICIT NONE |
---|
[1] | 768 | |
---|
[1786] | 769 | INTEGER(iwp) :: i !< |
---|
| 770 | INTEGER(iwp) :: j !< |
---|
| 771 | INTEGER(iwp) :: jshape(1) !< |
---|
| 772 | INTEGER(iwp) :: k !< |
---|
| 773 | INTEGER(iwp) :: m !< |
---|
| 774 | INTEGER(iwp) :: n !< |
---|
| 775 | INTEGER(iwp) :: pr !< |
---|
[1320] | 776 | |
---|
[1786] | 777 | REAL(wp) :: exponent !< |
---|
| 778 | REAL(wp) :: sum_spec_dum !< wavenumber-integrated spectrum |
---|
[1320] | 779 | |
---|
[1786] | 780 | REAL(wp), DIMENSION(0:ny) :: work !< |
---|
[1320] | 781 | |
---|
[1786] | 782 | REAL(wp), DIMENSION(0:ny/2) :: sums_spectra_l !< |
---|
[1320] | 783 | |
---|
[1786] | 784 | REAL(wp), DIMENSION(0:ny/2,100) :: sums_spectra !< |
---|
[1320] | 785 | |
---|
[1786] | 786 | REAL(wp), DIMENSION(0:ny,nxl_yd:nxr_yd,nzb_yd:nzt_yd) :: ddd !< |
---|
[1] | 787 | |
---|
| 788 | |
---|
| 789 | ! |
---|
[1786] | 790 | !-- Exponent for geometric average |
---|
| 791 | exponent = 1.0_wp / ( nx + 1.0_wp ) |
---|
[1] | 792 | |
---|
| 793 | ! |
---|
[1786] | 794 | !-- Loop over all levels defined by the user |
---|
| 795 | n = 1 |
---|
| 796 | DO WHILE ( comp_spectra_level(n) /= 999999 .AND. n <= 100 ) |
---|
[1] | 797 | |
---|
[1786] | 798 | k = comp_spectra_level(n) |
---|
[1] | 799 | |
---|
| 800 | ! |
---|
[1786] | 801 | !-- Calculate FFT only if the corresponding level is situated on this PE |
---|
| 802 | IF ( k >= nzb_yd .AND. k <= nzt_yd ) THEN |
---|
[1] | 803 | |
---|
[1786] | 804 | DO i = nxl_yd, nxr_yd |
---|
[1] | 805 | |
---|
[1786] | 806 | work = ddd(0:ny,i,k) |
---|
| 807 | CALL fft_y_1d( work, 'forward' ) |
---|
[1] | 808 | |
---|
[1786] | 809 | ddd(0,i,k) = dy * work(0)**2 |
---|
| 810 | DO j = 1, ny/2 |
---|
| 811 | ddd(j,i,k) = dy * ( work(j)**2 + work(ny+1-j)**2 ) |
---|
| 812 | ENDDO |
---|
| 813 | |
---|
[1] | 814 | ENDDO |
---|
| 815 | |
---|
| 816 | ! |
---|
[1786] | 817 | !-- Local sum and geometric average of these spectra |
---|
| 818 | !-- (WARNING: no global sum should be performed, because floating |
---|
| 819 | !-- point overflow may occur) |
---|
| 820 | DO j = 0, ny/2 |
---|
[1] | 821 | |
---|
[1786] | 822 | sums_spectra_l(j) = 1.0_wp |
---|
| 823 | DO i = nxl_yd, nxr_yd |
---|
| 824 | sums_spectra_l(j) = sums_spectra_l(j) * ddd(j,i,k)**exponent |
---|
| 825 | ENDDO |
---|
| 826 | |
---|
[1] | 827 | ENDDO |
---|
| 828 | |
---|
[1786] | 829 | ELSE |
---|
[1] | 830 | |
---|
[1786] | 831 | sums_spectra_l = 1.0_wp |
---|
[1] | 832 | |
---|
[1786] | 833 | ENDIF |
---|
[1] | 834 | |
---|
| 835 | ! |
---|
[1786] | 836 | !-- Global sum of spectra on PE0 (from where they are written on file) |
---|
| 837 | sums_spectra(:,n) = 0.0_wp |
---|
[1] | 838 | #if defined( __parallel ) |
---|
[1786] | 839 | CALL MPI_BARRIER( comm2d, ierr ) ! Necessary? |
---|
| 840 | CALL MPI_REDUCE( sums_spectra_l(0), sums_spectra(0,n), ny/2+1, & |
---|
| 841 | MPI_REAL, MPI_PROD, 0, comm2d, ierr ) |
---|
[1] | 842 | #else |
---|
[1786] | 843 | sums_spectra(:,n) = sums_spectra_l |
---|
[1] | 844 | #endif |
---|
[1431] | 845 | ! |
---|
[1786] | 846 | !-- Normalize spectra by variance |
---|
[2215] | 847 | sum_spec_dum = SUM( sums_spectra(1:ny/2,n) ) |
---|
| 848 | IF ( sum_spec_dum /= 0.0_wp ) THEN |
---|
| 849 | sums_spectra(1:ny/2,n) = sums_spectra(1:ny/2,n) * & |
---|
| 850 | var_d(k) / sum_spec_dum |
---|
[1786] | 851 | ENDIF |
---|
| 852 | n = n + 1 |
---|
[1] | 853 | |
---|
[1786] | 854 | ENDDO |
---|
| 855 | n = n - 1 |
---|
[1] | 856 | |
---|
| 857 | |
---|
[1786] | 858 | IF ( myid == 0 ) THEN |
---|
[1] | 859 | ! |
---|
[1786] | 860 | !-- Sum of spectra for later averaging (see routine data_output_spectra) |
---|
| 861 | DO j = 1, ny/2 |
---|
| 862 | DO k = 1, n |
---|
| 863 | spectrum_y(j,k,m) = spectrum_y(j,k,m) + sums_spectra(j,k) |
---|
| 864 | ENDDO |
---|
[1] | 865 | ENDDO |
---|
| 866 | |
---|
[1786] | 867 | ENDIF |
---|
[1] | 868 | |
---|
| 869 | ! |
---|
[1786] | 870 | !-- n_sp_y is needed by data_output_spectra_y |
---|
| 871 | n_sp_y = n |
---|
[1] | 872 | |
---|
[1786] | 873 | END SUBROUTINE calc_spectra_y |
---|
| 874 | |
---|
[1833] | 875 | END MODULE spectra_mod |
---|