PISM, A Parallel Ice Sheet Model  stable v2.0.6 committed by Constantine Khrulev on 2023-01-23 15:14:38 -0900
IO_Flags.hh
Go to the documentation of this file.
1 /* Copyright (C) 2014, 2015, 2018, 2019, 2020 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 _IO_FLAGS_H_
21 #define _IO_FLAGS_H_
22 
23 namespace pism {
24 
25 // I/O Flags used by File and NCFile. They are used in both interfaces,
26 // but I want to be able to create Python wrappers for File without
27 // exposing NCFile, and NCFile should compile without File, so it does
28 // not belong in either File.hh or NCFile.hh.
29 
30 // This is a subset of NetCDF data-types.
31 enum IO_Type {
32  PISM_NAT = 0, /* NAT = 'Not A Type' (c.f. NaN) */
33  PISM_BYTE = 1, /* signed 1 byte integer */
34  PISM_CHAR = 2, /* ISO/ASCII character */
35  PISM_SHORT = 3, /* signed 2 byte integer */
36  PISM_INT = 4, /* signed 4 byte integer */
37  PISM_FLOAT = 5, /* single precision floating point number */
38  PISM_DOUBLE = 6 /* double precision floating point number */
39 };
40 
43 
44 // This is a subset of NetCDF file modes. Use values that don't match
45 // NetCDF flags so that we can detect errors caused by passing these
46 // straight to NetCDF.
47 enum IO_Mode {
48  //! open an existing file for reading only
50  //! open an existing file for reading and writing
52  //! create a file for writing, overwrite if present
54  //! create a file for writing, move foo.nc to foo.nc~ if present
56 };
57 
58 // This is the special value corresponding to the "unlimited" dimension length.
59 // Gets cast to "int", so it should match the value used by NetCDF.
60 enum Dim_Length {
61  PISM_UNLIMITED = 0
62 };
63 
64 // "Fill" mode. Gets cast to "int", so it should match values used by NetCDF.
65 enum Fill_Mode {
66  PISM_FILL = 0,
67  PISM_NOFILL = 0x100
68 };
69 
71 
72 } // end of namespace pism
73 
74 #endif /* _IO_FLAGS_H_ */
IO_Type
Definition: IO_Flags.hh:31
@ PISM_BYTE
Definition: IO_Flags.hh:33
@ PISM_INT
Definition: IO_Flags.hh:36
@ PISM_NAT
Definition: IO_Flags.hh:32
@ PISM_DOUBLE
Definition: IO_Flags.hh:38
@ PISM_SHORT
Definition: IO_Flags.hh:35
@ PISM_FLOAT
Definition: IO_Flags.hh:37
@ PISM_CHAR
Definition: IO_Flags.hh:34
Dim_Length
Definition: IO_Flags.hh:60
@ PISM_UNLIMITED
Definition: IO_Flags.hh:61
RegriddingFlag
Definition: IO_Flags.hh:70
@ CRITICAL_FILL_MISSING
Definition: IO_Flags.hh:70
@ OPTIONAL_FILL_MISSING
Definition: IO_Flags.hh:70
@ OPTIONAL
Definition: IO_Flags.hh:70
@ CRITICAL
Definition: IO_Flags.hh:70
Fill_Mode
Definition: IO_Flags.hh:65
@ PISM_NOFILL
Definition: IO_Flags.hh:67
@ PISM_FILL
Definition: IO_Flags.hh:66
IO_Backend
Definition: IO_Flags.hh:41
@ PISM_GUESS
Definition: IO_Flags.hh:41
@ PISM_PIO_NETCDF
Definition: IO_Flags.hh:42
@ PISM_PIO_PNETCDF
Definition: IO_Flags.hh:42
@ PISM_PIO_NETCDF4P
Definition: IO_Flags.hh:42
@ PISM_NETCDF3
Definition: IO_Flags.hh:41
@ PISM_PIO_NETCDF4C
Definition: IO_Flags.hh:42
@ PISM_NETCDF4_PARALLEL
Definition: IO_Flags.hh:41
@ PISM_PNETCDF
Definition: IO_Flags.hh:42
@ PISM_NETCDF4_SERIAL
Definition: IO_Flags.hh:41
IO_Mode
Definition: IO_Flags.hh:47
@ PISM_READWRITE_CLOBBER
create a file for writing, overwrite if present
Definition: IO_Flags.hh:53
@ PISM_READWRITE_MOVE
create a file for writing, move foo.nc to foo.nc~ if present
Definition: IO_Flags.hh:55
@ PISM_READWRITE
open an existing file for reading and writing
Definition: IO_Flags.hh:51
@ PISM_READONLY
open an existing file for reading only
Definition: IO_Flags.hh:49