/*This program calculates the annual production of belowground biomass as measured by ingrowth cores. They are from an experiment that begain in 1987 in which the air CO2 concentration
was increased in three plant communities. 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 deep. Sample processing has varied over the years, with recoved belowground
biomass being separated into roots, C3 rhizomes, C4 rhizomes or just total mass, and combinations thereof. Staring in 2016 a new category was added, "Other Rhizome Biomass" which is
rarely used. Because methods varied over the course of this long-term study, there is code that makes a variety of adjustments to the input data in order arrive at a comparable annual
figure for each plot. Contact Pat Megonigal for details.*/
proc import datafile="S:\Biogeochemistry\GCREW\0-GCREW Archive\Archived Data\1-CO2xCommunity\
5-Root Ingrowth Data\CO2xComm Master Root Ingrowth 1987-2019 (Published 04-25-2020).csv"
out=Rootbiomass
dbms=dlm
replace;
delimiter=",";
proc sort; by year community treatment chamber core;
run;
data rootdata; set Rootbiomass;
if RootMass=-99 then RootMass=.; /*identifying missing values*/
if C3RhizMass=-99 then C3RhizMass=.;
if C4RhizMass=-99 then C4RhizMass=.;
if OtherRhizMass=-99 then OtherRhizMass=.;
if TotalRhizMass=-99 then TotalRhizMass=.;
if RootRhizMass=-99 then RootRhizMass=.;
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)*/
C3RhizMass_m2=(C3RhizMass/25.5176)*10000;
C4RhizMass_m2=(C4RhizMass/25.5176)*10000;
OtherRhizMass_m2=(OtherRhizMass/25.5176)*10000;
RootRhizMass_m2=(RootRhizMass/25.5176)*10000;
RhizMass_m2=sum(C3RhizMass_m2,C4RhizMass_m2,OtherRhizMass_m2);
TotalRhizMass_m2=(TotalRhizMass/25.5176)*10000;
TotalBelowMass_m2=sum(RootMass_m2,RhizMass_m2,TotalRhizMass_m2);
if year=1992 then TotalBelowMass_m2=RootRhizMass_m2;
if year=1997 then TotalBelowMass_m2=sum(RootMass_m2, RhizMass_m2);/*C3, C4 Rhizomes and Total_Rhiz_Mass data were in the Master data set for year 1997 and 1998 (C3, C4 Rhizomes data were found from Erickson's dataset). We only found Total_Rhiz_Mass data on SERC server.*/
if year=1998 then TotalBelowMass_m2=sum(RootMass_m2, RhizMass_m2);
proc sort; by year community treatment chamber core;
run;
/*OtherRhizMass_m2 is excluded as a separate category because there is just one observation of it. However, OtherRhizMass_m2 is included in the TotalRhizMass_m2*/
proc means noprint;
var RootMass_m2 C3RhizMass_m2 C4RhizMass_m2 RhizMass_m2 TotalRhizMass_m2 RootRhizMass_m2 TotalBelowMass_m2; /* Total root C3 and C4 Rhiz biomass as the variables*/
by year community treatment chamber; /* calculate the biomass in each year in each chamber*/
output out=ROOTdata (drop = _type_ _freq_) mean=RootMass_m2 C3RhizMass_m2 C4RhizMass_m2 RhizMass_m2 TotalRhizMass_m2 RootRhizMass_m2 TotalBelowMass_m2;
run;
Data TOTALroot; Set ROOTdata (drop = Rootmass_m2 C3Rhizmass_m2 C4Rhizmass_m2 Rhizmass_m2 TotalRhizMass_m2 RootRhizMass_m2);
if TotalBelowMass_m2=. then TotalBelowMass_m2=-99;
proc export data=TOTALroot
outfile='S:\Biogeochemistry\GCREW\0-GCREW Archive\Archived Data\1-CO2xCommunity\1-Biomass (Derived)\
3-CO2xComm Total Root Biomass 1987-2019.csv'
replace
dbms=dlm;
delimiter=",";
run;
Data ROOTBIOtype; Set ROOTdata (drop = TotalRhizMass_m2 RootRhizMass_m2);
if year ge 2000;
proc export data=ROOTBIOtype
outfile='S:\Biogeochemistry\GCREW\0-GCREW Archive\Archived Data\1-CO2xCommunity\1-Biomass (Derived)\
3-CO2xComm Root Biomass by Category 2000-2019.csv'
replace
dbms=dlm;
delimiter=",";
run;