The tools address the following requirements.
The dycore needs geopotential phi_s at GLL points, and the physics needs phi_s at FV cell centers.
Physics parameterizations need SGH, SGH30, LANDFRAC computed on the FV grid.
We require that the map of the GLL phi_s data be equal to the FV phi_s data.
We want to run HOMME's smoother on GLL phi_s.
We illustrate the steps in the case of ne30pg2:
TempestRemap: Create GLL and pg2 grid template files
# Generate the element mesh. ${tempest_root}/bin/GenerateCSMesh --alt --res 30 --file topo2/ne30.g # Generate the target physgrid mesh and SCRIP file: ${tempest_root}/bin/GenerateVolumetricMesh --in topo2/ne30.g --out topo2/ne30pg2.g --np 2 --uniform ${tempest_root}/bin/ConvertExodusToSCRIP --in topo2/ne30pg2.g --out topo2/ne30pg2_scrip.nc # Option 1: exodus & SCRIP file for the USGS-topo-cube3000.nc file: GenerateCSMesh --alt --res 3000 --file ne3000.g ConvertExodusToSCRIP --in ne3000.g --out ne3000pg1.scrip.nc # Option 2: # genearte GLL SCRIP file: for RRM grids, this SCRIP files are good enough # for topo downscalings, but not conservative enough for use in the coupled model: rm -f input.nl cat > input.nl <<EOF &ctl_nl ne = 30 mesh_file = "none" / &vert_nl / &analysis_nl tool = 'grid_template_tool' output_dir = "./" output_timeunits=1 output_frequency=1 output_varnames1='area','corners','cv_lat','cv_lon' output_type='netcdf' !output_type='netcdf4p' ! needed for ne1024 io_stride = 16 / EOF mpirun -np 8 ./homme_tool < input.nl # make the 'scrip' file ncks -O -v lat,lon,area,cv_lat,cv_lon ne30np4_tmp1.nc ne30np4_tmp.nc ncl E3SM/components/homme/test/tool/ncl/HOMME2SCRIP.ncl name=\"$mesh\" ne=30 np=4
cube_to_target, run 1: Compute phi_s on the np4 grid. Any reasonable downscaling (i.e. non-interpolatory) map can be used for this step. Eventually we hope to replace this step with mbtempest. As of 2021/5, we use “cube_to_target” for this step, which requires a GLL SCRIP file for the target grid. In the V2 tool chain, this SCRIP file was avoided by first mapping to a “pg4” grid (using an FV SCRIP file) as an intermediate step. But with the very little smoothing used in V3 topography files, this intermediate step was found to introduce too much smoothing itself.
${e3sm_root}/components/cam/tools/topo_tool/cube_to_target \ --target-grid topo2/ne30np4_scrip.nc \ --input-topography topo2/USGS-topo-cube3000.nc \ --output-topography topo2/ne30np4_topo.nc
These warnings appear to be innocuous:
sum of weights is negative - negative area? -1.8651290104823655E-009 675 3000
homme_tool: Starting with the unsmoothed topo data on the GLL grid, apply dycore specific smoothing.
$ cat input.nl &ctl_nl ne = 30 smooth_phis_p2filt = 2 smooth_phis_numcycle = 1 smooth_phis_nudt = 4e-16 hypervis_scaling = 2 se_ftype = 2 ! actually output NPHYS; overloaded use of ftype / &vert_nl / &analysis_nl tool = 'topo_pgn_to_smoothed' infilenames = 'ne30np4_topo.nc', 'ne30np4pg2_smoothed_phis' / mpirun -np 8 ./homme_tool < input.nl
Note that for RRM grids,
mesh_file
will need to be specified in thectl_nl
section as well, andne
should be set to0
.smooth_phis_numcycle
is an adjustable parameter, and can be lowered for less smoothing. Current work suggests the final tuning of this will be either 1 or 2. In the V3 tool, we have switched to using tensor HV smoothing, and thussmooth_phis_nudt
is now resolution independent. We have also turned on a p=2 filter in the smoothing algorithm which improves results (as documented on /wiki/spaces/NGDNA/pages/2411397876 ). For the new smoothing algorithm, which combines the p2 filter and tensor laplacing smoothing, we use the naming convention “fxNt”, where N is the value used for smooth_phis_numcycle.cube_to_target, run 2: Compute SGH, SGH30, LANDFRAC, and LANDM_COSLAT on the pg2 grid, using the pg2 phi_s data.
${e3sm_root}/components/cam/tools/topo_tool/cube_to_target \ --target-grid ne30pg2_scrip.nc \ --input-topography USGS-topo-cube3000.nc \ --smoothed-topography ne30np4pg2_smoothed_phis1.nc \ --output-topography USGS-gtopo30_ne30np4pg2_fx1t.nc
ncks: Append the GLL phi_s data to the output of step 4.
ncks -A ne30np4pg2_smoothed_phis1.nc USGS-gtopo30_ne30np4pg2_fx1t.nc
USGS-gtopo30_ne30np4pg2_fx1t.nc is the final GLL-physgrid topography file.