aldivi / caland Goto Github PK
View Code? Open in Web Editor NEWca carbon accounting model
License: Other
ca carbon accounting model
License: Other
We can do this later, as time permits. We currently assume that these fluxes are negligible in relation to our other fluxes, which mostly means that our dead C pool may be top-heavy over time.
Basically, we need C transfers from standing to downed to litter, and litter to soil.
And respiration from standing, downed, and litter.
need to not add current year managed area to the managed area sum for non-restoration forest practices
for compost and cultivated it does happen in the current year
this starts around 2046. need to check it out
unless specified as a gain (which signifies positive is into the variable of interest), the co2eq units should be negative into the land and positive into the atmosphere
totalnonburn and totalwood appear to incorrect signs
A script needs to be written to generate input files for the new spatial structure.
input dir and output dir should be specifiable as arguments
Update write_caland and plot_caland to have option in function args to convert ha to ac.
Then the areas will be calculated each year based on these fractions, within CALAND.
This will allow for easier scenario generation because all of the years will not have to be entered in each scenario to keep urban forest and dead removal calculated for same years across scenarios for consistency.
Maybe just put these fractions in the current area table? With a note in the header?
We don't have these data yet, but me may get a mock up soon.
These data will have to be preprocessed to CALAND spatial delineation.
Then they can be ingested into the write input script.
From Alan's email on May 7 2018: "There appears to be a bug in plot_caland.r regarding "All_land" plotting of managed area. The output file looks correct. And the individual land type plots are correct. One thing to note is that the developed_all total managed area (βAllβ label in the output file) is the sum of dead removal, urban forest, and growth. It look like that for All_land plots I meant to subtract out the developed_all managed area, but instead ended up plotting the developed_all managed area instead."
From Alan: Conceptually, I was adding the non-regen area to the total forest area lost rather than subtracting it (both values are negative in the code so it is a bit confusing).
The original lines are (3178-3179 in the current master):
lt_conv$area_adj[lt_conv[,conv_col_names[l]] < 0] = lt_conv$area_adj[lt_conv[,conv_col_names[l]] < 0] + lt_conv$non_regen_area[l] * lt_conv$nonreg_add[lt_conv[,conv_col_names[l]] < 0] / lt_conv$non_regen_area[l]
And they should be:
lt_conv$area_adj[lt_conv[,conv_col_names[l]] < 0] = lt_conv$area_adj[lt_conv[,conv_col_names[l]] < 0] - lt_conv$non_regen_area[l] * lt_conv$nonreg_add[lt_conv[,conv_col_names[l]] < 0] / lt_conv$non_regen_area[l]
recently removed prescribed burn from cum managed sum so that it can be repeated at short intervals without exploding the managed area c accum benefit
this is consistent with the assumption that prescribed burn is done on land that has been managed within the previous benefit period (currently 20 years)
but now it doesn't contribute to fire sev benefits because its value is zero
to reinstate the value make sure it isn't used for c accum
and then for fore sev subtract it from the other fuel reduction managements proportionally so that the total area is not inflated and the benefits are due to rx burn
Read in the new climate change factor table(s) and apply the multipliers to the carbon exchange rates.
Update CALAND so that the C density of non-regenerating patches is tracked within the annual loop so that when the conversion to shrubland happens it doesn't use the area-weighted average of forest. Instead, it will use the C density post-fire of that specific area that does not regenerate.
this will be similar to other restoration activities, and will come out of cultivated and grassland types.
in the "rest" ecosystem section the above and understory and root mortality needs to check to make sure there is veg c accum, otherwise do not apply it. for now, make sure the input file has zero mortality for the appropriate land categories
but the understory needs to be fixed. the assumption is that the soil c accum is the net exchange and the veg components remain the same if there is noveg c accum
soil carbon gain has to be matched by subtractions from roots (mortality) and litter
Need to fix this automated extraction so that the legends are not too long, but also contain the scenario info
This will involve updating the raw input file for management practices with the mean conservation C flux (not ratio of conservation flux to baseline), se or sd and min/max, headers file with new comments, and caland.r with (1) a new argument in caland function that selects which value (i.e. column) to use from input file, and (2) to calculate the effect factor within the function.
For forest and the rest of the land types (not savanna/woodland), mortality greater than the initial year is added (or subtracted if it is less than the initial, or at least it should be) to the soil c.
The difference that is added is incorrect (it is currently the difference between the initial year mortality carbon and the current year mortality carbon).
It should be the difference between the mortality calculated in the current year using the initial mortality fraction, and the mortality calculated in the current year using the current year mortality fraction.
If the time period for plotting is short enough (< 20 years?), the x-axis for year puts tick marks at non-integer year values
The USGS fourth assessment land use data needs to be processed into the CALAND annual area change input data format. There should be two outputs:
a constant annual rate, just like the current input data
each year has its own rate, so there would be many columns, like the other annually varying inputs--CALAND will have to be modified to accept this kind of input (another issue will be opened for this modification)
another issue has been opened to update the input file script to incorporate these new land use inputs into the actual input files
currently the name is fixed so the files have to be renamed to be used
alternatively, make these headers generic- not scenario specific
plot_caland.r needs to be expanded to generate useful plots of the new GHG outputs.
We now have the data to do this
the lcc component needs to be modified to deal with this also
This is for version 3. This is for exploring the effects of utilizing more of the slash.
This amounts to adding complementary paths in the management table parallel to, e.g., "understory2atmos" such as "understory2energy," so that instead of this biomass decaying or being burned it could be utilized for energy. We may need to make explicit paths, such as '2decay,' '2pileburn,' and '2energy' in place of '2atmos.' This way the burned fractions can be changed in the input file.
wildfire has multiple rows for each cat, with different numbers
management has scrambled values for developed_all (but not others?)
this needs to be done in the raw data inputs, the write inputs script, and caland.r
This is done in write_caland_inputs.r
We still need to resolve two very different datasets:
bjorkman/mcphersen and dingman
also move some carbon (use the % in the paper) to roots, both for initial and for growth.
these are only valid for specific single factor change experiments, and the basic idea is to divide the total benefit/cost by the managed area
Currently, reducing the Dead_removal fraction effectively reduces the urban forest area that experiences mortality.
The mortality fraction has to remain as it is in the mortality code, and then the mortality carbon has to be determined from the 'unmanaged' area. This is because the harvested pathway only operates on the 'managed' area.
The weighting of the mortality seems to be ok, as it adjusts the average mortality across managed and unmanaged land.
Update CALAND outputs section
the raw data files do not include the new slash utilization options
the generated input files do not give the correct accumulation factors (they are all other right now)
the CA fourth assessment fire data are here (but only area is available now):
http://beta.cal-adapt.org/data/wildfire/
we may split this task up between us - let's get the new land use data working first
update caland to use more detailed fire data
process the fire data into caland format
use the ab 1504 report - it should have the regional data
need to reword the spreadsheet
The preprocessed data will be ingested by write_caland_inputs.r and added as a table in the CALAND input scenario file.
This table will be similar to the mortality table in that any years can be included, and the values will be multipliers for the veg and soil sequestration rates.
We may need 2 tables, one for veg and one for soil.
Not sure how to deal with uncertainty yet.
write_caland_inputs currently zeroes out a raw scenario file record for annual area management that has the same start year and end year.
this is due to a divide by zero: end_year-start_year
afforestation input needs to be treated as direct prescribed annual change, rather than a total relative to an initial change value
this means that from lines:
for (i in 1:length(own_names)) {
to
Afforestation needs to be treated the same way as the meadow and marshes, instead of like growth.
There shouldn't be any soil C benefits from the practices.
The code needs to be updated to do these two sensitivities separately:
initial carbon density
input carbon accumulation values
It may make sense to do the vegetation and soil input accumulation values separately from each other, which would make 3 separate cases.
The resulting sensitivity runs that we want to do are the +- the standard deviation.
Additional sensitivity runs in the near term are for the newly added parameters for GHG accounting:
burned fractions
and the energy fractions:
fraction of removed to energy for both forest management and land conversion
if mortality is assigned to developed all, it just disappears because the carbon is not transferred to another pool (becuse the other pools are zero).
also, the current dead_removal assumes that standing dead is removed, but this pool is always zero
for now assume a net flux with mortality as the input.
to fix: send developed all mortality to standing dead only, even if it is zero, and make sure dead_removal covers all the developed_all area to clear out the dead pool
Capacity needs to be added to CALAND.r to accommodate new input files with a new spatial delineation column for the land catagories.
The diagnostics files will have to be updated as well, which may need to be a separate issue.
first look at this in a spreadsheet, but will likely have to add it.
Use arrays the length of which is the years over which decay occurs.
parameterize an exponential function for remaining material, and store the annual losses.
the rates will be based on the values from measured net changes; but compare with the one paper
shift the values each year once they have been subtracted from the pools.
currently caland just keeps track of how much negative c is cleared
write_caland_inputs only checks that management exists in the params file, not whether that management is applied to the correct land type
if management types are applied to the wrong land types, then undesirable management area calculations will occur. the code will probably still run, but not give correct results.
caland only checks whether the specified land categories to be managed exist, allowing management to be applied to a wrong land type if it exists.
right now it has to be one or the other because the calculations for transitions get muddled together
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.