in CARDAMOM_READ_NETCDF_DATA.c there's an assumption that any model run requires two or more timesteps to calculate "deltat". Short term fix determines whether we have one or more timesteps and uses TIME_INDEX.values[0] as the deltat calculations.
Some possible ways to fix this:
-
Change TIME_INDEX conventions to be defined "end of timestep" time index (rather than middle of timestep)
-
Explicitly define "deltat" in driver file (i.e. user defined) to avoid dependencies
-
Define timestep as Ntimesteps + 1 (same as POOLS) and therefore allow for deltat calculation.
//Pre-processing
//Ntimesteps
//The deltat and DATA->Ntimesteps calculations are highly implicit and code prone to bugs. Need to replace with more explicit definitions of time and deltat
DATA->Ntimesteps=DATA->TIME_INDEX.length;
//Delta T
if ( DATA->Ntimesteps>1){
DATA->deltat=DATA->TIME_INDEX.values[1]-DATA->TIME_INDEX.values[0];}
else {
DATA->deltat=DATA->TIME_INDEX.values[0];}
in CARDAMOM_READ_NETCDF_DATA.c there's an assumption that any model run requires two or more timesteps to calculate "deltat". Short term fix determines whether we have one or more timesteps and uses TIME_INDEX.values[0] as the deltat calculations.
Some possible ways to fix this:
Change TIME_INDEX conventions to be defined "end of timestep" time index (rather than middle of timestep)
Explicitly define "deltat" in driver file (i.e. user defined) to avoid dependencies
Define timestep as Ntimesteps + 1 (same as POOLS) and therefore allow for deltat calculation.
//Pre-processing
//Ntimesteps
//The deltat and DATA->Ntimesteps calculations are highly implicit and code prone to bugs. Need to replace with more explicit definitions of time and deltat
DATA->Ntimesteps=DATA->TIME_INDEX.length;
//Delta T
if ( DATA->Ntimesteps>1){
DATA->deltat=DATA->TIME_INDEX.values[1]-DATA->TIME_INDEX.values[0];}
else {
DATA->deltat=DATA->TIME_INDEX.values[0];}