Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BMI Update may incorrectly assume a 1 hour time step #28

Open
hellkite500 opened this issue Nov 16, 2021 · 10 comments
Open

BMI Update may incorrectly assume a 1 hour time step #28

hellkite500 opened this issue Nov 16, 2021 · 10 comments

Comments

@hellkite500
Copy link
Member

The Update function assumes a conversion of the precip variable from mm/hr to m/hr by simply accounting for the scale difference between mm and m. However, what happens when update_until modifies the dt for whatever reason to a fractional dt. Is this conversion/assumption still valid? A quick look through the model definitions implies that precipitation should be the value for the timestep -- timestep_rainfall_input_m. Just want to double check that there is nothing untoward happening here.

// divide by 1000 to convert from mm/h to m w/ 1h timestep as per t-shirt_0.99f

@jmframe
Copy link
Contributor

jmframe commented Nov 17, 2021

Andy, Keith or Naoki would be better answering this part, but here is my though: The precipitation input unit is kg m-2, which roughly translates to mm, assuming the density is kg m-3. I guess the assumption being that the kg of mass accumulated during the dt. So that note assumes the kg accumulated over a one hour dt. If the dt that you need to run CFE on is less or greater than one hour, than the kg m-2 should reflect the appropriate accumulation. So if you have a 30 min dt, for instance, that kg m-2 should be a 30 minute accumulation, so then dividing by 1000 should give you mm per 30 min, but the trick is that the km m-2 needs to reflect that 30 minute accumulation. Now on the CFE side, this is a question for Fred, but here is my thought: The CFE includes parameters that are calibrated to respond to forcings at one hour timesteps. Since this is a lumped conceptual model, rather than a physical model, there is no great way to change the timesetp. For instance, some of the model parameters are calibrated roughly to simulate water moving down a catchment, but there is no explicit velocity, so the spatial resolution of the catchment and the velocity of the water moving can't be directly compared to give a courant number. So this isn't really as simple as dividing up the precipitation to match the timestep. If you ran CFE at a timestep of one second, for instance, and divided the one hour accumulated precipitation mass by 3600, you probably won't get a comparable surface runoff after that full hour, because the CFE parameters think the precip is actually an hour, so it would give you a result that is more representative of 3600 hours of very low (basically zero) precipitation, rather than one hour of normal precipitation. The point being, it is probably not a good idea to run CFE at a timestep other than 1 hour. But Fred should make this decision.

@hellkite500
Copy link
Member Author

@jmframe Thanks for your thoughts! That's some sounds reasoning. I hadn't thought through all the implications here, which is why I opened this issue. I just noticed this oddity while looking through code trying to understand the chain of transformations from input data to output. Still some to consider it seems.

@SnowHydrology
Copy link
Contributor

@hellkite500 I agree with @jmframe. CFE has what I would call an implicit time step of one hour. There are parts of the code where the time step is explicitly handled (e.g., Schaake_partitioning_scheme) and others where it is not (e.g., Jonathan's explanation above of the GIUH). I ran a quick test and the GIUH outputs 6.9% less runoff when running on a 1 h time step versus a 1 s time step given the same total input water (5 mm/h for 24 h). Although a relatively small difference, it's a difference nonetheless.

@SnowHydrology
Copy link
Contributor

I should add that this is not uncommon for hydrologic models. You could force many models to run on non-standard time steps, but you'll get wonky outputs.

@andywood
Copy link

andywood commented Nov 17, 2021 via email

@SnowHydrology
Copy link
Contributor

Coming back to this issue, the original t-shirt/CFE was written with assumed precipitation of mm h-1 (or kg m-2 h-1). It also appears that the time step, in some cases, is assumed to be 1 h. What if we were to multiply the precipitation in the line @hellkite500 linked above by hourly fraction time step?

@SnowHydrology
Copy link
Contributor

Sorry it took me so long to catch this, but is CFE hard-coded to have a 3600 s (1 h) time step?

cfe/src/bmi_cfe.c

Line 2220 in e8c2d4b

data->time_step_size = 3600;

@stcui007
Copy link
Contributor

stcui007 commented Nov 18, 2021 via email

@jmframe
Copy link
Contributor

jmframe commented Nov 19, 2021

But when running a fraction of the specified time step size, the update until function changes it to the fraction:

cfe/src/bmi_cfe.c

Line 1017 in e8c2d4b

cfe_ptr->time_step_size = frac * dt;

then changes it back:

cfe/src/bmi_cfe.c

Line 1020 in e8c2d4b

cfe_ptr->time_step_size = dt;

@SnowHydrology
Copy link
Contributor

So here's the situation as I understand:

  • CFE has a hard-coded time step of 3600 s (1 h)
  • It does most of its internal equations assuming a time step of 1 h
  • It assumes precipitation is an input depth calculated from a rate given in mm h-1
  • If we run a fractional time step it will still assume precipitation is a depth accumulated over 1 h

It sounds like we can fix by:

  • Multiplying precipitation by the hourly fractional time step
  • In the vast majority of cases this will be 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants