Skip to content

Commit

Permalink
Enable -precip_lapse_scaling also for -surface pdd
Browse files Browse the repository at this point in the history
and fixed typo in -smb_lapse_scaling config
  • Loading branch information
talbrecht committed Nov 25, 2017
1 parent b9e1378 commit 9d148b8
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
9 changes: 7 additions & 2 deletions src/coupler/atmosphere/LapseRates.cc
Expand Up @@ -58,7 +58,6 @@ void LapseRates::init_impl() {
//This is basically temperature lapse rate 8.2 K/Km as in TemperaturPIK times precipitation scale rate 5%/K )
m_precip_scale_factor = m_config->get_double("atmosphere.precip_lapse_scale_factor");


if (do_precip_scale){

m_log->message(2,
Expand All @@ -84,6 +83,7 @@ void LapseRates::init_impl() {

void LapseRates::mean_precipitation_impl(IceModelVec2S &result) const {
m_input_model->mean_precipitation(result);

if (do_precip_scale) {
lapse_rate_scale(result, m_precip_scale_factor);
} else {
Expand Down Expand Up @@ -143,7 +143,12 @@ void LapseRates::precip_time_series_impl(int i, int j, std::vector<double> &resu
assert(m_surface != NULL);

for (unsigned int m = 0; m < m_ts_times.size(); ++m) {
result[m] -= m_precip_lapse_rate * ((*m_surface)(i, j) - usurf[m]);

if (do_precip_scale) {
result[m] *= exp(m_precip_lapse_rate * ((*m_surface)(i, j) - usurf[m]));
} else {
result[m] -= m_precip_lapse_rate * ((*m_surface)(i, j) - usurf[m]);
}
}
}

Expand Down
3 changes: 2 additions & 1 deletion src/coupler/surface/LapseRates.cc
Expand Up @@ -33,7 +33,7 @@ LapseRates::LapseRates(IceGrid::ConstPtr g, SurfaceModel* in)
m_option_prefix = "-surface_lapse_rate";

m_smb_scale_factor = 0.0;
do_smb_scale = m_config->get_double("surface.smb_lapse_rate");
do_smb_scale = m_config->get_boolean("surface.smb_lapse_scaling");

}

Expand Down Expand Up @@ -84,6 +84,7 @@ void LapseRates::init_impl() {

void LapseRates::mass_flux_impl(IceModelVec2S &result) const {
m_input_model->mass_flux(result);

if (do_smb_scale) {
lapse_rate_scale(result, m_smb_scale_factor);
} else {
Expand Down
1 change: 1 addition & 0 deletions src/coupler/surface/TemperatureIndex.cc
Expand Up @@ -421,6 +421,7 @@ void TemperatureIndex::update_impl(double t, double dt) {
// the precipitation time series from AtmosphereModel and its modifiers
m_atmosphere->precip_time_series(i, j, P);


// convert precipitation from "kg m-2 second-1" to "m second-1" (PDDMassBalance expects
// accumulation in m/second ice equivalent)
for (int k = 0; k < N; ++k) {
Expand Down
6 changes: 3 additions & 3 deletions src/pism_config.cdl
Expand Up @@ -62,7 +62,7 @@ netcdf pism_config {
pism_config:atmosphere.precip_exponential_factor_for_temperature_type = "scalar";
pism_config:atmosphere.precip_exponential_factor_for_temperature_units = "Kelvin-1";

pism_config:atmosphere.precip_lapse_scaling = "false";
pism_config:atmosphere.precip_lapse_scaling = "no";
pism_config:atmosphere.precip_lapse_scaling_doc = "Enable precipitation scaling according to change in surface elevation";
pism_config:atmosphere.precip_lapse_scaling_option = "precip_lapse_scaling";
pism_config:atmosphere.precip_lapse_scaling_type = "boolean";
Expand Down Expand Up @@ -1521,9 +1521,9 @@ netcdf pism_config {
pism_config:surface.pdd.std_dev_use_param_doc = "Parameterize standard deviation as a linear function of air temperature over ice-covered grid cells. The region of application is controlled by geometry.ice_free_thickness_standard.";
pism_config:surface.pdd.std_dev_use_param_type = "boolean";

pism_config:surface.smb_lapse_scaling = "false";
pism_config:surface.smb_lapse_scaling = "no";
pism_config:surface.smb_lapse_scaling_doc = "Enable surface mass balance scaling according to change in surface elevation";
pism_config:surface.smb_scaling_option = "smb_lapse_scaling";
pism_config:surface.smb_lapse_scaling_option = "smb_lapse_scaling";
pism_config:surface.smb_lapse_scaling_type = "boolean";

pism_config:surface.smb_lapse_scale_factor = 0.5;
Expand Down

0 comments on commit 9d148b8

Please sign in to comment.