Changeset 1833 for palm/trunk/SOURCE
- Timestamp:
- Apr 7, 2016 2:23:03 PM (9 years ago)
- Location:
- palm/trunk/SOURCE
- Files:
-
- 20 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/Makefile
r1827 r1833 20 20 # Current revisions: 21 21 # ------------------ 22 # 22 # spectrum renamed spectra_mod, depencies for spectra changed 23 23 # 24 24 # Former revisions: … … 290 290 random_function.f90 random_gauss.f90 random_generator_parallel.f90 \ 291 291 read_3d_binary.f90 read_var_list.f90 run_control.f90 \ 292 set_slicer_attributes_dvrp.f90 singleton.f90 sor.f90 spectr um.f90 \292 set_slicer_attributes_dvrp.f90 singleton.f90 sor.f90 spectra_mod.f90 \ 293 293 subsidence.f90 sum_up_3d_data.f90 \ 294 294 surface_coupler.f90 surface_layer_fluxes.f90 swap_timelevel.f90 temperton_fft.f90 \ … … 361 361 check_parameters.o: modules.o mod_kinds.o land_surface_model_mod.o \ 362 362 netcdf_interface.o plant_canopy_model_mod.o pmc_interface.o radiation_model_mod.o \ 363 s ubsidence.o363 spectra_mod.o subsidence.o 364 364 close_file.o: modules.o mod_kinds.o netcdf_interface.o 365 365 compute_vpt.o: modules.o mod_kinds.o … … 376 376 netcdf_interface.o mod_particle_attributes.o 377 377 data_output_spectra.o: modules.o cpulog.o mod_kinds.o netcdf_interface.o \ 378 spectr um.o378 spectra_mod.o 379 379 data_output_tseries.o: modules.o cpulog.o mod_kinds.o netcdf_interface.o 380 380 data_output_2d.o: modules.o cpulog.o mod_kinds.o mod_particle_attributes.o\ … … 399 399 global_min_max.o: modules.o mod_kinds.o 400 400 header.o: modules.o cpulog.o mod_kinds.o netcdf_interface.o land_surface_model_mod.o\ 401 plant_canopy_model_mod.o pmc_handle_communicator.o pmc_interface.o \402 radiation_model_mod.o spectr um.o subsidence.o401 plant_canopy_model.o pmc_handle_communicator.o pmc_interface.o \ 402 radiation_model_mod.o spectra_mod.o subsidence.o 403 403 inflow_turbulence.o: modules.o cpulog.o mod_kinds.o 404 404 init_1d_model.o: modules.o mod_kinds.o … … 414 414 init_masks.o: modules.o mod_kinds.o netcdf_interface.o 415 415 init_ocean.o: modules.o eqn_state_seawater.o mod_kinds.o 416 init_pegrid.o: modules.o mod_kinds.o 416 init_pegrid.o: modules.o mod_kinds.o spectra_mod.o 417 417 init_pt_anomaly.o: modules.o mod_kinds.o 418 418 init_rankine.o: modules.o mod_kinds.o … … 456 456 mod_particle_attributes.o: mod_particle_attributes.f90 mod_kinds.o 457 457 netcdf_interface.o: netcdf_interface.f90 modules.o mod_kinds.o \ 458 land_surface_model_mod.o spectr um.o458 land_surface_model_mod.o spectra_mod.o 459 459 nudging.o: modules.o cpulog.o mod_kinds.o 460 <<<<<<< .mine 461 package_parin.o: modules.o mod_kinds.o \ 462 plant_canopy_model.o radiation_model.o 463 ======= 460 464 package_parin.o: modules.o mod_kinds.o spectrum.o 465 >>>>>>> .r1832 461 466 palm.o: modules.o cpulog.o ls_forcing.o mod_kinds.o nudging.o\ 462 467 pmc_interface.o surface_layer_fluxes.o 463 468 parin.o: modules.o cpulog.o land_surface_model_mod.o mod_kinds.o netcdf_interface.o \ 469 <<<<<<< .mine 470 pmc_interface.o progress_bar.o spectra_mod.o 471 plant_canopy_model.o: modules.o mod_kinds.o 472 ======= 464 473 plant_canopy_model_mod.o pmc_interface.o progress_bar.o radiation_model_mod.o 465 474 plant_canopy_model_mod.o: modules.o mod_kinds.o 475 >>>>>>> .r1832 466 476 pmc_interface.o: modules.o mod_kinds.o pmc_client.o pmc_general.o\ 467 477 pmc_handle_communicator.o pmc_mpi_wrapper.o pmc_server.o … … 490 500 random_gauss.o: mod_kinds.o random_function.o random_generator_parallel.o 491 501 random_generator_parallel.o: mod_kinds.o 502 <<<<<<< .mine 503 read_3d_binary.o: modules.o cpulog.o mod_kinds.o land_surface_model_mod.o \ 504 radiation_model.o random_function.o random_generator_parallel.o \ 505 spectra_mod.o 506 read_var_list.o: modules.o mod_kinds.o netcdf_interface.o plant_canopy_model.o \ 507 spectra_mod.o 508 ======= 492 509 read_3d_binary.o: modules.o cpulog.o mod_kinds.o land_surface_model_mod.o\ 493 510 radiation_model_mod.o random_function.o\ 494 511 random_generator_parallel.o 495 512 read_var_list.o: modules.o mod_kinds.o netcdf_interface.o plant_canopy_model_mod.o 513 >>>>>>> .r1832 496 514 run_control.o: modules.o cpulog.o mod_kinds.o 497 515 set_slicer_attributes_dvrp.o: modules.o mod_kinds.o 498 516 singleton.o: mod_kinds.o singleton.f90 499 517 sor.o: modules.o mod_kinds.o 500 spectr um.o: spectrum.f90 modules.o mod_kinds.o cpulog.o fft_xy.o518 spectra_mod.o: spectra_mod.f90 modules.o mod_kinds.o cpulog.o fft_xy.o 501 519 subsidence.o: modules.o mod_kinds.o 502 520 sum_up_3d_data.o: modules.o cpulog.o mod_kinds.o land_surface_model_mod.o\ … … 511 529 ls_forcing.o mod_kinds.o nudging.o pmc_interface.o production_e.o \ 512 530 prognostic_equations.o progress_bar.o radiation_model_mod.o \ 513 spectr um.o user_actions.o surface_layer_fluxes.o531 spectra_mod.o user_actions.o surface_layer_fluxes.o 514 532 time_to_string.o: mod_kinds.o 515 533 timestep.o: modules.o cpulog.o mod_kinds.o … … 544 562 user_parin.o: modules.o mod_kinds.o user_module.o 545 563 user_read_restart_data.o: modules.o mod_kinds.o user_module.o 546 user_spectra.o: modules.o mod_kinds.o spectr um.o user_module.o564 user_spectra.o: modules.o mod_kinds.o spectra_mod.o user_module.o 547 565 user_statistics.o: modules.o mod_kinds.o netcdf_interface.o user_module.o 548 566 wall_fluxes.o: modules.o mod_kinds.o 567 <<<<<<< .mine 568 write_3d_binary.o: modules.o cpulog.o mod_kinds.o land_surface_model_mod.o \ 569 radiation_model.o random_function.o random_generator_parallel.o \ 570 spectra_mod.o 571 write_var_list.o: modules.o mod_kinds.o netcdf_interface.o plant_canopy_model.o\ 572 spectra_mod.o ======= 549 573 write_3d_binary.o: modules.o cpulog.o mod_kinds.o land_surface_model_mod.o\ 550 574 radiation_model_mod.o random_function.o\ 551 575 random_generator_parallel.o 552 write_var_list.o: modules.o mod_kinds.o netcdf_interface.o plant_canopy_model_mod.o 576 write_var_list.o: modules.o mod_kinds.o netcdf_interface.o plant_canopy_model_mod.o >>>>>>> .r1832 -
palm/trunk/SOURCE/check_parameters.f90
r1830 r1833 19 19 ! Current revisions: 20 20 ! ----------------- 21 ! 21 ! check of spectra quantities moved to spectra_mod 22 22 ! 23 23 ! Former revisions: … … 377 377 ONLY: radiation, radiation_check_data_output, & 378 378 radiation_check_data_output_pr, radiation_check_parameters 379 USE spectra_mod, & 380 ONLY: calculate_spectra, spectra_check_parameters 379 381 USE statistics 380 382 USE subsidence_mod … … 1042 1044 1043 1045 ! 1044 !-- When land surface model is used, peform addtional checks 1046 !-- Additional checks for spectra 1047 IF ( calculate_spectra ) CALL spectra_check_parameters 1048 ! 1049 !-- When land surface model is used, perform additional checks 1045 1050 IF ( land_surface ) CALL lsm_check_parameters 1046 1051 … … 2009 2014 ! 2010 2015 !-- Set the default intervals for data output, if necessary 2011 !-- NOTE: dt_dosp has already been set in package_parin2016 !-- NOTE: dt_dosp has already been set in spectra_parin 2012 2017 IF ( dt_data_output /= 9999999.9_wp ) THEN 2013 2018 IF ( dt_dopr == 9999999.9_wp ) dt_dopr = dt_data_output … … 2027 2032 IF ( skip_time_dopr == 9999999.9_wp ) & 2028 2033 skip_time_dopr = skip_time_data_output 2029 IF ( skip_time_dosp == 9999999.9_wp ) &2030 skip_time_dosp = skip_time_data_output2031 2034 IF ( skip_time_do2d_xy == 9999999.9_wp ) & 2032 2035 skip_time_do2d_xy = skip_time_data_output … … 2045 2048 2046 2049 ! 2047 !-- Check the average intervals (first for 3d-data, then for profiles and 2048 !-- spectra) 2050 !-- Check the average intervals (first for 3d-data, then for profiles) 2049 2051 IF ( averaging_interval > dt_data_output_av ) THEN 2050 2052 WRITE( message_string, * ) 'averaging_interval = ', & … … 2061 2063 averaging_interval_pr, ' must be <= dt_dopr = ', dt_dopr 2062 2064 CALL message( 'check_parameters', 'PA0086', 1, 2, 0, 6, 0 ) 2063 ENDIF2064 2065 IF ( averaging_interval_sp == 9999999.9_wp ) THEN2066 averaging_interval_sp = averaging_interval2067 ENDIF2068 2069 IF ( averaging_interval_sp > dt_dosp ) THEN2070 WRITE( message_string, * ) 'averaging_interval_sp = ', &2071 averaging_interval_sp, ' must be <= dt_dosp = ', dt_dosp2072 CALL message( 'check_parameters', 'PA0087', 1, 2, 0, 6, 0 )2073 2065 ENDIF 2074 2066 -
palm/trunk/SOURCE/data_output_spectra.f90
r1818 r1833 19 19 ! Current revisions: 20 20 ! ------------------ 21 ! 21 ! spectrum renamed spectra_mod, spectra related variables moved to spectra_mod, 22 ! routines data_output_spectra_x/y removed 22 23 ! 23 24 ! Former revisions: … … 78 79 #if defined( __netcdf ) 79 80 USE control_parameters, & 80 ONLY: average_count_sp, averaging_interval_sp, dosp_time_count, & 81 message_string, run_description_header, & 81 ONLY: message_string, run_description_header, & 82 82 time_since_reference_point 83 83 … … 94 94 USE pegrid 95 95 96 USE spectrum, & 97 ONLY: comp_spectra_level, data_output_sp, spectra_direction 98 99 USE statistics, & 100 ONLY: spectrum_x, spectrum_y 96 USE spectra_mod, & 97 ONLY: average_count_sp, averaging_interval_sp, comp_spectra_level, & 98 data_output_sp, dosp_time_count, spectra_direction, spectrum_x, & 99 spectrum_y 101 100 102 101 … … 226 225 ONLY: pi 227 226 228 USE control_parameters, &229 ONLY: dosp_time_count230 231 227 USE grid_variables, & 232 228 ONLY: dx, dy … … 243 239 netcdf_handle_error 244 240 245 USE spectrum, & 246 ONLY: n_sp_x, n_sp_y 247 248 USE statistics, & 249 ONLY: spectrum_x, spectrum_y 241 USE spectra_mod, & 242 ONLY: dosp_time_count, n_sp_x, n_sp_y, spectrum_x, spectrum_y 243 250 244 251 245 IMPLICIT NONE … … 302 296 #endif 303 297 END SUBROUTINE output_spectra_netcdf 304 305 306 !------------------------------------------------------------------------------!307 ! Description:308 ! ------------309 !> @todo Missing subroutine description.310 !------------------------------------------------------------------------------!311 SUBROUTINE data_output_spectra_x( m, cranz, pr, frame_written )312 313 USE arrays_3d, &314 ONLY: zu, zw315 USE constants, &316 ONLY: pi317 318 USE control_parameters, &319 ONLY: averaging_interval_sp, run_description_header, simulated_time_chr320 321 USE grid_variables, &322 ONLY: dx323 324 USE indices, &325 ONLY: nx326 327 USE kinds328 329 USE pegrid330 331 USE statistics, &332 ONLY: spectrum_x333 334 USE spectrum, &335 ONLY: comp_spectra_level, header_char, lstyles, klist_x, n_sp_x, &336 plot_spectra_level, utext_char, ytext_char337 338 IMPLICIT NONE339 340 CHARACTER (LEN=30) :: atext !<341 342 INTEGER(iwp) :: i !<343 INTEGER(iwp) :: j !<344 INTEGER(iwp) :: k !<345 INTEGER(iwp) :: m !<346 INTEGER(iwp) :: pr !<347 348 LOGICAL :: frame_written !<349 350 REAL(wp) :: frequency = 0.0_wp !<351 !352 !-- Variables needed for PROFIL-namelist353 CHARACTER (LEN=80) :: rtext !<354 CHARACTER (LEN=80) :: utext !<355 CHARACTER (LEN=80) :: xtext = 'k in m>->1' !<356 CHARACTER (LEN=80) :: ytext !<357 358 INTEGER(iwp) :: cranz !<359 INTEGER(iwp) :: labforx = 3 !<360 INTEGER(iwp) :: labfory = 3 !<361 INTEGER(iwp) :: legpos = 3 !<362 INTEGER(iwp) :: timodex = 1 !<363 364 INTEGER(iwp), DIMENSION(1:100) :: cucol = 1 !<365 INTEGER(iwp), DIMENSION(1:100) :: klist = 999999 !<366 INTEGER(iwp), DIMENSION(1:100) :: lstyle = 0 !<367 368 LOGICAL :: datleg = .TRUE. !<369 LOGICAL :: grid = .TRUE. !<370 LOGICAL :: lclose = .TRUE. !<371 LOGICAL :: rand = .TRUE. !<372 LOGICAL :: swap = .TRUE. !<373 LOGICAL :: twoxa = .TRUE. !<374 LOGICAL :: xlog = .TRUE. !<375 LOGICAL :: ylog = .TRUE. !<376 377 REAL(wp) :: gwid = 0.1_wp !<378 REAL(wp) :: rlegfak = 0.7_wp !<379 REAL(wp) :: uxmin !<380 REAL(wp) :: uxmax !<381 REAL(wp) :: uymin !<382 REAL(wp) :: uymax !<383 384 REAL(wp), DIMENSION(1:100) :: lwid = 0.6_wp !<385 REAL(wp), DIMENSION(100) :: uyma !<386 REAL(wp), DIMENSION(100) :: uymi !<387 388 NAMELIST /RAHMEN/ cranz, datleg, rtext, swap389 NAMELIST /CROSS/ rand, cucol, grid, gwid, klist, labforx, labfory, &390 legpos, lclose, lstyle, lwid, rlegfak, timodex, utext, &391 uxmin, uxmax, uymin, uymax, twoxa, xlog, xtext, ylog, &392 ytext393 394 395 rtext = '\0.5 ' // run_description_header396 397 !398 !-- Open parameter- and data-file399 CALL check_open( 81 )400 CALL check_open( 82 )401 402 !403 !-- Write file header,404 !-- write RAHMEN-parameters (pr=3: w-array is on zw, other arrys on zu,405 !-- pr serves as an index for output of strings (axis-labels) of the406 !-- different quantities u, v, w, pt and q)407 DO k = 1, n_sp_x408 IF ( k < 100 ) THEN409 IF ( pr == 3 ) THEN410 WRITE ( 82, 100 ) '#', k, header_char( pr ), &411 INT( zw(comp_spectra_level(k)) ), &412 simulated_time_chr413 ELSE414 WRITE ( 82, 100 ) '#', k, header_char( pr ), &415 INT( zu(comp_spectra_level(k)) ), &416 simulated_time_chr417 ENDIF418 ELSE419 IF ( pr == 3 ) THEN420 WRITE ( 82, 101 ) '#', k, header_char( pr ), &421 INT( zw(comp_spectra_level(k)) ), &422 simulated_time_chr423 ELSE424 WRITE ( 82, 101 ) '#', k, header_char( pr ), &425 INT( zu(comp_spectra_level(k)) ), &426 simulated_time_chr427 ENDIF428 ENDIF429 ENDDO430 431 IF ( .NOT. frame_written ) THEN432 WRITE ( 81, RAHMEN )433 frame_written = .TRUE.434 ENDIF435 436 !437 !-- Write all data and calculate uymi and uyma. They serve to calculate438 !-- the CROSS-parameters uymin and uymax439 uymi = 999.999_wp; uyma = -999.999_wp440 DO i = 1, nx/2441 frequency = 2.0_wp * pi * i / ( dx * ( nx + 1 ) )442 WRITE ( 82, 102 ) frequency, ( frequency * spectrum_x(i,k,m), k = 1, &443 n_sp_x )444 DO k = 1, n_sp_x445 uymi(k) = MIN( uymi(k), frequency * spectrum_x(i,k,m) )446 uyma(k) = MAX( uyma(k), frequency * spectrum_x(i,k,m) )447 ENDDO448 ENDDO449 450 !451 !-- Determine CROSS-parameters452 cucol(1:n_sp_x) = (/ ( k, k = 1, n_sp_x ) /)453 lstyle(1:n_sp_x) = (/ ( lstyles(k), k = 1, n_sp_x ) /)454 455 !456 !-- Calculate klist-values from the available comp_spectra_level values457 i = 1; k = 1458 DO WHILE ( i <= 100 .AND. plot_spectra_level(i) /= 999999 )459 DO WHILE ( k <= n_sp_x .AND. &460 plot_spectra_level(i) >= comp_spectra_level(k) )461 IF ( plot_spectra_level(i) == comp_spectra_level(k) ) THEN462 klist(i) = k + klist_x463 ELSE464 uymi(k) = 999.999_wp465 uyma(k) = -999.999_wp466 ENDIF467 k = k + 1468 ENDDO469 i = i + 1470 ENDDO471 uymi(k:n_sp_x) = 999.999_wp472 uyma(k:n_sp_x) = -999.999_wp473 utext = 'x'//utext_char( pr )474 IF ( averaging_interval_sp /= 0.0_wp ) THEN475 WRITE ( atext, 104 ) averaging_interval_sp476 utext = TRIM(utext) // ', ' // TRIM( atext )477 ENDIF478 uxmin = 0.8_wp * 2.0_wp * pi / ( dx * ( nx + 1 ) )479 uxmax = 1.2_wp * 2.0_wp * pi * nx/2 / ( dx * ( nx + 1 ) )480 uymin = 0.8_wp * MIN ( 999.999_wp, MINVAL ( uymi ) )481 uymax = 1.2_wp * MAX ( -999.999_wp, MAXVAL ( uyma ) )482 ytext = ytext_char( pr )483 484 !485 !-- Output of CROSS-parameters486 WRITE ( 81, CROSS )487 488 !489 !-- Increase counter by the number of profiles written in the actual block490 klist_x = klist_x + n_sp_x491 492 !493 !-- Write end-mark494 WRITE ( 82, 103 )495 496 !497 !-- Close parameter- and data-file498 CALL close_file( 81 )499 CALL close_file( 82 )500 501 !502 !-- Formats503 100 FORMAT (A,I1,1X,A,1X,I4,'m ',A)504 101 FORMAT (A,I2,1X,A,1X,I4,'m ',A)505 102 FORMAT (E15.7,100(1X,E15.7))506 103 FORMAT ('NEXT')507 104 FORMAT ('time averaged over',F7.1,' s')508 509 END SUBROUTINE data_output_spectra_x510 511 512 !------------------------------------------------------------------------------!513 ! Description:514 ! ------------515 !> @todo Missing subroutine description.516 !------------------------------------------------------------------------------!517 SUBROUTINE data_output_spectra_y( m, cranz, pr, frame_written )518 519 USE arrays_3d, &520 ONLY: zu, zw521 522 USE constants, &523 ONLY: pi524 525 USE control_parameters, &526 ONLY: averaging_interval_sp, run_description_header, simulated_time_chr527 528 USE grid_variables, &529 ONLY: dy530 531 USE indices, &532 ONLY: ny533 534 USE kinds535 536 USE pegrid537 538 USE statistics, &539 ONLY: spectrum_y540 541 USE spectrum, &542 ONLY: comp_spectra_level, header_char, klist_y, lstyles, n_sp_y, &543 plot_spectra_level, utext_char, ytext_char544 545 IMPLICIT NONE546 547 548 CHARACTER (LEN=30) :: atext !<549 550 INTEGER(iwp) :: i !<551 INTEGER(iwp) :: j !<552 INTEGER(iwp) :: k !<553 INTEGER(iwp) :: m !<554 INTEGER(iwp) :: pr !<555 556 LOGICAL :: frame_written !<557 558 REAL(wp) :: frequency = 0.0_wp !<559 560 !561 !-- Variables needed for PROFIL-namelist562 CHARACTER (LEN=80) :: rtext !<563 CHARACTER (LEN=80) :: utext !<564 CHARACTER (LEN=80) :: xtext = 'k in m>->1' !<565 CHARACTER (LEN=80) :: ytext !<566 567 INTEGER(iwp) :: cranz !<568 INTEGER(iwp) :: labforx = 3 !<569 INTEGER(iwp) :: labfory = 3 !<570 INTEGER(iwp) :: legpos = 3 !<571 INTEGER(iwp) :: timodex = 1 !<572 573 INTEGER(iwp), DIMENSION(1:100) :: cucol = 1 !<574 INTEGER(iwp), DIMENSION(1:100) :: klist = 999999 !<575 INTEGER(iwp), DIMENSION(1:100) :: lstyle = 0 !<576 577 LOGICAL :: datleg = .TRUE. !<578 LOGICAL :: grid = .TRUE. !<579 LOGICAL :: lclose = .TRUE. !<580 LOGICAL :: rand = .TRUE. !<581 LOGICAL :: swap = .TRUE. !<582 LOGICAL :: twoxa = .TRUE. !<583 LOGICAL :: xlog = .TRUE. !<584 LOGICAL :: ylog = .TRUE. !<585 586 REAL(wp) :: gwid = 0.1_wp !<587 REAL(wp) :: rlegfak = 0.7_wp !<588 REAL(wp) :: uxmin !<589 REAL(wp) :: uxmax !<590 REAL(wp) :: uymin !<591 REAL(wp) :: uymax !<592 593 REAL(wp), DIMENSION(1:100) :: lwid = 0.6_wp !<594 595 REAL(wp), DIMENSION(100) :: uyma !<596 REAL(wp), DIMENSION(100) :: uymi !<597 598 NAMELIST /RAHMEN/ cranz, datleg, rtext, swap599 NAMELIST /CROSS/ rand, cucol, grid, gwid, klist, labforx, labfory, &600 legpos, lclose, lstyle, lwid, rlegfak, timodex, utext, &601 uxmin, uxmax, uymin, uymax, twoxa, xlog, xtext, ylog, &602 ytext603 604 605 rtext = '\0.5 ' // run_description_header606 607 !608 !-- Open parameter- and data-file609 CALL check_open( 83 )610 CALL check_open( 84 )611 612 !613 !-- Write file header,614 !-- write RAHMEN-parameters (pr=3: w-array is on zw, other arrys on zu,615 !-- pr serves as an index for output of strings (axis-labels) of the616 !-- different quantities u, v, w, pt and q)617 DO k = 1, n_sp_y618 IF ( k < 100 ) THEN619 IF ( pr == 3 ) THEN620 WRITE ( 84, 100 ) '#', k, header_char( pr ), &621 INT( zw(comp_spectra_level(k)) ), &622 simulated_time_chr623 ELSE624 WRITE ( 84, 100 ) '#', k, header_char( pr ), &625 INT( zu(comp_spectra_level(k)) ), &626 simulated_time_chr627 ENDIF628 ELSE629 IF ( pr == 3 ) THEN630 WRITE ( 84, 101 ) '#', k, header_char( pr ), &631 INT( zw(comp_spectra_level(k)) ), &632 simulated_time_chr633 ELSE634 WRITE ( 84, 101 ) '#', k, header_char( pr ), &635 INT( zu(comp_spectra_level(k)) ), &636 simulated_time_chr637 ENDIF638 ENDIF639 ENDDO640 641 IF ( .NOT. frame_written ) THEN642 WRITE ( 83, RAHMEN )643 frame_written = .TRUE.644 ENDIF645 646 !647 !-- Write all data and calculate uymi and uyma. They serve to calculate648 !-- the CROSS-parameters uymin and uymax649 uymi = 999.999_wp; uyma = -999.999_wp650 DO j = 1, ny/2651 frequency = 2.0_wp * pi * j / ( dy * ( ny + 1 ) )652 WRITE ( 84, 102 ) frequency, ( frequency * spectrum_y(j,k,m), &653 k = 1, n_sp_y )654 DO k = 1, n_sp_y655 uymi(k) = MIN( uymi(k), frequency * spectrum_y(j,k,m) )656 uyma(k) = MAX( uyma(k), frequency * spectrum_y(j,k,m) )657 ENDDO658 ENDDO659 660 !661 !-- Determine CROSS-parameters662 cucol(1:n_sp_y) = (/ ( k, k = 1, n_sp_y ) /)663 lstyle(1:n_sp_y) = (/ ( lstyles(k), k = 1, n_sp_y ) /)664 665 !666 !-- Calculate klist-values from the available comp_spectra_level values667 j = 1; k = 1668 DO WHILE ( j <= 100 .AND. plot_spectra_level(j) /= 999999 )669 DO WHILE ( k <= n_sp_y .AND. &670 plot_spectra_level(j) >= comp_spectra_level(k) )671 IF ( plot_spectra_level(j) == comp_spectra_level(k) ) THEN672 klist(j) = k + klist_y673 ELSE674 uymi(k) = 999.999_wp675 uyma(k) = -999.999_wp676 ENDIF677 k = k + 1678 ENDDO679 j = j + 1680 ENDDO681 uymi(k:n_sp_y) = 999.999_wp682 uyma(k:n_sp_y) = -999.999_wp683 utext = 'y'//utext_char( pr )684 IF ( averaging_interval_sp /= 0.0_wp ) THEN685 WRITE ( atext, 104 ) averaging_interval_sp686 utext = TRIM(utext) // ', ' // TRIM( atext )687 ENDIF688 uxmin = 0.8_wp * 2.0_wp * pi / ( dy * ( ny + 1 ) )689 uxmax = 1.2_wp * 2.0_wp * pi * ny/2 / ( dy * ( ny + 1 ) )690 uymin = 0.8_wp * MIN ( 999.999_wp, MINVAL ( uymi ) )691 uymax = 1.2_wp * MAX ( -999.999_wp, MAXVAL ( uyma ) )692 ytext = ytext_char( pr )693 694 !695 !-- Output CROSS-parameters696 WRITE ( 83, CROSS )697 698 !699 !-- Increase counter by the number of profiles written in the actual block700 klist_y = klist_y + n_sp_y701 702 !703 !-- Write end-mark704 WRITE ( 84, 103 )705 706 !707 !-- Close parameter- and data-file708 CALL close_file( 83 )709 CALL close_file( 84 )710 711 !712 !-- Formats713 100 FORMAT (A,I1,1X,A,1X,I4,'m ',A)714 101 FORMAT (A,I2,1X,A,1X,I4,'m ',A)715 102 FORMAT (E15.7,100(1X,E15.7))716 103 FORMAT ('NEXT')717 104 FORMAT ('time averaged over',F7.1,' s')718 719 END SUBROUTINE data_output_spectra_y -
palm/trunk/SOURCE/header.f90
r1832 r1833 19 19 ! Current revisions: 20 20 ! ----------------- 21 ! 21 ! spectrum renamed spectra_mod, output of spectra related quantities moved to 22 ! spectra_mod 22 23 ! 23 24 ! Former revisions: … … 310 311 ONLY: radiation, radiation_header 311 312 312 USE spectrum, & 313 ONLY: comp_spectra_level, data_output_sp, plot_spectra_level, & 314 spectra_direction 313 USE spectra_mod, & 314 ONLY: calculate_spectra, spectra_header 315 315 316 316 IMPLICIT NONE … … 1631 1631 1632 1632 ! 1633 !-- Spectra output 1634 IF ( dt_dosp /= 9999999.9_wp ) THEN 1635 WRITE ( io, 370 ) 1636 1637 output_format = netcdf_data_format_string 1638 IF ( netcdf_deflate == 0 ) THEN 1639 WRITE ( io, 344 ) output_format 1640 ELSE 1641 WRITE ( io, 354 ) TRIM( output_format ), netcdf_deflate 1642 ENDIF 1643 WRITE ( io, 371 ) dt_dosp 1644 IF ( skip_time_dosp /= 0.0_wp ) WRITE ( io, 339 ) skip_time_dosp 1645 WRITE ( io, 372 ) ( data_output_sp(i), i = 1,10 ), & 1646 ( spectra_direction(i), i = 1,10 ), & 1647 ( comp_spectra_level(i), i = 1,100 ), & 1648 ( plot_spectra_level(i), i = 1,100 ), & 1649 averaging_interval_sp, dt_averaging_input_pr 1650 ENDIF 1633 !-- Output of spectra related quantities 1634 IF ( calculate_spectra ) CALL spectra_header( io ) 1651 1635 1652 1636 WRITE ( io, 99 ) … … 2089 2073 367 FORMAT (' Polygon reduction for topography: cluster_size = ', I1) 2090 2074 #endif 2091 370 FORMAT (' Spectra:')2092 371 FORMAT (' Output every ',F7.1,' s'/)2093 372 FORMAT (' Arrays: ', 10(A5,',')/ &2094 ' Directions: ', 10(A5,',')/ &2095 ' height levels k = ', 20(I3,',')/ &2096 ' ', 20(I3,',')/ &2097 ' ', 20(I3,',')/ &2098 ' ', 20(I3,',')/ &2099 ' ', 19(I3,','),I3,'.'/ &2100 ' height levels selected for standard plot:'/ &2101 ' k = ', 20(I3,',')/ &2102 ' ', 20(I3,',')/ &2103 ' ', 20(I3,',')/ &2104 ' ', 20(I3,',')/ &2105 ' ', 19(I3,','),I3,'.'/ &2106 ' Time averaged over ', F7.1, ' s,' / &2107 ' Profiles for the time averaging are taken every ', &2108 F6.1,' s')2109 2075 400 FORMAT (//' Physical quantities:'/ & 2110 2076 ' -------------------'/) -
palm/trunk/SOURCE/init_3d_model.f90
r1832 r1833 19 19 ! Current revisions: 20 20 ! ------------------ 21 ! 21 ! initialization of spectra quantities moved to spectra_mod 22 22 ! 23 23 ! Former revisions: … … 309 309 USE statistics, & 310 310 ONLY: hom, hom_sum, mean_surface_level_height, pr_palm, rmask, & 311 s pectrum_x, spectrum_y, statistic_regions, sums, sums_divnew_l,&312 sums_ divold_l, sums_l, sums_l_l, sums_up_fraction_l,&313 sums_wsts_bc_l, ts_value, var_d,weight_pres, weight_substep311 statistic_regions, sums, sums_divnew_l, sums_divold_l, sums_l, & 312 sums_l_l, sums_up_fraction_l, sums_wsts_bc_l, ts_value, & 313 weight_pres, weight_substep 314 314 315 315 USE surface_layer_fluxes_mod, & … … 578 578 ENDIF 579 579 580 IF ( dt_dosp /= 9999999.9_wp ) THEN581 ALLOCATE( spectrum_x( 1:nx/2, 1:10, 1:10 ), &582 spectrum_y( 1:ny/2, 1:10, 1:10 ) )583 spectrum_x = 0.0_wp584 spectrum_y = 0.0_wp585 586 ALLOCATE( var_d(nzb:nzt+1) )587 var_d = 0.0_wp588 ENDIF589 590 580 ! 591 581 !-- 1D-array for large scale subsidence velocity -
palm/trunk/SOURCE/init_pegrid.f90
r1818 r1833 19 19 ! Current revisions: 20 20 ! ------------------ 21 ! 21 ! spectra related variables moved to spectra_mod 22 22 ! 23 23 ! Former revisions: … … 141 141 USE control_parameters, & 142 142 ONLY: bc_lr, bc_ns, coupling_mode, coupling_mode_remote, & 143 coupling_topology, dt_dosp, gathered_size, grid_level,&143 coupling_topology, gathered_size, grid_level, & 144 144 grid_level_count, host, inflow_l, inflow_n, inflow_r, inflow_s, & 145 145 io_blocks, io_group, maximum_grid_level, & … … 163 163 164 164 USE pegrid 165 165 166 USE spectra_mod, & 167 ONLY: dt_dosp 168 166 169 USE transpose_indices, & 167 170 ONLY: nxl_y, nxl_yd, nxl_z, nxr_y, nxr_yd, nxr_z, nyn_x, nyn_z, nys_x,& -
palm/trunk/SOURCE/modules.f90
r1832 r1833 19 19 ! Current revisions: 20 20 ! ------------------ 21 ! 21 ! spectra parameter moved to spectra module 22 22 ! 23 23 ! Former revisions: … … 663 663 CHARACTER (LEN=20), DIMENSION(0:1,100) :: do2d = ' ', do3d = ' ' 664 664 665 INTEGER(iwp) :: abort_mode = 1, average_count_pr = 0, average_count_sp = 0,&665 INTEGER(iwp) :: abort_mode = 1, average_count_pr = 0, & 666 666 average_count_3d = 0, current_timestep_number = 0, & 667 667 coupling_topology = 0, & … … 669 669 disturbance_level_ind_t, doav_n = 0, dopr_n = 0, & 670 670 dopr_time_count = 0, dopts_time_count = 0, & 671 do sp_time_count = 0, dots_time_count = 0, &671 dots_time_count = 0, & 672 672 do2d_xy_n = 0, do2d_xz_n = 0, do2d_yz_n = 0, do3d_avs_n = 0, & 673 673 dp_level_ind_b = 0, dvrp_filecount = 0, & … … 781 781 alpha_surface = 0.0_wp, atmos_ocean_sign = 1.0_wp, & 782 782 averaging_interval = 0.0_wp, averaging_interval_pr = 9999999.9_wp, & 783 averaging_interval_sp = 9999999.9_wp, bc_pt_t_val, bc_q_t_val, & 784 bottom_salinityflux = 0.0_wp, & 783 bc_pt_t_val, bc_q_t_val, bottom_salinityflux = 0.0_wp, & 785 784 building_height = 50.0_wp, building_length_x = 50.0_wp, & 786 785 building_length_y = 50.0_wp, building_wall_left = 9999999.9_wp, & … … 799 798 dt_data_output_av = 9999999.9_wp, dt_disturb = 9999999.9_wp, & 800 799 dt_dopr = 9999999.9_wp, dt_dopr_listing = 9999999.9_wp, & 801 dt_dopts = 9999999.9_wp, dt_do sp = 9999999.9_wp, dt_dots = 9999999.9_wp, &800 dt_dopts = 9999999.9_wp, dt_dots = 9999999.9_wp, & 802 801 dt_do2d_xy = 9999999.9_wp, dt_do2d_xz = 9999999.9_wp, & 803 802 dt_do2d_yz = 9999999.9_wp, dt_do3d = 9999999.9_wp, dt_dvrp = 9999999.9_wp, & … … 828 827 simulated_time = 0.0_wp, simulated_time_at_begin, sin_alpha_surface, & 829 828 skip_time_data_output = 0.0_wp, skip_time_data_output_av = 9999999.9_wp,& 830 skip_time_dopr = 9999999.9_wp, skip_time_dosp = 9999999.9_wp,&829 skip_time_dopr = 9999999.9_wp, & 831 830 skip_time_do2d_xy = 9999999.9_wp, skip_time_do2d_xz = 9999999.9_wp, & 832 831 skip_time_do2d_yz = 9999999.9_wp, skip_time_do3d = 9999999.9_wp, & … … 1291 1290 REAL(wp), DIMENSION(:), ALLOCATABLE :: mean_surface_level_height, & 1292 1291 sums_divnew_l, sums_divold_l, & 1293 var_d, weight_substep, & 1294 weight_pres 1292 weight_substep, weight_pres 1295 1293 REAL(wp), DIMENSION(:,:), ALLOCATABLE :: sums, sums_wsts_bc_l, ts_value, & 1296 1294 sums_wsus_ws_l, sums_wsvs_ws_l, & … … 1304 1302 sums_ls_l 1305 1303 1306 REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: hom_sum, rmask, s pectrum_x,&1307 s pectrum_y, sums_l, sums_l_l, &1308 sums_up_fraction_l 1304 REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: hom_sum, rmask, sums_l, & 1305 sums_l_l, sums_up_fraction_l 1306 1309 1307 REAL(wp), DIMENSION(:,:,:,:), ALLOCATABLE :: hom 1310 1308 -
palm/trunk/SOURCE/netcdf_interface.f90
r1818 r1833 19 19 ! Current revisions: 20 20 ! ------------------ 21 ! 21 ! spectrum renamed spectra_mod 22 22 ! 23 23 ! Former revisions: … … 348 348 USE control_parameters, & 349 349 ONLY: averaging_interval, averaging_interval_pr, & 350 averaging_interval_sp,data_output_pr, domask, dopr_n, &350 data_output_pr, domask, dopr_n, & 351 351 dopr_time_count, dopts_time_count, dots_time_count, & 352 do sp_time_count, do2d, do2d_xz_time_count, do3d, &352 do2d, do2d_xz_time_count, do3d, & 353 353 do2d_yz_time_count, dt_data_output_av, dt_do2d_xy, dt_do2d_xz, & 354 354 dt_do2d_yz, dt_do3d, mask_size, do2d_xy_time_count, & … … 380 380 ONLY: crmax, cross_profiles, dopr_index, profile_columns, profile_rows 381 381 382 USE spectr um,&383 ONLY: comp_spectra_level, data_output_sp, spectra_direction382 USE spectra_mod, & 383 ONLY: averaging_interval_sp, comp_spectra_level, data_output_sp, dosp_time_count, spectra_direction 384 384 385 385 USE statistics, & -
palm/trunk/SOURCE/package_parin.f90
r1832 r1833 19 19 ! Current revisions: 20 20 ! ----------------- 21 ! 21 ! reading of spectra_par moved to spectra_mod 22 22 ! 23 23 ! Former revisions: … … 126 126 127 127 USE control_parameters, & 128 ONLY: averaging_interval_sp, dt_data_output, dt_dopts, dt_dosp, & 129 dt_dvrp, particle_maximum_age, skip_time_dosp, & 128 ONLY: dt_data_output, dt_dopts, dt_dvrp, particle_maximum_age, & 130 129 threshold 131 130 … … 159 158 seed_follows_topography, use_sgs_for_particles, & 160 159 vertical_particle_advection, write_particle_statistics 161 162 USE spectrum, &163 ONLY: comp_spectra_level, data_output_sp, plot_spectra_level, &164 spectra_direction165 160 166 161 IMPLICIT NONE … … 206 201 write_particle_statistics 207 202 208 NAMELIST /spectra_par/ averaging_interval_sp, comp_spectra_level, &209 data_output_sp, dt_dosp, plot_spectra_level, &210 skip_time_dosp, spectra_direction211 212 203 ! 213 204 !-- Position the namelist-file at the beginning (it was already opened in … … 251 242 30 CONTINUE 252 243 253 REWIND ( 11 )254 line = ' '255 DO WHILE ( INDEX( line, '&spectra_par' ) == 0 )256 READ ( 11, '(A)', END=40 ) line257 ENDDO258 BACKSPACE ( 11 )259 260 !261 !-- Read user-defined namelist262 READ ( 11, spectra_par )263 264 !265 !-- Default setting of dt_dosp here (instead of check_parameters), because its266 !-- current value is needed in init_pegrid267 IF ( dt_dosp == 9999999.9_wp ) dt_dosp = dt_data_output268 269 40 CONTINUE270 271 272 273 274 244 END SUBROUTINE package_parin -
palm/trunk/SOURCE/palm.f90
r1818 r1833 19 19 ! Current revisions: 20 20 ! ----------------- 21 ! 21 ! required user interface version changed 22 22 ! 23 23 ! Former revisions: … … 192 192 193 193 version = 'PALM 4.0' 194 user_interface_required_revision = 'r1 783'194 user_interface_required_revision = 'r1819' 195 195 196 196 #if defined( __parallel ) -
palm/trunk/SOURCE/parin.f90
r1832 r1833 19 19 ! Current revisions: 20 20 ! ----------------- 21 ! 21 ! call of spectra_parin 22 22 ! 23 23 ! Former revisions: … … 245 245 ONLY : batch_job 246 246 247 USE radiation_model_mod, & 248 ONLY: radiation_parin 249 247 USE radiation_model_mod, & 248 ONLY: radiation_parin 249 250 USE spectra_mod, & 251 ONLY : spectra_parin 252 250 253 USE statistics, & 251 254 ONLY: hom, hom_sum, pr_palm, region, statistic_regions … … 473 476 ENDIF 474 477 475 476 478 ! 477 479 !-- Check if land surface model is used and read &lsm_par if required 478 480 CALL lsm_parin 479 481 482 ! 483 !-- Check if spectra shall be calculated and read spectra_par if required 484 CALL spectra_parin 485 480 486 ! 481 487 !-- Check if radiation model is used and read &radiation_par if required -
palm/trunk/SOURCE/pmc_client.f90
r1818 r1833 20 20 ! Current revisions: 21 21 ! ------------------ 22 ! 22 ! gfortran requires pointer attributes for some array declarations, 23 ! long line wrapped 23 24 ! 24 25 ! Former revisions: … … 354 355 IMPLICIT none 355 356 356 REAL(wp), INTENT(IN) ,DIMENSION(:,:) :: array357 REAL(wp), INTENT(IN) ,DIMENSION(:,:), POINTER :: array 357 358 358 359 INTEGER :: NrDims … … 387 388 IMPLICIT none 388 389 389 REAL(wp),INTENT(IN),DIMENSION(:,:,:) :: array390 REAL(wp),INTENT(IN),DIMENSION(:,:,:), POINTER :: array 390 391 391 392 INTEGER :: NrDims … … 551 552 ar%SendBuf = c_loc(base_array_cs(ar%SendIndex)) 552 553 if(ar%SendIndex+ar%SendSize > bufsize) then 553 write(0,'(a,i4,4i7,1x,a)') 'Client Buffer too small ',i,ar%SendIndex,ar%SendSize,ar%SendIndex+ar%SendSize,bufsize,trim(ar%name) 554 write(0,'(a,i4,4i7,1x,a)') 'Client Buffer too small ',i, & 555 ar%SendIndex,ar%SendSize,ar%SendIndex+ar%SendSize,bufsize,trim(ar%name) 554 556 CALL MPI_Abort (MPI_COMM_WORLD, istat, ierr) 555 557 end if -
palm/trunk/SOURCE/pmc_server.f90
r1818 r1833 20 20 ! Current revisions: 21 21 ! ------------------ 22 ! 22 ! gfortran requires pointer attributes for some array declarations, 23 ! long line wrapped 23 24 ! 24 25 ! Former revisions: … … 277 278 IMPLICIT none 278 279 279 INTEGER,INTENT(IN) :: ClientId 280 REAL(wp), INTENT(IN), DIMENSION(:,:) :: array 281 REAL(wp), INTENT(IN), DIMENSION(:,:), OPTIONAL :: array_2 280 INTEGER,INTENT(IN) :: ClientId 281 282 REAL(wp), INTENT(IN), DIMENSION(:,:), POINTER :: array 283 REAL(wp), INTENT(IN), DIMENSION(:,:), POINTER, OPTIONAL :: array_2 282 284 283 285 INTEGER :: NrDims … … 307 309 IMPLICIT none 308 310 309 INTEGER,INTENT(IN) :: ClientId 310 REAL(wp), INTENT(IN), DIMENSION(:,:,:) :: array 311 REAL(wp), INTENT(IN), DIMENSION(:,:,:), OPTIONAL :: array_2 311 INTEGER,INTENT(IN) :: ClientId 312 313 REAL(wp), INTENT(IN), DIMENSION(:,:,:), POINTER :: array 314 REAL(wp), INTENT(IN), DIMENSION(:,:,:), POINTER, OPTIONAL :: array_2 312 315 INTEGER,INTENT(IN) :: nz_cl 313 316 INTEGER,INTENT(IN) :: nz … … 433 436 ar%SendBuf = c_loc(base_array_sc(ar%SendIndex)) 434 437 if(ar%SendIndex+ar%SendSize > bufsize) then 435 write(0,'(a,i4,4i7,1x,a)') 'Server Buffer too small ',i,ar%SendIndex,ar%SendSize,ar%SendIndex+ar%SendSize,bufsize,trim(ar%name) 438 write(0,'(a,i4,4i7,1x,a)') 'Server Buffer too small ',i, & 439 ar%SendIndex,ar%SendSize,ar%SendIndex+ar%SendSize,bufsize,trim(ar%name) 436 440 CALL MPI_Abort (MPI_COMM_WORLD, istat, ierr) 437 441 end if -
palm/trunk/SOURCE/read_3d_binary.f90
r1818 r1833 19 19 ! Current revisions: 20 20 ! ----------------- 21 ! 21 ! statistics module replaced by spectra module 22 22 ! 23 23 ! Former revisions: … … 146 146 ONLY: id_random_array, seq_random_array 147 147 148 USE s tatistics,&148 USE spectra_mod, & 149 149 ONLY: spectrum_x, spectrum_y 150 150 -
palm/trunk/SOURCE/read_var_list.f90
r1832 r1833 19 19 ! Current revisions: 20 20 ! ------------------ 21 ! 21 ! spectra_mod added 22 22 ! 23 23 ! Former revisions: … … 193 193 194 194 USE radiation_model_mod, & 195 ONLY: time_radiation 195 ONLY: time_radiation 196 197 USE spectra_mod, & 198 ONLY: average_count_sp 196 199 197 200 USE statistics, & -
palm/trunk/SOURCE/spectra_mod.f90
r1832 r1833 1 !> @file spectr um.f901 !> @file spectra_mod.f90 2 2 !--------------------------------------------------------------------------------! 3 3 ! This file is part of PALM. … … 19 19 ! Current revisions: 20 20 ! ----------------- 21 ! 21 ! file renamed, reading the spectra_par NAMELIST moved from package_parin to 22 ! here 22 23 ! 23 24 ! Former revisions: … … 91 92 !> transpose_zyd needs modification). 92 93 !------------------------------------------------------------------------------! 93 MODULE spectr um94 MODULE spectra_mod 94 95 95 96 USE kinds … … 97 98 PRIVATE 98 99 99 CHARACTER (LEN=6), DIMENSION(1:5) :: header_char = (/ 'PS(u) ', 'PS(v) ',& 100 'PS(w) ', 'PS(pt)', 'PS(q) ' /) 101 CHARACTER (LEN=2), DIMENSION(10) :: spectra_direction = 'x' 102 CHARACTER (LEN=10), DIMENSION(10) :: data_output_sp = ' ' 103 CHARACTER (LEN=25), DIMENSION(1:5) :: utext_char = & 104 (/ '-power spectrum of u ', & 105 '-power spectrum of v ', & 106 '-power spectrum of w ', & 107 '-power spectrum of ^1185 ', & 108 '-power spectrum of q ' /) 109 CHARACTER (LEN=39), DIMENSION(1:5) :: ytext_char = & 110 (/ 'k ^2236 ^2566^2569<u(k) in m>2s>->2 ', & 111 'k ^2236 ^2566^2569<v(k) in m>2s>->2 ', & 112 'k ^2236 ^2566^2569<w(k) in m>2s>->2 ', & 113 'k ^2236 ^2566^2569<^1185(k) in m>2s>->2', & 114 'k ^2236 ^2566^2569<q(k) in m>2s>->2 ' /) 115 116 INTEGER(iwp) :: klist_x = 0, klist_y = 0, n_sp_x = 0, n_sp_y = 0 117 118 INTEGER(iwp) :: comp_spectra_level(100) = 999999, & 119 lstyles(100) = (/ 0, 7, 3, 10, 1, 4, 9, 2, 6, 8, & 120 0, 7, 3, 10, 1, 4, 9, 2, 6, 8, & 121 0, 7, 3, 10, 1, 4, 9, 2, 6, 8, & 122 0, 7, 3, 10, 1, 4, 9, 2, 6, 8, & 123 0, 7, 3, 10, 1, 4, 9, 2, 6, 8, & 124 0, 7, 3, 10, 1, 4, 9, 2, 6, 8, & 125 0, 7, 3, 10, 1, 4, 9, 2, 6, 8, & 126 0, 7, 3, 10, 1, 4, 9, 2, 6, 8, & 127 0, 7, 3, 10, 1, 4, 9, 2, 6, 8, & 128 0, 7, 3, 10, 1, 4, 9, 2, 6, 8 /), & 129 plot_spectra_level(100) = 999999 130 131 REAL(wp) :: time_to_start_sp = 0.0_wp 132 133 PUBLIC comp_spectra_level, data_output_sp, header_char, klist_x, klist_y, & 134 lstyles, n_sp_x, n_sp_y, plot_spectra_level, spectra_direction, & 135 utext_char, ytext_char 100 CHARACTER (LEN=2), DIMENSION(10) :: spectra_direction = 'x' 101 CHARACTER (LEN=10), DIMENSION(10) :: data_output_sp = ' ' 102 103 INTEGER(iwp) :: average_count_sp = 0 104 INTEGER(iwp) :: dosp_time_count = 0 105 INTEGER(iwp) :: n_sp_x = 0, n_sp_y = 0 106 107 INTEGER(iwp) :: comp_spectra_level(100) = 999999 108 109 LOGICAL :: calculate_spectra = .FALSE. !< internal switch that spectra are calculated 110 LOGICAL :: spectra_initialized = .FALSE. !< internal switch that spectra related quantities are initialized 111 112 REAL(wp) :: averaging_interval_sp = 9999999.9_wp !< averaging interval for spectra output 113 REAL(wp) :: dt_dosp = 9999999.9_wp !< time interval for spectra output 114 REAL(wp) :: skip_time_dosp = 9999999.9_wp !< no output of spectra data before this interval has passed 115 116 REAL(wp), DIMENSION(:), ALLOCATABLE :: var_d 117 118 REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: spectrum_x, spectrum_y 136 119 137 120 SAVE … … 153 136 END INTERFACE calc_spectra_y 154 137 155 PUBLIC calc_spectra 138 INTERFACE spectra_check_parameters 139 MODULE PROCEDURE spectra_check_parameters 140 END INTERFACE spectra_check_parameters 141 142 INTERFACE spectra_header 143 MODULE PROCEDURE spectra_header 144 END INTERFACE spectra_header 145 146 INTERFACE spectra_init 147 MODULE PROCEDURE spectra_init 148 END INTERFACE spectra_init 149 150 INTERFACE spectra_parin 151 MODULE PROCEDURE spectra_parin 152 END INTERFACE spectra_parin 153 154 PUBLIC average_count_sp, averaging_interval_sp, calc_spectra, & 155 calculate_spectra, comp_spectra_level, data_output_sp, & 156 dosp_time_count, dt_dosp, n_sp_x, n_sp_y, plot_spectra_level, & 157 skip_time_dosp, spectra_check_parameters, spectra_direction, & 158 spectra_header, spectra_init, spectra_parin, spectrum_x, & 159 spectrum_y, var_d 156 160 157 161 158 162 CONTAINS 163 164 !------------------------------------------------------------------------------! 165 ! Description: 166 ! ------------ 167 !> Parin for &spectra_par for calculating spectra 168 !------------------------------------------------------------------------------! 169 SUBROUTINE spectra_parin 170 171 USE control_parameters, & 172 ONLY: dt_data_output 173 174 IMPLICIT NONE 175 176 CHARACTER (LEN=80) :: line !< dummy string that contains the current & 177 !< line of the parameter file 178 179 NAMELIST /spectra_par/ averaging_interval_sp, comp_spectra_level, & 180 data_output_sp, dt_dosp, skip_time_dosp, & 181 spectra_direction 182 183 184 ! 185 !-- Position the namelist-file at the beginning (it was already opened in 186 !-- parin), search for the namelist-group of the package and position the 187 !-- file at this line. 188 line = ' ' 189 190 ! 191 !-- Try to find the spectra package 192 REWIND ( 11 ) 193 line = ' ' 194 DO WHILE ( INDEX( line, '&spectra_par' ) == 0 ) 195 READ ( 11, '(A)', END=10 ) line 196 ENDDO 197 BACKSPACE ( 11 ) 198 199 ! 200 !-- Read namelist 201 READ ( 11, spectra_par ) 202 203 ! 204 !-- Default setting of dt_dosp here (instead of check_parameters), because 205 !-- its current value is needed in init_pegrid 206 IF ( dt_dosp == 9999999.9_wp ) dt_dosp = dt_data_output 207 208 ! 209 !-- Set general switch that spectra shall be calculated 210 calculate_spectra = .TRUE. 211 212 10 CONTINUE 213 214 END SUBROUTINE spectra_parin 215 216 217 218 !------------------------------------------------------------------------------! 219 ! Description: 220 ! ------------ 221 !> Initialization of spectra related variables 222 !------------------------------------------------------------------------------! 223 SUBROUTINE spectra_init 224 225 USE indices, & 226 ONLY: nx, ny, nzb, nzt 227 228 IMPLICIT NONE 229 230 IF ( spectra_initialized ) RETURN 231 232 IF ( dt_dosp /= 9999999.9_wp ) THEN 233 ALLOCATE( spectrum_x( 1:nx/2, 1:10, 1:10 ), & 234 spectrum_y( 1:ny/2, 1:10, 1:10 ) ) 235 spectrum_x = 0.0_wp 236 spectrum_y = 0.0_wp 237 238 ALLOCATE( var_d(nzb:nzt+1) ) 239 var_d = 0.0_wp 240 ENDIF 241 242 spectra_initialized = .TRUE. 243 244 END SUBROUTINE spectra_init 245 246 247 248 !------------------------------------------------------------------------------! 249 ! Description: 250 ! ------------ 251 !> Check spectra related quantities 252 !------------------------------------------------------------------------------! 253 SUBROUTINE spectra_check_parameters 254 255 USE control_parameters, & 256 ONLY: averaging_interval, message_string, skip_time_data_output 257 258 IMPLICIT NONE 259 260 ! 261 !-- Check the average interval 262 IF ( averaging_interval_sp == 9999999.9_wp ) THEN 263 averaging_interval_sp = averaging_interval 264 ENDIF 265 266 IF ( averaging_interval_sp > dt_dosp ) THEN 267 WRITE( message_string, * ) 'averaging_interval_sp = ', & 268 averaging_interval_sp, ' must be <= dt_dosp = ', dt_dosp 269 CALL message( 'spectra_check_parameters', 'PA0087', 1, 2, 0, 6, 0 ) 270 ENDIF 271 272 ! 273 !-- Set the default skip time interval for data output, if necessary 274 IF ( skip_time_dosp == 9999999.9_wp ) & 275 skip_time_dosp = skip_time_data_output 276 277 END SUBROUTINE spectra_check_parameters 278 279 280 281 !------------------------------------------------------------------------------! 282 ! Description: 283 ! ------------ 284 !> Header output for spectra 285 !> 286 !> @todo Output of netcdf data format and compression level 287 !------------------------------------------------------------------------------! 288 SUBROUTINE spectra_header ( io ) 289 290 USE control_parameters, & 291 ONLY: dt_averaging_input_pr 292 293 ! USE netcdf_interface, & 294 ! ONLY: netcdf_data_format_string, netcdf_deflate 295 296 IMPLICIT NONE 297 298 CHARACTER (LEN=40) :: output_format !< internal string 299 300 INTEGER(iwp) :: i !< internal counter 301 INTEGER(iwp), INTENT(IN) :: io !< Unit of the output file 302 303 ! 304 !-- Spectra output 305 IF ( dt_dosp /= 9999999.9_wp ) THEN 306 WRITE ( io, 1 ) 307 308 ! output_format = netcdf_data_format_string 309 ! IF ( netcdf_deflate == 0 ) THEN 310 ! WRITE ( io, 2 ) output_format 311 ! ELSE 312 ! WRITE ( io, 3 ) TRIM( output_format ), netcdf_deflate 313 ! ENDIF 314 WRITE ( io, 2 ) 'see profiles or other quantities' 315 WRITE ( io, 4 ) dt_dosp 316 IF ( skip_time_dosp /= 0.0_wp ) WRITE ( io, 5 ) skip_time_dosp 317 WRITE ( io, 6 ) ( data_output_sp(i), i = 1,10 ), & 318 ( spectra_direction(i), i = 1,10 ), & 319 ( comp_spectra_level(i), i = 1,100 ), & 320 averaging_interval_sp, dt_averaging_input_pr 321 ENDIF 322 323 1 FORMAT (' Spectra:') 324 2 FORMAT (' Output format: ',A/) 325 3 FORMAT (' Output format: ',A, ' compressed with level: ',I1/) 326 4 FORMAT (' Output every ',F7.1,' s'/) 327 5 FORMAT (' No output during initial ',F8.2,' s') 328 6 FORMAT (' Arrays: ', 10(A5,',')/ & 329 ' Directions: ', 10(A5,',')/ & 330 ' height levels k = ', 20(I3,',')/ & 331 ' ', 20(I3,',')/ & 332 ' ', 20(I3,',')/ & 333 ' ', 20(I3,',')/ & 334 ' ', 19(I3,','),I3,'.'/ & 335 ' Time averaged over ', F7.1, ' s,' / & 336 ' Profiles for the time averaging are taken every ', & 337 F6.1,' s') 338 339 END SUBROUTINE spectra_header 340 341 159 342 160 343 SUBROUTINE calc_spectra … … 164 347 165 348 USE control_parameters, & 166 ONLY: average_count_sp,bc_lr_cyc, bc_ns_cyc, message_string, psolver349 ONLY: bc_lr_cyc, bc_ns_cyc, message_string, psolver 167 350 168 351 USE cpulog, & … … 191 374 192 375 CALL cpu_log( log_point(30), 'calc_spectra', 'start' ) 376 377 ! 378 !-- Initialize spectra related quantities 379 CALL spectra_init 193 380 194 381 ! … … 308 495 309 496 USE statistics, & 310 ONLY: hom , var_d497 ONLY: hom 311 498 312 499 … … 411 598 ONLY: comm2d, ierr, myid 412 599 413 USE statistics, &414 ONLY: spectrum_x, var_d415 416 600 USE transpose_indices, & 417 601 ONLY: nyn_x, nys_x, nzb_x, nzt_x … … 554 738 ONLY: comm2d, ierr, myid 555 739 556 USE statistics, &557 ONLY: spectrum_y, var_d558 559 740 USE transpose_indices, & 560 741 ONLY: nxl_yd, nxr_yd, nzb_yd, nzt_yd … … 669 850 END SUBROUTINE calc_spectra_y 670 851 671 END MODULE spectr um852 END MODULE spectra_mod -
palm/trunk/SOURCE/time_integration.f90
r1832 r1833 19 19 ! Current revisions: 20 20 ! ------------------ 21 ! 21 ! spectrum renamed spectra_mod, spectra related variables moved to spectra_mod 22 22 ! 23 23 ! Former revisions: … … 207 207 USE control_parameters, & 208 208 ONLY: advected_distance_x, advected_distance_y, average_count_3d, & 209 averag e_count_sp, averaging_interval, averaging_interval_pr,&210 averaging_interval_sp, bc_lr_cyc, bc_ns_cyc, bc_pt_t_val,&209 averaging_interval, averaging_interval_pr, & 210 bc_lr_cyc, bc_ns_cyc, bc_pt_t_val, & 211 211 bc_q_t_val, call_psolver_at_all_substeps, cloud_droplets, & 212 212 cloud_physics, constant_flux_layer, constant_heatflux, & … … 217 217 dt_coupling, dt_data_output_av, dt_disturb, dt_do2d_xy, & 218 218 dt_do2d_xz, dt_do2d_yz, dt_do3d, dt_domask,dt_dopts, dt_dopr, & 219 dt_dopr_listing, dt_do sp, dt_dots, dt_dvrp, dt_run_control,&219 dt_dopr_listing, dt_dots, dt_dvrp, dt_run_control, & 220 220 end_time, first_call_lpm, galilei_transformation, humidity, & 221 221 intermediate_timestep_count, & … … 229 229 skip_time_do2d_xy, skip_time_do2d_xz, skip_time_do2d_yz, & 230 230 skip_time_do3d, skip_time_domask, skip_time_dopr, & 231 skip_time_d osp, skip_time_data_output_av, sloping_surface,&231 skip_time_data_output_av, sloping_surface, & 232 232 stop_dt, terminate_coupled, terminate_run, timestep_scheme, & 233 233 time_coupling, time_do2d_xy, time_do2d_xz, time_do2d_yz, & … … 292 292 skip_time_do_radiation, time_radiation 293 293 294 USE spectrum, & 295 ONLY: calc_spectra 294 USE spectra_mod, & 295 ONLY: average_count_sp, averaging_interval_sp, calc_spectra, dt_dosp, & 296 skip_time_dosp 296 297 297 298 USE statistics, & -
palm/trunk/SOURCE/user_parin.f90
r1818 r1833 19 19 ! Current revisions: 20 20 ! ----------------- 21 ! 21 ! required interface revision changed 22 22 ! 23 23 ! Former revisions: … … 92 92 !-- current revision does not match with previous revisions (e.g. if routines 93 93 !-- have been added/deleted or if parameter lists in subroutines have been changed). 94 user_interface_current_revision = 'r1 783'94 user_interface_current_revision = 'r1819' 95 95 96 96 ! -
palm/trunk/SOURCE/user_spectra.f90
r1818 r1833 19 19 ! Current revisions: 20 20 ! ----------------- 21 ! 21 ! spectrum renamed spectra_mod 22 22 ! 23 23 ! Former revisions: … … 59 59 USE kinds 60 60 61 USE spectr um61 USE spectra_mod 62 62 63 63 USE statistics -
palm/trunk/SOURCE/write_3d_binary.f90
r1823 r1833 19 19 ! Current revisions: 20 20 ! ----------------- 21 ! 21 ! statistics module replaced by spectra module 22 22 ! 23 23 ! Former revisions: … … 134 134 ONLY: id_random_array, seq_random_array 135 135 136 USE s tatistics,&136 USE spectra_mod, & 137 137 ONLY: spectrum_x, spectrum_y 138 138 -
palm/trunk/SOURCE/write_var_list.f90
r1832 r1833 19 19 ! Current revisions: 20 20 ! ----------------- 21 ! spectra_mod added 21 22 ! 22 23 ! … … 172 173 173 174 USE radiation_model_mod, & 174 ONLY: time_radiation 175 ONLY: time_radiation 176 177 USE spectra_mod, & 178 ONLY: average_count_sp 175 179 176 180 USE statistics, &
Note: See TracChangeset
for help on using the changeset viewer.