Loading [MathJax]/extensions/tex2jax.js
PISM, A Parallel Ice Sheet Model
2.2.2-d6b3a29ca committed by Constantine Khrulev on 2025-03-28
Toggle main menu visibility
Main Page
Related Pages
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
z
Variables
a
b
c
d
f
g
h
i
k
l
m
n
r
s
t
u
v
w
Typedefs
Enumerations
a
b
c
d
e
f
i
k
l
m
n
p
r
t
u
v
Enumerator
_
a
b
c
d
e
f
g
h
i
l
m
n
p
q
s
t
u
w
x
y
z
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
:
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
c
d
f
g
h
l
m
p
s
v
w
Enumerations
Enumerator
c
d
e
f
h
i
j
m
n
o
p
r
s
t
w
y
Related Symbols
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
k
l
m
n
p
r
s
t
u
w
z
Functions
a
b
c
d
e
f
g
h
i
l
m
p
r
s
u
Variables
b
c
d
e
g
h
k
l
m
n
p
r
s
t
u
w
z
Typedefs
Macros
_
a
b
c
g
h
i
k
m
n
r
s
t
u
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
Loading...
Searching...
No Matches
src
coupler
util
options.cc
Go to the documentation of this file.
1
/* Copyright (C) 2018, 2019, 2021, 2023 PISM Authors
2
*
3
* This file is part of PISM.
4
*
5
* PISM is free software; you can redistribute it and/or modify it under the
6
* terms of the GNU General Public License as published by the Free Software
7
* Foundation; either version 3 of the License, or (at your option) any later
8
* version.
9
*
10
* PISM is distributed in the hope that it will be useful, but WITHOUT ANY
11
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
13
* details.
14
*
15
* You should have received a copy of the GNU General Public License
16
* along with PISM; if not, write to the Free Software
17
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18
*/
19
20
#include "pism/coupler/util/options.hh"
21
22
#include "pism/util/Context.hh"
23
#include "pism/util/ConfigInterface.hh"
24
#include "pism/util/Logger.hh"
25
#include "pism/util/Component.hh"
26
27
namespace
pism
{
28
29
ForcingOptions::ForcingOptions
(
const
Context
&ctx,
30
const
std::string &prefix) {
31
32
const
Logger
&log = *ctx.
log
();
33
const
Config
&config = *ctx.
config
();
34
35
{
36
auto
file = config.
get_string
(prefix +
".file"
);
37
38
if
(not file.empty()) {
39
this->
filename
= file;
40
log.
message
(2,
41
" - Reading boundary conditions from '%s'...\n"
,
42
file.c_str());
43
}
else
{
44
this->
filename
=
process_input_options
(ctx.
com
(), ctx.
config
()).
filename
;
45
46
log.
message
(2,
47
" - Option %s.file is not set. Trying the input file '%s'...\n"
,
48
prefix.c_str(), this->filename.c_str());
49
}
50
51
if
(this->
filename
.empty()) {
52
throw
RuntimeError::formatted
(
PISM_ERROR_LOCATION
,
53
"PISM ERROR: %s.file is empty and no input ('-i') file found."
,
54
prefix.c_str());
55
}
56
}
57
58
this->
periodic
= config.
get_flag
(prefix +
".periodic"
);
59
}
29
ForcingOptions::ForcingOptions
(
const
Context
&ctx, {
…
}
60
61
}
// end of namespace pism
pism::Config::get_string
std::string get_string(const std::string &name, UseFlag flag=REMEMBER_THIS_USE) const
Definition
ConfigInterface.cc:328
pism::Config::get_flag
bool get_flag(const std::string &name, UseFlag flag=REMEMBER_THIS_USE) const
Definition
ConfigInterface.cc:357
pism::Config
A class for storing and accessing PISM configuration flags and parameters.
Definition
ConfigInterface.hh:54
pism::Context::com
MPI_Comm com() const
Definition
Context.cc:65
pism::Context::config
std::shared_ptr< const Config > config() const
Definition
Context.cc:89
pism::Context::log
std::shared_ptr< const Logger > log() const
Definition
Context.cc:113
pism::Context
Definition
Context.hh:40
pism::Logger::message
void message(int threshold, const char format[],...) const __attribute__((format(printf
Print a message to the log.
Definition
Logger.cc:49
pism::Logger
A basic logging class.
Definition
Logger.hh:40
pism::RuntimeError::formatted
static RuntimeError formatted(const ErrorLocation &location, const char format[],...) __attribute__((format(printf
build a RuntimeError with a formatted message
Definition
error_handling.cc:47
PISM_ERROR_LOCATION
#define PISM_ERROR_LOCATION
Definition
error_handling.hh:43
pism::process_input_options
InputOptions process_input_options(MPI_Comm com, Config::ConstPtr config)
Definition
Component.cc:43
pism
Definition
AgeColumnSystem.cc:23
pism::ForcingOptions::filename
std::string filename
Definition
options.hh:33
pism::ForcingOptions::ForcingOptions
ForcingOptions(const Context &ctx, const std::string &option_prefix)
Definition
options.cc:29
pism::ForcingOptions::periodic
bool periodic
Definition
options.hh:34
pism::InputOptions::filename
std::string filename
name of the input file (if applicable)
Definition
Component.hh:63
Generated by
1.9.8