-
Notifications
You must be signed in to change notification settings - Fork 24
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
Add wild fire setting switches #662
base: master
Are you sure you want to change the base?
Conversation
…dfire fire in the transient and scenario run stages.
…ags esentially duplicate each other.
Additional Technical Details:Here is a summary of code changes made with this PR:
|
Test Simulations:Here are a selection of test simulations. I can post more if requested. All simulations were run for 4 grid cells from PR to TR stages. Test Set 1:In this set of simulations equilibrium, spin-up, and transient stages were run for 110 years. Fire was turned on for the spin-up and transient stages. FRI lengths of 0, 30, 40, and 50 years were used for the four grid cells. For explicit fire grid cells had 0, 1, 3, or 5 fires (on every 4th prime year). Severity varies with grid cell, but this is not really relevant. They plots show the effect of changing Test Set 2:In this set of simulations equilibrium was run for the default 1000 years. The spin-up and transient stages were run for 210 years. FRI was set to 100 years for all grid cells. There is no evidence of fire in cell 1,1 because the severity = 0. Explicit fire setting were the same as above. Three plot showing the effect of |
Thanks Joshua for the very well documented request. I'll try to read it before the end of the week. |
re: the history of the conflict between re: turning fire on in pre-run, there is no use case for this but it would technically be possible to turn the flag on. The ecosystem would probably crash quickly. There is really no need to have the setting exposed for the pre-run stage, but it makes the files more consistent with everything else 🤷 re: FRI=0 being no fire, that makese sense. Probably that should get documented in a section describing the input files (maybe "Model Overview" > Inputs/Outputs" > "Inputs"?) https://uaf-arctic-eco-modeling.github.io/dvm-dos-tem/model_overview.html#inputs re: model behavior changes (FRI = 0 in equlibrium phase), it could be a divide by zero problem or could be the problem described in issue #613. re: as for what to do about merging this PR, got to talk with @hgenet and @rarutter about the overall design and are thinking that a config format to aim for would look like this:
Would this accomodate your anticipated needs? We are not sure how many hoops to jump thru for merging this current PR, but we'd like to aim towards the design laid out above. One way to move forward would be to effect the entire refactor right now (more commits to this PR). Another would be to implement only parts (i.e. renaming the config If time permits it might be better to fully flesh out this design and undertake the whole refactor now. If merging the PR sooner would greatly facilitate your work we could defer some of the refactoring and just button up a few small details. |
Sorry for the long silence on this PR. I'm planning on putting some time into this in order to resolve the remaining issues over the next couple of weeks. I'm providing an item by item responses to @tobeycarman's comments below but in short I think the proposed config file compromise will work for me and I can work on implementing the revisions as part of this PR (with one question below). A Zoom discussion would probably be good to make sure I'm following everything said above. I've started pulling updates from master to my local repo and at some point those will be pushed back here with further edits. It might be a few commits before any further attention is needed. I yell when I get to another stable version. Specific responses:
I don't want to change behavior in the pre-run so I am removing the switch in the config file.
I will work on updates to the documentation to cover this and tbe other changes (once finalized). Is is preferred to documentation changes as port of a code PR or as a separate one?
I'm familiar with issue #613 and this should be separate. My code fix seems to be working but we can reassess if any issues come up in subsequent testing.
I'm am fine with the solution proposed with separate switches to turn fire on and off for each run stage and dsb:fire switches to control fire run mode. ignition_XX is probably a fine terminology for the these switches. I anticipate additional fire mode switches may be needed fairly soon so this namespace will work nicely.
I think I follow this but a Zoom discussion (per above) might help. I'm glad to help with the code changes if I'm sure I know what you want. |
…stage_settings: sc: fire = false'.
…ettings: dsb: fire: ignition_XX' flags and update code to reflect this.
As I've been working a few questions have come up:
|
This pull request adds several switches to the config file for granular control of wildfire behavior. The PR is being filed as a draft because changes were made on master before I finished work that overlap some functionality (see
XX_dsb
notes below). I would like some feedback on how to revise these code changes to fit withXX_dsb
additions.There are some comments and other know issues in the changes that will be cleaned up prior to the final pull request.
Purpose:
These changes have four main purposes.
Details:
Fire Switches for Run Stages:
The config file settings
fire_on_PR
,fire_on_EQ
,fire_on_SP
,fire_on_TR
, andfire_on_SC
have been added. Each allows fire to be turned on for each of the corresponding run stages. Together these achieve purposes 1 and 2 above.I have used values
0
for 'off' and1
for 'on'. Currently there is no reason they could not betrue
andfalse
, but I was leaving room for expansibility, as further mode information could be provided in the future. It is important to note that 'on' only means wildfire is possible, not that it will occur. Wildfire will occur only when the fire is specified to occur. The input files that govern fire have not been modified.I have opted not to include a global fire switch that would override the above switches. Fire is turned off when all
fire_on_XX
switches are set to0
. A master switch could be convenient but I decided it would potentially lead to confusion. It could be added.Outstanding Issues:
@hgenet says that fire does not occur in the pre-run stage. However, the code suggests otherwise so I'm not sure. If fire should not occur in the pre-run then
fire_on_PR
will be removed. As is there is no way to test if fire is running in the pre-run stage anyway. Feedback would be appreciated on this issue.The
XX_dsb
settings that have been recently added partially duplicate the functionality of thefire_on_XX
switches. Or at least they did. When I merged some changes a while back I had a conflict because these settings were being used in the fire logic. Now it seems those issues have gone away (actually I think the issue was in TEM.cpp, see Additional Technical Details)? If anyone knows the history here please weigh in. Fire is currently the only disturbance (dsb) but that may not always be the case.Fire Mode Switch:
The config file setting
fire_ignition_mode
has been added. The default value of0
makes the model run in the traditional way. FRI based fire is used for the equilibrium and spin-up stages and explicit fire for the transient and scenario stages.Setting
fire_ignition_mode = 1
causes FRI based fire to be used for the transient and scenario stages as well (purpose 3 above). Thefri-fire.nc
input file is used in the same manner as in the other run stages to control fire occurrence.Work is ongoing on a revised wildfire implementation. I want to maintain the current/original/traditional wildfire behavior for backward compatibly and comparison purposes. New values for
fire_ignition_mode
will be added in the future to allow new functionality while preserving the existing.The name
fire_ignition_mode
, while currently reasonably descriptive, might need to be renamed the governed fire behavior may extend beyond ignitions.Namespacing:
The 'fire_' prefix has been used for all switches. It is likely that several additional wildfire related settings will be added in the future and I wanted to create a clear namespace for them. I placed the switches in the
model_settings
section of the config file because I thought that is where fit. This differs from the approach of the 'XX_eq' settings. Perhaps there could be a fire section? Any thoughts?Model Behavior Changes:
In addition to the changes listed above there is one small change to fire behavior. Previously if a FRI = 0 value was specified for a grid cell that was simulated a divide by zero exception would occur and cause a crash. I have modified the logic so that FRI = 0 means no fire will occur for that grid cell. While the divide by zero is clearly a bug I suspect that is exists because FRI based fire has historically been been specified as non-zero for most simulations. It makes sense to me that 0 represents no fire return interval but others might disagree. This code change could be considered armoring of the code of a feature addition depending on your perspective. FRI = 0 can cause another problem in the equilibrium phase. See below.
Testing:
This code has been debugged and tested at 3057e2b. Simulations were performed with may different combinations of
fire_on_XX
andfire_ignition_mode
settings. The switches were tested for the equilibrium, spin-up, and transient modes. The pre-run was not tested for the reasons discussed above. The scenario stage was also put off because the behavior is identical to the transient stage and because a new round of testing will be required after the issues discussed here are resolved. Fire was successfully turned on and off by stage for runs using identical fire input files. FRI based fire was confirmed for the transient stage. (See plots below.)An issue came up in testing with variable FRI values. For spin-up and transient stages having different FRI lengths works fine. I encountered problems in the equilibrium stage however. As is documented in the code the spin-up needs to start before the end of a fire disturbance cycle. When the FRI lengths vary, and included a grid cell with FRI = 0, this caused a crash trying to recalculate the equilibrium run length. I have not investigated whether this is just because of the zero run length or the because of the variability. I'm not sure why this requirement is there so I didn't want to spend much time on it. This is not a issue created by my changes per se, but it makes a concise set of test simulations difficult.
Documentation:
Documentation is only inline currently. Documentation will be added to the documents when the issues discussed above are resolved.