Skip to content

Commit 175664c

Browse files
I/O issues on Hera (#20)
* Read-only mode for read_obsop and correct variable in test/CMakeLists.txt * Revert to develop if branch missing for local data * Add ENV for LOCAL_PATH_JEDI_TESTFILES
1 parent f28ddb9 commit 175664c

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/saber/bump/type_obsop.F90

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ subroutine obsop_read(obsop,mpl,nam,geom)
117117

118118
! Define file
119119
write(filename,'(a,a,i6.6,a,i6.6)') trim(nam%prefix),'_obs_',mpl%nproc,'-',mpl%myproc
120-
ncid = mpl%nc_file_create_or_open(subr,trim(nam%datadir)//'/'//trim(filename)//'.nc')
120+
call mpl%ncerr(subr,nf90_open(trim(nam%datadir)//'/'//trim(filename)//'.nc',nf90_nowrite,ncid))
121121

122122
! Check grid hash
123123
call mpl%ncerr(subr,nf90_get_att(ncid,nf90_global,'grid_hash',grid_hash))
@@ -161,7 +161,7 @@ subroutine obsop_write(obsop,mpl,nam,geom)
161161

162162
! Define file
163163
write(filename,'(a,a,i6.6,a,i6.6)') trim(nam%prefix),'_obs_',mpl%nproc,'-',mpl%myproc
164-
ncid = mpl%nc_file_create_or_open(subr,trim(nam%datadir)//'/'//trim(filename)//'.nc')
164+
ncid = mpl%nc_file_create_or_open(subr,trim(nam%datadir)//'/'//trim(filename)//'.nc')
165165

166166
! Write grid hash
167167
call mpl%ncerr(subr,nf90_put_att(ncid,nf90_global,'grid_hash',geom%grid_hash))

test/CMakeLists.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,11 @@ endif()
182182

183183
# If local path to testfiles is defined don't download
184184
if( DEFINED ENV{LOCAL_PATH_JEDI_TESTFILES} )
185-
set( SABER_TESTFILES_PATH $ENV{LOCAL_PATH_JEDI_TESTFILES}/saber/${GIT_BRANCH_SABER} )
185+
if( EXISTS $ENV{LOCAL_PATH_JEDI_TESTFILES}/saber/${GIT_BRANCH_SABER} )
186+
set( SABER_TESTFILES_PATH $ENV{LOCAL_PATH_JEDI_TESTFILES}/saber/${GIT_BRANCH_SABER} )
187+
else()
188+
set( SABER_TESTFILES_PATH $ENV{LOCAL_PATH_JEDI_TESTFILES}/saber/develop )
189+
endif()
186190
if( NOT EXISTS ${SABER_TESTFILES_PATH}/testdata )
187191
message( FATAL_ERROR "Directory ${SABER_TESTFILES_PATH}/testdata is missing" )
188192
endif()
@@ -216,7 +220,7 @@ execute_process( COMMAND bash ${CMAKE_BINARY_DIR}/bin/saber_setup.sh
216220
${CMAKE_BINARY_DIR} )
217221

218222
# Download SABER data
219-
if( NOT DEFINED LOCAL_PATH_TESTFILES_SABER )
223+
if( NOT DEFINED ENV{LOCAL_PATH_JEDI_TESTFILES} )
220224
message( STATUS "Download sources:" )
221225

222226
# Check whether the URLs exist or not

0 commit comments

Comments
 (0)