From 175664c0971fc786eb11a9a369036503141ba21f Mon Sep 17 00:00:00 2001 From: Benjamin Menetrier <30638301+benjaminmenetrier@users.noreply.github.com> Date: Wed, 28 Oct 2020 21:16:25 +0100 Subject: [PATCH] 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 --- src/saber/bump/type_obsop.F90 | 4 ++-- test/CMakeLists.txt | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/saber/bump/type_obsop.F90 b/src/saber/bump/type_obsop.F90 index 521e1d6d0..87a26f40c 100644 --- a/src/saber/bump/type_obsop.F90 +++ b/src/saber/bump/type_obsop.F90 @@ -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)) @@ -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)) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 9cccdd093..ff00b3d59 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -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() @@ -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