Skip to content

Commit

Permalink
Merge pull request #338 from esmf-org/esmf_regrid_netcdf4
Browse files Browse the repository at this point in the history
Support -h in addition to --help in ESMF_Regrid, and fix some typos in documentation
  • Loading branch information
billsacks authored Dec 18, 2024
2 parents d9000f1 + f0d37d8 commit 2df4ee9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
11 changes: 6 additions & 5 deletions src/apps/ESMF_Regrid/ESMF_Regrid.F90
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,10 @@ program ESMF_RegridApp
! then broadcast the results to the rest of the Pets
!
if (PetNo == 0) then
call ESMF_UtilGetArgIndex('--help', argindex=ind)
call ESMF_UtilGetArgIndex('-h', argindex=ind)
if (ind == -1) call ESMF_UtilGetArgIndex('--help', argindex=ind)
if (ind /= -1) then
call PrintUsage()
call PrintUsage()
terminateProg=.true.
endif
call ESMF_UtilGetArgIndex('--version', argindex=ind)
Expand Down Expand Up @@ -526,7 +527,7 @@ subroutine PrintUsage()
print *, " [--dst_regional]"
print *, " [--check]"
print *, " [--no_log]"
print *, " [--help]"
print *, " [--help|-h]"
print *, " [--version]"
print *, " [-V]"
print *, "where"
Expand All @@ -547,7 +548,7 @@ subroutine PrintUsage()
print *, " where tilename is the tile name defined in the source grid file"
print *, "--dstdatafile - If the destination grid is of type MOSAIC, the data is stored"
print *, " in separated files, one per tile. dstdatafile is the prefix of"
print *, " the destination data file. The filename is srcdatafile.tilename.nc,"
print *, " the destination data file. The filename is dstdatafile.tilename.nc,"
print *, " where tilename is the tile name defined in the destination grid file"
print *, "--tilefile_path - The alternative file path for the tile files and mosaic data files"
print *, " when either srcFile or dstFile is a GRIDSPEC MOSAIC grid. The path"
Expand Down Expand Up @@ -578,7 +579,7 @@ subroutine PrintUsage()
print *, " data(i,j,k,l)=2.0+(k-1)+2*(l-1)+cos(lat(i,j))**2*cos(2*lon(i,j)), assuming"
print *, " it is a 2D grid "
print *, "--no_log - Turn off the ESMF error log."
print *, "--help - Print this help message and exit."
print *, "--help or -h - Print this help message and exit."
print *, "--version - Print ESMF version and license information and exit."
print *, "-V - Print ESMF version number and exit."
print *, ""
Expand Down
2 changes: 1 addition & 1 deletion src/apps/ESMF_RegridWeightGen/ESMF_RegridWeightGen.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1379,7 +1379,7 @@ subroutine PrintUsage()
print *, " [--no_log]"
print *, " [--check]"
print *, " [--checkFlag]"
print *, " [--help]"
print *, " [--help|-h]"
print *, " [--version]"
print *, " [-V]"
print *, "where"
Expand Down
6 changes: 3 additions & 3 deletions src/doc/ESMF_Regrid.tex
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ \subsection{Description}
a logically rectangular grid, the UGRID file
format(~\ref{sec:fileformat:ugrid}) for unstructured grid and the GRIDSPEC
Mosaic file format(~\ref{sec:fileformat:mosaic}) for cubed-sphere grid. For
the GRIDSPEC Mosaic file format, the data are stored in seperate data files,
the GRIDSPEC Mosaic file format, the data are stored in separate data files,
one file per tile.
The SCRIP format(~\ref{sec:fileformat:scrip}) and the ESMF unstructured grid format(~\ref{sec:fileformat:esmf}) are not supported because there is no way to define a variable field using these two formats. Currently, the tool only works with 2D grids, the support for the 3D grid will be
made available in the future release. The variable array can be up to four dimensions. The
Expand Down Expand Up @@ -113,7 +113,7 @@ \subsection{Description}

The GRIDSPEC MOSAIC file(~\ref{sec:fileformat:mosaic}) can be identified by a dummy variable with {\tt
standard\_name} attribute set to {\tt grid\_mosaic\_spec}. The data for a
GRIDSPEC Mosaic file are stored in seperate files, one tile per file. The
GRIDSPEC Mosaic file are stored in separate files, one tile per file. The
name of the data file is not specified in the mosaic file. Therefore,
additional optional argument {\tt --srcdatafile} or {\tt --dstdatafile} is
required to provide the prefix of the datafile. The datafile is also a CF
Expand Down Expand Up @@ -177,7 +177,7 @@ \subsection{Description}
If the destination
variable exists in the destination grid file, it has to have the same number of dimensions and the same type as the source variable. Except for the latitude and longitude dimensions, the size of
the destination variable's extra dimensions (e.g., time and vertical layers) has to match with the
source variable. If the destination varialbe does not exist in the destination grid file, a
source variable. If the destination variable does not exist in the destination grid file, a
new variable will be created with the same type and matching dimensions as the source variable.
All the attributes of the source variable will be copied to the destination variable except those
related to the grid definition (i.e. {\tt coordinates} attribute if the destination file is in
Expand Down

0 comments on commit 2df4ee9

Please sign in to comment.