Changeset 478e9e6 in flexpart.git for src/concoutput_mpi.f90


Ignore:
Timestamp:
Sep 1, 2015, 9:31:33 AM (9 years ago)
Author:
Espen Sollum ATMOS <eso@…>
Branches:
master, 10.4.1_pesei, GFS_025, bugfixes+enhancements, dev, release-10, release-10.4.1, scaling-bug, univie
Children:
f55fdce
Parents:
cda0919
Message:

dates file is now created at program start, instead of appending to it if it already exists

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/concoutput_mpi.f90

    r5f9d14a r478e9e6  
    102102  real,parameter :: weightair=28.97
    103103  logical :: sp_zer
     104  LOGICAL,save :: init=.true.
    104105  character :: adate*8,atime*6
    105106  character(len=3) :: anspec
    106107  integer :: mind
    107108! mind        eso:added to ensure identical results between 2&3-fields versions
     109  CHARACTER(LEN=8),save :: file_stat='REPLACE'
    108110
    109111! Measure execution time
     
    118120  write(adate,'(i8.8)') jjjjmmdd
    119121  write(atime,'(i6.6)') ihmmss
    120   open(unitdates,file=path(2)(1:length(2))//'dates', ACCESS='APPEND')
     122  OPEN(unitdates,file=path(2)(1:length(2))//'dates', ACCESS='APPEND', STATUS=file_stat)
    121123  write(unitdates,'(a)') adate//atime
    122124  close(unitdates) 
     125
     126  ! Overwrite existing dates file on first call, later append to it
     127  ! This fixes a bug where the dates file kept growing across multiple runs
     128  ! TODO check if the 'always APPEND'-behaviour is useful in other scenarioes
     129  ! e.g. (restart?)
     130  IF (init) THEN
     131    file_stat='OLD'
     132    init=.false.
     133  END IF
     134
    123135
    124136! For forward simulations, output fields have dimension MAXSPEC,
Note: See TracChangeset for help on using the changeset viewer.
hosted by ZAMG