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