Skip to content

2. Correct the nest bathymetry and update 1_domain_cfg.nc

tbrivoal edited this page Nov 22, 2022 · 5 revisions

1. Update the bathymetry with the BMG TOOL

External dataset bathymetry is interpolated on the nest grid with a classic bilinear interpolation. Thus, mismatches with the coastlines can occur. In order to refine the coaslines, you can download the BMG tool from IFREMER (https://mars3d.ifremer.fr/Les-outils/BathyMeshGridTOOLS) which is very useful to refine the bathymetry.

*Bathymetry in the bay of mont Saint Michel, before (top) and after (bottom) update*

  • Follow the steps

1: *Download bmg tool, or load bmg module on mercator px:

module load bmg/bmg-5.0

2: The tool is not maintained anymore but remains useful. It requires the data to be formatted a certain way to work. The script SCRIPT HERE is meant to create the coordinate file and the bathymetry file which are needed by BMG from the DOMAINCFG

./make_domaincfg_compatible_BMG.sh DOMAIN_CFG_FILE_NAME OUT_COORD_FILE_NAME OUT_BATHY_FILE_NAME

  • Download a coastline file, of untar the GSHHG coastline file here.

3: Run CheckBMG:

CheckBMG

4: *Go to 'files', then 'open files'. Select 'NEMO' as 'grid file format'. Then select the file OUT_COORD_FILE_NAME for the NEMO coordinates files, and OUT_BATHY_FILE_NAME for the bathymetry, and the .line file as coastline file.

5: have fun updating the bathymetry!

Nb: depending on the bathymetry source, one might want to also add the tidal amplitude to the bathymetry (see IMMERSE Deliverable 6.1)


2. Run domain_cfg a second time with the new updated bathymetry

  • Run the domaincfg tool once again while reading the new bathymetry file created at last step, so with the following parameters:
ln_read_cfg = .false.   !  Read from a domain_cfg file
nn_bathy    =    1      ! = 0 compute analyticaly
                        ! = 1 read the bathymetry file
                        ! = 2 compute from external bathymetry (should be on a regular grid)
                        ! = 3 compute from parent (if "key_agrif")
cn_topo = 'OUT_BATHY_FILE_NAME' ! Name of the bathymetry file 
cn_bath = 'Bathymetry'
cn_lon = 'glamt'
cn_lat = 'gphit'
  • At this step, you will have created both parent and child coordinate files domain_cfg.nc and 1_domain_cfg.nc respectively.