/*This program calculates the annual production of belowground biomass as measured by ingrowth cores. They are from an experiment that begain in 2005 in which the air CO2 concentration
was increased and N was fertilized. The program ingests data from the belowground production that was measured by implanting bags filled with commerical sedge peat into three locations
per chamber each year in November, and recovering them one year later. Each bag is 26 cm2 and 40 cm deept. Sample processing has varied over the years, with recoved belowground biomass
being separated into fine roots, coarse roots, C3 rhizomes, C4 rhizomes. Contact Pat Megonigal for details.*/
proc import datafile="S:\Biogeochemistry\GCREW\0-GCREW Archive\Archived Data\2-CO2xN\5-Root Ingrowth Data\
CO2xN Master Root Ingrowth 2005-2019 (Published 09-05-2020).csv"
out=Rootbiomass
dbms=csv
replace;
getnames=YES;
proc sort; by Year Chamber CO2 Nitrogen Treatment Depth SampleID;
run;
data rootdata; set Rootbiomass;
if RootMass=-99 then RootMass=.; /*identifying missing values*/
if CoarseRootMass=-99 then CoarseRootMass=.;
if C3RhizMass=-99 then C3RhizMass=.;
if C4RhizMass=-99 then C4RhizMass=.;
if RootLitterMass=-99 then RootLitterMass=.;
RootMass_m2=(RootMass/25.5176)*10000; /* calculate the area based (AB) rootbiomass in each core. Area of root ingrowth cores = 25.5176 cm2 (lengths are provided for volume conversions if desired)*/
CoarseRootMass_m2=(CoarseRootMass/25.5176)*10000;
C3RhizMass_m2=(C3RhizMass/25.5176)*10000;
C4RhizMass_m2=(C4RhizMass/25.5176)*10000;
RootLitterMass_m2=(RootLitterMass/25.5176)*10000;
TotalBelowMass_m2=sum(RootMass_m2, C3RhizMass_m2, C4RhizMass_m2 );
proc sort; by Year Chamber CO2 Nitrogen Treatment Depth SampleID;
proc means noprint;
var RootMass_m2 CoarseRootMass_m2 C3RhizMass_m2 C4RhizMass_m2 TotalBelowMass_m2 RootLitterMass_m2; /* Total root C3 and C4 Rhiz biomass as the variables*/
by Year Chamber CO2 Nitrogen Treatment; /* calculate the biomass in each year in each chamber*/
output out=ROOTdata (drop = _type_ _freq_) mean=RootMass_m2 CoarseRootMass_m2 C3RhizMass_m2 C4RhizMass_m2 TotalBelowMass_m2 RootLitterMass_m2;
run;
Data ROOTBIOtype; Set ROOTdata;
if Year=2005 then delete; /* In year 2005 we harvested all root biomass in 0-30 cm layers, therefore data in 2005 were root biomass. Data after 2005 were root productivity. */
if RootMass_m2=. then RootMass_m2=-99;
if CoarseRootMass_m2=. then CoarseRootMass_m2=-99;
if C3RhizMass_m2=. then C3RhizMass_m2=-99;
if C4RhizMass_m2=. then C4RhizMass_m2=-99;
if TotalBelowMass_m2=. then TotalBelowMass_m2=-99;
if RootLitterMass_m2=. then RootLitterMass_m2=-99;
proc export data=ROOTBIOtype
/*Year after 2005 Root productivity data. Exports an excel file to the "making data sheets" folder. Update the name of this file appropriately*/
outfile='S:\Biogeochemistry\GCREW\0-GCREW Archive\Archived Data\2-CO2xN\1-Biomass (Derived)\3-CO2xN Root Biomass by Category 2006-2019.csv' replace dbms=csv;
run;
Data Data ROOTBIO2005; Set ROOTdata;
if year>2005 then delete; /* In year 2005 we harvested all root biomass in 0-30 cm layers, therefore data in 2005 were root biomass. Data after 2005 were root productivity. */
if RootMass_m2=. then RootMass_m2=-99;
if CoarseRootMass_m2=. then CoarseRootMass_m2=-99;
if C3RhizMass_m2=. then C3RhizMass_m2=-99;
if C4RhizMass_m2=. then C4RhizMass_m2=-99;
if TotalBelowMass_m2=. then TotalBelowMass_m2=-99;
if RootLitterMass_m2=. then RootLitterMass_m2=-99;
proc export data=ROOTBIO2005
/*2005 Root biomass data. Exports an excel file to the "making data sheets" folder. Update the name of this file appropriately*/
outfile='S:\Biogeochemistry\GCREW\0-GCREW Archive\Archived Data\2-CO2xN\1-Biomass (Derived)\3-CO2xN Root Biomass by Category 2005.csv' replace dbms=csv;
run;