Skip to content

Commit

Permalink
Reimplementing the adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
kdorheim committed Jul 2, 2024
1 parent 17eca52 commit c75f884
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 37 deletions.
15 changes: 8 additions & 7 deletions src/forcing_component.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ void ForcingComponent::run(const double runToDate) {
.value(U_TG);
// The 0.2 value comes from equally distributing the alpha scalar to all 5
// aerosol RF types.
double fbc = 0.2 * alpha.value(U_UNITLESS) * rho_bc * E_BC;
double fbc = rho_bc * E_BC * (1 - 0.2 * (1 - alpha.value(U_UNITLESS)));
forcings[D_RF_BC].set(fbc, U_W_M2);

// ---------- Organic carbon ----------
Expand All @@ -445,15 +445,15 @@ void ForcingComponent::run(const double runToDate) {
.value(U_TG);
// The 0.2 value comes from equally distributing the alpha scalar to all 5
// aerosol RF types.
double foc = 0.2 * alpha.value(U_UNITLESS) * rho_oc * E_OC;
double foc = rho_oc * E_OC * (1 - 0.2 * (1 - alpha.value(U_UNITLESS)));
forcings[D_RF_OC].set(foc, U_W_M2);

// ---------- Sulphate Aerosols ----------
unitval SO2_emission = core->sendMessage(M_GETDATA, D_EMISSIONS_SO2,
message_data(runToDate));
// The 0.2 value comes from equally distributing the alpha scalar to all 5
// aerosol RF types.
double fso2 = 0.2 * alpha.value(U_UNITLESS) * rho_so2 * SO2_emission.value(U_GG_S);
double fso2 = rho_so2 * SO2_emission.value(U_GG_S) * (1 - 0.2 * (1 - alpha.value(U_UNITLESS)));
forcings[D_RF_SO2].set(fso2, U_W_M2);

// ---------- NH3 ----------
Expand All @@ -462,17 +462,18 @@ void ForcingComponent::run(const double runToDate) {
.value(U_TG);
// The 0.2 value comes from equally distributing the alpha scalar to all 5
// aerosol RF types.
double fnh3 = 0.2 * alpha.value(U_UNITLESS) * rho_nh3 * E_NH3;
double fnh3 = rho_nh3 * E_NH3 * (1 - 0.2 * (1 - alpha.value(U_UNITLESS)));
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
// The 0.2 value comes from equally distributing the alpha scalar to all 5
// aerosol RF types.
double aci_rf =
0.2 * alpha.value(U_UNITLESS) * -1 * aci_beta *
log(1 + (SO2_emission / s_SO2) + ((E_BC + E_OC) / s_BCOC));
double aci_rf =
-1 * aci_beta *
log(1 + (SO2_emission / s_SO2) + ((E_BC + E_OC) / s_BCOC)) *
(1 - 0.2 * (1 - alpha.value(U_UNITLESS)));
forcings[D_RF_ACI].set(aci_rf, U_W_M2);
}

Expand Down
31 changes: 1 addition & 30 deletions src/temperature_component.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,6 @@ void TemperatureComponent::init(Core *coreptr) {

// Register our dependencies
core->registerDependency(D_RF_TOTAL, getComponentName());
core->registerDependency(D_RF_BC, getComponentName());
core->registerDependency(D_RF_OC, getComponentName());
core->registerDependency(D_RF_NH3, getComponentName());
core->registerDependency(D_RF_SO2, getComponentName());
core->registerDependency(D_RF_ACI, getComponentName());
core->registerDependency(D_RF_VOL, getComponentName());

// Register the inputs we can receive from outside
core->registerInput(D_ECS, getComponentName());
Expand Down Expand Up @@ -439,31 +433,8 @@ void TemperatureComponent::run(const double runToDate) {

// Some needed inputs
int tstep = runToDate - core->getStartDate();
forcing[tstep] = core->sendMessage(M_GETDATA, D_RF_TOTAL, message_data(runToDate)).value(U_W_M2);

// Calculate the total aresol forcing from aerosol-radiation interactions and
// the aerosol-cloud interactions so that that total aerosol forcing can be
// adjusted by the aerosol forcing scaling factor.
double aero_forcing =
core->sendMessage(M_GETDATA, D_RF_BC, message_data(runToDate))
.value(U_W_M2) +
core->sendMessage(M_GETDATA, D_RF_OC, message_data(runToDate))
.value(U_W_M2) +
core->sendMessage(M_GETDATA, D_RF_NH3, message_data(runToDate))
.value(U_W_M2) +
core->sendMessage(M_GETDATA, D_RF_SO2, message_data(runToDate))
.value(U_W_M2) +
core->sendMessage(M_GETDATA, D_RF_ACI, message_data(runToDate))
.value(U_W_M2);

double volcanic_forcing =
double(core->sendMessage(M_GETDATA, D_RF_VOL, message_data(runToDate)));

// Adjust total forcing to account for the aerosol and volcanic forcing
// scaling factor
const double ftot = core->sendMessage(M_GETDATA, D_RF_TOTAL, message_data(runToDate)).value(U_W_M2);
forcing[tstep] =
double(ftot) -
(0.0) * aero_forcing - (0.0) * volcanic_forcing;

// Initialize variables for time-stepping through the model
double DQ1 = 0.0;
Expand Down

0 comments on commit c75f884

Please sign in to comment.