Skip to content

#361 Use Netcdf-3 64-bit offset format for split-ncvars single-file … #367

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ceblanton
Copy link
Contributor

@ceblanton ceblanton commented Jun 11, 2025

Description
split-ncvars's "single file output" option must use Netcdf-3 64-bit offset format. Bronx frepp exclusively uses the -f single-file option to create a static pp file containing variables from different history files. frepp scripts run split_ncvars.pl f looping over the source history files. With Netcdf-4, this usage reliably causes this error:

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.

Fixes #361

How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Please also note
any relevant details for your test configuration (e.g. compiler, OS). Include
enough information so someone can reproduce your tests.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules
  • New check tests, if applicable, are included
  • make distcheck passes

…option.

FRE uses split_ncvars.pl -f "single file option" to incrementally create
a static pp file, which fails when using Netcdf-4 format. The cause is that
the Netcdf-4 api is more strict w.r.t replacing fill values.
@ceblanton ceblanton requested review from mlee03 and underwoo June 12, 2025 14:14
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}");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-6 or -64?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

split_ncvars.pl appending feature does not work well with Netcdf-4
2 participants