SCALE-RM
Functions
gtool_file_f.c File Reference
#include "gtool_file.h"
Include dependency graph for gtool_file_f.c:

Go to the source code of this file.

Functions

void file_open_ (int32_t *fid, char *fname, int32_t *mode, int32_t *error, int32_t fname_len)
 
void file_set_option_ (int32_t *fid, char *filetype, char *key, char *val, int32_t *error, int32_t filetype_len, int32_t key_len, int32_t val_len)
 
void file_get_datainfo_ (datainfo_t *dinfo, int32_t *fid, char *varname, int32_t *step, int32_t *suppress, int32_t *error, int32_t varname_len)
 
void file_read_data_ (void *var, datainfo_t *dinfo, int32_t *precision, int32_t *error)
 
void file_get_global_attribute_text_ (int32_t *fid, char *key, char *value, int32_t *error, int32_t key_len, int32_t value_len)
 
void file_get_global_attribute_int_ (int32_t *fid, char *key, int32_t *len, int32_t *value, int32_t *error, int32_t key_len)
 
void file_get_global_attribute_float_ (int32_t *fid, char *key, int32_t *len, float *value, int32_t *error, int32_t key_len)
 
void file_get_global_attribute_double_ (int32_t *fid, char *key, int32_t *len, double *value, int32_t *error, int32_t key_len)
 
void file_set_global_attribute_text_ (int32_t *fid, char *key, char *value, int32_t *error, int32_t key_len, int32_t value_len)
 
void file_set_global_attribute_int_ (int32_t *fid, char *key, int32_t *value, int32_t *len, int32_t *error, int32_t key_len)
 
void file_set_global_attribute_float_ (int32_t *fid, char *key, float *value, int32_t *len, int32_t *error, int32_t key_len)
 
void file_set_global_attribute_double_ (int32_t *fid, char *key, double *value, int32_t *len, int32_t *error, int32_t key_len)
 
void file_set_tunits_ (int32_t *fid, char *time_units, int32_t *error, int32_t len)
 
void file_set_tattr_ (int32_t *fid, char *vname, char *key, char *val, int32_t *error, int32_t vname_len, int32_t key_len, int32_t val_len)
 
void file_put_axis_ (int32_t *fid, char *name, char *desc, char *units, char *dim_name, int32_t *dtype, void *val, int32_t *size, int32_t *precision, int32_t *error, int32_t name_len, int32_t desc_len, int32_t units_len, int32_t dim_name_len)
 
void file_def_axis_ (int32_t *fid, char *name, char *desc, char *units, char *dim_name, int32_t *dtype, int32_t *dim_size, int32_t *error, int32_t name_len, int32_t desc_len, int32_t units_len, int32_t dim_name_len)
 
void file_write_axis_ (int32_t *fid, char *name, void *val, int32_t *precision, int32_t *error, int32_t name_len)
 
void file_put_associated_coordinates_ (int32_t *fid, char *name, char *desc, char *units, char *dim_names, int32_t *ndims, int32_t *dtype, void *val, int32_t *precision, int32_t *error, int32_t name_len, int32_t desc_len, int32_t units_len, int32_t dim_name_len)
 
void file_def_associated_coordinates_ (int32_t *fid, char *name, char *desc, char *units, char *dim_names, int32_t *ndims, int32_t *dtype, int32_t *error, int32_t name_len, int32_t desc_len, int32_t units_len, int32_t dim_name_len)
 
void file_write_associated_coordinates_ (int32_t *fid, char *name, void *val, int32_t *precision, int32_t *error, int32_t name_len)
 
void file_add_variable_ (int32_t *vid, int32_t *fid, char *varname, char *desc, char *units, char *dims, int32_t *ndims, int32_t *dtype, real64_t *tint, int32_t *tavg, int32_t *error, int32_t varname_len, int32_t desc_len, int32_t units_len, int32_t dims_len)
 
void file_write_data_ (int32_t *fid, int32_t *vid, void *var, real64_t *t_start, real64_t *t_end, int32_t *precision, int32_t *error)
 
void file_write_var_ (int32_t *vid, void *var, real64_t *t_start, real64_t *t_end, int32_t *precision, int32_t *error)
 
void file_close_ (int32_t *fid, int32_t *error)
 
void file_enddef_ (int32_t *fid, int32_t *error)
 

Function Documentation

◆ file_open_()

void file_open_ ( int32_t *  fid,
char *  fname,
int32_t *  mode,
int32_t *  error,
int32_t  fname_len 
)

Definition at line 35 of file gtool_file_f.c.

40 {
41  char _fname[File_HLONG+1];
42  int32_t len;
43 
44  len = fname_len > File_HLONG ? File_HLONG : fname_len;
45  fstr2cstr(_fname, fname, len);
46 
47  *error = file_open( fid, _fname, *mode );
48 }
int32_t file_open(int32_t *fid, char *fname, int32_t mode)
Definition: gtool_netcdf.c:97
#define File_HLONG
Definition: gtool_file.h:13

◆ file_set_option_()

void file_set_option_ ( int32_t *  fid,
char *  filetype,
char *  key,
char *  val,
int32_t *  error,
int32_t  filetype_len,
int32_t  key_len,
int32_t  val_len 
)

Definition at line 50 of file gtool_file_f.c.

References File_HMID, and File_HSHORT.

58 {
59  char _filetype[File_HSHORT+1];
60  char _key[File_HMID+1];
61  char _val[File_HMID+1];
62  int32_t len;
63 
64  len = filetype_len > File_HSHORT ? File_HSHORT : filetype_len;
65  fstr2cstr(_filetype, filetype, len);
66 
67  len = key_len > File_HMID ? File_HMID : key_len;
68  fstr2cstr(_key, key, len);
69 
70  len = val_len > File_HMID ? File_HMID : val_len;
71  fstr2cstr(_val, val, len);
72 
73  *error = file_set_option(*fid, _filetype, _key, _val);
74 }
#define File_HMID
Definition: gtool_file.h:12
#define File_HSHORT
Definition: gtool_file.h:11
int32_t file_set_option(int32_t fid, char *filetype, char *key, char *val)
Definition: gtool_netcdf.c:146

◆ file_get_datainfo_()

void file_get_datainfo_ ( datainfo_t dinfo,
int32_t *  fid,
char *  varname,
int32_t *  step,
int32_t *  suppress,
int32_t *  error,
int32_t  varname_len 
)

Definition at line 76 of file gtool_file_f.c.

83 {
84  char _varname[File_HSHORT+1];
85  int32_t len;
86  int i;
87 
88  len = varname_len > File_HSHORT ? File_HSHORT : varname_len;
89  fstr2cstr(_varname, varname, len);
90 
91  *error = file_get_datainfo( dinfo, *fid, _varname, *step, *suppress );
92 
93  cstr2fstr(dinfo->varname, dinfo->varname, File_HSHORT);
94  cstr2fstr(dinfo->description, dinfo->description, File_HMID);
95  cstr2fstr(dinfo->units, dinfo->units, File_HSHORT);
96  cstr2fstr(dinfo->time_units, dinfo->time_units, File_HMID);
97  for ( i=0; i<MAX_RANK; i++ )
98  cstr2fstr(dinfo->dim_name+i*File_HSHORT, dinfo->dim_name+i*File_HSHORT, File_HSHORT);
99 }
#define File_HMID
Definition: gtool_file.h:12
#define MAX_RANK
Definition: gtool_file.h:34
char dim_name[File_HSHORT *MAX_RANK]
Definition: gtool_file.h:47
char description[File_HMID]
Definition: gtool_file.h:43
int32_t file_get_datainfo(datainfo_t *dinfo, int32_t fid, char *varname, int32_t step, int32_t suppress)
Definition: gtool_netcdf.c:162
#define File_HSHORT
Definition: gtool_file.h:11
char time_units[File_HMID]
Definition: gtool_file.h:52
char units[File_HSHORT]
Definition: gtool_file.h:44
char varname[File_HSHORT]
Definition: gtool_file.h:42

◆ file_read_data_()

void file_read_data_ ( void *  var,
datainfo_t dinfo,
int32_t *  precision,
int32_t *  error 
)

Definition at line 100 of file gtool_file_f.c.

104 {
105  int i;
106 
107  fstr2cstr(dinfo->varname, dinfo->varname, File_HSHORT);
108  fstr2cstr(dinfo->description, dinfo->description, File_HMID);
109  fstr2cstr(dinfo->units, dinfo->units, File_HSHORT);
110  fstr2cstr(dinfo->time_units, dinfo->time_units, File_HMID);
111  for ( i=0; i<MAX_RANK; i++ )
112  fstr2cstr(dinfo->dim_name+i*File_HSHORT, dinfo->dim_name+i*File_HSHORT, File_HSHORT);
113 
114  *error = file_read_data( var, dinfo, *precision );
115 }
#define File_HMID
Definition: gtool_file.h:12
#define MAX_RANK
Definition: gtool_file.h:34
char dim_name[File_HSHORT *MAX_RANK]
Definition: gtool_file.h:47
char description[File_HMID]
Definition: gtool_file.h:43
#define File_HSHORT
Definition: gtool_file.h:11
char time_units[File_HMID]
Definition: gtool_file.h:52
char units[File_HSHORT]
Definition: gtool_file.h:44
char varname[File_HSHORT]
Definition: gtool_file.h:42
int32_t file_read_data(void *var, datainfo_t *dinfo, int32_t precision)
Definition: gtool_netcdf.c:245

◆ file_get_global_attribute_text_()

void file_get_global_attribute_text_ ( int32_t *  fid,
char *  key,
char *  value,
int32_t *  error,
int32_t  key_len,
int32_t  value_len 
)

Definition at line 117 of file gtool_file_f.c.

123 {
124  char _key[File_HLONG+1];
125  char _value[File_HLONG+1];
126  int32_t len;
127 
128  len = key_len > File_HLONG ? File_HLONG : key_len;
129  fstr2cstr(_key, key, len);
130 
131  *error = file_get_global_attribute_text( *fid, _key, _value, value_len );
132 
133  len = value_len > File_HLONG ? File_HLONG : value_len;
134  cstr2fstr(value, _value, len);
135 }
int32_t file_get_global_attribute_text(int32_t fid, char *key, char *value, int32_t len)
Definition: gtool_netcdf.c:294
#define File_HLONG
Definition: gtool_file.h:13

◆ file_get_global_attribute_int_()

void file_get_global_attribute_int_ ( int32_t *  fid,
char *  key,
int32_t *  len,
int32_t *  value,
int32_t *  error,
int32_t  key_len 
)

Definition at line 137 of file gtool_file_f.c.

143 {
144  char _key[File_HLONG+1];
145  int32_t l;
146 
147  l = key_len > File_HLONG ? File_HLONG : key_len;
148  fstr2cstr(_key, key, l);
149 
150  *error = file_get_global_attribute_int( *fid, _key, value, (size_t)*len );
151 }
int32_t file_get_global_attribute_int(int32_t fid, char *key, int32_t *value, size_t len)
#define File_HLONG
Definition: gtool_file.h:13

◆ file_get_global_attribute_float_()

void file_get_global_attribute_float_ ( int32_t *  fid,
char *  key,
int32_t *  len,
float value,
int32_t *  error,
int32_t  key_len 
)

Definition at line 153 of file gtool_file_f.c.

159 {
160  char _key[File_HLONG+1];
161  int32_t l;
162 
163  l = key_len > File_HLONG ? File_HLONG : key_len;
164  fstr2cstr(_key, key, l);
165 
166  *error = file_get_global_attribute_float( *fid, _key, value, (size_t)*len );
167 }
int32_t file_get_global_attribute_float(int32_t fid, char *key, float *value, size_t len)
Definition: gtool_netcdf.c:332
#define File_HLONG
Definition: gtool_file.h:13

◆ file_get_global_attribute_double_()

void file_get_global_attribute_double_ ( int32_t *  fid,
char *  key,
int32_t *  len,
double value,
int32_t *  error,
int32_t  key_len 
)

Definition at line 169 of file gtool_file_f.c.

175 {
176  char _key[File_HLONG+1];
177  int32_t l;
178 
179  l = key_len > File_HLONG ? File_HLONG : key_len;
180  fstr2cstr(_key, key, l);
181 
182  *error = file_get_global_attribute_double( *fid, _key, value, (size_t)*len );
183 }
int32_t file_get_global_attribute_double(int32_t fid, char *key, double *value, size_t len)
Definition: gtool_netcdf.c:350
#define File_HLONG
Definition: gtool_file.h:13

◆ file_set_global_attribute_text_()

void file_set_global_attribute_text_ ( int32_t *  fid,
char *  key,
char *  value,
int32_t *  error,
int32_t  key_len,
int32_t  value_len 
)

Definition at line 185 of file gtool_file_f.c.

191 {
192  char _key[File_HLONG+1];
193  char _value[File_HLONG+1];
194  int32_t len;
195 
196  len = key_len > File_HLONG ? File_HLONG : key_len;
197  fstr2cstr(_key, key, len);
198 
199  len = value_len > File_HLONG ? File_HLONG : value_len;
200  fstr2cstr(_value, value, len);
201 
202  *error = file_set_global_attribute_text( *fid, _key, _value );
203 }
int32_t file_set_global_attribute_text(int32_t fid, char *key, char *value)
Definition: gtool_netcdf.c:368
#define File_HLONG
Definition: gtool_file.h:13

◆ file_set_global_attribute_int_()

void file_set_global_attribute_int_ ( int32_t *  fid,
char *  key,
int32_t *  value,
int32_t *  len,
int32_t *  error,
int32_t  key_len 
)

Definition at line 205 of file gtool_file_f.c.

211 {
212  char _key[File_HLONG+1];
213 
214  key_len = key_len > File_HLONG ? File_HLONG : key_len;
215  fstr2cstr(_key, key, key_len);
216 
217  *error = file_set_global_attribute_int( *fid, _key, value, (size_t)*len );
218 }
int32_t file_set_global_attribute_int(int32_t fid, char *key, int32_t *value, size_t len)
#define File_HLONG
Definition: gtool_file.h:13

◆ file_set_global_attribute_float_()

void file_set_global_attribute_float_ ( int32_t *  fid,
char *  key,
float value,
int32_t *  len,
int32_t *  error,
int32_t  key_len 
)

Definition at line 220 of file gtool_file_f.c.

226 {
227  char _key[File_HLONG+1];
228  int32_t l;
229 
230  l = key_len > File_HLONG ? File_HLONG : key_len;
231  fstr2cstr(_key, key, l);
232 
233  *error = file_set_global_attribute_float( *fid, _key, value, (size_t)*len );
234 }
int32_t file_set_global_attribute_float(int32_t fid, char *key, float *value, size_t len)
Definition: gtool_netcdf.c:411
#define File_HLONG
Definition: gtool_file.h:13

◆ file_set_global_attribute_double_()

void file_set_global_attribute_double_ ( int32_t *  fid,
char *  key,
double value,
int32_t *  len,
int32_t *  error,
int32_t  key_len 
)

Definition at line 236 of file gtool_file_f.c.

242 {
243  char _key[File_HLONG+1];
244  int32_t l;
245 
246  l = key_len > File_HLONG ? File_HLONG : key_len;
247  fstr2cstr(_key, key, l);
248 
249  *error = file_set_global_attribute_double( *fid, _key, value, (size_t)*len );
250 }
int32_t file_set_global_attribute_double(int32_t fid, char *key, double *value, size_t len)
Definition: gtool_netcdf.c:433
#define File_HLONG
Definition: gtool_file.h:13

◆ file_set_tunits_()

void file_set_tunits_ ( int32_t *  fid,
char *  time_units,
int32_t *  error,
int32_t  len 
)

Definition at line 252 of file gtool_file_f.c.

References File_HMID.

256 {
257  char _time_units[File_HMID+1];
258 
259  len = len > File_HMID ? File_HMID : len;
260  fstr2cstr(_time_units, time_units, len);
261 
262  *error = file_set_tunits( *fid, _time_units );
263 }
int32_t file_set_tunits(int32_t fid, char *time_units)
Definition: gtool_netcdf.c:455
#define File_HMID
Definition: gtool_file.h:12

◆ file_set_tattr_()

void file_set_tattr_ ( int32_t *  fid,
char *  vname,
char *  key,
char *  val,
int32_t *  error,
int32_t  vname_len,
int32_t  key_len,
int32_t  val_len 
)

Definition at line 265 of file gtool_file_f.c.

References File_HLONG, and File_HSHORT.

273 {
274  char _vname[File_HSHORT+1];
275  char _key[File_HSHORT+1];
276  char _val[File_HLONG+1];
277  int32_t len;
278 
279  len = vname_len > File_HLONG ? File_HLONG : vname_len;
280  fstr2cstr(_vname, vname, len);
281 
282  len = key_len > File_HLONG ? File_HLONG : key_len;
283  fstr2cstr(_key, key, len);
284 
285  len = val_len > File_HLONG ? File_HLONG : val_len;
286  fstr2cstr(_val, val, len);
287 
288  *error = file_set_tattr( *fid, _vname, _key, _val );
289 }
int32_t file_set_tattr(int32_t fid, char *vname, char *key, char *val)
Definition: gtool_netcdf.c:463
#define File_HSHORT
Definition: gtool_file.h:11
#define File_HLONG
Definition: gtool_file.h:13

◆ file_put_axis_()

void file_put_axis_ ( int32_t *  fid,
char *  name,
char *  desc,
char *  units,
char *  dim_name,
int32_t *  dtype,
void *  val,
int32_t *  size,
int32_t *  precision,
int32_t *  error,
int32_t  name_len,
int32_t  desc_len,
int32_t  units_len,
int32_t  dim_name_len 
)

Definition at line 291 of file gtool_file_f.c.

305 {
306  char _name[File_HSHORT+1];
307  char _desc[File_HMID+1];
308  char _units[File_HMID+1];
309  char _dim_name[File_HSHORT+1];
310  int len;
311 
312  len = name_len > File_HSHORT ? File_HSHORT : name_len;
313  fstr2cstr(_name, name, len);
314 
315  len = desc_len > File_HMID ? File_HMID : desc_len;
316  fstr2cstr(_desc, desc, len);
317 
318  len = units_len > File_HMID ? File_HMID : units_len;
319  fstr2cstr(_units, units, len);
320 
321  len = dim_name_len > File_HSHORT ? File_HSHORT : dim_name_len;
322  fstr2cstr(_dim_name, dim_name, len);
323 
324  *error = file_put_axis( *fid, _name, _desc, _units, _dim_name, *dtype, val, *size, *precision );
325 }
#define File_HMID
Definition: gtool_file.h:12
#define File_HSHORT
Definition: gtool_file.h:11
int32_t file_put_axis(int32_t fid, char *name, char *desc, char *units, char *dim_name, int32_t dtype, void *val, int32_t size, int32_t precision)
Definition: gtool_netcdf.c:492

◆ file_def_axis_()

void file_def_axis_ ( int32_t *  fid,
char *  name,
char *  desc,
char *  units,
char *  dim_name,
int32_t *  dtype,
int32_t *  dim_size,
int32_t *  error,
int32_t  name_len,
int32_t  desc_len,
int32_t  units_len,
int32_t  dim_name_len 
)

Definition at line 327 of file gtool_file_f.c.

339 {
340  char _name[File_HSHORT+1];
341  char _desc[File_HMID+1];
342  char _units[File_HMID+1];
343  char _dim_name[File_HSHORT+1];
344  int len;
345 
346  len = name_len > File_HSHORT ? File_HSHORT : name_len;
347  fstr2cstr(_name, name, len);
348 
349  len = desc_len > File_HMID ? File_HMID : desc_len;
350  fstr2cstr(_desc, desc, len);
351 
352  len = units_len > File_HMID ? File_HMID : units_len;
353  fstr2cstr(_units, units, len);
354 
355  len = dim_name_len > File_HSHORT ? File_HSHORT : dim_name_len;
356  fstr2cstr(_dim_name, dim_name, len);
357 
358  *error = file_def_axis( *fid, _name, _desc, _units, _dim_name, *dtype, *dim_size );
359 }
#define File_HMID
Definition: gtool_file.h:12
#define File_HSHORT
Definition: gtool_file.h:11
int32_t file_def_axis(int32_t fid, char *name, char *desc, char *units, char *dim_name, int32_t dtype, int32_t dim_size)
Definition: gtool_netcdf.c:546

◆ file_write_axis_()

void file_write_axis_ ( int32_t *  fid,
char *  name,
void *  val,
int32_t *  precision,
int32_t *  error,
int32_t  name_len 
)

Definition at line 361 of file gtool_file_f.c.

References File_HSHORT.

367 {
368  char _name[File_HSHORT+1];
369  int len;
370 
371  len = name_len > File_HSHORT ? File_HSHORT : name_len;
372  fstr2cstr(_name, name, len);
373 
374  *error = file_write_axis( *fid, _name, val, *precision );
375 }
#define File_HSHORT
Definition: gtool_file.h:11
int32_t file_write_axis(int32_t fid, char *name, void *val, int32_t precision)
Definition: gtool_netcdf.c:581

◆ file_put_associated_coordinates_()

void file_put_associated_coordinates_ ( int32_t *  fid,
char *  name,
char *  desc,
char *  units,
char *  dim_names,
int32_t *  ndims,
int32_t *  dtype,
void *  val,
int32_t *  precision,
int32_t *  error,
int32_t  name_len,
int32_t  desc_len,
int32_t  units_len,
int32_t  dim_name_len 
)

Definition at line 377 of file gtool_file_f.c.

391 {
392  char _name[File_HSHORT+1];
393  char _desc[File_HMID+1];
394  char _units[File_HMID+1];
395  char **_dim_names;
396  int len;
397  int i;
398 
399  len = name_len > File_HSHORT ? File_HSHORT : name_len;
400  fstr2cstr(_name, name, len);
401 
402  len = desc_len > File_HMID ? File_HMID : desc_len;
403  fstr2cstr(_desc, desc, len);
404 
405  len = units_len > File_HMID ? File_HMID : units_len;
406  fstr2cstr(_units, units, len);
407 
408  _dim_names = (char**) malloc(sizeof(char*)*(*ndims));
409  len = dim_name_len > File_HSHORT ? File_HSHORT : dim_name_len;
410  for ( i=0; i<*ndims; i++ ) {
411  _dim_names[i] = (char*) malloc(sizeof(char)*(File_HSHORT+1));
412  fstr2cstr(_dim_names[i], dim_names+i*dim_name_len, len);
413  }
414  *error = file_put_associated_coordinates( *fid, _name, _desc, _units, _dim_names, *ndims, *dtype, val, *precision );
415 }
#define File_HMID
Definition: gtool_file.h:12
#define File_HSHORT
Definition: gtool_file.h:11
int32_t file_put_associated_coordinates(int32_t fid, char *name, char *desc, char *units, char **dim_names, int32_t ndims, int32_t dtype, void *val, int32_t precision)
Definition: gtool_netcdf.c:615

◆ file_def_associated_coordinates_()

void file_def_associated_coordinates_ ( int32_t *  fid,
char *  name,
char *  desc,
char *  units,
char *  dim_names,
int32_t *  ndims,
int32_t *  dtype,
int32_t *  error,
int32_t  name_len,
int32_t  desc_len,
int32_t  units_len,
int32_t  dim_name_len 
)

Definition at line 417 of file gtool_file_f.c.

429 {
430  char _name[File_HSHORT+1];
431  char _desc[File_HMID+1];
432  char _units[File_HMID+1];
433  char **_dim_names;
434  int len;
435  int i;
436 
437  len = name_len > File_HSHORT ? File_HSHORT : name_len;
438  fstr2cstr(_name, name, len);
439 
440  len = desc_len > File_HMID ? File_HMID : desc_len;
441  fstr2cstr(_desc, desc, len);
442 
443  len = units_len > File_HMID ? File_HMID : units_len;
444  fstr2cstr(_units, units, len);
445 
446  _dim_names = (char**) malloc(sizeof(char*)*(*ndims));
447  len = dim_name_len > File_HSHORT ? File_HSHORT : dim_name_len;
448  for ( i=0; i<*ndims; i++ ) {
449  _dim_names[i] = (char*) malloc(sizeof(char)*(File_HSHORT+1));
450  fstr2cstr(_dim_names[i], dim_names+i*dim_name_len, len);
451  }
452  *error = file_def_associated_coordinates( *fid, _name, _desc, _units, _dim_names, *ndims, *dtype );
453 }
#define File_HMID
Definition: gtool_file.h:12
#define File_HSHORT
Definition: gtool_file.h:11
int32_t file_def_associated_coordinates(int32_t fid, char *name, char *desc, char *units, char **dim_names, int32_t ndims, int32_t dtype)
Definition: gtool_netcdf.c:673

◆ file_write_associated_coordinates_()

void file_write_associated_coordinates_ ( int32_t *  fid,
char *  name,
void *  val,
int32_t *  precision,
int32_t *  error,
int32_t  name_len 
)

Definition at line 455 of file gtool_file_f.c.

References File_HSHORT.

461 {
462  char _name[File_HSHORT+1];
463  int len;
464 
465  len = name_len > File_HSHORT ? File_HSHORT : name_len;
466  fstr2cstr(_name, name, len);
467 
468  *error = file_write_associated_coordinates( *fid, _name, val, *precision );
469 }
#define File_HSHORT
Definition: gtool_file.h:11
int32_t file_write_associated_coordinates(int32_t fid, char *name, void *val, int32_t precision)
Definition: gtool_netcdf.c:712

◆ file_add_variable_()

void file_add_variable_ ( int32_t *  vid,
int32_t *  fid,
char *  varname,
char *  desc,
char *  units,
char *  dims,
int32_t *  ndims,
int32_t *  dtype,
real64_t *  tint,
int32_t *  tavg,
int32_t *  error,
int32_t  varname_len,
int32_t  desc_len,
int32_t  units_len,
int32_t  dims_len 
)

Definition at line 471 of file gtool_file_f.c.

486 {
487  char _varname[File_HSHORT+1];
488  char _desc[File_HMID+1];
489  char _units[File_HMID+1];
490  char **_dims;
491  int len;
492  int i;
493 
494  len = varname_len > File_HSHORT ? File_HSHORT : varname_len;
495  fstr2cstr(_varname, varname, len);
496 
497  len = desc_len > File_HMID ? File_HMID : desc_len;
498  fstr2cstr(_desc, desc, len);
499 
500  len = units_len > File_HMID ? File_HMID : units_len;
501  fstr2cstr(_units, units, len);
502 
503  _dims = (char**) malloc(sizeof(char*)*(*ndims));
504  len = dims_len > File_HSHORT ? File_HSHORT : dims_len;
505  for ( i=0; i<*ndims; i++ ) {
506  _dims[i] = (char*) malloc(sizeof(char)*(File_HSHORT+1));
507  fstr2cstr(_dims[i], dims+i*dims_len, len);
508  }
509 
510  *error = file_add_variable( vid, *fid, _varname, _desc, _units, _dims, *ndims, *dtype, *tint, *tavg );
511 
512  for ( i=0; i<*ndims; i++ )
513  free( _dims[i] );
514  free( _dims );
515 }
#define File_HMID
Definition: gtool_file.h:12
#define File_HSHORT
Definition: gtool_file.h:11
int32_t file_add_variable(int32_t *vid, int32_t fid, char *varname, char *desc, char *units, char **dims, int32_t ndims, int32_t dtype, real64_t tint, int32_t tavg)
Definition: gtool_netcdf.c:746

◆ file_write_data_()

void file_write_data_ ( int32_t *  fid,
int32_t *  vid,
void *  var,
real64_t *  t_start,
real64_t *  t_end,
int32_t *  precision,
int32_t *  error 
)

Definition at line 517 of file gtool_file_f.c.

References file_write_data().

524 {
525  *error = file_write_data( *fid, *vid, var, *t_start, *t_end, *precision );
526 }
int32_t file_write_data(int32_t fid, int32_t vid, void *var, real64_t t_start, real64_t t_end, int32_t precision)
Definition: gtool_netcdf.c:948
Here is the call graph for this function:

◆ file_write_var_()

void file_write_var_ ( int32_t *  vid,
void *  var,
real64_t *  t_start,
real64_t *  t_end,
int32_t *  precision,
int32_t *  error 
)

Definition at line 528 of file gtool_file_f.c.

References file_write_var().

534 {
535  *error = file_write_var( *vid, var, *t_start, *t_end, *precision );
536 }
int32_t file_write_var(int32_t vid, void *var, real64_t t_start, real64_t t_end, int32_t precision)
Here is the call graph for this function:

◆ file_close_()

void file_close_ ( int32_t *  fid,
int32_t *  error 
)

Definition at line 538 of file gtool_file_f.c.

References file_close().

540 {
541  *error = file_close( *fid );
542 }
int32_t file_close(int32_t fid)
Here is the call graph for this function:

◆ file_enddef_()

void file_enddef_ ( int32_t *  fid,
int32_t *  error 
)

Definition at line 544 of file gtool_file_f.c.

References file_enddef().

546 {
547  *error = file_enddef( *fid );
548 }
int32_t file_enddef(int32_t fid)
Here is the call graph for this function: