Changeset 2964


Ignore:
Timestamp:
Apr 12, 2018 4:04:03 PM (6 years ago)
Author:
Giersch
Message:

Bugfix in the calculation of fixed number of output time levels for parallel netcdf output, error message related to reading sky view factors revised

Location:
palm/trunk/SOURCE
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • palm/trunk/SOURCE/check_open.f90

    r2957 r2964  
    2525! -----------------
    2626! $Id$
     27! Error message moved to radiation_model_mod
     28!
     29! 2957 2018-04-11 08:48:06Z Giersch
    2730! Error message has been corrected in case of writing sky view factors
    2831!
     
    167170
    168171    USE control_parameters,                                                    &
    169         ONLY:  coupling_char, data_output_2d_on_each_pe, max_masks,            &
    170                message_string, mid, nz_do3d, openfile, run_description_header, &
    171                runnr
     172        ONLY:  coupling_char, data_output_2d_on_each_pe,                       &
     173               max_masks, message_string, mid, nz_do3d, openfile,              &
     174               run_description_header, runnr
    172175
    173176    USE grid_variables,                                                        &
     
    546549       CASE ( 88 )
    547550
    548           IF (numprocs_previous_run /= numprocs) THEN
    549              WRITE( message_string, * ) 'A different number of processors',    &
    550                                         ' between the run that has written',   &
    551                                         ' the svf data and the one that will ',&
    552                                         ' read it is not allowed'
    553              CALL message( 'check_open', 'PA0484', 1, 2, 0, 6, 0 )
    554           ENDIF
    555 
    556551          IF ( myid_char == '' )  THEN
    557552             OPEN ( 88, FILE='SVFIN'//TRIM( coupling_char )//myid_char,        &
     
    887882!--       actual run.
    888883          INQUIRE( FILE=filename, EXIST=netcdf_extend )
    889 
    890884          IF ( netcdf_extend )  THEN
    891885!
  • palm/trunk/SOURCE/check_parameters.f90

    r2938 r2964  
    2525! -----------------
    2626! $Id$
     27! Calculation of fixed number of output time levels for parallel netcdf output
     28! has been revised (based on calculations in netcdf_interface_mod)
     29!
     30! 2938 2018-03-27 15:52:42Z suehring
    2731! - Revise start and end indices for imposing random disturbances in case of
    2832!   nesting or large-scale forcing.
     
    36893693       CALL check_dt_do( dt_do2d_yz, 'dt_do2d_yz' )
    36903694
    3691        ntdim_3d(0)    = CEILING( ( end_time - skip_time_do3d ) / dt_do3d )
     3695!--    Set needed time levels (ntdim) to
     3696!--    saved time levels + to be saved time levels.
     3697       ntdim_3d(0) = do3d_time_count(0) + CEILING(                             &
     3698                     ( end_time - MAX( skip_time_do3d,                         &
     3699                                       simulated_time_at_begin )               &
     3700                     ) / dt_do3d )
    36923701       IF ( do3d_at_begin ) ntdim_3d(0) = ntdim_3d(0) + 1
    3693        ntdim_3d(1)    = CEILING( ( end_time - skip_time_data_output_av )           &
    3694                              / dt_data_output_av )
    3695        ntdim_2d_xy(0) = CEILING( ( end_time - skip_time_do2d_xy ) / dt_do2d_xy )
    3696        ntdim_2d_xz(0) = CEILING( ( end_time - skip_time_do2d_xz ) / dt_do2d_xz )
    3697        ntdim_2d_yz(0) = CEILING( ( end_time - skip_time_do2d_yz ) / dt_do2d_yz )
     3702
     3703       ntdim_3d(1) = do3d_time_count(1) + CEILING(                             &
     3704                     ( end_time - MAX( skip_time_data_output_av,               &
     3705                                       simulated_time_at_begin )               &
     3706                     ) / dt_data_output_av )
     3707
     3708       ntdim_2d_xy(0) = do2d_xy_time_count(0) + CEILING(                       &
     3709                        ( end_time - MAX( skip_time_do2d_xy,                   &
     3710                                          simulated_time_at_begin )            &
     3711                        ) / dt_do2d_xy )
     3712
     3713       ntdim_2d_xz(0) = do2d_xz_time_count(0) + CEILING(                       &
     3714                        ( end_time - MAX( skip_time_do2d_xz,                   &
     3715                                          simulated_time_at_begin )            &
     3716                        ) / dt_do2d_xz )
     3717
     3718       ntdim_2d_yz(0) = do2d_yz_time_count(0) + CEILING(                       &
     3719                        ( end_time - MAX( skip_time_do2d_yz,                   &
     3720                                          simulated_time_at_begin )            &
     3721                        ) / dt_do2d_yz )
     3722
    36983723       IF ( do2d_at_begin )  THEN
    36993724          ntdim_2d_xy(0) = ntdim_2d_xy(0) + 1
     
    37013726          ntdim_2d_yz(0) = ntdim_2d_yz(0) + 1
    37023727       ENDIF
    3703        ntdim_2d_xy(1) = ntdim_3d(1)
    3704        ntdim_2d_xz(1) = ntdim_3d(1)
    3705        ntdim_2d_yz(1) = ntdim_3d(1)
     3728
     3729       ntdim_2d_xy(1) = do2d_xy_time_count(1) + CEILING(                       &
     3730                        ( end_time - MAX( skip_time_data_output_av,            &
     3731                                          simulated_time_at_begin )            &
     3732                        ) / dt_data_output_av )
     3733
     3734       ntdim_2d_xz(1) = do2d_xz_time_count(1) + CEILING(                       &
     3735                        ( end_time - MAX( skip_time_data_output_av,            &
     3736                                          simulated_time_at_begin )            &
     3737                                 ) / dt_data_output_av )
     3738
     3739       ntdim_2d_yz(1) = do2d_yz_time_count(1) + CEILING(                       &
     3740                        ( end_time - MAX( skip_time_data_output_av,            &
     3741                                          simulated_time_at_begin )            &
     3742                        ) / dt_data_output_av )
    37063743
    37073744    ENDIF
  • palm/trunk/SOURCE/modules.f90

    r2918 r2964  
    2525! -----------------
    2626! $Id$
     27! *_time_count variables are all initialized with zero now
     28!
     29! 2918 2018-03-21 15:52:14Z gronemeier
    2730! -l_grid, -l_wall
    2831!
     
    11821185    INTEGER(iwp) ::  dist_nys(0:1)                               !< south boundary of disturbance region
    11831186    INTEGER(iwp) ::  do2d_no(0:1) = 0                            !< number of 2d output quantities
    1184     INTEGER(iwp) ::  do2d_xy_time_count(0:1)                     !< number of output intervals for 2d data (xy)
    1185     INTEGER(iwp) ::  do2d_xz_time_count(0:1)                     !< number of output intervals for 2d data (xz)
    1186     INTEGER(iwp) ::  do2d_yz_time_count(0:1)                     !< number of output intervals for 2d data (yz)
     1187    INTEGER(iwp) ::  do2d_xy_time_count(0:1) = 0                 !< number of output intervals for 2d data (xy)
     1188    INTEGER(iwp) ::  do2d_xz_time_count(0:1) = 0                 !< number of output intervals for 2d data (xz)
     1189    INTEGER(iwp) ::  do2d_yz_time_count(0:1) = 0                 !< number of output intervals for 2d data (yz)
    11871190    INTEGER(iwp) ::  do3d_no(0:1) = 0                            !< number of 3d output quantities
    1188     INTEGER(iwp) ::  do3d_time_count(0:1)                        !< number of output intervals for 3d data
     1191    INTEGER(iwp) ::  do3d_time_count(0:1) = 0                    !< number of output intervals for 3d data
    11891192    INTEGER(iwp) ::  domask_no(max_masks,0:1) = 0                !< number of masked output quantities
    11901193    INTEGER(iwp) ::  domask_time_count(max_masks,0:1)            !< number of output intervals for masked data
  • palm/trunk/SOURCE/netcdf_interface_mod.f90

    r2932 r2964  
    2525! -----------------
    2626! $Id$
     27! Calculation of fixed number of output time levels for parallel netcdf output
     28! has been moved completely to check_parameters
     29!
     30! 2932 2018-03-26 09:39:22Z maronga
    2731! Renamed inipar to initialization_parameters.
    2832!
     
    18301834          IF ( netcdf_data_format > 4 )  THEN
    18311835!
    1832 !--          Set needed time levels (ntdim) to
    1833 !--          saved time levels + to be saved time levels.
    1834              IF ( av == 0 )  THEN
    1835                 ntdim_3d(0) = do3d_time_count(0) + CEILING(                &
    1836                               ( end_time - MAX( skip_time_do3d,            &
    1837                                                 simulated_time_at_begin )  &
    1838                               ) / dt_do3d )
    1839                 IF ( do3d_at_begin )  ntdim_3d(0) = ntdim_3d(0) + 1
    1840              ELSE
    1841                 ntdim_3d(1) = do3d_time_count(1) + CEILING(                &
    1842                               ( end_time - MAX( skip_time_data_output_av,  &
    1843                                                 simulated_time_at_begin )  &
    1844                               ) / dt_data_output_av )
    1845              ENDIF
    1846 
    1847 !
    18481836!--          Check if the needed number of output time levels is increased
    18491837!--          compared to the number of time levels in the existing file.
     
    26062594          IF ( netcdf_data_format > 4 )  THEN
    26072595!
    2608 !--          Set needed time levels (ntdim) to
    2609 !--          saved time levels + to be saved time levels.
    2610              IF ( av == 0 )  THEN
    2611                 ntdim_2d_xy(0) = do2d_xy_time_count(0) + CEILING(             &
    2612                                  ( end_time - MAX( skip_time_do2d_xy,         &
    2613                                                    simulated_time_at_begin )  &
    2614                                  ) / dt_do2d_xy )
    2615                 IF ( do2d_at_begin )  ntdim_2d_xy(0) = ntdim_2d_xy(0) + 1
    2616              ELSE
    2617                 ntdim_2d_xy(1) = do2d_xy_time_count(1) + CEILING(             &
    2618                                  ( end_time - MAX( skip_time_data_output_av,  &
    2619                                                    simulated_time_at_begin )  &
    2620                                  ) / dt_data_output_av )
    2621              ENDIF
    2622 
    2623 !
    26242596!--          Check if the needed number of output time levels is increased
    26252597!--          compared to the number of time levels in the existing file.
     
    32653237          IF ( netcdf_data_format > 4 )  THEN
    32663238!
    3267 !--          Set needed time levels (ntdim) to
    3268 !--          saved time levels + to be saved time levels.
    3269              IF ( av == 0 )  THEN
    3270                 ntdim_2d_xz(0) = do2d_xz_time_count(0) + CEILING(             &
    3271                                  ( end_time - MAX( skip_time_do2d_xz,         &
    3272                                                    simulated_time_at_begin )  &
    3273                                  ) / dt_do2d_xz )
    3274                 IF ( do2d_at_begin )  ntdim_2d_xz(0) = ntdim_2d_xz(0) + 1
    3275              ELSE
    3276                 ntdim_2d_xz(1) = do2d_xz_time_count(1) + CEILING(             &
    3277                                  ( end_time - MAX( skip_time_data_output_av,  &
    3278                                                    simulated_time_at_begin )  &
    3279                                  ) / dt_data_output_av )
    3280              ENDIF
    3281 
    3282 !
    32833239!--          Check if the needed number of output time levels is increased
    32843240!--          compared to the number of time levels in the existing file.
     
    39273883          IF ( netcdf_data_format > 4 )  THEN
    39283884!
    3929 !--          Set needed time levels (ntdim) to
    3930 !--          saved time levels + to be saved time levels.
    3931              IF ( av == 0 )  THEN
    3932                 ntdim_2d_yz(0) = do2d_yz_time_count(0) + CEILING(             &
    3933                                  ( end_time - MAX( skip_time_do2d_yz,         &
    3934                                                    simulated_time_at_begin )  &
    3935                                  ) / dt_do2d_yz )
    3936                 IF ( do2d_at_begin )  ntdim_2d_yz(0) = ntdim_2d_yz(0) + 1
    3937              ELSE
    3938                 ntdim_2d_yz(1) = do2d_yz_time_count(1) + CEILING(             &
    3939                                  ( end_time - MAX( skip_time_data_output_av,  &
    3940                                                    simulated_time_at_begin )  &
    3941                                  ) / dt_data_output_av )
    3942              ENDIF
    3943 
    3944 !
    39453885!--          Check if the needed number of output time levels is increased
    39463886!--          compared to the number of time levels in the existing file.
  • palm/trunk/SOURCE/radiation_model_mod.f90

    r2963 r2964  
    2828! -----------------
    2929! $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
    3035! - Introduce index for vegetation/wall, pavement/green-wall and water/window
    3136!   surfaces, for clearer access of surface fraction, albedo, emissivity, etc. .
     
    66936698
    66946699        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       
    67476763!
    67486764!--          Close binary file                 
    67496765             CALL close_file( fsvf )
    67506766               
    6751             ENDIF
     6767           ENDIF
    67526768#if defined( __parallel )
    67536769            CALL MPI_BARRIER( comm2d, ierr )
Note: See TracChangeset for help on using the changeset viewer.