t8  1.2.0
t8code is a C library to manage a forest of adaptive space-trees of general element classes in parallel.
t8_netcdf.h
1 /*
2  This file is part of t8code.
3  t8code is a C library to manage a collection (a forest) of multiple
4  connected adaptive space-trees of general element classes in parallel.
5 
6  Copyright (C) 2015 the developers
7 
8  t8code is free software; you can redistribute it and/or modify
9  it under the terms of the GNU General Public License as published by
10  the Free Software Foundation; either version 2 of the License, or
11  (at your option) any later version.
12 
13  t8code is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  GNU General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with t8code; if not, write to the Free Software Foundation, Inc.,
20  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 */
22 
27 #ifndef T8_NETCDF_H
28 #define T8_NETCDF_H
29 
30 #include <t8.h>
31 
32 T8_EXTERN_C_BEGIN ();
33 
34 /* Datatype for 64 bit NetCDF Data */
35 typedef int64_t t8_nc_int64_t;
36 
37 /* Datatype for 32 bit NetCDF Data */
38 typedef int32_t t8_nc_int32_t;
39 
41 typedef enum t8_netcdf_variable_type
42 {
44  T8_NETCDF_INT = 0,
46  T8_NETCDF_INT64 = 1,
48  T8_NETCDF_DOUBLE = 2
49 }
50 t8_netcdf_variable_type_t;
51 
52 /* Struct for elementwise data variable for a NetCDF file */
53 typedef struct
54 {
55  const char *variable_name;
56  const char *variable_long_name;
57  const char *variable_units;
58  t8_netcdf_variable_type_t datatype;
59  int var_user_dimid;
60  sc_array_t *var_user_data;
62 
71 t8_netcdf_variable_t *t8_netcdf_create_var (t8_netcdf_variable_type_t
72  var_type, const char *var_name,
73  const char *var_long_name,
74  const char *var_unit,
75  sc_array_t *var_data);
76 
84 t8_netcdf_variable_t *t8_netcdf_create_integer_var (const char *var_name,
85  const char *var_long_name,
86  const char *var_unit,
87  sc_array_t *var_data);
88 
96 t8_netcdf_variable_t *t8_netcdf_create_double_var (const char *var_name,
97  const char *var_long_name,
98  const char *var_unit,
99  sc_array_t *var_data);
100 
104 /* Free the allocated NetCDF variable */
105 void t8_netcdf_variable_destroy (t8_netcdf_variable_t *
106  var_destroy);
107 
108 T8_EXTERN_C_END ();
109 
110 #endif /* T8_NETCDF_H */
Definition: t8_netcdf.h:54
This is the administrative header file for t8code.