Commit 4f83f4f4 authored by Thomas Jahns's avatar Thomas Jahns 🤸
Browse files

Add print method to vlist type struct.

parent dcb1731e
......@@ -114,8 +114,6 @@ void modelRun ()
zaxisDefLevels(zaxisID3, levs);
namespaceSetActive ( 0 );
reshArrayPrint ();
// Create a variable list
vlistID = vlistCreate();
......@@ -139,6 +137,7 @@ void modelRun ()
// Assign the Time axis to the variable list
vlistDefTaxis(vlistID, taxisID);
reshArrayPrint ();
// Create a dataset in netCDF fromat
......
......@@ -47,9 +47,14 @@ vlist_compare(vlist_t *a, vlist_t *b)
return diff;
}
static void
vlistPrintKernel(vlist_t *vlistptr);
resOps vlist_ops = {
(valCompareFunc)vlist_compare,
free
free,
(valPrintFunc)vlistPrintKernel
};
......@@ -1005,8 +1010,8 @@ int vlistNtsteps(int vlistID)
return (vlistptr->ntsteps);
}
void vlistPrint(int vlistID)
static void
vlistPrintKernel(vlist_t *vlistptr)
{
int nvars, flag, index;
int varID, fvarID, mvarID, flevID, mlevID, levID;
......@@ -1015,15 +1020,10 @@ void vlistPrint(int vlistID)
char paramstr[32];
char *name, *longname, *units;
double level;
vlist_t *vlistptr;
vlistptr = vlist_to_pointer(vlistID);
vlist_check_ptr(__func__, vlistptr);
printf("#\n# vlistID %d\n#\n", vlistID);
if ( vlistID == CDI_UNDEFID ) return;
printf("#\n# vlistID %d\n#\n", vlistptr->self);
nvars = vlistptr->nvars;
......@@ -1081,6 +1081,18 @@ void vlistPrint(int vlistID)
}
}
void vlistPrint(int vlistID)
{
vlist_t *vlistptr;
if ( vlistID == CDI_UNDEFID ) return;
vlistptr = vlist_to_pointer(vlistID);
vlist_check_ptr(__func__, vlistptr);
vlistPrintKernel(vlistptr);
}
/*
@Function vlistDefTaxis
@Title Define the time axis
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment