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
pism_type_conversion.hh
Go to the documentation of this file.
1
// Copyright (C) 2012, 2014, 2015, 2016, 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
#include <netcdf.h>
20
21
#include "pism/util/io/IO_Flags.hh"
22
23
//! Convert PISM's IO types into NetCDF types and back. Note that NC_* may be
24
//! macros, so you need to include the appropriate NetCDF header first.
25
namespace
pism
{
26
27
static
nc_type
pism_type_to_nc_type
(
pism::io::Type
input) {
28
switch
(input) {
29
case
io::PISM_BYTE
:
30
return
NC_BYTE;
31
case
io::PISM_CHAR
:
32
return
NC_CHAR;
33
case
io::PISM_SHORT
:
34
return
NC_SHORT;
35
case
io::PISM_INT
:
36
return
NC_INT;
37
case
io::PISM_FLOAT
:
38
return
NC_FLOAT;
39
case
io::PISM_DOUBLE
:
40
return
NC_DOUBLE;
41
default
:
42
return
NC_NAT;
43
}
44
}
27
static
nc_type
pism_type_to_nc_type
(
pism::io::Type
input) {
…
}
45
46
static
pism::io::Type
nc_type_to_pism_type
(
int
input) {
47
switch
(input) {
48
case
NC_BYTE:
49
return
io::PISM_BYTE
;
50
case
NC_CHAR:
51
case
NC_STRING:
// treat NC_CHAR and NC_STRING as equivalent
52
return
io::PISM_CHAR
;
53
case
NC_SHORT:
54
return
io::PISM_SHORT
;
55
case
NC_INT:
56
return
io::PISM_INT
;
57
case
NC_FLOAT:
58
return
io::PISM_FLOAT
;
59
case
NC_DOUBLE:
60
return
io::PISM_DOUBLE
;
61
default
:
62
return
io::PISM_NAT
;
63
}
64
}
46
static
pism::io::Type
nc_type_to_pism_type
(
int
input) {
…
}
65
66
}
// end of namespace pism
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::nc_type_to_pism_type
static pism::io::Type nc_type_to_pism_type(int input)
Definition
pism_type_conversion.hh:46
pism::pism_type_to_nc_type
static nc_type pism_type_to_nc_type(pism::io::Type input)
Definition
pism_type_conversion.hh:27
pism
Definition
AgeColumnSystem.cc:23
Generated by
1.9.8