Skip to content

Commit

Permalink
Pull request #253: Enl/bugfix/feb2022
Browse files Browse the repository at this point in the history
Merge in JGCRI/gcam-core from enl/bugfix/feb2022 to master

* commit '891304dcd5e8d8b8293b5c7a24e02c8c7c21d0a1': (42 commits)
  Some last minute fixes: * Fix GCAM-USA config to have global non-CO2 inputs in the right place, reducing warning messages * Fix global_ghg_link.xml to set price/demand adjust from 1975 to avoid warnings about them not being set * Fix Other industry rewrite in the CO2 emissions by assigned sector query
  Remove unnecesary constraint files
  Solver tweaks, potentially reducing robustness but I think will have more consistency in iteration counts from run to run
  Switch to using trn_freight_truck to break H2 truck simultaneities
  Update TF 2.6 initial guesses which we do for each release
  Undo unintentional comment out of bio_extern in configuration_ref
  Fix for NEI processing chunk which fails with latest R packages
  Fixes to queries.  Note: I haven't checked GCAM-USA yet.
  Bump the version.h to 6.0
  Resolve warning wrt prediction from a rank-deficient fit may be misleading
  Rebuild documentation and take care of a few warnings
  Some changes to support gcamwrapper: - Allows us to reset and create a new GCAM instance in the same session - Use price/quantity scales from EDFun which get adjusted over the forcasted ones which were used previously. - Directly manage reseting the STATE since the indirect method used previously is also tied up in the parallelism strategy used.
  Replace driver with driver_drake in usermod vignette
  Pull request #263: Gcamdata changes
  Update config files for missed other_industry renaming including the SSPs
  add trial markets to the "electricity" and "refining" sectors to help with model solution
  Fix round off bug caused by using the constant `0` in a ternary expression with a `Value` instead of `0.0`.  This was causing a slightly wrong lower bound supply price to be calculated.  Ultimately leading to solution failures in `dispatch 0` for all of our target finder runs since the detailed industry merged (the subsequent dispatches are able to recover just fine).
  Format constants correctly
  Remove successive mutates and forbidden functions
  Drop energy_balance and storage tables from VS proj file
  ...
  • Loading branch information
pralitp committed Jun 7, 2022
2 parents d330871 + 891304d commit 8d00382
Show file tree
Hide file tree
Showing 198 changed files with 9,493 additions and 2,084 deletions.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@

xml:
cd input/gcamdata && Rscript -e "devtools::load_all('.')" -e "driver(write_output=FALSE, write_xml=TRUE)"

install_hector:
git submodule update --init cvs/objects/climate/source/hector

3 changes: 0 additions & 3 deletions cvs/objects/build/linux/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@ main_dir : libgcam.a
@date


install_hector:
git submodule update --init ../../climate/source/hector

# target for debugging configure.gcam
varchk:
@echo GCAMLIB_HOME: $(GCAMLIB_HOME)
Expand Down
29 changes: 28 additions & 1 deletion cvs/objects/build/linux/configure.gcam
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ endif
ifeq ($(strip $(CC)),)
CC = gcc
endif
CXXOPTIM = -O2 -pthread
CXXOPTIM = -O3 -pthread
CXXDEBUG = -ggdb -DNDEBUG -DFUSION_MAX_VECTOR_SIZE=30
CXXBASEOPTS = $(CXXDEBUG)

Expand Down Expand Up @@ -58,6 +58,10 @@ ifeq ($(USE_HECTOR),1)

HECTOR_INCLUDE = -I../../climate/source/hector/headers

ifeq ($(strip $(BOOST_LIB)),)
$(error Unable to detect Boost lib path, please set env variable BOOST_LIB)
endif

HECTOR_LIB = -L$(BOOST_LIB) -Wl,-rpath,$(BOOST_LIB) -lhector -lboost_system -lboost_filesystem
endif # if(USE_HECTOR==1)

Expand All @@ -83,11 +87,26 @@ else
endif
#
ifneq ($(USE_GCAM_PARALLEL),0)
ifeq ($(strip $(TBB_INC)),)
$(error Unable to detect TBB include path, please set env variable TBB_INCLUDE)
endif
ifeq ($(strip $(TBB_LIBRARY)),)
$(error Unable to detect TBB lib path, please set env variable TBB_LIB)
endif
TBB_LIB_IMPORT = -l$(LIBTBB) -l$(LIBTBBMALLOC) -l$(LIBTBBMALLOC_PROXY)
endif

# Set up Java paths for compiling via environment variables if we are using it
ifneq ($(HAVE_JAVA),0)
ifeq ($(strip $(JAVA_INCLUDE)),)
$(error Unable to detect Java include path, please set env variable JAVA_INCLUDE)
endif
ifeq ($(strip $(JAVA_LIB)),)
$(error Unable to detect Java lib path, please set env variable JAVA_LIB)
endif
ifeq ($(strip $(JARS_LIB)),)
$(error Unable to detect Jar lib path, please set env variable JARS_LIB)
endif
## custom values set by environment variables
OSNAME_LOWERCASE := $(shell uname -s | tr '[:upper:]' '[:lower:]')
JAVAINC = -I$(JAVA_INCLUDE) -I$(JAVA_INCLUDE)/$(OSNAME_LOWERCASE)
Expand All @@ -108,6 +127,14 @@ endif
### locations of library include files
# BOOST_INCLUDE should be set in the user environment on Evergreen by running 'tap boost'.
BOOSTINC = $(BOOST_INCLUDE)
ifeq ($(strip $(BOOST_INCLUDE)),)
$(error Unable to detect Boost include path, please set env variable BOOST_INCLUDE)
endif


ifeq ($(strip $(EIGEN_INCLUDE)),)
$(error Unable to detect Eigen include path, please set env variable EIGEN_INCLUDE)
endif

#
### locations of libraries
Expand Down
6 changes: 1 addition & 5 deletions cvs/objects/build/vc10/objects.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -743,10 +743,8 @@
<ClCompile Include="..\..\util\curves\source\xy_data_point.cpp" />
<ClCompile Include="..\..\consumers\source\consumer.cpp" />
<ClCompile Include="..\..\reporting\source\batch_csv_outputter.cpp" />
<ClCompile Include="..\..\reporting\source\energy_balance_table.cpp" />
<ClCompile Include="..\..\reporting\source\graph_printer.cpp" />
<ClCompile Include="..\..\reporting\source\land_allocator_printer.cpp" />
<ClCompile Include="..\..\reporting\source\storage_table.cpp" />
<ClCompile Include="..\..\reporting\source\xml_db_outputter.cpp" />
<ClCompile Include="..\..\climate\source\magicc_model.cpp" />
<ClCompile Include="..\..\functions\source\aproduction_function.cpp" />
Expand Down Expand Up @@ -1057,9 +1055,7 @@
<ClInclude Include="..\..\util\curves\include\xy_data_point.h" />
<ClInclude Include="..\..\consumers\include\consumer.h" />
<ClInclude Include="..\..\reporting\include\batch_csv_outputter.h" />
<ClInclude Include="..\..\reporting\include\energy_balance_table.h" />
<ClInclude Include="..\..\reporting\include\graph_printer.h" />
<ClInclude Include="..\..\reporting\include\storage_table.h" />
<ClInclude Include="..\..\reporting\include\xml_db_outputter.h" />
<ClInclude Include="..\..\functions\include\aproduction_function.h" />
<ClInclude Include="..\..\functions\include\ces_production_function.h" />
Expand Down Expand Up @@ -1112,4 +1108,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>
12 changes: 0 additions & 12 deletions cvs/objects/build/xcode3/objects.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,8 @@
CD4887A4122873C200F5A88A /* policy_ghg.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD4885A8122873C100F5A88A /* policy_ghg.cpp */; };
CD4887A5122873C200F5A88A /* policy_portfolio_standard.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD4885A9122873C100F5A88A /* policy_portfolio_standard.cpp */; };
CD4887A6122873C200F5A88A /* batch_csv_outputter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD4885BD122873C100F5A88A /* batch_csv_outputter.cpp */; };
CD4887AA122873C200F5A88A /* energy_balance_table.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD4885C1122873C100F5A88A /* energy_balance_table.cpp */; };
CD4887AC122873C200F5A88A /* graph_printer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD4885C3122873C100F5A88A /* graph_printer.cpp */; };
CD4887AF122873C200F5A88A /* land_allocator_printer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD4885C6122873C100F5A88A /* land_allocator_printer.cpp */; };
CD4887B4122873C200F5A88A /* storage_table.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD4885CB122873C100F5A88A /* storage_table.cpp */; };
CD4887B5122873C200F5A88A /* xml_db_outputter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD4885CC122873C100F5A88A /* xml_db_outputter.cpp */; };
CD4887B6122873C200F5A88A /* accumulated_grade.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD4885DA122873C100F5A88A /* accumulated_grade.cpp */; };
CD4887B7122873C200F5A88A /* accumulated_post_grade.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD4885DB122873C100F5A88A /* accumulated_post_grade.cpp */; };
Expand Down Expand Up @@ -536,16 +534,12 @@
CD4885A8122873C100F5A88A /* policy_ghg.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = policy_ghg.cpp; sourceTree = "<group>"; };
CD4885A9122873C100F5A88A /* policy_portfolio_standard.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = policy_portfolio_standard.cpp; sourceTree = "<group>"; };
CD4885AC122873C100F5A88A /* batch_csv_outputter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = batch_csv_outputter.h; sourceTree = "<group>"; };
CD4885B0122873C100F5A88A /* energy_balance_table.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = energy_balance_table.h; sourceTree = "<group>"; };
CD4885B2122873C100F5A88A /* graph_printer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = graph_printer.h; sourceTree = "<group>"; };
CD4885B5122873C100F5A88A /* land_allocator_printer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = land_allocator_printer.h; sourceTree = "<group>"; };
CD4885BA122873C100F5A88A /* storage_table.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = storage_table.h; sourceTree = "<group>"; };
CD4885BB122873C100F5A88A /* xml_db_outputter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = xml_db_outputter.h; sourceTree = "<group>"; };
CD4885BD122873C100F5A88A /* batch_csv_outputter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = batch_csv_outputter.cpp; sourceTree = "<group>"; };
CD4885C1122873C100F5A88A /* energy_balance_table.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = energy_balance_table.cpp; sourceTree = "<group>"; };
CD4885C3122873C100F5A88A /* graph_printer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = graph_printer.cpp; sourceTree = "<group>"; };
CD4885C6122873C100F5A88A /* land_allocator_printer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = land_allocator_printer.cpp; sourceTree = "<group>"; };
CD4885CB122873C100F5A88A /* storage_table.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = storage_table.cpp; sourceTree = "<group>"; };
CD4885CC122873C100F5A88A /* xml_db_outputter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = xml_db_outputter.cpp; sourceTree = "<group>"; };
CD4885CF122873C100F5A88A /* accumulated_grade.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = accumulated_grade.h; sourceTree = "<group>"; };
CD4885D0122873C100F5A88A /* accumulated_post_grade.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = accumulated_post_grade.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1475,10 +1469,8 @@
isa = PBXGroup;
children = (
CD4885AC122873C100F5A88A /* batch_csv_outputter.h */,
CD4885B0122873C100F5A88A /* energy_balance_table.h */,
CD4885B2122873C100F5A88A /* graph_printer.h */,
CD4885B5122873C100F5A88A /* land_allocator_printer.h */,
CD4885BA122873C100F5A88A /* storage_table.h */,
CD4885BB122873C100F5A88A /* xml_db_outputter.h */,
);
path = include;
Expand All @@ -1488,10 +1480,8 @@
isa = PBXGroup;
children = (
CD4885BD122873C100F5A88A /* batch_csv_outputter.cpp */,
CD4885C1122873C100F5A88A /* energy_balance_table.cpp */,
CD4885C3122873C100F5A88A /* graph_printer.cpp */,
CD4885C6122873C100F5A88A /* land_allocator_printer.cpp */,
CD4885CB122873C100F5A88A /* storage_table.cpp */,
CD4885CC122873C100F5A88A /* xml_db_outputter.cpp */,
);
path = source;
Expand Down Expand Up @@ -2242,11 +2232,9 @@
CD4887A4122873C200F5A88A /* policy_ghg.cpp in Sources */,
CD4887A5122873C200F5A88A /* policy_portfolio_standard.cpp in Sources */,
CD4887A6122873C200F5A88A /* batch_csv_outputter.cpp in Sources */,
CD4887AA122873C200F5A88A /* energy_balance_table.cpp in Sources */,
CD4887AC122873C200F5A88A /* graph_printer.cpp in Sources */,
CD3CFCD8238DA5B800016CDB /* food_demand_input.cpp in Sources */,
CD4887AF122873C200F5A88A /* land_allocator_printer.cpp in Sources */,
CD4887B4122873C200F5A88A /* storage_table.cpp in Sources */,
CD4887B5122873C200F5A88A /* xml_db_outputter.cpp in Sources */,
CD4887B6122873C200F5A88A /* accumulated_grade.cpp in Sources */,
CD4887B7122873C200F5A88A /* accumulated_post_grade.cpp in Sources */,
Expand Down
6 changes: 1 addition & 5 deletions cvs/objects/containers/include/region.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@
class Demographic;
class Sector;
class GHGPolicy;
class PolicyPortfolioStandard;
class Curve;
class AResource;
class IInfo;
Expand Down Expand Up @@ -117,10 +116,7 @@ class Region: public INamed, public IVisitable, public AParsable, protected boos
DEFINE_VARIABLE( CONTAINER, "sector", mSupplySector, std::vector<Sector*> ),

/*! \brief vector of pointers to ghg market objects, container for constraints and emissions */
DEFINE_VARIABLE( CONTAINER, "ghg-policies", mGhgPolicies, std::vector<GHGPolicy*> ),

/*! \brief vector of pointers to portfolio standard market objects, container for constraints */
DEFINE_VARIABLE( CONTAINER, "policies", mPolicies, std::vector<PolicyPortfolioStandard*> ),
DEFINE_VARIABLE( CONTAINER, "policies", mGhgPolicies, std::vector<GHGPolicy*> ),

/*! \brief vector of pointers to resource objects */
DEFINE_VARIABLE( CONTAINER, "resource", mResources, std::vector<AResource*> ),
Expand Down
25 changes: 0 additions & 25 deletions cvs/objects/containers/source/region.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,6 @@ typedef std::vector<Sector*>::iterator SectorIterator;
typedef std::vector<Sector*>::const_iterator CSectorIterator;
typedef std::vector<GHGPolicy*>::iterator GHGPolicyIterator;
typedef std::vector<GHGPolicy*>::const_iterator CGHGPolicyIterator;
typedef std::vector<PolicyPortfolioStandard*>::iterator PolicyIterator;
typedef std::vector<PolicyPortfolioStandard*>::const_iterator CPolicyIterator;
typedef std::vector<AResource*>::iterator ResourceIterator;
typedef std::vector<AResource*>::const_iterator CResourceIterator;

Expand All @@ -107,10 +105,6 @@ void Region::clear(){
for( GHGPolicyIterator policyIter = mGhgPolicies.begin(); policyIter != mGhgPolicies.end(); ++policyIter ){
delete *policyIter;
}

for( PolicyIterator policyIter = mPolicies.begin(); policyIter != mPolicies.end(); ++policyIter ){
delete *policyIter;
}

for ( ResourceIterator rescIter = mResources.begin(); rescIter != mResources.end(); ++rescIter ) {
delete *rescIter;
Expand Down Expand Up @@ -151,16 +145,6 @@ void Region::toDebugXML( const int period, ostream& out, Tabs* tabs ) const {
for( CSectorIterator j = mSupplySector.begin(); j != mSupplySector.end(); j++ ){
( *j )->toDebugXML( period, out, tabs );
}

// write out mGhgPolicies objects.
for( CGHGPolicyIterator currPolicy = mGhgPolicies.begin(); currPolicy != mGhgPolicies.end(); ++currPolicy ){
(*currPolicy)->toDebugXML( period, out, tabs );
}

// write out mPolicies objects.
for( CPolicyIterator currPolicy = mPolicies.begin(); currPolicy != mPolicies.end(); ++currPolicy ){
(*currPolicy)->toDebugXML( period, out, tabs );
}

// write out the resources objects.
for( CResourceIterator currResource = mResources.begin(); currResource != mResources.end(); ++currResource ){
Expand Down Expand Up @@ -199,9 +183,6 @@ void Region::completeInit() {
for( GHGPolicyIterator ghgPolicy = mGhgPolicies.begin(); ghgPolicy != mGhgPolicies.end(); ++ghgPolicy ){
(*ghgPolicy)->completeInit( mName );
}
for( PolicyIterator policy = mPolicies.begin(); policy != mPolicies.end(); ++policy ){
(*policy)->completeInit( mName );
}
for( ResourceIterator resourceIter = mResources.begin(); resourceIter != mResources.end(); ++resourceIter ) {
(*resourceIter)->completeInit( mName, mRegionInfo );
}
Expand All @@ -212,9 +193,6 @@ void Region::completeInit() {
* \param aPeriod The model period about to begin.
*/
void Region::initCalc( const int aPeriod ) {
for( auto currPolicy : mPolicies ) {
currPolicy->initCalc( mName, aPeriod );
}
}

/*! \brief Function to finalize objects after a period is solved.
Expand All @@ -233,9 +211,6 @@ void Region::postCalc( const int aPeriod ){
for( ResourceIterator currResource = mResources.begin(); currResource != mResources.end(); ++currResource ){
(*currResource)->postCalc( mName, aPeriod );
}
for( auto currPolicy : mPolicies ) {
currPolicy->postCalc( mName, aPeriod );
}
}

/*! \brief Update a visitor for a Region.
Expand Down
34 changes: 0 additions & 34 deletions cvs/objects/containers/source/world.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@
#include "emissions/include/emissions_summer.h"
#include "emissions/include/luc_emissions_summer.h"
#include "technologies/include/global_technology_database.h"
#include "reporting/include/energy_balance_table.h"
#include "containers/include/market_dependency_finder.h"
#include "technologies/include/global_technology_database.h"
#include "containers/include/iactivity.h"
Expand Down Expand Up @@ -219,20 +218,6 @@ void World::initCalc( const int period ) {
( *i )->initCalc( period );
}

Configuration* conf = Configuration::getInstance();
if( conf->getBool( "CalibrationActive" ) ){
// print an I/O table for debuging before we do any calibration
ILogger& calLog = ILogger::getLogger( "calibration_log" );
calLog.setLevel( ILogger::DEBUG );
for( CRegionIterator reigonIt = mRegions.begin(); reigonIt != mRegions.end(); ++reigonIt ){
// for this table we will want a condensed table without non-calibrated values
// so the user can get an easy to see view of what they put in
EnergyBalanceTable table( (*reigonIt)->getName(), calLog, true, false );
(*reigonIt)->accept( &table, period );
table.finish();
}
}

// Reset the calc counter.
mCalcCounter->startNewPeriod();
#if GCAM_PARALLEL_ENABLED
Expand Down Expand Up @@ -625,28 +610,9 @@ void World::runClimateModel( int aPeriod ) {
*/
bool World::isAllCalibrated( const int period, double calAccuracy, const bool printWarnings ) const {
bool isAllCalibrated = true;
ILogger& calLog = ILogger::getLogger( "calibration_log" );
calLog.setLevel( ILogger::DEBUG );
for( CRegionIterator i = mRegions.begin(); i != mRegions.end(); i++ ){
bool currRegionCalibrated = ( *i )->isAllCalibrated( period, calAccuracy, printWarnings );
isAllCalibrated &= currRegionCalibrated;
// if we did not calibrate this region correctly and we are printing warnings then give the
// user some I/O tables to help them understand what was inconsistent
if( !currRegionCalibrated && printWarnings ) {
// we want to give the user two tables to use one with a condensed view
// with all inputs and outputs so they can see what didn't calibrate
// and another table fully expanded with just the calibrated values
calLog << "Energy balance table where inputs and outputs have been replaced by a"
<< " calibrated value if it exists:" << endl;
EnergyBalanceTable condensedTable( (*i)->getName(), calLog, true, true );
(*i)->accept( &condensedTable, period );
condensedTable.finish();

calLog << "Full energy balalce table with just cal values:" << endl;
EnergyBalanceTable fullTable( (*i)->getName(), calLog, false, false );
(*i)->accept( &fullTable, period );
fullTable.finish();
}
}

return isAllCalibrated;
Expand Down
8 changes: 6 additions & 2 deletions cvs/objects/emissions/source/co2_emissions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ const string& CO2Emissions::getXMLNameStatic(){
return XML_NAME;
}


void CO2Emissions::toDebugXMLDerived( const int aPeriod, ostream& aOut, Tabs* aTabs ) const {
}

Expand Down Expand Up @@ -188,9 +189,11 @@ double CO2Emissions::calcOutputEmissions( const vector<IOutput*>& aOutputs,
const int aPeriod ) const
{
double emissions = 0;
assert(aOutputs.size() > 0);
const double primaryOutput = aOutputs[ 0 ]->getPhysicalOutput( aPeriod );
for( unsigned int i = 0; i < aOutputs.size(); ++i ){
emissions += aOutputs[ i ]->getEmissionsPerOutput( getName(), aPeriod )
* aOutputs[ i ]->getPhysicalOutput( aPeriod );
emissions += aOutputs[ i ]->getEmissionsPerOutput( getName(), aPeriod)
* primaryOutput;
}
return emissions;
}
Expand All @@ -216,6 +219,7 @@ double CO2Emissions::calcInputCO2Emissions( const vector<IInput*>& aInputs, cons
totalEmissions += (*input)->getPhysicalDemand( aPeriod )
* (*input)->getCO2EmissionsCoefficient( getName(), aPeriod );
}

return totalEmissions;
}

Expand Down
2 changes: 1 addition & 1 deletion cvs/objects/functions/source/food_demand_function.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ double FoodDemandFunction::calcDemand( InputSet& aInput, double income, const st

if(alphaTotal > budget) {
ILogger& mainLog = ILogger::getLogger( "main_log" );
mainLog.setLevel( ILogger::WARNING );
mainLog.setLevel( ILogger::DEBUG );
mainLog << "Share of budget spent on FoodDemand: " << alphaTotal << " exceeds total income in " << aRegionName << endl;
}

Expand Down
3 changes: 2 additions & 1 deletion cvs/objects/policy/include/policy_ghg.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
#include "util/base/include/data_definition_util.h"

// Need to forward declare the subclasses as well.
class PolicyPortfolioStandard;
class LinkedGHGPolicy;

/*!
Expand Down Expand Up @@ -84,7 +85,7 @@ class GHGPolicy: public INamed, private boost::noncopyable {
/* Declare all subclasses of GHGPolicy to allow automatic traversal of the
* hierarchy under introspection.
*/
DEFINE_SUBCLASS_FAMILY( GHGPolicy, LinkedGHGPolicy ),
DEFINE_SUBCLASS_FAMILY( GHGPolicy, PolicyPortfolioStandard, LinkedGHGPolicy ),

//! GHG name
DEFINE_VARIABLE( SIMPLE, "name", mName, std::string ),
Expand Down
Loading

0 comments on commit 8d00382

Please sign in to comment.