FFSM++  1.1.0
French Forest Sector Model ++
output_parser_globals.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
3 
4 # 0 - parameters
5 
6 # input data filenames
7 # input data expected format
8 # - scen;parName;country;region;forType;diamClass;year;value;
9 
10 forIFiles = []
11 prodIFiles = []
12 carbonIFiles = []
13 
14 scenarios = {}
15 years = []
16 printChartsFlag = False
17 printTablesFlag = False
18 printAATablesFlag = False
19 
20 chartoutdir = 'charts'
21 tableoutdir = 'tables'
22 tablesmaster = '00_master_tables'
23 chartsmaster = '00_master_charts'
24 charttype = 'pdf'
25 sep = ';'
26 
27 
28 
29 countries = {'FRA': [['AlsChaLor','AquPoi','AuvLim','BasHau','BouFra','BrePay','Cen','Cor','IleNorPic','LanPro','Mid','Rho'],'France']}
30 
31 regions = {'AlsChaLor': 'Alsace ; Champagne Ardenne ; Lorraine',
32  'AquPoi': 'Aquitaine ; Poitou Charentes',
33  'AuvLim': 'Auvergne ; Limousin',
34  'BasHau': 'Basse Normandie ; Haute Normandie',
35  'BouFra': 'Bourgogne : Franche Comté',
36  'BrePay': 'Bretagne ; pays de la Loire',
37  'Cen': 'Centre Val de Loire',
38  'Cor': 'Corse',
39  'IleNorPic': 'Ile de France ; Nord Pas de Calais ; Picardie',
40  'LanPro': 'Languedoc Roussillon ; Provence Alpes Côtes d\'Azur',
41  'Mid': 'Midi Pyrénées',
42  'Rho': 'Rhône Alpes',}
43 
44 # key: var short name
45 # value: turple with long name, unit and optionally variable to act for ponderation and name of aggregated variable. 20160815: added info if the ponderation variable is specific for the same ft (keywork: 'sameft') or global for all the forest types ('globalft')
46 # These should be called forVars
47 forVars = {'hV': ['Harvested volumes', r"$Mm^3$"],
48  'vReg': ['Regeneration volumes', r"$Mm^3$"],
49  'vol': ['Forest volumes', r"$Mm^3$"],
50  'sumExpReturns': ['Sum of expected returns', r"€"],
51  #'expReturns': ['Expected returns','€/ha','forArea', 'totalExpReturns','globalft'], # the script doesn't use sumExpReturns, it computes itself the value using the pounderation variable and put the value in this temporary variable . Then it does compute the total aggregate using this intermediate variable (as it should be).
52  'expReturns': ['Expected returns','€/ha'],
53  'forArea': ['Forest area','ha'],
54  'harvestedArea': ['Harvested area','ha'],
55  'regArea': ['Regeneration area','ha'],
56  'STOCK_INV': ['Carbon pool in inventoried forest resources', r"$Mt CO_2$"],
57  'STOCK_EXTRA': ['Carbon pool in non-inventoried forest resources (branches, roots)', r"$Mt CO_2$"],
58  'STOCK_PRODUCTS': ['Carbon pool in forest products', r"$Mt CO_2$"],
59  'EM_ENSUB': ['Cumulative emissions from energy substitution', r"$Mt CO_2$"],
60  'EM_MATSUB': ['Cumulative emissions from material substitution', r"$Mt CO_2$"],
61  'EM_FOROP': ['Cumulative emissions from forest operations', r"$Mt CO_2$"],
62  }
63 # key: var short name
64 # value: list with long name, unit, domain (either pp, tp or p) and optionally a variable to act for ponderation
65 prodVars = {'st': ['Total supply', r"$Mm^3$", 'p'],
66  'pl': ['Local price', r"$Mm^3$", 'p', 'st'],
67  }
68 
69 spGroups = ['Fut_Feu', 'Fut_Mix', 'Fut_Con', 'Mel_Feu', 'Mel_Mix', 'Tail_Feu',]
70 
71 pProd = ['hardWRoundW','softWRoundW','pulpWFuelW','ashRoundW']
72 tProd=['fuelW','hardWSawnW','softWSawnW','plyW','pulpW','pannels','ashSawnW','ashPlyW']
73 
74 
75 
76 
77 #key: human name
78 #value[0]: list of sp groups
79 #value[1]: chart line type
80 #value[2]: chart line width
81 #value[3]: (optional) alias in the data. If present, the input data will be converted to the name at input time
82 spAggregates = {'00_Total': [['Fut_Feu', 'Fut_Mix', 'Fut_Con', 'Mel_Feu', 'Mel_Mix', 'Tail_Feu',],'-',4,''],
83  '01_Broadleaved': [['Fut_Feu', 'Mel_Feu','Tail_Feu'],'--',3,'broadL'],
84  '02_Coniferous': [['Fut_Con'],':',3,'con'],
85  '03_Mixed': [['Fut_Mix','Mel_Mix'],'-.',3,'mixedBC']
86  }
87 
88 tvalue001 = [63.6567411629, 9.9248432009, 5.8409093097, 4.6040948714, 4.0321429836, 3.7074280213, 3.4994832974, 3.3553873313, 3.2498355416, 3.1692726726, 3.1058065155, 3.0545395894, 3.0122758387, 2.9768427344, 2.9467128835, 2.9207816224, 2.8982305197, 2.8784404727, 2.8609346065, 2.8453397098, 2.831359558, 2.8187560606, 2.8073356838, 2.7969395048, 2.7874358137, 2.7787145333, 2.7706829571, 2.7632624555, 2.7563859037, 2.7499956536, 2.7440419193, 2.738481482, 2.7332766424, 2.7283943671, 2.7238055892, 2.7194846305, 2.7154087215, 2.7115576019, 2.7079131835, 2.7044592674, 2.7011813036, 2.6980661862, 2.6951020792, 2.6922782657, 2.6895850194, 2.6870134922, 2.6845556179, 2.682204027, 2.6799519736, 2.6777932709] # invt for alpha=0.01
89 tvalue0001 = [636.6192487687, 31.5990545764, 12.9239786367, 8.6103015814, 6.8688266259, 5.9588161788, 5.4078825209, 5.0413054334, 4.7809125859, 4.5868938587, 4.4369793382, 4.3177912836, 4.2208317277, 4.1404541127, 4.0727651959, 4.0149963272, 3.9651262721, 3.9216458251, 3.8834058526, 3.8495162749, 3.8192771643, 3.7921306717, 3.7676268043, 3.7453986193, 3.7251439497, 3.7066117435, 3.6895917135, 3.6739064007, 3.6594050195, 3.645958635, 3.6334563498, 3.6218022599, 3.6109130077, 3.6007157974, 3.5911467758, 3.5821497015, 3.5736748444, 3.5656780716, 3.5581200813, 3.5509657609, 3.544183643, 3.5377454453, 3.5316256778, 3.5258013065, 3.520251465, 3.5149572055, 3.5099012834, 3.5050679705, 3.5004428914, 3.4960128818] # invt for alpha=0.001
90 
91 
92 
93 
94 # -----------------------------------------------------------------------------
95 # global containers, don't touch
96 idata = {}
97 odata = {}
98 x = []
99 sortedregions = []
100 products= pProd+tProd