From 7ce5207959117c68c7f137ce23f43de55c3cc2dc Mon Sep 17 00:00:00 2001 From: Benjamin Auer Date: Mon, 13 Jun 2022 16:20:47 -0400 Subject: [PATCH] fixes #1565 --- CHANGELOG.md | 1 + gridcomps/History/MAPL_HistoryGridComp.F90 | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9864344ee9fd..3da56956c14a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Update CI to work with latest GEOSadas `develop` (Uses a special branch of GEOSadas) - Fix bundleio tests +- HistoryGridComp now checks if a file exists already before writing and errors out if so ### Added diff --git a/gridcomps/History/MAPL_HistoryGridComp.F90 b/gridcomps/History/MAPL_HistoryGridComp.F90 index 2076ddb621e0..a9cf19c1f9b6 100644 --- a/gridcomps/History/MAPL_HistoryGridComp.F90 +++ b/gridcomps/History/MAPL_HistoryGridComp.F90 @@ -3365,7 +3365,7 @@ subroutine Run ( gc, import, export, clock, rc ) integer :: sec ! variables for "backwards" mode - logical :: fwd + logical :: fwd, file_exists logical, allocatable :: Ignore(:) ! ErrLog vars @@ -3605,6 +3605,10 @@ subroutine Run ( gc, import, export, clock, rc ) list(n)%currentFile = filename(n) else if( list(n)%unit.eq.0 ) then + inquire (file=trim(filename(n)),exist=file_exists) + if (file_exists) then + _FAIL(trim(filename(n))//" being created for History output already exists") + end if if (list(n)%format == 'CFIO') then call list(n)%mGriddedIO%modifyTime(oClients=o_Clients,rc=status) _VERIFY(status)