Changeset 478e9e6 in flexpart.git for src


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

Location:
src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/concoutput.f90

    r5f9d14a r478e9e6  
    9797  real,parameter :: weightair=28.97
    9898  logical :: sp_zer
     99  LOGICAL,save :: init=.true.
    99100  character :: adate*8,atime*6
    100101  character(len=3) :: anspec
    101102  integer :: mind
    102103! mind        eso:added to ensure identical results between 2&3-fields versions
    103 
     104  CHARACTER(LEN=8),save :: file_stat='REPLACE'
    104105
    105106  ! Determine current calendar date, needed for the file name
     
    110111  write(adate,'(i8.8)') jjjjmmdd
    111112  write(atime,'(i6.6)') ihmmss
    112   open(unitdates,file=path(2)(1:length(2))//'dates', ACCESS='APPEND')
     113  OPEN(unitdates,file=path(2)(1:length(2))//'dates', ACCESS='APPEND', STATUS=file_stat)
    113114  write(unitdates,'(a)') adate//atime
    114115  close(unitdates) 
     116
     117  ! Overwrite existing dates file on first call, later append to it
     118  ! This fixes a bug where the dates file kept growing across multiple runs
     119  ! TODO check if the 'always APPEND'-behaviour is useful in other scenarioes
     120  ! e.g. (restart?)
     121  IF (init) THEN
     122    file_stat='OLD'
     123    init=.false.
     124  END IF
     125
     126
    115127
    116128  ! For forward simulations, output fields have dimension MAXSPEC,
  • 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