Skip to content

Commit

Permalink
Pull request #343: Movers/feature/plcoe v7
Browse files Browse the repository at this point in the history
Merge in JGCRI/gcam-core from movers/feature/plcoe_v7 to master

Squashed commit of the following:

commit 0fe169c4020a331a19fad43847f639cbd89d2f3b
Author: Pralit Patel <pralit.patel@pnnl.gov>
Date:   Wed Jan 8 14:15:30 2025 -0500

    Bump version number for public release

commit 13253bf8faa2bc2174ad278fc600e46e8663e322
Merge: 72fda79 bdcab96
Author: Pralit Patel <pralit.patel@pnnl.gov>
Date:   Tue Dec 24 10:02:34 2024 -0500

    Merge remote-tracking branch 'origin/master' into movers/feature/plcoe_v7

commit 72fda79
Author: Matthew Binsted <matthew.binsted@pnnl.gov>
Date:   Fri Nov 1 14:20:34 2024 -0400

    Minor C++ updates in response to PR review comments.

commit 6a6152f
Author: Matthew Binsted <matthew.binsted@pnnl.gov>
Date:   Thu Oct 10 17:15:30 2024 -0400

    Improve comments in C++ code based on pull request review comments.

commit 21021d9
Author: Matthew Binsted <matthew.binsted@pnnl.gov>
Date:   Wed Oct 9 17:19:24 2024 -0400

    Re-incorporate option for using previous backup-capacity approach to VRE integration. Includes C++ code changes and gcamdata changes (using a switch in constants.R).

commit d13a2e4
Author: Matthew Binsted <matthew.binsted@pnnl.gov>
Date:   Tue Jun 11 00:25:27 2024 -0400

    Minor C++ code cleanup.

commit 7ffc87d
Author: Matthew Binsted <matthew.binsted@pnnl.gov>
Date:   Fri Mar 29 18:24:48 2024 -0400

    Change subsector shareweight interpolation rules for wind and solar.

commit 90602c5
Merge: 5d47ed4 a607cc4
Author: Matthew Binsted <matthew.binsted@pnnl.gov>
Date:   Fri Mar 22 15:41:28 2024 -0400

    Merge branch 'plcoe_v7' of https://github.com/mmowers/gcam-core into plcoe_v7

commit 5d47ed4
Author: Matthew Binsted <matthew.binsted@pnnl.gov>
Date:   Fri Mar 22 15:41:12 2024 -0400

    Bugfix for gcam-usa related to PLCOE setup.

commit a607cc4
Author: Matt Mowers <matt.mowers@gmail.com>
Date:   Mon Mar 18 00:44:36 2024 -0400

    Update comments for new PLCOE and value factor approach

commit fb86da1
Author: Matthew Binsted <matthew.binsted@pnnl.gov>
Date:   Mon Feb 26 18:14:56 2024 -0500

    Fix error related to L2233.Elec_tables_globaltech[cost_SWInterp_Fltr] in module_water_L2233.electricity_water.

commit 8509286
Merge: 912f1b0 5c98b79
Author: Matthew Binsted <matthew.binsted@pnnl.gov>
Date:   Fri Feb 16 01:23:05 2024 -0500

    Merge GCAM v6 PLCOE with GCAM v7.  Code compiles; gcamdata produces all XMLs; GCAM runs and sovles cleanly; results have not yet been vetted.

commit 5c98b79
Author: Matt Mowers <matt.mowers@gmail.com>
Date:   Fri Mar 17 00:15:27 2023 -0400

    Fix electricity technology value factor calculation

commit 9fd62d0
Author: Matt Mowers <matt.mowers@gmail.com>
Date:   Fri Mar 10 13:33:45 2023 -0500

    Separate offshore wind from onshore wind trial market

commit 986ec4a
Author: Matthew Binsted <matthew.binsted@pnnl.gov>
Date:   Mon Mar 6 10:35:35 2023 -0500

    Removing errant declaration of boost::noncopyable.

commit c7b30e7
Author: Matthew Binsted <matthew.binsted@pnnl.gov>
Date:   Wed Mar 1 16:17:36 2023 -0500

    Removing extra qualification ValueFactorCalculator::getValueFactor

commit a3dd830
Author: Matthew Binsted <matthew.binsted@pnnl.gov>
Date:   Tue Feb 14 16:29:55 2023 -0500

    Update to use parsed-in values for value factor equation, rather than hard-coded values.

commit 2850cb2
Author: Matthew Binsted <matthew.binsted@pnnl.gov>
Date:   Fri Feb 3 17:48:33 2023 -0500

    Initial implementation of value factor in GCAM.  Data changes only in this commit (code changes were in a previous commit). Model runs and solves normally, but results have not been explored / vetted.

commit a8ae1aa
Author: Matthew Binsted <matthew.binsted@pnnl.gov>
Date:   Fri Feb 3 17:45:18 2023 -0500

    Initial implementation of value factor in GCAM.  Code changes only in this commit; data changes to follow in a separate commit. Model runs and solves normally, but results have not been explored / vetted.

commit 82e33fe
Author: Matt Mowers <matt.mowers@gmail.com>
Date:   Fri Dec 16 11:58:39 2022 -0500

    Add technology value factor intercept and slope variables for clarity

... and 1 more commit
  • Loading branch information
pralitp committed Jan 8, 2025
1 parent bdcab96 commit 1b4705c
Show file tree
Hide file tree
Showing 39 changed files with 1,620 additions and 509 deletions.
4 changes: 4 additions & 0 deletions cvs/objects/build/vc10/objects.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -642,6 +642,7 @@
<ClCompile Include="..\..\sectors\source\subsector_add_techcosts.cpp" />
<ClCompile Include="..\..\sectors\source\supply_sector.cpp" />
<ClCompile Include="..\..\sectors\source\tran_subsector.cpp" />
<ClCompile Include="..\..\sectors\source\value_factor_calculator.cpp" />
<ClCompile Include="..\..\solution\solvers\source\bisect_all.cpp" />
<ClCompile Include="..\..\solution\solvers\source\bisect_one.cpp" />
<ClCompile Include="..\..\solution\solvers\source\bisect_policy.cpp" />
Expand Down Expand Up @@ -681,6 +682,7 @@
<ClCompile Include="..\..\target_finder\source\rcp_forcing_target.cpp" />
<ClCompile Include="..\..\target_finder\source\secanter.cpp" />
<ClCompile Include="..\..\technologies\source\ag_production_technology.cpp" />
<ClCompile Include="..\..\technologies\source\backup_intermittent_technology.cpp" />
<ClCompile Include="..\..\technologies\source\base_technology.cpp" />
<ClCompile Include="..\..\technologies\source\cal_data_output.cpp" />
<ClCompile Include="..\..\technologies\source\cal_data_output_percap.cpp" />
Expand Down Expand Up @@ -924,6 +926,7 @@
<ClInclude Include="..\..\sectors\include\subsector_add_techcosts.h" />
<ClInclude Include="..\..\sectors\include\supply_sector.h" />
<ClInclude Include="..\..\sectors\include\tran_subsector.h" />
<ClInclude Include="..\..\sectors\include\value_factor_calculator.h" />
<ClInclude Include="..\..\solution\solvers\include\bisect_all.h" />
<ClInclude Include="..\..\solution\solvers\include\bisect_one.h" />
<ClInclude Include="..\..\solution\solvers\include\bisect_policy.h" />
Expand Down Expand Up @@ -970,6 +973,7 @@
<ClInclude Include="..\..\target_finder\include\rcp_forcing_target.h" />
<ClInclude Include="..\..\target_finder\include\secanter.h" />
<ClInclude Include="..\..\technologies\include\ag_production_technology.h" />
<ClInclude Include="..\..\technologies\include\backup_intermittent_technology.h" />
<ClInclude Include="..\..\technologies\include\base_technology.h" />
<ClInclude Include="..\..\technologies\include\cal_data_output.h" />
<ClInclude Include="..\..\technologies\include\cal_data_output_percap.h" />
Expand Down
38 changes: 25 additions & 13 deletions cvs/objects/build/vc10/objects.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -269,12 +269,6 @@
<ClCompile Include="..\..\resources\source\unlimited_resource.cpp">
<Filter>Source Files\resources</Filter>
</ClCompile>
<ClCompile Include="..\..\sectors\source\capacity_limit_backup_calculator.cpp">
<Filter>Source Files\sectors</Filter>
</ClCompile>
<ClCompile Include="..\..\sectors\source\CSP_backup_calculator.cpp">
<Filter>Source Files\sectors</Filter>
</ClCompile>
<ClCompile Include="..\..\sectors\source\energy_final_demand.cpp">
<Filter>Source Files\sectors</Filter>
</ClCompile>
Expand Down Expand Up @@ -935,6 +929,18 @@
<ClCompile Include="..\..\resources\source\trial_value_resource.cpp">
<Filter>Source Files\resources</Filter>
</ClCompile>
<ClCompile Include="..\..\sectors\source\value_factor_calculator.cpp">
<Filter>Source Files\sectors</Filter>
</ClCompile>
<ClCompile Include="..\..\sectors\source\capacity_limit_backup_calculator.cpp">
<Filter>Source Files\sectors</Filter>
</ClCompile>
<ClCompile Include="..\..\sectors\source\CSP_backup_calculator.cpp">
<Filter>Source Files\sectors</Filter>
</ClCompile>
<ClCompile Include="..\..\technologies\source\backup_intermittent_technology.cpp">
<Filter>Source Files\technology</Filter>
</ClCompile>
<ClCompile Include="..\..\technologies\source\ag_storage_technology.cpp">
<Filter>Source Files</Filter>
</ClCompile>
Expand Down Expand Up @@ -1075,12 +1081,6 @@
<ClInclude Include="..\..\sectors\include\afinal_demand.h">
<Filter>Header Files\sectors</Filter>
</ClInclude>
<ClInclude Include="..\..\sectors\include\capacity_limit_backup_calculator.h">
<Filter>Header Files\sectors</Filter>
</ClInclude>
<ClInclude Include="..\..\sectors\include\CSP_backup_calculator.h">
<Filter>Header Files\sectors</Filter>
</ClInclude>
<ClInclude Include="..\..\sectors\include\energy_final_demand.h">
<Filter>Header Files\sectors</Filter>
</ClInclude>
Expand Down Expand Up @@ -1900,8 +1900,20 @@
<ClInclude Include="..\..\technologies\include\output_accounting.h">
<Filter>Header Files\technologies</Filter>
</ClInclude>
<ClInclude Include="..\..\sectors\include\value_factor_calculator.h">
<Filter>Header Files\sectors</Filter>
</ClInclude>
<ClInclude Include="..\..\sectors\include\capacity_limit_backup_calculator.h">
<Filter>Header Files\sectors</Filter>
</ClInclude>
<ClInclude Include="..\..\sectors\include\CSP_backup_calculator.h">
<Filter>Header Files\sectors</Filter>
</ClInclude>
<ClInclude Include="..\..\technologies\include\backup_intermittent_technology.h">
<Filter>Header Files\technologies</Filter>
</ClInclude>
<ClInclude Include="..\..\technologies\include\ag_storage_technology.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>
</Project>
1 change: 1 addition & 0 deletions cvs/objects/functions/include/non_energy_input.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ class Tabs;
*/
class NonEnergyInput: public MiniCAMInput
{
friend class BackupIntermittentTechnology;
friend class IntermittentTechnology;
friend class SolarTechnology;
friend class WindTechnology;
Expand Down
13 changes: 7 additions & 6 deletions cvs/objects/sectors/include/ibackup_calculator.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,17 @@ class Tabs;
// Need to forward declare the subclasses as well.
class CapacityLimitBackupCalculator;
class CSPBackupCalculator;
class ValueFactorCalculator;

/*!
* \ingroup Objects
* \brief Interface which defines methods for calculating an average and
* marginal amount of backup capacity required per unit of output.
* \details Defines an interface to an object which determines the backup
* capacity required for a Sector. The backup capacity is determined
* \brief Interface which defines methods for calculating a value factor or
* backup capacity requirement (average and marginal) per unit of output.
* \details Defines an interface to an object which helps determine the value factor of or
* backup capacity required for a technology. The backup capacity is determined
* per unit of output, but may use trial values to allow computation
* based on the total output. Backup requirements are specific to
* sectors that produce electricity.
* technologies that produce electricity.
* \author Josh Lurz
*/
class IBackupCalculator : public INamed, private boost::noncopyable {
Expand Down Expand Up @@ -152,7 +153,7 @@ class IBackupCalculator : public INamed, private boost::noncopyable {
* hierarchy under introspection.
*/
DEFINE_SUBCLASS_FAMILY( IBackupCalculator, CapacityLimitBackupCalculator,
CSPBackupCalculator )
CSPBackupCalculator, ValueFactorCalculator )
)
};

Expand Down
114 changes: 114 additions & 0 deletions cvs/objects/sectors/include/value_factor_calculator.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
/*
* LEGAL NOTICE
* This computer software was prepared by Battelle Memorial Institute,
* hereinafter the Contractor, under Contract No. DE-AC05-76RL0 1830
* with the Department of Energy (DOE). NEITHER THE GOVERNMENT NOR THE
* CONTRACTOR MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR ASSUMES ANY
* LIABILITY FOR THE USE OF THIS SOFTWARE. This notice including this
* sentence must appear on any copies of this computer software.
*
* EXPORT CONTROL
* User agrees that the Software will not be shipped, transferred or
* exported into any country or used in any manner prohibited by the
* United States Export Administration Act or any other applicable
* export laws, restrictions or regulations (collectively the "Export Laws").
* Export of the Software may require some form of license or other
* authority from the U.S. Government, and failure to obtain such
* export control license may result in criminal liability under
* U.S. laws. In addition, if the Software is identified as export controlled
* items under the Export Laws, User represents and warrants that User
* is not a citizen, or otherwise located within, an embargoed nation
* (including without limitation Iran, Syria, Sudan, Cuba, and North Korea)
* and that User is not otherwise prohibited
* under the Export Laws from receiving the Software.
*
* Copyright 2011 Battelle Memorial Institute. All Rights Reserved.
* Distributed as open-source under the terms of the Educational Community
* License version 2.0 (ECL 2.0). http://www.opensource.org/licenses/ecl2.php
*
* For further details, see: http://www.globalchange.umd.edu/models/gcam/
*
*/


#ifndef _VALUE_FACTOR_CALCULATOR_H_
#define _VALUE_FACTOR_CALCULATOR_H_
#if defined(_MSC_VER)
#pragma once
#endif

/*!
* \file value_factor_calculator.h
* \ingroup Objects
* \brief The ValueFactorCalculator class header file.
* \author Matthew Binsted, Matt Mowers
*/

#include <string>
#include "sectors/include/ibackup_calculator.h"


// Forward declaration
class IInfo;

/*!
* \ingroup Objects
* \brief Interface which defines methods for calculating value factor
* of a technology depending on its market share.
* \details Defines an interface to an object which determines the value
* factor for a technology. The value factor may use trial values of
* market share. Value factors are specific to electricity sector
* technologies.
* \author Matthew Binsted, Matt Mowers
*/
class ValueFactorCalculator : public IBackupCalculator {
public:
ValueFactorCalculator();
virtual ValueFactorCalculator* clone() const;
static const std::string& getXMLNameStatic();
virtual const std::string& getXMLName() const;
virtual bool isSameType(const std::string& aType) const;
virtual const std::string& getName() const;
virtual void toDebugXML(const int aPeriod, std::ostream& aOut, Tabs* aTabs) const;
virtual void initCalc(const IInfo* aTechInfo);

virtual double getMarginalBackupCapacity(const std::string& aSector,
const std::string& aElectricSector,
const std::string& aResource,
const std::string& aRegion,
const double aTechCapacityFactor,
const double aReserveMargin,
const double aAverageGridCapacityFactor,
const int aPeriod) const;

virtual double getAverageBackupCapacity(const std::string& aSector,
const std::string& aElectricSector,
const std::string& aResource,
const std::string& aRegion,
const double aTechCapacityFactor,
const double aReserveMargin,
const double aAverageGridCapacityFactor,
const int aPeriod) const;

virtual double getValueFactor(const std::string& aSector,
const std::string& aElectricSector,
const std::string& aRegion,
const int aPeriod) const;

protected:

// Define data such that introspection utilities can process the data from this
// subclass together with the data members of the parent classes.
DEFINE_DATA_WITH_PARENT(
IBackupCalculator,

//! Y-inercept of linear function which equates intermittent technology share to value factor
DEFINE_VARIABLE( SIMPLE, "value-factor-intercept", mValueFactorIntercept, double ),

//! Slope of linear function which equates intermittent technology share to value factor
DEFINE_VARIABLE( SIMPLE, "value-factor-slope", mValueFactorSlope, double )

)
};

#endif // _VALUE_FACTOR_CALCULATOR_H_
Loading

0 comments on commit 1b4705c

Please # to comment.