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

For practices with long-term benefits, the per area calculations for annual variables in plot_caland using the INDIVIDUAL setting use total cumulative management area #84

Open
aldivi opened this issue Feb 10, 2021 · 0 comments

Comments

@aldivi
Copy link
Owner

aldivi commented Feb 10, 2021

v3.0.0
This is a literal application of cumulative area, which includes early management areas in the calculation that may not be contributing to the annual flux value, thus reducing the per-area-per-year diagnostic output for practices with long-term benefits.
So the per-area diagnostics for annual variables are valid for only soil conservation, which has a single-year benefit.
The per area diagnostics for other practices (those with benefits that extend for more than year) are calculated correctly for the cumulative variables.

It seems that this can be fixed by using only the cumulative area that contributes to the annual flux, which is based on the benefit period.

msimmond added a commit to msimmond/caland that referenced this issue Apr 10, 2021
…scription. corrected the name in a stop check. 2) in plot_caland() updated some formatting and the order of the landtypes/management that are evaluated in the individual per area (per year) loops within the annual GHG loop and the cumulative GHG loop. Moved the rangeland evaluation up below cultivated. 3) in plot_caland, within the annual GHG loop, the rangeland checks whether range_cum is TRUE (use cumulative area) or FALSE (use annual area), and divides by the corresponding area. A test was incorporated to stop if low_frequency or med_frequency were prescribed and range_cum was incorrectly set as FALSE. 3) in plot_caland, I updated the individual practice cultivated land evaluation within the cumulative GHG loop to check for the landtype instead of by management practice (soil conservation) since we have more management practices now. Note that I left rangeland alone in this loop since, similar to annual practices in cultivated lands, the cumulative GHG loop will calculate cum benefits / cum area (/year) regardless if it’s annual or cumulative practice. However, the rangeland annual per area benefit should be updated so that it’s dividing by the cumulative area for that benefit period and not total since the beginning of the simulation. This is an outstanding issue aldivi#84 on Alan’s master.
sbassett referenced this issue in TNC-NMFO/NWLAND Jun 17, 2021
commit cc3b404
Merge: fe7f9bc c1454a3
Author: Alan Di Vittorio <avdivittorio@lbl.gov>
Date:   Mon Apr 12 10:04:51 2021 -0700

    Merge pull request #86 from msimmond/WLIC

    Completing the WLIC development branch merge

commit c1454a3
Merge: 706554e e051923
Author: Maegen Simmonds <maegen.simmonds@gmail.com>
Date:   Fri Apr 9 17:36:57 2021 -0700

    trying to sync with remote WLIC which is apparently still ahead one commit

commit 706554e
Author: Maegen Simmonds <maegen.simmonds@gmail.com>
Date:   Fri Apr 9 17:32:13 2021 -0700

    adding updated readme file that I created remotely

commit fe7f9bc
Merge: b5626cc e051923
Author: Alan Di Vittorio <avdivittorio@lbl.gov>
Date:   Fri Apr 9 11:50:36 2021 -0700

    Merge pull request #85 from msimmond/WLIC

    Merge active WLIC branch into new WLIC development branch in main repo

commit 529ef7c
Author: Maegen Simmonds <maegen.simmonds@gmail.com>
Date:   Wed Feb 24 16:44:26 2021 -0800

    1) in CALAND() added range_cum definition to the CALAND() argument description. corrected the name in a stop check.  2)  in plot_caland() updated some formatting and the order of the landtypes/management that are evaluated in the individual per area (per year) loops within the annual GHG loop and the cumulative GHG loop. Moved the rangeland evaluation up below cultivated. 3) in plot_caland, within the annual GHG loop, the rangeland checks whether range_cum is TRUE (use cumulative area) or FALSE (use annual area), and divides by the corresponding area. A test was incorporated to stop if low_frequency or med_frequency were prescribed and range_cum was incorrectly set as FALSE. 3) in plot_caland, I updated the individual practice cultivated land evaluation within the cumulative GHG loop to check for the landtype instead of by management practice (soil conservation) since we have more management practices now. Note that I left rangeland alone in this loop since, similar to annual practices in cultivated lands, the cumulative GHG loop will calculate cum benefits / cum area (/year) regardless if it’s annual or cumulative practice. However, the rangeland annual per area benefit  should be updated so that it’s dividing by the cumulative area for that benefit period and not total since the beginning of the simulation. This is an outstanding issue #84 on Alan’s master.

commit e051923
Author: Maegen Simmonds <mbsimmonds@lbl.gov>
Date:   Tue Jan 19 09:33:06 2021 -0800

    Update readme

    added the formatting for the CALAND DOI hyperlink

commit 1513005
Author: Maegen Simmonds <mbsimmonds@lbl.gov>
Date:   Tue Jan 19 09:32:13 2021 -0800

    Update readme with the new paper citations

commit e867a16
Author: Maegen Simmonds <mbsimmonds@lbl.gov>
Date:   Tue Jan 19 09:23:45 2021 -0800

    Update readme with new peer-reviewed publication

commit 71c0d45
Author: Maegen Simmonds <maegen.simmonds@gmail.com>
Date:   Tue Jan 19 09:10:53 2021 -0800

    Updates to CALAND(): (1) Added range_cum argument to CALAND() to allow for new rangeland management practices that can be simulated with annual benefits during the year of management only (range_cum = FALSE) - the same way as cultivated lands - or be simulated with cumulative benefits over 10 or 30 years for Low_frequency or Med_frequency compost application, respectively. The latter was the original designation. If range_cum is set as TRUE if a new rangeland management practice is prescribed (i.e., not Low_frequency or Med_frequency) it is automatically treated as a 30-year benefit period, i.e., the same as Low_frequency. (2) A check was added to CALAND() to ensure that if Low_frequency or Med_frequency are prescribed, that range_cum is TRUE. (3) Annotated the creation of management area tables for med and low frequency compost in CALAND(). (4) Edited the climate scalar adjustment section for rangeland management to accommodate the new possibility for rangelandss management practices with annually-applied benefits. Climate scalar adjustments are now considered for both current-year management areas (man_area) and cumulative management areas (man_area_sum) depending on whether it’s compost related or not. This consideration is also factored into the final area-weighted carbon accumulation equations and whether to use the cumulative unmanaged areas or annual unmanaged areas in the calculations. (5) Note that currently only one agriculural management practice is valid per land category because the historic flux (soilc_accum_val)would otherwise be double-counted when the land categories are sum aggregated. For now, continue calculating the combined management practices externally. There could also be issues with range_cum if there were multiple rangeland agricultural practices (excluding restoration). Updates to plot_caland(): (1) made the plotting dataframe for cultivated lands more general to accomodate new practice ID’s by removing the subsetting by 'soil conservation’ and changed it to subset by land type equal to cultivated. (2) expanded the plotting functionality for rangelands with non-compost related management practices that benefits divided by annual areas instead of cumulative area for the sensitivity plots. lc_params_2020_12_14.xls: (1) all the new management ID’s for cultivated and rangelands are explicit, including the 20% dissolution ID’s. lc_params_2020_11_11.xls: (1) old version prior to making the rangeland mangagement practice ID’s explicit. Updates to plot_caland(): (1) only edited the formatting of the licencing

commit f44ba47
Author: Maegen Simmonds <maegen.simmonds@gmail.com>
Date:   Sun Dec 6 18:27:42 2020 -0800

    In CALAND(): 1) corrected the calculations for the cultivated and rangeland input values for mean - SD and mean - 2*SD. Before it was subtracting the mean from the SD. 2) shortened the climate scalar adjustment section by replacing the loops for each row of the man_adjust_df_check_cult and man_adjust_df_check_range data frames with single line of ifelse() that checked the whole column at once. 3) commented out the exported csv files for testing the climate scalar adjustment - these were checked an it was working correctly. In plot_uncertainty(): 1) fixed the formatting of the new licencing information; 2) updated the description of scenarios_a,b,and c to make it clearer which file it’s referring to; 3) added the new argument, scenario_file_labels, to allow for more tailored labeling of the plots in scen_labs_a,b,c. Before an error would be triggered if including a ‘%’ symbol in scen_labs_a because the scenario labels for the plots were used as a filename tag, which can’t include a percent symbol. Now the user specifies all the file name tags with scenario_file_labels. 4) added the new arguments: cultivated and rangelands, which are TRUE or FALSE, and indicated whether the plot_caland files that are being read include uncertainty bounds for rangeland or cultivated managed fluxes. This is needed for checking which part of the filename to select for each scenario. I had to update both possibilties - the scenario names of low, hi, and avg could be in the same file or they could be in different folders. The general structure was already in place in version 3 to accomodate that possibility for soil conservation uncertainty. Note that the tag in the filenames for cultivated lands is no longer ’S’ (previously for soil_conservation) and is ‘C’ for Cultivated since there are additional practices. Similarly, ‘R’ is used for rangelands followed by +/-SD or +/-2SD.

commit 9656663
Author: Maegen Simmonds <maegen.simmonds@gmail.com>
Date:   Tue Dec 1 16:22:51 2020 -0800

    Fixed an issue with merging the managed fluxes for cultivated and rangelands into their respective adjustment dataframes. Previously it was merging based on land category only, but this would not work correctly if there are multiple management practices per land type. This update  merges based on land category and management practice.

commit 6ac2ff7
Author: Maegen Simmonds <maegen.simmonds@gmail.com>
Date:   Thu Nov 19 14:49:01 2020 -0800

    updated caland() so that it would export 3 dataframes for each annual loop as CSV so that an external script could check that the climate-adjusted soil c flux calculations are valid. specifically, man_adjust_df_check_cult, man_adjust_df_check_range, and man_soilflux_agg are exported.

commit f15725a
Author: Maegen Simmonds <maegen.simmonds@gmail.com>
Date:   Thu Nov 12 15:12:09 2020 -0800

    edited the climate scalar dataframe tracker so it would save the soil scalars in the final simulation year.

commit 5ac7101
Author: Maegen Simmonds <maegen.simmonds@gmail.com>
Date:   Thu Nov 12 10:20:35 2020 -0800

    adding updated lc_params with new rangeland structure, new inputs for cultivated and rangeland. Note that the SD now represent the propagated error of the change in total net flux, and for the rock + soil_con and rock + 10-year compost, the rock SD component represents the max potential range in the change (i.e, bicarbonate versus carbonate fate). Also note that the rock + 10-year compost is input with the management name of low_frequency so that the benefits will be applied consistently for 30 years - the length of the WLIC management period.

commit 3a0df2e
Author: Maegen Simmonds <maegen.simmonds@gmail.com>
Date:   Thu Nov 12 10:09:29 2020 -0800

    1) added more identifying columns (reg, lt, own) to the new management cultivated and rangeland dataframes for tracking changes in soil c flux signs; 2) cleaned up checks; 3) No longer replacing the soil climate scalars in the original dataframe (climate_soil_df); instead it adds one column for cultivated scalar adjustments ([year]_adjusted_cult) and one for rangeland ([year]_adjusted_range). Note that there will always be a value in the adjustment column if there is management area regardless if the adjustment was made. This is fine because it will retain the original scalar if the adjustment is not needed. 4) The new climate_soil_df with the 2 additional adjustment columns per year (if there’s any mangement) is comppiled for each annual loop and saved as a CSV to allow checking that the scalars are adjusted correctly. 5) deleted the original calculation of the climate-scaled historic soil c flux (soilc_accum_df *  * climate_soil_df[,as.character(year)]) because this is now done for the managed (man_soil_df) and unmanaged areas separately 5a) For managed lands, first it excludes all ag lands, and then calculates soilcfluxXarea using the original climate scalar. second for managed lands,  if the adjusted cultivated soil climate scalar column exists, it selects only cultivated, and then calculates soilcfluxXarea using the adjusted cultivated soil climate scalar column, and if no managed areas it sets soilcfluxXarea to 0. Same for rangelands. 5b) For unmanaged lands, it applies the unadjusted soil climate scalar in the man_soilflux_agg df when calculating the area-weighted soil c flux, which already includes the climate-scaled managed soil c flux (soilcfluxXarea).

commit 131d047
Author: Maegen Simmonds <maegen.simmonds@gmail.com>
Date:   Wed Oct 21 15:37:53 2020 -0700

    reverted the changes to the original lc_params.xls to keep that as a version, although it can't be used with the new CALAND or write_caland due to the new structure of grass_manage.

commit 2671793
Author: Maegen Simmonds <maegen.simmonds@gmail.com>
Date:   Wed Oct 21 15:09:05 2020 -0700

    edited lc_params.xls to include the new cultivated and rangeland management practices. Also changes the input table for rangelands (grass_manage sheet) so that there are absolute fluxes input the same way as cultivated lands. However, Low_frequency is actually the medium frequency compost amendment every 10 years and 40 tonne rock/ha. It's input this way so that the beneft period lasts 30 years - the length of the simulation for the WLIC pathways simulations.

commit a1542ce
Author: Maegen Simmonds <maegen.simmonds@gmail.com>
Date:   Mon Oct 19 16:47:00 2020 -0700

    updated intro to match the upstream master update wrt licensing; Edited the description of the carbon input file with the updated absolute fluxes for managemed rangeland; Added the additional arguments to CALAND() to the argument descriptions (value_col_range, ADD_range, double_soilcon, double_range); Update the filenaming algorithm that checks for the tags for soil cultivated and rangeland and labels it according to whether the SD is  added or subtracted, and whether it’s doubled.

commit 442498c
Author: Maegen Simmonds <maegen.simmonds@gmail.com>
Date:   Fri Oct 16 14:38:19 2020 -0700

    Updated write_caland_inputs() to accomodate the new structure for the grass_manage tab (absolute mean, min, max, SD fluxes) in lc_params.xls

commit 0dce7fc
Author: Maegen Simmonds <maegen.simmonds@gmail.com>
Date:   Fri Oct 16 14:34:44 2020 -0700

    replaced with new files created by Alan who corrected the calculations for Delta cultivated scalars as follows: new = 2 - old. This is based on how they were originally calculated. The delta fresh marsh scalars are correct because fresh marsh has positive soil c accumulation, so these are set before this adjustment for negative delta cultivated soil accumulation.

commit 97ac5c4
Author: Maegen Simmonds <maegen.simmonds@gmail.com>
Date:   Fri Oct 16 14:33:36 2020 -0700

    Updated lc_params with new values for cultivated and rangeland management. note that the rangeland rock + 1—year freq compost had to be input as ‘Low frequency’ so that there could be 30 years of benefits. changed grass_manage tab to mirror the ag_manage tab so the absolutes are input.

commit b40ddef
Author: Maegen Simmonds <maegen.simmonds@gmail.com>
Date:   Fri Oct 16 14:29:25 2020 -0700

    added new arguments to CALAND to control rangeland inputs (mean mean+SD or mean-SD), and to control whether to double the SD for cultivated or rangeland management (double_soilcon and double_range)
    added a file tag within CALAND() (ftag_range) to indicate in filename whether rangeland management was simulated as mean or +/- SD
    similar to soil conservation (man_ag_df), added dataframe shortcut for rangeland management to assign the correct flux column (man_grass_df)
    added check if double_soilcon or double_range are true, to double the +/- SD
    added check before soil climate effect is applied to the historic soil c flux, to see if the cultivated or rangelenad managed soil flux sign differs from the historic soil flux, and then make the necessary adjustments to the climate scalar. Note this is only done if there is management for the current year. This is checked by first  subsetting rows for cultivated lands that have man_area != 0 and for rangelands that have man_area_sum !=0, excluding restoration. (this may not work for rangelands - does the man_area_sum revert to 0 after benefit period  ends?)

commit fe4d273
Merge: dc02da5 b5626cc
Author: Maegen Simmonds <maegen.simmonds@gmail.com>
Date:   Thu Aug 6 15:06:17 2020 -0700

    adding changes from upstream regarding new licencing

commit dc02da5
Author: Maegen Simmonds <maegen.simmonds@gmail.com>
Date:   Thu Mar 26 15:39:28 2020 -0700

    added new management practices to cultivated lands and rangelands, i.e., rock and rock_plus_soil_con in cultivated and rock and rock_plus_compost in grassland, savanna, and woodland, based on literature values and assuming additive effect. calculations in google sheet: https://docs.google.com/spreadsheets/d/1v0Ix2AqwKzLvO3jKSb0a7k0Q6az5OnjPCKZfrHeBzJo/edit#gid=1069581180
sbassett referenced this issue in TNC-NMFO/NWLAND Jul 26, 2021
commit cc3b404
Merge: fe7f9bc c1454a3
Author: Alan Di Vittorio <avdivittorio@lbl.gov>
Date:   Mon Apr 12 10:04:51 2021 -0700

    Merge pull request #86 from msimmond/WLIC

    Completing the WLIC development branch merge

commit c1454a3
Merge: 706554e e051923
Author: Maegen Simmonds <maegen.simmonds@gmail.com>
Date:   Fri Apr 9 17:36:57 2021 -0700

    trying to sync with remote WLIC which is apparently still ahead one commit

commit 706554e
Author: Maegen Simmonds <maegen.simmonds@gmail.com>
Date:   Fri Apr 9 17:32:13 2021 -0700

    adding updated readme file that I created remotely

commit fe7f9bc
Merge: b5626cc e051923
Author: Alan Di Vittorio <avdivittorio@lbl.gov>
Date:   Fri Apr 9 11:50:36 2021 -0700

    Merge pull request #85 from msimmond/WLIC

    Merge active WLIC branch into new WLIC development branch in main repo

commit 529ef7c
Author: Maegen Simmonds <maegen.simmonds@gmail.com>
Date:   Wed Feb 24 16:44:26 2021 -0800

    1) in CALAND() added range_cum definition to the CALAND() argument description. corrected the name in a stop check.  2)  in plot_caland() updated some formatting and the order of the landtypes/management that are evaluated in the individual per area (per year) loops within the annual GHG loop and the cumulative GHG loop. Moved the rangeland evaluation up below cultivated. 3) in plot_caland, within the annual GHG loop, the rangeland checks whether range_cum is TRUE (use cumulative area) or FALSE (use annual area), and divides by the corresponding area. A test was incorporated to stop if low_frequency or med_frequency were prescribed and range_cum was incorrectly set as FALSE. 3) in plot_caland, I updated the individual practice cultivated land evaluation within the cumulative GHG loop to check for the landtype instead of by management practice (soil conservation) since we have more management practices now. Note that I left rangeland alone in this loop since, similar to annual practices in cultivated lands, the cumulative GHG loop will calculate cum benefits / cum area (/year) regardless if it’s annual or cumulative practice. However, the rangeland annual per area benefit  should be updated so that it’s dividing by the cumulative area for that benefit period and not total since the beginning of the simulation. This is an outstanding issue #84 on Alan’s master.

commit e051923
Author: Maegen Simmonds <mbsimmonds@lbl.gov>
Date:   Tue Jan 19 09:33:06 2021 -0800

    Update readme

    added the formatting for the CALAND DOI hyperlink

commit 1513005
Author: Maegen Simmonds <mbsimmonds@lbl.gov>
Date:   Tue Jan 19 09:32:13 2021 -0800

    Update readme with the new paper citations

commit e867a16
Author: Maegen Simmonds <mbsimmonds@lbl.gov>
Date:   Tue Jan 19 09:23:45 2021 -0800

    Update readme with new peer-reviewed publication

commit 71c0d45
Author: Maegen Simmonds <maegen.simmonds@gmail.com>
Date:   Tue Jan 19 09:10:53 2021 -0800

    Updates to CALAND(): (1) Added range_cum argument to CALAND() to allow for new rangeland management practices that can be simulated with annual benefits during the year of management only (range_cum = FALSE) - the same way as cultivated lands - or be simulated with cumulative benefits over 10 or 30 years for Low_frequency or Med_frequency compost application, respectively. The latter was the original designation. If range_cum is set as TRUE if a new rangeland management practice is prescribed (i.e., not Low_frequency or Med_frequency) it is automatically treated as a 30-year benefit period, i.e., the same as Low_frequency. (2) A check was added to CALAND() to ensure that if Low_frequency or Med_frequency are prescribed, that range_cum is TRUE. (3) Annotated the creation of management area tables for med and low frequency compost in CALAND(). (4) Edited the climate scalar adjustment section for rangeland management to accommodate the new possibility for rangelandss management practices with annually-applied benefits. Climate scalar adjustments are now considered for both current-year management areas (man_area) and cumulative management areas (man_area_sum) depending on whether it’s compost related or not. This consideration is also factored into the final area-weighted carbon accumulation equations and whether to use the cumulative unmanaged areas or annual unmanaged areas in the calculations. (5) Note that currently only one agriculural management practice is valid per land category because the historic flux (soilc_accum_val)would otherwise be double-counted when the land categories are sum aggregated. For now, continue calculating the combined management practices externally. There could also be issues with range_cum if there were multiple rangeland agricultural practices (excluding restoration). Updates to plot_caland(): (1) made the plotting dataframe for cultivated lands more general to accomodate new practice ID’s by removing the subsetting by 'soil conservation’ and changed it to subset by land type equal to cultivated. (2) expanded the plotting functionality for rangelands with non-compost related management practices that benefits divided by annual areas instead of cumulative area for the sensitivity plots. lc_params_2020_12_14.xls: (1) all the new management ID’s for cultivated and rangelands are explicit, including the 20% dissolution ID’s. lc_params_2020_11_11.xls: (1) old version prior to making the rangeland mangagement practice ID’s explicit. Updates to plot_caland(): (1) only edited the formatting of the licencing

commit f44ba47
Author: Maegen Simmonds <maegen.simmonds@gmail.com>
Date:   Sun Dec 6 18:27:42 2020 -0800

    In CALAND(): 1) corrected the calculations for the cultivated and rangeland input values for mean - SD and mean - 2*SD. Before it was subtracting the mean from the SD. 2) shortened the climate scalar adjustment section by replacing the loops for each row of the man_adjust_df_check_cult and man_adjust_df_check_range data frames with single line of ifelse() that checked the whole column at once. 3) commented out the exported csv files for testing the climate scalar adjustment - these were checked an it was working correctly. In plot_uncertainty(): 1) fixed the formatting of the new licencing information; 2) updated the description of scenarios_a,b,and c to make it clearer which file it’s referring to; 3) added the new argument, scenario_file_labels, to allow for more tailored labeling of the plots in scen_labs_a,b,c. Before an error would be triggered if including a ‘%’ symbol in scen_labs_a because the scenario labels for the plots were used as a filename tag, which can’t include a percent symbol. Now the user specifies all the file name tags with scenario_file_labels. 4) added the new arguments: cultivated and rangelands, which are TRUE or FALSE, and indicated whether the plot_caland files that are being read include uncertainty bounds for rangeland or cultivated managed fluxes. This is needed for checking which part of the filename to select for each scenario. I had to update both possibilties - the scenario names of low, hi, and avg could be in the same file or they could be in different folders. The general structure was already in place in version 3 to accomodate that possibility for soil conservation uncertainty. Note that the tag in the filenames for cultivated lands is no longer ’S’ (previously for soil_conservation) and is ‘C’ for Cultivated since there are additional practices. Similarly, ‘R’ is used for rangelands followed by +/-SD or +/-2SD.

commit 9656663
Author: Maegen Simmonds <maegen.simmonds@gmail.com>
Date:   Tue Dec 1 16:22:51 2020 -0800

    Fixed an issue with merging the managed fluxes for cultivated and rangelands into their respective adjustment dataframes. Previously it was merging based on land category only, but this would not work correctly if there are multiple management practices per land type. This update  merges based on land category and management practice.

commit 6ac2ff7
Author: Maegen Simmonds <maegen.simmonds@gmail.com>
Date:   Thu Nov 19 14:49:01 2020 -0800

    updated caland() so that it would export 3 dataframes for each annual loop as CSV so that an external script could check that the climate-adjusted soil c flux calculations are valid. specifically, man_adjust_df_check_cult, man_adjust_df_check_range, and man_soilflux_agg are exported.

commit f15725a
Author: Maegen Simmonds <maegen.simmonds@gmail.com>
Date:   Thu Nov 12 15:12:09 2020 -0800

    edited the climate scalar dataframe tracker so it would save the soil scalars in the final simulation year.

commit 5ac7101
Author: Maegen Simmonds <maegen.simmonds@gmail.com>
Date:   Thu Nov 12 10:20:35 2020 -0800

    adding updated lc_params with new rangeland structure, new inputs for cultivated and rangeland. Note that the SD now represent the propagated error of the change in total net flux, and for the rock + soil_con and rock + 10-year compost, the rock SD component represents the max potential range in the change (i.e, bicarbonate versus carbonate fate). Also note that the rock + 10-year compost is input with the management name of low_frequency so that the benefits will be applied consistently for 30 years - the length of the WLIC management period.

commit 3a0df2e
Author: Maegen Simmonds <maegen.simmonds@gmail.com>
Date:   Thu Nov 12 10:09:29 2020 -0800

    1) added more identifying columns (reg, lt, own) to the new management cultivated and rangeland dataframes for tracking changes in soil c flux signs; 2) cleaned up checks; 3) No longer replacing the soil climate scalars in the original dataframe (climate_soil_df); instead it adds one column for cultivated scalar adjustments ([year]_adjusted_cult) and one for rangeland ([year]_adjusted_range). Note that there will always be a value in the adjustment column if there is management area regardless if the adjustment was made. This is fine because it will retain the original scalar if the adjustment is not needed. 4) The new climate_soil_df with the 2 additional adjustment columns per year (if there’s any mangement) is comppiled for each annual loop and saved as a CSV to allow checking that the scalars are adjusted correctly. 5) deleted the original calculation of the climate-scaled historic soil c flux (soilc_accum_df *  * climate_soil_df[,as.character(year)]) because this is now done for the managed (man_soil_df) and unmanaged areas separately 5a) For managed lands, first it excludes all ag lands, and then calculates soilcfluxXarea using the original climate scalar. second for managed lands,  if the adjusted cultivated soil climate scalar column exists, it selects only cultivated, and then calculates soilcfluxXarea using the adjusted cultivated soil climate scalar column, and if no managed areas it sets soilcfluxXarea to 0. Same for rangelands. 5b) For unmanaged lands, it applies the unadjusted soil climate scalar in the man_soilflux_agg df when calculating the area-weighted soil c flux, which already includes the climate-scaled managed soil c flux (soilcfluxXarea).

commit 131d047
Author: Maegen Simmonds <maegen.simmonds@gmail.com>
Date:   Wed Oct 21 15:37:53 2020 -0700

    reverted the changes to the original lc_params.xls to keep that as a version, although it can't be used with the new CALAND or write_caland due to the new structure of grass_manage.

commit 2671793
Author: Maegen Simmonds <maegen.simmonds@gmail.com>
Date:   Wed Oct 21 15:09:05 2020 -0700

    edited lc_params.xls to include the new cultivated and rangeland management practices. Also changes the input table for rangelands (grass_manage sheet) so that there are absolute fluxes input the same way as cultivated lands. However, Low_frequency is actually the medium frequency compost amendment every 10 years and 40 tonne rock/ha. It's input this way so that the beneft period lasts 30 years - the length of the simulation for the WLIC pathways simulations.

commit a1542ce
Author: Maegen Simmonds <maegen.simmonds@gmail.com>
Date:   Mon Oct 19 16:47:00 2020 -0700

    updated intro to match the upstream master update wrt licensing; Edited the description of the carbon input file with the updated absolute fluxes for managemed rangeland; Added the additional arguments to CALAND() to the argument descriptions (value_col_range, ADD_range, double_soilcon, double_range); Update the filenaming algorithm that checks for the tags for soil cultivated and rangeland and labels it according to whether the SD is  added or subtracted, and whether it’s doubled.

commit 442498c
Author: Maegen Simmonds <maegen.simmonds@gmail.com>
Date:   Fri Oct 16 14:38:19 2020 -0700

    Updated write_caland_inputs() to accomodate the new structure for the grass_manage tab (absolute mean, min, max, SD fluxes) in lc_params.xls

commit 0dce7fc
Author: Maegen Simmonds <maegen.simmonds@gmail.com>
Date:   Fri Oct 16 14:34:44 2020 -0700

    replaced with new files created by Alan who corrected the calculations for Delta cultivated scalars as follows: new = 2 - old. This is based on how they were originally calculated. The delta fresh marsh scalars are correct because fresh marsh has positive soil c accumulation, so these are set before this adjustment for negative delta cultivated soil accumulation.

commit 97ac5c4
Author: Maegen Simmonds <maegen.simmonds@gmail.com>
Date:   Fri Oct 16 14:33:36 2020 -0700

    Updated lc_params with new values for cultivated and rangeland management. note that the rangeland rock + 1—year freq compost had to be input as ‘Low frequency’ so that there could be 30 years of benefits. changed grass_manage tab to mirror the ag_manage tab so the absolutes are input.

commit b40ddef
Author: Maegen Simmonds <maegen.simmonds@gmail.com>
Date:   Fri Oct 16 14:29:25 2020 -0700

    added new arguments to CALAND to control rangeland inputs (mean mean+SD or mean-SD), and to control whether to double the SD for cultivated or rangeland management (double_soilcon and double_range)
    added a file tag within CALAND() (ftag_range) to indicate in filename whether rangeland management was simulated as mean or +/- SD
    similar to soil conservation (man_ag_df), added dataframe shortcut for rangeland management to assign the correct flux column (man_grass_df)
    added check if double_soilcon or double_range are true, to double the +/- SD
    added check before soil climate effect is applied to the historic soil c flux, to see if the cultivated or rangelenad managed soil flux sign differs from the historic soil flux, and then make the necessary adjustments to the climate scalar. Note this is only done if there is management for the current year. This is checked by first  subsetting rows for cultivated lands that have man_area != 0 and for rangelands that have man_area_sum !=0, excluding restoration. (this may not work for rangelands - does the man_area_sum revert to 0 after benefit period  ends?)

commit fe4d273
Merge: dc02da5 b5626cc
Author: Maegen Simmonds <maegen.simmonds@gmail.com>
Date:   Thu Aug 6 15:06:17 2020 -0700

    adding changes from upstream regarding new licencing

commit dc02da5
Author: Maegen Simmonds <maegen.simmonds@gmail.com>
Date:   Thu Mar 26 15:39:28 2020 -0700

    added new management practices to cultivated lands and rangelands, i.e., rock and rock_plus_soil_con in cultivated and rock and rock_plus_compost in grassland, savanna, and woodland, based on literature values and assuming additive effect. calculations in google sheet: https://docs.google.com/spreadsheets/d/1v0Ix2AqwKzLvO3jKSb0a7k0Q6az5OnjPCKZfrHeBzJo/edit#gid=1069581180
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

1 participant