diff --git a/src/pks/flow/constitutive_relations/wrm/wrm_implicit_permafrost_model.cc b/src/pks/flow/constitutive_relations/wrm/wrm_implicit_permafrost_model.cc index 1f171db6f..244966462 100644 --- a/src/pks/flow/constitutive_relations/wrm/wrm_implicit_permafrost_model.cc +++ b/src/pks/flow/constitutive_relations/wrm/wrm_implicit_permafrost_model.cc @@ -358,17 +358,19 @@ WRMImplicitPermafrostModel::si_frozen_unsaturated_nospline_(double pc_liq, int max_it(max_it_); if (solver_ == "bisection") { - Errors::Message emsg("WRMImplicitPermafrostModel:: invalid solver method \"bisection\", use \"brent\""); + Errors::Message emsg( + "WRMImplicitPermafrostModel:: invalid solver method \"bisection\", use \"brent\""); Exceptions::amanzi_throw(emsg); } else if (solver_ == "toms") { - Errors::Message emsg("WRMImplicitPermafrostModel:: invalid solver method \"bisection\", use \"brent\""); + Errors::Message emsg( + "WRMImplicitPermafrostModel:: invalid solver method \"bisection\", use \"brent\""); Exceptions::amanzi_throw(emsg); } else if (solver_ == "brent") { result = Utils::findRootBrent(func, left, right, eps_, &max_it); } else { Errors::Message emsg; - emsg << "WRMImplicitPermafrostModel: invalid solver method \"" - << solver_ << "\", use \"brent\""; + emsg << "WRMImplicitPermafrostModel: invalid solver method \"" << solver_ + << "\", use \"brent\""; Exceptions::amanzi_throw(emsg); } @@ -378,8 +380,8 @@ WRMImplicitPermafrostModel::si_frozen_unsaturated_nospline_(double pc_liq, if (max_it >= max_it_) { // did not converge? May be ABS converged but not REL converged! std::cerr << "WRMImplicitPermafrostModel did not converge, " << max_it - << " iterations, error = " << func(si) << ", s_i = " << si - << ", PC_{lg,il} = " << pc_liq << "," << pc_ice << std::endl; + << " iterations, error = " << func(si) << ", s_i = " << si + << ", PC_{lg,il} = " << pc_liq << "," << pc_ice << std::endl; if (throw_ok) { Exceptions::amanzi_throw(Errors::CutTimeStep()); } } return si; diff --git a/src/pks/flow/predictor_delegate_bc_flux.cc b/src/pks/flow/predictor_delegate_bc_flux.cc index cf2cfb606..a9b2c5c6d 100644 --- a/src/pks/flow/predictor_delegate_bc_flux.cc +++ b/src/pks/flow/predictor_delegate_bc_flux.cc @@ -104,8 +104,8 @@ PredictorDelegateBCFlux::CreateFunctor_(int f, const Teuchos::Ptr& pres, - double& lambda) + const Teuchos::Ptr& pres, + double& lambda) { #if DEBUG_FLAG std::cout << " Flux correcting face " << f << ": q = " << (*bc_values_)[f] << std::endl; diff --git a/src/pks/pk_bdf_default.cc b/src/pks/pk_bdf_default.cc index 28716f3ec..52ed2a4c7 100644 --- a/src/pks/pk_bdf_default.cc +++ b/src/pks/pk_bdf_default.cc @@ -39,11 +39,11 @@ PK_BDF_Default::Setup() // check if continuation method and require continuation parameter // -- ETC Note this needs fixed if more than one continuation method used if (bdf_plist.isSublist("continuation parameters")) { - S_->Require("continuation_parameter", Tag(name_), name_); + S_->Require(Keys::cleanName(name_) + "_continuation_parameter", Tags::DEFAULT, name_); } // require data for checkpointing timestep size - S_->Require("dt_internal", Tag(name_), name_); + S_->Require(Keys::cleanName(name_) + "_dt_internal", Tags::DEFAULT, name_); } }; @@ -67,13 +67,15 @@ PK_BDF_Default::Initialize() Teuchos::rcp(new BDF1_TI(*this, bdf_plist, solution_, S_)); double dt_init = time_stepper_->initial_timestep(); - S_->Assign("dt_internal", Tag(name_), name_, dt_init); - S_->GetRecordW("dt_internal", Tag(name_), name_).set_initialized(); + S_->Assign(Keys::cleanName(name_) + "_dt_internal", Tags::DEFAULT, name_, dt_init); + S_->GetRecordW(Keys::cleanName(name_) + "_dt_internal", Tags::DEFAULT, name_).set_initialized(); // -- initialize continuation parameter if needed. - if (S_->HasRecord("continuation_parameter", Tag(name_))) { - S_->Assign("continuation_parameter", Tag(name_), name_, (double)1.); - S_->GetRecordW("continuation_parameter", Tag(name_), name_).set_initialized(); + if (S_->HasRecord(Keys::cleanName(name_) + "_continuation_parameter", Tags::DEFAULT)) { + S_->Assign( + Keys::cleanName(name_) + "_continuation_parameter", Tags::DEFAULT, name_, (double)1.); + S_->GetRecordW(Keys::cleanName(name_) + "_continuation_parameter", Tags::DEFAULT, name_) + .set_initialized(); } // -- initialize time derivative @@ -93,7 +95,7 @@ double PK_BDF_Default::get_dt() { if (!strongly_coupled_) - return S_->Get("dt_internal", Tag(name_)); + return S_->Get(Keys::cleanName(name_) + "_dt_internal", Tags::DEFAULT); else return -1.; } @@ -101,7 +103,8 @@ PK_BDF_Default::get_dt() void PK_BDF_Default::set_dt(double dt) { - if (!strongly_coupled_) S_->Assign("dt_internal", Tag(name_), name_, dt); + if (!strongly_coupled_) + S_->Assign(Keys::cleanName(name_) + "_dt_internal", Tags::DEFAULT, name_, dt); } // -- Commit any secondary (dependent) variables. @@ -139,7 +142,7 @@ PK_BDF_Default::AdvanceStep(double t_old, double t_new, bool reinit) // -- dt is the requested timestep size. It must be less than or equal to... // -- dt_internal is the max valid dt, and is set by physics/solvers // -- dt_solver is what the solver wants to do - double dt_internal = S_->Get("dt_internal", Tag(name_)); + double dt_internal = S_->Get(Keys::cleanName(name_) + "_dt_internal", Tags::DEFAULT); // NOTE, still a bug in amanzi#685, despite fixes in amanzi#694, so this assertion still fails --ETC // AMANZI_ASSERT(dt <= dt_internal + 2.e-8); // roundoff @@ -175,7 +178,7 @@ PK_BDF_Default::AdvanceStep(double t_old, double t_new, bool reinit) dt_internal = dt_solver; } - S_->Assign("dt_internal", Tag(name_), name_, dt_internal); + S_->Assign(Keys::cleanName(name_) + "_dt_internal", Tags::DEFAULT, name_, dt_internal); } catch (Errors::TimeStepCrash& e) { // inject more information into the crash message std::stringstream msg_str; @@ -196,7 +199,7 @@ PK_BDF_Default::AdvanceStep(double t_old, double t_new, bool reinit) void PK_BDF_Default::UpdateContinuationParameter(double lambda) { - S_->Assign("continuation_parameter", Tag(name_), name_, lambda); + S_->Assign(Keys::cleanName(name_) + "_continuation_parameter", Tags::DEFAULT, name_, lambda); ChangedSolution(); } diff --git a/src/pks/surface_balance/constitutive_relations/land_cover/albedo_threecomponent_evaluator.cc b/src/pks/surface_balance/constitutive_relations/land_cover/albedo_threecomponent_evaluator.cc index 0c890297a..20a54a87d 100644 --- a/src/pks/surface_balance/constitutive_relations/land_cover/albedo_threecomponent_evaluator.cc +++ b/src/pks/surface_balance/constitutive_relations/land_cover/albedo_threecomponent_evaluator.cc @@ -51,9 +51,7 @@ AlbedoThreeComponentEvaluator::AlbedoThreeComponentEvaluator(Teuchos::ParameterL a_ice_ = plist_.get("albedo ice [-]", 0.44); a_water_ = plist_.get("albedo water [-]", 0.1168); is_constant_snow_albedo_ = plist_.isParameter("albedo snow [-]"); - if (is_constant_snow_albedo_) { - a_snow_ = plist_.get("albedo snow [-]"); - } + if (is_constant_snow_albedo_) { a_snow_ = plist_.get("albedo snow [-]"); } e_ice_ = plist_.get("emissivity ice [-]", 0.98); e_water_ = plist_.get("emissivity water [-]", 0.995); @@ -88,7 +86,8 @@ AlbedoThreeComponentEvaluator::Evaluate_(const State& S, for (auto c : lc_ids) { // albedo of the snow - albedo[2][c] = is_constant_snow_albedo_ ? a_snow_ : Relations::CalcAlbedoSnow((*snow_dens)[0][c]); + albedo[2][c] = + is_constant_snow_albedo_ ? a_snow_ : Relations::CalcAlbedoSnow((*snow_dens)[0][c]); // a and e of water albedo[1][c] = unfrozen_fraction[0][c] * a_water_ + (1 - unfrozen_fraction[0][c]) * a_ice_; diff --git a/src/pks/surface_balance/constitutive_relations/land_cover/albedo_twocomponent_evaluator.cc b/src/pks/surface_balance/constitutive_relations/land_cover/albedo_twocomponent_evaluator.cc index eab547acf..a44a01cd6 100644 --- a/src/pks/surface_balance/constitutive_relations/land_cover/albedo_twocomponent_evaluator.cc +++ b/src/pks/surface_balance/constitutive_relations/land_cover/albedo_twocomponent_evaluator.cc @@ -55,9 +55,7 @@ AlbedoTwoComponentEvaluator::AlbedoTwoComponentEvaluator(Teuchos::ParameterList& a_ice_ = plist_.get("albedo ice [-]", 0.44); a_water_ = plist_.get("albedo water [-]", 0.1168); is_constant_snow_albedo_ = plist_.isParameter("albedo snow [-]"); - if (is_constant_snow_albedo_) { - a_snow_ = plist_.get("albedo snow [-]"); - } + if (is_constant_snow_albedo_) { a_snow_ = plist_.get("albedo snow [-]"); } e_ice_ = plist_.get("emissivity ice [-]", 0.98); e_water_ = plist_.get("emissivity water [-]", 0.995); @@ -92,7 +90,8 @@ AlbedoTwoComponentEvaluator::Evaluate_(const State& S, const std::vector