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

No warning/ no error despite missing CO2 data #62

Closed
dschlaep opened this issue Sep 27, 2017 · 5 comments
Closed

No warning/ no error despite missing CO2 data #62

dschlaep opened this issue Sep 27, 2017 · 5 comments

Comments

@dschlaep
Copy link
Member

As long as there is an appropriately named carbon.in file (name as in files.in), the execution runs without errors and without warnings -- whether or not the carbon.in file is

  • empty, or
  • contains data only for other scenarios, or
    --> example output from co2_effects.yr:
1980	0.000000	0.000000	0.000000	183.333333	183.333333	0.000000	0.000000	0.000000	314.750008	314.750008	1.000000	1.000000
1981	0.000000	0.000000	0.000000	183.333333	183.333333	0.000000	0.000000	0.000000	314.750008	314.750008	1.000000	1.000000
1982	0.000000	0.000000	0.000000	183.333333	183.333333	0.000000	0.000000	0.000000	314.750008	314.750008	1.000000	1.000000
  • contains data for the requested scenario for only a few years of the simulation period, but not for other years of the simulation period
    --> example output for carbon.in with data for years 2010 and 2012:
2009	0.000000	0.000000	0.000000	183.333333	183.333333	0.000000	0.000000	0.000000	314.750008	314.750008	1.000000	1.000000
2010	0.000000	0.000000	0.000000	167.006543	167.006543	0.000000	0.000000	0.000000	286.719877	286.719877	0.910945	1.131505
2011	0.000000	0.000000	0.000000	183.333333	183.333333	0.000000	0.000000	0.000000	314.750008	314.750008	1.000000	1.000000
2012	0.000000	0.000000	0.000000	167.018017	167.018017	0.000000	0.000000	0.000000	286.739576	286.739576	0.911007	1.131387
2013	0.000000	0.000000	0.000000	183.333333	183.333333	0.000000	0.000000	0.000000	314.750008	314.750008	1.000000	1.000000
  • contains repeated data for the requested scenario for only a few years of the simulation period, but not for other years of the simulation period
    --> example output for carbon.in with multiple values data for year 2010: only last value used
2009	0.000000	0.000000	0.000000	183.333333	183.333333	0.000000	0.000000	0.000000	314.750008	314.750008	1.000000	1.000000
2010	0.000000	0.000000	0.000000	167.018017	167.018017	0.000000	0.000000	0.000000	286.739576	286.739576	0.911007	1.131387
2011	0.000000	0.000000	0.000000	183.333333	183.333333	0.000000	0.000000	0.000000	314.750008	314.750008	1.000000	1.000000

I don't think it makes sense to run a simulation with missing data. I suggest to have the code error out if there are missing years and/or multiple years for a scenario.

@Zachary-Kramer
Copy link
Contributor

Okay, makes sense.

contains data only for other scenarios

I'm not sure if this should be a fail case. If no scenario in the experimental design is provided, but a multiplier is enabled, then rSFSW2 will grab the scenario from whatever is being run: scenario <- sim_scens[["df"]][sc - 1, "ConcScen"]

I could remove this functionality if you think it's too dangerous, per say. With this approach the carbon values have the potential to not exist for the scenario. Should it fail here? Or just be a warning?

@dschlaep
Copy link
Member Author

If we request a specific simulation setup, but inputs are not available, then the run has to fail.

@Zachary-Kramer
Copy link
Contributor

So to be clear, if someone enabled CO2, but didn't specify the scenario because they wanted it to be extracted with the above code, and the extracted scenario has no CO2 data, it should fail. Correct?

@dschlaep
Copy link
Member Author

The code cited in three comments above scenario <- sim_scens[["df"]][sc - 1, "ConcScen"] is rSFSW2 code. This here is SOILWAT2. SOILWAT2 should fail if carbon inputs are misspecified:

  • scenario name from siteparam.in does not exist in carbon.in,
  • any simulation year from years.in has not a single unique corresponding carbon value in carbon.in for requested scenario

@Zachary-Kramer
Copy link
Contributor

Four checks have been added:

A duplicated year was entered in the scenario data. Run cancels even if that year was not being run, simply because invalid input data should not be acceptable.

Carbon.in was empty. Should never happen, but it will fail when it does.

The scenario was not found.

A requested year was missing ppm data. This only fails if that year was being used, because it is valid to have skips in the input data (e.g. only have data for 1800-1900 and 2000-2100).

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

No branches or pull requests

2 participants