PISM, A Parallel Ice Sheet Model  stable v2.1-1-g6902d5502 committed by Ed Bueler on 2023-12-20 08:38:27 -0800

◆ set_number_from_option()

void pism::set_number_from_option ( units::System::Ptr  unit_system,
Config config,
const std::string &  name,
const std::string &  parameter 
)

Sets a configuration parameter from a command-line option.

Set one scalar parameter using command-line options.

If called as number_from_option("foo", "foo"), checks -foo and calls set("foo", value).

Does nothing if -foo was not set.

Note that no unit conversion is performed; parameters should be stored in input units and converted as needed. (This allows saving parameters without converting again.)

Definition at line 513 of file ConfigInterface.cc.

References CONFIG_USER, pism::Config::doc(), pism::Config::FORGET_THIS_USE, pism::Config::get_number(), pism::options::Option< T >::is_set(), pism::Config::set_number(), and pism::Config::units().

Referenced by set_parameter_from_options().