Skip to content

Commit

Permalink
simplify qco2
Browse files Browse the repository at this point in the history
  • Loading branch information
kdorheim committed Mar 23, 2022
1 parent 774698f commit 112f0a6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion inst/include/temperature_component.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class TemperatureComponent : public IModelComponent {
double taudif; // interior ocean heat uptake time scale, yr
double tauksl; // sea-land heat exchange time scale, yr
double taukls; // land-sea heat exchange time scale, yr
unitval q2co2; // radiative forcing for atmospheric CO2 doubling (W/m2)
double qco2; // radiative forcing for atmospheric CO2 doubling

std::vector<double> KT0;
std::vector<double> KTA1;
Expand Down
7 changes: 2 additions & 5 deletions src/temperature_component.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ void TemperatureComponent::setData( const string& varName,
volscl = data.getUnitval(U_UNITLESS);
} else if(varName == D_QCO2) {
H_ASSERT( data.date == Core::undefinedIndex(), "date not allowed" );
q2co2 = data.getUnitval(U_UNDEFINED);
qco2 = data.getUnitval(U_UNITLESS).value(U_UNITLESS);
} else if( varName == D_TGAV_CONSTRAIN ) {
H_ASSERT( data.date != Core::undefinedIndex(), "date required" );
tgav_constrain.set(data.date, data.getUnitval(U_DEGC));
Expand Down Expand Up @@ -250,9 +250,6 @@ void TemperatureComponent::prepareToRun() {
// Constants & conversion factors
kcon = secs_per_Year / 10000; // conversion factor from cm2/s to m2/yr;
ocean_area = (1.0 - flnd) * earth_area; // m2
double qco2 = q2co2.value( U_UNDEFINED );



// Calculate climate feedback parameterisation
cnum = rlam * flnd + bsi * (1.0 - flnd); // denominator used to calculate climate senstivity feedback parameters over land & sea
Expand Down Expand Up @@ -594,7 +591,7 @@ unitval TemperatureComponent::getData( const std::string& varName,
returnval = volscl;
} else if( varName == D_QCO2 ) {
H_ASSERT( date == Core::undefinedIndex(), "Date not allowed for q2co2" );
returnval = q2co2;
returnval = unitval(qco2, U_DEGC);
} else if( varName == D_LO_WARMING_RATIO ) {
H_ASSERT( date == Core::undefinedIndex(), "Date not allowed for land ocean warming ratio" );
returnval = lo_warming_ratio;
Expand Down

2 comments on commit 112f0a6

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Differences in Hector outputs

Hello, this is leeyabot! 🤖

The current pull request's outputs do not differ from 3.0.0 (0f2664f).

CML watermark

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Differences in Hector outputs

Hello, this is leeyabot! 🤖

The current pull request's outputs do not differ from 3.0.0 (0f2664f).

CML watermark

Please sign in to comment.