Skip to content

Commit 02a55cb

Browse files
authored
NETCDF Large File Support now default (wrf-model#112)
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.
1 parent 8a24af9 commit 02a55cb

File tree

3 files changed

+61
-61
lines changed

3 files changed

+61
-61
lines changed

configure

+3-3
Original file line numberDiff line numberDiff line change
@@ -730,10 +730,10 @@ if test -n "$NETCDF" ; then
730730
fi
731731
grep nf_format_64bit $NETCDF/include/netcdf.inc > /dev/null
732732
configure_aaaa=$? ; export configure_aaaa
733-
if [ $configure_aaaa -a -z "$WRFIO_NCD_LARGE_FILE_SUPPORT" ] ; then
733+
if [ $configure_aaaa -a -z "$WRFIO_NCD_NO_LARGE_FILE_SUPPORT" ] ; then
734734
echo "NetCDF users note:"
735-
echo " This installation of NetCDF supports large file support. To enable large file"
736-
echo " support in NetCDF, set the environment variable WRFIO_NCD_LARGE_FILE_SUPPORT"
735+
echo " This installation of NetCDF supports large file support. To DISABLE large file"
736+
echo " support in NetCDF, set the environment variable WRFIO_NCD_NO_LARGE_FILE_SUPPORT"
737737
echo " to 1 and run configure again. Set to any other value to avoid this message."
738738
fi
739739
fi

external/io_netcdf/wrf_io.F90

+6-6
Original file line numberDiff line numberDiff line change
@@ -1351,21 +1351,21 @@ SUBROUTINE ext_ncd_open_for_write_begin(FileName,Comm,IOComm,SysDepInfo,DataHand
13511351
if ( DH%use_netcdf_classic ) then
13521352
write(msg,*) 'output will be in classic NetCDF format'
13531353
call wrf_debug ( WARN , TRIM(msg))
1354-
#ifdef WRFIO_NCD_LARGE_FILE_SUPPORT
1355-
stat = NF_CREATE(FileName, IOR(NF_CLOBBER,NF_64BIT_OFFSET), DH%NCID)
1356-
#else
1354+
#ifdef WRFIO_NCD_NO_LARGE_FILE_SUPPORT
13571355
stat = NF_CREATE(FileName, NF_CLOBBER, DH%NCID)
1356+
#else
1357+
stat = NF_CREATE(FileName, IOR(NF_CLOBBER,NF_64BIT_OFFSET), DH%NCID)
13581358
#endif
13591359
else
13601360
create_mode = nf_netcdf4
13611361
stat = NF_CREATE(FileName, create_mode, DH%NCID)
13621362
stat = NF_SET_CHUNK_CACHE(cache_size, cache_nelem, cache_preemption)
13631363
endif
13641364
#else
1365-
#ifdef WRFIO_NCD_LARGE_FILE_SUPPORT
1366-
stat = NF_CREATE(FileName, IOR(NF_CLOBBER,NF_64BIT_OFFSET), DH%NCID)
1367-
#else
1365+
#ifdef WRFIO_NCD_NO_LARGE_FILE_SUPPORT
13681366
stat = NF_CREATE(FileName, NF_CLOBBER, DH%NCID)
1367+
#else
1368+
stat = NF_CREATE(FileName, IOR(NF_CLOBBER,NF_64BIT_OFFSET), DH%NCID)
13691369
#endif
13701370
#endif
13711371
call netcdf_err(stat,Status)

hydro/Routing/module_HYDRO_io.F

+52-52
Original file line numberDiff line numberDiff line change
@@ -1729,12 +1729,12 @@ subroutine output_rt(igrid, split_output_count, ixrt, jxrt, nsoil, &
17291729
#ifdef HYDRO_D
17301730
print*, 'output_flnm = "'//trim(output_flnm)//'"'
17311731
#endif
1732-
#ifdef WRFIO_NCD_LARGE_FILE_SUPPORT
1733-
write(6,*) "using large netcdf file for RTOUT_DOMAIN"
1734-
iret = nf_create(trim(output_flnm), IOR(NF_CLOBBER,NF_64BIT_OFFSET), ncid)
1735-
#else
1732+
#ifdef WRFIO_NCD_NO_LARGE_FILE_SUPPORT
17361733
write(6,*) "using normal netcdf file for RTOUT_DOMAIN"
17371734
iret = nf_create(trim(output_flnm), NF_CLOBBER, ncid)
1735+
#else
1736+
write(6,*) "using large netcdf file for RTOUT_DOMAIN"
1737+
iret = nf_create(trim(output_flnm), IOR(NF_CLOBBER,NF_64BIT_OFFSET), ncid)
17381738
#endif
17391739
if (iret /= 0) then
17401740
call hydro_stop("In output_rt() - Problem nf_create")
@@ -2240,10 +2240,10 @@ subroutine output_gw_spinup(igrid, split_output_count, ixrt, jxrt, &
22402240
#endif
22412241
22422242
2243-
#ifdef WRFIO_NCD_LARGE_FILE_SUPPORT
2244-
iret = nf_create(trim(output_flnm), IOR(NF_CLOBBER,NF_64BIT_OFFSET), ncid)
2245-
#else
2243+
#ifdef WRFIO_NCD_NO_LARGE_FILE_SUPPORT
22462244
iret = nf_create(trim(output_flnm), NF_CLOBBER, ncid)
2245+
#else
2246+
iret = nf_create(trim(output_flnm), IOR(NF_CLOBBER,NF_64BIT_OFFSET), ncid)
22472247
#endif
22482248
22492249
if (iret /= 0) then
@@ -2585,10 +2585,10 @@ subroutine sub_output_gw(igrid, split_output_count, ixrt, jxrt, nsoil, &
25852585
#endif
25862586
25872587
2588-
#ifdef WRFIO_NCD_LARGE_FILE_SUPPORT
2589-
iret = nf_create(trim(output_flnm), IOR(NF_CLOBBER,NF_64BIT_OFFSET), ncid)
2590-
#else
2588+
#ifdef WRFIO_NCD_NO_LARGE_FILE_SUPPORT
25912589
iret = nf_create(trim(output_flnm), NF_CLOBBER, ncid)
2590+
#else
2591+
iret = nf_create(trim(output_flnm), IOR(NF_CLOBBER,NF_64BIT_OFFSET), ncid)
25922592
#endif
25932593
25942594
if (iret /= 0) then
@@ -3008,19 +3008,19 @@ subroutine output_chrt(igrid, split_output_count, NLINKS, ORDER, &
30083008
print*, 'output_flnm = "'//trim(output_flnm)//'"'
30093009
#endif
30103010
3011-
#ifdef WRFIO_NCD_LARGE_FILE_SUPPORT
3012-
iret = nf_create(trim(output_flnm), IOR(NF_CLOBBER,NF_64BIT_OFFSET), ncid)
3013-
#else
3011+
#ifdef WRFIO_NCD_NO_LARGE_FILE_SUPPORT
30143012
iret = nf_create(trim(output_flnm), NF_CLOBBER, ncid)
3013+
#else
3014+
iret = nf_create(trim(output_flnm), IOR(NF_CLOBBER,NF_64BIT_OFFSET), ncid)
30153015
#endif
30163016
if (iret /= 0) then
30173017
call hydro_stop("In output_chrt() - Problem nf_create points")
30183018
endif
30193019
3020-
#ifdef WRFIO_NCD_LARGE_FILE_SUPPORT
3021-
iret = nf_create(trim(output_flnm2), IOR(NF_CLOBBER,NF_64BIT_OFFSET), ncid2)
3022-
#else
3020+
#ifdef WRFIO_NCD_NO_LARGE_FILE_SUPPORT
30233021
iret = nf_create(trim(output_flnm2), NF_CLOBBER, ncid2)
3022+
#else
3023+
iret = nf_create(trim(output_flnm2), IOR(NF_CLOBBER,NF_64BIT_OFFSET), ncid2)
30243024
#endif
30253025
if (iret /= 0) then
30263026
call hydro_stop("In output_chrt() - Problem nf_create observation")
@@ -3718,19 +3718,19 @@ subroutine output_chrt_bak(igrid, split_output_count, NLINKS, ORDER,
37183718
print*, 'output_flnm = "'//trim(output_flnm)//'"'
37193719
#endif
37203720
3721-
#ifdef WRFIO_NCD_LARGE_FILE_SUPPORT
3722-
iret = nf_create(trim(output_flnm), IOR(NF_CLOBBER,NF_64BIT_OFFSET), ncid)
3723-
#else
3721+
#ifdef WRFIO_NCD_NO_LARGE_FILE_SUPPORT
37243722
iret = nf_create(trim(output_flnm), NF_CLOBBER, ncid)
3723+
#else
3724+
iret = nf_create(trim(output_flnm), IOR(NF_CLOBBER,NF_64BIT_OFFSET), ncid)
37253725
#endif
37263726
if (iret /= 0) then
37273727
call hydro_stop("In output_chrt() - Problem nf_create points")
37283728
endif
37293729
3730-
#ifdef WRFIO_NCD_LARGE_FILE_SUPPORT
3731-
iret = nf_create(trim(output_flnm2), IOR(NF_CLOBBER,NF_64BIT_OFFSET), ncid2)
3732-
#else
3730+
#ifdef WRFIO_NCD_NO_LARGE_FILE_SUPPORT
37333731
iret = nf_create(trim(output_flnm2), NF_CLOBBER, ncid2)
3732+
#else
3733+
iret = nf_create(trim(output_flnm2), IOR(NF_CLOBBER,NF_64BIT_OFFSET), ncid2)
37343734
#endif
37353735
if (iret /= 0) then
37363736
call hydro_stop("In output_chrt() - Problem nf_create observation")
@@ -4578,10 +4578,10 @@ subroutine output_lakes(igrid, split_output_count, NLAKES, &
45784578
print*, 'output_flnm = "'//trim(output_flnm)//'"'
45794579
#endif
45804580
4581-
#ifdef WRFIO_NCD_LARGE_FILE_SUPPORT
4582-
iret = nf_create(trim(output_flnm), IOR(NF_CLOBBER,NF_64BIT_OFFSET), ncid)
4583-
#else
4581+
#ifdef WRFIO_NCD_NO_LARGE_FILE_SUPPORT
45844582
iret = nf_create(trim(output_flnm), NF_CLOBBER, ncid)
4583+
#else
4584+
iret = nf_create(trim(output_flnm), IOR(NF_CLOBBER,NF_64BIT_OFFSET), ncid)
45854585
#endif
45864586
45874587
if (iret /= 0) then
@@ -4818,10 +4818,10 @@ subroutine output_lakes2(igrid, split_output_count, NLAKES, &
48184818
print*, 'output_flnm = "'//trim(output_flnm)//'"'
48194819
#endif
48204820
4821-
#ifdef WRFIO_NCD_LARGE_FILE_SUPPORT
4822-
iret = nf_create(trim(output_flnm), IOR(NF_CLOBBER,NF_64BIT_OFFSET), ncid)
4823-
#else
4821+
#ifdef WRFIO_NCD_NO_LARGE_FILE_SUPPORT
48244822
iret = nf_create(trim(output_flnm), NF_CLOBBER, ncid)
4823+
#else
4824+
iret = nf_create(trim(output_flnm), IOR(NF_CLOBBER,NF_64BIT_OFFSET), ncid)
48254825
#endif
48264826
48274827
if (iret /= 0) then
@@ -5042,10 +5042,10 @@ subroutine output_chrtgrd(igrid, split_output_count, ixrt,jxrt, &
50425042

50435043

50445044
!--- define dimension
5045-
#ifdef WRFIO_NCD_LARGE_FILE_SUPPORT
5046-
iret = nf_create(trim(output_flnm), IOR(NF_CLOBBER,NF_64BIT_OFFSET), ncid)
5047-
#else
5045+
#ifdef WRFIO_NCD_NO_LARGE_FILE_SUPPORT
50485046
iret = nf_create(trim(output_flnm), NF_CLOBBER, ncid)
5047+
#else
5048+
iret = nf_create(trim(output_flnm), IOR(NF_CLOBBER,NF_64BIT_OFFSET), ncid)
50495049
#endif
50505050

50515051
if (iret /= 0) then
@@ -5417,10 +5417,10 @@ subroutine output_lsm(outFile,did)
54175417
if(IO_id.eq.my_id) &
54185418
#endif
54195419

5420-
#ifdef WRFIO_NCD_LARGE_FILE_SUPPORT
5421-
iret = nf_create(trim(outFile), IOR(NF_CLOBBER,NF_64BIT_OFFSET), ncid)
5422-
#else
5420+
#ifdef WRFIO_NCD_NO_LARGE_FILE_SUPPORT
54235421
iret = nf_create(trim(outFile), NF_CLOBBER, ncid)
5422+
#else
5423+
iret = nf_create(trim(outFile), IOR(NF_CLOBBER,NF_64BIT_OFFSET), ncid)
54245424
#endif
54255425

54265426
#ifdef MPP_LAND
@@ -5519,16 +5519,16 @@ subroutine RESTART_OUT_nc(outFile,did)
55195519
if(IO_id.eq.my_id) &
55205520
#endif
55215521

5522-
#ifdef WRFIO_NCD_LARGE_FILE_SUPPORT
5523-
iret = nf_create(trim(outFile), IOR(NF_CLOBBER,NF_64BIT_OFFSET), ncid)
5522+
#ifdef WRFIO_NCD_NO_LARGE_FILE_SUPPORT
5523+
iret = nf_create(trim(outFile), NF_CLOBBER, ncid)
55245524
#ifdef HYDRO_D
5525-
write(6,*) "yyywww using large netcdf file definition. "
5525+
write(6,*) "yyywww do not use large netcdf file definition. "
55265526
call flush(6)
55275527
#endif
55285528
#else
5529-
iret = nf_create(trim(outFile), NF_CLOBBER, ncid)
5529+
iret = nf_create(trim(outFile), IOR(NF_CLOBBER,NF_64BIT_OFFSET), ncid)
55305530
#ifdef HYDRO_D
5531-
write(6,*) "yyywww do not use large netcdf file definition. "
5531+
write(6,*) "yyywww using large netcdf file definition. "
55325532
call flush(6)
55335533
#endif
55345534
#endif
@@ -8083,10 +8083,10 @@ subroutine outPutChanInfo(fromNode,toNode,chlon,chlat)
80838083
integer :: iret, nodes, i, ncid, dimid_n, varid
80848084
80858085
nodes = size(chlon,1)
8086-
#ifdef WRFIO_NCD_LARGE_FILE_SUPPORT
8087-
iret = nf_create("nodeInfor.nc", IOR(NF_CLOBBER,NF_64BIT_OFFSET), ncid)
8088-
#else
8086+
#ifdef WRFIO_NCD_NO_LARGE_FILE_SUPPORT
80898087
iret = nf_create("nodeInfor.nc", NF_CLOBBER, ncid)
8088+
#else
8089+
iret = nf_create("nodeInfor.nc", IOR(NF_CLOBBER,NF_64BIT_OFFSET), ncid)
80908090
#endif
80918091
iret = nf_def_dim(ncid, "node", nodes, dimid_n) !-- make a decimated grid
80928092
! define the varialbes
@@ -8801,10 +8801,10 @@ subroutine output_chrt2(igrid, split_output_count, NLINKS, ORDER, &
88018801
print*, 'output_flnm = "'//trim(output_flnm)//'"'
88028802
#endif
88038803
8804-
#ifdef WRFIO_NCD_LARGE_FILE_SUPPORT
8805-
iret = nf_create(trim(output_flnm), IOR(NF_CLOBBER,NF_64BIT_OFFSET), ncid)
8806-
#else
8804+
#ifdef WRFIO_NCD_NO_LARGE_FILE_SUPPORT
88078805
iret = nf_create(trim(output_flnm), NF_CLOBBER, ncid)
8806+
#else
8807+
iret = nf_create(trim(output_flnm), IOR(NF_CLOBBER,NF_64BIT_OFFSET), ncid)
88088808
#endif
88098809
if (iret /= 0) then
88108810
print*, "Problem nf_create points"
@@ -9180,10 +9180,10 @@ subroutine output_gw_netcdf(igrid, split_output_count, nbasns, &
91809180
print*, 'output_flnm = "'//trim(output_flnm)//'"'
91819181
#endif
91829182
9183-
#ifdef WRFIO_NCD_LARGE_FILE_SUPPORT
9184-
iret = nf_create(trim(output_flnm), IOR(NF_CLOBBER,NF_64BIT_OFFSET), ncid)
9185-
#else
9183+
#ifdef WRFIO_NCD_NO_LARGE_FILE_SUPPORT
91869184
iret = nf_create(trim(output_flnm), NF_CLOBBER, ncid)
9185+
#else
9186+
iret = nf_create(trim(output_flnm), IOR(NF_CLOBBER,NF_64BIT_OFFSET), ncid)
91879187
#endif
91889188
91899189
if (iret /= 0) then
@@ -9865,12 +9865,12 @@ subroutine output_lake_types( inNLINKS, inLINKID, inTYPEL )
98659865
flush(6)
98669866
#endif
98679867
9868-
#ifdef WRFIO_NCD_LARGE_FILE_SUPPORT
9869-
write(6,*) "using large netcdf file for LAKE TYPES"
9870-
iret = nf_create(trim(output_flnm), ior(NF_CLOBBER,NF_64BIT_OFFSET), ncid)
9871-
#else
9868+
#ifdef WRFIO_NCD_NO_LARGE_FILE_SUPPORT
98729869
write(6,*) "using normal netcdf file for LAKE TYPES"
98739870
iret = nf_create(trim(output_flnm), NF_CLOBBER, ncid)
9871+
#else
9872+
write(6,*) "using large netcdf file for LAKE TYPES"
9873+
iret = nf_create(trim(output_flnm), ior(NF_CLOBBER,NF_64BIT_OFFSET), ncid)
98749874
#endif
98759875
98769876
if (iret /= 0) then

0 commit comments

Comments
 (0)