Skip to content

Commit

Permalink
I/O issues on Hera (#20)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
benjaminmenetrier authored Oct 28, 2020
1 parent f28ddb9 commit 175664c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/saber/bump/type_obsop.F90
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ subroutine obsop_read(obsop,mpl,nam,geom)

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

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

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

! Write grid hash
call mpl%ncerr(subr,nf90_put_att(ncid,nf90_global,'grid_hash',geom%grid_hash))
Expand Down
8 changes: 6 additions & 2 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,11 @@ endif()

# If local path to testfiles is defined don't download
if( DEFINED ENV{LOCAL_PATH_JEDI_TESTFILES} )
set( SABER_TESTFILES_PATH $ENV{LOCAL_PATH_JEDI_TESTFILES}/saber/${GIT_BRANCH_SABER} )
if( EXISTS $ENV{LOCAL_PATH_JEDI_TESTFILES}/saber/${GIT_BRANCH_SABER} )
set( SABER_TESTFILES_PATH $ENV{LOCAL_PATH_JEDI_TESTFILES}/saber/${GIT_BRANCH_SABER} )
else()
set( SABER_TESTFILES_PATH $ENV{LOCAL_PATH_JEDI_TESTFILES}/saber/develop )
endif()
if( NOT EXISTS ${SABER_TESTFILES_PATH}/testdata )
message( FATAL_ERROR "Directory ${SABER_TESTFILES_PATH}/testdata is missing" )
endif()
Expand Down Expand Up @@ -216,7 +220,7 @@ execute_process( COMMAND bash ${CMAKE_BINARY_DIR}/bin/saber_setup.sh
${CMAKE_BINARY_DIR} )

# Download SABER data
if( NOT DEFINED LOCAL_PATH_TESTFILES_SABER )
if( NOT DEFINED ENV{LOCAL_PATH_JEDI_TESTFILES} )
message( STATUS "Download sources:" )

# Check whether the URLs exist or not
Expand Down

0 comments on commit 175664c

Please sign in to comment.