Skip to content

Conversation

@NeilBarton-NOAA
Copy link
Contributor

@NeilBarton-NOAA NeilBarton-NOAA commented Oct 30, 2025

Description

Addressing
NOAA-EMC/GFS#37
NOAA-EMC/GFS#36
NOAA-EMC/GFS#4
#4163

Reducing the I/O burden by reducing the number of variables, layers, and adding compression.
Also adds archiving for native subsets

Type of change

  • Bug fix (fixes something broken)
  • New feature (adds functionality)
  • Maintenance (code refactor, clean-up, new CI test, etc.)

Change characteristics

  • Is this a breaking change (a change in existing functionality)? NO
  • Does this change require a documentation update? NO
  • Does this change require an update to any of the following submodules? NO (If YES, please add a link to any PRs that are pending.)
    • EMC verif-global
    • GDAS
    • GFS-utils
    • GSI
    • GSI-monitor
    • GSI-utils
    • UFS-utils
    • UFS-weather-model
    • wxflow

How has this been tested?

Tested using C192mx025 SFS forecasts. This will be a draft until GFS testing can be done.

Checklist

  • Any dependent changes have been merged and published
  • 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 documented my code, including function, input, and output descriptions
  • My changes generate no new warnings
  • New and existing tests pass with my changes
  • [] This change is covered by an existing CI test or a new one has been added
  • Any new scripts have been added to the .github/CODEOWNERS file with owners
  • I have made corresponding changes to the system documentation if necessary

@NeilBarton-NOAA NeilBarton-NOAA marked this pull request as ready for review November 3, 2025 18:43
@NeilBarton-NOAA
Copy link
Contributor Author

GFS forecast tested with archiving changes. New interpolated_zgrid file needed, and is at

gaeac6:/gpfs/f6/sfs-emc/scratch/Neil.Barton/CODE/gw_ocnice_products_NeilBarton-NOAA/fix/interpolate_zgrid_30L.nc

copy:
- ["{{ EXECgfs }}/ocnicepost.x", "{{ DATA }}/"]
- ["{{ PARMgfs }}/post/ocnicepost.nml.jinja2", "{{ DATA }}/"]
{% if write_grib2 and write_netcdf %}
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't this be or instead of and?
Also, shouldn't the ocnicepost.nml.jinja2 file be conditioned based on the if-block?
I think the reason it it outside because the yaml wants atleast one item in the copy block.
In that case, the copy block itself should be conditioned on the if statement, no?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, I uploaded the change

- ["{{ DATA }}/ocean_subset.nc", "{{ COMOUT_OCEAN_NETCDF }}/{{ RUN }}.t{{ current_cycle | strftime('%H') }}z.tripolar.f{{ '%03d' % forecast_hour }}.nc"]
- ["{{ DATA }}/ocean_subset.nc", "{{ COMOUT_OCEAN_NETCDF }}/native/{{ RUN }}.t{{ current_cycle | strftime('%H') }}z.native.f{{ '%03d' % forecast_hour }}.nc"]
- ["{{ DATA }}/ocean_compressed.nc", "{{ COMIN_OCEAN_HISTORY }}/{{ RUN }}.t{{ current_cycle | strftime('%H') }}z.{{ interval }}hr_avg.f{{ '%03d' % forecast_hour }}.nc"]
{% if write_grib2 %}
Copy link
Contributor

Choose a reason for hiding this comment

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

Where is the data from write_netcdf being copied to?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't know. I don't think it was defined in the yaml file before my edits.

Copy link
Contributor

Choose a reason for hiding this comment

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

Correct. The requirement was to provide grib2 output to the users. The netcdf was considered as an intermediate by-product of ocnicepost.x
write_netcdf=True is only needed if we are going to ever give out interpolated netcdf products.

Copy link
Contributor

Choose a reason for hiding this comment

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

reminder that we need to add the section when write_netcdf = True to copy the interpolated netcdf files

- ["{{ DATA }}/ice_subset.nc", "{{ COMOUT_ICE_NETCDF }}/native/{{ RUN }}.t{{ current_cycle | strftime('%H') }}z.native.f{{ '%03d' % forecast_hour }}.nc"]
- ["{{ DATA }}/ice_compressed.nc", "{{ COMIN_ICE_HISTORY }}/{{ RUN }}.t{{ current_cycle | strftime('%H') }}z.{{ interval }}hr_avg.f{{ '%03d' % forecast_hour }}.nc"]
{% for grid in product_grids %}
{% if write_grib2 %}
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't the interpolated output data from write_netcdf=True be copied to COMOUT_ICE_NETCDF/grid?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

same as above

Copy link
Contributor

Choose a reason for hiding this comment

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

same reminder as above.

# save subsetted variables to a new netcdf file
ds_subset.to_netcdf(output_file)
# save subsetted variables to a new netcdf file and compress
default_compression = {"zlib": True, "complevel": 8}
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be configured in the oceanice_products.yaml

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the compression level? or to compress or not?

Copy link
Contributor

Choose a reason for hiding this comment

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

both.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

namelist options added

copy:
- ["{{ DATA }}/ice_subset.nc", "{{ COMOUT_ICE_NETCDF }}/native/{{ RUN }}.t{{ current_cycle | strftime('%H') }}z.tripolar.f{{ '%03d' % forecast_hour }}.nc"]
- ["{{ DATA }}/ice_subset.nc", "{{ COMOUT_ICE_NETCDF }}/native/{{ RUN }}.t{{ current_cycle | strftime('%H') }}z.native.f{{ '%03d' % forecast_hour }}.nc"]
- ["{{ DATA }}/ice_compressed.nc", "{{ COMIN_ICE_HISTORY }}/{{ RUN }}.t{{ current_cycle | strftime('%H') }}z.{{ interval }}hr_avg.f{{ '%03d' % forecast_hour }}.nc"]
Copy link
Contributor

Choose a reason for hiding this comment

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

Over-writing model history output?
I don't think this should be allowed because it looses provenance. Perhaps consider the model to write out compressed output in the first place.

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think NCO would accept that. I don't think we can overwrite what's in COM right?

Would it be possible to just compress what we subset in the product directory ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Compression to the products is included in this PR. Compression for the history files can be removed.

The model uses pnetcdf2, which to my knowledge cannot be compressed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

compression of history files removed

Copy link
Contributor

Choose a reason for hiding this comment

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

Still see the compressed files are overwriting history files.

NeilBarton-NOAA and others added 2 commits November 3, 2025 16:34
Co-authored-by: Rahul Mahajan <aerorahul@users.noreply.github.com>
Co-authored-by: Rahul Mahajan <aerorahul@users.noreply.github.com>
@@ -1,10 +1,7 @@
ocean_native:
{% set NET = NET %}
{% set FREQ = FHOUT_ICE_GFS %}
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this FHOUT_ICE_GFS? Should it be FHOUT_OCN_GFS (if that exists)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

changed with update. This was a copy from the other file

Co-authored-by: Rahul Mahajan <aerorahul@users.noreply.github.com>
@NeilBarton-NOAA NeilBarton-NOAA changed the title Reduction on Ocean and Sea Ice Output Reduction in Ocean and Sea Ice Output Nov 5, 2025
NeilBarton-NOAA and others added 2 commits November 5, 2025 16:04
Removed unnecessary variables from the subset list in oceanice_products_gfs.yaml.

remove duplicate variables
name: "OCEAN_NATIVE"
target: "{{ ATARDIR }}/{{ cycle_YMDH }}/ocean_native_subset.tar"
required:
{% for fhr in range(FHOUT_ICE_GFS, FHMAX_GFS + FHOUT_ICE_GFS, FHOUT_ICE_GFS) %}
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't these be FHOUT_OCN_GFS?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, change uploaded

write_grib2: True
write_netcdf: False
write_grib2: {{ write_grib2 }}
write_netcdf: {{ write_netcdf }}
Copy link
Contributor

Choose a reason for hiding this comment

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

This should stay False. When this is True, the program will run and create the interpolated netcdf files, but they remain in DATA, which gets removed when the job ends.

Suggested change
write_netcdf: {{ write_netcdf }}
write_netcdf: False

Copy link
Contributor Author

Choose a reason for hiding this comment

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

NeilBarton-NOAA and others added 2 commits November 6, 2025 15:10
Co-authored-by: Rahul Mahajan <aerorahul@users.noreply.github.com>
Co-authored-by: Rahul Mahajan <aerorahul@users.noreply.github.com>
copy:
- ["{{ EXECgfs }}/ocnicepost.x", "{{ DATA }}/"]
- ["{{ PARMgfs }}/post/ocnicepost.nml.jinja2", "{{ DATA }}/"]
{% if write_grib2 %}
Copy link
Contributor

Choose a reason for hiding this comment

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

These are needed when write_netcdf = True as well.

- ["{{ DATA }}/ocean_subset.nc", "{{ COMOUT_OCEAN_NETCDF }}/{{ RUN }}.t{{ current_cycle | strftime('%H') }}z.tripolar.f{{ '%03d' % forecast_hour }}.nc"]
- ["{{ DATA }}/ocean_subset.nc", "{{ COMOUT_OCEAN_NETCDF }}/native/{{ RUN }}.t{{ current_cycle | strftime('%H') }}z.native.f{{ '%03d' % forecast_hour }}.nc"]
- ["{{ DATA }}/ocean_compressed.nc", "{{ COMIN_OCEAN_HISTORY }}/{{ RUN }}.t{{ current_cycle | strftime('%H') }}z.{{ interval }}hr_avg.f{{ '%03d' % forecast_hour }}.nc"]
{% if write_grib2 %}
Copy link
Contributor

Choose a reason for hiding this comment

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

reminder that we need to add the section when write_netcdf = True to copy the interpolated netcdf files

- ["{{ DATA }}/ice_subset.nc", "{{ COMOUT_ICE_NETCDF }}/native/{{ RUN }}.t{{ current_cycle | strftime('%H') }}z.native.f{{ '%03d' % forecast_hour }}.nc"]
- ["{{ DATA }}/ice_compressed.nc", "{{ COMIN_ICE_HISTORY }}/{{ RUN }}.t{{ current_cycle | strftime('%H') }}z.{{ interval }}hr_avg.f{{ '%03d' % forecast_hour }}.nc"]
{% for grid in product_grids %}
{% if write_grib2 %}
Copy link
Contributor

Choose a reason for hiding this comment

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

same reminder as above.

copy:
- ["{{ DATA }}/ocean_subset.nc", "{{ COMOUT_OCEAN_NETCDF }}/native/{{ RUN }}.t{{ current_cycle | strftime('%H') }}z.tripolar.f{{ '%03d' % forecast_hour }}.nc"]
- ["{{ DATA }}/ocean_subset.nc", "{{ COMOUT_OCEAN_NETCDF }}/native/{{ RUN }}.t{{ current_cycle | strftime('%H') }}z.native.f{{ '%03d' % forecast_hour }}.nc"]
- ["{{ DATA }}/ocean_compressed.nc", "{{ COMIN_OCEAN_HISTORY }}/{{ RUN }}.t{{ current_cycle | strftime('%H') }}z.{{ interval }}hr_avg.f{{ '%03d' % forecast_hour }}.nc"]
Copy link
Contributor

Choose a reason for hiding this comment

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

Should not overwrite model output.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed

Comment on lines +45 to +47
{% if write_netcdf %}
- "{{ COMOUT_OCEAN_NETCDF }}/{{ grid }}"
{% endif %}
Copy link
Contributor

Choose a reason for hiding this comment

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

write_netcdf = False. This section is irrelevant.

Comment on lines +77 to +79
{% if write_netcdf %}
- "{{ COMOUT_ICE_NETCDF }}/{{ grid }}"
{% endif %}
Copy link
Contributor

Choose a reason for hiding this comment

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

This section is irrelevant because write_netcdf = False

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added write_netcdf: {{ write_netcdf }}

sfs products are requested as lat/lon as netCDF

copy:
- ["{{ DATA }}/ice_subset.nc", "{{ COMOUT_ICE_NETCDF }}/native/{{ RUN }}.t{{ current_cycle | strftime('%H') }}z.tripolar.f{{ '%03d' % forecast_hour }}.nc"]
- ["{{ DATA }}/ice_subset.nc", "{{ COMOUT_ICE_NETCDF }}/native/{{ RUN }}.t{{ current_cycle | strftime('%H') }}z.native.f{{ '%03d' % forecast_hour }}.nc"]
- ["{{ DATA }}/ice_compressed.nc", "{{ COMIN_ICE_HISTORY }}/{{ RUN }}.t{{ current_cycle | strftime('%H') }}z.{{ interval }}hr_avg.f{{ '%03d' % forecast_hour }}.nc"]
Copy link
Contributor

Choose a reason for hiding this comment

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

Still see the compressed files are overwriting history files.

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