Skip to content

Commit

Permalink
NETCDF Large File Support now default (#112)
Browse files Browse the repository at this point in the history
TYPE: enhancement

KEYWORDS: NETCDF, WRFIO_NCD_LARGE_FILE_SUPPORT

SOURCE: internal

DESCRIPTION OF CHANGES:
The default behavior in WRF now assumes that the user will use LARGE FILE SUPPORT.  If a user wishes to disable this capability, then the user sets the env variable WRFIO_NCD_NO_LARGE_FILE_SUPPORT.  Basically, this is not the opposite of what WRF has done since forever.

LIST OF MODIFIED FILES: list of changed files (use `git diff --name-status master` to get formatted list)
M       configure
M       external/io_netcdf/wrf_io.F90
M       hydro/Routing/module_HYDRO_io.F

TESTS CONDUCTED:
1. Code builds.
  • Loading branch information
davegill committed Jan 13, 2017
1 parent 8a24af9 commit 02a55cb
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 61 deletions.
6 changes: 3 additions & 3 deletions configure
Expand Up @@ -730,10 +730,10 @@ if test -n "$NETCDF" ; then
fi
grep nf_format_64bit $NETCDF/include/netcdf.inc > /dev/null
configure_aaaa=$? ; export configure_aaaa
if [ $configure_aaaa -a -z "$WRFIO_NCD_LARGE_FILE_SUPPORT" ] ; then
if [ $configure_aaaa -a -z "$WRFIO_NCD_NO_LARGE_FILE_SUPPORT" ] ; then
echo "NetCDF users note:"
echo " This installation of NetCDF supports large file support. To enable large file"
echo " support in NetCDF, set the environment variable WRFIO_NCD_LARGE_FILE_SUPPORT"
echo " This installation of NetCDF supports large file support. To DISABLE large file"
echo " support in NetCDF, set the environment variable WRFIO_NCD_NO_LARGE_FILE_SUPPORT"
echo " to 1 and run configure again. Set to any other value to avoid this message."
fi
fi
Expand Down
12 changes: 6 additions & 6 deletions external/io_netcdf/wrf_io.F90
Expand Up @@ -1351,21 +1351,21 @@ SUBROUTINE ext_ncd_open_for_write_begin(FileName,Comm,IOComm,SysDepInfo,DataHand
if ( DH%use_netcdf_classic ) then
write(msg,*) 'output will be in classic NetCDF format'
call wrf_debug ( WARN , TRIM(msg))
#ifdef WRFIO_NCD_LARGE_FILE_SUPPORT
stat = NF_CREATE(FileName, IOR(NF_CLOBBER,NF_64BIT_OFFSET), DH%NCID)
#else
#ifdef WRFIO_NCD_NO_LARGE_FILE_SUPPORT
stat = NF_CREATE(FileName, NF_CLOBBER, DH%NCID)
#else
stat = NF_CREATE(FileName, IOR(NF_CLOBBER,NF_64BIT_OFFSET), DH%NCID)
#endif
else
create_mode = nf_netcdf4
stat = NF_CREATE(FileName, create_mode, DH%NCID)
stat = NF_SET_CHUNK_CACHE(cache_size, cache_nelem, cache_preemption)
endif
#else
#ifdef WRFIO_NCD_LARGE_FILE_SUPPORT
stat = NF_CREATE(FileName, IOR(NF_CLOBBER,NF_64BIT_OFFSET), DH%NCID)
#else
#ifdef WRFIO_NCD_NO_LARGE_FILE_SUPPORT
stat = NF_CREATE(FileName, NF_CLOBBER, DH%NCID)
#else
stat = NF_CREATE(FileName, IOR(NF_CLOBBER,NF_64BIT_OFFSET), DH%NCID)
#endif
#endif
call netcdf_err(stat,Status)
Expand Down
104 changes: 52 additions & 52 deletions hydro/Routing/module_HYDRO_io.F
Expand Up @@ -1729,12 +1729,12 @@ subroutine output_rt(igrid, split_output_count, ixrt, jxrt, nsoil, &
#ifdef HYDRO_D
print*, 'output_flnm = "'//trim(output_flnm)//'"'
#endif
#ifdef WRFIO_NCD_LARGE_FILE_SUPPORT
write(6,*) "using large netcdf file for RTOUT_DOMAIN"
iret = nf_create(trim(output_flnm), IOR(NF_CLOBBER,NF_64BIT_OFFSET), ncid)
#else
#ifdef WRFIO_NCD_NO_LARGE_FILE_SUPPORT
write(6,*) "using normal netcdf file for RTOUT_DOMAIN"
iret = nf_create(trim(output_flnm), NF_CLOBBER, ncid)
#else
write(6,*) "using large netcdf file for RTOUT_DOMAIN"
iret = nf_create(trim(output_flnm), IOR(NF_CLOBBER,NF_64BIT_OFFSET), ncid)
#endif
if (iret /= 0) then
call hydro_stop("In output_rt() - Problem nf_create")
Expand Down Expand Up @@ -2240,10 +2240,10 @@ subroutine output_gw_spinup(igrid, split_output_count, ixrt, jxrt, &
#endif
#ifdef WRFIO_NCD_LARGE_FILE_SUPPORT
iret = nf_create(trim(output_flnm), IOR(NF_CLOBBER,NF_64BIT_OFFSET), ncid)
#else
#ifdef WRFIO_NCD_NO_LARGE_FILE_SUPPORT
iret = nf_create(trim(output_flnm), NF_CLOBBER, ncid)
#else
iret = nf_create(trim(output_flnm), IOR(NF_CLOBBER,NF_64BIT_OFFSET), ncid)
#endif
if (iret /= 0) then
Expand Down Expand Up @@ -2585,10 +2585,10 @@ subroutine sub_output_gw(igrid, split_output_count, ixrt, jxrt, nsoil, &
#endif
#ifdef WRFIO_NCD_LARGE_FILE_SUPPORT
iret = nf_create(trim(output_flnm), IOR(NF_CLOBBER,NF_64BIT_OFFSET), ncid)
#else
#ifdef WRFIO_NCD_NO_LARGE_FILE_SUPPORT
iret = nf_create(trim(output_flnm), NF_CLOBBER, ncid)
#else
iret = nf_create(trim(output_flnm), IOR(NF_CLOBBER,NF_64BIT_OFFSET), ncid)
#endif
if (iret /= 0) then
Expand Down Expand Up @@ -3008,19 +3008,19 @@ subroutine output_chrt(igrid, split_output_count, NLINKS, ORDER, &
print*, 'output_flnm = "'//trim(output_flnm)//'"'
#endif
#ifdef WRFIO_NCD_LARGE_FILE_SUPPORT
iret = nf_create(trim(output_flnm), IOR(NF_CLOBBER,NF_64BIT_OFFSET), ncid)
#else
#ifdef WRFIO_NCD_NO_LARGE_FILE_SUPPORT
iret = nf_create(trim(output_flnm), NF_CLOBBER, ncid)
#else
iret = nf_create(trim(output_flnm), IOR(NF_CLOBBER,NF_64BIT_OFFSET), ncid)
#endif
if (iret /= 0) then
call hydro_stop("In output_chrt() - Problem nf_create points")
endif
#ifdef WRFIO_NCD_LARGE_FILE_SUPPORT
iret = nf_create(trim(output_flnm2), IOR(NF_CLOBBER,NF_64BIT_OFFSET), ncid2)
#else
#ifdef WRFIO_NCD_NO_LARGE_FILE_SUPPORT
iret = nf_create(trim(output_flnm2), NF_CLOBBER, ncid2)
#else
iret = nf_create(trim(output_flnm2), IOR(NF_CLOBBER,NF_64BIT_OFFSET), ncid2)
#endif
if (iret /= 0) then
call hydro_stop("In output_chrt() - Problem nf_create observation")
Expand Down Expand Up @@ -3718,19 +3718,19 @@ subroutine output_chrt_bak(igrid, split_output_count, NLINKS, ORDER,
print*, 'output_flnm = "'//trim(output_flnm)//'"'
#endif
#ifdef WRFIO_NCD_LARGE_FILE_SUPPORT
iret = nf_create(trim(output_flnm), IOR(NF_CLOBBER,NF_64BIT_OFFSET), ncid)
#else
#ifdef WRFIO_NCD_NO_LARGE_FILE_SUPPORT
iret = nf_create(trim(output_flnm), NF_CLOBBER, ncid)
#else
iret = nf_create(trim(output_flnm), IOR(NF_CLOBBER,NF_64BIT_OFFSET), ncid)
#endif
if (iret /= 0) then
call hydro_stop("In output_chrt() - Problem nf_create points")
endif
#ifdef WRFIO_NCD_LARGE_FILE_SUPPORT
iret = nf_create(trim(output_flnm2), IOR(NF_CLOBBER,NF_64BIT_OFFSET), ncid2)
#else
#ifdef WRFIO_NCD_NO_LARGE_FILE_SUPPORT
iret = nf_create(trim(output_flnm2), NF_CLOBBER, ncid2)
#else
iret = nf_create(trim(output_flnm2), IOR(NF_CLOBBER,NF_64BIT_OFFSET), ncid2)
#endif
if (iret /= 0) then
call hydro_stop("In output_chrt() - Problem nf_create observation")
Expand Down Expand Up @@ -4578,10 +4578,10 @@ subroutine output_lakes(igrid, split_output_count, NLAKES, &
print*, 'output_flnm = "'//trim(output_flnm)//'"'
#endif
#ifdef WRFIO_NCD_LARGE_FILE_SUPPORT
iret = nf_create(trim(output_flnm), IOR(NF_CLOBBER,NF_64BIT_OFFSET), ncid)
#else
#ifdef WRFIO_NCD_NO_LARGE_FILE_SUPPORT
iret = nf_create(trim(output_flnm), NF_CLOBBER, ncid)
#else
iret = nf_create(trim(output_flnm), IOR(NF_CLOBBER,NF_64BIT_OFFSET), ncid)
#endif
if (iret /= 0) then
Expand Down Expand Up @@ -4818,10 +4818,10 @@ subroutine output_lakes2(igrid, split_output_count, NLAKES, &
print*, 'output_flnm = "'//trim(output_flnm)//'"'
#endif
#ifdef WRFIO_NCD_LARGE_FILE_SUPPORT
iret = nf_create(trim(output_flnm), IOR(NF_CLOBBER,NF_64BIT_OFFSET), ncid)
#else
#ifdef WRFIO_NCD_NO_LARGE_FILE_SUPPORT
iret = nf_create(trim(output_flnm), NF_CLOBBER, ncid)
#else
iret = nf_create(trim(output_flnm), IOR(NF_CLOBBER,NF_64BIT_OFFSET), ncid)
#endif
if (iret /= 0) then
Expand Down Expand Up @@ -5042,10 +5042,10 @@ subroutine output_chrtgrd(igrid, split_output_count, ixrt,jxrt, &


!--- define dimension
#ifdef WRFIO_NCD_LARGE_FILE_SUPPORT
iret = nf_create(trim(output_flnm), IOR(NF_CLOBBER,NF_64BIT_OFFSET), ncid)
#else
#ifdef WRFIO_NCD_NO_LARGE_FILE_SUPPORT
iret = nf_create(trim(output_flnm), NF_CLOBBER, ncid)
#else
iret = nf_create(trim(output_flnm), IOR(NF_CLOBBER,NF_64BIT_OFFSET), ncid)
#endif

if (iret /= 0) then
Expand Down Expand Up @@ -5417,10 +5417,10 @@ subroutine output_lsm(outFile,did)
if(IO_id.eq.my_id) &
#endif

#ifdef WRFIO_NCD_LARGE_FILE_SUPPORT
iret = nf_create(trim(outFile), IOR(NF_CLOBBER,NF_64BIT_OFFSET), ncid)
#else
#ifdef WRFIO_NCD_NO_LARGE_FILE_SUPPORT
iret = nf_create(trim(outFile), NF_CLOBBER, ncid)
#else
iret = nf_create(trim(outFile), IOR(NF_CLOBBER,NF_64BIT_OFFSET), ncid)
#endif

#ifdef MPP_LAND
Expand Down Expand Up @@ -5519,16 +5519,16 @@ subroutine RESTART_OUT_nc(outFile,did)
if(IO_id.eq.my_id) &
#endif

#ifdef WRFIO_NCD_LARGE_FILE_SUPPORT
iret = nf_create(trim(outFile), IOR(NF_CLOBBER,NF_64BIT_OFFSET), ncid)
#ifdef WRFIO_NCD_NO_LARGE_FILE_SUPPORT
iret = nf_create(trim(outFile), NF_CLOBBER, ncid)
#ifdef HYDRO_D
write(6,*) "yyywww using large netcdf file definition. "
write(6,*) "yyywww do not use large netcdf file definition. "
call flush(6)
#endif
#else
iret = nf_create(trim(outFile), NF_CLOBBER, ncid)
iret = nf_create(trim(outFile), IOR(NF_CLOBBER,NF_64BIT_OFFSET), ncid)
#ifdef HYDRO_D
write(6,*) "yyywww do not use large netcdf file definition. "
write(6,*) "yyywww using large netcdf file definition. "
call flush(6)
#endif
#endif
Expand Down Expand Up @@ -8083,10 +8083,10 @@ subroutine outPutChanInfo(fromNode,toNode,chlon,chlat)
integer :: iret, nodes, i, ncid, dimid_n, varid
nodes = size(chlon,1)
#ifdef WRFIO_NCD_LARGE_FILE_SUPPORT
iret = nf_create("nodeInfor.nc", IOR(NF_CLOBBER,NF_64BIT_OFFSET), ncid)
#else
#ifdef WRFIO_NCD_NO_LARGE_FILE_SUPPORT
iret = nf_create("nodeInfor.nc", NF_CLOBBER, ncid)
#else
iret = nf_create("nodeInfor.nc", IOR(NF_CLOBBER,NF_64BIT_OFFSET), ncid)
#endif
iret = nf_def_dim(ncid, "node", nodes, dimid_n) !-- make a decimated grid
! define the varialbes
Expand Down Expand Up @@ -8801,10 +8801,10 @@ subroutine output_chrt2(igrid, split_output_count, NLINKS, ORDER, &
print*, 'output_flnm = "'//trim(output_flnm)//'"'
#endif
#ifdef WRFIO_NCD_LARGE_FILE_SUPPORT
iret = nf_create(trim(output_flnm), IOR(NF_CLOBBER,NF_64BIT_OFFSET), ncid)
#else
#ifdef WRFIO_NCD_NO_LARGE_FILE_SUPPORT
iret = nf_create(trim(output_flnm), NF_CLOBBER, ncid)
#else
iret = nf_create(trim(output_flnm), IOR(NF_CLOBBER,NF_64BIT_OFFSET), ncid)
#endif
if (iret /= 0) then
print*, "Problem nf_create points"
Expand Down Expand Up @@ -9180,10 +9180,10 @@ subroutine output_gw_netcdf(igrid, split_output_count, nbasns, &
print*, 'output_flnm = "'//trim(output_flnm)//'"'
#endif
#ifdef WRFIO_NCD_LARGE_FILE_SUPPORT
iret = nf_create(trim(output_flnm), IOR(NF_CLOBBER,NF_64BIT_OFFSET), ncid)
#else
#ifdef WRFIO_NCD_NO_LARGE_FILE_SUPPORT
iret = nf_create(trim(output_flnm), NF_CLOBBER, ncid)
#else
iret = nf_create(trim(output_flnm), IOR(NF_CLOBBER,NF_64BIT_OFFSET), ncid)
#endif
if (iret /= 0) then
Expand Down Expand Up @@ -9865,12 +9865,12 @@ subroutine output_lake_types( inNLINKS, inLINKID, inTYPEL )
flush(6)
#endif
#ifdef WRFIO_NCD_LARGE_FILE_SUPPORT
write(6,*) "using large netcdf file for LAKE TYPES"
iret = nf_create(trim(output_flnm), ior(NF_CLOBBER,NF_64BIT_OFFSET), ncid)
#else
#ifdef WRFIO_NCD_NO_LARGE_FILE_SUPPORT
write(6,*) "using normal netcdf file for LAKE TYPES"
iret = nf_create(trim(output_flnm), NF_CLOBBER, ncid)
#else
write(6,*) "using large netcdf file for LAKE TYPES"
iret = nf_create(trim(output_flnm), ior(NF_CLOBBER,NF_64BIT_OFFSET), ncid)
#endif
if (iret /= 0) then
Expand Down

0 comments on commit 02a55cb

Please sign in to comment.