NOAA-OWP / evapotranspiration

Other
3 stars 9 forks source link

Modify `update_until()` def #23

Closed madMatchstick closed 1 year ago

madMatchstick commented 1 year ago

The current version of update_until() includes a lot of temporary debug print statements. Not 100% sure if it's fully functional as is. Recommend a more standard approach, similar to CFE, etc.

//TODO: confirm the fractional input is valid? Are we supporting this aspect for the update_until() call, or is this functionality optional?

    frac = n_steps - (int)n_steps;
    if (frac > 0){
        printf("WARNING: PET trying to update a fraction of a timestep\n");

        // change timestep to remaining fraction & call update()
        pet->bmi.time_step_size_s = frac * dt;
        Update (self);
        pet->bmi.time_step_size_s = dt;
    }
madMatchstick commented 1 year ago

@madMatchstick, when I run the unit test script, update_until appears not to work:

updating until... new total timesteps in test loop: 6
current time: 3600.000000

It's still stuck on the time step from the earlier update test.

Fixed.

image