Skip to content

Regrid iceberg fluxes on OM3 grid#120

Merged
anton-seaice merged 10 commits into
mainfrom
119
Apr 24, 2026
Merged

Regrid iceberg fluxes on OM3 grid#120
anton-seaice merged 10 commits into
mainfrom
119

Conversation

@anton-seaice
Copy link
Copy Markdown
Contributor

@anton-seaice anton-seaice commented Feb 27, 2026

Closes #119

This change adds a script to regrid iceberg flux climatology onto the OM3 grid.

The two input files are hardcoded:

AQ_MELT_PATTERN = "/g/data/av17/access-nri/OM3/Mankoff_2025_V9/AQ_iceberg_melt.nc"
GL_MELT_PATTERN = "/g/data/av17/access-nri/OM3/Mankoff_2025_V9/GL_iceberg_melt.nc"

and in the script, the melt pattern is combined for all regions, and hemispheres.

Example output in /g/data/tm70/as2285/making_inputs/om3-scripts/rof_pattern_generation/access-om3-100km-rofi-spread.nc

image

I've refactored regrid_forcing.py to generalise it a little and move into a separate file.

I regenerated SFe_Hamiltonetal2020_monthly_clim and checked the results matched:

Screenshot 2026-03-04 at 1 56 24 pm

@anton-seaice anton-seaice marked this pull request as ready for review March 4, 2026 02:59
@access-hive-bot
Copy link
Copy Markdown

This pull request has been mentioned on ACCESS Hive Community Forum. There might be relevant details there:

https://forum.access-hive.org.au/t/access-om3-development-highlights-updates/5902/3

Copy link
Copy Markdown
Collaborator

@dougiesquire dougiesquire left a comment

Choose a reason for hiding this comment

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

@anton-seaice, I tried to run this and got:

$ python3 generate_rofi_pattern.py --topog-file=/g/data/vk83/configurations/inputs/access-om3/share/grids/global.100km/2020.10.22/topog.nc --hgrid-filename=/g/data/vk83/configurations/inputs/access-om3/mom/grids/mosaic/global.100km/2020.05.30/ocean_hgrid.nc --output-filename=./test.nc
/g/data/xp65/public/apps/med_conda/envs/analysis3-26.03/lib/python3.12/site-packages/xesmf/backend.py:42: UserWarning: Input array is not F_CONTIGUOUS. Will affect performance.
  warnings.warn('Input array is not F_CONTIGUOUS. ' 'Will affect performance.')
/g/data/xp65/public/apps/med_conda/envs/analysis3-26.03/lib/python3.12/site-packages/xesmf/backend.py:42: UserWarning: Input array is not F_CONTIGUOUS. Will affect performance.
  warnings.warn('Input array is not F_CONTIGUOUS. ' 'Will affect performance.')
Traceback (most recent call last):
  File "/g/data/tm70/ds0092/software/om3-scripts/rof_pattern_generation/generate_rofi_pattern.py", line 229, in <module>
    main()
  File "/g/data/tm70/ds0092/software/om3-scripts/rof_pattern_generation/generate_rofi_pattern.py", line 172, in main
    weights_da = move_runoff_on_land(regrid.grid_dest, mask, forcing_regrid_glob)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/g/data/tm70/ds0092/software/om3-scripts/rof_pattern_generation/generate_rofi_pattern.py", line 67, in move_runoff_on_land
    grid_dest["mask"] = xr.DataArray(mask, dims=["ny", "nx"])
    ^^^^^^^^^
NameError: name 'grid_dest' is not defined. Did you mean: 'grid_mask'?

Comment thread rof_pattern_generation/generate_rofi_pattern.py
Comment thread regrid_common.py
anton-seaice and others added 2 commits April 20, 2026 11:16
Co-authored-by: Dougie Squire <dougie.squire@anu.edu.au>
@anton-seaice
Copy link
Copy Markdown
Contributor Author

I've re-run after the changes, and checked it produces the same netcdf files as previously for both the rof pattern and SFe forcing file.

@anton-seaice
Copy link
Copy Markdown
Contributor Author

Thanks @dougiesquire - ready for another look

Comment thread rof_pattern_generation/generate_rofi_pattern.py Outdated
Comment thread rof_pattern_generation/generate_rofi_pattern.py Outdated
Comment thread rof_pattern_generation/generate_rofi_pattern.py Outdated
Comment thread regrid_common.py
Comment thread rof_pattern_generation/generate_rofi_pattern.py
@anton-seaice
Copy link
Copy Markdown
Contributor Author

Should be ready @dougiesquire

Copy link
Copy Markdown
Collaborator

@dougiesquire dougiesquire left a comment

Choose a reason for hiding this comment

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

Thanks @anton-seaice looks good (assuming you've tested using the latest version of the code)

@anton-seaice anton-seaice merged commit 477df70 into main Apr 24, 2026
4 checks passed
@anton-seaice anton-seaice deleted the 119 branch April 24, 2026 05:08
@anton-seaice anton-seaice self-assigned this Apr 24, 2026
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.

Script to generate iceberg spreading patterns

3 participants