Skip to content

Commit

Permalink
Alpha and Volscl impact RF output (#745)
Browse files Browse the repository at this point in the history
Here we change where the scalers are applied so that the vol, aerosol, and total forcing outputs are updated appropriately. While this PR does not change hector output or behavior between the parameter name change, there are code-breaking changes that have been made to the ini files. The ini files are not backward compatible. 

---------

Co-authored-by: ptrscll <[email protected]>
  • Loading branch information
kdorheim and ptrscll authored Jul 18, 2024
1 parent ddfffa4 commit 6b91163
Show file tree
Hide file tree
Showing 20 changed files with 118 additions and 92 deletions.
4 changes: 2 additions & 2 deletions data-raw/input_params.csv
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,10 @@ forcing,rho_so2,n,n,y,-7.24E-06,W yr m-2 S Gg-1,IPCC AR6 radiative efficiency SO
forcing,rho_nh3,n,n,y,-0.00208,W yr m-2 NH3 Tg-1,IPCC AR6 radiative efficiency NH3 (7.SM.1.3.1 of IPCC AR6)
forcing,RF_misc,n,n,n,"""(csv)""",,Miscellaneous radiative forcings default set to 0
forcing,RF_misc,n,n,y,0,,"Miscellaneous radiative forcings default set to 0, or read in from a input table, may be used to read in additional forcings not modeled by Hector (i.e. solar, bc on snow , contrails from)"
forcing,aero_scalar,n,n,y,1,(unitless),scaling factor for aerosol forcing
forcing,vol_scalar,n,n,y,1,(unitless),scaling factor for volcanic forcing
temperature,S,n,n,y,3,degC,equilibrium climate sensitivity for 2xCO2
temperature,diff,n,n,y,2.3,cm2 s-1,ocean heat diffusivity
temperature,alpha,n,n,y,1,(unitless),scaling factor for aerosol forcing
temperature,volscl,n,n,y,1,(unitless),scaling factor for volcanic forcing
temperature,qco2,n,n,y,3.75,,CO2 RF (7.3.2 of IPCC AR6)
temperature,tas_constrain,n,y,n,"""(csv)""",,"Optional global temperature constraint; If supplied, the model will use these data, ignoring what it calculates"
bc,BC_emissions,n,y,y,"""(csv)""",,
Expand Down
Binary file modified data/inputstable.rda
Binary file not shown.
Binary file modified data/unitstable.rda
Binary file not shown.
4 changes: 2 additions & 2 deletions inst/include/component_data.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@
#define D_RHO_OC "rho_oc" // BC radiative efficiency
#define D_RHO_SO2 "rho_so2" // SO2 radiative efficiency
#define D_RHO_NH3 "rho_nh3" // NH3 radiative efficiency
#define D_AERO_SCALE "aero_scalar"
#define D_VOLCANIC_SCALE "vol_scalar"

// halocarbon components
#define D_RF_CF4 D_RF_PREFIX CF4_COMPONENT_BASE
Expand Down Expand Up @@ -397,8 +399,6 @@
#define D_GMST "gmst"
#define D_LO_WARMING_RATIO "lo_warming_ratio"
#define D_DIFFUSIVITY "diff"
#define D_AERO_SCALE "alpha"
#define D_VOLCANIC_SCALE "volscl"
#define D_FLUX_MIXED "heatflux_mixed"
#define D_FLUX_INTERIOR "heatflux_interior"
#define D_HEAT_FLUX "heatflux"
Expand Down
5 changes: 4 additions & 1 deletion inst/include/forcing_component.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,10 @@ class ForcingComponent : public IModelComponent {
unitval
rho_nh3; // (W yr m–2 Tg–1) IPCC AR6 radiative efficiency SO2 7.SM.1.3.1

// Aerosol parameters for aerosol-cloud interactions (RFaci) see equation
// Aerosol parameters
unitval alpha; // aerosol forcing factor, unitless
unitval volscl; // volcanic forcing scaling factor, unitless
// Parameters for aerosol-cloud interactions (RFaci) see equation
// Equation 7.SM.1.2 of IPCC AR6
double const aci_beta = 2.279759; // Dorheim et al. 2024
double const s_BCOC = 111.05064063; // (Tg C yr-1) IPCC AR6 7.SM.1.3.1
Expand Down
2 changes: 0 additions & 2 deletions inst/include/temperature_component.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,6 @@ class TemperatureComponent : public IModelComponent {
// Model parameters
unitval S; //!< climate sensitivity for 2xCO2, deg C
unitval diff; //!< ocean heat diffusivity, cm2/s
unitval alpha; //!< aerosol forcing factor, unitless
unitval volscl; //!< volcanic forcing scaling factor, unitless

// Model outputs
unitval tas; //!< global average air temperature anomaly, deg C
Expand Down
4 changes: 2 additions & 2 deletions inst/input/hector_ssp119.ini
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,8 @@ baseyear=1750 ; when to start reporting; by definition, all F=0 in this year

; Optional radiative forcing constraint
;RF_tot_constrain=csv:tables/CONSTRAINT.csv
aero_scalar=1.0 ; (unitless) uncertainty scaling factor for volcanic forcing
vol_scalar=1.0 ; (unitless) uncertainty scaling factor for volcanic forcing
delta_co2=0.05 ; (unitless) forcing tropospheric adjustments for CO2 (7.3.2.1 of IPCC AR6)
delta_ch4=-.14 ; (unitless) forcing tropospheric adjustments for CH4 (7.3.2.2 of IPCC AR6)
delta_n2o=0.07 ; (unitless) forcing tropospheric adjustments for N2O (7.3.2.3 of IPCC AR6)
Expand All @@ -179,8 +181,6 @@ RF_misc[1750]=0
[temperature]
S=3.0 ; equilibrium climate sensitivity for 2xCO2 degC (A.4.4 of IPCC AR6)
diff=2.38 ; ocean heat diffusivity, cm2/s calibrated to historical observations Dorheim et al. 2024 for details
alpha=1.0 ; uncertainty scaling factor for aerosol forcing
volscl=1.0 ; uncertainty scaling factor for volcanic forcing
qco2=3.75 ; 2×CO2 RF (7.3.2 of IPCC AR6)

; Optional global temperature constraint
Expand Down
4 changes: 2 additions & 2 deletions inst/input/hector_ssp126.ini
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,8 @@ baseyear=1750 ; when to start reporting; by definition, all F=0 in this year

; Optional radiative forcing constraint
;RF_tot_constrain=csv:tables/CONSTRAINT.csv
aero_scalar=1.0 ; uncertainty scaling factor for aerosol forcing
vol_scalar=1.0 ; uncertainty scaling factor for volcanic forcing
delta_co2=0.05 ; (unitless) forcing tropospheric adjustments for CO2 (7.3.2.1 of IPCC AR6)
delta_ch4=-.14 ; (unitless) forcing tropospheric adjustments for CH4 (7.3.2.2 of IPCC AR6)
delta_n2o=0.07 ; (unitless) forcing tropospheric adjustments for N2O (7.3.2.3 of IPCC AR6)
Expand All @@ -179,8 +181,6 @@ RF_misc[1750]=0
[temperature]
S=3.0 ; equilibrium climate sensitivity for 2xCO2 degC (A.4.4 of IPCC AR6)
diff=2.38 ; ocean heat diffusivity, cm2/s calibrated to historical observations Dorheim et al. 2024 for details
alpha=1.0 ; uncertainty scaling factor for aerosol forcing
volscl=1.0 ; uncertainty scaling factor for volcanic forcing
qco2=3.75 ; 2×CO2 RF (7.3.2 of IPCC AR6)

; Optional global temperature constraint
Expand Down
4 changes: 2 additions & 2 deletions inst/input/hector_ssp245.ini
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,8 @@ baseyear=1750 ; when to start reporting; by definition, all F=0 in this year

; Optional radiative forcing constraint
;RF_tot_constrain=csv:tables/CONSTRAINT.csv
aero_scalar=1.0 ; (unitless) uncertainty scaling factor for volcanic forcing
vol_scalar=1.0 ; (unitless) uncertainty scaling factor for volcanic forcing
delta_co2=0.05 ; (unitless) forcing tropospheric adjustments for CO2 (7.3.2.1 of IPCC AR6)
delta_ch4=-.14 ; (unitless) forcing tropospheric adjustments for CH4 (7.3.2.2 of IPCC AR6)
delta_n2o=0.07 ; (unitless) forcing tropospheric adjustments for N2O (7.3.2.3 of IPCC AR6)
Expand All @@ -179,8 +181,6 @@ RF_misc[1750]=0
[temperature]
S=3.0 ; equilibrium climate sensitivity for 2xCO2 degC (A.4.4 of IPCC AR6)
diff=2.38 ; ocean heat diffusivity, cm2/s calibrated to historical observations Dorheim et al. 2024 for details
alpha=1.0 ; uncertainty scaling factor for aerosol forcing
volscl=1.0 ; uncertainty scaling factor for volcanic forcing
qco2=3.75 ; 2×CO2 RF (7.3.2 of IPCC AR6)

; Optional global temperature constraint
Expand Down
4 changes: 2 additions & 2 deletions inst/input/hector_ssp370.ini
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,8 @@ baseyear=1750 ; when to start reporting; by definition, all F=0 in this year

; Optional radiative forcing constraint
;RF_tot_constrain=csv:tables/CONSTRAINT.csv
aero_scalar=1.0 ; uncertainty scaling factor for aerosol forcing
vol_scalar=1.0 ; uncertainty scaling factor for volcanic forcing
delta_co2=0.05 ; (unitless) forcing tropospheric adjustments for CO2 (7.3.2.1 of IPCC AR6)
delta_ch4=-.14 ; (unitless) forcing tropospheric adjustments for CH4 (7.3.2.2 of IPCC AR6)
delta_n2o=0.07 ; (unitless) forcing tropospheric adjustments for N2O (7.3.2.3 of IPCC AR6)
Expand All @@ -179,8 +181,6 @@ RF_misc[1750]=0
[temperature]
S=3.0 ; equilibrium climate sensitivity for 2xCO2 degC (A.4.4 of IPCC AR6)
diff=2.38 ; ocean heat diffusivity, cm2/s calibrated to historical observations Dorheim et al. 2024 for details
alpha=1.0 ; uncertainty scaling factor for aerosol forcing
volscl=1.0 ; uncertainty scaling factor for volcanic forcing
qco2=3.75 ; 2×CO2 RF (7.3.2 of IPCC AR6)

; Optional global temperature constraint
Expand Down
4 changes: 2 additions & 2 deletions inst/input/hector_ssp434.ini
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,8 @@ baseyear=1750 ; when to start reporting; by definition, all F=0 in this year

; Optional radiative forcing constraint
;RF_tot_constrain=csv:tables/CONSTRAINT.csv
aero_scalar=1.0 ; uncertainty scaling factor for aerosol forcing
vol_scalar=1.0 ; uncertainty scaling factor for volcanic forcing
delta_co2=0.05 ; (unitless) forcing tropospheric adjustments for CO2 (7.3.2.1 of IPCC AR6)
delta_ch4=-.14 ; (unitless) forcing tropospheric adjustments for CH4 (7.3.2.2 of IPCC AR6)
delta_n2o=0.07 ; (unitless) forcing tropospheric adjustments for N2O (7.3.2.3 of IPCC AR6)
Expand All @@ -179,8 +181,6 @@ RF_misc[1750]=0
[temperature]
S=3.0 ; equilibrium climate sensitivity for 2xCO2 degC (A.4.4 of IPCC AR6)
diff=2.38 ; ocean heat diffusivity, cm2/s calibrated to historical observations Dorheim et al. 2024 for details
alpha=1.0 ; uncertainty scaling factor for aerosol forcing
volscl=1.0 ; uncertainty scaling factor for volcanic forcing
qco2=3.75 ; 2×CO2 RF (7.3.2 of IPCC AR6)

; Optional global temperature constraint
Expand Down
4 changes: 2 additions & 2 deletions inst/input/hector_ssp460.ini
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,8 @@ baseyear=1750 ; when to start reporting; by definition, all F=0 in this year

; Optional radiative forcing constraint
;RF_tot_constrain=csv:tables/CONSTRAINT.csv
aero_scalar=1.0 ; uncertainty scaling factor for aerosol forcing
vol_scalar=1.0 ; uncertainty scaling factor for volcanic forcing
delta_co2=0.05 ; (unitless) forcing tropospheric adjustments for CO2 (7.3.2.1 of IPCC AR6)
delta_ch4=-.14 ; (unitless) forcing tropospheric adjustments for CH4 (7.3.2.2 of IPCC AR6)
delta_n2o=0.07 ; (unitless) forcing tropospheric adjustments for N2O (7.3.2.3 of IPCC AR6)
Expand All @@ -179,8 +181,6 @@ RF_misc[1750]=0
[temperature]
S=3.0 ; equilibrium climate sensitivity for 2xCO2 degC (A.4.4 of IPCC AR6)
diff=2.38 ; ocean heat diffusivity, cm2/s calibrated to historical observations Dorheim et al. 2024 for details
alpha=1.0 ; uncertainty scaling factor for aerosol forcing
volscl=1.0 ; uncertainty scaling factor for volcanic forcing
qco2=3.75 ; 2×CO2 RF (7.3.2 of IPCC AR6)

; Optional global temperature constraint
Expand Down
4 changes: 2 additions & 2 deletions inst/input/hector_ssp534-over.ini
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,8 @@ baseyear=1750 ; when to start reporting; by definition, all F=0 in this year

; Optional radiative forcing constraint
;RF_tot_constrain=csv:tables/CONSTRAINT.csv
aero_scalar=1.0 ; uncertainty scaling factor for aerosol forcing
vol_scalar=1.0 ; uncertainty scaling factor for volcanic forcing
delta_co2=0.05 ; (unitless) forcing tropospheric adjustments for CO2 (7.3.2.1 of IPCC AR6)
delta_ch4=-.14 ; (unitless) forcing tropospheric adjustments for CH4 (7.3.2.2 of IPCC AR6)
delta_n2o=0.07 ; (unitless) forcing tropospheric adjustments for N2O (7.3.2.3 of IPCC AR6)
Expand All @@ -179,8 +181,6 @@ RF_misc[1750]=0
[temperature]
S=3.0 ; equilibrium climate sensitivity for 2xCO2 degC (A.4.4 of IPCC AR6)
diff=2.38 ; ocean heat diffusivity, cm2/s calibrated to historical observations Dorheim et al. 2024 for details
alpha=1.0 ; uncertainty scaling factor for aerosol forcing
volscl=1.0 ; uncertainty scaling factor for volcanic forcing
qco2=3.75 ; 2×CO2 RF (7.3.2 of IPCC AR6)

; Optional global temperature constraint
Expand Down
4 changes: 2 additions & 2 deletions inst/input/hector_ssp585.ini
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,8 @@ baseyear=1750 ; when to start reporting; by definition, all F=0 in this year

; Optional radiative forcing constraint
;RF_tot_constrain=csv:tables/CONSTRAINT.csv
aero_scalar=1.0 ; uncertainty scaling factor for aerosol forcing
vol_scalar=1.0 ; uncertainty scaling factor for volcanic forcing
delta_co2=0.05 ; (unitless) forcing tropospheric adjustments for CO2 (7.3.2.1 of IPCC AR6)
delta_ch4=-.14 ; (unitless) forcing tropospheric adjustments for CH4 (7.3.2.2 of IPCC AR6)
delta_n2o=0.07 ; (unitless) forcing tropospheric adjustments for N2O (7.3.2.3 of IPCC AR6)
Expand All @@ -179,8 +181,6 @@ RF_misc[1750]=0
[temperature]
S=3.0 ; equilibrium climate sensitivity for 2xCO2 degC (A.4.4 of IPCC AR6)
diff=2.38 ; ocean heat diffusivity, cm2/s calibrated to historical observations Dorheim et al. 2024 for details
alpha=1.0 ; uncertainty scaling factor for aerosol forcing
volscl=1.0 ; uncertainty scaling factor for volcanic forcing
qco2=3.75 ; 2×CO2 RF (7.3.2 of IPCC AR6)

; Optional global temperature constraint
Expand Down
10 changes: 6 additions & 4 deletions project_files/Xcode/hector.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@
27B2C270261511C8005DE26D /* spline_forsythe.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 27B2C24D261511C8005DE26D /* spline_forsythe.cpp */; };
27B2C271261511C8005DE26D /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 27B2C24E261511C8005DE26D /* main.cpp */; };
27F2613726B55617004BDD47 /* csv_tracking_visitor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 27962904268F237200333AA3 /* csv_tracking_visitor.cpp */; };
354045FC2913D50A00CA297D /* test_dependency_finder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 273FC38F26A3570B00D5303E /* test_dependency_finder.cpp */; };
354045FB2913CF6600CA297D /* test_csv_file_reader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 273FC39126A3570B00D5303E /* test_csv_file_reader.cpp */; };
354045FA2913C0F300CA297D /* test_core.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 273FC38D26A3570B00D5303E /* test_core.cpp */; };
354045FB2913CF6600CA297D /* test_csv_file_reader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 273FC39126A3570B00D5303E /* test_csv_file_reader.cpp */; };
354045FC2913D50A00CA297D /* test_dependency_finder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 273FC38F26A3570B00D5303E /* test_dependency_finder.cpp */; };
35ACB833285E4F4E0025928F /* h_util.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 275CBFF127AC7CC0009E2AF5 /* h_util.cpp */; };
954D62AE278E005500840656 /* nh3_component.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 954D62AD278E005500840656 /* nh3_component.cpp */; };
954D62AF278E005500840656 /* nh3_component.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 954D62AD278E005500840656 /* nh3_component.cpp */; };
Expand Down Expand Up @@ -607,7 +607,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = "${BOOSTROOT}";
HEADER_SEARCH_PATHS = "${BOOSTINC}";
"HEADER_SEARCH_PATHS[arch=*]" = "${BOOSTROOT}";
LIBRARY_SEARCH_PATHS = "${BOOSTLIB}";
MACOSX_DEPLOYMENT_TARGET = 10.15;
Expand Down Expand Up @@ -664,7 +664,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = "${BOOSTROOT}";
HEADER_SEARCH_PATHS = "${BOOSTINC}";
LIBRARY_SEARCH_PATHS = "${BOOSTLIB}";
MACOSX_DEPLOYMENT_TARGET = 10.15;
MTL_ENABLE_DEBUG_INFO = NO;
Expand All @@ -681,6 +681,7 @@
buildSettings = {
CODE_SIGN_IDENTITY = "-";
CODE_SIGN_STYLE = Automatic;
HEADER_SEARCH_PATHS = "${BOOSTINC}";
LIBRARY_SEARCH_PATHS = "${BOOSTLIB}";
"OTHER_LDFLAGS[arch=*]" = "$(inherited)";
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -692,6 +693,7 @@
buildSettings = {
CODE_SIGN_IDENTITY = "-";
CODE_SIGN_STYLE = Automatic;
HEADER_SEARCH_PATHS = "${BOOSTINC}";
LIBRARY_SEARCH_PATHS = "${BOOSTLIB}";
PRODUCT_NAME = "$(TARGET_NAME)";
};
Expand Down
Empty file.
33 changes: 26 additions & 7 deletions src/forcing_component.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,9 @@ void ForcingComponent::init(Core *coreptr) {
core->registerCapability(D_RHO_SO2, getComponentName());
core->registerCapability(D_RF_SO2, getComponentName());
core->registerCapability(D_RF_ACI, getComponentName());
core->registerCapability(D_AERO_SCALE, getComponentName());
core->registerCapability(D_VOLCANIC_SCALE, getComponentName());

for (int i = 0; i < N_HALO_FORCINGS; ++i) {
core->registerCapability(adjusted_halo_forcings[i], getComponentName());
forcing_name_map[adjusted_halo_forcings[i]] = halo_forcing_names[i];
Expand Down Expand Up @@ -183,6 +186,9 @@ void ForcingComponent::init(Core *coreptr) {
core->registerInput(D_RHO_NH3, getComponentName());
core->registerInput(D_RF_MISC, getComponentName());
core->registerInput(D_FTOT_CONSTRAIN, getComponentName());
core->registerInput(D_AERO_SCALE, getComponentName());
core->registerInput(D_VOLCANIC_SCALE, getComponentName());

}

//------------------------------------------------------------------------------
Expand Down Expand Up @@ -237,6 +243,12 @@ void ForcingComponent::setData(const string &varName,
} else if (varName == D_RHO_SO2) {
H_ASSERT(data.date == Core::undefinedIndex(), "date not allowed");
rho_so2 = data.getUnitval(U_W_M2_GG);
} else if (varName == D_AERO_SCALE) {
H_ASSERT(data.date == Core::undefinedIndex(), "date not allowed");
alpha = data.getUnitval(U_UNITLESS);
} else if (varName == D_VOLCANIC_SCALE) {
H_ASSERT(data.date == Core::undefinedIndex(), "date not allowed");
volscl = data.getUnitval(U_UNITLESS);
} else if (varName == D_FTOT_CONSTRAIN) {
H_ASSERT(data.date != Core::undefinedIndex(), "date required");
Ftot_constrain.set(data.date, data.getUnitval(U_W_M2));
Expand Down Expand Up @@ -422,35 +434,37 @@ void ForcingComponent::run(const double runToDate) {
double E_BC =
core->sendMessage(M_GETDATA, D_EMISSIONS_BC, message_data(runToDate))
.value(U_TG);
double fbc = rho_bc * E_BC;
double fbc = alpha.value(U_UNITLESS) * rho_bc * E_BC;
forcings[D_RF_BC].set(fbc, U_W_M2);

// ---------- Organic carbon ----------
double E_OC =
core->sendMessage(M_GETDATA, D_EMISSIONS_OC, message_data(runToDate))
.value(U_TG);
double foc = rho_oc * E_OC;
double foc = alpha.value(U_UNITLESS) * rho_oc * E_OC;
forcings[D_RF_OC].set(foc, U_W_M2);

// ---------- Sulphate Aerosols ----------
unitval SO2_emission = core->sendMessage(M_GETDATA, D_EMISSIONS_SO2,
message_data(runToDate));
double fso2 = rho_so2 * SO2_emission.value(U_GG_S);
double fso2 = alpha.value(U_UNITLESS) * rho_so2 * SO2_emission.value(U_GG_S);
forcings[D_RF_SO2].set(fso2, U_W_M2);

// ---------- NH3 ----------
double E_NH3 =
core->sendMessage(M_GETDATA, D_EMISSIONS_NH3, message_data(runToDate))
.value(U_TG);
double fnh3 = rho_nh3 * E_NH3;
double fnh3 = alpha.value(U_UNITLESS) * rho_nh3 * E_NH3;
forcings[D_RF_NH3].set(fnh3, U_W_M2);

// ---------- RFaci ----------
// ERF from aerosol-cloud interactions (RFaci)
// Based on Equation 7.SM.1.2 from IPCC AR6 where
double aci_rf =
-1 * aci_beta *
log(1 + (SO2_emission / s_SO2) + ((E_BC + E_OC) / s_BCOC));
// The 0.2 value comes from equally distributing the alpha scalar to all 5
// aerosol RF types.
double aci_rf =
alpha.value(U_UNITLESS) * (-1 * aci_beta *
log(1 + (SO2_emission / s_SO2) + ((E_BC + E_OC) / s_BCOC)));
forcings[D_RF_ACI].set(aci_rf, U_W_M2);
}

Expand All @@ -464,6 +478,7 @@ void ForcingComponent::run(const double runToDate) {
if (core->checkCapability(D_VOLCANIC_SO2)) {
// The volcanic forcings are read in from an ini file.
forcings[D_RF_VOL] =
volscl.value(U_UNITLESS) *
core->sendMessage(M_GETDATA, D_VOLCANIC_SO2, message_data(runToDate));
}

Expand Down Expand Up @@ -540,6 +555,10 @@ unitval ForcingComponent::getData(const std::string &varName,
returnval = rho_so2;
} else if (varName == D_RHO_NH3) {
returnval = rho_nh3;
} else if (varName == D_AERO_SCALE) {
returnval = alpha;
} else if (varName == D_VOLCANIC_SCALE) {
returnval = volscl;
} else if (varName == D_RF_BASEYEAR) {
returnval.set(baseyear, U_UNITLESS);
} else {
Expand Down
Loading

0 comments on commit 6b91163

Please sign in to comment.