EDmodel / ED2

Ecosystem Demography Model
78 stars 112 forks source link

flux variables not time updated in update_polygon_derived_props #184

Open rgknox opened 8 years ago

rgknox commented 8 years ago

Summary: several flux type variables are updated in update_derived_props.f90: update_polygon_derived_props().

Flux variables usually aren't too valuable when saved as instantaneous variables, which is the case here.

These litter fluxes are zeroed every time dynamics called, and only reflect the litter fluxes that have accumulated over the dynamics time-step.

 cgrid%Cleaf_litter_flux       (ipy) = 0.0
      cgrid%Croot_litter_flux       (ipy) = 0.0
      cgrid%Nleaf_litter_flux       (ipy) = 0.0
      cgrid%Nroot_litter_flux       (ipy) = 0.0

These output variables which are sent to the analysis file, the state file (history) and daily file. The only output frequency which appears relevant is the daily (and I am not sure about the call sequence on flushing the variable etc).

These values will be misleading to anyone who reads them in the history file, they will probably think it is an average over whatever frequency they are writing at, but its only relevant over the day before writing.

Does anyone see it the way I do? My wires get a little crossed on this type of thing as my brain is submerged in CLM these days.

What should be done: These variables should be time integrated appropriately using the conventions for D, M and Q type output designations.

mpaiao commented 8 years ago

@rgknox I totally agree that these variables should follow the dmean/mmean naming convention.

I'm not saying this is the case with these specific variables, but history files should never be used for science. Their goal is to provide ED with the state of the simulation at the time they were written, so the model can resume from that point. If the numbers must look completely strange to meet this requirement, then they should look strange.

This happens with all the MMEAN/QMEAN variables if history files are written every day. If one looks at the history file on day 15, they will see that the MMEAN file has the partial sum up to that point. This isn't a bug, because a history simulation starting on day 15 would pick up the sum up to day 15 and continue to integrate the variable until the end of the month.

rgknox commented 8 years ago

As far as I can tell, cgrid%Cleaf_litter_flux is a diagnostic. The only diagnostics that should be in the history output are those with memory or accumulation over time, I don't believe these variables have memory. They are constantly zero'd with every call to update_derived_props and they are not involved in updating other diagnostics or states.