Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Once the grid is at least close to what you want proceed to steps below.


1) Save the Refinement Map - under the Actions menu. This writes a netcdf file of the map of refinement values (0 for no refinement, 1 for maximum refinement).  Save the files as something like: REFMAP_Nanjing_ne30x8.nc.

Save frequently as the VRM Editor on the Mac tends to crash.  You can then restart the Editor, Read the refinement later Refinement Map and start adjusting the grid from that point.  

Also, make note of any Longitude Shift and Rotate-X, -Y values as those are not saved in the Refinement map Map file.

2) Write EXODUS File: If you are happy with your grid, under Actions: Write Exodus File - give it a name like Nanjing_ne30x8_EXODUS.nc. 

If you want to make further manual edits to your grid, as described below, do not save the EXODUS file.

 

3) Write Refinement Grid - for manual editing of refinement region and halos

...

Once you have a rough version of your grid, save a the Refinement Grid - in the Actions menu, select 'Write Refinement Grid'.

...

(be sure this is all on one line)

For this example:

> /glade/derecho/scratch/emmons/nanjing_musica_tutorial> /glade/work/emmons/tutorial_Nanjing/VRM_tools/VRM_Editor/src/Create_VRMgrid --refine_type "LOWCONN" --grid_type "CubeSquared" --resolution 30 --refine_level 3 --smooth_type "SPRING" --smooth_dist 3 --smooth_iter 3 --x_rotate 25  --y_rotate 0  --lon_shift 30  --refine_file REFMAP_Nanjing_ne30x8.nc  --refine_cube RefGrid_Nanjing_ne30x8.dat --output Nanjing_ne30x8_EXODUS.nc 

...

Create SCRIP and LATLON grid files from EXODUS file

On casper: build Gen_ControlVolumes.exe; be sure to use the gnu (gcc) compiler. 

> cd $REPO/grids$(VRM_tools)/VRM_ControlVolumes/src
> module load gcc
> make
> module load intel


> cd $REPO/grids
> cp ${VRM_tools}> cp /glade/work/emmons/tutorial_Nanjing/VRM_tools/VRM_ControlVolumes/src/input.nl input-Nanjing.nl

Edit input-Nanjing_ne30x8.nl to have your path to $REPO/grids and the grid name. 

Then run Gen_ControlVolumes:

> /glade/work/emmons/tutorial_Nanjing/${VRM_tools}/VRM_ControlVolumes/src/Gen_ControlVolumes.exe input-Nanjing.nl > LOG_Nanjing

This produces the SCRIP file: Nanjing_ne30x8_np4_SCRIP.nc which is used for further regridding steps, as well as for plotting your final model output on the native grid.

 A "LATLON" file is also produced: and Nanjing_ne30x8_np4_LATLON.nc

If you do not see these files, check LOG_Nanjing for errors.

Examine the LATLON file to get the number of columns in your new grid:

...

In the directory with your SCRIP file ($REPO/grids), run (be sure all on one line):

> /glade/u/apps/casper/23.10/spack/opt/spack/esmf/8.5.0/mpi-serial/2.3.0/oneapi/2023.2.1/dfkx/bin/ESMF_Scrip2Unstruct Nanjing_ne30x8_np4_SCRIP.nc Nanjing_ne30x8_np4_MESH.nc 0

Note the 0 at the end.

This creates the ESMF mesh file: Nanjing_ne30x8_np4_MESH.nc

...