Skip to content

generate_wombat_ic.py: Add support for WOMBATmid initial conditions#125

Merged
dougiesquire merged 2 commits intomainfrom
wombatmid-IC
May 7, 2026
Merged

generate_wombat_ic.py: Add support for WOMBATmid initial conditions#125
dougiesquire merged 2 commits intomainfrom
wombatmid-IC

Conversation

@dougiesquire
Copy link
Copy Markdown
Collaborator

@dougiesquire dougiesquire commented Apr 30, 2026

This PR replaces generate_wombatlite_ic.py with a unified generate_wombat_ic.py that supports both WOMBATlite and WOMBATmid via a --wombat-version=<lite|mid> argument.

The script now generates all required initial conditions, whereas previously we initialised some variables from other files. Initial conditions are constructed as follows:

  • no3: From WOA23. Use Jan average with depths below 800m filled in from annual data
  • o2: From WOA23. Use Jan average with depths below 1500m filled in from annual data
  • sil: From WOA23. Use Jan average with depths below 800m filled in from annual data
  • n2o: Calculated from WOA23 T and S. Use Jan average with depths below 1500m filled in from annual data.
  • alk: From GLODAPv2 mapped fields
  • dic: From GLODAPv2 mapped fields
  • fe: From Huang 2022 (zenodo.org/records/6994318)

Missing ocean regions are in-filled using the harmonic interpolation routine I used for SW chl. All other variables are initialised as constants on the WOA23 no3 1deg grid or derived from the above variables. Discussion of which datasets/values to use, including summary plots, can be found in this issue.

Example output can be found here:

/g/data/tm70/ds0092/model/inputs/wombat/wombatlite_ic.nc
/g/data/tm70/ds0092/model/inputs/wombat/wombatmid_ic.nc

This will change answers for WOMBAT tracers in OM3 since it changes the initial conditions. I've checked that OM3 runs with the new initial conditions.

This also changes the answers produced by the chlorophyll/chl_climatology_and_fill.py. While refactoring the shared code, I noticed that I was incorrectly assuming a tripolar grid when doing the in-filling of these data. The difference is unlikely to have any noticeable impact, but configurations will need to be updated.

Still to do Now done

@joshuatorrance is currently helping me get some of the required data into /g/data/av17. For now the script uses my own downloads, but it will need to be updated once the data is in /g/data/av17:

  • GLODAPv2
  • Huang et al. 2022 dFe

@dougiesquire dougiesquire self-assigned this Apr 30, 2026
@dougiesquire
Copy link
Copy Markdown
Collaborator Author

Actually, maybe hold off on reviewing this @anton-seaice. We'd like to download the annual WOA23 data and use that to fill in values at depth

@dougiesquire
Copy link
Copy Markdown
Collaborator Author

Actually, maybe hold off on reviewing this @anton-seaice. We'd like to download the annual WOA23 data and use that to fill in values at depth

Ok @anton-seaice I think this is ready for a look. I've updated the PR description since opening.

@dougiesquire dougiesquire force-pushed the wombatmid-IC branch 3 times, most recently from 9e1246f to 11b551d Compare May 5, 2026 01:04
@anton-seaice
Copy link
Copy Markdown
Contributor

The data here appears to be kept on it's native grid(s)? And then is there a second step to regrid onto the OM3 grid ?

Should there be a description in the global attributes of what the file is ?

It looks like there are some variable attributes referring to things which don't exist:

        float lat(lat) ;
...
                lat:bounds = "lat_bnds" ;
cchecker.py -t cf /g/data/tm70/ds0092/model/inputs/wombat/wombatlite_ic.nc
Running Compliance Checker on the datasets from: ['/g/data/tm70/ds0092/model/inputs/wombat/wombatlite_ic.nc']


--------------------------------------------------------------------------------
                         IOOS Compliance Checker Report                         
                                 Version 5.4.2                                  
                     Report generated 2026-05-06T03:36:06Z                      
                                    cf:1.11                                     
http://cfconventions.org/Data/cf-conventions/cf-conventions-1.11/cf-conventions.html
--------------------------------------------------------------------------------
                               Corrective Actions                               
wombatlite_ic.nc has 6 potential issues


                                     Errors                                     
--------------------------------------------------------------------------------
§4.3 Vertical Coordinate
* depth2: vertical coordinates not defining pressure must include a positive attribute that is either 'up' or 'down'

§5.6 Horizontal Coordinate Reference Systems, Grid Mappings, Projections
* grid mapping variable crs must exist in this dataset
* grid mapping variable crs must exist in this dataset
* grid mapping variable crs must exist in this dataset
* grid mapping variable crs must exist in this dataset
* grid mapping variable crs must exist in this dataset
* grid mapping variable crs must exist in this dataset
* grid mapping variable crs must exist in this dataset
* grid mapping variable crs must exist in this dataset
* grid mapping variable crs must exist in this dataset
* grid mapping variable crs must exist in this dataset
* grid mapping variable crs must exist in this dataset
* grid mapping variable crs must exist in this dataset


                                    Warnings                                    
--------------------------------------------------------------------------------
§2.6 Attributes
* §2.6.2 global attribute title should exist and be a non-empty string
* §2.6.1 Conventions field is not present

§4.1 Latitude Coordinate
* latitude variable 'lat1' should define valid units for latitude

§4.2 Longitude Coordinate
* longitude variable 'lon1' should define valid units for longitude
* ...

@dougiesquire
Copy link
Copy Markdown
Collaborator Author

The data here appears to be kept on it's native grid(s)? And then is there a second step to regrid onto the OM3 grid ?

Nah, MOM can read the native data directly. So we'll only have one file for all resolutions

Should there be a description in the global attributes of what the file is ?

Sure, I'll add it

It looks like there are some variable attributes referring to things which don't exist:

Yeah ok, I'll remove these and fix up the easy cf-compliance issues

@anton-seaice
Copy link
Copy Markdown
Contributor

Nah, MOM can read the native data directly. So we'll only have one file for all resolutions

Oh cool - should there be some more information on what the grids are then ? (is it confusing having multiple lats & lons for different grids in the same file ?)

@dougiesquire
Copy link
Copy Markdown
Collaborator Author

dougiesquire commented May 6, 2026

Oh cool - should there be some more information on what the grids are then ? (is it confusing having multiple lats & lons for different grids in the same file ?)

Well it's not really intended to be a file that people use. I already add the source attribute to each variable which describes the source dataset (and hence the grid). What information did you have in mind?

@dougiesquire
Copy link
Copy Markdown
Collaborator Author

With the most recent change:

lite

$ compliance-checker --test=cf:1.6 /g/data/tm70/ds0092/model/inputs/wombat/wombatlite_ic.nc
Running Compliance Checker on the datasets from: ['/g/data/tm70/ds0092/model/inputs/wombat/wombatlite_ic.nc']


--------------------------------------------------------------------------------
                         IOOS Compliance Checker Report
                                 Version 5.4.2
                     Report generated 2026-05-06T04:48:53Z
                                     cf:1.6
       http://cfconventions.org/cf-conventions/v1.6.0/cf-conventions.html
--------------------------------------------------------------------------------
All tests passed!

mid

$ compliance-checker --test=cf:1.6 /g/data/tm70/ds0092/model/inputs/wombat/wombatmid_ic.nc
Running Compliance Checker on the datasets from: ['/g/data/tm70/ds0092/model/inputs/wombat/wombatmid_ic.nc']


--------------------------------------------------------------------------------
                         IOOS Compliance Checker Report
                                 Version 5.4.2
                     Report generated 2026-05-06T04:55:36Z
                                     cf:1.6
       http://cfconventions.org/cf-conventions/v1.6.0/cf-conventions.html
--------------------------------------------------------------------------------
All tests passed!

@dougiesquire
Copy link
Copy Markdown
Collaborator Author

I think this is ready for you again @anton-seaice. Unless you want me to add something more in response to this:

Oh cool - should there be some more information on what the grids are then ? (is it confusing having multiple lats & lons for different grids in the same file ?)

Well it's not really intended to be a file that people use. I already add the source attribute to each variable which describes the source dataset (and hence the grid). What information did you have in mind?

Comment thread wombat_ic_generation/generate_wombat_ic.py Outdated
Copy link
Copy Markdown
Contributor

@anton-seaice anton-seaice left a comment

Choose a reason for hiding this comment

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

Thanks Dougie

Approving based on the agreement in ACCESS-NRI/GFDL-generic-tracers#111 and having checked that output has metadata and the code looks well structured and clear.

@dougiesquire
Copy link
Copy Markdown
Collaborator Author

Thanks @anton-seaice. I'm going to squash the last N-1 commits so may require another approval

@dougiesquire dougiesquire merged commit cd01e49 into main May 7, 2026
4 checks passed
@dougiesquire dougiesquire deleted the wombatmid-IC branch May 7, 2026 01:00
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.

2 participants