Changeset 2906 for palm/trunk/SOURCE
- Timestamp:
- Mar 19, 2018 8:56:40 AM (7 years ago)
- Location:
- palm/trunk/SOURCE
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/check_open.f90
r2718 r2906 25 25 ! ----------------- 26 26 ! $Id$ 27 ! CASE 88 and 89 has been added for the input/output of sky view factors 28 ! 29 ! 2718 2018-01-02 08:49:38Z maronga 27 30 ! Corrected "Former revisions" section 28 31 ! … … 512 515 FORM='UNFORMATTED', POSITION='APPEND', IOSTAT=ioerr ) 513 516 IF ( ioerr /= 0 ) THEN 514 WRITE( 9, * ) '*** could not open "PARTICLE_DATA'// &515 TRIM( coupling_char )//'/'//myid_char// &517 WRITE( 9, * ) '*** could not open "PARTICLE_DATA'// & 518 TRIM( coupling_char )//'/'//myid_char// & 516 519 '"! Trying again in 1 sec.' 517 520 CALL fortran_sleep( 1 ) … … 533 536 WRITE ( 85 ) particle_groups 534 537 WRITE ( 85 ) nxl, nxr, nys, nyn, nzb, nzt, nbgp 538 ENDIF 539 540 ! 541 !-- File where sky-view factors and further required data is stored will be 542 !-- read 543 CASE ( 88 ) 544 545 IF (numprocs_previous_run /= numprocs) THEN 546 WRITE( message_string, * ) 'A different number of processors', & 547 ' between the run that has written', & 548 ' the svf data and the one that will ',& 549 ' read it is not allowed' 550 CALL message( 'check_open', 'PA0484', 1, 2, 0, 6, 0 ) 551 ENDIF 552 553 IF ( myid_char == '' ) THEN 554 OPEN ( 88, FILE='SVFIN'//TRIM( coupling_char )//myid_char, & 555 FORM='UNFORMATTED', STATUS='OLD', IOSTAT=ioerr ) 556 ELSE 557 558 OPEN ( 88, FILE='SVFIN'//TRIM( coupling_char )//'/'//myid_char, & 559 FORM='UNFORMATTED', STATUS='OLD', IOSTAT=ioerr ) 560 ENDIF 561 562 ! 563 !-- File where sky-view factors and further required data is stored will be 564 !-- created 565 CASE ( 89 ) 566 567 IF ( myid_char == '' ) THEN 568 OPEN ( 89, FILE='SVFOUT'//TRIM( coupling_char )//myid_char, & 569 FORM='UNFORMATTED', STATUS='NEW' ) 570 ELSE 571 IF ( myid == 0 .AND. .NOT. openfile(file_id)%opened_before ) THEN 572 CALL local_system( 'mkdir SVFOUT' // TRIM( coupling_char ) ) 573 ENDIF 574 #if defined( __parallel ) 575 ! 576 !-- Set a barrier in order to allow that all other processors in the 577 !-- directory created by PE0 can open their file 578 CALL MPI_BARRIER( comm2d, ierr ) 579 #endif 580 ioerr = 1 581 DO WHILE ( ioerr /= 0 ) 582 OPEN ( 89, FILE='SVFOUT'//TRIM(coupling_char)//'/'//myid_char, & 583 FORM='UNFORMATTED', STATUS='NEW', IOSTAT=ioerr ) 584 IF ( ioerr /= 0 ) THEN 585 WRITE( 9, * ) '*** could not open "BINOUT'// & 586 TRIM(coupling_char)//'/'//myid_char// & 587 '"! Trying again in 1 sec.' 588 CALL fortran_sleep( 1 ) 589 ENDIF 590 ENDDO 591 535 592 ENDIF 536 593 -
palm/trunk/SOURCE/init_3d_model.f90
r2894 r2906 25 25 ! ----------------- 26 26 ! $Id$ 27 ! The variables read/write_svf_on_init have been removed. Instead ENVIRONMENT 28 ! variables read/write_svf have been introduced. Location_message has been 29 ! added. 30 ! 31 ! 2894 2018-03-15 09:17:58Z Giersch 27 32 ! Renamed routines with respect to reading restart data, file 13 is closed in 28 33 ! rrd_read_parts_of_global now … … 474 479 ONLY: dots_max, dots_num, dots_unit, dots_label 475 480 476 USE netcdf_data_input_mod, 481 USE netcdf_data_input_mod, & 477 482 ONLY: init_3d, netcdf_data_input_interpolate, netcdf_data_input_init_3d 478 483 … … 487 492 USE radiation_model_mod, & 488 493 ONLY: radiation_init, radiation, radiation_control, radiation_scheme, & 489 read_svf_on_init, & 490 write_svf_on_init, radiation_calc_svf, radiation_write_svf, & 494 radiation_calc_svf, radiation_write_svf, & 491 495 radiation_interaction, radiation_interactions, & 492 496 radiation_interaction_init, radiation_read_svf … … 2356 2360 ! 2357 2361 !-- If required, read or calculate and write out the SVF 2358 IF ( radiation_interactions .AND. read_svf_on_init) THEN2362 IF ( radiation_interactions .AND. read_svf) THEN 2359 2363 ! 2360 2364 !-- Read sky-view factors and further required data from file … … 2363 2367 CALL location_message( ' Reading SVF from file has finished', .TRUE. ) 2364 2368 2365 ELSEIF ( radiation_interactions ) THEN2369 ELSEIF ( radiation_interactions .AND. .NOT. read_svf) THEN 2366 2370 ! 2367 2371 !-- calculate SFV and CSF … … 2371 2375 ENDIF 2372 2376 2373 IF ( radiation_interactions .AND. write_svf_on_init) THEN2377 IF ( radiation_interactions .AND. write_svf) THEN 2374 2378 ! 2375 2379 !-- Write svf, csf svfsurf and csfsurf data to file 2380 CALL location_message( ' Start writing SVF in file', .FALSE. ) 2376 2381 CALL radiation_write_svf() 2382 CALL location_message( ' Writing SVF in file has finished', .TRUE. ) 2377 2383 ENDIF 2378 2384 -
palm/trunk/SOURCE/modules.f90
r2894 r2906 25 25 ! ----------------- 26 26 ! $Id$ 27 ! Module control_parameters has been extended with ENVIRONMENT variables 28 ! read/write_svf 29 ! 30 ! 2894 2018-03-15 09:17:58Z Giersch 27 31 ! _prerun flags were removed, Control paramters restart_string and length have 28 32 ! been added … … 1298 1302 LOGICAL :: rans_tke_e = .FALSE. !< use TKE-e turbulence closure for RANS mode 1299 1303 LOGICAL :: rans_tke_l = .FALSE. !< use TKE-l turbulence closure for RANS mode 1304 LOGICAL :: read_svf = .FALSE. !< ENVPAR namelist parameter to steer input of svf (ENVPAR is created by palmrun) 1300 1305 LOGICAL :: recycling_yshift = .FALSE. !< namelist parameter 1301 1306 LOGICAL :: run_control_header = .FALSE. !< onetime output of RUN_CONTROL header … … 1327 1332 LOGICAL :: wall_adjustment = .TRUE. !< namelist parameter 1328 1333 LOGICAL :: wind_turbine = .FALSE. !< flag for use of wind turbine model 1329 LOGICAL :: write_binary = .FALSE. !< ENVPAR namelist parameter to steer restart I/O (ENVPAR is created by mrun) 1334 LOGICAL :: write_binary = .FALSE. !< ENVPAR namelist parameter to steer restart I/O (ENVPAR is created by palmrun) 1335 LOGICAL :: write_svf = .FALSE. !< ENVPAR namelist parameter to steer output of svf (ENVPAR is created by palmrun) 1330 1336 LOGICAL :: ws_scheme_sca = .FALSE. !< use Wicker-Skamarock scheme (scalar advection)? 1331 1337 LOGICAL :: ws_scheme_mom = .FALSE. !< use Wicker-Skamarock scheme (momentum advection)? -
palm/trunk/SOURCE/parin.f90
r2894 r2906 25 25 ! ----------------- 26 26 ! $Id$ 27 ! ENVIRONMENT variables read/write_svf has been added 28 ! 29 ! 2894 2018-03-15 09:17:58Z Giersch 27 30 ! read_var_list has been renamed to rrd_global, all module related _parin 28 31 ! routines are called before reading the global restart data to overwrite them … … 542 545 NAMELIST /envpar/ batch_job, host, local_dvrserver_running, & 543 546 maximum_cpu_time_allowed, maximum_parallel_io_streams, & 544 revision, run_identifier, tasks_per_node, write_binary 547 read_svf, revision, run_identifier, tasks_per_node, & 548 write_binary, write_svf 545 549 546 550 ! -
palm/trunk/SOURCE/radiation_model_mod.f90
r2894 r2906 25 25 ! ----------------- 26 26 ! $Id$ 27 ! NAMELIST paramter read/write_svf_on_init have been removed, functions 28 ! check_open and close_file are used now for opening/closing files related to 29 ! svf data, adjusted unit number and error numbers 30 ! 31 ! 2894 2018-03-15 09:17:58Z Giersch 27 32 ! Calculations of the index range of the subdomain on file which overlaps with 28 33 ! the current subdomain are already done in read_restart_data_mod … … 650 655 LOGICAL :: energy_balance_surf_h = .TRUE. !< flag parameter indicating wheather the energy balance is calculated for horizontal surfaces 651 656 LOGICAL :: energy_balance_surf_v = .TRUE. !< flag parameter indicating wheather the energy balance is calculated for vertical surfaces 652 LOGICAL :: read_svf_on_init = .FALSE. !< flag parameter indicating wheather SVFs will be read from a file at initialization653 LOGICAL :: write_svf_on_init = .FALSE. !< flag parameter indicating wheather SVFs will be written out to a file654 657 LOGICAL :: mrt_factors = .FALSE. !< whether to generate MRT factor files during init 655 658 INTEGER(iwp) :: nrefsteps = 0 !< number of reflection steps to perform … … 885 888 zenith, calc_zenith, sun_direction, sun_dir_lat, sun_dir_lon, & 886 889 split_diffusion_radiation, & 887 energy_balance_surf_h, energy_balance_surf_v, write_svf_on_init,&888 read_svf_on_init, nrefsteps, mrt_factors, dist_max_svf, nsvfl, svf,&890 energy_balance_surf_h, energy_balance_surf_v, & 891 nrefsteps, mrt_factors, dist_max_svf, nsvfl, svf, & 889 892 svfsurf, surfinsw, surfinlw, surfins, surfinl, surfinswdir, & 890 893 surfinswdif, surfoutsw, surfoutlw, surfinlwdif, rad_sw_in_dir, & … … 2801 2804 energy_balance_surf_h, & 2802 2805 energy_balance_surf_v, & 2803 read_svf_on_init, &2804 2806 nrefsteps, & 2805 write_svf_on_init, &2806 2807 mrt_factors, & 2807 2808 dist_max_svf, & … … 6612 6613 SUBROUTINE radiation_read_svf 6613 6614 6614 IMPLICIT NONE 6615 INTEGER(iwp) :: fsvf = 89 6616 INTEGER(iwp) :: i 6617 CHARACTER(usm_version_len) :: usm_version_field 6618 CHARACTER(svf_code_len) :: svf_code_field 6619 6620 DO i = 0, io_blocks-1 6621 IF ( i == io_group ) THEN 6622 OPEN ( fsvf, FILE='SVFIN'//TRIM(coupling_char)//'/'//myid_char,& 6623 form='unformatted', status='old' ) 6624 6625 !-- read and check version 6626 READ ( fsvf ) usm_version_field 6627 IF ( TRIM(usm_version_field) /= TRIM(usm_version) ) THEN 6628 WRITE( message_string, * ) 'Version of binary SVF file "', & 6629 TRIM(usm_version_field), '" does not match ', & 6630 'the version of model "', TRIM(usm_version), '"' 6631 CALL message( 'radiation_read_svf', 'UI0012', 1, 2, 0, 6, 0 ) 6632 ENDIF 6615 IMPLICIT NONE 6616 INTEGER(iwp) :: fsvf = 88 6617 INTEGER(iwp) :: i 6618 CHARACTER(usm_version_len) :: usm_version_field 6619 CHARACTER(svf_code_len) :: svf_code_field 6620 6621 DO i = 0, io_blocks-1 6622 IF ( i == io_group ) THEN 6623 6624 ! 6625 !-- Open binary file 6626 CALL check_open( fsvf ) 6627 6628 6629 !-- read and check version 6630 READ ( fsvf ) usm_version_field 6631 IF ( TRIM(usm_version_field) /= TRIM(usm_version) ) THEN 6632 WRITE( message_string, * ) 'Version of binary SVF file "', & 6633 TRIM(usm_version_field), '" does not match ', & 6634 'the version of model "', TRIM(usm_version), '"' 6635 CALL message( 'radiation_read_svf', 'PA0482', 1, 2, 0, 6, 0 ) 6636 ENDIF 6633 6637 6634 !-- 6635 6636 6637 6638 CALL message( 'radiation_read_svf', 'UI0012', 1, 2, 0, 6, 0 )6639 6640 6641 6642 6638 !-- read nsvfl, ncsfl 6639 READ ( fsvf ) nsvfl, ncsfl 6640 IF ( nsvfl <= 0 .OR. ncsfl < 0 ) THEN 6641 WRITE( message_string, * ) 'Wrong number of SVF or CSF' 6642 CALL message( 'radiation_read_svf', 'PA0483', 1, 2, 0, 6, 0 ) 6643 ELSE 6644 WRITE(message_string,*) ' Number of SVF and CSF to read', nsvfl, ncsfl 6645 CALL location_message( message_string, .TRUE. ) 6646 ENDIF 6643 6647 6644 ALLOCATE(svf(ndsvf,nsvfl)) 6645 ALLOCATE(svfsurf(idsvf,nsvfl)) 6646 READ(fsvf) svf 6647 READ(fsvf) svfsurf 6648 IF ( plant_canopy ) THEN 6649 ALLOCATE(csf(ndcsf,ncsfl)) 6650 ALLOCATE(csfsurf(idcsf,ncsfl)) 6651 READ(fsvf) csf 6652 READ(fsvf) csfsurf 6653 ENDIF 6654 READ ( fsvf ) svf_code_field 6648 ALLOCATE(svf(ndsvf,nsvfl)) 6649 ALLOCATE(svfsurf(idsvf,nsvfl)) 6650 6651 READ(fsvf) svf 6652 READ(fsvf) svfsurf 6653 6654 IF ( plant_canopy ) THEN 6655 ALLOCATE(csf(ndcsf,ncsfl)) 6656 ALLOCATE(csfsurf(idcsf,ncsfl)) 6657 READ(fsvf) csf 6658 READ(fsvf) csfsurf 6659 ENDIF 6660 6661 READ ( fsvf ) svf_code_field 6662 IF ( TRIM(svf_code_field) /= TRIM(svf_code) ) THEN 6663 WRITE( message_string, * ) 'Wrong structure of binary svf file' 6664 CALL message( 'radiation_read_svf', 'PA0484', 1, 2, 0, 6, 0 ) 6665 ENDIF 6655 6666 6656 IF ( TRIM(svf_code_field) /= TRIM(svf_code) ) THEN 6657 WRITE( message_string, * ) 'Wrong structure of binary svf file' 6658 CALL message( 'radiation_read_svf', 'UI0012', 1, 2, 0, 6, 0 ) 6659 ENDIF 6667 ! 6668 !-- Close binary file 6669 CALL close_file( fsvf ) 6660 6670 6661 CLOSE (fsvf) 6662 6663 ENDIF 6671 ENDIF 6664 6672 #if defined( __parallel ) 6665 6673 CALL MPI_BARRIER( comm2d, ierr ) 6666 6674 #endif 6667 6675 ENDDO 6668 6676 6669 6677 END SUBROUTINE radiation_read_svf … … 6678 6686 SUBROUTINE radiation_write_svf 6679 6687 6680 IMPLICIT NONE 6681 INTEGER(iwp) :: fsvf = 89 6682 INTEGER(iwp) :: i 6683 6684 DO i = 0, io_blocks-1 6685 IF ( i == io_group ) THEN 6686 OPEN ( fsvf, FILE='SVFOUT'//TRIM( coupling_char )//'/'//myid_char, & 6687 form='unformatted', status='new' ) 6688 6689 WRITE ( fsvf ) usm_version 6690 WRITE ( fsvf ) nsvfl, ncsfl 6691 WRITE ( fsvf ) svf 6692 WRITE ( fsvf ) svfsurf 6693 IF ( plant_canopy ) THEN 6694 WRITE ( fsvf ) csf 6695 WRITE ( fsvf ) csfsurf 6696 ENDIF 6697 WRITE ( fsvf ) TRIM(svf_code) 6698 6699 CLOSE (fsvf) 6688 6689 IMPLICIT NONE 6690 6691 INTEGER(iwp) :: fsvf = 89 6692 INTEGER(iwp) :: i 6693 6694 6695 DO i = 0, io_blocks-1 6696 IF ( i == io_group ) THEN 6697 6698 ! 6699 !-- Open binary file 6700 CALL check_open( fsvf ) 6701 6702 WRITE ( fsvf ) usm_version 6703 WRITE ( fsvf ) nsvfl, ncsfl 6704 WRITE ( fsvf ) svf 6705 WRITE ( fsvf ) svfsurf 6706 IF ( plant_canopy ) THEN 6707 WRITE ( fsvf ) csf 6708 WRITE ( fsvf ) csfsurf 6709 ENDIF 6710 WRITE ( fsvf ) TRIM(svf_code) 6711 6712 ! 6713 !-- Close binary file 6714 CALL close_file( fsvf ) 6715 6716 ENDIF 6700 6717 #if defined( __parallel ) 6701 6718 CALL MPI_BARRIER( comm2d, ierr ) 6702 6719 #endif 6703 ENDIF 6704 ENDDO 6720 ENDDO 6705 6721 6706 6722 END SUBROUTINE radiation_write_svf -
palm/trunk/SOURCE/urban_surface_mod.f90
r2894 r2906 26 26 ! ----------------- 27 27 ! $Id$ 28 ! Local variable ids has to be initialized with a value of -1 in 29 ! usm_average_3d_data 30 ! 31 ! 2894 2018-03-15 09:17:58Z Giersch 28 32 ! Calculations of the index range of the subdomain on file which overlaps with 29 33 ! the current subdomain are already done in read_restart_data_mod, … … 1177 1181 1178 1182 !-- find the real name of the variable 1183 ids = -1 1179 1184 var = TRIM(variable) 1180 1185 DO i = 0, nd-1
Note: See TracChangeset
for help on using the changeset viewer.