Changeset 2964 for palm/trunk/SOURCE/radiation_model_mod.f90
- Timestamp:
- Apr 12, 2018 4:04:03 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/radiation_model_mod.f90
r2963 r2964 28 28 ! ----------------- 29 29 ! $Id$ 30 ! Error message PA0491 has been introduced which could be previously found in 31 ! check_open. The variable numprocs_previous_run is only known in case of 32 ! initializing_actions == read_restart_data 33 ! 34 ! 2963 2018-04-12 14:47:44Z suehring 30 35 ! - Introduce index for vegetation/wall, pavement/green-wall and water/window 31 36 ! surfaces, for clearer access of surface fraction, albedo, emissivity, etc. . … … 6693 6698 6694 6699 DO i = 0, io_blocks-1 6695 IF ( i == io_group ) THEN 6696 6697 ! 6698 !-- Open binary file 6699 CALL check_open( fsvf ) 6700 6701 !-- read and check version 6702 READ ( fsvf ) rad_version_field 6703 IF ( TRIM(rad_version_field) /= TRIM(rad_version) ) THEN 6704 WRITE( message_string, * ) 'Version of binary SVF file "', & 6705 TRIM(rad_version_field), '" does not match ', & 6706 'the version of model "', TRIM(rad_version), '"' 6707 CALL message( 'radiation_read_svf', 'PA0482', 1, 2, 0, 6, 0 ) 6708 ENDIF 6709 6710 !-- read nsvfl, ncsfl 6711 READ ( fsvf ) nsvfl, ncsfl, nsurfl_from_file 6712 IF ( nsvfl <= 0 .OR. ncsfl < 0 ) THEN 6713 WRITE( message_string, * ) 'Wrong number of SVF or CSF' 6714 CALL message( 'radiation_read_svf', 'PA0483', 1, 2, 0, 6, 0 ) 6715 ELSE 6716 WRITE(message_string,*) ' Number of SVF, CSF, and nsurfl to read '& 6717 , nsvfl, ncsfl, nsurfl 6718 CALL location_message( message_string, .TRUE. ) 6719 ENDIF 6720 IF ( nsurfl_from_file /= nsurfl ) THEN 6721 WRITE( message_string, * ) 'nsurfl from SVF file does not ', & 6722 'match calculated nsurfl from ', & 6723 'radiation_interaction_init' 6724 CALL message( 'radiation_read_svf', 'PA0490', 1, 2, 0, 6, 0 ) 6725 ENDIF 6726 6727 IF ( .NOT. ALLOCATED( skyvf ) ) ALLOCATE( skyvf(nsurfl) ) 6728 IF ( .NOT. ALLOCATED( skyvft ) ) ALLOCATE( skyvft(nsurfl) ) 6729 IF ( .NOT. ALLOCATED( svf ) ) ALLOCATE( svf(ndsvf,nsvfl) ) 6730 IF ( .NOT. ALLOCATED( svfsurf ) ) ALLOCATE( svfsurf(idsvf,nsvfl) ) 6731 READ(fsvf) skyvf 6732 READ(fsvf) skyvft 6733 READ(fsvf) svf 6734 READ(fsvf) svfsurf 6735 IF ( plant_canopy ) THEN 6736 IF ( .NOT. ALLOCATED( csf ) ) ALLOCATE( csf(ndcsf,ncsfl) ) 6737 IF ( .NOT. ALLOCATED( csfsurf ) ) ALLOCATE( csfsurf(idcsf,ncsfl) ) 6738 READ(fsvf) csf 6739 READ(fsvf) csfsurf 6740 ENDIF 6741 READ ( fsvf ) svf_code_field 6742 6743 IF ( TRIM(svf_code_field) /= TRIM(svf_code) ) THEN 6744 WRITE( message_string, * ) 'Wrong structure of binary svf file' 6745 CALL message( 'radiation_read_svf', 'PA0484', 1, 2, 0, 6, 0 ) 6746 ENDIF 6700 IF ( i == io_group ) THEN 6701 6702 IF ( initializing_actions == 'read_restart_data' ) THEN 6703 6704 IF ( numprocs_previous_run /= numprocs ) THEN 6705 WRITE( message_string, * ) 'A different number of processors', & 6706 ' between the run that has written', & 6707 ' the svf data and the one that will', & 6708 ' read it is not allowed' 6709 CALL message( 'check_open', 'PA0491', 1, 2, 0, 6, 0 ) 6710 ENDIF 6711 6712 ENDIF 6713 ! 6714 !-- Open binary file 6715 CALL check_open( fsvf ) 6716 6717 !-- read and check version 6718 READ ( fsvf ) rad_version_field 6719 IF ( TRIM(rad_version_field) /= TRIM(rad_version) ) THEN 6720 WRITE( message_string, * ) 'Version of binary SVF file "', & 6721 TRIM(rad_version_field), '" does not match ', & 6722 'the version of model "', TRIM(rad_version), '"' 6723 CALL message( 'radiation_read_svf', 'PA0482', 1, 2, 0, 6, 0 ) 6724 ENDIF 6725 6726 !-- read nsvfl, ncsfl 6727 READ ( fsvf ) nsvfl, ncsfl, nsurfl_from_file 6728 IF ( nsvfl <= 0 .OR. ncsfl < 0 ) THEN 6729 WRITE( message_string, * ) 'Wrong number of SVF or CSF' 6730 CALL message( 'radiation_read_svf', 'PA0483', 1, 2, 0, 6, 0 ) 6731 ELSE 6732 WRITE(message_string,*) ' Number of SVF, CSF, and nsurfl to read '& 6733 , nsvfl, ncsfl, nsurfl 6734 CALL location_message( message_string, .TRUE. ) 6735 ENDIF 6736 IF ( nsurfl_from_file /= nsurfl ) THEN 6737 WRITE( message_string, * ) 'nsurfl from SVF file does not ', & 6738 'match calculated nsurfl from ', & 6739 'radiation_interaction_init' 6740 CALL message( 'radiation_read_svf', 'PA0490', 1, 2, 0, 6, 0 ) 6741 ENDIF 6742 6743 IF ( .NOT. ALLOCATED( skyvf ) ) ALLOCATE( skyvf(nsurfl) ) 6744 IF ( .NOT. ALLOCATED( skyvft ) ) ALLOCATE( skyvft(nsurfl) ) 6745 IF ( .NOT. ALLOCATED( svf ) ) ALLOCATE( svf(ndsvf,nsvfl) ) 6746 IF ( .NOT. ALLOCATED( svfsurf ) ) ALLOCATE( svfsurf(idsvf,nsvfl) ) 6747 READ(fsvf) skyvf 6748 READ(fsvf) skyvft 6749 READ(fsvf) svf 6750 READ(fsvf) svfsurf 6751 IF ( plant_canopy ) THEN 6752 IF ( .NOT. ALLOCATED( csf ) ) ALLOCATE( csf(ndcsf,ncsfl) ) 6753 IF ( .NOT. ALLOCATED( csfsurf ) ) ALLOCATE( csfsurf(idcsf,ncsfl) ) 6754 READ(fsvf) csf 6755 READ(fsvf) csfsurf 6756 ENDIF 6757 READ ( fsvf ) svf_code_field 6758 6759 IF ( TRIM(svf_code_field) /= TRIM(svf_code) ) THEN 6760 WRITE( message_string, * ) 'Wrong structure of binary svf file' 6761 CALL message( 'radiation_read_svf', 'PA0484', 1, 2, 0, 6, 0 ) 6762 ENDIF 6747 6763 ! 6748 6764 !-- Close binary file 6749 6765 CALL close_file( fsvf ) 6750 6766 6751 6767 ENDIF 6752 6768 #if defined( __parallel ) 6753 6769 CALL MPI_BARRIER( comm2d, ierr )
Note: See TracChangeset
for help on using the changeset viewer.