Skip to content

Feature: Ability to set desired NetCDF output precision from config#105

Merged
fmalatino merged 4 commits intoNOAA-GFDL:developfrom
fmalatino:feature/config_netcdf
Mar 13, 2025
Merged

Feature: Ability to set desired NetCDF output precision from config#105
fmalatino merged 4 commits intoNOAA-GFDL:developfrom
fmalatino:feature/config_netcdf

Conversation

@fmalatino
Copy link
Copy Markdown
Contributor

Description
This PR introduces methods for setting the desired precision of output when using the netcdf output format. Within a config file, the precision can be specified as follows:

diagnostics_config:
  path: output
  output_format: netcdf
  precision: Float | float32 |float64

The Float option will use whatever is the current value of the PACE_FLOAT_PRECISION environment variable for output precision.
The float32 option will set the output precision to be numpy.float32.
The float64 option will set the output precision to be numpy.float64.
The default option is Float.
The latter two options allow for instances when the desired run precision, as set by PACE_FLOAT_PRECISION, will be different than the required output precision.
If the combination of float64 is used with PACE_FLOAT_PRECISION = 32, a warning will be raised.

How Has This Been Tested?
Tested using the current set of unit tests in the workflow CI

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

@fmalatino fmalatino requested review from bensonr and oelbert March 5, 2025 16:02
Copy link
Copy Markdown
Collaborator

@FlorianDeconinck FlorianDeconinck left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Copy Markdown
Collaborator

@oelbert oelbert left a comment

Choose a reason for hiding this comment

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

👍

@fmalatino fmalatino merged commit ea391f7 into NOAA-GFDL:develop Mar 13, 2025
2 checks passed
@fmalatino fmalatino deleted the feature/config_netcdf branch July 22, 2025 14:33
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.

3 participants