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
util
io
IO_Flags.hh
Go to the documentation of this file.
1
/* Copyright (C) 2014, 2015, 2018, 2019, 2020, 2023, 2024 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
#ifndef PISM_IO_FLAGS_H
21
#define PISM_IO_FLAGS_H
22
23
#include <string>
24
25
namespace
pism
{
26
27
/*!
28
* Axis corresponding to dimensions (and coordinate variables) in a NetCDF file.
29
*
30
* These values are also used as indexes in `start` and `count` arrays -- this is why they
31
* have consecutive values starting from 0.
32
*/
33
enum
AxisType
:
int
{
T_AXIS
= 0,
X_AXIS
= 1,
Y_AXIS
= 2,
Z_AXIS
= 3,
UNKNOWN_AXIS
= 4 };
34
35
AxisType
axis_type_from_string
(
const
std::string &input);
36
37
namespace
io {
38
39
// I/O Flags used by File and NCFile. They are used in both interfaces,
40
// but I want to be able to create Python wrappers for File without
41
// exposing NCFile, and NCFile should compile without File, so it does
42
// not belong in either File.hh or NCFile.hh.
43
44
// This is a subset of NetCDF data-types.
45
enum
Type
:
int
{
46
PISM_NAT
= 0,
/* NAT = 'Not A Type' (c.f. NaN) */
47
PISM_BYTE
= 1,
/* signed 1 byte integer */
48
PISM_CHAR
= 2,
/* ISO/ASCII character */
49
PISM_SHORT
= 3,
/* signed 2 byte integer */
50
PISM_INT
= 4,
/* signed 4 byte integer */
51
PISM_FLOAT
= 5,
/* single precision floating point number */
52
PISM_DOUBLE
= 6
/* double precision floating point number */
53
};
45
enum
Type
:
int
{
…
};
54
55
enum
Backend
:
int
{
56
PISM_GUESS
,
57
PISM_NETCDF3
,
58
PISM_NETCDF4_SERIAL
,
59
PISM_NETCDF4_PARALLEL
,
60
PISM_PNETCDF
61
};
55
enum
Backend
:
int
{
…
};
62
63
// This is a subset of NetCDF file modes. Use values that don't match
64
// NetCDF flags so that we can detect errors caused by passing these
65
// straight to NetCDF.
66
enum
Mode
:
int
{
67
//! open an existing file for reading only
68
PISM_READONLY
= 7,
69
//! open an existing file for reading and writing
70
PISM_READWRITE
= 8,
71
//! create a file for writing, overwrite if present
72
PISM_READWRITE_CLOBBER
= 9,
73
//! create a file for writing, move foo.nc to foo.nc~ if present
74
PISM_READWRITE_MOVE
= 10
75
};
66
enum
Mode
:
int
{
{
…
};
76
77
// This is the special value corresponding to the "unlimited" dimension length.
78
// Gets cast to "int", so it should match the value used by NetCDF.
79
enum
Dim_Length
:
int
{
PISM_UNLIMITED
= 0 };
80
81
// "Fill" mode. Gets cast to "int", so it should match values used by NetCDF.
82
enum
Fill_Mode
:
int
{
PISM_FILL
= 0,
PISM_NOFILL
= 0x100 };
83
84
/*!
85
* Default value to use when a regridding variable is not found.
86
*/
87
class
Default
{
88
public
:
89
90
/*!
91
* No default value: stop if the variable was not found.
92
*/
93
static
Default
Nil
() {
94
return
{};
95
}
93
static
Default
Nil
() {
…
}
96
97
/*!
98
* Use this default value if the variable was not found.
99
*/
100
Default
(
double
v) {
101
m_exists
=
true
;
102
m_value
= v;
103
}
100
Default
(
double
v) {
…
}
104
105
/*!
106
* True if the default value exists.
107
*/
108
bool
exists
()
const
{
109
return
m_exists
;
110
}
108
bool
exists
()
const
{
…
}
111
112
/*!
113
* Convert the default value to `double`.
114
*/
115
operator
double
()
const
{
116
return
m_value
;
117
}
115
operator
double
()
const
{
…
}
118
119
private
:
120
Default
() {
121
m_exists
=
false
;
122
m_value
= 0;
123
}
120
Default
() {
…
}
124
double
m_value
;
125
bool
m_exists
;
126
};
87
class
Default
{
…
};
127
128
}
// namespace io
129
130
}
// end of namespace pism
131
132
#endif
/* PISM_IO_FLAGS_H */
double
pism::io::Default::m_value
double m_value
Definition
IO_Flags.hh:124
pism::io::Default::Default
Default()
Definition
IO_Flags.hh:120
pism::io::Default::Nil
static Default Nil()
Definition
IO_Flags.hh:93
pism::io::Default::exists
bool exists() const
Definition
IO_Flags.hh:108
pism::io::Default::Default
Default(double v)
Definition
IO_Flags.hh:100
pism::io::Default::m_exists
bool m_exists
Definition
IO_Flags.hh:125
pism::io::Default
Definition
IO_Flags.hh:87
pism::io::Backend
Backend
Definition
IO_Flags.hh:55
pism::io::PISM_GUESS
@ PISM_GUESS
Definition
IO_Flags.hh:56
pism::io::PISM_NETCDF3
@ PISM_NETCDF3
Definition
IO_Flags.hh:57
pism::io::PISM_PNETCDF
@ PISM_PNETCDF
Definition
IO_Flags.hh:60
pism::io::PISM_NETCDF4_PARALLEL
@ PISM_NETCDF4_PARALLEL
Definition
IO_Flags.hh:59
pism::io::PISM_NETCDF4_SERIAL
@ PISM_NETCDF4_SERIAL
Definition
IO_Flags.hh:58
pism::io::Mode
Mode
Definition
IO_Flags.hh:66
pism::io::PISM_READWRITE_CLOBBER
@ PISM_READWRITE_CLOBBER
create a file for writing, overwrite if present
Definition
IO_Flags.hh:72
pism::io::PISM_READWRITE_MOVE
@ PISM_READWRITE_MOVE
create a file for writing, move foo.nc to foo.nc~ if present
Definition
IO_Flags.hh:74
pism::io::PISM_READONLY
@ PISM_READONLY
open an existing file for reading only
Definition
IO_Flags.hh:68
pism::io::PISM_READWRITE
@ PISM_READWRITE
open an existing file for reading and writing
Definition
IO_Flags.hh:70
pism::io::Dim_Length
Dim_Length
Definition
IO_Flags.hh:79
pism::io::PISM_UNLIMITED
@ PISM_UNLIMITED
Definition
IO_Flags.hh:79
pism::io::Type
Type
Definition
IO_Flags.hh:45
pism::io::PISM_SHORT
@ PISM_SHORT
Definition
IO_Flags.hh:49
pism::io::PISM_FLOAT
@ PISM_FLOAT
Definition
IO_Flags.hh:51
pism::io::PISM_DOUBLE
@ PISM_DOUBLE
Definition
IO_Flags.hh:52
pism::io::PISM_NAT
@ PISM_NAT
Definition
IO_Flags.hh:46
pism::io::PISM_BYTE
@ PISM_BYTE
Definition
IO_Flags.hh:47
pism::io::PISM_INT
@ PISM_INT
Definition
IO_Flags.hh:50
pism::io::PISM_CHAR
@ PISM_CHAR
Definition
IO_Flags.hh:48
pism::io::Fill_Mode
Fill_Mode
Definition
IO_Flags.hh:82
pism::io::PISM_FILL
@ PISM_FILL
Definition
IO_Flags.hh:82
pism::io::PISM_NOFILL
@ PISM_NOFILL
Definition
IO_Flags.hh:82
pism::AxisType
AxisType
Definition
IO_Flags.hh:33
pism::UNKNOWN_AXIS
@ UNKNOWN_AXIS
Definition
IO_Flags.hh:33
pism::T_AXIS
@ T_AXIS
Definition
IO_Flags.hh:33
pism::X_AXIS
@ X_AXIS
Definition
IO_Flags.hh:33
pism::Z_AXIS
@ Z_AXIS
Definition
IO_Flags.hh:33
pism::Y_AXIS
@ Y_AXIS
Definition
IO_Flags.hh:33
pism::axis_type_from_string
AxisType axis_type_from_string(const std::string &input)
Definition
File.cc:436
pism
Definition
AgeColumnSystem.cc:23
Generated by
1.9.8