Skip to content
Snippets Groups Projects
Commit 7f0b6f29 authored by Thomas Jahns's avatar Thomas Jahns :cartwheel:
Browse files

Add support for curvilinear grids in PIO test program.

parent 6d97bf65
No related branches found
No related tags found
No related merge requests found
......@@ -177,6 +177,7 @@ cdiPioQueryVarDims(int varShape[3], int vlistID, int varID)
{
case GRID_LONLAT:
case GRID_GAUSSIAN:
case GRID_CURVILINEAR:
varShape[0] = gridInqXsize(gridID);
varShape[1] = gridInqYsize(gridID);
break;
......@@ -187,7 +188,6 @@ cdiPioQueryVarDims(int varShape[3], int vlistID, int varID)
case GRID_GENERIC:
case GRID_PROJECTION:
case GRID_GME:
case GRID_CURVILINEAR:
case GRID_UNSTRUCTURED:
xabort("unimplemented grid type: %d", gridType);
}
......
......@@ -138,6 +138,7 @@ parse_long_option(struct model_config *restrict setup,
#endif
static const char cacheRedistStr[] = "no-cache-redists",
pioRoleSchemeOptionStr[] = "pio-role-scheme",
curvilinearGridOptionStr[] = "no-create-curvilinear-grid",
uuidCreateOptionStr[] = "no-create-uuid";
struct boolOptionParse bop;
if ((bop = parseBooleanLongOption(sizeof (cacheRedistStr), cacheRedistStr,
......@@ -183,6 +184,12 @@ parse_long_option(struct model_config *restrict setup,
setup->flags = (setup->flags & ~PIO_WRITE_CONFIG_CREATE_UUID_FLAG)
| (bop.value << PIO_WRITE_CONFIG_CREATE_UUID_BIT);
}
else if ((bop = parseBooleanLongOption(sizeof (curvilinearGridOptionStr),
curvilinearGridOptionStr, str)).matched)
{
setup->flags = (setup->flags & ~PIO_WRITE_CONFIG_CREATE_CURVILINEAR_GRID_FLAG)
| (bop.value << PIO_WRITE_CONFIG_CREATE_CURVILINEAR_GRID_BIT);
}
else
invalidOptionDie("unknown long option: %s\n", str);
}
......
......@@ -16,8 +16,11 @@ typedef int MPI_Comm;
enum {
PIO_WRITE_CONFIG_CHECKSUM_BIT = 0,
PIO_WRITE_CONFIG_CREATE_UUID_BIT,
PIO_WRITE_CONFIG_CREATE_CURVILINEAR_GRID_BIT,
PIO_WRITE_CONFIG_CHECKSUM_FLAG = 1 << PIO_WRITE_CONFIG_CHECKSUM_BIT,
PIO_WRITE_CONFIG_CREATE_UUID_FLAG = 1 << PIO_WRITE_CONFIG_CREATE_UUID_BIT,
PIO_WRITE_CONFIG_CREATE_CURVILINEAR_GRID_FLAG
= 1 << PIO_WRITE_CONFIG_CREATE_CURVILINEAR_GRID_BIT,
};
......
......@@ -8,7 +8,7 @@ fi
mpi_task_num="${mpi_task_num-4}"
suffix="${suffix-grb}"
if [ "@USE_MPI@" = yes ]; then
variations="-qcache-redists"
variations="-qcache-redists -qcreate-curvilinear-grid"
else
unset variations
fi
......
......@@ -18,7 +18,11 @@ int
setupGrid(struct model_config *setup, MPI_Comm comm)
{
int nlon = setup->nlon, nlat = setup->nlat;
int gridID = createGlobalLatLonGrid(nlon, nlat);
int gridID;
if (setup->flags & PIO_WRITE_CONFIG_CREATE_CURVILINEAR_GRID_FLAG)
gridID = createLocalCurvilinearGrid(nlon, nlat);
else
gridID = createGlobalLatLonGrid(nlon, nlat);
if (setup->flags & PIO_WRITE_CONFIG_CREATE_UUID_FLAG)
{
int rank = 0;
......
......@@ -115,7 +115,8 @@ cksum_stream(const char *fname, size_t *table_len)
if (nvars == -1)
break;
if ((gridType = gridInqType(grid)) != GRID_LONLAT
&& gridType != GRID_GENERIC)
&& gridType != GRID_GENERIC
&& gridType != GRID_CURVILINEAR)
{
fprintf(stderr, "unexpected non-lonlat grid found: %d\n",
gridType);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment