Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/split_ncvars/split_ncvars.pl.in
Original file line number Diff line number Diff line change
Expand Up @@ -495,10 +495,15 @@ foreach my $file (@ifiles) {
} ### end of variable loop ###

#--- extract fields for single file option ---
# Hard-code Netcdf-3 output format for single-file option
# FRE uses the single-file option exclusively for creating the static pp file, which does not work properly with Netcdf-4. This error results:
# ERROR NC_ELATEFILL (formerly NC_EFILLVALUE) Attempt to define fill value when data already exists
# HINT: NC_ELATEFILL errors can occur when NCO attempts to create, modify, or overwrite a _FillValue attribute
# for an existing variable in a netCDF4 file. The netCDF4 format (unlike netCDF3) does not permit this.
if ( $Opt{onefile} ) {
my $vlist = join ",", @vlist;
print "$ncks -h -A -v $vlist $file $Opt{onefile}\n" if $Opt{VERBOSE} > 0;
system("$ncks -h -A -v $vlist $file $Opt{onefile}");
print "$ncks -6 -h -A -v $vlist $file $Opt{onefile}\n" if $Opt{VERBOSE} > 0;
system("$ncks -6 -h -A -v $vlist $file $Opt{onefile}");
$ncstatus += $?;

my @ncatted_opts = set_ncatted_opts( $Opt{onefile}, tailname( $Opt{onefile} ) );
Expand Down