Commit b47b5d6a3ce3c29acf779889309e76d449f5ac46

Authored by Benjamin Renard
1 parent 8c137f82

Fix for #9042 - When CTime is equal to a record of the data file, we expect to return this record

Showing 1 changed file with 7 additions and 1 deletions   Show diff stats
src/SERVER/DD_GetData.c
... ... @@ -1257,7 +1257,13 @@ int SetTime(DD_Var_t *DD_VarL, double VCTime)
1257 1257 {
1258 1258 TestTime = Time_GetValueFromVar(DD_VarL->ncID, TimeID, TimeIsDouble, start[0]);
1259 1259  
1260   - if(CTime >= TestTime)
  1260 + if(CTime == TestTime)
  1261 + {
  1262 + // BRE - 01/07/2021 - Fix for #9042 - When CTime is equal to a record of the data file, we expect to return this record !
  1263 + DD_VarL->nc_rec = start[0];
  1264 + More = 0;
  1265 + }
  1266 + else if(CTime > TestTime)
1261 1267 {
1262 1268 // if(start[0] +1 >= DD_VarL->Maxnc_rec) return(OUTOFTIME);
1263 1269 if(start[0] +1 >= DD_VarL->Maxnc_rec) // We are in the gap between the last record
... ...