diff --git a/ConcordanceLibrary/Additional/20200426_Additional_Root2Mother_Sec_Ind30Pro39v1.xlsx b/ConcordanceLibrary/Additional/20200426_Additional_Root2Mother_Sec_Ind30Pro39v1.xlsx new file mode 100644 index 0000000..5e6fc18 Binary files /dev/null and b/ConcordanceLibrary/Additional/20200426_Additional_Root2Mother_Sec_Ind30Pro39v1.xlsx differ diff --git a/ConcordanceLibrary/IRP/20200426_IRP_Extraction_SecConc.xlsx b/ConcordanceLibrary/IRP/20200426_IRP_Extraction_SecConc.xlsx new file mode 100644 index 0000000..fc3248d Binary files /dev/null and b/ConcordanceLibrary/IRP/20200426_IRP_Extraction_SecConc.xlsx differ diff --git a/ConcordanceLibrary/Sector Aggregators/20200426_30Industries_SectorAggregator.csv b/ConcordanceLibrary/Sector Aggregators/20200426_30Industries_SectorAggregator.csv new file mode 100644 index 0000000..9864143 --- /dev/null +++ b/ConcordanceLibrary/Sector Aggregators/20200426_30Industries_SectorAggregator.csv @@ -0,0 +1,76 @@ +1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0,1,0,0,0,0,0,0,0,0,0,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,0,0,0,0,0,0,0,0,0,0,0,0,1,0 diff --git a/ConcordanceLibrary/Sector Aggregators/20200426_39Products_SectorAggregator.csv b/ConcordanceLibrary/Sector Aggregators/20200426_39Products_SectorAggregator.csv new file mode 100644 index 0000000..a482786 --- /dev/null +++ b/ConcordanceLibrary/Sector Aggregators/20200426_39Products_SectorAggregator.csv @@ -0,0 +1,266 @@ +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0 +1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0 +1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0 +0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0 +0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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0,0,0,0,0,0,0,0,0,0 +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0 +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0 +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0 +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0 +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0 +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0 +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0 +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0 +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0 diff --git a/ConcordanceLibrary/Sector Aggregators/Archive/20200421_30Industries_SectorAggregator.csv b/ConcordanceLibrary/Sector Aggregators/Archive/20200421_30Industries_SectorAggregator.csv new file mode 100644 index 0000000..9864143 --- /dev/null +++ b/ConcordanceLibrary/Sector Aggregators/Archive/20200421_30Industries_SectorAggregator.csv @@ -0,0 +1,76 @@ +1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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,0 +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0 +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0 +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0 +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0 +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0 +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0 +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0 diff --git a/ConcordanceLibrary/Sector Aggregators/Archive/20200421_39Products_SectorAggregator.csv b/ConcordanceLibrary/Sector Aggregators/Archive/20200421_39Products_SectorAggregator.csv new file mode 100644 index 0000000..e0b669a --- /dev/null +++ b/ConcordanceLibrary/Sector Aggregators/Archive/20200421_39Products_SectorAggregator.csv @@ -0,0 +1,266 @@ +1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +1,0,0,0,0,0,0,0,0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0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0 +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0 diff --git a/ConcordanceLibrary/WSA/20200426_WSA_Source2Root_Industry.csv b/ConcordanceLibrary/WSA/20200426_WSA_Source2Root_Industry.csv new file mode 100644 index 0000000..a03a7bf --- /dev/null +++ b/ConcordanceLibrary/WSA/20200426_WSA_Source2Root_Industry.csv @@ -0,0 +1,27 @@ +0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0,0,0,0,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0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,0,0,0,0,0 +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 diff --git a/ConcordanceLibrary/WSA/20200426_WSA_Source2Root_Product.csv b/ConcordanceLibrary/WSA/20200426_WSA_Source2Root_Product.csv new file mode 100644 index 0000000..c284518 --- /dev/null +++ b/ConcordanceLibrary/WSA/20200426_WSA_Source2Root_Product.csv @@ -0,0 +1,27 @@ +0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0,0,0,0,0,0,0,0,0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0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 diff --git a/ConcordanceLibrary/WSA/Archive/20200421_WSA_Source2Root_Industry.csv b/ConcordanceLibrary/WSA/Archive/20200421_WSA_Source2Root_Industry.csv new file mode 100644 index 0000000..a03a7bf --- /dev/null +++ b/ConcordanceLibrary/WSA/Archive/20200421_WSA_Source2Root_Industry.csv @@ -0,0 +1,27 @@ +0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0,0,0,0,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0,0,0,0,0,0,0,0,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0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 diff --git a/ConcordanceLibrary/WSA/Archive/20200421_WSA_Source2Root_Product.csv b/ConcordanceLibrary/WSA/Archive/20200421_WSA_Source2Root_Product.csv new file mode 100644 index 0000000..cf043f7 --- /dev/null +++ b/ConcordanceLibrary/WSA/Archive/20200421_WSA_Source2Root_Product.csv @@ -0,0 +1,27 @@ +0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0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A_Source2Root_WithLabelsV4.xlsx new file mode 100644 index 0000000..e9c191e Binary files /dev/null and b/ConcordanceLibrary/WSA/WSA_Source2Root_WithLabelsV4.xlsx differ diff --git a/IEfeeds_code/Archive/Ind20Pro22v1_InitialEstimate.m b/IEfeeds_code/Archive/Ind20Pro22v1_InitialEstimate.m new file mode 100644 index 0000000..4866435 --- /dev/null +++ b/IEfeeds_code/Archive/Ind20Pro22v1_InitialEstimate.m @@ -0,0 +1,49 @@ +function [RegMap,IndMap,ProdMap]=Ind20Pro22v1_InitialEstimate(handles) + + disp('Launching initial estimate for the extended PIOT version 1'); + + % Write handles variables into mat-file for R to read + % Working directory + filename = [handles.processeddatadir,'WorkingDirectory4R.mat']; + out = handles.motherALANGdir; + save(filename,'out'); + + % Write region aggregator to file + filename = [handles.processeddatadir,'RegionAggFile4R.mat']; + out = handles.regionaggfile; + save(filename,'out'); + + % Region aggregator + RegMap = csvread(handles.regionagg); + + if size(RegMap,1) > size(RegMap,2) % check orientation of aggregator + RegMap = RegMap'; + end + + reg_proxy = ones(size(RegMap,2),1); + RegMap = prorate(RegMap,'col_proxy',reg_proxy); + + % Product aggregator + ProdMap = csvread(handles.sectoraggprod); + + if size(ProdMap,1) > size(ProdMap,2) % check orientation of aggregator + ProdMap = ProdMap'; + end + + prod_proxy = ones(size(ProdMap,2),1); + ProdMap = prorate(ProdMap,'col_proxy',prod_proxy); + + % Industry aggregator + IndMap = csvread(handles.sectoragg); + + if size(IndMap,1) > size(IndMap,2) % check orientation of aggregator + IndMap = IndMap'; + end + + ind_proxy = ones(size(IndMap,2),1); + IndMap = prorate(IndMap,'col_proxy',ind_proxy); + + command = 'Rscript /import/emily1/isa/IELab/Roots/PIOLab/Rscripts/IEfeeds_code/Ind20Pro22v1_InitialEstimate.R'; + system(command,'-echo'); + + end \ No newline at end of file diff --git a/IEfeeds_code/Archive/Ind30Pro40v1_InitialEstimate.m b/IEfeeds_code/Archive/Ind30Pro40v1_InitialEstimate.m new file mode 100644 index 0000000..7db8a82 --- /dev/null +++ b/IEfeeds_code/Archive/Ind30Pro40v1_InitialEstimate.m @@ -0,0 +1,49 @@ +function [RegMap,IndMap,ProdMap]=Ind30Pro40v1_InitialEstimate(handles) + + disp('Launching initial estimate for the extended PIOT version 1'); + + % Write handles variables into mat-file for R to read + % Working directory + filename = [handles.processeddatadir,'WorkingDirectory4R.mat']; + out = handles.motherALANGdir; + save(filename,'out'); + + % Write region aggregator to file + filename = [handles.processeddatadir,'RegionAggFile4R.mat']; + out = handles.regionaggfile; + save(filename,'out'); + + % Region aggregator + RegMap = csvread(handles.regionagg); + + if size(RegMap,1) > size(RegMap,2) % check orientation of aggregator + RegMap = RegMap'; + end + + reg_proxy = ones(size(RegMap,2),1); + RegMap = prorate(RegMap,'col_proxy',reg_proxy); + + % Product aggregator + ProdMap = csvread(handles.sectoraggprod); + + if size(ProdMap,1) > size(ProdMap,2) % check orientation of aggregator + ProdMap = ProdMap'; + end + + prod_proxy = ones(size(ProdMap,2),1); + ProdMap = prorate(ProdMap,'col_proxy',prod_proxy); + + % Industry aggregator + IndMap = csvread(handles.sectoragg); + + if size(IndMap,1) > size(IndMap,2) % check orientation of aggregator + IndMap = IndMap'; + end + + ind_proxy = ones(size(IndMap,2),1); + IndMap = prorate(IndMap,'col_proxy',ind_proxy); + + command = 'Rscript /import/emily1/isa/IELab/Roots/PIOLab/Rscripts/IEfeeds_code/Ind30Pro40v1_InitialEstimate.R'; + system(command,'-echo'); + + end \ No newline at end of file diff --git a/IEfeeds_code/IEsettings/IE_longnames.txt b/IEfeeds_code/IEsettings/IE_longnames.txt index 31b7c0c..eba8d88 100644 --- a/IEfeeds_code/IEsettings/IE_longnames.txt +++ b/IEfeeds_code/IEsettings/IE_longnames.txt @@ -1,2 +1 @@ -IE feed from R for various regions with 20 industries and 22 products IE feed from R for various regions with 30 industries and 39 products \ No newline at end of file diff --git a/IEfeeds_code/IEsettings/IE_shortnames.txt b/IEfeeds_code/IEsettings/IE_shortnames.txt index ae1da5f..fc19c2b 100644 --- a/IEfeeds_code/IEsettings/IE_shortnames.txt +++ b/IEfeeds_code/IEsettings/IE_shortnames.txt @@ -1,2 +1 @@ -Ind20Pro22v1 Ind30Pro39v1 \ No newline at end of file diff --git a/IEfeeds_code/datafeed_PIOLab_InitialEstimate.m b/IEfeeds_code/datafeed_PIOLab_InitialEstimate.m index 08b4ba8..563952e 100644 --- a/IEfeeds_code/datafeed_PIOLab_InitialEstimate.m +++ b/IEfeeds_code/datafeed_PIOLab_InitialEstimate.m @@ -3,10 +3,6 @@ % Master file for IE feeds if handles.nonsurvey == 1 - - [RegMap,IndMap,ProdMap]=Ind20Pro22v1_InitialEstimate(handles); - - elseif handles.nonsurvey == 2 [RegMap,IndMap,ProdMap]=Ind30Pro39v1_InitialEstimate(handles); diff --git a/Rscripts/IEfeeds_code/Archive/Ind20Pro22v1_InitialEstimate.R b/Rscripts/IEfeeds_code/Archive/Ind20Pro22v1_InitialEstimate.R new file mode 100644 index 0000000..80fa928 --- /dev/null +++ b/Rscripts/IEfeeds_code/Archive/Ind20Pro22v1_InitialEstimate.R @@ -0,0 +1,173 @@ +############################################### +# # +# This is the IE data feed for processing # +# raw data of the iron and steel PIOT # +# it covers 20 processes and 22 products # +# # +############################################### +# IE feed for 20 industries/processes and 22 products base classifications +# hanspeter.wieland@wu.ac.at (c) +# 02.19.2020 + +# In case the code is executed not on the server (and the GUI) for debugging, +# the user can choose the desired region aggregator by setting the following variable +# either to 5,35 or 49. If test_regagg is not defined it will be set automatically to +# 5 regions later on in the code. +# test_regagg <- "049" + +################################################################################ +# 1. Set up environment for building the initial estimate + +IEdatafeed_name <- "Ind20Pro22v1" +print(paste0("Start of ",IEdatafeed_name," InitialEstimate.")) + +# Set library path when running on suphys server +if(Sys.info()[1] == "Linux"){ + .libPaths("/suphys/hwie3321/R/x86_64-redhat-linux-gnu-library/3.5") + # Define location for root directory + root_folder <- "/import/emily1/isa/IELab/Roots/PIOLab/"}else{ + root_folder <- "C:/Users/hwieland/Github workspace/PIOLab/"} + +# Initializing R script (load R packages and set paths to folders etc.) +source(paste0(root_folder,"Rscripts/Subroutines/InitializationR.R")) + +# Read base regions, products and codes from mat-file if available +source(paste0(path$root,"Rscripts/Subroutines/Read_BaseClassification.R")) + +# Read region aggregation from classification to set the right path for the IE data +if(max(base$region$Code) < 10) {regagg <- paste0("00",max(base$region$Code))} else +{regagg <- paste0("0",max(base$region$Code))} + +# Set additional paths that are specific to the present run +path[["IE_Subroutines"]] <- paste0(path$root,"Rscripts/IEfeeds_code/IE_subroutines") +path[["IE_Processed"]] <- paste0(path$root,"ProcessedData/",IEdatafeed_name,"/",regagg) +path[["Agg_Processed"]] <- paste0(path$root,"ProcessedData/",IEdatafeed_name) + +remove(regagg) + +# Check whether output folder for processed data for the present initial estimate exists, if not then create it +if(!dir.exists(path$Agg_Processed)) dir.create(path$Agg_Processed) + +# Check whether output folder for processed data for the specific aggregation exists, if yes, delete it +if(dir.exists(path$IE_Processed)) unlink(path$IE_Processed,recursive = TRUE) +dir.create(path$IE_Processed) + +# Check if ALANG files of old initial estimate exist and delete +source(paste0(path$Subroutines,"/DeleteALANGfilesOfOldIEfeeds.R")) + +################################################################################ +# 2. Commencing data feeds + +# Loading production values for semi- and finished steel + information on yields +source(paste0(path$IE_Subroutines,"/IEFeed_PIOLab_WSA.R")) +IEFeed_PIOLab_WSA(year,path) +source(paste0(path$IE_Subroutines,"/IEFeed_PIOLab_SteelIndustryYields.R")) +IEFeed_PIOLab_SteelIndustryYields(path) + +# Loading the trade data +source(paste0(path$IE_Subroutines,"/IEFeed_PIOLab_BACI.R")) +IEFeed_PIOLab_BACI(year,path) + +# The extraction and ore grade feed +source(paste0(path$IE_Subroutines,"/IEFeed_PIOLab_IRP.R")) +IEFeed_PIOLab_IRP(year,path) +source(paste0(path$IE_Subroutines,"/IEFeed_PIOLab_Grades.R")) +IEFeed_PIOLab_Grades(path) + +# Loading end-of-life steel scrap +source(paste0(path$IE_Subroutines,"/IEFeed_PIOLab_EOL.R")) +IEFeed_PIOLab_EOL(year,path) + +# Loading energy data +source(paste0(path$IE_Subroutines,"/IEFeed_PIOLab_IEA.R")) +IEFeed_PIOLab_IEA(year,path) + +# Loading and aggregating EXIOBASE Waste-MFA IO version +source(paste0(path$IE_Subroutines,"/IEFeed_PIOLab_EXIOWasteMFAIO.R")) +IEFeed_PIOLab_EXIOWasteMFAIO(year,path) + +# Loading fabrication yields taken from Cullen et al 2012 +source(paste0(path$IE_Subroutines,"/IEFeed_PIOLab_Cullen.R")) +IEFeed_PIOLab_Cullen(path) + +################################################################################ +# 3. Commencing data processing + +# Aligning WSA and IEA data and filling gaps in WSA accounts. +# Moreover, remove BACI trade flows of iron ores for regions where IRP reports no extraction +source(paste0(path$IE_Subroutines,"/IEDataProcessing_PIOLab_AligningData.R")) +IEDataProcessing_PIOLab_AligningData(year,path) + +# Compile extension for the MFA-Waste IO Model and estimate fabrication scrap +source(paste0(path$IE_Subroutines,"/IEDataProcessing_PIOLab_WasteMFAIOExtension.R")) +IEDataProcessing_PIOLab_WasteMFAIOExtension(year,path) + +# Run Waste-IO Model calculation +source(paste0(path$IE_Subroutines,"/IEDataProcessing_PIOLab_WasteMFAIOModelRun.R")) +IEDataProcessing_PIOLab_WasteMFAIOModelRun(year,path) + +# Compile domestic SUTs +source(paste0(path$IE_Subroutines,"/IEDataProcessing_PIOLab_BuildingDomesticTables.R")) +IEDataProcessing_PIOLab_BuildingDomesticTables(year,path) + +# Compiling trade blocks +source(paste0(path$IE_Subroutines,"/IEDataProcessing_PIOLab_BuildingTradeBlocks.R")) +IEDataProcessing_PIOLab_BuildingTradeBlocks(year,path) + +################################################################################ +# 4. Create S8 files (see AISHA manual annex for further information) for easy data import to AISHA + +source(paste0(path$IE_Subroutines,"/IEDataProcessing_PIOLab_BuildS8fromSupplyUseTables.R")) +IEDataProcessing_PIOLab_BuildS8fromSupplyUseTables(year,path) + +################################################################################ +# 5. Write ALANG commands +print("Start writing ALANG commands.") + +# Set up wrapper for adding rows to ALANG +NewALANG <- function(name,SE,ALANG) +{ + file <- paste0("S8 ",path$mother,"Data/IE/",gsub("-","",Sys.Date()), + "_PIOLab_AllCountriesS8File_",name,year,".csv") + + ALANG <- add_row(ALANG,'1' = name,Coef1 = file, S.E. = SE, + Value = "I",Incl = "Y",Parts = "1",'Row parent' = "",'Row child' = "", + 'Row grandchild' = "",'Column parent' = "",'Column child' = "", + 'Column grandchild' = "",Years = "",Margin = "",'Pre-map' = "",'Post-map' = "", + 'Pre-Map' = "",'Post-Map' = "") + + return(ALANG) +} + +n_reg <- nrow(base$region) +# Create empty file with header +source(paste0(path$Subroutines,"/makeALANGheadline.R")) + +# Write ALANG commands +ALANG <- NewALANG("Supply","E MX1;MN10;",ALANG) +ALANG <- NewALANG("Use","E MX1;MN10;CN1;",ALANG) +ALANG <- NewALANG("FinalDemand","E MX1;MN10;",ALANG) +ALANG <- NewALANG("Extraction","E MX1;MN10;",ALANG) +ALANG <- NewALANG("EolScrap","E MX1;MN10;",ALANG) +ALANG <- NewALANG("OtherInput","E MX1;MN10;",ALANG) +ALANG <- NewALANG("Waste","E MX1;MN10;",ALANG) +ALANG <- NewALANG("Zero","E CN1;",ALANG) + +ALANG$`#` <- as.character(1:nrow(ALANG)) + +# Write data frame with ALANG commands as tab-delimited txt-file to root and working directory (mother) +# Note HP: This is probably not the normal procedure, meaning no IE ALANG's in the root +filename <- paste0(path$root,"ALANGfiles/",gsub("-","",Sys.Date()), + "_PIOLab_SUT_000_InitialEstimate-",year,"_000_S8filesForAllRegionsAndFlows.txt") + +write.table(ALANG,file = filename,row.names = FALSE, quote = F,sep = "\t") +# Check if the mother directory really exists +if(file.exists(path$mother)) +{ + filename <- paste0(path$mother,gsub("-","",Sys.Date()), + "_PIOLab_SUT_000_InitialEstimate-",year,"_000_S8filesForAllRegionsAndFlows.txt") + + write.table(ALANG,file = filename,row.names = FALSE, quote = F,sep = "\t") +} + +print(paste0("End of ",IEdatafeed_name," InitialEstimate.")) diff --git a/Rscripts/IEfeeds_code/Archive/Ind30Pro40v1_InitialEstimate.R b/Rscripts/IEfeeds_code/Archive/Ind30Pro40v1_InitialEstimate.R new file mode 100644 index 0000000..8bf59d0 --- /dev/null +++ b/Rscripts/IEfeeds_code/Archive/Ind30Pro40v1_InitialEstimate.R @@ -0,0 +1,232 @@ +############################################### +# # +# This is the IE data feed for processing # +# raw data of the iron and steel PIOT # +# it covers 20 processes and 22 products # +# # +############################################### +# IE feed for 20 industries/processes and 22 products base classifications +# hanspeter.wieland@wu.ac.at (c) +# 02.19.2020 + +# In case the code is executed not on the server (and the GUI) for debugging, +# the user can choose the desired region aggregator by setting the following variable +# either to 5,35 or 49. If test_regagg is not defined it will be set automatically to +# 5 regions later on in the code. +# test_regagg <- "049" + +################################################################################ +# 1. Set up environment for building the initial estimate + +IEdatafeed_name <- "Ind30Pro40v1" + +print(paste0("Start of ",IEdatafeed_name," InitialEstimate.")) + +# Set library path when running on suphys server +if(Sys.info()[1] == "Linux"){ + .libPaths("/suphys/hwie3321/R/x86_64-redhat-linux-gnu-library/3.5") + # Define location for root directory + root_folder <- "/import/emily1/isa/IELab/Roots/PIOLab/"}else{ + root_folder <- "C:/Users/hwieland/Github workspace/PIOLab/"} + +# Initializing R script (load R packages and set paths to folders etc.) + +source(paste0(root_folder,"Rscripts/Subroutines/InitializationR.R")) + +# Read base regions, products and codes from mat-file if available + +source(paste0(path$root,"Rscripts/Subroutines/Read_BaseClassification.R")) + +# Read region aggregation from classification to set the right path for the IE data + +if(max(base$region$Code) < 10) + { + regagg <- paste0("00",max(base$region$Code)) + } else + { + regagg <- paste0("0",max(base$region$Code)) + } + +# Set additional paths that are specific to the present run +path[["IE_Subroutines"]] <- paste0(path$root,"Rscripts/IEfeeds_code/IE_subroutines") +path[["IE_Processed"]] <- paste0(path$root,"ProcessedData/",IEdatafeed_name,"/",regagg) +path[["Agg_Processed"]] <- paste0(path$root,"ProcessedData/",IEdatafeed_name) + +remove(regagg) + +# Check whether output folder for processed data for the present initial estimate exists, if not then create it + +if(!dir.exists(path$Agg_Processed)) dir.create(path$Agg_Processed) + +# Check whether output folder for processed data for the specific aggregation exists, if yes, delete it + +if(dir.exists(path$IE_Processed)) unlink(path$IE_Processed,recursive = TRUE) + +dir.create(path$IE_Processed) + +# Check if ALANG files of old initial estimate exist and delete + +source(paste0(path$Subroutines,"/DeleteALANGfilesOfOldIEfeeds.R")) + +# Functions to process raw data for Initial Estimate + +IE_fun <- list("/IEFeed_PIOLab_WSA.R", + "/IEFeed_PIOLab_SteelIndustryYields.R", + "/IEFeed_PIOLab_BACI.R", + "/IEFeed_PIOLab_IRP.R", + "/IEFeed_PIOLab_Grades.R", + "/IEFeed_PIOLab_EOL.R", + "/IEFeed_PIOLab_IEA.R", + "/IEFeed_PIOLab_EXIOWasteMFAIOV2.R", + "/IEFeed_PIOLab_Cullen.R", + "/IEDataProcessing_PIOLab_AligningDataV2.R", + "/IEDataProcessing_PIOLab_WasteMFAIOExtensionV2.R", + "/IEDataProcessing_PIOLab_WasteMFAIOModelRunV2.R", + "/IEDataProcessing_PIOLab_BuildingDomesticTablesV2.R", + "/IEDataProcessing_PIOLab_BuildingTradeBlocks.R", + "/IEDataProcessing_PIOLab_BuildS8fromSupplyUseTables.R") + +IE_fun <- paste0(path$IE_Subroutines,IE_fun) # Add path to functions + +lapply(IE_fun,source) # Load functions into workspace + + +# 2. Commencing data pre-processing (from source to root classification) + +IEFeed_PIOLab_WSA(year,path) # WSA production numbers + +IEFeed_PIOLab_SteelIndustryYields(path) # Yield information + +IEFeed_PIOLab_BACI(year,path) # Trade data + +IEFeed_PIOLab_IRP(year,path) # Extraction data + +IEFeed_PIOLab_Grades(path) # Ore grades + +IEFeed_PIOLab_EOL(year,path) # end-of-life i.e. old scrap + +IEFeed_PIOLab_IEA(year,path) # IEA energy data + +IEFeed_PIOLab_EXIOWasteMFAIOV2(year,path) # Aggregate EXIOBASE Waste-MFA IO model (WIO) + +IEFeed_PIOLab_Cullen(path) # Fabrication yields from Cullen et al. 2012 + + +# 3. Commencing data processing + +IEDataProcessing_PIOLab_AligningDataV2(year,path) # Align WSA, IRP extraction + +IEDataProcessing_PIOLab_WasteMFAIOExtensionV2(year,path) # Compile extension for WIO + +IEDataProcessing_PIOLab_WasteMFAIOModelRunV2(year,path) # Run WIO Model calculation + + + +# Compile domestic SUTs + +IEDataProcessing_PIOLab_BuildingDomesticTablesV2(year,path) + +# Compiling trade blocks + +IEDataProcessing_PIOLab_BuildingTradeBlocks(year,path) + +################################################################################ +# 4. Create S8 files (see AISHA manual annex for further information) for easy data import to AISHA + +IEDataProcessing_PIOLab_BuildS8fromSupplyUseTables(year,path) + +################################################################################ +# 5. Write ALANG commands +print("Start writing ALANG commands.") + +# Set up wrapper for adding rows to ALANG +NewALANG <- function(name,SE,ALANG) +{ + file <- paste0("S8 ",path$mother,"Data/IE/",gsub("-","",Sys.Date()), + "_PIOLab_AllCountriesS8File_",name,year,".csv") + + ALANG <- add_row(ALANG,'1' = name,Coef1 = file, S.E. = SE, + Value = "I",Incl = "Y",Parts = "1",'Row parent' = "",'Row child' = "", + 'Row grandchild' = "",'Column parent' = "",'Column child' = "", + 'Column grandchild' = "",Years = "",Margin = "",'Pre-map' = "",'Post-map' = "", + 'Pre-Map' = "",'Post-Map' = "") + + return(ALANG) +} + +# n_reg <- nrow(base$region) +# Create empty file with header +source(paste0(path$Subroutines,"/makeALANGheadline.R")) + +RSE <- read.xlsx(xlsxFile = paste0(path$Settings,"/datafeeds_settings/IE_RSE_settings.xlsx")) + +# Write ALANG commands + +name <- "Supply" +RSE_sel <- RSE[RSE$item == name,] +ALANG <- NewALANG(name, + paste0("E MX",RSE_sel$MX,";MN",RSE_sel$MN,";"), + ALANG) + +name <- "Use" +RSE_sel <- RSE[RSE$item == name,] +ALANG <- NewALANG(name, + paste0("E MX",RSE_sel$MX,";MN",RSE_sel$MN,";CN",RSE_sel$CN,";"), + ALANG) + +name <- "FinalOutput" +RSE_sel <- RSE[RSE$item == name,] +ALANG <- NewALANG(name, + paste0("E MX",RSE_sel$MX,";MN",RSE_sel$MN,";"), + ALANG) + +name <- "Extraction" +RSE_sel <- RSE[RSE$item == name,] +ALANG <- NewALANG(name, + paste0("E MX",RSE_sel$MX,";MN",RSE_sel$MN,";"), + ALANG) + +name <- "EolScrap" +RSE_sel <- RSE[RSE$item == name,] +ALANG <- NewALANG(name, + paste0("E MX",RSE_sel$MX,";MN",RSE_sel$MN,";"), + ALANG) + +name <- "OtherInput" +RSE_sel <- RSE[RSE$item == name,] +ALANG <- NewALANG(name, + paste0("E MX",RSE_sel$MX,";MN",RSE_sel$MN,";"), + ALANG) + +name <- "Waste" +RSE_sel <- RSE[RSE$item == name,] +ALANG <- NewALANG(name, + paste0("E MX",RSE_sel$MX,";MN",RSE_sel$MN,";"), + ALANG) + +name <- "Zero" +RSE_sel <- RSE[RSE$item == name,] +ALANG <- NewALANG(name, + paste0("E CN",RSE_sel$CN,";"), + ALANG) + +ALANG$`#` <- as.character(1:nrow(ALANG)) + +# Write data frame with ALANG commands as tab-delimited txt-file to root and working directory (mother) +# Note HP: This is probably not the normal procedure, meaning no IE ALANG's in the root +filename <- paste0(path$root,"ALANGfiles/",gsub("-","",Sys.Date()), + "_PIOLab_SUT_000_InitialEstimate-",year,"_000_S8filesForAllRegionsAndFlows.txt") + +write.table(ALANG,file = filename,row.names = FALSE, quote = F,sep = "\t") + +# Check if the mother directory really exists + +if(file.exists(path$mother)) +{ + filename <- paste0(path$mother,gsub("-","",Sys.Date()), + "_PIOLab_SUT_000_InitialEstimate-",year,"_000_S8filesForAllRegionsAndFlows.txt") + + write.table(ALANG,file = filename,row.names = FALSE, quote = F,sep = "\t") +} + +print(paste0("End of ",IEdatafeed_name," InitialEstimate.")) diff --git a/Rscripts/IEfeeds_code/IE_subroutines/Archive/IEDataProcessing_PIOLab_AligningData.R b/Rscripts/IEfeeds_code/IE_subroutines/Archive/IEDataProcessing_PIOLab_AligningData.R new file mode 100644 index 0000000..faa4c52 --- /dev/null +++ b/Rscripts/IEfeeds_code/IE_subroutines/Archive/IEDataProcessing_PIOLab_AligningData.R @@ -0,0 +1,148 @@ +########################################### +# # +# This function fills the gap of the # +# of the WorldSteels (WSA) production # +# numbers using the IEA energy data. # +# Moreover, BACI trade data is aligned # +# with IRP ore extraction data # +# # +########################################### + +IEDataProcessing_PIOLab_AligningData <- function(year,path) +{ + print("IEDataProcessing_PIOLab_AligningData initiated.") + + ############################################################################## + + # 1. Loading data + + # Loading processed WSA production numbers + + Pig <- read.csv(paste0(path$IE_Processed,"/WSA/WSA_",year,"_PigIron.csv")) + + Flat <- read.csv(paste0(path$IE_Processed,"/WSA/WSA_",year,"_FlatRolledProducts.csv")) + + colnames(Flat)[2] <- "Flat" + + Long <- read.csv(paste0(path$IE_Processed,"/WSA/WSA_",year,"_LongRolledProducts.csv")) + + colnames(Long)[2] <- "Long" + + BOF_steel <- read.csv(paste0(path$IE_Processed,"/WSA/WSA_",year,"_SteelOxygenBlownConverters.csv")) + + EAF_steel <- read.csv(paste0(path$IE_Processed,"/WSA/WSA_",year,"_SteelElectricFurnaces.csv")) + + colnames(EAF_steel)[2] <- "EAF" + + + # Loading IE_Processed IEA energy data + BF_gas <- read.csv(paste0(path$IE_Processed,"/IEA/IEA_",year,"_BlastFurnaceGas.csv")) + colnames(BF_gas)[2] <- "Energy" + BOF_gas <- read.csv(paste0(path$IE_Processed,"/IEA/IEA_",year,"_BlastOxygenFurnaceGas.csv")) + colnames(BOF_gas)[2] <- "Energy" + Energy_con <- read.csv(paste0(path$IE_Processed,"/IEA/IEA_",year,"_SteelIndustryEnergyConsumption.csv")) + + # Loading BACI trade data on iron ores and IRP extraction accounts + BACI <- read.csv(file = paste0(path$IE_Processed,"/BACI/BACI_",year,".csv")) + IronOre_Extraction <- read.csv(file = paste0(path$IE_Processed,"/IRP/IRP_",year,".csv")) + + ############################################################################## + # 2. Filling gaps in WSA production accounts by checking IEA energy data + # 2.1 WSA pig iron production vs. production of (IEA) blast furnace gas + + # Following the WSA publication "Energy use in the steel industry" (p98) between + # 4.3 and 7.2 GJ of blast furnace gas is produced per ton of pig iron. + # In the following we fill the gaps assuming an average intensity of 5.7 GJ/t + + # Merge the two data sets and filter for missing production values + Pig_vs_BF <- full_join(Pig,BF_gas,c("base"),copy = FALSE) %>% + mutate(Intensity = Energy/Quantity) + Pig_vs_BF_gap <- Pig_vs_BF %>% filter(Quantity == 0 & Energy != 0) + + # Fill in values and save new pig iron production data + if(length(Pig_vs_BF_gap) > 0) { + Pig_vs_BF$Quantity[Pig_vs_BF$base %in% Pig_vs_BF_gap$base] <- Pig_vs_BF_gap$Energy / 5.7 + Pig <- Pig_vs_BF %>% select(base,Quantity) + write.csv(Pig, file = paste0(path$IE_Processed,"/WSA/WSA_",year,"_PigIron.csv"),row.names = FALSE)} + + remove(Pig_vs_BF,Pig_vs_BF_gap,Pig,BF_gas) + + # 2.2 BOF steel production vs. BOF gas production + + # Again according to the WSA report on energy, the blown oxygen furnace steelmaking + # process produces gases of approx. 0.234 GJ per crude steel (p101). Please note that the + # WSA case studies (p104) showed values betwene 0.4 and 0.8 GJ per ton + + Steel_vs_BOF <- full_join(BOF_steel,BOF_gas,c("base"),copy = FALSE) %>% + mutate(Intensity = Energy/Quantity) + Steel_vs_BOF_gap <- Steel_vs_BOF %>% filter(Quantity == 0 & Energy != 0) + + # Fill in values and save new BOF steel production data + if(nrow(Steel_vs_BOF_gap) > 0) { + Steel_vs_BOF$Quantity[Steel_vs_BOF$base %in% Steel_vs_BOF_gap$base] <- Steel_vs_BOF_gap$Energy / 0.234 + BOF_steel <- Steel_vs_BOF %>% select(base,Quantity) + write.csv(BOF_steel, file = paste0(path$IE_Processed,"/WSA/WSA_",year,"_SteelOxygenBlownConverters.csv"),row.names = FALSE)} + + remove(Steel_vs_BOF,Steel_vs_BOF_gap,BOF_gas) + colnames(BOF_steel)[2] <- "BOF" + + # 2.3 Filling gaps for rolled steel products + Steel_vs_energy <- full_join(Energy_con,Flat,c("base"),copy = FALSE) + Steel_vs_energy <- full_join(Steel_vs_energy,Long,c("base"),copy = FALSE) + Steel_vs_energy <- full_join(Steel_vs_energy,BOF_steel,c("base"),copy = FALSE) + Steel_vs_energy <- full_join(Steel_vs_energy,EAF_steel,c("base"),copy = FALSE) + Steel_vs_energy[is.na(Steel_vs_energy)] <- 0 + Steel_vs_energy <- mutate(Steel_vs_energy,Rolled = Flat+Long,Intensity = Value/Rolled) + Steel_vs_energy$Intensity[Steel_vs_energy$Intensity == Inf] <- 0 + + # The reference plant, of the WSA report, has an average energy intensity for + # long rolled products of approx. 20 GJ per ton and 9.5 GJ per ton for scrap based long products + # WSA referenced flat rolling plate mill has an energy intensity of 24 GJ per ton of product (p120-122) + # Please note that these numbers refer to the total energy requirement including + # upstream energy use for steel and iron making. Direct energy use in rolling mills is much smaller at around 2-7 GJ/t + + # 2.3.1 Filter for countries with inconsistent data + # No flat rolling reported but BOF steel is produced + Gap <- Steel_vs_energy %>% filter(Flat == 0 & BOF != 0) + if(nrow(Gap) > 0) Steel_vs_energy$Flat[Steel_vs_energy$base %in% Gap$base] <- Gap$BOF + + # No long rolling reported but EAF steel is porduced + Gap <- Steel_vs_energy %>% filter(Long == 0 & EAF != 0) + if(nrow(Gap) > 0) Steel_vs_energy$Long[Steel_vs_energy$base %in% Gap$base] <- Gap$EAF + + # BOF steel reported but flat rolled products + energy intensity is below the threshold + Gap <- Steel_vs_energy %>% filter(BOF == 0 & Flat != 0 & Intensity < 20) + if(nrow(Gap) > 0) Steel_vs_energy$BOF[Steel_vs_energy$base %in% Gap$base] <- Gap$Flat + + # No flat and long rolling reported but energy use data available + Gap <- Steel_vs_energy %>% filter(Flat == 0 & Long == 0 & Value != 0) + if(nrow(Gap) > 0) { + # Assuming 18 GJ/ton + filling <- Gap$Value/18 + Steel_vs_energy[Steel_vs_energy$base %in% Gap$base,c("Flat","Long","BOF","EAF")] <- filling/2 } + + ############################################################################## + # 3. Delete BACI trade flows of iron ores where IRP reports no extraction + colnames(IronOre_Extraction)[2] <- "Extraction" + # Code of countries with no extraction + sel <- setdiff(base$region$Code,IronOre_Extraction$base) + # Set zero + BACI$Quantity[BACI$From %in% sel & BACI$Product == 1] <- 0 + BACI <- BACI[BACI$Quantity != 0,] + ############################################################################## + # 4. Writing manipulated data to folder + Flat <- select(Steel_vs_energy,base,Flat) + Long <- select(Steel_vs_energy,base,Long) + BOF <- select(Steel_vs_energy,base,BOF) + EAF <- select(Steel_vs_energy,base,EAF) + colnames(Flat)[2] <- colnames(Long)[2] <- colnames(BOF)[2] <- colnames(EAF)[2] <- "Quantity" + + write.csv(Flat,file = paste0(path$IE_Processed,"/WSA/WSA_",year,"_FlatRolledProducts.csv"),row.names = FALSE) + write.csv(Long,file = paste0(path$IE_Processed,"/WSA/WSA_",year,"_LongRolledProducts.csv"),row.names = FALSE) + write.csv(BOF,file = paste0(path$IE_Processed,"/WSA/WSA_",year,"_SteelOxygenBlownConverters.csv"),row.names = FALSE) + write.csv(EAF,file = paste0(path$IE_Processed,"/WSA/WSA_",year,"_SteelElectricFurnaces.csv"),row.names = FALSE) + write.csv(BACI,file = paste0(path$IE_Processed,"/BACI/BACI_",year,".csv"),row.names = FALSE) + + print("IEDataProcessing_PIOLab_AligningData finished.") + +} \ No newline at end of file diff --git a/Rscripts/IEfeeds_code/IE_subroutines/Archive/IEDataProcessing_PIOLab_BuildingDomesticTables.R b/Rscripts/IEfeeds_code/IE_subroutines/Archive/IEDataProcessing_PIOLab_BuildingDomesticTables.R new file mode 100644 index 0000000..5084b04 --- /dev/null +++ b/Rscripts/IEfeeds_code/IE_subroutines/Archive/IEDataProcessing_PIOLab_BuildingDomesticTables.R @@ -0,0 +1,396 @@ +##################################### +# # +# This code writes the data # +# into the domestic SUTs that # +# can be used as an input for # +# AISHA # +# # +##################################### + + +IEDataProcessing_PIOLab_BuildingDomesticTables <- function(year,path) +{ + print("IEDataProcessing_PIOLab_BuildingDomesticTables initiated.") + # Load region aggregator + source(paste0(path$Subroutines,"/Root2Base_RegionAggregator.R")) + reg_agg <- Root2Base_RegionAggregator(RegionAggregator) + # Load function to compile end use map + source(paste0(path$Subroutines,"/makeEndUseMap.R")) + # Load slag rate of blast furnace and coefficient per ton of pig iron output + WSA_yield <- read.csv(paste0(path$IE_Processed,"/WSA/SteelIndustryYields.csv")) %>% + select(Process,Average) + # Load extension of the WasteMFAIO model and IO codes + load(paste0(path$IE_Processed,"/EXIOWasteMFAIO/",year,"_Q.RData")) + load(paste0(path$IE_Processed,"/EXIOWasteMFAIO/IO.codes.RData")) + # Load trade data + BACI <- read.csv(paste0(path$IE_Processed,"/BACI/BACI_",year,".csv")) + # Load allocation function + source(paste0(path$Subroutines,"/AllocateSupply2Use.R")) + + # Define general variables + n_pro <- nrow(base$product) + n_ind <- nrow(base$industry) + n_reg <- nrow(base$region) + n_va <- 5 + n_fd <- 3 + + for(i in 1:n_reg) + { + print(i) + # Create empty SUT + SUT <- data.frame(matrix(0,(n_pro+n_ind+n_va),(n_pro+n_ind+n_fd))) + colnames(SUT) <- c(base$industry$Name,base$product$Name, + "FinalConsumption","Landfill","Atmosphere") + rownames(SUT) <- c(base$industry$Name,base$product$Name, + "FerrousMinerals","EOLScrap","Limestone","Coke","Air") + SUT <- as.matrix(SUT) + ############################################################################ + # 1. Writing boundary inputs of iron ore extraction and end-of-life scrap to table + + # 1.1 EoL scrap + data <- read.csv(paste0(path$IE_Processed,"/EOL/EOL_",year,".csv")) + if(i %in% data$base) { + value <- data$Quantity[data$base == i] + SUT["EOLScrap","Scrap preparation"] <- value } + + # 1.2 IRP iron ore extraction i.e. inputs from nature + data <- read.csv(paste0(path$IE_Processed,"/IRP/IRP_",year,".csv")) + if(i %in% data$base) { + value <- data$Quantity[data$base == i] + SUT["FerrousMinerals","Mining"] <- value } + + ############################################################################ + # 2. Writing production values into supply table + + # 2.1 Waste (gangue) output of mining + # Read iron ore grades and assume beneficiation to 60% of ore grade + data <- read.csv(paste0(path$IE_Processed,"/Grades/IronOreGrades.csv")) + + # if no ore grades are available for a region, assume 0.6 + if(i %in% data$base) + {concen <- data$Concentration[data$base == i]}else + {concen <- 0.6} + + if(SUT["FerrousMinerals","Mining"] > 0) { + iron <- SUT["FerrousMinerals","Mining"]*concen + # iron ore weight with 60% grade, when concentration is higher than 0.6, leave it like it is + if(concen <= 0.6) {value_new <- iron/0.6} else + {value_new <- iron/concen} + # Calculate waste flow to landfill + waste <- value-value_new + # Allocate output of iron ore (now 60% grade) to mining + SUT["Mining","Iron ore"] <- value_new + # Allocate boundary outputs of waste to the supply-side of mining, that is landfill + SUT["Mining","Landfill"] <- waste } + + # 2.2 Write pig iron production and use yields to estimate waste/slag flows + data <- read.csv(paste0(path$IE_Processed,"/WSA/WSA_",year,"_PigIron.csv")) + + if(i %in% data$base) { + value <- data$Quantity[data$base == i] + SUT["Blast furnace","Pig iron"] <- value + # Take slag rate from WSA + yield <- WSA_yield$Average[WSA_yield$Process == 'BF slag rate']/1000 + # Estimate slag output and allocate to landfill (final use) + SUT["Blast furnace","Landfill"] <- value * yield + # Estimate output of top gas (1.7 tons per ton oig iron) + SUT["Blast furnace","Atmosphere"] <- value *1.7} + + # 2.3 Sponge iron + data <- read.csv(paste0(path$IE_Processed,"/WSA/WSA_",year,"_SpongeIron.csv")) + if(i %in% data$base) { + value <- data$Quantity[data$base == i] + SUT["Direct reduction","Sponge iron"] <- value + # Allocate slag output assuming losses of 5% of sponge iron output + #yield <- 0.05 + #waste <- value * yield + # Alternatively allocate losses including gangue by assuming waste of 600 kg per ton of useful output + SUT["Direct reduction","Landfill"] <- value * 0.6 } + + # 2.4 Write steel production of BOF & OHF + data_1 <- read.csv(paste0(path$IE_Processed,"/WSA/WSA_",year,"_SteelOxygenBlownConverters.csv")) + data_2 <- read.csv(paste0(path$IE_Processed,"/WSA/WSA_",year,"_SteelOpenHearthFurnaces.csv")) + data <- rbind(data_1,data_2) %>% group_by(base) %>% summarise(Quantity = sum(Quantity)) + remove(data_1,data_2) + + if(i %in% data$base) { + value <- data$Quantity[data$base == i] + SUT["Oxygen blown & open hearth furnace","Liquid steel (OBF/OHF)"] <- value + # Calculate waste + yield <- WSA_yield$Average[WSA_yield$Process == 'BOF yield'] + waste <- (value/yield)-value + SUT["Oxygen blown & open hearth furnace","Landfill"] <- waste } + + # 2.5 Write steel production of EAF + data <- read.csv(paste0(path$IE_Processed,"/WSA/WSA_",year,"_SteelElectricFurnaces.csv")) + + if(i %in% data$base) { + value <- data$Quantity[data$base == i] + SUT["Electric arc furnace","Liquid steel (EAF)"] <- value + # Calculate waste + yield <- WSA_yield$Average[WSA_yield$Process == 'EAF yield'] + waste <- (value/yield)-value + SUT["Electric arc furnace","Landfill"] <- waste } + + # 2.6 Write flat rolling production and forming scrap + data <- read.csv(paste0(path$IE_Processed,"/WSA/WSA_",year,"_FlatRolledProducts.csv")) + + if(i %in% data$base) { + value <- data$Quantity[data$base == i] + SUT["Flat rolling","Flat rolled products"] <- value + # Calculate waste + yield <- WSA_yield$Average[WSA_yield$Process == 'Slab caster yield'] + waste <- (value/yield)-value + SUT["Flat rolling","Forming & fabrication scrap"] <- waste } + + # 2.7 Write long rolling production and forming scrap + data <- read.csv(paste0(path$IE_Processed,"/WSA/WSA_",year,"_LongRolledProducts.csv")) + + if(i %in% data$base) { + value <- data$Quantity[data$base == i] + SUT["Long rolling","Long rolled products"] <- value + # Calculate waste + yield <- WSA_yield$Average[WSA_yield$Process == 'Bloom caster yield'] + waste <- (value/yield)-value + SUT["Long rolling","Forming & fabrication scrap"] <- waste } + + # 2.8 Write production of ingots and subsequently fill the gap of the casting + # process with slabs (because all feeds into flat rolling) + data <- read.csv(paste0(path$IE_Processed,"/WSA/WSA_",year,"_Ingots.csv")) + + if(i %in% data$base) { + value <- data$Quantity[data$base == i] + SUT["Casting of ingots & slabs","Ingots"] <- value + value <- SUT["Flat rolling","Flat rolled products"] - SUT["Casting of ingots & slabs","Ingots"] + SUT["Casting of ingots & slabs","Slabs"] <- value + yield <- WSA_yield$Average[WSA_yield$Process == 'Slab caster yield'] + value <- SUT["Flat rolling","Flat rolled products"] + waste <- (value/yield)-value + SUT["Casting of ingots & slabs","Forming & fabrication scrap"] <- waste } + + # 2.9 For the production value of billets and blooms use the value of long rolling + value <- sum(SUT["Long rolling",c("Long rolled products","Forming & fabrication scrap")]) + SUT["Casting of billets & blooms","Billets & blooms"] <- value + # Estimate scrap flows using yield data + yield <- WSA_yield$Average[WSA_yield$Process == 'Bloom caster yield'] + waste <- (value/yield)-value + SUT["Casting of billets & blooms","Forming & fabrication scrap"] <- waste + + # 2.10 Fabrication i.e. manufacturing output + data <- read.csv(paste0(path$IE_Processed,"/EXIOWasteMFAIO/",year,"_FabricationToFinalDemand.csv")) %>% + filter(From.Region == i) %>% select(From.Product,Quantity) %>% group_by(From.Product) %>% + summarise(Quantity = sum(Quantity)) + # Set up index to write values directly into cells + index <- cbind(base$industry$Name[11:20],base$product$Name[13:22]) + SUT[index] <- data$Quantity + + # 2.11 Fabrication scarp + data <- read.csv(paste0(path$IE_Processed,"/FabricationScrap/FabricationScrap_",year,".csv")) %>% + filter(base == i) + data <- data.frame("commodity" = as.character(data$commodity), + "Quantity" = data$Quantity, + stringsAsFactors = FALSE) + index <- as.data.frame(index,stringsAsFactors = FALSE) + colnames(index) <- c("Industry","Product") + data <- left_join(index,data,c("Product" = "commodity"),copy = FALSE) + + SUT[data$Industry,"Forming & fabrication scrap"] <- data$Quantity + + # 2.12 Estimate production of scrap steel by summing over "forming and fabrication scrap" + # and EoL scrap supply + + value <- sum(SUT[,"Forming & fabrication scrap"]) + SUT["EOLScrap","Scrap preparation"] + SUT["Scrap preparation","Scrap steel"] <- value + + ############################################################################ + # 3. Filling use table + # IMPORTANT: The allocation follows the logic to source data on exports from the + # BACI data set and subtract this value from the domestic production of the upstream process + # to get an estimate for the domestic inputs of each process. Where this results in negative values + # for domestic use, we assume that inputs are 50% from foreign source + + # 3.1 Steel in final demand + data <- read.csv(paste0(path$IE_Processed,"/EXIOWasteMFAIO/",year,"_SteelInFinalDemand.csv")) %>% + filter(From.Region == i & To.Region == i) + index <- base$product$Name[base$product$Code %in% data$Product] + SUT[index,"FinalConsumption"] <- data$Quantity + + # 3.2.1 Flat Rolled products used in fabrication + item <- "Flat rolled products" + # Load map to allocate to end use (fabrication) + map <- makeEndUseMap(i,"Flat") + map <- map[order(map$index),] + share <- map$Share + ############################################ + # The following command may cause problems # + ############################################ + users <- base$industry$Code[11:20][map$index] + # Load trade data + data <- filter(BACI,Product == base$product$Code[base$product$Name == item]) %>% select(From,To,Quantity) + # Read domestic production + pro <- SUT["Flat rolling","Flat rolled products"] + # Read domestic use + use <- sum(Q["Flat",IO.codes$index[IO.codes$base == i]]) + + # Execute function for estimation script to write values + SUT <- AllocateSupply2Use(SUT,item,share,users,data,pro,use,i) + + # 3.3.2 Long Rolled products used in fabrication + item <- "Long rolled products" + # Load map to allocate to end use (fabrication) + map <- makeEndUseMap(i,"Long") + map <- map[order(map$index),] + share <- map$Share + users <- base$industry$Code[11:20][map$index] + # Load trade data + data <- filter(BACI,Product == base$product$Code[base$product$Name == item]) %>% select(From,To,Quantity) + # Read domestic production + pro <- SUT["Long rolling",item] + # Read domestic use + use <- sum(Q["Long",IO.codes$index[IO.codes$base == i]]) + + # Execute function for estimation script to write values + SUT <- AllocateSupply2Use(SUT,item,share,users,data,pro,use,i) + + # 3.4 Use of forming and fabrication scrap by scrap preparation + SUT["Forming & fabrication scrap","Scrap preparation"] <- sum(SUT[,"Forming & fabrication scrap"]) + + # 3.5 Use of billets and blooms by long rolling + # Load number for exports of billets and blooms + item <- "Billets & blooms" + users <- "Long rolling" + share <- 1 + data <- filter(BACI,Product == base$product$Code[base$product$Name == item]) %>% select(From,To,Quantity) + pro <- SUT["Casting of billets & blooms",item] + use <- sum(SUT[users,]) + + # Execute function for estimation script to write values + SUT <- AllocateSupply2Use(SUT,item,share,users,data,pro,use,i) + + # 3.6 Use of ingots and slabs by flat rolling + # 3.6.1 Ingots + export <- filter(BACI,Product == base$product$Code[base$product$Name == "Ingots"]) %>% + select(From,To,Quantity) %>% filter(From == i) + value <- SUT["Casting of ingots & slabs","Ingots"] - sum(export$Quantity) + # In case value is negative, assume that 5% of inputs is coming from domestic ingots + if(value > 0) {SUT["Ingots","Flat rolling"] <- value} else + {SUT["Ingots","Flat rolling"] <- sum(SUT["Flat rolling",]) * 0.05} + + # 3.6.2 Slabs + export <- filter(BACI,Product == base$product$Code[base$product$Name == "Slabs"]) %>% + select(From,To,Quantity) %>% filter(From == i) + # Domestic production of slabs minus exports = domestic use + value <- SUT["Casting of ingots & slabs","Slabs"] - sum(export$Quantity) + if(value > 0) {SUT["Slabs","Flat rolling"] <- value} else + {SUT["Slabs","Flat rolling"] <- sum(SUT["Flat rolling",]) * 0.45} + + # 3.7 Casting of billets and blooms and casting of ingots and slabs + # The only input to casting is liquid steel which is not a traded commodity, + # The inputs to casting are therefor estimated by using the production/output value + # of the respective furnace + + # Steel from Electric arc furnace + SUT["Liquid steel (EAF)","Casting of billets & blooms"] <- SUT["Electric arc furnace","Liquid steel (EAF)"] + # Fill remaining gap with OBF steel + gap <- sum(SUT["Casting of billets & blooms",]) - SUT["Liquid steel (EAF)","Casting of billets & blooms"] + if(gap > 0) SUT["Liquid steel (OBF/OHF)","Casting of billets & blooms"] <- gap + + # Steel from oxygen blown converter + SUT["Liquid steel (OBF/OHF)","Casting of ingots & slabs"] <- sum(SUT["Casting of ingots & slabs",]) + + # 3.8 Sponge iron used by EAF + export <- filter(BACI,Product == base$product$Code[base$product$Name == "Sponge iron"],From == i) + + if(SUT["Direct reduction","Sponge iron"] != 0) + { + value <- SUT["Direct reduction","Sponge iron"] - sum(export$Quantity) + if(value > 0) {SUT["Sponge iron","Electric arc furnace"] <- value} else + {SUT["Sponge iron","Electric arc furnace"] <- sum(SUT["Direct reduction","Sponge iron"])/2} + } + + # 3.9 Allocating iron ores used by direct reduction + SUT["Iron ore","Direct reduction"] <- sum(SUT["Direct reduction",]) + + # 3.10 Allocate iron ores used by Blast furnace + export <- filter(BACI,Product == base$product$Code[base$product$Name == "Iron ore"],From == i) + value <- SUT["Mining","Iron ore"] - sum(export$Quantity) + if(value > 0) {SUT["Iron ore","Blast furnace"] <- value} else + {SUT["Iron ore","Blast furnace"] <- sum(SUT["Blast furnace",])/2} + + # 3.10.1 + # Allocate other inputs used by blast furnace + if(SUT["Blast furnace","Pig iron"] > 0) + { + pro <- SUT["Blast furnace","Pig iron"] + # Limestone and fluxes assuming 300 kg per ton of pig iron + SUT["Limestone","Blast furnace"] <- pro *0.3 + # 600 kg coke or coal per ton pig iron + SUT["Coke","Blast furnace"] <- pro * 0.6 + # (Hot) air of approx. 800 kg per ton + SUT["Air","Blast furnace"] <- pro * 0.8 + } + + # 3.11 Allocating pig iron to BOF + export <- filter(BACI,Product == base$product$Code[base$product$Name == "Pig iron"],From == i) + value <- SUT["Blast furnace","Pig iron"] - sum(export$Quantity) + if(value > 0) {SUT["Pig iron","Oxygen blown & open hearth furnace"] <- value} else + {SUT["Pig iron","Oxygen blown & open hearth furnace"] <- sum(SUT["Oxygen blown & open hearth furnace",])*0.4} + + # 3.12 Allocate Scrap steel to BOF and EAF + SUT["Scrap steel","Oxygen blown & open hearth furnace"] <- sum(SUT["Oxygen blown & open hearth furnace",])*0.15 + SUT["Scrap steel","Electric arc furnace"] <- sum(SUT["Electric arc furnace",]) - SUT["Direct reduction","Electric arc furnace"] + + # 4. Save SUT + # Check if subfolder in processed data exists and if not create it + path_set <- paste0(path$IE_Processed,"/SUT") + if(!dir.exists(path_set)) dir.create(path_set) + # Setting decimals to two digits + SUT <- round(SUT,2) + print(min(SUT)) + # Decompose SUT into single elements, that is supply, use, final demand, inputs from nature and eol scrap + Use <- SUT[base$product$Name,base$industry$Name] + Supply <- SUT[base$industry$Name,base$product$Name] + # What is final demand in monetary IO is called hereafter boundary output + BoundaryOutput <- SUT[c(base$industry$Name,base$product$Name),c("FinalConsumption","Landfill","Atmosphere")] + + # What is value added in monetary IO is called hereafter boundary input + pi <- c("FerrousMinerals","EOLScrap","Air","Limestone","Coke") + BoundaryInput <- matrix(SUT[pi,base$industry$Name],length(pi),nrow(base$industry)) + + # Remove all column and row names + colnames(Use) <- NULL + rownames(Use) <- NULL + colnames(Supply) <- NULL + rownames(Supply) <- NULL + colnames(BoundaryOutput) <- NULL + rownames(BoundaryOutput) <- NULL + colnames(BoundaryInput) <- NULL + rownames(BoundaryInput) <- NULL + + # Write Supply, Use, In- and Output to root folder, note that because write.csv will always export colnames + # had to use the write.tabel function. + + write.table(Supply,file = paste0(path_set,"/",year,"_DomesticSupply_Region",i,".csv"), + col.names = FALSE, + row.names = FALSE, + sep = ",") + + write.table(Use,file = paste0(path_set,"/",year,"_DomesticUse_Region",i,".csv"), + col.names = FALSE, + row.names = FALSE, + sep = ",") + + write.table(BoundaryOutput,file = paste0(path_set,"/",year,"_BoundaryOutput_Region",i,".csv"), + col.names = FALSE, + row.names = FALSE, + sep = ",") + + write.table(BoundaryInput,file = paste0(path_set,"/",year,"_BoundaryInput_Region",i,".csv"), + col.names = FALSE, + row.names = FALSE, + sep = ",") + + print(paste0("Minimum value: ",min(SUT))) + } + print("IEDataProcessing_PIOLab_BuildingDomesticTables finished.") +} diff --git a/Rscripts/IEfeeds_code/IE_subroutines/Archive/IEDataProcessing_PIOLab_WasteMFAIOExtension.R b/Rscripts/IEfeeds_code/IE_subroutines/Archive/IEDataProcessing_PIOLab_WasteMFAIOExtension.R new file mode 100644 index 0000000..de6c7c4 --- /dev/null +++ b/Rscripts/IEfeeds_code/IE_subroutines/Archive/IEDataProcessing_PIOLab_WasteMFAIOExtension.R @@ -0,0 +1,149 @@ +############################################### +# # +# This code uses the data on fabrication # +# yields and products flows to end-use to # +# build the IO extension and estimate # +# the amount of fabrication scrap # +# # +############################################### + + +IEDataProcessing_PIOLab_WasteMFAIOExtension <- function(year,path) +{ + print("IEDataProcessing_PIOLab_WasteMFAIOExtension initiated.") + ############################################################################# + + # Load IO codes of aggregated EXIOBASE data + load(paste0(path$IE_Processed,"/EXIOWasteMFAIO/IO.codes.RData")) + + # Load function to create allocation map + source(paste0(path$Subroutines,"/makeEndUseMap.R")) + # 1. Defining functions + + # aggregation function + Agg <- function(x) + { + x <- as.matrix(x) %*% sapply(unique(colnames(x)),"==",colnames(x)) + return(x) + } + + # Writing values of rolled products into arrays (extension and fabrication scrap) + WriteValues2Array <- function(data,name,Q,Scrap) + { + for(i in 1:nrow(data)) + { + #print(i) + reg <- data$base[i] + + # call function to create specific map + map <- makeEndUseMap(reg,name) + + map <- map %>% mutate(Value = Share * data$Quantity[data$base == reg]) %>% + select(index,IO,Yield.Sector,Value) + + map <- left_join(map,Yields,c("Yield.Sector"),copy = FALSE) %>% mutate(EndUse = Value*Yield.Factor,Scrap = Value - EndUse) %>% + select(index,IO,EndUse,Scrap) + + index <- map$index+((reg-1)*10) + + if(name == "Flat") + { + Q[1,index] <<- map$EndUse + Scrap[1,index] <<- map$Scrap + }else + { + Q[2,index] <<- map$EndUse + Scrap[2,index] <<- map$Scrap + } + } + + } + + # Load processed data from Cullen et al 2012 + Yields <- read.csv(paste0(path$IE_Processed,"/Cullen/FabricationYields.csv")) + + ############################################################################## + # 1. The first section calculates the net use of rolled steel products in regions + # by adding imports and subtracting exports from the WSA production values + + BACI <- read.csv(paste0(path$IE_Processed,"/BACI/BACI_",year,".csv")) # Load trade data + + # Load finished steel production + Flat <- read.csv(paste0(path$IE_Processed,"/WSA/WSA_",year,"_FlatRolledProducts.csv")) + Long <- read.csv(paste0(path$IE_Processed,"/WSA/WSA_",year,"_LongRolledProducts.csv")) + + + + Flat_trade <- BACI %>% filter(Product == base$product$Code[base$product$Name == "Flat rolled products"]) %>% + select(From,To,Quantity) + + Long_trade <- BACI %>% filter(Product == base$product$Code[base$product$Name == "Long rolled products"]) %>% + select(From,To,Quantity) + + # Estimate the net-use of products in countries + Flat_import <- Flat_trade %>% group_by(To) %>% summarise(Quantity = sum(Quantity)) + Flat_export <- Flat_trade %>% group_by(From) %>% summarise(Quantity = sum(Quantity)) + Flat_trade <- full_join(Flat_import,Flat_export,c("To" = "From"),copy = FALSE) + colnames(Flat_trade) <- c("base","import","export") + # Regional production + imports - exports = net-use + Flat <- full_join(Flat,Flat_trade,c("base"),copy = FALSE) + Flat[is.na(Flat)] <- 0 + + Flat <- Flat %>% mutate(NetUse = Quantity + import - export) + + ##################################### + # When negatives: set net use to import value + Flat$NetUse[Flat$NetUse < 0] <- Flat$import[Flat$NetUse < 0] + Flat <- Flat %>% select(base,NetUse) + colnames(Flat)[2] <- "Quantity" + ##################################### + + Long_import <- Long_trade %>% group_by(To) %>% summarise(Quantity = sum(Quantity)) + Long_export <- Long_trade %>% group_by(From) %>% summarise(Quantity = sum(Quantity)) + Long_trade <- full_join(Long_import,Long_export,c("To" = "From"),copy = FALSE) + colnames(Long_trade) <- c("base","import","export") + # Regional production + imports - exports = net-use + Long <- full_join(Long,Long_trade,c("base"),copy = FALSE) + Long[is.na(Long)] <- 0 + + Long <- Long %>% mutate(NetUse = Quantity + import - export) + ##################################### + # When negatives: set net use to import value + Long$NetUse[Long$NetUse < 0] <- Long$import[Long$NetUse < 0] + ##################################### + Long <- Long %>% select(base,NetUse) + colnames(Long)[2] <- "Quantity" + + ############################################################################## + # 3. Start processing + + # Create two empty arrays for steel for the extension (Q) and for the fabrication scrap + Scrap <- Q <- as.data.frame(matrix(0,2,nrow(IO.codes))) + rownames(Scrap) <- rownames(Q) <- c("Flat","Long") + + # Execute functions + # Warnings are turned of for the run. + options(warn = -1) + WriteValues2Array(Flat,"Flat",Q,Scrap) + WriteValues2Array(Long,"Long",Q,Scrap) + options(warn = 0) + + # Save extension of the MFA-Waste-IO Model + save(Q,file = paste0(path$IE_Processed,"/EXIOWasteMFAIO/",year,"_Q.RData")) + + # Prepate fabrication scrap data for export + Scrap <- colSums(Scrap) + Scrap <- data.frame(IO.codes, + "Quantity" = Scrap, + stringsAsFactors = FALSE) + + # Check if subfolder in processed data exists and if not create it + path_set <- paste0(path$IE_Processed,"/FabricationScrap") + if(!dir.exists(path_set)) dir.create(path_set) + + # Write to folder + write.csv(Scrap,file = paste0(path_set,"/FabricationScrap_",year,".csv"),row.names = FALSE) + + print("IEDataProcessing_PIOLab_WasteMFAIOExtension finished.") + +} \ No newline at end of file diff --git a/Rscripts/IEfeeds_code/IE_subroutines/Archive/IEDataProcessing_PIOLab_WasteMFAIOModelRun.R b/Rscripts/IEfeeds_code/IE_subroutines/Archive/IEDataProcessing_PIOLab_WasteMFAIOModelRun.R new file mode 100644 index 0000000..85ec43c --- /dev/null +++ b/Rscripts/IEfeeds_code/IE_subroutines/Archive/IEDataProcessing_PIOLab_WasteMFAIOModelRun.R @@ -0,0 +1,141 @@ +######################################### +# # +# This code runs the Waste-IO model # +# and saves the data in the # +# appropriate folders # +# # +######################################### + +IEDataProcessing_PIOLab_WasteMFAIOModelRunV2 <- function(year,path) +{ + + print("IEDataProcessing_PIOLab_WasteMFAIOModelRunV2 initiated.") + + + # Load codes and indices of model: + + IO.codes <- read.csv( paste0(path$IE_Processed,"/EXIOWasteMFAIO/IO_codes.csv")) + + IO.codes["Key"] <- paste0(IO.codes$base,"-",IO.codes$sector) + + Y.codes <- read.csv( paste0(path$IE_Processed,"/EXIOWasteMFAIO/Y_codes.csv")) + + Y.codes["Key"] <- paste0(Y.codes$base,"-",Y.codes$sector) + + + # Load model variables: + + Q <- as.matrix( read.csv(paste0(path$IE_Processed,"/EXIOWasteMFAIO/",year,"_Q.csv"), + header = FALSE) ) + + L <- as.matrix( read.csv(paste0(path$IE_Processed,"/EXIOWasteMFAIO/",year,"_L.csv"), + header = FALSE) ) + + Y <- as.matrix( read.csv(paste0(path$IE_Processed,"/EXIOWasteMFAIO/",year,"_Y.csv"), + header = FALSE) ) + + x <- rowSums( L %*% Y ) # Calculate gross output + + # Calculate multipliers + + E <- colSums(Q)/x + + E[is.na(E)] <- 0 + + MP <- L*E + + # 1. Estimate flows from fabrication to final product + + FP <- MP %*% diag( rowSums(Y) ) + + colnames(FP) <- rownames(FP) <- IO.codes$Key + + FP <- melt(FP) # Transfrom from wide to long format (pivot-like list) + + colnames(FP) <- c("From","To","Quantity") + + FP[,c("From","To")] <- apply(FP[,c("From","To")], c(2), as.character) + + + # Differentiate sector and region codes (from and to): + + FP <- left_join( x = FP, y = select(IO.codes,base,sector,Key), + by = c("From" = "Key"), + copy = FALSE, + suffix = c(".from",".to") ) + + FP <- left_join( x = FP, y = select(IO.codes,base,sector,Key), + by = c("To" = "Key"), + copy = FALSE, + suffix = c(".from",".to") ) + + Fabrication2Final <- select(FP,-From,-To) # Remove key (not needed anymore) + + + # 2. Estimate steel in final demand + + + FP <- Y # Create object to store data + + # Set col and row names: + + colnames(FP) <- paste0(Y.codes$base,"-",Y.codes$demand) + + rownames(FP) <- paste0(IO.codes$base,"-",IO.codes$sector) + + FP[1:nrow(Y),1:ncol(Y)] <- 0 # Set values to zero + + + # Calculate flows: + + for( i in 1:ncol(Y) ) FP[,i] <- rowSums( t(MP)*Y[,i] ) + + + FP <- melt(FP) # Transfrom from wide to long format (pivot-like list) + + colnames(FP) <- c("From","To","Quantity") + + FP[,c("From","To")] <- apply(FP[,c("From","To")], c(2), as.character) + + + # Differentiate sector and region codes (from and to): + + FP <- left_join( x = FP, y = select(IO.codes,base,sector,Key), + by = c("From" = "Key"), + copy = FALSE, + suffix = c(".from",".to") ) + + FP <- left_join( x = FP, y = select(IO.codes,base,sector,Key), + by = c("To" = "Key"), + copy = FALSE, + suffix = c(".from",".to") ) + + Fabrication2Final <- select(FP,-From,-To) # Remove key (not needed anymore) + + + + + colSums(SteelInFinalDemand)/1000000 + + + sum(SteelInFinalDemand) + + SteelInFinalDemand <- tibble::rownames_to_column(SteelInFinalDemand, "Key") + SteelInFinalDemand <- melt(SteelInFinalDemand,id.vars = "Key") + colnames(SteelInFinalDemand) <- c("Key","To.Region","Quantity") + # Warning messages are turned off for the following join + options(warn = -1) + SteelInFinalDemand <- left_join(SteelInFinalDemand,IO.codes,c("Key"),copy = FALSE) %>% + select(base,To.Region,commodity,Quantity) + options(warn = 0) + colnames(SteelInFinalDemand)[c(1,3)] <- c("From.Region","Commodity") + SteelInFinalDemand <- left_join(SteelInFinalDemand,base$product,c("Commodity" = "Name"),copy = FALSE) %>% + select(From.Region,To.Region,Code,Quantity) + colnames(SteelInFinalDemand)[3] <- "Product" + + # 4. Save results to folder + write.csv(FabricationToFinal,file = paste0(path$IE_Processed,"/EXIOWasteMFAIO/",year,"_FabricationToFinalDemand.csv"),row.names = FALSE) + write.csv(SteelInFinalDemand,file = paste0(path$IE_Processed,"/EXIOWasteMFAIO/",year,"_SteelInFinalDemand.csv"),row.names = FALSE) + + print("DataProcessing_PIOLab_WasteMFAIOModelRun finished.") +} \ No newline at end of file diff --git a/Rscripts/IEfeeds_code/IE_subroutines/Archive/IEFeed_PIOLab_EXIOWasteMFAIO.R b/Rscripts/IEfeeds_code/IE_subroutines/Archive/IEFeed_PIOLab_EXIOWasteMFAIO.R new file mode 100644 index 0000000..baf9954 --- /dev/null +++ b/Rscripts/IEfeeds_code/IE_subroutines/Archive/IEFeed_PIOLab_EXIOWasteMFAIO.R @@ -0,0 +1,146 @@ +################################################# +# # +# This Feed takes EXIOBASE 3.6 and aggregating # +# the database in order to apply the # +# MFA-Waste-IO approach # +# # +################################################# + + +IEFeed_PIOLab_EXIOWasteMFAIO <- function(year,path) +{ + print("IEFeed_PIOLab_EXIOWasteMFAIO initiated.") + # Function for aggregating the IOT + Agg <- function(x) + { + x <- as.matrix(x) %*% sapply(unique(colnames(x)),"==",colnames(x)) + return(x) + } + + # 1. Loading the original EXIOBASE 3.6 variables + # Transaction matrix: + load(paste0(path$Raw,"/EXIOWasteMFAIO/",year,"_Z.RData")) + # Final demand: + load(paste0(path$Raw,"/EXIOWasteMFAIO/",year,"_Y.RData")) + # IO sector codes: + load(paste0(path$Raw,"/EXIOWasteMFAIO/","IO.codes.RData")) + IO.codes <- IO.codes %>% select(Index,Product.Name,Country.Code) + regions <- unique(IO.codes$Country.Code) + # Final demand codes + load(paste0(path$Raw,"/EXIOWasteMFAIO/","Y.codes.RData")) + + # Load the root classifciation + root_class <- root$region %>% select(Code,ISO2digitCode) + + # Load region aggregator + source(paste0(path$Subroutines,"/Root2Base_RegionAggregator.R")) + + # Load source-to-root and calculate Source2Base concordances + Source2Root <- read.csv(paste0(path$Concordance,"/EXIOBASE/Source2Root_Region_EXIOBASE.csv"), + header = FALSE) + + Root2Base <- as.matrix(RegionAggregator) + + Source2Root <- as.matrix(Source2Root) + # Create map from concordance + Source2Root <- Source2Root/rowSums(Source2Root) + Root2Base <- as.matrix(Root2Base) + # Create Source-to-base matrix + Source2Base <- Source2Root %*% Root2Base + + # Create concordance + Source2Base <- t(Source2Base)*(1:ncol(Source2Base)) + rownames(Source2Base) <- NULL + Source2Base <- melt(Source2Base) + Source2Base <- filter(Source2Base,value > 0) %>% select(-value) + colnames(Source2Base) <- c("base","root") + + IO.codes <- data.frame(IO.codes,"NewProducts" = "NEC",stringsAsFactors = FALSE) + IO.codes["base"] <- rep(Source2Base$base,each = 200) + + # select steel containing commodities + steel.id <- c(117:125,150) + IO.codes$NewProducts[IO.codes$Product.Name %in% IO.codes$Product.Name[steel.id]] <- IO.codes$Product.Name[IO.codes$Product.Name %in% IO.codes$Product.Name[steel.id]] + + # Create key for aggregation + IO.codes <- data.frame(IO.codes, + "Key" = paste0(as.character(IO.codes$base),"§",IO.codes$NewProducts), + stringsAsFactors = FALSE) + + # Aggregate transaction matrix + colnames(Z) <- IO.codes$Key + Z <- Agg(Z) + Z <- t(Z) + colnames(Z) <- IO.codes$Key + Z <- Agg(Z) + Z <- t(Z) + + # Aggregate final demand + Y.codes["base"] <- rep(Source2Base$base,each = 7) + colnames(Y) <- Y.codes$base + Y <- Agg(Y) + Y <- t(Y) + colnames(Y) <- IO.codes$Key + Y <- Agg(Y) + Y <- t(Y) + # Rearrange columns so that the region code of the base table is in increasing order + Y <- Y[,as.character(1:max(Source2Base$base))] + + # Create new IO.codes to rearrange the variables so that base region codes increases + IO.codes <- colnames(Z) + IO.codes <- as.data.frame(str_split_fixed(IO.codes, "§", 2),stringsAsFactors = FALSE) + colnames(IO.codes) <- c("base","commodity") + storage.mode(IO.codes$base) <- "numeric" + IO.codes <- IO.codes[order(IO.codes$base),] + IO.codes$index <- 1:nrow(IO.codes) + IO.codes$Key <- paste0(as.character(IO.codes$base),"§",IO.codes$commodity) + IO.codes <- IO.codes[,c("index","base","commodity","Key")] + + # New Y.codes + Y.codes <- data.frame("base" = 1:max(Source2Base$base), + "Region.Name" = base$region$Name, + stringsAsFactors = FALSE) + + # Rearrange Z & Y (if necessary) + Z <- Z[,IO.codes$Key] + Z <- t(Z) + Z <- Z[,IO.codes$Key] + Y <- t(Y) + Y <- Y[,IO.codes$Key] + Y <- t(Y) + + # Compute new variables of the aggreagted table + x <- rowSums(Z) + rowSums(Y) + A <- t(t(Z)/x) + A[is.na(A)] <- 0 + + # Delete input/flows not containing steel + A[IO.codes$index[IO.codes$commodity == "NEC"],] <- 0 + A[,IO.codes$index[IO.codes$commodity == "NEC"]] <- 0 + L <- solve(diag(nrow(A))-A) + + # Construct new final demand (now only steel-containing products) + Y[IO.codes$index[IO.codes$commodity == "NEC"],] <- 0 + + # Remove NEC product from WIO model + L <- L[IO.codes$index[IO.codes$commodity != "NEC"],IO.codes$index[IO.codes$commodity != "NEC"]] + Y <- Y[IO.codes$index[IO.codes$commodity != "NEC"],] + x <- rowSums(L%*%Y) + IO.codes <- IO.codes[IO.codes$commodity != "NEC",] + IO.codes$index <- 1:nrow(IO.codes) + IO.codes$WIOcode <- 1:length(unique(IO.codes$commodity)) + IO.codes$base.product <- base$product$Code[base$product$Name %in% IO.codes$commodity] + + # Check if subfolder in processed data exists and if not create it + path_set <- paste0(path$IE_Processed,"/EXIOWasteMFAIO") + if(!dir.exists(path_set)) dir.create(path_set) + + write.table(L,file = paste0(path_set,"/",year,"_L.csv"),row.names = FALSE,col.names = FALSE,sep = ",") + write.table(Y,file = paste0(path_set,"/",year,"_Y.csv"),row.names = FALSE,col.names = FALSE,sep = ",") + write.table(x,file = paste0(path_set,"/",year,"_x.csv"),row.names = FALSE,col.names = FALSE,sep = ",") + save(IO.codes,file = paste0(path_set,"/IO.codes.RData")) + save(Y.codes,file = paste0(path_set,"/Y.codes.RData")) + + print("IEFeed_PIOLab_EXIOWasteMFAIO finished.") + +} \ No newline at end of file diff --git a/Rscripts/IEfeeds_code/IE_subroutines/IEDataProcessing_PIOLab_AligningData.R b/Rscripts/IEfeeds_code/IE_subroutines/IEDataProcessing_PIOLab_AligningData.R index faa4c52..2237f78 100644 --- a/Rscripts/IEfeeds_code/IE_subroutines/IEDataProcessing_PIOLab_AligningData.R +++ b/Rscripts/IEfeeds_code/IE_subroutines/IEDataProcessing_PIOLab_AligningData.R @@ -1,148 +1,89 @@ -########################################### -# # -# This function fills the gap of the # -# of the WorldSteels (WSA) production # -# numbers using the IEA energy data. # -# Moreover, BACI trade data is aligned # -# with IRP ore extraction data # -# # -########################################### +################################################################################ +# This function uses WSA data to estimate forging output and +# aligns trade data with IRP extraction +# It differs from version 1 in not filling the gaps in WSA by comparing with IEA +# Author: hanspeter.wieland@wu.ac.at +# Date: 26.03.2020 IEDataProcessing_PIOLab_AligningData <- function(year,path) { + print("IEDataProcessing_PIOLab_AligningData initiated.") - ############################################################################## + # Loading BACI trade data and IRP extraction accounts: + + BACI <- read.csv(file = paste0(path$IE_Processed,"/BACI/BACI_",year,".csv")) - # 1. Loading data + IronOre <- read.csv(file = paste0(path$IE_Processed,"/IRP/IRP_",year,".csv")) - # Loading processed WSA production numbers + colnames(IronOre)[2] <- "Extraction" - Pig <- read.csv(paste0(path$IE_Processed,"/WSA/WSA_",year,"_PigIron.csv")) + sel <- setdiff(base$region$Code,IronOre$base) # Countries with no extraction - Flat <- read.csv(paste0(path$IE_Processed,"/WSA/WSA_",year,"_FlatRolledProducts.csv")) + BACI$Quantity[BACI$From %in% sel & BACI$Product == 1] <- 0 # Set zero - colnames(Flat)[2] <- "Flat" + BACI <- BACI[BACI$Quantity != 0,] # Filter regions with non-zero values - Long <- read.csv(paste0(path$IE_Processed,"/WSA/WSA_",year,"_LongRolledProducts.csv")) + # Write to folder: - colnames(Long)[2] <- "Long" + write.csv(BACI,file = paste0(path$IE_Processed,"/BACI/BACI_",year,".csv"), + row.names = FALSE) - BOF_steel <- read.csv(paste0(path$IE_Processed,"/WSA/WSA_",year,"_SteelOxygenBlownConverters.csv")) + remove(IronOre,sel) # Delete objects not needed anymore - EAF_steel <- read.csv(paste0(path$IE_Processed,"/WSA/WSA_",year,"_SteelElectricFurnaces.csv")) - colnames(EAF_steel)[2] <- "EAF" + # 2. Estimate forgings - # Loading IE_Processed IEA energy data - BF_gas <- read.csv(paste0(path$IE_Processed,"/IEA/IEA_",year,"_BlastFurnaceGas.csv")) - colnames(BF_gas)[2] <- "Energy" - BOF_gas <- read.csv(paste0(path$IE_Processed,"/IEA/IEA_",year,"_BlastOxygenFurnaceGas.csv")) - colnames(BOF_gas)[2] <- "Energy" - Energy_con <- read.csv(paste0(path$IE_Processed,"/IEA/IEA_",year,"_SteelIndustryEnergyConsumption.csv")) + # Read settings list for WSA data feeds: + + Settings <- read.xlsx(paste0(path$Settings,"/datafeeds_settings/WSA_settings.xlsx")) + + # Read production, import and export of ingots from WSA and BACI: + + Ingots <- list("Production" = read.csv(paste0(path$IE_Processed,"/WSA/WSA_",year,"_Ingots.csv"))) + + Ingots[["Code"]] <- filter(base$flow, Name == "Ingots") %>% pull(Code) + + Ingots[["Export"]] <- filter(BACI, Product == Ingots$Code) %>% select(-Product) %>% + group_by(From) %>% summarise(Quantity = sum(Quantity)) %>% ungroup(From) + + Ingots[["Import"]] <- filter(BACI, Product == Ingots$Code) %>% select(-Product) %>% + group_by(To) %>% summarise(Quantity = sum(Quantity)) %>% ungroup(To) + + # Estimate forging output: + + Forgings <- data.frame("base" = 1:nrow(base$region), + "Quantity" = 0, + "In_pro" = 0, + "In_im" = 0, + "In_ex" = 0) + + Forgings$In_pro[Ingots$Production$base] <- Ingots$Production$Quantity + + Forgings$In_im[Ingots$Import$To] <- Ingots$Import$Quantity + + Forgings$In_ex[Ingots$Export$From] <- Ingots$Export$Quantity + + Forgings$Quantity <- Forgings$In_pro - Forgings$In_ex + Forgings$In_im + + Forgings$Quantity[Forgings$Quantity < 0] <- Forgings$In_im[Forgings$Quantity < 0] + + Forgings <- select(Forgings, base, Quantity) + + + # Check if folder with processed data exists and in case delete: + + df_Processed <- paste0(path$IE_Processed,"/AligningData") + + if(dir.exists(df_Processed)) unlink(df_Processed,recursive = TRUE) + + dir.create(df_Processed) # Create new (empty) folder + + # Write data to folder + + write.csv(Forgings,file = paste0(df_Processed,"/Forgings_",year,".csv"), + row.names = FALSE) - # Loading BACI trade data on iron ores and IRP extraction accounts - BACI <- read.csv(file = paste0(path$IE_Processed,"/BACI/BACI_",year,".csv")) - IronOre_Extraction <- read.csv(file = paste0(path$IE_Processed,"/IRP/IRP_",year,".csv")) - - ############################################################################## - # 2. Filling gaps in WSA production accounts by checking IEA energy data - # 2.1 WSA pig iron production vs. production of (IEA) blast furnace gas - - # Following the WSA publication "Energy use in the steel industry" (p98) between - # 4.3 and 7.2 GJ of blast furnace gas is produced per ton of pig iron. - # In the following we fill the gaps assuming an average intensity of 5.7 GJ/t - - # Merge the two data sets and filter for missing production values - Pig_vs_BF <- full_join(Pig,BF_gas,c("base"),copy = FALSE) %>% - mutate(Intensity = Energy/Quantity) - Pig_vs_BF_gap <- Pig_vs_BF %>% filter(Quantity == 0 & Energy != 0) - - # Fill in values and save new pig iron production data - if(length(Pig_vs_BF_gap) > 0) { - Pig_vs_BF$Quantity[Pig_vs_BF$base %in% Pig_vs_BF_gap$base] <- Pig_vs_BF_gap$Energy / 5.7 - Pig <- Pig_vs_BF %>% select(base,Quantity) - write.csv(Pig, file = paste0(path$IE_Processed,"/WSA/WSA_",year,"_PigIron.csv"),row.names = FALSE)} - - remove(Pig_vs_BF,Pig_vs_BF_gap,Pig,BF_gas) - - # 2.2 BOF steel production vs. BOF gas production - - # Again according to the WSA report on energy, the blown oxygen furnace steelmaking - # process produces gases of approx. 0.234 GJ per crude steel (p101). Please note that the - # WSA case studies (p104) showed values betwene 0.4 and 0.8 GJ per ton - - Steel_vs_BOF <- full_join(BOF_steel,BOF_gas,c("base"),copy = FALSE) %>% - mutate(Intensity = Energy/Quantity) - Steel_vs_BOF_gap <- Steel_vs_BOF %>% filter(Quantity == 0 & Energy != 0) - - # Fill in values and save new BOF steel production data - if(nrow(Steel_vs_BOF_gap) > 0) { - Steel_vs_BOF$Quantity[Steel_vs_BOF$base %in% Steel_vs_BOF_gap$base] <- Steel_vs_BOF_gap$Energy / 0.234 - BOF_steel <- Steel_vs_BOF %>% select(base,Quantity) - write.csv(BOF_steel, file = paste0(path$IE_Processed,"/WSA/WSA_",year,"_SteelOxygenBlownConverters.csv"),row.names = FALSE)} - - remove(Steel_vs_BOF,Steel_vs_BOF_gap,BOF_gas) - colnames(BOF_steel)[2] <- "BOF" - - # 2.3 Filling gaps for rolled steel products - Steel_vs_energy <- full_join(Energy_con,Flat,c("base"),copy = FALSE) - Steel_vs_energy <- full_join(Steel_vs_energy,Long,c("base"),copy = FALSE) - Steel_vs_energy <- full_join(Steel_vs_energy,BOF_steel,c("base"),copy = FALSE) - Steel_vs_energy <- full_join(Steel_vs_energy,EAF_steel,c("base"),copy = FALSE) - Steel_vs_energy[is.na(Steel_vs_energy)] <- 0 - Steel_vs_energy <- mutate(Steel_vs_energy,Rolled = Flat+Long,Intensity = Value/Rolled) - Steel_vs_energy$Intensity[Steel_vs_energy$Intensity == Inf] <- 0 - - # The reference plant, of the WSA report, has an average energy intensity for - # long rolled products of approx. 20 GJ per ton and 9.5 GJ per ton for scrap based long products - # WSA referenced flat rolling plate mill has an energy intensity of 24 GJ per ton of product (p120-122) - # Please note that these numbers refer to the total energy requirement including - # upstream energy use for steel and iron making. Direct energy use in rolling mills is much smaller at around 2-7 GJ/t - - # 2.3.1 Filter for countries with inconsistent data - # No flat rolling reported but BOF steel is produced - Gap <- Steel_vs_energy %>% filter(Flat == 0 & BOF != 0) - if(nrow(Gap) > 0) Steel_vs_energy$Flat[Steel_vs_energy$base %in% Gap$base] <- Gap$BOF - - # No long rolling reported but EAF steel is porduced - Gap <- Steel_vs_energy %>% filter(Long == 0 & EAF != 0) - if(nrow(Gap) > 0) Steel_vs_energy$Long[Steel_vs_energy$base %in% Gap$base] <- Gap$EAF - - # BOF steel reported but flat rolled products + energy intensity is below the threshold - Gap <- Steel_vs_energy %>% filter(BOF == 0 & Flat != 0 & Intensity < 20) - if(nrow(Gap) > 0) Steel_vs_energy$BOF[Steel_vs_energy$base %in% Gap$base] <- Gap$Flat - - # No flat and long rolling reported but energy use data available - Gap <- Steel_vs_energy %>% filter(Flat == 0 & Long == 0 & Value != 0) - if(nrow(Gap) > 0) { - # Assuming 18 GJ/ton - filling <- Gap$Value/18 - Steel_vs_energy[Steel_vs_energy$base %in% Gap$base,c("Flat","Long","BOF","EAF")] <- filling/2 } - - ############################################################################## - # 3. Delete BACI trade flows of iron ores where IRP reports no extraction - colnames(IronOre_Extraction)[2] <- "Extraction" - # Code of countries with no extraction - sel <- setdiff(base$region$Code,IronOre_Extraction$base) - # Set zero - BACI$Quantity[BACI$From %in% sel & BACI$Product == 1] <- 0 - BACI <- BACI[BACI$Quantity != 0,] - ############################################################################## - # 4. Writing manipulated data to folder - Flat <- select(Steel_vs_energy,base,Flat) - Long <- select(Steel_vs_energy,base,Long) - BOF <- select(Steel_vs_energy,base,BOF) - EAF <- select(Steel_vs_energy,base,EAF) - colnames(Flat)[2] <- colnames(Long)[2] <- colnames(BOF)[2] <- colnames(EAF)[2] <- "Quantity" - - write.csv(Flat,file = paste0(path$IE_Processed,"/WSA/WSA_",year,"_FlatRolledProducts.csv"),row.names = FALSE) - write.csv(Long,file = paste0(path$IE_Processed,"/WSA/WSA_",year,"_LongRolledProducts.csv"),row.names = FALSE) - write.csv(BOF,file = paste0(path$IE_Processed,"/WSA/WSA_",year,"_SteelOxygenBlownConverters.csv"),row.names = FALSE) - write.csv(EAF,file = paste0(path$IE_Processed,"/WSA/WSA_",year,"_SteelElectricFurnaces.csv"),row.names = FALSE) - write.csv(BACI,file = paste0(path$IE_Processed,"/BACI/BACI_",year,".csv"),row.names = FALSE) - - print("IEDataProcessing_PIOLab_AligningData finished.") } \ No newline at end of file diff --git a/Rscripts/IEfeeds_code/IE_subroutines/IEDataProcessing_PIOLab_BuildS8fromSupplyUseTables.R b/Rscripts/IEfeeds_code/IE_subroutines/IEDataProcessing_PIOLab_BuildS8fromSupplyUseTables.R index 73b93c1..1241381 100644 --- a/Rscripts/IEfeeds_code/IE_subroutines/IEDataProcessing_PIOLab_BuildS8fromSupplyUseTables.R +++ b/Rscripts/IEfeeds_code/IE_subroutines/IEDataProcessing_PIOLab_BuildS8fromSupplyUseTables.R @@ -171,8 +171,6 @@ IEDataProcessing_PIOLab_BuildS8fromSupplyUseTables <- function(year,path) write_file(zero,"Zero") write_file(S8,"AllInOne") - print(paste0("IEDataProcessing_PIOLab_BuildS8fromSupplyUseTables finished")) - } diff --git a/Rscripts/IEfeeds_code/IE_subroutines/IEDataProcessing_PIOLab_BuildingDomesticTables.R b/Rscripts/IEfeeds_code/IE_subroutines/IEDataProcessing_PIOLab_BuildingDomesticTables.R index 5084b04..a060e52 100644 --- a/Rscripts/IEfeeds_code/IE_subroutines/IEDataProcessing_PIOLab_BuildingDomesticTables.R +++ b/Rscripts/IEfeeds_code/IE_subroutines/IEDataProcessing_PIOLab_BuildingDomesticTables.R @@ -10,387 +10,712 @@ IEDataProcessing_PIOLab_BuildingDomesticTables <- function(year,path) { + # !diagnostics off + print("IEDataProcessing_PIOLab_BuildingDomesticTables initiated.") - # Load region aggregator - source(paste0(path$Subroutines,"/Root2Base_RegionAggregator.R")) - reg_agg <- Root2Base_RegionAggregator(RegionAggregator) - # Load function to compile end use map - source(paste0(path$Subroutines,"/makeEndUseMap.R")) - # Load slag rate of blast furnace and coefficient per ton of pig iron output - WSA_yield <- read.csv(paste0(path$IE_Processed,"/WSA/SteelIndustryYields.csv")) %>% - select(Process,Average) - # Load extension of the WasteMFAIO model and IO codes - load(paste0(path$IE_Processed,"/EXIOWasteMFAIO/",year,"_Q.RData")) - load(paste0(path$IE_Processed,"/EXIOWasteMFAIO/IO.codes.RData")) - # Load trade data - BACI <- read.csv(paste0(path$IE_Processed,"/BACI/BACI_",year,".csv")) + + # Add path to IE classification setting file: + + path[["IE_classification"]] <- paste0(path$Settings,"/Base/",IEdatafeed_name,"_BaseSectorClassification.xlsx") + + # Load prorating function and Number2File: + + source(paste0(path$Subroutines,"/Prorate.R")) + + source(paste0(path$Subroutines,"/Numbers2File.R")) + + + Codes <- list( "WIO" = read.csv(file = paste0(path$IE_Processed,"/EXIOWasteMFAIO/IO_codes.csv") ) ) + + Setting <- list( "WSA" = read.xlsx(xlsxFile = paste0(path$Settings,"/datafeeds_settings/WSA_settings.xlsx"), sheet = 1 ), + "IE" = read.xlsx(xlsxFile = paste0(path$Settings,"/Base/IE_settings.xlsx"), sheet = 1 )) + + Setting$WSA["path"] <- paste0(path$IE_Processed,"/WSA/WSA_",year,"_",Setting$WSA$FeedName,".csv") + + + # Load flow data where all regions are included in one object: + + data <- list( "FinalDemand" = read.csv( paste0(path$IE_Processed,"/EXIOWasteMFAIO/",year,"_","FinalDemand.csv") ), + "Fab2Demand" = read.csv( paste0(path$IE_Processed,"/EXIOWasteMFAIO/",year,"_","Fabrication2FinalDemand.csv") ), + "BACI" = read.csv(paste0(path$IE_Processed,"/BACI/BACI_",year,".csv") ), + "Eol" = read.csv(paste0(path$IE_Processed,"/EOL/EOL_",year,".csv") ), + "IRP" = read.csv(paste0(path$IE_Processed,"/IRP/IRP_",year,".csv") ), + "Grade" = read.csv(paste0(path$IE_Processed,"/Grades/IronOreGrades.csv") ), + "Yield" = select(read.csv(paste0(path$IE_Processed,"/WSA/SteelIndustryYields.csv")),Process,Average), + "WSA" = lapply(X = Setting$WSA$path, FUN = read.csv), + "Forgings" = read.csv(paste0(path$IE_Processed,"/AligningData/Forgings_",year,".csv") ) + ) + + # Load WSA Source2Root concordances + + set <- read.xlsx(xlsxFile = paste0(path$Settings,"/Base/IE_settings.xlsx"),sheet = 2) + + path_sel <- list("flow" = paste0(path$Concordance,"/WSA/", + set$date[set$aggregator == "sector"],"_WSA_Source2Root_Product.csv"), + "process" = paste0(path$Concordance,"/WSA/", + set$date[set$aggregator == "sector"],"_WSA_Source2Root_Industry.csv") + ) + + S2R <- list( "WSA" = list( "industry" = as.matrix( read.csv(path_sel$process,header = FALSE) ), + "product" = as.matrix( read.csv(path_sel$flow,header = FALSE) ) + ) + ) + + # Store root to mother concordances in list object: + + R2M_sel <- list( "WSA" = list( "industry" = R2M$process, + "product" = R2M$flow + ) + ) + + # Normalize source to root concordances (create maps) + + for(j in 1:2) S2R$WSA[[j]] <- as.matrix( S2R$WSA[[j]] / rowSums(S2R$WSA[[j]]) ) + + S2M <- list("WSA" = list()) # Create empty list to store source to mother maps + + # Create Source to mother map: + + for(j in 1:2) S2M$WSA[[j]] <- S2R$WSA[[j]] %*% R2M_sel$WSA[[j]] + + # Load SUT templates + + SUT_temp <- list( "Supply" = as.matrix( read.xlsx(path$IE_classification, sheet = 5,rowNames = TRUE) ), + "Use" = as.matrix( read.xlsx(path$IE_classification, sheet = 6,rowNames = TRUE) ) + ) + # Load allocation function - source(paste0(path$Subroutines,"/AllocateSupply2Use.R")) - # Define general variables - n_pro <- nrow(base$product) - n_ind <- nrow(base$industry) - n_reg <- nrow(base$region) - n_va <- 5 - n_fd <- 3 + # source(paste0(path$Subroutines,"/AllocateSupply2Use.R")) - for(i in 1:n_reg) + # Define general variables: + + # num <- list("pro" = nrow(base$product), + # "ind" = nrow(base$industry), + # "reg" = nrow(base$region), + # "va" = nrow(base$input), + # "fd" = nrow(base$demand) ) + + for(i in 1:num$reg) { - print(i) - # Create empty SUT - SUT <- data.frame(matrix(0,(n_pro+n_ind+n_va),(n_pro+n_ind+n_fd))) - colnames(SUT) <- c(base$industry$Name,base$product$Name, - "FinalConsumption","Landfill","Atmosphere") - rownames(SUT) <- c(base$industry$Name,base$product$Name, - "FerrousMinerals","EOLScrap","Limestone","Coke","Air") - SUT <- as.matrix(SUT) - ############################################################################ - # 1. Writing boundary inputs of iron ore extraction and end-of-life scrap to table - - # 1.1 EoL scrap - data <- read.csv(paste0(path$IE_Processed,"/EOL/EOL_",year,".csv")) - if(i %in% data$base) { - value <- data$Quantity[data$base == i] - SUT["EOLScrap","Scrap preparation"] <- value } - - # 1.2 IRP iron ore extraction i.e. inputs from nature - data <- read.csv(paste0(path$IE_Processed,"/IRP/IRP_",year,".csv")) - if(i %in% data$base) { - value <- data$Quantity[data$base == i] - SUT["FerrousMinerals","Mining"] <- value } - - ############################################################################ - # 2. Writing production values into supply table - - # 2.1 Waste (gangue) output of mining - # Read iron ore grades and assume beneficiation to 60% of ore grade - data <- read.csv(paste0(path$IE_Processed,"/Grades/IronOreGrades.csv")) - - # if no ore grades are available for a region, assume 0.6 - if(i %in% data$base) - {concen <- data$Concentration[data$base == i]}else - {concen <- 0.6} - - if(SUT["FerrousMinerals","Mining"] > 0) { - iron <- SUT["FerrousMinerals","Mining"]*concen - # iron ore weight with 60% grade, when concentration is higher than 0.6, leave it like it is - if(concen <= 0.6) {value_new <- iron/0.6} else - {value_new <- iron/concen} - # Calculate waste flow to landfill - waste <- value-value_new - # Allocate output of iron ore (now 60% grade) to mining - SUT["Mining","Iron ore"] <- value_new - # Allocate boundary outputs of waste to the supply-side of mining, that is landfill - SUT["Mining","Landfill"] <- waste } - - # 2.2 Write pig iron production and use yields to estimate waste/slag flows - data <- read.csv(paste0(path$IE_Processed,"/WSA/WSA_",year,"_PigIron.csv")) - - if(i %in% data$base) { - value <- data$Quantity[data$base == i] - SUT["Blast furnace","Pig iron"] <- value - # Take slag rate from WSA - yield <- WSA_yield$Average[WSA_yield$Process == 'BF slag rate']/1000 - # Estimate slag output and allocate to landfill (final use) - SUT["Blast furnace","Landfill"] <- value * yield - # Estimate output of top gas (1.7 tons per ton oig iron) - SUT["Blast furnace","Atmosphere"] <- value *1.7} - - # 2.3 Sponge iron - data <- read.csv(paste0(path$IE_Processed,"/WSA/WSA_",year,"_SpongeIron.csv")) - if(i %in% data$base) { - value <- data$Quantity[data$base == i] - SUT["Direct reduction","Sponge iron"] <- value - # Allocate slag output assuming losses of 5% of sponge iron output - #yield <- 0.05 - #waste <- value * yield - # Alternatively allocate losses including gangue by assuming waste of 600 kg per ton of useful output - SUT["Direct reduction","Landfill"] <- value * 0.6 } + print(paste("Compiling",base$region$Name[i])) + + # Create empty SUT: + + SUT <- data.frame(matrix(0,(num$flow + num$process + num$input),(num$flow + num$process + num$demand))) + + colnames(SUT) <- c(base$process$Name, + base$flow$Name, + base$demand$Name) + + rownames(SUT) <- c(base$process$Name, + base$flow$Name, + base$input$Name) + + SUT <- as.matrix(SUT) # Transform to matrix write numbers using matrix indices + + + ### Flows associated with fabrication ### + + + # Load data on fabrication use: + + data_sel <- read.csv(paste0(path$IE_Processed,"/Cullen/FabricationUse_", + year,"_",base$region$Name[i],".csv"), + header = FALSE) + + # Store matrix index in list: + + index <- list("row" = num$process + filter(base$flow,Type == "Finished") %>% pull(Code), + "col" = filter(base$process,Type == "Final") %>% pull(Code)) + + SUT[index$row,index$col] <- as.matrix(data_sel) # Write into table + + # Load data on fabrication scrap output + + data_sel <- read.csv(paste0(path$IE_Processed,"/Cullen/FabricationScrap_", + year,"_",base$region$Name[i],".csv")) + + # Matrix indices in list: + + index <- list("row" = data_sel$base, + "col" = num$process + filter(base$flow, Name == "Fabrication scrap") %>% pull(Code)) + + SUT[index$row,index$col] <- data_sel$Quantity # Write scrap flows into table + + # Read data for useful fabrication output + + data_sel <- select(data$Fab2Demand,base.from,sector.from,Quantity) %>% filter(base.from == i) %>% + group_by(base.from,sector.from) %>% summarise(Quantity = sum(Quantity)) %>% ungroup(base.from,sector.from) + + # Store matrix index in list: + + index <- as.matrix(data.frame("row" = filter(base$process,Type == "Final") %>% pull(Code), + "col" = num$process + filter(base$flow,Type == "Final") %>% pull(Code) + ) + ) + + SUT[index] <- data_sel$Quantity # Write fab output to table + + + # Read data on intermediate use of manufacturing output + + data_sel <- data$Fab2Demand %>% filter(base.from == i,base.to == i) %>% + select(sector.from,sector.to,Quantity) %>% group_by(sector.from,sector.to) %>% + summarise(Quantity = sum(Quantity)) %>% ungroup(sector.from,sector.from) + + # Read base sector codes: + + index <-data.frame( "row" = num$process + filter(base$flow,Type == "Final") %>% pull(Code), + "col" = filter(base$process,Type == "Final") %>% pull(Code) ) + + data_sel$sector.from <- index$row[data_sel$sector.from] # Exchange WIO codes with base row codes + + data_sel$sector.to <- index$col[data_sel$sector.to] # Exchange WIO codes with base col codes + + # Copy base codes into data frame and transform into matrix: + + index <- as.matrix(data_sel[,c("sector.from","sector.to")]) + + SUT[index] <- data_sel$Quantity + + + # Read flows from final production sector (manuf.) to final demand category: + + data_sel <- data$FinalDemand %>% filter(base.from == i,base.to == i) %>% + select(sector,demand,Quantity) %>% group_by(sector,demand) %>% + summarise(Quantity = sum(Quantity)) %>% ungroup(sector,sector,demand) + + # Read base sector codes: + + index <-data.frame( "row" = filter(base$process,Type == "Final") %>% pull(Code)) + + data_sel$sector <- index$row[data_sel$sector] # Exchange WIO code with base sector code + + data_sel$demand <- data_sel$demand + num$process + num$flow # Exchange WIO with base sector code + + index <- as.matrix( data_sel[,c("sector","demand")] ) # Create matrix for indices + + SUT[index] <- data_sel$Quantity + + + ### Output of steelmaking sector ### + + # Read WSA id's of processed data that is relevant: + + Code_sel <- Setting$WSA %>% filter(Type %in% c("Primary","Secondary","Finished")) %>% + select(id, FeedName, Type) + + # Use id to extract a list containing the processed data: + + data_sel <- data$WSA[Code_sel$id] + + # Create vector in list to store the data for country i: + + Value <- list( "Source" = vector( mode="integer", length= length(data_sel) ) ) + + # Write production numbers in vector: + + for( j in 1:nrow(Code_sel) ) + { + if(i %in% data_sel[[j]]$base) Value$Source[j] <- filter(data_sel[[j]],base == i) %>% pull(Quantity) + } + + # Map raw data to mother product classification: + + Value[["Mother"]] <- colSums( S2M$WSA[[2]][Code_sel$id,] * Value$Source ) + + # Read indices of steelmaking sector outputs + + index <- list( "row" = filter(base$process,Type %in% c("Primary","Secondary","Finished")) %>% pull(Code), + "col" = filter(base$flow,Type %in% c("Primary","Secondary","Finished")) %>% pull(Code) + ) + + Value[["Supply"]] <- SUT_temp$Supply %*% diag(Value$Mother) # Allocate products to industries + + # Write values into SUT (note addition of number of industries to column indices): + + SUT[index$row, num$process + index$col] <- Value$Supply[index$row,index$col] + + ### Add forging production ### + + if(i %in% data$Forgings$base) + { + SUT["Steel casting and forging","Forgings"] <- filter(data$Forgings,base == i) %>% pull(Quantity) + } + + # Read indices of secondary i.e. crude steel: + + index <- data.frame("industry" = filter(base$process,Name %in% paste("Continuous casting of",c("slabs","billets","blooms"))) %>% pull(Code), + "product" = filter(base$flow,Name %in% c("Slabs","Billets","Blooms")) %>% pull(Code) + ) + + + # Create map to calculate crude steel (secondary) output by estimating demand of downstream processes: + + Map <- t( SUT_temp$Use[index$product,] ) / colSums( SUT_temp$Use[index$product,] ) + + Map[is.na(Map)] <- 0 + + # Estimate crude steel demand/output: + + Value <- colSums( Map * rowSums(SUT[base$process$Code, num$process + base$flow$Code]) ) + + index$product <- index$product + num$process # Change product (col) code to write in SUT + + SUT[as.matrix(index)] <- Value # Write value + + + ### Estimate forming scrap ### + + # indices of forming processes: + + index <- list( "industry" = filter(base$process, Type == "Finished") %>% pull(Code) ) + + # Output of forming processes: + + Value <- rowSums(SUT[index$industry, num$process + base$flow$Code]) + + # Scrap = ( Useful output / yield ) - Useful output: + + Value <- ( Value / filter(data$Yield, Process == "Hot rolling yield") %>% pull(Average) ) - Value + + SUT[index$industry,"Forming scrap"] <- Value # Write values in SUT + + ############################################## + ### Estimate final outputs of steel sector ### + ############################################## + + # Read process factor for top gas per pig iron: + + factor <- filter(Setting$IE, item == "TopGasPerPigIron") %>% pull(value) + + + # Write emissions in final output quadrant: + + SUT["Blast furnace","Atmosphere"] <- SUT["Blast furnace","Pig iron"] * factor + + + # Read slag per unit pig iron and allocate amount to output to landfill + + factor <- filter(Setting$IE, item == "SlagPerPigIron") %>% pull(value) + + SUT["Blast furnace","Landfill"] <- SUT["Blast furnace","Pig iron"] * factor + + + # Read gangue per unit sponge iron factor and add amount to landfill: + + factor <- filter(Setting$IE, item == "GanguePerSpongeIron") %>% pull(value) + + SUT["Direct reduction","Landfill"] <- SUT["Direct reduction","Sponge iron"] * factor + + + # Read oxygen blown furnace yield and use this for both OBF and open hearth furnace: + + factor <- filter(data$Yield,Process == "BOF yield") %>% pull(Average) + + # Read sector indices: + + index <- data.frame("industry" = filter(base$process, Name %in% c("Basic oxygen converter","Open hearth furnace")) %>% pull(Code), + "product" = num$process + filter(base$flow, Name %in% c("Liquid steel OBF","Liquid steel OHF")) %>% pull(Code) + ) + + # Write flow to landfill: + + SUT[index$industry,"Landfill"] <- ( SUT[as.matrix(index)] / factor ) - SUT[as.matrix(index)] + + + # Read electric arc furnace yield and estimate waste flow: + + factor <- filter(data$Yield,Process == "EAF yield") %>% pull(Average) + + Value <- SUT["Electric arc furnace","Liquid steel EAF"] # EAF steel production + + SUT["Electric arc furnace","Landfill"] <- ( Value / factor ) - Value + + + # Read slab and billet caster yields: + + factor <- filter( data$Yield,Process %in% c("Slab caster yield","Billet caster yield") ) %>% pull(Average) + + index <- data.frame("industry" = filter(base$process,Name %in% paste("Continuous casting of",c("slabs","billets"))) %>% pull(Code), + "product" = num$process + filter(base$flow,Name %in% c("Slabs","Billets") ) %>% pull(Code) + ) + + + SUT[index$industry,"Forming scrap"] <- ( SUT[as.matrix(index)] / factor ) - SUT[as.matrix(index)] + + + # Read bloom caster yield and use this for both blooms and ingost: + + factor <- filter( data$Yield,Process == "Bloom caster yield" ) %>% pull(Average) + + index <- data.frame("industry" = filter(base$process,Name %in% c("Continuous casting of blooms","Ingot casting")) %>% pull(Code), + "product" = num$process + filter(base$flow,Name %in% c("Blooms","Ingots") ) %>% pull(Code) + ) + + SUT[index$industry,"Forming scrap"] <- ( SUT[as.matrix(index)] / factor ) - SUT[as.matrix(index)] + + + ######################################################## + ### Fill use table of forming processes (= Finished) ### + ######################################################## + + + # Read indices of products that are used by these processes + # Note: Hot rolled coil-sheet-strip is handled separatly: + + index <- list( "product" = filter( base$flow, Name %in% c("Slabs","Billets","Blooms","Ingots") ) %>% pull(Code), + "industry" = filter( base$process, Type == "Finished" ) %>% pull(Code), + "interind" = filter( base$process, Type == "Secondary" ) %>% pull(Code) + ) + + # Read domestic output of intermediate inputs and of process: + + DomOut <- list( "Process" = rowSums(SUT[index$industry,]), + "Intermed" = rowSums(SUT[index$interind,]) + ) + + # Read use structure from template and create map: + + Map <- SUT_temp$Use[index$product, index$industry] + + # Create prorated map: + + Map <- Prorate(Map, DomOut$Process) + + Map[is.na(Map)] <- 0 + + + # Read export of intermediates: + + export <- filter(data$BACI,From == i,Product %in% index$product) %>% select(Product,Quantity) %>% + group_by(Product) %>% summarise(Quantity = sum(Quantity)) %>% ungroup(Product) + + + offset <- min(index$product)-1 # Offset product codes to write in Map + + if(length(export) >= 1) + { + Value <- DomOut$Intermed + Value[export$Product-offset] <- DomOut$Intermed[export$Product-offset] - export$Quantity + } + + # Check if exports are unavailable and if so set to zero: + + if( length(export) == 0 ) + { + Value <- DomOut$Intermed + } + + + + # Check if negatives exists and replace them with domestic production: + + for(j in 1:length(Value)) if(Value[j] < 0) Value[j] <- DomOut$Intermed[j] + + # Mulitply with map and write in use table + + SUT[num$process + index$product, index$industry] <- Map * Value + + + # Estimate use of hot rolled coil-sheet-strip products: + # Note that the use of hot rolled CSS by manufacturing is already accounted for by the WIO model extension + + index <- list( "product" = filter( base$flow, Name == "Hot rolled coil-sheet-strip" ) %>% pull(Code), + "rolling" = filter( base$process, Name %in% c("Tube welding","Cold rolling mill") ) %>% pull(Code), + "manufacturing" = filter( base$process, Type == "Final" ) %>% pull(Code), + "interind" = filter( base$process, Name == "Hot strip mill" ) %>% pull(Code) + ) + + # Read domestic output of intermediate inputs (product) and of relevant processes: + + DomOut <- list( "rolling" = rowSums(SUT[index$rolling,]), + "interind" = sum(SUT[index$interind,]), + "manufacturing" = sum(SUT[index$interind,]) + ) + + SUT[num$process + index$product, index$rolling] <- DomOut$rolling + + + # Estimate liquid steel use of casting: + + index <- list( "product" = filter( base$flow, Name %in% paste("Liquid steel",c("OBF","OHF","EAF")) ) %>% pull(Code), + "industry" = filter( base$process, Type == "Secondary" ) %>% pull(Code), + "interind" = filter( base$process, Name %in% c("Basic oxygen converter","Open hearth furnace","Electric arc furnace") ) %>% pull(Code) + ) + + # Read domestic output of intermediate inputs and of process: + + DomOut <- list( "industry" = rowSums(SUT[index$industry,]), + "Interind" = rowSums(SUT[index$interind,]) + ) + + # Read use structure from template and create map: + + Map <- SUT_temp$Use[index$product, index$industry] + + Map[is.na(Map)] <- 0 + + Map <- Prorate( Map, DomOut$industry) # Prorate map + + Value <- Map * DomOut$Interind # Multiply map with steel production + + SUT[num$process + index$product,index$industry] <- Value # Write into table + + + ### Primary inputs ### + + factor <- filter(Setting$IE, item == "AirPerPigIron") %>% pull(value) + + SUT["Air","Blast furnace"] <- SUT["Blast furnace","Pig iron"] * factor + + factor <- filter(Setting$IE, item == "CokePerPigIron") %>% pull(value) + + SUT["Coke","Blast furnace"] <- SUT["Blast furnace","Pig iron"] * factor + + factor <- filter(Setting$IE, item == "FluxPerPigIron") %>% pull(value) + + SUT["Flux","Blast furnace"] <- SUT["Blast furnace","Pig iron"] * factor + + # EoL scrap: + + if(i %in% data$Eol$base) SUT["End-of-Life Scrap","Scrap preparation"] <- data$Eol$Quantity[data$Eol$base == i] + + # IRP iron ore extraction + + if(i %in% data$IRP$base) + { + crude <- data$IRP$Quantity[data$IRP$base == i] - # 2.4 Write steel production of BOF & OHF - data_1 <- read.csv(paste0(path$IE_Processed,"/WSA/WSA_",year,"_SteelOxygenBlownConverters.csv")) - data_2 <- read.csv(paste0(path$IE_Processed,"/WSA/WSA_",year,"_SteelOpenHearthFurnaces.csv")) - data <- rbind(data_1,data_2) %>% group_by(base) %>% summarise(Quantity = sum(Quantity)) - remove(data_1,data_2) - - if(i %in% data$base) { - value <- data$Quantity[data$base == i] - SUT["Oxygen blown & open hearth furnace","Liquid steel (OBF/OHF)"] <- value - # Calculate waste - yield <- WSA_yield$Average[WSA_yield$Process == 'BOF yield'] - waste <- (value/yield)-value - SUT["Oxygen blown & open hearth furnace","Landfill"] <- waste } - - # 2.5 Write steel production of EAF - data <- read.csv(paste0(path$IE_Processed,"/WSA/WSA_",year,"_SteelElectricFurnaces.csv")) - - if(i %in% data$base) { - value <- data$Quantity[data$base == i] - SUT["Electric arc furnace","Liquid steel (EAF)"] <- value - # Calculate waste - yield <- WSA_yield$Average[WSA_yield$Process == 'EAF yield'] - waste <- (value/yield)-value - SUT["Electric arc furnace","Landfill"] <- waste } - - # 2.6 Write flat rolling production and forming scrap - data <- read.csv(paste0(path$IE_Processed,"/WSA/WSA_",year,"_FlatRolledProducts.csv")) - - if(i %in% data$base) { - value <- data$Quantity[data$base == i] - SUT["Flat rolling","Flat rolled products"] <- value - # Calculate waste - yield <- WSA_yield$Average[WSA_yield$Process == 'Slab caster yield'] - waste <- (value/yield)-value - SUT["Flat rolling","Forming & fabrication scrap"] <- waste } - - # 2.7 Write long rolling production and forming scrap - data <- read.csv(paste0(path$IE_Processed,"/WSA/WSA_",year,"_LongRolledProducts.csv")) - - if(i %in% data$base) { - value <- data$Quantity[data$base == i] - SUT["Long rolling","Long rolled products"] <- value - # Calculate waste - yield <- WSA_yield$Average[WSA_yield$Process == 'Bloom caster yield'] - waste <- (value/yield)-value - SUT["Long rolling","Forming & fabrication scrap"] <- waste } - - # 2.8 Write production of ingots and subsequently fill the gap of the casting - # process with slabs (because all feeds into flat rolling) - data <- read.csv(paste0(path$IE_Processed,"/WSA/WSA_",year,"_Ingots.csv")) - - if(i %in% data$base) { - value <- data$Quantity[data$base == i] - SUT["Casting of ingots & slabs","Ingots"] <- value - value <- SUT["Flat rolling","Flat rolled products"] - SUT["Casting of ingots & slabs","Ingots"] - SUT["Casting of ingots & slabs","Slabs"] <- value - yield <- WSA_yield$Average[WSA_yield$Process == 'Slab caster yield'] - value <- SUT["Flat rolling","Flat rolled products"] - waste <- (value/yield)-value - SUT["Casting of ingots & slabs","Forming & fabrication scrap"] <- waste } - - # 2.9 For the production value of billets and blooms use the value of long rolling - value <- sum(SUT["Long rolling",c("Long rolled products","Forming & fabrication scrap")]) - SUT["Casting of billets & blooms","Billets & blooms"] <- value - # Estimate scrap flows using yield data - yield <- WSA_yield$Average[WSA_yield$Process == 'Bloom caster yield'] - waste <- (value/yield)-value - SUT["Casting of billets & blooms","Forming & fabrication scrap"] <- waste + SUT["Crude Ore","Mining"] <- crude - # 2.10 Fabrication i.e. manufacturing output - data <- read.csv(paste0(path$IE_Processed,"/EXIOWasteMFAIO/",year,"_FabricationToFinalDemand.csv")) %>% - filter(From.Region == i) %>% select(From.Product,Quantity) %>% group_by(From.Product) %>% - summarise(Quantity = sum(Quantity)) - # Set up index to write values directly into cells - index <- cbind(base$industry$Name[11:20],base$product$Name[13:22]) - SUT[index] <- data$Quantity + # if no ore grades are available for a region, assume 0.6: - # 2.11 Fabrication scarp - data <- read.csv(paste0(path$IE_Processed,"/FabricationScrap/FabricationScrap_",year,".csv")) %>% - filter(base == i) - data <- data.frame("commodity" = as.character(data$commodity), - "Quantity" = data$Quantity, - stringsAsFactors = FALSE) - index <- as.data.frame(index,stringsAsFactors = FALSE) - colnames(index) <- c("Industry","Product") - data <- left_join(index,data,c("Product" = "commodity"),copy = FALSE) - - SUT[data$Industry,"Forming & fabrication scrap"] <- data$Quantity - - # 2.12 Estimate production of scrap steel by summing over "forming and fabrication scrap" - # and EoL scrap supply - - value <- sum(SUT[,"Forming & fabrication scrap"]) + SUT["EOLScrap","Scrap preparation"] - SUT["Scrap preparation","Scrap steel"] <- value - - ############################################################################ - # 3. Filling use table - # IMPORTANT: The allocation follows the logic to source data on exports from the - # BACI data set and subtract this value from the domestic production of the upstream process - # to get an estimate for the domestic inputs of each process. Where this results in negative values - # for domestic use, we assume that inputs are 50% from foreign source - - # 3.1 Steel in final demand - data <- read.csv(paste0(path$IE_Processed,"/EXIOWasteMFAIO/",year,"_SteelInFinalDemand.csv")) %>% - filter(From.Region == i & To.Region == i) - index <- base$product$Name[base$product$Code %in% data$Product] - SUT[index,"FinalConsumption"] <- data$Quantity - - # 3.2.1 Flat Rolled products used in fabrication - item <- "Flat rolled products" - # Load map to allocate to end use (fabrication) - map <- makeEndUseMap(i,"Flat") - map <- map[order(map$index),] - share <- map$Share - ############################################ - # The following command may cause problems # - ############################################ - users <- base$industry$Code[11:20][map$index] - # Load trade data - data <- filter(BACI,Product == base$product$Code[base$product$Name == item]) %>% select(From,To,Quantity) - # Read domestic production - pro <- SUT["Flat rolling","Flat rolled products"] - # Read domestic use - use <- sum(Q["Flat",IO.codes$index[IO.codes$base == i]]) - - # Execute function for estimation script to write values - SUT <- AllocateSupply2Use(SUT,item,share,users,data,pro,use,i) - - # 3.3.2 Long Rolled products used in fabrication - item <- "Long rolled products" - # Load map to allocate to end use (fabrication) - map <- makeEndUseMap(i,"Long") - map <- map[order(map$index),] - share <- map$Share - users <- base$industry$Code[11:20][map$index] - # Load trade data - data <- filter(BACI,Product == base$product$Code[base$product$Name == item]) %>% select(From,To,Quantity) - # Read domestic production - pro <- SUT["Long rolling",item] - # Read domestic use - use <- sum(Q["Long",IO.codes$index[IO.codes$base == i]]) - - # Execute function for estimation script to write values - SUT <- AllocateSupply2Use(SUT,item,share,users,data,pro,use,i) - - # 3.4 Use of forming and fabrication scrap by scrap preparation - SUT["Forming & fabrication scrap","Scrap preparation"] <- sum(SUT[,"Forming & fabrication scrap"]) - - # 3.5 Use of billets and blooms by long rolling - # Load number for exports of billets and blooms - item <- "Billets & blooms" - users <- "Long rolling" - share <- 1 - data <- filter(BACI,Product == base$product$Code[base$product$Name == item]) %>% select(From,To,Quantity) - pro <- SUT["Casting of billets & blooms",item] - use <- sum(SUT[users,]) - - # Execute function for estimation script to write values - SUT <- AllocateSupply2Use(SUT,item,share,users,data,pro,use,i) - - # 3.6 Use of ingots and slabs by flat rolling - # 3.6.1 Ingots - export <- filter(BACI,Product == base$product$Code[base$product$Name == "Ingots"]) %>% - select(From,To,Quantity) %>% filter(From == i) - value <- SUT["Casting of ingots & slabs","Ingots"] - sum(export$Quantity) - # In case value is negative, assume that 5% of inputs is coming from domestic ingots - if(value > 0) {SUT["Ingots","Flat rolling"] <- value} else - {SUT["Ingots","Flat rolling"] <- sum(SUT["Flat rolling",]) * 0.05} - - # 3.6.2 Slabs - export <- filter(BACI,Product == base$product$Code[base$product$Name == "Slabs"]) %>% - select(From,To,Quantity) %>% filter(From == i) - # Domestic production of slabs minus exports = domestic use - value <- SUT["Casting of ingots & slabs","Slabs"] - sum(export$Quantity) - if(value > 0) {SUT["Slabs","Flat rolling"] <- value} else - {SUT["Slabs","Flat rolling"] <- sum(SUT["Flat rolling",]) * 0.45} - - # 3.7 Casting of billets and blooms and casting of ingots and slabs - # The only input to casting is liquid steel which is not a traded commodity, - # The inputs to casting are therefor estimated by using the production/output value - # of the respective furnace - - # Steel from Electric arc furnace - SUT["Liquid steel (EAF)","Casting of billets & blooms"] <- SUT["Electric arc furnace","Liquid steel (EAF)"] - # Fill remaining gap with OBF steel - gap <- sum(SUT["Casting of billets & blooms",]) - SUT["Liquid steel (EAF)","Casting of billets & blooms"] - if(gap > 0) SUT["Liquid steel (OBF/OHF)","Casting of billets & blooms"] <- gap - - # Steel from oxygen blown converter - SUT["Liquid steel (OBF/OHF)","Casting of ingots & slabs"] <- sum(SUT["Casting of ingots & slabs",]) - - # 3.8 Sponge iron used by EAF - export <- filter(BACI,Product == base$product$Code[base$product$Name == "Sponge iron"],From == i) - - if(SUT["Direct reduction","Sponge iron"] != 0) + if(i %in% data$Grade$base) concen <- data$Grade$Concentration[data$Grade$base == i] + + if(!i %in% data$Grade$base) concen <- 0.6 + + # Calculate iron content: + + iron <- crude * concen + + if(concen <= 0.6) ore <- iron / 0.6 # iron ore weight when 60% grade (ready for shipping) + + if(concen > 0.6) ore <- iron / concen # when concentration is > 0.6: not change + + SUT["Mining","Landfill"] <- crude - ore # Waste to landfill (supply-side of mining) + + SUT["Mining","Iron ore"] <- ore # Supply of iron ore (now 60% grade) by mining + } + + + ### Allocate iron ore use to ironmaking ### + + index <- list( "supply" = data.frame("industry" = filter(base$process, Name %in% c("Blast furnace","Direct reduction")) %>% pull(Code), + "product" = num$process + filter(base$flow, Name %in% c("Pig iron","Sponge iron")) %>% pull(Code) + ), + "use" = data.frame("industry" = filter(base$process, Name == "Mining") %>% pull(Code), + "product" = num$process + filter(base$flow, Name == "Iron ore") %>% pull(Code) + ) + ) + + # Read factors for iron ore inputs: + + factor <- filter(Setting$IE, item %in% c("OrePerPigIron","OrePerSpongeIron") ) %>% pull(value) + + # Read primary iron output and estimate total iron ore input with factors: + + TotIn <- SUT[ as.matrix(index$supply) ] * factor + + DomOut <- SUT[as.matrix(index$use)] # Read domestic production of iron ore + + if(DomOut > 0) { - value <- SUT["Direct reduction","Sponge iron"] - sum(export$Quantity) - if(value > 0) {SUT["Sponge iron","Electric arc furnace"] <- value} else - {SUT["Sponge iron","Electric arc furnace"] <- sum(SUT["Direct reduction","Sponge iron"])/2} + # Read export of iron ore: + + export <- filter(data$BACI,From == i,Product %in% (index$use$product-num$process) ) %>% select(Product,Quantity) %>% + group_by(Product) %>% summarise(Quantity = sum(Quantity)) %>% ungroup(Product) %>% pull(Quantity) + + if( length(export) == 0 ) export <- 0 # Check if exports are unavailable and if so set to zero + + Value <- DomOut - export + + if(Value < 0) Value <- DomOut # Set to domestic production if exports too large + + Map <- (TotIn/sum(TotIn)) # Create map + + Map[is.na(Map)] <- 1 # Set 1 if NA + + # Write values into table using map: + + SUT[index$use$product,index$supply$industry] <- Map * Value + } - # 3.9 Allocating iron ores used by direct reduction - SUT["Iron ore","Direct reduction"] <- sum(SUT["Direct reduction",]) + ### Add forming and scrap use by steelmaking ### + + steel <- data.frame("ind" = filter(base$process, Name %in% c("Basic oxygen converter","Electric arc furnace")) %>% pull(Code), + "pro" = num$process + filter(base$flow, Name %in% paste("Liquid steel",c("OBF","EAF"))) %>% pull(Code) + ) + + # Read scrap per unit output factors: + + factor <- filter(Setting$IE, item %in% c("ScrapPerBOFsteel","ScrapPerEAFsteel") ) %>% pull(value) + + # Create map from output values: + + Map <- ( SUT[as.matrix(steel)] * factor ) / sum(SUT[as.matrix(steel)] * factor) + + Map[is.na(Map)] <- 0 + + # Multiply with forming scrap supply and write in table + + SUT["Forming scrap",steel$ind] <- Map * sum(SUT[,"Forming scrap"]) + + - # 3.10 Allocate iron ores used by Blast furnace - export <- filter(BACI,Product == base$product$Code[base$product$Name == "Iron ore"],From == i) - value <- SUT["Mining","Iron ore"] - sum(export$Quantity) - if(value > 0) {SUT["Iron ore","Blast furnace"] <- value} else - {SUT["Iron ore","Blast furnace"] <- sum(SUT["Blast furnace",])/2} + ### Write fabrication scrap use of waste management (scrap preparation) ### - # 3.10.1 - # Allocate other inputs used by blast furnace - if(SUT["Blast furnace","Pig iron"] > 0) + SUT["Fabrication scrap","Scrap preparation"] <- sum(SUT[,"Fabrication scrap"]) + + + ### Write steel scrap output in supply table ### + + SUT["Scrap preparation","Steel scrap"] <- sum(SUT[,"Scrap preparation"]) + + + ### Write steel scrap use by steelmaking ### + + # Read exports of steel scrap: + + index <- list("industry" = filter(base$process, Name %in% c("Basic oxygen converter","Electric arc furnace")) %>% pull(Code), + "product" = num$process + filter(base$flow, Name == "Steel scrap") %>% pull(Code) + ) + + DomOut <- SUT["Scrap preparation","Steel scrap"] # Read domestic production of steel scrap + + export <- filter(data$BACI,From == i,Product %in% (index$product-num$process) ) %>% select(Product,Quantity) %>% + group_by(Product) %>% summarise(Quantity = sum(Quantity)) %>% ungroup(Product) %>% pull(Quantity) + + + + if(length(export) >= 1) { - pro <- SUT["Blast furnace","Pig iron"] - # Limestone and fluxes assuming 300 kg per ton of pig iron - SUT["Limestone","Blast furnace"] <- pro *0.3 - # 600 kg coke or coal per ton pig iron - SUT["Coke","Blast furnace"] <- pro * 0.6 - # (Hot) air of approx. 800 kg per ton - SUT["Air","Blast furnace"] <- pro * 0.8 + Value <- DomOut - export } - # 3.11 Allocating pig iron to BOF - export <- filter(BACI,Product == base$product$Code[base$product$Name == "Pig iron"],From == i) - value <- SUT["Blast furnace","Pig iron"] - sum(export$Quantity) - if(value > 0) {SUT["Pig iron","Oxygen blown & open hearth furnace"] <- value} else - {SUT["Pig iron","Oxygen blown & open hearth furnace"] <- sum(SUT["Oxygen blown & open hearth furnace",])*0.4} + if( length(export) == 0 ) # Check if exports are unavailable and if so set to zero + { + Value <- DomOut + } + + if(Value < 0) Value <- DomOut # Check if exports are larger + + SUT[index$product,index$industry] <- Map * Value # Write into table + + + ### Allocate pig and sponge iron to steelmaking ### + + index <- list("industry" = filter(base$process, Name %in% c("Basic oxygen converter","Open hearth furnace","Electric arc furnace")) %>% pull(Code), + "product" = filter(base$flow, Name %in% c("Pig iron","Sponge iron") ) %>% pull(Code) + ) - # 3.12 Allocate Scrap steel to BOF and EAF - SUT["Scrap steel","Oxygen blown & open hearth furnace"] <- sum(SUT["Oxygen blown & open hearth furnace",])*0.15 - SUT["Scrap steel","Electric arc furnace"] <- sum(SUT["Electric arc furnace",]) - SUT["Direct reduction","Electric arc furnace"] + steel <- data.frame("ind" = filter(base$process, Name %in% c("Basic oxygen converter","Open hearth furnace","Electric arc furnace")) %>% pull(Code), + "pro" = num$process + filter(base$flow, Name %in% paste("Liquid steel",c("OBF","OHF","EAF"))) %>% pull(Code) + ) + + iron <- data.frame("ind" = filter(base$process, Name %in% c("Blast furnace","Direct reduction") ) %>% pull(Code), + "pro" = num$process + filter(base$flow, Name %in% c("Pig iron","Sponge iron") ) %>% pull(Code) + ) + + # Estimate steel and iron outputs: + + DomOut <- list("steel" = SUT[as.matrix(steel)], + "iron" = SUT[as.matrix(iron)] + ) + + # Read export of pig iron and sponge iron: + + export <- filter(data$BACI,From == i,Product %in% (iron$pro - num$process) ) %>% select(Product,Quantity) %>% + group_by(Product) %>% summarise(Quantity = sum(Quantity)) %>% ungroup(Product) + + offset <- min(iron$pro - num$process)-1 + + if(length(export) >= 1) + { + Value <- DomOut$iron + Value[export$Product-offset] <- DomOut$iron[export$Product-offset] - export$Quantity + } + + # Check if exports are unavailable and if so set to zero: + + if( length(export) == 0 ) + { + Value <- DomOut$iron + } + + for(j in 1:length(Value)) if(Value[j] < 0) Value[j] <- DomOut$iron[j] + + factor <- filter(Setting$IE, item %in% c("PigIronPerBOFsteel","SpongeIronPerEAFsteel") ) %>% pull(value) + + Map <- SUT_temp$Use[index$pro,index$ind] # Create map for allocation + + Demand <- DomOut$steel * c( factor[1],1,factor[2] ) # Estimate iron demand + + Map <- Prorate(Map,Demand) # prorate the map + + Value <- Map * Value # Allocate values with map to use + + SUT[(index$pro + num$process), index$industry] <- Value # Write value in table + + + ### Save SUT ### - # 4. Save SUT # Check if subfolder in processed data exists and if not create it + path_set <- paste0(path$IE_Processed,"/SUT") + if(!dir.exists(path_set)) dir.create(path_set) + # Setting decimals to two digits + SUT <- round(SUT,2) + print(min(SUT)) + # Decompose SUT into single elements, that is supply, use, final demand, inputs from nature and eol scrap - Use <- SUT[base$product$Name,base$industry$Name] - Supply <- SUT[base$industry$Name,base$product$Name] - # What is final demand in monetary IO is called hereafter boundary output - BoundaryOutput <- SUT[c(base$industry$Name,base$product$Name),c("FinalConsumption","Landfill","Atmosphere")] - # What is value added in monetary IO is called hereafter boundary input - pi <- c("FerrousMinerals","EOLScrap","Air","Limestone","Coke") - BoundaryInput <- matrix(SUT[pi,base$industry$Name],length(pi),nrow(base$industry)) + Use <- SUT[base$flow$Name,base$process$Name] + + Supply <- SUT[base$process$Name,base$flow$Name] + + # Final output (= final demand + landfill + atmosphere): + + FinalOutput <- SUT[base$process$Name,base$demand$Name] + + # Primary inputs: + + PrimaryInput <- SUT[base$input$Name,base$process$Name] + + # Remove all column and row names: - # Remove all column and row names colnames(Use) <- NULL rownames(Use) <- NULL colnames(Supply) <- NULL rownames(Supply) <- NULL - colnames(BoundaryOutput) <- NULL - rownames(BoundaryOutput) <- NULL - colnames(BoundaryInput) <- NULL - rownames(BoundaryInput) <- NULL - - # Write Supply, Use, In- and Output to root folder, note that because write.csv will always export colnames - # had to use the write.tabel function. - - write.table(Supply,file = paste0(path_set,"/",year,"_DomesticSupply_Region",i,".csv"), - col.names = FALSE, - row.names = FALSE, - sep = ",") - - write.table(Use,file = paste0(path_set,"/",year,"_DomesticUse_Region",i,".csv"), - col.names = FALSE, - row.names = FALSE, - sep = ",") - - write.table(BoundaryOutput,file = paste0(path_set,"/",year,"_BoundaryOutput_Region",i,".csv"), - col.names = FALSE, - row.names = FALSE, - sep = ",") - - write.table(BoundaryInput,file = paste0(path_set,"/",year,"_BoundaryInput_Region",i,".csv"), - col.names = FALSE, - row.names = FALSE, - sep = ",") + colnames(FinalOutput) <- NULL + rownames(FinalOutput) <- NULL + colnames(PrimaryInput) <- NULL + rownames(PrimaryInput) <- NULL + + # Write tables to folder: + + Numbers2File(Supply, paste0(path_set,"/",year,"_Supply_Region",i,".csv") ) + Numbers2File(Use, paste0(path_set,"/",year,"_Use_Region",i,".csv") ) + Numbers2File(FinalOutput, paste0(path_set,"/",year,"_FinalOutput_Region",i,".csv") ) + Numbers2File(PrimaryInput, paste0(path_set,"/",year,"_PrimaryInput_Region",i,".csv") ) print(paste0("Minimum value: ",min(SUT))) } - print("IEDataProcessing_PIOLab_BuildingDomesticTables finished.") } diff --git a/Rscripts/IEfeeds_code/IE_subroutines/IEDataProcessing_PIOLab_BuildingTradeBlocks.R b/Rscripts/IEfeeds_code/IE_subroutines/IEDataProcessing_PIOLab_BuildingTradeBlocks.R index b8f98a8..493114f 100644 --- a/Rscripts/IEfeeds_code/IE_subroutines/IEDataProcessing_PIOLab_BuildingTradeBlocks.R +++ b/Rscripts/IEfeeds_code/IE_subroutines/IEDataProcessing_PIOLab_BuildingTradeBlocks.R @@ -9,30 +9,20 @@ IEDataProcessing_PIOLab_BuildingTradeBlocks <- function(year,path) { print("IEDataProcessing_PIOLab_BuildingTradeBlocks initiated.") - path[["IE_classification"]] <- paste0(path$Concordance,"/LabelsAndCodes/",IEdatafeed_name,"_BaseSectorClassification.xlsx") + path[["IE_classification"]] <- paste0(path$Settings,"/Base/",IEdatafeed_name,"_BaseSectorClassification.xlsx") - # Define general variables: - - # num <- list("pro" = nrow(base$product), - # "ind" = nrow(base$industry), - # "reg" = nrow(base$region), - # "va" = nrow(base$input), - # "fd" = nrow(base$demand) ) - # Load WSA settings (for codes and feed names): - Settings <- read.xlsx(paste0(path$Settings,"/datafeeds_settings/WSA_settings.xlsx")) # Load prorating function and Number2File: source(paste0(path$Subroutines,"/Prorate.R")) - source(paste0(path$Subroutines,"/Numbers2File.R")) - Setting <- list( "WSA" = read.xlsx(xlsxFile = paste0(path$Settings,"/datafeeds_settings/WSA_settings.xlsx"), sheet = 1 ), - "IE" = read.xlsx(xlsxFile = paste0(path$Settings,"/datafeeds_settings/IE_settings.xlsx"), sheet = 1 ) - ) + # Setting <- list( "WSA" = read.xlsx(xlsxFile = paste0(path$Settings,"/datafeeds_settings/WSA_settings.xlsx"), sheet = 1 ), + # "IE" = read.xlsx(xlsxFile = paste0(path$Settings,"/datafeeds_settings/IE_settings.xlsx"), sheet = 1 ) + # ) # Load flow data where all regions are included in one object: @@ -59,12 +49,12 @@ IEDataProcessing_PIOLab_BuildingTradeBlocks <- function(year,path) # Run syntax to load Source2Root maps: - set <- read.xlsx(xlsxFile = paste0(path$Settings,"/datafeeds_settings/WSA_settings.xlsx"),sheet = 2) + set <- read.xlsx(xlsxFile = paste0(path$Settings,"/Base/IE_settings.xlsx"),sheet = 2) path_sel <- list("flow" = paste0(path$Concordance,"/WSA/", - set$date[set$aggregator == "product"],"_WSA_Source2Root_Product.csv"), + set$date[set$aggregator == "sector"],"_WSA_Source2Root_Product.csv"), "process" = paste0(path$Concordance,"/WSA/", - set$date[set$aggregator == "industry"],"_WSA_Source2Root_Industry.csv") + set$date[set$aggregator == "sector"],"_WSA_Source2Root_Industry.csv") ) Source2Root <- list("WSA" = as.matrix( read.csv(path_sel$flow,header = FALSE) )) @@ -274,5 +264,4 @@ IEDataProcessing_PIOLab_BuildingTradeBlocks <- function(year,path) } } - print("End of IEDataProcessing_PIOLab_BuildingTradeBlocks.") } diff --git a/Rscripts/IEfeeds_code/IE_subroutines/IEDataProcessing_PIOLab_WasteMFAIOExtension.R b/Rscripts/IEfeeds_code/IE_subroutines/IEDataProcessing_PIOLab_WasteMFAIOExtension.R index de6c7c4..fc989df 100644 --- a/Rscripts/IEfeeds_code/IE_subroutines/IEDataProcessing_PIOLab_WasteMFAIOExtension.R +++ b/Rscripts/IEfeeds_code/IE_subroutines/IEDataProcessing_PIOLab_WasteMFAIOExtension.R @@ -10,140 +10,276 @@ IEDataProcessing_PIOLab_WasteMFAIOExtension <- function(year,path) { + print("IEDataProcessing_PIOLab_WasteMFAIOExtension initiated.") - ############################################################################# + + + # Load sector codes of aggregated EXIOBASE data + + IO.codes <- read.csv(file = paste0(path$IE_Processed,"/EXIOWasteMFAIO/IO_codes.csv"), + row.names = NULL) + + # Load variables and calculate gross output (x): - # Load IO codes of aggregated EXIOBASE data - load(paste0(path$IE_Processed,"/EXIOWasteMFAIO/IO.codes.RData")) + L <- as.matrix( read.csv(paste0(path$IE_Processed,"/EXIOWasteMFAIO/",year,"_L.csv"), + row.names = NULL, + header = FALSE) + ) + + Y <- as.matrix( read.csv(paste0(path$IE_Processed,"/EXIOWasteMFAIO/",year,"_Y.csv"), + row.names = NULL, + header = FALSE) + ) + + x <- rowSums( L %*% Y ) # Calculate total output and create vector + + source(paste0(path$Subroutines,"/Numbers2File.R")) # Load fun. to write arrays to files - # Load function to create allocation map - source(paste0(path$Subroutines,"/makeEndUseMap.R")) # 1. Defining functions - # aggregation function - Agg <- function(x) - { - x <- as.matrix(x) %*% sapply(unique(colnames(x)),"==",colnames(x)) - return(x) - } + # Load WSA settings (for codes and feed names): + + Settings <- read.xlsx(paste0(path$Settings,"/datafeeds_settings/WSA_settings.xlsx")) + + + # Select codes for finished steel: + + Code <- list("base" = list("Finished" = filter(base$flow,Type == 'Finished') %>% pull(Code), + "Final" = filter(base$flow,Type == 'Final') %>% pull(Code), + "Forgings" = base$flow$Code[base$flow$Name == 'Forgings'], + "CoilSheetStrip" = base$flow$Code[base$flow$Name == "Hot rolled coil-sheet-strip"]), + "WSA" = Settings %>% filter(Type == 'Finished') %>% pull(id) ) + + + # Run syntax to load Source2Root maps: + + set <- read.xlsx(xlsxFile = paste0(path$Settings,"/Base/IE_settings.xlsx"),sheet = 2) + + paste0(path$Concordance,"/WSA/",set$date[set$aggregator == "sector"],"_WSA_Source2Root_Product.csv") + + path_sel <- list("flow" = paste0(path$Concordance,"/WSA/", + set$date[set$aggregator == "sector"],"_WSA_Source2Root_Product.csv"), + "process" = paste0(path$Concordance,"/WSA/", + set$date[set$aggregator == "sector"],"_WSA_Source2Root_Industry.csv") + ) + + Source2Root <-list("WSA" = as.matrix( read.csv(path_sel$flow,header = FALSE) )) + + Source2Root$WSA <- Source2Root$WSA[Code$WSA,] # Select only finished steel + + Source2Root$WSA <- Source2Root$WSA / rowSums(Source2Root$WSA) # Create map (normalized concordance) + + Source2Root[["Cullen"]] <- list("Product" = as.matrix( read.csv(paste0(path$Concordance,"/Cullen/Cullen_Source2Root_Product.csv"),header = FALSE) ), + "EndUse" = as.matrix( read.csv(paste0(path$Concordance,"/Cullen/Cullen_Source2Root_EndUse.csv"),header = FALSE) )) + + # Compile Source to mother concordance for finished steel products + + Source2Mother <- list("WSA" = Source2Root$WSA %*% as.matrix(R2M$flow[,Code$base$Finished]) ) + + # Load WSA Source2Source map for estimate final use of hot rolled coil-sheet-strip + + Source2Source <- list("WSA" = as.matrix(read.csv(paste0(path$Concordance,"/WSA/WSA_Source2Source.csv"),header = FALSE)) ) + + Source2Source$WSA <- Source2Source$WSA[Code$WSA,Code$WSA] + + + # Create map to allocate mother to source: + + Mother2Source_Map <- list("WSA" = t(Source2Mother$WSA) / colSums(Source2Mother$WSA) ) + + Mother2Source_Map$WSA[is.na(Mother2Source_Map$WSA)] <- 0 # Because forgings is not form WSA, set NA to 0 + + # Create mother2mother concordance = parent to child processes + + Mother2Mother <- list("WSA" = Mother2Source_Map$WSA %*% Source2Source$WSA %*% Source2Mother$WSA ) + + colnames(Mother2Mother$WSA) <- rownames(Mother2Mother$WSA) <- Code$base$Finished + + + # Load products to end-use map from Cullen et al 2012 + + Products2EndUse <- read.csv(paste0(path$IE_Processed,"/Cullen/ProductsToEndUse.csv")) + + rownames(Products2EndUse) <- Products2EndUse$X # Write products names to row names + + Products2EndUse$X <- NULL # Delete product name column + + Products2EndUse <- as.matrix(Products2EndUse) + + # Create Source to Root and Source to mother maps: + + Source2Root_Map <- list("Cullen" = list("EndUse" = (Source2Root$Cullen$EndUse / rowSums(Source2Root$Cullen$EndUse) ), + "Product" = (Source2Root$Cullen$Product / rowSums(Source2Root$Cullen$Product) ) + ) + ) + + Source2Mother[["Cullen"]] <- list("EndUse" = Source2Root_Map$Cullen$EndUse %*% as.matrix(R2M$flow[,Code$base$Final]), + "Product" = Source2Root_Map$Cullen$Product %*% as.matrix(R2M$flow[,Code$base$Finished]) + ) + + Source2Mother$Cullen$Yields <- Source2Mother$Cullen$EndUse # Add concordance for yields + + Source2Mother$Cullen$Yields[Source2Mother$Cullen$Yields > 0] <- 1 # Set shares to 1 for yields + + + # Add mother sector names to maps: + + colnames(Source2Mother$Cullen$EndUse) <- base$product$Name[Code$base$Final] + + colnames(Source2Mother$Cullen$Product) <- base$product$Name[Code$base$Finished] + + # Translate product to end-use map to base classification of mother table: + + Products2EndUse <- t(Source2Mother$Cullen$Product) %*% Products2EndUse %*% Source2Mother$Cullen$EndUse + + rownames(Products2EndUse) <- Code$base$Finished + + # Load Yield data from Cullen et al.: + + Yields <- read.csv(paste0(path$IE_Processed,"/Cullen/FabricationYields.csv")) + + Yields <- Yields[Yields$Yield.Sector != "All products",] # Remove average yield + + Yields <- Source2Mother$Cullen$Yields * Yields$Yield.Factor # Distribute yields to base sectors + + Yields <- apply(Yields, 2, function(x) max(x, na.rm = TRUE)) # Select largest yields available + + + # Load BACI trade data: + + BACI <- read.csv(paste0(path$IE_Processed,"/BACI/BACI_",year,".csv")) + + + # Create two empty arrays for steel for the extension (Q) and for the fabrication total use (R) + + Q <- R <- as.data.frame(matrix(0,length(Code$base$Finished),nrow(IO.codes))) + + rownames(Q) <- rownames(R) <- base$flow$Name[Code$base$Finished] - # Writing values of rolled products into arrays (extension and fabrication scrap) - WriteValues2Array <- function(data,name,Q,Scrap) + + # Loop over base regions: + + for(r in base$region$Code) { - for(i in 1:nrow(data)) + + map <- Source2Mother$WSA # Create Map for base region and finished steel + + colnames(map) <- Code$base$Finished + + # Loop over finished steel data feeds: + + for(p in 1:length(Code$WSA)) { - #print(i) - reg <- data$base[i] - - # call function to create specific map - map <- makeEndUseMap(reg,name) - - map <- map %>% mutate(Value = Share * data$Quantity[data$base == reg]) %>% - select(index,IO,Yield.Sector,Value) - map <- left_join(map,Yields,c("Yield.Sector"),copy = FALSE) %>% mutate(EndUse = Value*Yield.Factor,Scrap = Value - EndUse) %>% - select(index,IO,EndUse,Scrap) + data <- read.csv(paste0(path$IE_Processed,"/WSA/WSA_",year,"_",Settings$FeedName[Code$WSA[p]],".csv")) - index <- map$index+((reg-1)*10) + vec <- rep(1,nrow(map)) # create empty vector - if(name == "Flat") + if(r %in% data$base) # Check if region exists in production account { - Q[1,index] <<- map$EndUse - Scrap[1,index] <<- map$Scrap - }else - { - Q[2,index] <<- map$EndUse - Scrap[2,index] <<- map$Scrap + vec[p] <- filter(data,base == r) %>% pull(Quantity) # Write value in vector } + + map <- map * vec # Add value to map + } - } - - # Load processed data from Cullen et al 2012 - Yields <- read.csv(paste0(path$IE_Processed,"/Cullen/FabricationYields.csv")) - - ############################################################################## - # 1. The first section calculates the net use of rolled steel products in regions - # by adding imports and subtracting exports from the WSA production values - - BACI <- read.csv(paste0(path$IE_Processed,"/BACI/BACI_",year,".csv")) # Load trade data - - # Load finished steel production - Flat <- read.csv(paste0(path$IE_Processed,"/WSA/WSA_",year,"_FlatRolledProducts.csv")) - Long <- read.csv(paste0(path$IE_Processed,"/WSA/WSA_",year,"_LongRolledProducts.csv")) + # Load forging production + data <- read.csv(paste0(path$IE_Processed,"/AligningData/Forgings_",year,".csv")) + + if(r %in% data$base) # Check if region exists in production account + { + value <- filter(data,base == r) %>% pull(Quantity) + } + + map <- rbind(map,0) # Add empty row + + map[nrow(map),colnames(map) == Code$base$Forgings] <- value + + # Aggregate across sources and transform in data table: + + df <- data.frame("Code" = Code$base$Finished, + "Production" = colSums(map), + "Import" = 0, + "Export" = 0, + "Use" = 0) + + # Read and aggregate exports and imports across trade partners: + + BACI_export <- filter(BACI,From == r) %>% select(Product,Quantity) %>% + group_by(Product) %>% summarise(Quantity = sum(Quantity)) %>% + ungroup(Product) %>% filter(Product %in% Code$base$Finished) + + BACI_import <- filter(BACI,To == r) %>% select(Product,Quantity) %>% + group_by(Product) %>% summarise(Quantity = sum(Quantity)) %>% + ungroup(Product) %>% filter(Product %in% Code$base$Finished) + + + # Write trade flows into data frame and estimate domestic use: + + df$Import[df$Code %in% BACI_import$Product] <- BACI_import$Quantity + + df$Export[df$Code %in% BACI_export$Product] <- BACI_export$Quantity + + df$Use <- df$Production + df$Import - df$Export + - - - Flat_trade <- BACI %>% filter(Product == base$product$Code[base$product$Name == "Flat rolled products"]) %>% - select(From,To,Quantity) - - Long_trade <- BACI %>% filter(Product == base$product$Code[base$product$Name == "Long rolled products"]) %>% - select(From,To,Quantity) - - # Estimate the net-use of products in countries - Flat_import <- Flat_trade %>% group_by(To) %>% summarise(Quantity = sum(Quantity)) - Flat_export <- Flat_trade %>% group_by(From) %>% summarise(Quantity = sum(Quantity)) - Flat_trade <- full_join(Flat_import,Flat_export,c("To" = "From"),copy = FALSE) - colnames(Flat_trade) <- c("base","import","export") - # Regional production + imports - exports = net-use - Flat <- full_join(Flat,Flat_trade,c("base"),copy = FALSE) - Flat[is.na(Flat)] <- 0 - - Flat <- Flat %>% mutate(NetUse = Quantity + import - export) - - ##################################### - # When negatives: set net use to import value - Flat$NetUse[Flat$NetUse < 0] <- Flat$import[Flat$NetUse < 0] - Flat <- Flat %>% select(base,NetUse) - colnames(Flat)[2] <- "Quantity" - ##################################### - - Long_import <- Long_trade %>% group_by(To) %>% summarise(Quantity = sum(Quantity)) - Long_export <- Long_trade %>% group_by(From) %>% summarise(Quantity = sum(Quantity)) - Long_trade <- full_join(Long_import,Long_export,c("To" = "From"),copy = FALSE) - colnames(Long_trade) <- c("base","import","export") - # Regional production + imports - exports = net-use - Long <- full_join(Long,Long_trade,c("base"),copy = FALSE) - Long[is.na(Long)] <- 0 - - Long <- Long %>% mutate(NetUse = Quantity + import - export) - ##################################### - # When negatives: set net use to import value - Long$NetUse[Long$NetUse < 0] <- Long$import[Long$NetUse < 0] - ##################################### - Long <- Long %>% select(base,NetUse) - colnames(Long)[2] <- "Quantity" - - ############################################################################## - # 3. Start processing - - # Create two empty arrays for steel for the extension (Q) and for the fabrication scrap - Scrap <- Q <- as.data.frame(matrix(0,2,nrow(IO.codes))) - rownames(Scrap) <- rownames(Q) <- c("Flat","Long") - - # Execute functions - # Warnings are turned of for the run. - options(warn = -1) - WriteValues2Array(Flat,"Flat",Q,Scrap) - WriteValues2Array(Long,"Long",Q,Scrap) - options(warn = 0) + # Subtract production values of cold rolled products from hot rolled coil-sheet-strip + + Subtract <- sum(Mother2Mother$WSA[rownames(Mother2Mother$WSA) == Code$base$CoilSheetStrip,] * df$Production) + + df$Use[df$Code == Code$base$CoilSheetStrip] <- df$Use[df$Code == Code$base$CoilSheetStrip] - Subtract + + print("minimum values before adjustment to domestic production:") + print(df[df$Use < 0,]) + + df$Use[df$Use < 0] <- df$Production[df$Use < 0] # Set use to production where negative + + + print(paste0("Minimum of ",base$region$Name[r],": ",min(df$Use))) # Check min. + + + x_filter <- diag(x[IO.codes$index[IO.codes$base == r]]) # Read production of region r + + x_filter[x_filter > 0] <- 1 # Set non-zero values to 1 for filtering + + map <- Products2EndUse %*% x_filter # Apply filter + + colnames(map) <- IO.codes$commodity[IO.codes$base == r] + - # Save extension of the MFA-Waste-IO Model - save(Q,file = paste0(path$IE_Processed,"/EXIOWasteMFAIO/",year,"_Q.RData")) - - # Prepate fabrication scrap data for export - Scrap <- colSums(Scrap) - Scrap <- data.frame(IO.codes, - "Quantity" = Scrap, - stringsAsFactors = FALSE) + map[rownames(map) == Code$base$Forgings, c(1,2,7,8)] <- 1 # Add forgings (no information) + + map <- ( map / rowSums(map) ) * df$Use # Create map and add material use + + Scrap <- colSums(map) * (1-Yields) # Estimate scrap flows + + # Write into data frame with base industry codes + + Scrap <- data.frame("base" = base$process$Code[base$process$Type == "Final"], + "Quantity" = Scrap) + + rownames(Scrap) <- NULL + + # Write Scrap data to folder + + write.csv(Scrap,file = paste0(path$IE_Processed,"/Cullen/FabricationScrap_", + year,"_",base$region$Name[r],".csv"),row.names = FALSE) + + # Write fabrication-use data to folder + + Numbers2File(map,paste0(path$IE_Processed,"/Cullen/FabricationUse_",year, + "_",base$region$Name[r],".csv")) + + map <- map %*% diag(Yields) # Estimate useful output + + Q[,IO.codes$index[IO.codes$base == r]] <- map # Write values into extension + + } - # Check if subfolder in processed data exists and if not create it - path_set <- paste0(path$IE_Processed,"/FabricationScrap") - if(!dir.exists(path_set)) dir.create(path_set) - # Write to folder - write.csv(Scrap,file = paste0(path_set,"/FabricationScrap_",year,".csv"),row.names = FALSE) + # Save extension of the MFA-Waste-IO Model - print("IEDataProcessing_PIOLab_WasteMFAIOExtension finished.") + Numbers2File( Q, paste0(path$IE_Processed,"/EXIOWasteMFAIO/",year,"_Q.csv") ) } \ No newline at end of file diff --git a/Rscripts/IEfeeds_code/IE_subroutines/IEDataProcessing_PIOLab_WasteMFAIOModelRun.R b/Rscripts/IEfeeds_code/IE_subroutines/IEDataProcessing_PIOLab_WasteMFAIOModelRun.R index 85ec43c..7a37a63 100644 --- a/Rscripts/IEfeeds_code/IE_subroutines/IEDataProcessing_PIOLab_WasteMFAIOModelRun.R +++ b/Rscripts/IEfeeds_code/IE_subroutines/IEDataProcessing_PIOLab_WasteMFAIOModelRun.R @@ -6,10 +6,10 @@ # # ######################################### -IEDataProcessing_PIOLab_WasteMFAIOModelRunV2 <- function(year,path) +IEDataProcessing_PIOLab_WasteMFAIOModelRun <- function(year,path) { - print("IEDataProcessing_PIOLab_WasteMFAIOModelRunV2 initiated.") + print("IEDataProcessing_PIOLab_WasteMFAIOModelRun initiated.") # Load codes and indices of model: @@ -20,7 +20,7 @@ IEDataProcessing_PIOLab_WasteMFAIOModelRunV2 <- function(year,path) Y.codes <- read.csv( paste0(path$IE_Processed,"/EXIOWasteMFAIO/Y_codes.csv")) - Y.codes["Key"] <- paste0(Y.codes$base,"-",Y.codes$sector) + Y.codes["Key"] <- paste0(Y.codes$base,"-",Y.codes$demand) # Load model variables: @@ -36,13 +36,13 @@ IEDataProcessing_PIOLab_WasteMFAIOModelRunV2 <- function(year,path) x <- rowSums( L %*% Y ) # Calculate gross output - # Calculate multipliers - E <- colSums(Q)/x + + E <- colSums(Q)/x # Calculate direct intensity E[is.na(E)] <- 0 - MP <- L*E + MP <- L*E # Calculate material mulitplier # 1. Estimate flows from fabrication to final product @@ -79,9 +79,9 @@ IEDataProcessing_PIOLab_WasteMFAIOModelRunV2 <- function(year,path) # Set col and row names: - colnames(FP) <- paste0(Y.codes$base,"-",Y.codes$demand) + colnames(FP) <- Y.codes$Key - rownames(FP) <- paste0(IO.codes$base,"-",IO.codes$sector) + rownames(FP) <- IO.codes$Key FP[1:nrow(Y),1:ncol(Y)] <- 0 # Set values to zero @@ -105,37 +105,22 @@ IEDataProcessing_PIOLab_WasteMFAIOModelRunV2 <- function(year,path) copy = FALSE, suffix = c(".from",".to") ) - FP <- left_join( x = FP, y = select(IO.codes,base,sector,Key), + FP <- left_join( x = FP, y = select(Y.codes,base,demand,Key), by = c("To" = "Key"), copy = FALSE, suffix = c(".from",".to") ) - Fabrication2Final <- select(FP,-From,-To) # Remove key (not needed anymore) - - - - - colSums(SteelInFinalDemand)/1000000 + FinalDemand <- select(FP,-From,-To) # Remove key (not needed anymore) + # 4. Save results to folder - sum(SteelInFinalDemand) + write.csv(Fabrication2Final, + file = paste0(path$IE_Processed,"/EXIOWasteMFAIO/",year,"_Fabrication2FinalDemand.csv"), + row.names = FALSE) - SteelInFinalDemand <- tibble::rownames_to_column(SteelInFinalDemand, "Key") - SteelInFinalDemand <- melt(SteelInFinalDemand,id.vars = "Key") - colnames(SteelInFinalDemand) <- c("Key","To.Region","Quantity") - # Warning messages are turned off for the following join - options(warn = -1) - SteelInFinalDemand <- left_join(SteelInFinalDemand,IO.codes,c("Key"),copy = FALSE) %>% - select(base,To.Region,commodity,Quantity) - options(warn = 0) - colnames(SteelInFinalDemand)[c(1,3)] <- c("From.Region","Commodity") - SteelInFinalDemand <- left_join(SteelInFinalDemand,base$product,c("Commodity" = "Name"),copy = FALSE) %>% - select(From.Region,To.Region,Code,Quantity) - colnames(SteelInFinalDemand)[3] <- "Product" + write.csv(FinalDemand, + file = paste0(path$IE_Processed,"/EXIOWasteMFAIO/",year,"_FinalDemand.csv"), + row.names = FALSE) - # 4. Save results to folder - write.csv(FabricationToFinal,file = paste0(path$IE_Processed,"/EXIOWasteMFAIO/",year,"_FabricationToFinalDemand.csv"),row.names = FALSE) - write.csv(SteelInFinalDemand,file = paste0(path$IE_Processed,"/EXIOWasteMFAIO/",year,"_SteelInFinalDemand.csv"),row.names = FALSE) - print("DataProcessing_PIOLab_WasteMFAIOModelRun finished.") } \ No newline at end of file diff --git a/Rscripts/IEfeeds_code/IE_subroutines/IEFeed_PIOLab_BACI.R b/Rscripts/IEfeeds_code/IE_subroutines/IEFeed_PIOLab_BACI.R index 0e9f2e5..d6e0b95 100644 --- a/Rscripts/IEfeeds_code/IE_subroutines/IEFeed_PIOLab_BACI.R +++ b/Rscripts/IEfeeds_code/IE_subroutines/IEFeed_PIOLab_BACI.R @@ -36,8 +36,7 @@ IEFeed_PIOLab_BACI <- function(year,path) write.csv(data_clean,file = paste0(path_set,"BACI_",year,".csv"),row.names = FALSE) # Note that trade flows are measured in metric tons of material - - print("IEFeed_PIOLab_BACI finished.") + } diff --git a/Rscripts/IEfeeds_code/IE_subroutines/IEFeed_PIOLab_Cullen.R b/Rscripts/IEfeeds_code/IE_subroutines/IEFeed_PIOLab_Cullen.R index 401397a..5584ed7 100644 --- a/Rscripts/IEfeeds_code/IE_subroutines/IEFeed_PIOLab_Cullen.R +++ b/Rscripts/IEfeeds_code/IE_subroutines/IEFeed_PIOLab_Cullen.R @@ -80,6 +80,4 @@ IEFeed_PIOLab_Cullen <- function(path) # Write to file write.csv(Conco,file = paste0(path_set,"/ProductsToEndUse.csv")) - - print("IEFeed_PIOLab_Cullen finished.") } \ No newline at end of file diff --git a/Rscripts/IEfeeds_code/IE_subroutines/IEFeed_PIOLab_EOL.R b/Rscripts/IEfeeds_code/IE_subroutines/IEFeed_PIOLab_EOL.R index 86d389d..8445905 100644 --- a/Rscripts/IEfeeds_code/IE_subroutines/IEFeed_PIOLab_EOL.R +++ b/Rscripts/IEfeeds_code/IE_subroutines/IEFeed_PIOLab_EOL.R @@ -35,9 +35,6 @@ IEFeed_PIOLab_EOL <- function(year,path) write.csv(data_clean, file = paste0(path_set,"/EOL_",year,".csv"), row.names = FALSE) - - print("IEFeed_PIOLab_EOL finished.") - } diff --git a/Rscripts/IEfeeds_code/IE_subroutines/IEFeed_PIOLab_EXIOWasteMFAIO.R b/Rscripts/IEfeeds_code/IE_subroutines/IEFeed_PIOLab_EXIOWasteMFAIO.R index baf9954..b9df14b 100644 --- a/Rscripts/IEfeeds_code/IE_subroutines/IEFeed_PIOLab_EXIOWasteMFAIO.R +++ b/Rscripts/IEfeeds_code/IE_subroutines/IEFeed_PIOLab_EXIOWasteMFAIO.R @@ -9,138 +9,263 @@ IEFeed_PIOLab_EXIOWasteMFAIO <- function(year,path) { + print("IEFeed_PIOLab_EXIOWasteMFAIO initiated.") - # Function for aggregating the IOT - Agg <- function(x) - { - x <- as.matrix(x) %*% sapply(unique(colnames(x)),"==",colnames(x)) - return(x) - } - - # 1. Loading the original EXIOBASE 3.6 variables - # Transaction matrix: - load(paste0(path$Raw,"/EXIOWasteMFAIO/",year,"_Z.RData")) - # Final demand: - load(paste0(path$Raw,"/EXIOWasteMFAIO/",year,"_Y.RData")) - # IO sector codes: - load(paste0(path$Raw,"/EXIOWasteMFAIO/","IO.codes.RData")) - IO.codes <- IO.codes %>% select(Index,Product.Name,Country.Code) - regions <- unique(IO.codes$Country.Code) - # Final demand codes - load(paste0(path$Raw,"/EXIOWasteMFAIO/","Y.codes.RData")) - - # Load the root classifciation - root_class <- root$region %>% select(Code,ISO2digitCode) - - # Load region aggregator + + + # Set path tpo functions: + + fun <- list(paste0(path$Subroutines,"/Root2Base_RegionAggregator.R"), + paste0(path$Subroutines,"/Agg.R"), + paste0(path$Subroutines,"/Numbers2File.R")) + + lapply(fun,source) # Load functions + + source(paste0(path$Subroutines,"/Root2Base_RegionAggregator.R")) # Load source-to-root and calculate Source2Base concordances + Source2Root <- read.csv(paste0(path$Concordance,"/EXIOBASE/Source2Root_Region_EXIOBASE.csv"), header = FALSE) - Root2Base <- as.matrix(RegionAggregator) - + # Root2Mother <- as.matrix(RegionAggregator) + Source2Root <- as.matrix(Source2Root) - # Create map from concordance - Source2Root <- Source2Root/rowSums(Source2Root) - Root2Base <- as.matrix(Root2Base) + + + + Source2Root <- Source2Root/rowSums(Source2Root) # Create map from concordance + + # Root2Mother <- as.matrix(Root2Mother) + # Create Source-to-base matrix - Source2Base <- Source2Root %*% Root2Base + + Source2Mother <- Source2Root %*% R2M$region # Create concordance - Source2Base <- t(Source2Base)*(1:ncol(Source2Base)) - rownames(Source2Base) <- NULL - Source2Base <- melt(Source2Base) - Source2Base <- filter(Source2Base,value > 0) %>% select(-value) - colnames(Source2Base) <- c("base","root") - - IO.codes <- data.frame(IO.codes,"NewProducts" = "NEC",stringsAsFactors = FALSE) - IO.codes["base"] <- rep(Source2Base$base,each = 200) - - # select steel containing commodities - steel.id <- c(117:125,150) - IO.codes$NewProducts[IO.codes$Product.Name %in% IO.codes$Product.Name[steel.id]] <- IO.codes$Product.Name[IO.codes$Product.Name %in% IO.codes$Product.Name[steel.id]] - - # Create key for aggregation - IO.codes <- data.frame(IO.codes, - "Key" = paste0(as.character(IO.codes$base),"§",IO.codes$NewProducts), - stringsAsFactors = FALSE) - - # Aggregate transaction matrix - colnames(Z) <- IO.codes$Key - Z <- Agg(Z) - Z <- t(Z) - colnames(Z) <- IO.codes$Key - Z <- Agg(Z) - Z <- t(Z) - - # Aggregate final demand - Y.codes["base"] <- rep(Source2Base$base,each = 7) - colnames(Y) <- Y.codes$base - Y <- Agg(Y) - Y <- t(Y) - colnames(Y) <- IO.codes$Key - Y <- Agg(Y) - Y <- t(Y) - # Rearrange columns so that the region code of the base table is in increasing order - Y <- Y[,as.character(1:max(Source2Base$base))] - - # Create new IO.codes to rearrange the variables so that base region codes increases - IO.codes <- colnames(Z) - IO.codes <- as.data.frame(str_split_fixed(IO.codes, "§", 2),stringsAsFactors = FALSE) - colnames(IO.codes) <- c("base","commodity") - storage.mode(IO.codes$base) <- "numeric" - IO.codes <- IO.codes[order(IO.codes$base),] - IO.codes$index <- 1:nrow(IO.codes) - IO.codes$Key <- paste0(as.character(IO.codes$base),"§",IO.codes$commodity) - IO.codes <- IO.codes[,c("index","base","commodity","Key")] - - # New Y.codes - Y.codes <- data.frame("base" = 1:max(Source2Base$base), - "Region.Name" = base$region$Name, - stringsAsFactors = FALSE) - - # Rearrange Z & Y (if necessary) - Z <- Z[,IO.codes$Key] - Z <- t(Z) - Z <- Z[,IO.codes$Key] - Y <- t(Y) - Y <- Y[,IO.codes$Key] - Y <- t(Y) - - # Compute new variables of the aggreagted table - x <- rowSums(Z) + rowSums(Y) - A <- t(t(Z)/x) - A[is.na(A)] <- 0 - - # Delete input/flows not containing steel - A[IO.codes$index[IO.codes$commodity == "NEC"],] <- 0 - A[,IO.codes$index[IO.codes$commodity == "NEC"]] <- 0 - L <- solve(diag(nrow(A))-A) - - # Construct new final demand (now only steel-containing products) - Y[IO.codes$index[IO.codes$commodity == "NEC"],] <- 0 + + Source2Mother <- t(Source2Mother)*(1:ncol(Source2Mother)) + + rownames(Source2Mother) <- NULL + + Source2Mother <- melt(Source2Mother) + + Source2Mother <- filter(Source2Mother,value > 0) %>% select(-value) + + colnames(Source2Mother) <- c("MotherRegion","SourceRegion") + + + # Loading IO codes: + + Code <- list("Source" = list("Product" = read.csv(paste0(path$Raw,"/EXIOWasteMFAIO/IO_product_codes.csv")), + "Industry" = read.csv(paste0(path$Raw,"/EXIOWasteMFAIO/IO_industry_codes.csv")), + "Demand" = read.csv(paste0(path$Raw,"/EXIOWasteMFAIO/IO_finaldemand_codes.csv")) + ) + ) + + + Code$Source$Product <- left_join(Code$Source$Product,Source2Mother,by = c("RegionCode" = "SourceRegion")) + + Code$Source$Industry <- left_join(Code$Source$Industry,Source2Mother,by = c("RegionCode" = "SourceRegion")) + + Code$Source$Demand <- left_join(Code$Source$Demand,Source2Mother,by = c("RegionCode" = "SourceRegion")) + + + n_pro <- max(Code$Source$Product$MotherProductCode) # Number of manufactured products + + n_ind <- max(Code$Source$Industry$MotherIndustryCode) # Number of manufacturing industries + + n_reg <- ncol(R2M$region) # Number of regions + + + # 1. Load EXIOBASE 3.6 mrSUTs + + # Supply table (products by industry): + + S <- read.csv(paste0(path$Raw,"/EXIOWasteMFAIO/MRSUT_",year,"/supply.csv"),header = FALSE) + + S <- as.matrix(S) # Transform into matrix + + # Aggregate from source to mother classification: + + S <- Agg(S,paste0(Code$Source$Industry$MotherRegion,"-",Code$Source$Industry$MotherIndustryCode),2) + + S <- Agg(S,paste0(Code$Source$Product$MotherRegion,"-",Code$Source$Product$MotherProductCode),1) + + # Use table (products by industry): + + U <- read.csv(paste0(path$Raw,"/EXIOWasteMFAIO/MRSUT_",year,"/use.csv"),header = FALSE) + + U <- as.matrix(U) # Transform into matrix + + # Aggregate from source to mother: + + U <- Agg(U,paste0(Code$Source$Industry$MotherRegion,"-",Code$Source$Industry$MotherIndustryCode),2) + + U <- Agg(U,paste0(Code$Source$Product$MotherRegion,"-",Code$Source$Product$MotherProductCode),1) + + + # Final demand block (product by final demand category) + + Y <- read.csv(paste0(path$Raw,"/EXIOWasteMFAIO/MRSUT_",year,"/final_demand.csv"),header = FALSE) + + Y <- as.matrix(Y) # Transform into matrix + + # Aggregate from source to mother: + + Y <- Agg(Y,paste0(Code$Source$Demand$MotherRegion,"-",Code$Source$Demand$FinalDemandCode),2) + + Y <- Agg(Y,paste0(Code$Source$Product$MotherRegion,"-",Code$Source$Product$MotherProductCode),1) + + + x <- colSums(S) # Gross production of all industry - # Remove NEC product from WIO model - L <- L[IO.codes$index[IO.codes$commodity != "NEC"],IO.codes$index[IO.codes$commodity != "NEC"]] - Y <- Y[IO.codes$index[IO.codes$commodity != "NEC"],] - x <- rowSums(L%*%Y) - IO.codes <- IO.codes[IO.codes$commodity != "NEC",] - IO.codes$index <- 1:nrow(IO.codes) - IO.codes$WIOcode <- 1:length(unique(IO.codes$commodity)) - IO.codes$base.product <- base$product$Code[base$product$Name %in% IO.codes$commodity] + q <- rowSums(S) # Gross production of all products + + + D <- t(S/q) # Matrix of all commodity output proportions (industry by product) + + D[is.na(D)] <- 0 # Set NaN (due to zero gross output) to zero + + C <- t(t(S)/x) # Matrix of all industry output proportions (product by industry) + + C[is.na(C)] <- 0 # Set NaN (due to zero gross output) to zero + + + B <- t(t(U)/x) # All commodity by industry coefficient matrix + + B[is.na(B)] <- 0 # Set NaN (due to zero gross output) to zero + + A <- B %*% D # Calculate pro-by-pro technology matrix + + + filter <- rep(c(0,rep(1,n_pro)),n_reg) # Create filter vector + + A_f <- diag(filter) %*% A %*% diag(filter) # Apply filter + + I <- diag( rep(1, (n_pro+1) * n_reg ) ) # Create Identity matrix + + + # Filter mrSUTs for steel containing sectors and recalculate market share matrices: + + S_f <- diag(filter) %*% S %*% diag(filter) # Filter supply table + + x_f <- colSums(S_f) # Filter industry output + + q_f <- rowSums(S_f) # Filter product output + + + D_f <- t(S_f/q_f) # Matrix of all commodity output proportions (industry by product) + + D_f[is.na(D_f)] <- 0 # Set NaN (due to zero gross output) to zero + + C_f <- t(t(S_f)/x_f) # Matrix of all industry output proportions (product by industry) + + C_f[is.na(C_f)] <- 0 # Set NaN (due to zero gross output) to zero + + + + TRM_f <- solve( I - A_f ) %*% C_f # Calculate pro-by-ind total requirement matrix + + Y_f <- D_f %*% diag(filter) %*% Y # Filter and calculate final demand by industry output + + print( sum(TRM_f %*% rowSums(Y_f)) / sum(x) ) # Share of manuf. steel in production + + + Code[["Mother"]] <- list( "Sector" = colnames(A), + "Demand" = colnames(Y) ) # Create new codes for WIO-MFA model + + + # Split colname string into region and sector code: + + Code$Mother$Sector <- as.data.frame(str_split_fixed(Code$Mother$Sector, "-", 2),stringsAsFactors = FALSE) + + Code$Mother$Demand <- as.data.frame(str_split_fixed(Code$Mother$Demand, "-", 2),stringsAsFactors = FALSE) + + # Change storage mode to numeric: + + Code$Mother$Sector <- as.data.frame(apply(Code$Mother$Sector, c(2),as.numeric)) + + Code$Mother$Demand <- as.data.frame(apply(Code$Mother$Demand, c(2),as.numeric)) + + # Add indices: + + Code$Mother$Sector["index"] <- 1:nrow(Code$Mother$Sector) + + Code$Mother$Demand["index"] <- 1:nrow(Code$Mother$Demand) + + + # Set colnames: + + colnames(Code$Mother$Sector) <- c("base","sector","index") + + colnames(Code$Mother$Demand) <- c("base","demand","index") + + + # Remove NEC sectors and export demand category (which is always zero): + + Code$Mother$Sector <- Code$Mother$Sector[Code$Mother$Sector$sector != 0,] + + Code$Mother$Demand <- Code$Mother$Demand[Code$Mother$Demand$demand != 7,] + + + # Re-order region list: + + Code$Mother$Sector <- Code$Mother$Sector[order(Code$Mother$Sector$base),] + + Code$Mother$Demand <- Code$Mother$Demand[order(Code$Mother$Demand$base),] + + + remove(A,x,q,Y,S,U) # Remove tables not needed + + + # Filter only WIO-MFA sectors: + + A <- A_f[Code$Mother$Sector$index,Code$Mother$Sector$index] + + S <- S_f[Code$Mother$Sector$index,Code$Mother$Sector$index] + + TRM <- TRM_f[Code$Mother$Sector$index,Code$Mother$Sector$index] + + Y <- Y_f[Code$Mother$Sector$index,Code$Mother$Demand$index] + + + # Adapt indices to new model classification: + + Code$Mother$Sector$index <- 1:nrow(Code$Mother$Sector) + + Code$Mother$Demand$index <- 1:nrow(Code$Mother$Demand) + # Check if subfolder in processed data exists and if not create it + path_set <- paste0(path$IE_Processed,"/EXIOWasteMFAIO") + if(!dir.exists(path_set)) dir.create(path_set) - write.table(L,file = paste0(path_set,"/",year,"_L.csv"),row.names = FALSE,col.names = FALSE,sep = ",") - write.table(Y,file = paste0(path_set,"/",year,"_Y.csv"),row.names = FALSE,col.names = FALSE,sep = ",") - write.table(x,file = paste0(path_set,"/",year,"_x.csv"),row.names = FALSE,col.names = FALSE,sep = ",") - save(IO.codes,file = paste0(path_set,"/IO.codes.RData")) - save(Y.codes,file = paste0(path_set,"/Y.codes.RData")) - print("IEFeed_PIOLab_EXIOWasteMFAIO finished.") + # Write codes and tables to folder: + + write.csv(x = Code$Mother$Sector, + file = paste0(path$IE_Processed,"/EXIOWasteMFAIO/IO_codes.csv"), + row.names = FALSE) + + write.csv(x = Code$Mother$Demand, + file = paste0(path$IE_Processed,"/EXIOWasteMFAIO/Y_codes.csv"), + row.names = FALSE ) + + + Numbers2File(Y,paste0(path$IE_Processed,"/EXIOWasteMFAIO/",year,"_Y.csv")) + + Numbers2File(A,paste0(path$IE_Processed,"/EXIOWasteMFAIO/",year,"_A.csv")) + + Numbers2File(TRM,paste0(path$IE_Processed,"/EXIOWasteMFAIO/",year,"_L.csv")) + + + + print(paste0( "Share of final demand in total gross production: ", + round( sum(Y)/sum(TRM %*% Y),digits = 2) ) + ) -} \ No newline at end of file +} diff --git a/Rscripts/IEfeeds_code/IE_subroutines/IEFeed_PIOLab_Grades.R b/Rscripts/IEfeeds_code/IE_subroutines/IEFeed_PIOLab_Grades.R index b43a693..f44c961 100644 --- a/Rscripts/IEfeeds_code/IE_subroutines/IEFeed_PIOLab_Grades.R +++ b/Rscripts/IEfeeds_code/IE_subroutines/IEFeed_PIOLab_Grades.R @@ -40,6 +40,4 @@ IEFeed_PIOLab_Grades <- function(path) if(!dir.exists(path_set)) dir.create(path_set) write.csv(data_clean,file = paste0(path_set,"/IronOreGrades.csv"),row.names = FALSE) - - print("IEFeed_PIOLab_Grades finished.") } \ No newline at end of file diff --git a/Rscripts/IEfeeds_code/IE_subroutines/IEFeed_PIOLab_IEA.R b/Rscripts/IEfeeds_code/IE_subroutines/IEFeed_PIOLab_IEA.R index 519d209..239c536 100644 --- a/Rscripts/IEfeeds_code/IE_subroutines/IEFeed_PIOLab_IEA.R +++ b/Rscripts/IEfeeds_code/IE_subroutines/IEFeed_PIOLab_IEA.R @@ -76,6 +76,4 @@ IEFeed_PIOLab_IEA <- function(year,path) file = paste0(path_set,"/IEA_",year,"_SteelIndustryEnergyConsumption.csv"), row.names = FALSE) - print("IEFeed_PIOLab_IEA finished.") - } \ No newline at end of file diff --git a/Rscripts/IEfeeds_code/IE_subroutines/IEFeed_PIOLab_IRP.R b/Rscripts/IEfeeds_code/IE_subroutines/IEFeed_PIOLab_IRP.R index 3e8f8b7..a9fe0b5 100644 --- a/Rscripts/IEfeeds_code/IE_subroutines/IEFeed_PIOLab_IRP.R +++ b/Rscripts/IEfeeds_code/IE_subroutines/IEFeed_PIOLab_IRP.R @@ -24,6 +24,4 @@ IEFeed_PIOLab_IRP <- function(year,path) # Export data to folder (note that the unit is metric tons) write.csv(data,file = paste0(path_set,"/IRP_",year,".csv"),row.names = FALSE) - - print("IEFeed_PIOLab_IRP finished") } \ No newline at end of file diff --git a/Rscripts/IEfeeds_code/IE_subroutines/IEFeed_PIOLab_SteelIndustryYields.R b/Rscripts/IEfeeds_code/IE_subroutines/IEFeed_PIOLab_SteelIndustryYields.R index 708929f..a6b6a03 100644 --- a/Rscripts/IEfeeds_code/IE_subroutines/IEFeed_PIOLab_SteelIndustryYields.R +++ b/Rscripts/IEfeeds_code/IE_subroutines/IEFeed_PIOLab_SteelIndustryYields.R @@ -16,6 +16,5 @@ IEFeed_PIOLab_SteelIndustryYields <- function(path) # Write to folder write.csv(data,file = paste0(path$IE_Processed,"/WSA/SteelIndustryYields.csv"),row.names = FALSE) - - print("IEFeed_PIOLab_SteelIndustryYields finished.") + } \ No newline at end of file diff --git a/Rscripts/IEfeeds_code/IE_subroutines/IEFeed_PIOLab_WSA.R b/Rscripts/IEfeeds_code/IE_subroutines/IEFeed_PIOLab_WSA.R index ab30554..f748bb2 100644 --- a/Rscripts/IEfeeds_code/IE_subroutines/IEFeed_PIOLab_WSA.R +++ b/Rscripts/IEfeeds_code/IE_subroutines/IEFeed_PIOLab_WSA.R @@ -41,5 +41,4 @@ IEFeed_PIOLab_WSA <- function(year,path) file = paste0(path_set,"/WSA_",year,"_",item_name,".csv"), row.names = FALSE) } - print("IEFeed_PIOLab_WSA finished.") } diff --git a/Rscripts/IEfeeds_code/Ind30Pro39v1_InitialEstimate.R b/Rscripts/IEfeeds_code/Ind30Pro39v1_InitialEstimate.R index a10abe1..b2e4203 100644 --- a/Rscripts/IEfeeds_code/Ind30Pro39v1_InitialEstimate.R +++ b/Rscripts/IEfeeds_code/Ind30Pro39v1_InitialEstimate.R @@ -7,7 +7,7 @@ ############################################### # IE feed for 20 industries/processes and 22 products base classifications # hanspeter.wieland@wu.ac.at (c) -# 02.19.2020 +# 04.16.2020 # In case the code is executed not on the server (and the GUI) for debugging, # the user can choose the desired region aggregator by setting the following variable @@ -16,7 +16,7 @@ # test_regagg <- "049" ################################################################################ -# 1. Set up environment for building the initial estimate +### 1. Set up workplace for building the initial estimate IEdatafeed_name <- "Ind30Pro39v1" @@ -38,10 +38,6 @@ source(paste0(path$root,"Rscripts/Subroutines/Read_BaseClassification.R")) # Read root to mother sector aggregators source(paste0(path$root,"Rscripts/Subroutines/Load_Root2Mother_sectors.R")) -# Read root to mother region aggregator (from mat-file if available) -# source(paste0(path$root,"Rscripts/Subroutines/Load_Root2Mother_regions.R")) - - # Read region aggregation from classification to set the right path for the IE data if(max(base$region$Code) < 10) @@ -64,13 +60,10 @@ remove(regagg) if(!dir.exists(path$Agg_Processed)) dir.create(path$Agg_Processed) # Check whether output folder for processed data for the specific aggregation exists, if yes, delete it - if(dir.exists(path$IE_Processed)) unlink(path$IE_Processed,recursive = TRUE) - dir.create(path$IE_Processed) # Check if ALANG files of old initial estimate exist and delete - source(paste0(path$Subroutines,"/DeleteALANGfilesOfOldIEfeeds.R")) # Functions to process raw data for Initial Estimate @@ -82,68 +75,48 @@ IE_fun <- list("/IEFeed_PIOLab_WSA.R", "/IEFeed_PIOLab_Grades.R", "/IEFeed_PIOLab_EOL.R", "/IEFeed_PIOLab_IEA.R", - "/IEFeed_PIOLab_EXIOWasteMFAIOV2.R", + "/IEFeed_PIOLab_EXIOWasteMFAIO.R", "/IEFeed_PIOLab_Cullen.R", - "/IEDataProcessing_PIOLab_AligningDataV2.R", - "/IEDataProcessing_PIOLab_WasteMFAIOExtensionV2.R", - "/IEDataProcessing_PIOLab_WasteMFAIOModelRunV2.R", - "/IEDataProcessing_PIOLab_BuildingDomesticTablesV2.R", + "/IEDataProcessing_PIOLab_AligningData.R", + "/IEDataProcessing_PIOLab_WasteMFAIOExtension.R", + "/IEDataProcessing_PIOLab_WasteMFAIOModelRun.R", + "/IEDataProcessing_PIOLab_BuildingDomesticTables.R", "/IEDataProcessing_PIOLab_BuildingTradeBlocks.R", "/IEDataProcessing_PIOLab_BuildS8fromSupplyUseTables.R") IE_fun <- paste0(path$IE_Subroutines,IE_fun) # Add path to functions - -lapply(IE_fun,source) # Load functions into workspace +lapply(IE_fun,source) # Load functions into workspace -# 2. Commencing data pre-processing (from source to root classification) - -IEFeed_PIOLab_WSA(year,path) # WSA production numbers +### 2. Commencing data pre-processing (from source to root classification) +IEFeed_PIOLab_WSA(year,path) # WSA production numbers IEFeed_PIOLab_SteelIndustryYields(path) # Yield information +IEFeed_PIOLab_BACI(year,path) # Trade data +IEFeed_PIOLab_IRP(year,path) # Extraction data +IEFeed_PIOLab_Grades(path) # Ore grades +IEFeed_PIOLab_EOL(year,path) # end-of-life i.e. old scrap +IEFeed_PIOLab_IEA(year,path) # IEA energy data +IEFeed_PIOLab_EXIOWasteMFAIO(year,path) # Aggregate EXIOBASE Waste-MFA IO model (WIO) +IEFeed_PIOLab_Cullen(path) # Fabrication yields from Cullen et al. 2012 -IEFeed_PIOLab_BACI(year,path) # Trade data - -IEFeed_PIOLab_IRP(year,path) # Extraction data - -IEFeed_PIOLab_Grades(path) # Ore grades - -IEFeed_PIOLab_EOL(year,path) # end-of-life i.e. old scrap - -IEFeed_PIOLab_IEA(year,path) # IEA energy data - -IEFeed_PIOLab_EXIOWasteMFAIOV2(year,path) # Aggregate EXIOBASE Waste-MFA IO model (WIO) -IEFeed_PIOLab_Cullen(path) # Fabrication yields from Cullen et al. 2012 +### 3. Commencing data processing +IEDataProcessing_PIOLab_AligningData(year,path) # Align WSA, IRP extraction +IEDataProcessing_PIOLab_WasteMFAIOExtension(year,path) # Compile extension for WIO +IEDataProcessing_PIOLab_WasteMFAIOModelRun(year,path) # Run WIO Model calculation -# 3. Commencing data processing - -IEDataProcessing_PIOLab_AligningDataV2(year,path) # Align WSA, IRP extraction - -IEDataProcessing_PIOLab_WasteMFAIOExtensionV2(year,path) # Compile extension for WIO - -IEDataProcessing_PIOLab_WasteMFAIOModelRunV2(year,path) # Run WIO Model calculation - - -# Compile domestic SUTs - -IEDataProcessing_PIOLab_BuildingDomesticTablesV2(year,path) - -# Compiling trade blocks +### 4. Compile domestic SUTs, trade blocks and S8 files thereof +IEDataProcessing_PIOLab_BuildingDomesticTables(year,path) IEDataProcessing_PIOLab_BuildingTradeBlocks(year,path) - -################################################################################ -# 4. Create S8 files (see AISHA manual annex for further information) for easy data import to AISHA - IEDataProcessing_PIOLab_BuildS8fromSupplyUseTables(year,path) -################################################################################ -# 5. Write ALANG commands -print("Start writing ALANG commands.") +### 5. Write ALANG commands # Set up wrapper for adding rows to ALANG + NewALANG <- function(name,SE,ALANG) { file <- paste0("S8 ",path$mother,"Data/IE/",gsub("-","",Sys.Date()), @@ -162,7 +135,7 @@ NewALANG <- function(name,SE,ALANG) # Create empty file with header source(paste0(path$Subroutines,"/makeALANGheadline.R")) -RSE <- read.xlsx(xlsxFile = paste0(path$Settings,"/datafeeds_settings/IE_RSE_settings.xlsx")) +RSE <- read.xlsx( paste0(path$Settings,"/Base/IE_settings.xlsx"), sheet = 3 ) # Write ALANG commands diff --git a/Rscripts/Subroutines/InitializationR.R b/Rscripts/Subroutines/InitializationR.R index fb298dc..5b92678 100644 --- a/Rscripts/Subroutines/InitializationR.R +++ b/Rscripts/Subroutines/InitializationR.R @@ -57,14 +57,21 @@ path <- list("Raw" = paste0(root_folder,"RawDataRepository"), "root" = root_folder, "mother" = mother, "Settings" = paste0(root_folder,"Settings"), - "RSE_settings" = paste0(root_folder,"Settings/datafeeds_settings/RSE_settings.xlsx")) + "RSE_settings" = paste0(root_folder,"Settings/datafeeds_settings/df_RSE_settings.xlsx")) # Set the year year <- 2008 # Read root region, industry and products -root <- list("region" = read.xlsx(paste0(path$Concordance,"/LabelsAndCodes/PIOLab_RootClassification.xlsx"),sheet = 1), - "process" = read.xlsx(paste0(path$Concordance,"/LabelsAndCodes/PIOLab_RootClassification.xlsx"),sheet = 2)[,1:2], - "flow" = read.xlsx(paste0(path$Concordance,"/LabelsAndCodes/PIOLab_RootClassification.xlsx"),sheet = 3)) -remove(mother,OnServer,root_folder) +path_rootclass <- paste0(path$Settings,"/Root/Legends/PIOLab_RootClassification.xlsx") + +root <- list("region" = read.xlsx(path_rootclass,sheet = 1), + "process" = read.xlsx(path_rootclass,sheet = 2)[,1:2], + "flow" = read.xlsx(path_rootclass,sheet = 3), + "demand" = read.xlsx(path_rootclass,sheet = 4), + "input" = read.xlsx(path_rootclass,sheet = 5) ) + + + +remove(mother,OnServer,root_folder, path_rootclass) diff --git a/Rscripts/Subroutines/Load_Root2Mother_sectors.R b/Rscripts/Subroutines/Load_Root2Mother_sectors.R index e3fa544..245c1e4 100644 --- a/Rscripts/Subroutines/Load_Root2Mother_sectors.R +++ b/Rscripts/Subroutines/Load_Root2Mother_sectors.R @@ -2,35 +2,15 @@ # Load root to mother sector aggregators - -if(IEdatafeed_name == "Ind20Pro22v1") -{ - ProductAggregator <- read.csv(paste0(path$Concordance,"/Sector Aggregators/22ProV1_SectorAggregatorProducts.csv"), - stringsAsFactors=FALSE, sep = ",",header = FALSE) - - IndustryAggregator <- read.csv(paste0(path$Concordance,"/Sector Aggregators/20IndV1_SectorAggregatorIndustries.csv"), - stringsAsFactors=FALSE, sep = ",",header = FALSE) -} - -if(IEdatafeed_name == "Ind30Pro40v1") -{ - - ProductAggregator <- read.csv(paste0(path$Concordance,"/Sector Aggregators/40ProV1_SectorAggregatorProducts.csv"), - stringsAsFactors=FALSE, sep = ",",header = FALSE) - - IndustryAggregator <- read.csv(paste0(path$Concordance,"/Sector Aggregators/30IndV1_SectorAggregatorIndustries.csv"), - stringsAsFactors=FALSE, sep = ",",header = FALSE) -} - if(IEdatafeed_name == "Ind30Pro39v1") { - set <- read.xlsx(xlsxFile = paste0(path$Settings,"/datafeeds_settings/IE_settings.xlsx"),sheet = 2) + set <- read.xlsx(xlsxFile = paste0(path$Settings,"/Base/IE_settings.xlsx"),sheet = 2) path_sel <- list("flow" = paste0(path$Concordance,"/Sector Aggregators/", - set$date[set$aggregator == "product"],"_",num$flow,"Products_SectorAggregator.csv"), + set$date[set$aggregator == "sector"],"_",num$flow,"Products_SectorAggregator.csv"), "process" = paste0(path$Concordance,"/Sector Aggregators/", - set$date[set$aggregator == "industry"],"_",num$process,"Industries_SectorAggregator.csv") + set$date[set$aggregator == "sector"],"_",num$process,"Industries_SectorAggregator.csv") ) diff --git a/Rscripts/Subroutines/Read_BaseClassification.R b/Rscripts/Subroutines/Read_BaseClassification.R index ef65ffd..0c7e893 100644 --- a/Rscripts/Subroutines/Read_BaseClassification.R +++ b/Rscripts/Subroutines/Read_BaseClassification.R @@ -16,11 +16,14 @@ if(file.exists(reg_path)) # Read the number of regions from the name of the aggregator RegionAgg <- substr(reg_map,nchar(reg_map)-23,nchar(reg_map)-21) - base <- list("region" = read.xlsx(paste0(path$Concordance,"/LabelsAndCodes/",RegionAgg,"_BaseRegionClassification.xlsx"),sheet = 1), - "process" = read.xlsx(paste0(path$Concordance,"/LabelsAndCodes/",IEdatafeed_name,"_BaseSectorClassification.xlsx"),sheet = 1), - "flow" = read.xlsx(paste0(path$Concordance,"/LabelsAndCodes/",IEdatafeed_name,"_BaseSectorClassification.xlsx"),sheet = 2), - "demand" = read.xlsx(paste0(path$Concordance,"/LabelsAndCodes/",IEdatafeed_name,"_BaseSectorClassification.xlsx"),sheet = 3), - "input" = read.xlsx(paste0(path$Concordance,"/LabelsAndCodes/",IEdatafeed_name,"_BaseSectorClassification.xlsx"),sheet = 4)) + path_base_reg <- paste0(path$Settings,"/Base/",RegionAgg,"_BaseRegionClassification.xlsx") + path_base_sec <- paste0(path$Settings,"/Base/",IEdatafeed_name,"_BaseSectorClassification.xlsx") + + base <<- list("region" = read.xlsx(path_base_reg,sheet = 1), + "process" = read.xlsx(path_base_sec,sheet = 1), + "flow" = read.xlsx(path_base_sec,sheet = 2), + "demand" = read.xlsx(path_base_sec,sheet = 3), + "input" = read.xlsx(path_base_sec,sheet = 4)) remove(reg_map,RegionAgg) @@ -37,11 +40,14 @@ if(file.exists(reg_path)) ) ) - base <<- list("region" = read.xlsx(paste0(path$Concordance,"/LabelsAndCodes/",test_regagg,"_BaseRegionClassification.xlsx"),sheet = 1), - "process" = read.xlsx(paste0(path$Concordance,"/LabelsAndCodes/",IEdatafeed_name,"_BaseSectorClassification.xlsx"),sheet = 1), - "flow" = read.xlsx(paste0(path$Concordance,"/LabelsAndCodes/",IEdatafeed_name,"_BaseSectorClassification.xlsx"),sheet = 2), - "demand" = read.xlsx(paste0(path$Concordance,"/LabelsAndCodes/",IEdatafeed_name,"_BaseSectorClassification.xlsx"),sheet = 3), - "input" = read.xlsx(paste0(path$Concordance,"/LabelsAndCodes/",IEdatafeed_name,"_BaseSectorClassification.xlsx"),sheet = 4)) + path_base_reg <- paste0(path$Settings,"/Base/",test_regagg,"_BaseRegionClassification.xlsx") + path_base_sec <- paste0(path$Settings,"/Base/",IEdatafeed_name,"_BaseSectorClassification.xlsx") + + base <<- list("region" = read.xlsx(path_base_reg,sheet = 1), + "process" = read.xlsx(path_base_sec,sheet = 1), + "flow" = read.xlsx(path_base_sec,sheet = 2), + "demand" = read.xlsx(path_base_sec,sheet = 3), + "input" = read.xlsx(path_base_sec,sheet = 4)) remove(test_regagg) } diff --git a/Rscripts/concfeeds_code/concfeed_Root2Mother_sectors.R b/Rscripts/concfeeds_code/concfeed_Root2Mother_sectors.R index a698719..3282fa7 100644 --- a/Rscripts/concfeeds_code/concfeed_Root2Mother_sectors.R +++ b/Rscripts/concfeeds_code/concfeed_Root2Mother_sectors.R @@ -14,7 +14,7 @@ if(Sys.info()[1] == "Linux"){ .libPaths("/suphys/hwie3321/R/x86_64-redhat-linux-gnu-library/3.5") # Define location for root directory root_folder <- "/import/emily1/isa/IELab/Roots/PIOLab/"}else{ - root_folder <- "C:/Users/hwieland/Github workspace/PIOLab/"} + root_folder <- "C:/Users/hwieland/Github workspace/PIOLab/"} # Initializing R script (load R packages and set paths to folders etc.) source(paste0(root_folder,"Rscripts/Subroutines/InitializationR.R")) @@ -25,18 +25,24 @@ source(paste0(path$root,"Rscripts/Subroutines/Read_BaseClassification.R")) # Load function to write tables to file source(paste0(path$root,"Rscripts/Subroutines/Numbers2File.R")) +set <- read.xlsx(paste0(path$Settings,"/Base/IE_settings.xlsx"),sheet = 2) + # Load Source to root sector aggregator of (i) WSA and (ii) IRP accounts # and (iii) additionally pseudo S2R where no raw data is available # Note that all tables are transposed (i.e. in root to source format): -S2R <- list("WSA" = list("process" = read.xlsx(paste0(path$Concordance,"/WSA/WSA_Source2Root_WithLabelsV3.xlsx"), sheet = 1), - "flow" = read.xlsx(paste0(path$Concordance,"/WSA/WSA_Source2Root_WithLabelsV3.xlsx"), sheet = 2) +path_wsa <- paste0(path$Concordance,"/WSA/WSA_Source2Root_WithLabels",set$date[set$aggregator == "WSA"],".xlsx") +path_IRP <- paste0(path$Concordance,"/IRP/",set$date[set$aggregator == "sector"],"_IRP_Extraction_SecConc.xlsx") +path_add <- paste0(path$Concordance,"/Additional/",set$date[set$aggregator == "Additional"],"_Additional_Root2Mother_Sec_Ind30Pro39v1.xlsx") + +S2R <- list("WSA" = list("process" = read.xlsx(path_wsa, sheet = 1), + "flow" = read.xlsx(path_wsa, sheet = 2) ), - "IRP" = list("process" = read.xlsx(paste0(path$Concordance,"/IRP/20200420_IRP_Extraction_SecConc.xlsx"), sheet = 1), - "flow" = read.xlsx(paste0(path$Concordance,"/IRP/20200420_IRP_Extraction_SecConc.xlsx"), sheet = 2) + "IRP" = list("process" = read.xlsx(path_IRP, sheet = 1), + "flow" = read.xlsx(path_IRP, sheet = 2) ), - "Add" = list("process" = read.xlsx(paste0(path$Concordance,"/Additional/20200420_Additional_Root2Mother_Sec_Ind30Pro39v1.xlsx"), sheet = 1), - "flow" = read.xlsx(paste0(path$Concordance,"/Additional/20200420_Additional_Root2Mother_Sec_Ind30Pro39v1.xlsx"), sheet = 2) + "Add" = list("process" = read.xlsx(path_add, sheet = 1), + "flow" = read.xlsx(path_add, sheet = 2) ) ) @@ -56,7 +62,7 @@ Code <- list("WSA" = base$flow[base$flow$feed %in% colnames(S2R$WSA$flow), ], # Extract Source to root concordances (just to make sure the right subset is selected) Conco <- list("WSA" = as.matrix( S2R$WSA$flow[1:nrow(root$flow), Code$WSA$feed] ), - "IRP" = S2R$IRP$flow$IRPextraction, + "IRP" = S2R$IRP$flow$binary, "Add" = as.matrix( S2R$Add$flow[1:nrow(root$flow), as.character( Code$Add$Code )] ) ) @@ -90,7 +96,7 @@ Code <- list("WSA" = base_sel[base_sel$feed_1 %in% colnames(S2R$WSA$process), ], # Extract Source to root concordances (just to make sure the right subset is selected) Conco <- list("WSA" = as.matrix( S2R$WSA$process[1:nrow(root$process), Code$WSA$feed_1] ), - "IRP" = S2R$IRP$process$IRPextraction, + "IRP" = S2R$IRP$process$binary, "Add" = as.matrix( S2R$Add$process[1:nrow(root$process), as.character( Code$Add$Code )] ) ) diff --git a/Rscripts/concfeeds_code/concfeed_WSA_Source2Root_sectors.R b/Rscripts/concfeeds_code/concfeed_WSA_Source2Root_sectors.R index 1dd98ef..66900b8 100644 --- a/Rscripts/concfeeds_code/concfeed_WSA_Source2Root_sectors.R +++ b/Rscripts/concfeeds_code/concfeed_WSA_Source2Root_sectors.R @@ -19,9 +19,8 @@ source(paste0(root_folder,"Rscripts/Subroutines/InitializationR.R")) # Load function to write tables to file source(paste0(path$root,"Rscripts/Subroutines/Numbers2File.R")) -S2R <- list("process" = read.xlsx(paste0(path$Concordance,"/WSA/WSA_Source2Root_WithLabelsV3.xlsx"), sheet = 1), - "flow" = read.xlsx(paste0(path$Concordance,"/WSA/WSA_Source2Root_WithLabelsV3.xlsx"), sheet = 2) - ) +S2R <- list("process" = read.xlsx(paste0(path$Concordance,"/WSA/WSA_Source2Root_WithLabelsV4.xlsx"), sheet = 1), + "flow" = read.xlsx(paste0(path$Concordance,"/WSA/WSA_Source2Root_WithLabelsV4.xlsx"), sheet = 2) ) # Read WSA settings to get exact number of feeds Settings <- read.xlsx(paste0(path$Settings,"/datafeeds_settings/WSA_settings.xlsx")) diff --git a/Rscripts/datafeeds_code/Archive/datafeed_PIOLab_IRPexports.R b/Rscripts/datafeeds_code/Archive/datafeed_PIOLab_IRPexports.R new file mode 100644 index 0000000..e932152 --- /dev/null +++ b/Rscripts/datafeeds_code/Archive/datafeed_PIOLab_IRPexports.R @@ -0,0 +1,137 @@ +################################################################################ + +datafeed_name <- "IRPexports" +print(paste0("datafeed_PIOLab_",datafeed_name," initiated.")) + +################################################################################ +# Set library path when running on suphys server +if(Sys.info()[1] == "Linux"){ + .libPaths("/suphys/hwie3321/R/x86_64-redhat-linux-gnu-library/3.5") + # Define location for root directory + root_folder <- "/import/emily1/isa/IELab/Roots/PIOLab/"}else{ + root_folder <- "C:/Users/hwieland/Github workspace/PIOLab/"} +################################################################################ + +# Initializing R script (load R packages and set paths to folders etc.) +source(paste0(root_folder,"Rscripts/Subroutines/InitializationR.R")) + +path["df_Processed"] <- paste0(path$Processed,"/",datafeed_name) + +# Load function to write arrays to files +source(paste0(path$Subroutines,"/Numbers2File.R")) + +# Check if folder with processed data exists, in case delete and create empty one + +if(dir.exists(path$df_Processed)) unlink(path$df_Processed,recursive = TRUE) + +dir.create(path$df_Processed) + +# Loading raw data +data <- read.csv(paste0(path$Raw,"/IRP/all_CCC_Exp_ResearchDB.csv"),stringsAsFactors=FALSE) +colnames(data)[6:49] <- 1970:2013 +data <- data %>% filter(CCC_IEATrade_Name == "Iron ores") %>% select(Country,AlphaNumISO,as.character(year)) +# Remove NA +data <- data[!is.na(data$`2008`),] + +# transform 3-digit ISO codes and translate into root classification, first load the root +data <- data %>% separate(AlphaNumISO, into = c('ISOCode', 'num'), sep = 3) %>% select(-num) +colnames(data)[ncol(data)] <- "Quantity" +data <- filter(data,Quantity > 0) +# Look up root codes +data <- left_join(data,root$region[,c("Code","RootCountryAbbreviation")],by = c("ISOCode" = "RootCountryAbbreviation"),copy = FALSE) + +# No root codes for Faroe Islands and Mayotte (remove for now and talk Manfred/Arne) +data <- data[!is.na(data$Code),] + +# Remove Yugoslavia and USSR from data +data <- data %>% filter(!Code %in% c(233,242)) + +data <- data[!is.na(data$Code),] # Mayotte and Farour Isl. are not in root (tbc) + +n_reg <- nrow(root$region) + +# Read standard errors: + +RSE <- filter(read.xlsx(path$RSE_settings),Item == datafeed_name) + +data_new <- data.frame("code" = 1:n_reg,"RHS" = 0) + +data_new$RHS[data$Code] <- data$Quantity + +data <- data_new + +remove(data_new) + + +ConcoReg <- diag(nrow(root$region)) # Create pseudo aggregator (for columns) + +# Set names and paths to data and concordances: + +filename <- list("RHS" = paste0("/",datafeed_name,"/",datafeed_name,"_RHS_",year,".csv"), + "ConcoReg" = "/Root2Root_Reg_Concordance.csv") + +Numbers2File( t(data$RHS), paste0(path$Processed,filename$RHS)) # Save S2R reg aggregator + +Numbers2File( ConcoReg, paste0(path$Concordance,filename$ConcoReg)) # Save S2R reg aggregator + + +# Create empty ALANG table with header: + +source(paste0(path$Subroutines,"/makeALANGheadline.R")) # Create ALANG header + +ALANG <- ALANG[,c(1:19,11:19)] # Extend table with additional columns + +ALANG <- add_row(ALANG,'1' = "DataFeed IRP export") # Create command + +ALANG$Value <- paste0("DATAPATH",filename$RHS) + +ALANG$S.E. <- paste0("E MX",RSE$Maximum,"; MN",RSE$Minimum,";") + + +# Write first 8-tuple (sum of domestic use and imports for each region) + +ALANG$Coef1 <- "-1" + +ALANG$Years <- "1" +ALANG$Margin <- "1" + +ALANG$`Row parent` <- paste0("1:e a CONCPATH",filename$ConcoReg) +ALANG$`Row child` <- "2" +ALANG$`Row grandchild` <- "1-e" + +ALANG$`Column parent` <- "1:e~3" +ALANG$`Column child` <- "1" +ALANG$`Column grandchild` <- "1-e" + +# Write second 8-tuple (subtract sum of domestic use table) + +ALANG$Coef1.1 <- "1" + +ALANG$Years.1 <- "1" +ALANG$Margin.1 <- "1" + +ALANG$`Row parent.1` <- "1:e" +ALANG$`Row child.1` <- "2" +ALANG$`Row grandchild.1` <- "1-e" + +ALANG$`Column parent.1` <- "1-e" +ALANG$`Column child.1` <- "1-e" +ALANG$`Column grandchild.1` <- "1-e" + +ALANG$`#` <- as.character(1:nrow(ALANG)) +ALANG$Incl <- "Y" +ALANG$Parts <- "2" + +ALANG$`Pre-map` <- "" +ALANG$`Post-map` <- "" +ALANG$`Pre-Map` <- "" +ALANG$`Post-Map` <- "" + + +# Call script that writes the ALANG file to the repsective folder in the root +source(paste0(path$root,"Rscripts/datafeeds_code/datafeed_subroutines/WriteALANG2Folder.R")) + +print(paste0("datafeed_PIOLab_",datafeed_name," finished.")) + +rm(list = ls()) # clear workspace + diff --git a/Rscripts/datafeeds_code/Archive/datafeed_PIOLab_IRPimports.R b/Rscripts/datafeeds_code/Archive/datafeed_PIOLab_IRPimports.R new file mode 100644 index 0000000..1fb93bc --- /dev/null +++ b/Rscripts/datafeeds_code/Archive/datafeed_PIOLab_IRPimports.R @@ -0,0 +1,139 @@ +################################################################################ + +datafeed_name <- "IRPimports" +print(paste0("datafeed_PIOLab_",datafeed_name," initiated.")) + +################################################################################ +# Set library path when running on suphys server +if(Sys.info()[1] == "Linux"){ + .libPaths("/suphys/hwie3321/R/x86_64-redhat-linux-gnu-library/3.5") + # Define location for root directory + root_folder <- "/import/emily1/isa/IELab/Roots/PIOLab/"}else{ + root_folder <- "C:/Users/hwieland/Github workspace/PIOLab/"} +################################################################################ + +# Initializing R script (load R packages and set paths to folders etc.) + +source(paste0(root_folder,"Rscripts/Subroutines/InitializationR.R")) + +path["df_Processed"] <- paste0(path$Processed,"/",datafeed_name) + +source(paste0(path$Subroutines,"/Numbers2File.R")) # Load fun. to write arrays to files + + +# Check if folder with processed data exists, in case delete and create empty one + +if(dir.exists(path$df_Processed)) unlink(path$df_Processed,recursive = TRUE) + +dir.create(path$df_Processed) + + +# Loading raw data +data <- read.csv(paste0(path$Raw,"/IRP/all_CCC_Imp_ResearchDB.csv"),stringsAsFactors=FALSE) +colnames(data)[6:49] <- 1970:2013 +data <- data %>% filter(CCC_IEATrade_Name == "Iron ores") %>% select(Country,AlphaNumISO,as.character(year)) +# Remove NA +data <- data[!is.na(data$`2008`),] + +data <- data %>% separate(AlphaNumISO, into = c('ISOCode', 'num'), sep = 3) %>% + select(-num) + +colnames(data)[ncol(data)] <- "Quantity" +data <- filter(data,Quantity > 0) + +# Remove Yugoslavia and USSR from data +data <- data %>% filter(!ISOCode %in% c("YUG","SUN")) + +# Look up root codes +data <- left_join(data,root$region[,c("Code","RootCountryAbbreviation")], + by = c("ISOCode" = "RootCountryAbbreviation"),copy = FALSE) %>% + select(Code,Quantity) + +data <- data[!is.na(data$Code),] # Mayotte and Farour Isl. are not in root (tbc) + +RSE <- filter(read.xlsx(path$RSE_settings),Item == datafeed_name) # Import RSE + +# # Add standard errors +# source(paste0(path$Subroutines,"/SE_LogRegression.R")) +# data <- SE_LogRegression(data,RSE$Minimum,RSE$Maximum) + +n_reg <- nrow(root$region) # Read number of root regions + +data_new <- data.frame("code" = 1:n_reg,"RHS" = 0) + +data_new$RHS[data$Code] <- data$Quantity + +data <- data_new + +remove(data_new) + + +ConcoReg <- diag(nrow(root$region)) # Create pseudo aggregator (for columns) + +# Set names and paths to data and concordances: + +filename <- list("RHS" = paste0("/",datafeed_name,"/",datafeed_name,"_RHS_",year,".csv"), + "ConcoReg" = "/Root2Root_Reg_Concordance.csv") + +Numbers2File( t(data$RHS), paste0(path$Processed,filename$RHS)) # Save S2R reg aggregator + +Numbers2File( ConcoReg, paste0(path$Concordance,filename$ConcoReg)) # Save S2R reg aggregator + + +source(paste0(path$Subroutines,"/makeALANGheadline.R")) # Create ALANG header + +ALANG <- ALANG[,c(1:19,11:19)] # Extend table with additional columns + +ALANG <- add_row(ALANG,'1' = "DataFeed IRP imports") # Create command + +ALANG$Value <- paste0("DATAPATH",filename$RHS) + +ALANG$S.E. <- paste0("E MX",RSE$Maximum,"; MN",RSE$Minimum,";") + +# Write first 8-tuple (sum of domestic use and imports for each region) + +ALANG$Coef1 <- "-1" + +ALANG$Years <- "1" +ALANG$Margin <- "1" + +ALANG$`Row parent` <- paste0("1:e a CONCPATH",filename$ConcoReg) +ALANG$`Row child` <- "2" +ALANG$`Row grandchild` <- "1-e" + +ALANG$`Column parent` <- "1:e~3" +ALANG$`Column child` <- "1" +ALANG$`Column grandchild` <- "1-e" + +# Write second 8-tuple (subtract sum of domestic use table) + +ALANG$Coef1.1 <- "1" + +ALANG$Years.1 <- "1" +ALANG$Margin.1 <- "1" + +ALANG$`Row parent.1` <- "1-e" +ALANG$`Row child.1` <- "2" +ALANG$`Row grandchild.1` <- "1-e" + +ALANG$`Column parent.1` <- "1:e" +ALANG$`Column child.1` <- "1" +ALANG$`Column grandchild.1` <- "1-e" + +ALANG$`#` <- as.character(1:nrow(ALANG)) +ALANG$Incl <- "Y" +ALANG$Parts <- "2" + +ALANG$`Pre-map` <- "" +ALANG$`Post-map` <- "" +ALANG$`Pre-Map` <- "" +ALANG$`Post-Map` <- "" + +# Call script that writes the ALANG file to the repsective folder in the root + +source(paste0(path$root,"Rscripts/datafeeds_code/datafeed_subroutines/WriteALANG2Folder.R")) + +print(paste0("datafeed_PIOLab_",datafeed_name," finished.")) + +rm(list = ls()) # clear workspace + diff --git a/Rscripts/datafeeds_code/datafeed_PIOLab_BACI.R b/Rscripts/datafeeds_code/datafeed_PIOLab_BACI.R index e3b0879..5a23e2d 100644 --- a/Rscripts/datafeeds_code/datafeed_PIOLab_BACI.R +++ b/Rscripts/datafeeds_code/datafeed_PIOLab_BACI.R @@ -88,8 +88,10 @@ ALANG$RHS$Value <- paste0("DATAPATH/",datafeed_name,"/",ALANG$RHS$`1`,".csv") ALANG$SE$S.E. <- paste0("DATAPATH/",datafeed_name,"/",ALANG$SE$`1`,".csv") vec <- data.frame("pro" = 1:pro_max, - "RHS" = NA, - "SE" = NA) + "RHS" = 0, + "SE" = 0) + +vec[256:266,2:3] <- NA ### 2. Write commands by looping over export regions: @@ -113,11 +115,10 @@ for( i in 1:nrow(index) ) } - ### 3. Merge ALANG sheets and complete missing entries -ALANG <- rbind(ALANG$RHS,ALANG$SE) # Combine SE and RHS commands -ALANG$`#` <- 1:nrow(ALANG) # Add index +ALANG <- rbind(ALANG$RHS,ALANG$SE) # Combine SE and RHS commands +ALANG$`#` <- 1:nrow(ALANG) # Add index ALANG[] <- lapply(ALANG,as.character) # Convert all entries to character ### 4. Call script that writes the ALANG file to the repsective folder in the root diff --git a/Rscripts/datafeeds_code/datafeed_PIOLab_IRPextraction.R b/Rscripts/datafeeds_code/datafeed_PIOLab_IRPextraction.R index d3964d5..898a62d 100644 --- a/Rscripts/datafeeds_code/datafeed_PIOLab_IRPextraction.R +++ b/Rscripts/datafeeds_code/datafeed_PIOLab_IRPextraction.R @@ -13,11 +13,17 @@ if(Sys.info()[1] == "Linux"){ ################################################################################ # Initializing R script (load R packages and set paths to folders etc.) source(paste0(root_folder,"Rscripts/Subroutines/InitializationR.R")) - -path["df_Processed"] <- paste0(path$Processed,"/",datafeed_name) +path["df_Processed"] <- paste0(path$Processed,"/",datafeed_name) # Add datafeed specific path for output data +path["df_conco"] <- paste0(path$Concordance,"/IRP/") # Add datafeed specific path for S2R concordance # Load function to write arrays to files -source(paste0(path$Subroutines,"/Numbers2File.R")) +source( paste0(path$Subroutines,"/Numbers2File.R") ) + +# Read date of concordance for sourc2root industries and products +set <- read.xlsx(xlsxFile = paste0(path$Settings,"/datafeeds_settings/IRP_settings.xlsx"),sheet = 1) + +Conco <- list("process" = read.xlsx(xlsxFile = paste0(path$df_conco,set$date,"_IRP_Extraction_SecConc.xlsx"),sheet = 1), + "flow" = read.xlsx(xlsxFile = paste0(path$df_conco,set$date,"_IRP_Extraction_SecConc.xlsx"),sheet = 2) ) # Loading raw data source(paste0(path$Subroutines,"/Read_ExtractionIRP.R")) @@ -57,17 +63,17 @@ ALANG <- add_row(ALANG, S.E. = paste0("E MX",RSE$Maximum,"; MN",RSE$Minimum,";") ) ALANG$`#` <- 1:nrow(ALANG) -ALANG$Coef1 <- "1" -ALANG$Years <- "1" -ALANG$Margin <- "1" +ALANG$Coef1 <- 1 +ALANG$Years <- 1 +ALANG$Margin <- 1 ALANG$`Row parent` <- "1-e" -ALANG$`Row child` <- "3" -ALANG$`Row grandchild` <- "4" +ALANG$`Row child` <- 3 +ALANG$`Row grandchild` <- root$input$Code[ root$input$Name == "Hematite & Magnetite" ] ALANG$`Column parent` <- "1:e t2 CONCPATH/Root2Root_Reg_Concordance.csv" ALANG$`Column child` <- "1" -ALANG$`Column grandchild` <- "1-4" +ALANG$`Column grandchild` <- paste( Conco$process$Code[Conco$process$binary == 1] , collapse = "," ) ALANG$Incl <- "Y" ALANG$Parts <- "1" @@ -80,3 +86,4 @@ ALANG$`Post-Map` <- "" source(paste0(path$root,"Rscripts/datafeeds_code/datafeed_subroutines/WriteALANG2Folder.R")) print(paste0("datafeed_PIOLab_",datafeed_name," finished.")) + diff --git a/Rscripts/datafeeds_code/datafeed_subroutines/CreateALANGforWSAdata.R b/Rscripts/datafeeds_code/datafeed_subroutines/CreateALANGforWSAdata.R index 91029ec..d8814a2 100644 --- a/Rscripts/datafeeds_code/datafeed_subroutines/CreateALANGforWSAdata.R +++ b/Rscripts/datafeeds_code/datafeed_subroutines/CreateALANGforWSAdata.R @@ -6,36 +6,27 @@ # Initializing R script (R packages, folders etc.): - source(paste0(root_folder,"Rscripts/Subroutines/InitializationR.R")) - path["df_Processed"] <- paste0(path$Processed,"/",datafeed_name) # Add path for processed data print(paste0("datafeed_PIOLab_",datafeed_name," initiated.")) source(paste0(path$Subroutines,"/Numbers2File.R")) # Load fun. to write arrays to files - source(paste0(path$Subroutines,"/Read_ProductionWSA.R")) # Fun. to align data with root classification - # Check if folder with processed data exists and in case delete: - if(dir.exists(path$df_Processed)) unlink(path$df_Processed,recursive = TRUE) - dir.create(path$df_Processed) # Create new (empty) folder # Get relative standard error for smallest and largest values in the data set: - RSE <- filter(read.xlsx(path$RSE_settings),Item == datafeed_name) # Read settings (e.g. page in the specific yearbook) for WSA data feeds: - Settings <- read.xlsx(paste0(path$Settings,"/datafeeds_settings/WSA_settings.xlsx")) - Settings <- Settings[Settings$FeedName == datafeed_name,] # Select which feed @@ -74,12 +65,12 @@ concord <- read.xlsx(xlsxFile = paste0(path$Concordance,"/WSA/WSA_RegionConcorda # Load concordance for sourc2root industries and products -set <- read.xlsx(xlsxFile = paste0(path$Settings,"/datafeeds_settings/WSA_settings.xlsx"),sheet = 2) +set <- read.xlsx(xlsxFile = paste0(path$Settings,"/Base/IE_settings.xlsx"),sheet = 2) path_sel <- list("flow" = paste0(path$Concordance,"/WSA/", - set$date[set$aggregator == "product"],"_WSA_Source2Root_Product.csv"), + set$date[set$aggregator == "sector"],"_WSA_Source2Root_Product.csv"), "process" = paste0(path$Concordance,"/WSA/", - set$date[set$aggregator == "industry"],"_WSA_Source2Root_Industry.csv") + set$date[set$aggregator == "sector"],"_WSA_Source2Root_Industry.csv") ) ConcoInd <- read.table(path_sel$process,sep = ",") @@ -104,7 +95,7 @@ RHS <- matrix(0,nrow = 1,ncol = n_reg) # vector for RHS values all root regions RHS[1,data$Code] <- data$Quantity # Write right-hand-side in vector -ConcoReg <- diag(nrow(root$region)) # Create pseudo aggregator +# ConcoReg <- diag(nrow(root$region)) # Create pseudo aggregator # Set names and paths to data and concordances: @@ -114,7 +105,7 @@ filename <- list("RHS" = paste0("/",datafeed_name,"/",datafeed_name,"_RHS_",year "ConcoInd" = paste0("/WSA_Source2Root_Industry_",datafeed_name,".csv"), "ConcoPro" = paste0("/WSA_Source2Root_Product_",datafeed_name,".csv")) -Numbers2File( ConcoReg, paste0(path$Concordance,filename$ConcoReg)) # Save region aggregator +# Numbers2File( ConcoReg, paste0(path$Concordance,filename$ConcoReg)) # Save region aggregator Numbers2File( RHS, paste0(path$Processed, filename$RHS)) # Write data to folder @@ -134,13 +125,14 @@ ALANG$`Column parent` <- paste0("1:e t2 CONCPATH",filename$ConcoReg) # Write command for elements that are zero: -ALANG <- add_row(ALANG,'1' = paste(datafeed_name,year, "Zero elements")) # Create entry - -ALANG$Value[2] <- paste0("0") -ALANG$S.E.[2] <- paste0("0") -ALANG$`Row grandchild`[2] <- ConcoInd$Zero -ALANG$`Column parent`[2] <- paste0("1-e") +# ALANG <- add_row(ALANG,'1' = paste(datafeed_name,year, "Zero elements")) # Create entry +# +# ALANG$Value[2] <- paste0("0") +# ALANG$S.E.[2] <- paste0("0") +# ALANG$`Row grandchild`[2] <- ConcoInd$Zero +# ALANG$`Column parent`[2] <- paste0("1-e") +# Write other variables ALANG$`Row parent` <- "1-e" ALANG$`Row child` <- "1" diff --git a/Settings/Base/002_BaseRegionClassification.xlsx b/Settings/Base/002_BaseRegionClassification.xlsx new file mode 100644 index 0000000..884a165 Binary files /dev/null and b/Settings/Base/002_BaseRegionClassification.xlsx differ diff --git a/Settings/Base/005_BaseRegionClassification.xlsx b/Settings/Base/005_BaseRegionClassification.xlsx new file mode 100644 index 0000000..6c84340 Binary files /dev/null and b/Settings/Base/005_BaseRegionClassification.xlsx differ diff --git a/Settings/Base/049_BaseRegionClassification.xlsx b/Settings/Base/049_BaseRegionClassification.xlsx new file mode 100644 index 0000000..4051d0f Binary files /dev/null and b/Settings/Base/049_BaseRegionClassification.xlsx differ diff --git a/Settings/Base/Archive/Ind20Pro22v1_BaseSectorClassification.xlsx b/Settings/Base/Archive/Ind20Pro22v1_BaseSectorClassification.xlsx new file mode 100644 index 0000000..2854938 Binary files /dev/null and b/Settings/Base/Archive/Ind20Pro22v1_BaseSectorClassification.xlsx differ diff --git a/Settings/Base/Archive/Ind30Pro40v1_BaseSectorClassification.xlsx b/Settings/Base/Archive/Ind30Pro40v1_BaseSectorClassification.xlsx new file mode 100644 index 0000000..a04fac4 Binary files /dev/null and b/Settings/Base/Archive/Ind30Pro40v1_BaseSectorClassification.xlsx differ diff --git a/Settings/Base/Archive/PIOLab_RootClassification_OLD.xlsx b/Settings/Base/Archive/PIOLab_RootClassification_OLD.xlsx new file mode 100644 index 0000000..390d013 Binary files /dev/null and b/Settings/Base/Archive/PIOLab_RootClassification_OLD.xlsx differ diff --git a/Settings/Base/IE_settings.xlsx b/Settings/Base/IE_settings.xlsx new file mode 100644 index 0000000..ad85d11 Binary files /dev/null and b/Settings/Base/IE_settings.xlsx differ diff --git a/Settings/Base/Ind30Pro39v1_BaseSectorClassification.xlsx b/Settings/Base/Ind30Pro39v1_BaseSectorClassification.xlsx new file mode 100644 index 0000000..c0bed3a Binary files /dev/null and b/Settings/Base/Ind30Pro39v1_BaseSectorClassification.xlsx differ diff --git a/Settings/Root/Legends/Archive/._RootRegionLegend.xlsx b/Settings/Root/Legends/Archive/._RootRegionLegend.xlsx new file mode 100644 index 0000000..c51f873 Binary files /dev/null and b/Settings/Root/Legends/Archive/._RootRegionLegend.xlsx differ diff --git a/Settings/Root/Legends/Archive/._RootSectorLegend.xlsx b/Settings/Root/Legends/Archive/._RootSectorLegend.xlsx new file mode 100644 index 0000000..4478dc5 Binary files /dev/null and b/Settings/Root/Legends/Archive/._RootSectorLegend.xlsx differ diff --git a/Settings/Root/Legends/Archive/.~lock.RootRegionLegend.xlsx# b/Settings/Root/Legends/Archive/.~lock.RootRegionLegend.xlsx# new file mode 100644 index 0000000..80fff98 --- /dev/null +++ b/Settings/Root/Legends/Archive/.~lock.RootRegionLegend.xlsx# @@ -0,0 +1 @@ +,hwie3321,gateway.physics.usyd.edu.au,26.02.2020 13:19,file:///suphys/hwie3321/.config/libreoffice/4; \ No newline at end of file diff --git a/Settings/Root/Legends/Archive/RootRegionLegend.xlsx b/Settings/Root/Legends/Archive/RootRegionLegend.xlsx new file mode 100644 index 0000000..40e765e Binary files /dev/null and b/Settings/Root/Legends/Archive/RootRegionLegend.xlsx differ diff --git a/Settings/Root/Legends/Archive/RootSectorLegend.xlsx b/Settings/Root/Legends/Archive/RootSectorLegend.xlsx new file mode 100644 index 0000000..6ad69b8 Binary files /dev/null and b/Settings/Root/Legends/Archive/RootSectorLegend.xlsx differ diff --git a/Settings/Root/Legends/PIOLab_RootClassification.xlsx b/Settings/Root/Legends/PIOLab_RootClassification.xlsx new file mode 100644 index 0000000..2c298f1 Binary files /dev/null and b/Settings/Root/Legends/PIOLab_RootClassification.xlsx differ diff --git a/Settings/datafeeds_settings/IRP_settings.xlsx b/Settings/datafeeds_settings/IRP_settings.xlsx new file mode 100644 index 0000000..d3b6c09 Binary files /dev/null and b/Settings/datafeeds_settings/IRP_settings.xlsx differ diff --git a/Settings/datafeeds_settings/WSA_settings.xlsx b/Settings/datafeeds_settings/WSA_settings.xlsx index 1448156..ca3c754 100644 Binary files a/Settings/datafeeds_settings/WSA_settings.xlsx and b/Settings/datafeeds_settings/WSA_settings.xlsx differ diff --git a/Settings/datafeeds_settings/df_RSE_settings.xlsx b/Settings/datafeeds_settings/df_RSE_settings.xlsx new file mode 100644 index 0000000..a5290f6 Binary files /dev/null and b/Settings/datafeeds_settings/df_RSE_settings.xlsx differ diff --git a/datafeeds_code/Archive/datafeed_PIOLab_IRPexports.m b/datafeeds_code/Archive/datafeed_PIOLab_IRPexports.m new file mode 100644 index 0000000..468137a --- /dev/null +++ b/datafeeds_code/Archive/datafeed_PIOLab_IRPexports.m @@ -0,0 +1,5 @@ +function datafeed_PIOLab_IRPexports(handles) + +system('Rscript /import/emily1/isa/IELab/Roots/PIOLab/Rscripts/datafeeds_code/datafeed_PIOLab_IRPexports.R','-echo'); + +end \ No newline at end of file diff --git a/datafeeds_code/Archive/datafeed_PIOLab_IRPimports.m b/datafeeds_code/Archive/datafeed_PIOLab_IRPimports.m new file mode 100644 index 0000000..7ec22a9 --- /dev/null +++ b/datafeeds_code/Archive/datafeed_PIOLab_IRPimports.m @@ -0,0 +1,5 @@ +function datafeed_PIOLab_IRPimports(handles) + +system('Rscript /import/emily1/isa/IELab/Roots/PIOLab/Rscripts/datafeeds_code/datafeed_PIOLab_IRPimports.R','-echo'); + +end \ No newline at end of file