Ignore:
Timestamp:
Mar 19, 2018 8:56:40 AM (4 years ago)
Author:
Giersch
Message:

new procedure for reading/writing svf data, initialization of local variable ids

File:
1 edited

Legend:

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

    r2718 r2906  
    2525! -----------------
    2626! $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
    2730! Corrected "Former revisions" section
    2831!
     
    512515                           FORM='UNFORMATTED', POSITION='APPEND', IOSTAT=ioerr )
    513516                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//      &
    516519                                  '"! Trying again in 1 sec.'
    517520                   CALL fortran_sleep( 1 )
     
    533536             WRITE ( 85 )  particle_groups
    534537             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
    535592          ENDIF
    536593
Note: See TracChangeset for help on using the changeset viewer.