SCALE-RM
gtool_file_f.c
Go to the documentation of this file.
1 #include "gtool_file.h"
2 
3 static void fstr2cstr( char *cstr, // (out)
4  char *fstr, // (in)
5  int32_t len)
6 {
7  int i;
8 
9  if ( cstr != fstr ) strncpy( cstr, fstr, len );
10 
11  for ( i=len-1; i>=0; i-- ) {
12  if ( cstr[i] != ' ' ) {
13  i += 1;
14  break;
15  }
16  }
17  cstr[i] = '\0';
18 }
19 
20 static void cstr2fstr( char *fstr, // (out)
21  char *cstr, // (in)
22  int32_t len)
23 {
24  int i;
25 
26  if ( fstr != cstr ) strncpy( fstr, cstr, len );
27 
28  for ( i=0; i<len; i++ )
29  if ( cstr[i] == '\0' ) break;
30 
31  for ( ; i < len; i++ )
32  fstr[i] = ' ';
33 }
34 
35 void file_open_( int32_t *fid, // (out)
36  char *fname, // (in)
37  int32_t *mode, // (in)
38  int32_t *error, // (out)
39  int32_t fname_len) // (in)
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 }
49 
50 void file_set_option_( int32_t *fid, // (in)
51  char *filetype, // (in)
52  char *key, // (in)
53  char *val, // (in)
54  int32_t *error, // (out)
55  int32_t filetype_len,
56  int32_t key_len,
57  int32_t val_len)
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 }
75 
76 void file_get_datainfo_( datainfo_t *dinfo, // (out)
77  int32_t *fid, // (in)
78  char *varname, // (in)
79  int32_t *step, // (in)
80  int32_t *suppress, // (in)
81  int32_t *error, // (out)
82  int32_t varname_len) // (in)
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 }
100 void file_read_data_( void *var, // (out)
101  datainfo_t *dinfo, // (in)
102  int32_t *precision, // (in)
103  int32_t *error) // (out)
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 }
116 
117 void file_get_global_attribute_text_( int32_t *fid, // (in)
118  char *key, // (in)
119  char *value, // (out)
120  int32_t *error, // (out)
121  int32_t key_len, // (in)
122  int32_t value_len ) // (in)
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 }
136 
137 void file_get_global_attribute_int_( int32_t *fid, // (in)
138  char *key, // (in)
139  int32_t *len, // (in)
140  int32_t *value, // (out)
141  int32_t *error, // (out)
142  int32_t key_len ) // (in)
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 }
152 
153 void file_get_global_attribute_float_( int32_t *fid, // (in)
154  char *key, // (in)
155  int32_t *len, // (in)
156  float *value, // (out)
157  int32_t *error, // (out)
158  int32_t key_len ) // (in)
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 }
168 
169 void file_get_global_attribute_double_( int32_t *fid, // (in)
170  char *key, // (in)
171  int32_t *len, // (in)
172  double *value, // (out)
173  int32_t *error, // (out)
174  int32_t key_len ) // (in)
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 }
184 
185 void file_set_global_attribute_text_( int32_t *fid, // (in)
186  char *key, // (in)
187  char *value, // (in)
188  int32_t *error, // (out)
189  int32_t key_len, // (in)
190  int32_t value_len ) // (in)
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 }
204 
205 void file_set_global_attribute_int_( int32_t *fid, // (in)
206  char *key, // (in)
207  int32_t *value, // (in)
208  int32_t *len, // (in)
209  int32_t *error, // (out)
210  int32_t key_len ) // (in)
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 }
219 
220 void file_set_global_attribute_float_( int32_t *fid, // (in)
221  char *key, // (in)
222  float *value, // (in)
223  int32_t *len, // (in)
224  int32_t *error, // (out)
225  int32_t key_len ) // (in)
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 }
235 
236 void file_set_global_attribute_double_( int32_t *fid, // (in)
237  char *key, // (in)
238  double *value, // (in)
239  int32_t *len, // (in)
240  int32_t *error, // (out)
241  int32_t key_len ) // (in)
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 }
251 
252 void file_set_tunits_( int32_t *fid, // (in)
253  char *time_units, // (in)
254  int32_t *error, // (in)
255  int32_t len) // (in)
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 }
264 
265 void file_set_tattr_( int32_t *fid, // (in)
266  char *vname, // (in)
267  char *key, // (in)
268  char *val, // (in)
269  int32_t *error, // (out)
270  int32_t vname_len, // (in)
271  int32_t key_len, // (in)
272  int32_t val_len) // (in)
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 }
290 
291 void file_put_axis_( int32_t *fid, // (in)
292  char *name, // (in)
293  char *desc, // (in)
294  char *units, // (in)
295  char *dim_name, // (in)
296  int32_t *dtype, // (in)
297  void *val, // (in)
298  int32_t *size, // (in)
299  int32_t *precision, // (in)
300  int32_t *error, // (out)
301  int32_t name_len, // (in)
302  int32_t desc_len, // (in)
303  int32_t units_len, // (in)
304  int32_t dim_name_len) // (in)
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 }
326 
327 void file_def_axis_( int32_t *fid, // (in)
328  char *name, // (in)
329  char *desc, // (in)
330  char *units, // (in)
331  char *dim_name, // (in)
332  int32_t *dtype, // (in)
333  int32_t *dim_size, // (in)
334  int32_t *error, // (out)
335  int32_t name_len, // (in)
336  int32_t desc_len, // (in)
337  int32_t units_len, // (in)
338  int32_t dim_name_len) // (in)
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 }
360 
361 void file_write_axis_( int32_t *fid, // (in)
362  char *name, // (in)
363  void *val, // (in)
364  int32_t *precision, // (in)
365  int32_t *error, // (out)
366  int32_t name_len) // (in)
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 }
376 
377 void file_put_associated_coordinates_( int32_t *fid, // (in)
378  char *name, // (in)
379  char *desc, // (in)
380  char *units, // (in)
381  char *dim_names, // (in)
382  int32_t *ndims, // (in)
383  int32_t *dtype, // (in)
384  void *val, // (in)
385  int32_t *precision, // (in)
386  int32_t *error, // (out)
387  int32_t name_len, // (in)
388  int32_t desc_len, // (in)
389  int32_t units_len, // (in)
390  int32_t dim_name_len) // (in)
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 }
416 
417 void file_def_associated_coordinates_( int32_t *fid, // (in)
418  char *name, // (in)
419  char *desc, // (in)
420  char *units, // (in)
421  char *dim_names, // (in)
422  int32_t *ndims, // (in)
423  int32_t *dtype, // (in)
424  int32_t *error, // (out)
425  int32_t name_len, // (in)
426  int32_t desc_len, // (in)
427  int32_t units_len, // (in)
428  int32_t dim_name_len) // (in)
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 }
454 
455 void file_write_associated_coordinates_( int32_t *fid, // (in)
456  char *name, // (in)
457  void *val, // (in)
458  int32_t *precision, // (in)
459  int32_t *error, // (out)
460  int32_t name_len) // (in)
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 }
470 
471 void file_add_variable_( int32_t *vid, // (out)
472  int32_t *fid, // (in)
473  char *varname, // (in)
474  char *desc, // (in)
475  char *units, // (in)
476  char *dims, // (in)
477  int32_t *ndims, // (in)
478  int32_t *dtype, // (in)
479  real64_t *tint, // (in)
480  int32_t *tavg, // (in)
481  int32_t *error, // (out)
482  int32_t varname_len, // (in)
483  int32_t desc_len, // (in)
484  int32_t units_len, // (in)
485  int32_t dims_len) // (in)
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 }
516 
517 void file_write_data_( int32_t *fid, // (in)
518  int32_t *vid, // (in)
519  void *var, // (in)
520  real64_t *t_start, // (in)
521  real64_t *t_end, // (in)
522  int32_t *precision, // (in)
523  int32_t *error) // (out)
524 {
525  *error = file_write_data( *fid, *vid, var, *t_start, *t_end, *precision );
526 }
527 
528 void file_write_var_( int32_t *vid, // (in)
529  void *var, // (in)
530  real64_t *t_start, // (in)
531  real64_t *t_end, // (in)
532  int32_t *precision, // (in)
533  int32_t *error) // (out)
534 {
535  *error = file_write_var( *vid, var, *t_start, *t_end, *precision );
536 }
537 
538 void file_close_( int32_t *fid , // (in)
539  int32_t *error ) // (out)
540 {
541  *error = file_close( *fid );
542 }
543 
544 void file_enddef_( int32_t *fid , // (in)
545  int32_t *error ) // (out)
546 {
547  *error = file_enddef( *fid );
548 }
int32_t file_set_tunits(int32_t fid, char *time_units)
Definition: gtool_netcdf.c:455
#define File_HMID
Definition: gtool_file.h:12
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: gtool_file_f.c:377
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: gtool_file_f.c:76
void file_close_(int32_t *fid, int32_t *error)
Definition: gtool_file_f.c:538
#define MAX_RANK
Definition: gtool_file.h:34
void file_open_(int32_t *fid, char *fname, int32_t *mode, int32_t *error, int32_t fname_len)
Definition: gtool_file_f.c:35
int32_t file_set_tattr(int32_t fid, char *vname, char *key, char *val)
Definition: gtool_netcdf.c:463
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: gtool_file_f.c:265
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: gtool_file_f.c:517
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: gtool_file_f.c:291
void file_set_global_attribute_float_(int32_t *fid, char *key, float *value, int32_t *len, int32_t *error, int32_t key_len)
Definition: gtool_file_f.c:220
int32_t file_set_global_attribute_text(int32_t fid, char *key, char *value)
Definition: gtool_netcdf.c:368
void file_set_global_attribute_double_(int32_t *fid, char *key, double *value, int32_t *len, int32_t *error, int32_t key_len)
Definition: gtool_file_f.c:236
int32_t file_set_global_attribute_double(int32_t fid, char *key, double *value, size_t len)
Definition: gtool_netcdf.c:433
void file_write_associated_coordinates_(int32_t *fid, char *name, void *val, int32_t *precision, int32_t *error, int32_t name_len)
Definition: gtool_file_f.c:455
int32_t file_set_global_attribute_float(int32_t fid, char *key, float *value, size_t len)
Definition: gtool_netcdf.c:411
int32_t file_get_global_attribute_int(int32_t fid, char *key, int32_t *value, size_t len)
int32_t file_get_global_attribute_float(int32_t fid, char *key, float *value, size_t len)
Definition: gtool_netcdf.c:332
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
int32_t file_enddef(int32_t fid)
void file_set_tunits_(int32_t *fid, char *time_units, int32_t *error, int32_t len)
Definition: gtool_file_f.c:252
void file_enddef_(int32_t *fid, int32_t *error)
Definition: gtool_file_f.c:544
#define File_HSHORT
Definition: gtool_file.h:11
void file_write_axis_(int32_t *fid, char *name, void *val, int32_t *precision, int32_t *error, int32_t name_len)
Definition: gtool_file_f.c:361
int32_t file_set_global_attribute_int(int32_t fid, char *key, int32_t *value, size_t len)
void file_get_global_attribute_double_(int32_t *fid, char *key, int32_t *len, double *value, int32_t *error, int32_t key_len)
Definition: gtool_file_f.c:169
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: gtool_file_f.c:50
int32_t file_get_global_attribute_double(int32_t fid, char *key, double *value, size_t len)
Definition: gtool_netcdf.c:350
int32_t file_open(int32_t *fid, char *fname, int32_t mode)
Definition: gtool_netcdf.c:97
void file_read_data_(void *var, datainfo_t *dinfo, int32_t *precision, int32_t *error)
Definition: gtool_file_f.c:100
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
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
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
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: gtool_file_f.c:185
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: gtool_file_f.c:205
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: gtool_file_f.c:417
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: gtool_file_f.c:137
int32_t file_get_global_attribute_text(int32_t fid, char *key, char *value, int32_t len)
Definition: gtool_netcdf.c:294
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: gtool_file_f.c:117
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: gtool_file_f.c:471
char time_units[File_HMID]
Definition: gtool_file.h:52
void file_get_global_attribute_float_(int32_t *fid, char *key, int32_t *len, float *value, int32_t *error, int32_t key_len)
Definition: gtool_file_f.c:153
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
int32_t file_write_axis(int32_t fid, char *name, void *val, int32_t precision)
Definition: gtool_netcdf.c:581
#define File_HLONG
Definition: gtool_file.h:13
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: gtool_file_f.c:327
char units[File_HSHORT]
Definition: gtool_file.h:44
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
int32_t file_write_var(int32_t vid, void *var, real64_t t_start, real64_t t_end, int32_t precision)
int32_t file_write_associated_coordinates(int32_t fid, char *name, void *val, int32_t precision)
Definition: gtool_netcdf.c:712
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
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
int32_t file_close(int32_t fid)
int32_t file_set_option(int32_t fid, char *filetype, char *key, char *val)
Definition: gtool_netcdf.c:146
void file_write_var_(int32_t *vid, void *var, real64_t *t_start, real64_t *t_end, int32_t *precision, int32_t *error)
Definition: gtool_file_f.c:528