PISM, A Parallel Ice Sheet Model 2.3.0-79cae578d committed by Constantine Khrulev on 2026-03-22
Loading...
Searching...
No Matches

◆ set_number_from_option()

void pism::set_number_from_option ( Config config,
const std::string &  option,
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 582 of file Config.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(), pism::Config::unit_system(), and pism::Config::units().

Referenced by set_parameter_from_options().