Makes resolution-specific topog.nc MOM6 global bathymetry files for ACCESS-OM3 topography workflows based on the GEBCO 2024 dataset. The current workflow supports both 25km and 100km grids.
The workflow gen_topo.sh contains many steps, and stores intermediate files in topography_intermediate_output so you can check the result of each step. Key stages in the processing are:
- Interpolate GEBCO onto the model grid, setting each cell's altitude to the mean of the GEBCO data within it and setting cells that contain more than 50% land in GEBCO to 100% land in the model (this rule of thumb gives acceptable results in most places but requires some specific fixes to ensure important straits, sills, etc. are well represented).
- Produce a global topography (
topog_new_fillfraction_edited_deseas.nc) with a coastline suitable for a C-grid (i.e. with 1-cell-wide channels). - (optional,
USE_BGRID_MERGE=true) Also create a second topography (topog_new_fillfraction_B_edited_fixnonadvective_deseas.nc) with a coastline suitable for both a B-grid and C-grid (i.e. all 1-cell-wide channels are closed off or widened to at least 2 cells); this is identical to the C-grid version apart from coastal points and any embayments/channels that are cut off by closing 1-cell-wide channels. It is then merged withcombine_by_mask.pyusing the maskB_mask.ncsuch the B-grid version is used in regions prone to sea ice and the C-grid version everywhere else. This allows the use of B-grid CICE6 with C-grid MOM6 without ice piling up in narrow channels and inlets. This step is off by default — setUSE_BGRID_MERGE=trueto enable it (see step 3 below). - Further processing and edits to generate the final
topog.nc. - Generation of associated .nc files based on and consistent with
topog.nc.
-
Download to Gadi
This repository contains submodules, so clone with
git clone --recursive https://github.com/ACCESS-NRI/make_om3_topo cd make_om3_topo -
(optional) Regenerate B-grid mask
B_mask.nccan be updated withmake_B_mask.ipynbif needed- run
make_B_mask_xxkm.ipynbon ARE and check it looks like what you want - move
~/B_mask_xxkm.ncto topog generation directory so it can be used in workflow - run
finalise_B_mask.shto embed its provenance. A positional argument specifying the resolution is required:
- run
./finalise_B_mask.sh 25km
./finalise_B_mask.sh 100km-
Generate Topography Use
./gen_topo.shto generate the topography and associated files. The script selects the 25km or 100km workflow from a singlecaseblock.- add gdata for your project & working directory to the
#PBS -l storage=line ingen_topo.sh - check/adjust the per-resolution configuration block in
gen_topo.shandfinalise.sh - for smaller cases such as 100km you can run with a positional argument; for 25km submit with qsub using RESOLUTION:
./gen_topo.sh 100km qsub -v RESOLUTION=25km -P $PROJECT gen_topo.sh- the B-grid merge steps (using
B_mask.ncandedit_*_topog_Bgrid.txt, see step 5) are off by default. To enable them, setUSE_BGRID_MERGE=true:
USE_BGRID_MERGE=true ./gen_topo.sh 100km qsub -v RESOLUTION=25km,USE_BGRID_MERGE=true -P $PROJECT gen_topo.sh- after generating the topography, this will then generate most other masks, forcing and remapping files needed by OM3
- add gdata for your project & working directory to the
-
Check the output files look OK
- See whether the final topography
topog.ncand associated .nc files look OK. Look carefully for any missing marginal seas, and channels that are too wide or narrow/closed. If there's a problem, you can identify where it arose by inspecting the intermediate outputs intopography_intermediate_output. - Run
non-advective.ipynbon ARE to see the B-grid changes in the polar coastlines, and check there are no seas/bays without B-grid advective connection to the ocean intopography_intermediate_output/topog_new_fillfraction_B_edited_fixnonadvective_deseas.nc.
- See whether the final topography
-
Fix problems (if any)
Since all outputs are generated from
topog.nc, problems in any of the outputs can generally be fixed by altering the edits applied as part of generatingtopog.ncin the workflow. There are two resolution-specific files containing lists of edits, which are applied byeditTopo.pyingen_topo.sh:- edit_025deg_topog.txt is always applied, to the C-grid topography. If
USE_BGRID_MERGE=true, it is applied a second time to the merged file. - edit_025deg_topog_Bgrid.txt is only used when
USE_BGRID_MERGE=true; it is applied to the B-grid file prior to merging but after the first application of edit_025deg_topog.txt. This should apply fixes that are suitable for a global B-grid, e.g. to open the Bosphorus so the Black Sea is retained. - For the 100 km workflow, the same procedure is used, but with the corresponding edit files
edit_100km_topog.txtandedit_100km_topog_Bgrid.txt. - Run
bathymetry-tools/editTopo.pyon the appropriate intermediate files to generate new lists of edits which can be appended (with explanatory comments) to the relevant edit file for your chosen resolution. - Return to step 3 to check that the updated workflow does what you want.
- edit_025deg_topog.txt is always applied, to the C-grid topography. If
-
Finalise Output Files
Once the output files meet your satisfaction, to commit and push the changes run
finalise.sh. This adds the git commit hash as metadata in the output.ncfiles for provenance. This then triggers creation of the other input/forcing files which depends on the grid and bathymetry, including ESMF mesh files, tidal and wombatlite forcings. A positional argument specifying the resolution is required:
./finalise.sh 25km
./finalise.sh 100kmThis workflow relies on the xp65 conda environments for running the scripts and generating the outputs. As long as you are a member of the xp65 project, this conda environment is loaded as part of the scripts. There's is data loaded from the av17, ik11 and xp65 projects.