forked from pressel/pycles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDiagnosticVariables.pxd
29 lines (29 loc) · 1.26 KB
/
DiagnosticVariables.pxd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
cimport ParallelMPI
cimport Grid
from NetCDFIO cimport NetCDFIO_Stats
cdef class DiagnosticVariables:
cdef:
dict name_index
dict units
int nv
double [:] values
double [:] bc_type
dict name_index_2d
dict units_2d
int nv_2d
double [:] values_2d
void communicate_variable(self,Grid.Grid Gr,ParallelMPI.ParallelMPI PM, long nv)
cpdef add_variables(self, name, units, bc_type, ParallelMPI.ParallelMPI Pa)
cpdef initialize(self,Grid.Grid Gr, NetCDFIO_Stats NS, ParallelMPI.ParallelMPI Pa)
cpdef get_variable_array(self,name,Grid.Grid Gr)
cdef inline int get_nv(self, str variable_name):
return self.name_index[variable_name]
cdef inline int get_varshift(self, Grid.Grid Gr, str variable_name):
return self.name_index[variable_name] * Gr.dims.npg
cpdef val_nan(self,PA,message)
cpdef stats_io(self, Grid.Grid Gr, NetCDFIO_Stats NS, ParallelMPI.ParallelMPI Pa)
cpdef add_variables_2d(self, name, units)
cdef inline int get_nv_2d(self, str variable_name):
return self.name_index_2d[variable_name]
cdef inline int get_varshift_2d(self, Grid.Grid Gr, str variable_name):
return self.name_index_2d[variable_name] * Gr.dims.nlg[0] * Gr.dims.nlg[1]