-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add volcanic scaling factor #291
Changes from 1 commit
4a852ef
8d05973
85126a1
163b328
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -92,6 +92,7 @@ void TemperatureComponent::init( Core* coreptr ) { | |
diff.set( 0.55, U_CM2_S ); // default ocean heat diffusivity, cm2/s. value is CDICE default (varname is kappa there). | ||
S.set( 3.0, U_DEGC ); // default climate sensitivity, K (varname is t2co in CDICE). | ||
alpha.set( 1.0, U_UNITLESS); // default aerosol scaling, unitless (similar to alpha in CDICE). | ||
volscl.set(1.0, U_UNITLESS); // Default volcanic scaling, unitless (works the same way as alpha) | ||
|
||
// Register the data we can provide | ||
core->registerCapability( D_GLOBAL_TEMP, getComponentName() ); | ||
|
@@ -111,6 +112,7 @@ void TemperatureComponent::init( Core* coreptr ) { | |
core->registerInput(D_ECS, getComponentName()); | ||
core->registerInput(D_DIFFUSIVITY, getComponentName()); | ||
core->registerInput(D_AERO_SCALE, getComponentName()); | ||
core->registerInput(D_VOLCANIC_SCALE, getComponentName()); | ||
} | ||
|
||
//------------------------------------------------------------------------------ | ||
|
@@ -151,6 +153,9 @@ void TemperatureComponent::setData( const string& varName, | |
} 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_TGAV_CONSTRAIN ) { | ||
H_ASSERT( data.date != Core::undefinedIndex(), "date required" ); | ||
tgav_constrain.set(data.date, data.getUnitval(U_DEGC)); | ||
|
@@ -324,8 +329,11 @@ void TemperatureComponent::run( const double runToDate ) throw ( h_exception ) { | |
double aero_forcing = | ||
double(core->sendMessage( M_GETDATA, D_RF_BC ).value( U_W_M2 )) + double(core->sendMessage( M_GETDATA, D_RF_OC).value( U_W_M2 )) + | ||
double(core->sendMessage( M_GETDATA, D_RF_SO2d ).value( U_W_M2 )) + double(core->sendMessage( M_GETDATA, D_RF_SO2i ).value( U_W_M2 )); | ||
double volcanic_forcing = double(core->sendMessage(M_GETDATA, D_RF_VOL)); | ||
|
||
forcing[tstep] = double(core->sendMessage( M_GETDATA, D_RF_TOTAL ).value( U_W_M2 )) - ( 1.0 - alpha ) * aero_forcing; | ||
forcing[tstep] = double(core->sendMessage(M_GETDATA, D_RF_TOTAL).value(U_W_M2)) | ||
- (1.0 - alpha) * aero_forcing | ||
- (1.0 - volscl) * volcanic_forcing; | ||
|
||
// Initialize variables for time-stepping through the model | ||
double DQ1 = 0.0; | ||
|
@@ -441,8 +449,8 @@ unitval TemperatureComponent::getData( const std::string& varName, | |
returnval = heatflux; | ||
} else if( varName == D_ECS ) { | ||
returnval = S; | ||
} else if(varName == D_AERO_SCALE) { | ||
returnval = alpha; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why did you delete the alpha here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It was a duplicate. Alpha is already processed on lines 434-435 (old numbering). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ah, gotcha! |
||
} else if(varName == D_VOLCANIC_SCALE) { | ||
returnval = volscl; | ||
} else { | ||
H_THROW( "Caller is requesting unknown variable: " + varName ); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps both scaling factors' comments should note centered around 1, i.e. 1.0 = no scaling?