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 )
10  for ( i=0; i<len; i++ )
11  cstr[i] = fstr[i];
12 
13  for ( i=len-1; i>=0; i-- ) {
14  if ( cstr[i] != ' ' ) {
15  i += 1;
16  break;
17  }
18  }
19  cstr[i] = '\0';
20 }
21 
22 static void cstr2fstr( char *fstr, // (out)
23  char *cstr, // (in)
24  int32_t len)
25 {
26  int i;
27 
28  if ( fstr != cstr )
29  for ( i=0; i<len; i++ )
30  fstr[i] = cstr[i];
31 
32  for ( i=0; i<len; i++ )
33  if ( cstr[i] == '\0' ) break;
34 
35  for ( ; i < len; i++ )
36  fstr[i] = ' ';
37 }
38 
39 void file_open_( int32_t *fid, // (out)
40  char *fname, // (in)
41  int32_t *mode, // (in)
42  int32_t *comm, // (in)
43  int32_t *error, // (out)
44  int32_t fname_len) // (in)
45 {
46  char _fname[File_HLONG+1];
47  int32_t len;
48 
49  len = fname_len > File_HLONG ? File_HLONG : fname_len;
50  fstr2cstr(_fname, fname, len);
51 
52  *error = file_open( fid, _fname, *mode, MPI_Comm_f2c(*comm) );
53 }
54 
55 void file_set_option_( int32_t *fid, // (in)
56  char *filetype, // (in)
57  char *key, // (in)
58  char *val, // (in)
59  int32_t *error, // (out)
60  int32_t filetype_len,
61  int32_t key_len,
62  int32_t val_len)
63 {
64  char _filetype[File_HSHORT+1];
65  char _key[File_HMID+1];
66  char _val[File_HMID+1];
67  int32_t len;
68 
69  len = filetype_len > File_HSHORT ? File_HSHORT : filetype_len;
70  fstr2cstr(_filetype, filetype, len);
71 
72  len = key_len > File_HMID ? File_HMID : key_len;
73  fstr2cstr(_key, key, len);
74 
75  len = val_len > File_HMID ? File_HMID : val_len;
76  fstr2cstr(_val, val, len);
77 
78  *error = file_set_option(*fid, _filetype, _key, _val);
79 }
80 
81 void file_get_datainfo_( datainfo_t *dinfo, // (out)
82  int32_t *fid, // (in)
83  char *varname, // (in)
84  int32_t *step, // (in)
85  int32_t *suppress, // (in)
86  int32_t *error, // (out)
87  int32_t varname_len) // (in)
88 {
89  char _varname[File_HSHORT+1];
90  int32_t len;
91  int i;
92 
93  len = varname_len > File_HSHORT ? File_HSHORT : varname_len;
94  fstr2cstr(_varname, varname, len);
95 
96  *error = file_get_datainfo( dinfo, *fid, _varname, *step, *suppress );
97 
98  cstr2fstr(dinfo->varname, dinfo->varname, File_HSHORT);
99  cstr2fstr(dinfo->description, dinfo->description, File_HMID);
100  cstr2fstr(dinfo->units, dinfo->units, File_HSHORT);
101  cstr2fstr(dinfo->time_units, dinfo->time_units, File_HMID);
102  for ( i=0; i<MAX_RANK; i++ )
103  cstr2fstr(dinfo->dim_name+i*File_HSHORT, dinfo->dim_name+i*File_HSHORT, File_HSHORT);
104 }
105 void file_read_data_( void *var, // (out)
106  datainfo_t *dinfo, // (in)
107  int32_t *precision, // (in)
108  int32_t *error) // (out)
109 {
110  int i;
111 
112  fstr2cstr(dinfo->varname, dinfo->varname, File_HSHORT-1);
113  fstr2cstr(dinfo->description, dinfo->description, File_HMID-1);
114  fstr2cstr(dinfo->units, dinfo->units, File_HSHORT-1);
115  fstr2cstr(dinfo->time_units, dinfo->time_units, File_HMID-1);
116  for ( i=0; i<MAX_RANK; i++ )
117  fstr2cstr(dinfo->dim_name+i*File_HSHORT, dinfo->dim_name+i*File_HSHORT, File_HSHORT-1);
118 
119  *error = file_read_data( var, dinfo, *precision );
120 }
121 
122 void file_read_data_par_( void *var, // (out)
123  datainfo_t *dinfo, // (in)
124  int32_t *ndims, // (in)
125  int32_t *ntypes, // (in)
126  int32_t *dtype, // (in)
127  int32_t *start, // (in)
128  int32_t *count, // (in)
129  int32_t *error) // (out)
130 {
131  int i;
132  MPI_Offset ntypes_, start_[4], count_[4];
133 
134  fstr2cstr(dinfo->varname, dinfo->varname, File_HSHORT-1);
135  fstr2cstr(dinfo->description, dinfo->description, File_HMID-1);
136  fstr2cstr(dinfo->units, dinfo->units, File_HSHORT-1);
137  fstr2cstr(dinfo->time_units, dinfo->time_units, File_HMID-1);
138  for ( i=0; i<MAX_RANK; i++ )
139  fstr2cstr(dinfo->dim_name+i*File_HSHORT, dinfo->dim_name+i*File_HSHORT, File_HSHORT-1);
140 
141  for (i=0; i<*ndims; i++) {
142  start_[i+1] = start[*ndims - i - 1] - 1;
143  count_[i+1] = count[*ndims - i - 1];
144  }
145  ntypes_ = (MPI_Offset)(*ntypes);
146 
147  *error = file_read_data_par( var, dinfo, ntypes_, MPI_Type_f2c(*dtype), start_, count_ );
148 }
149 
150 void file_get_global_attribute_text_( int32_t *fid, // (in)
151  char *key, // (in)
152  char *value, // (out)
153  int32_t *error, // (out)
154  int32_t key_len, // (in)
155  int32_t value_len ) // (in)
156 {
157  char _key[File_HLONG+1];
158  char _value[File_HLONG+1];
159  int32_t len;
160 
161  len = key_len > File_HLONG ? File_HLONG : key_len;
162  fstr2cstr(_key, key, len);
163 
164  *error = file_get_global_attribute_text( *fid, _key, _value, value_len );
165 
166  len = value_len > File_HLONG ? File_HLONG : value_len;
167  cstr2fstr(value, _value, len);
168 }
169 
170 void file_get_global_attribute_int_( int32_t *fid, // (in)
171  char *key, // (in)
172  int32_t *len, // (in)
173  int32_t *value, // (out)
174  int32_t *error, // (out)
175  int32_t key_len ) // (in)
176 {
177  char _key[File_HLONG+1];
178  int32_t l;
179 
180  l = key_len > File_HLONG ? File_HLONG : key_len;
181  fstr2cstr(_key, key, l);
182 
183  *error = file_get_global_attribute_int( *fid, _key, value, (size_t)*len );
184 }
185 
186 void file_get_global_attribute_float_( int32_t *fid, // (in)
187  char *key, // (in)
188  int32_t *len, // (in)
189  float *value, // (out)
190  int32_t *error, // (out)
191  int32_t key_len ) // (in)
192 {
193  char _key[File_HLONG+1];
194  int32_t l;
195 
196  l = key_len > File_HLONG ? File_HLONG : key_len;
197  fstr2cstr(_key, key, l);
198 
199  *error = file_get_global_attribute_float( *fid, _key, value, (size_t)*len );
200 }
201 
202 void file_get_global_attribute_double_( int32_t *fid, // (in)
203  char *key, // (in)
204  int32_t *len, // (in)
205  double *value, // (out)
206  int32_t *error, // (out)
207  int32_t key_len ) // (in)
208 {
209  char _key[File_HLONG+1];
210  int32_t l;
211 
212  l = key_len > File_HLONG ? File_HLONG : key_len;
213  fstr2cstr(_key, key, l);
214 
215  *error = file_get_global_attribute_double( *fid, _key, value, (size_t)*len );
216 }
217 
218 void file_set_global_attribute_text_( int32_t *fid, // (in)
219  char *key, // (in)
220  char *value, // (in)
221  int32_t *error, // (out)
222  int32_t key_len, // (in)
223  int32_t value_len ) // (in)
224 {
225  char _key[File_HLONG+1];
226  char _value[File_HLONG+1];
227  int32_t len;
228 
229  len = key_len > File_HLONG ? File_HLONG : key_len;
230  fstr2cstr(_key, key, len);
231 
232  len = value_len > File_HLONG ? File_HLONG : value_len;
233  fstr2cstr(_value, value, len);
234 
235  *error = file_set_global_attribute_text( *fid, _key, _value );
236 }
237 
238 void file_set_global_attribute_int_( int32_t *fid, // (in)
239  char *key, // (in)
240  int32_t *value, // (in)
241  int32_t *len, // (in)
242  int32_t *error, // (out)
243  int32_t key_len ) // (in)
244 {
245  char _key[File_HLONG+1];
246 
247  key_len = key_len > File_HLONG ? File_HLONG : key_len;
248  fstr2cstr(_key, key, key_len);
249 
250  *error = file_set_global_attribute_int( *fid, _key, value, (size_t)*len );
251 }
252 
253 void file_set_global_attribute_float_( int32_t *fid, // (in)
254  char *key, // (in)
255  float *value, // (in)
256  int32_t *len, // (in)
257  int32_t *error, // (out)
258  int32_t key_len ) // (in)
259 {
260  char _key[File_HLONG+1];
261  int32_t l;
262 
263  l = key_len > File_HLONG ? File_HLONG : key_len;
264  fstr2cstr(_key, key, l);
265 
266  *error = file_set_global_attribute_float( *fid, _key, value, (size_t)*len );
267 }
268 
269 void file_set_global_attribute_double_( int32_t *fid, // (in)
270  char *key, // (in)
271  double *value, // (in)
272  int32_t *len, // (in)
273  int32_t *error, // (out)
274  int32_t key_len ) // (in)
275 {
276  char _key[File_HLONG+1];
277  int32_t l;
278 
279  l = key_len > File_HLONG ? File_HLONG : key_len;
280  fstr2cstr(_key, key, l);
281 
282  *error = file_set_global_attribute_double( *fid, _key, value, (size_t)*len );
283 }
284 
285 void file_set_tunits_( int32_t *fid, // (in)
286  char *time_units, // (in)
287  int32_t *error, // (in)
288  int32_t len) // (in)
289 {
290  char _time_units[File_HMID+1];
291 
292  len = len > File_HMID ? File_HMID : len;
293  fstr2cstr(_time_units, time_units, len);
294 
295  *error = file_set_tunits( *fid, _time_units );
296 }
297 
298 void file_set_tattr_( int32_t *fid, // (in)
299  char *vname, // (in)
300  char *key, // (in)
301  char *val, // (in)
302  int32_t *error, // (out)
303  int32_t vname_len, // (in)
304  int32_t key_len, // (in)
305  int32_t val_len) // (in)
306 {
307  char _vname[File_HSHORT+1];
308  char _key[File_HSHORT+1];
309  char _val[File_HLONG+1];
310  int32_t len;
311 
312  len = vname_len > File_HLONG ? File_HLONG : vname_len;
313  fstr2cstr(_vname, vname, len);
314 
315  len = key_len > File_HLONG ? File_HLONG : key_len;
316  fstr2cstr(_key, key, len);
317 
318  len = val_len > File_HLONG ? File_HLONG : val_len;
319  fstr2cstr(_val, val, len);
320 
321  *error = file_set_tattr( *fid, _vname, _key, _val );
322 }
323 
324 void file_put_axis_( int32_t *fid, // (in)
325  char *name, // (in)
326  char *desc, // (in)
327  char *units, // (in)
328  char *dim_name, // (in)
329  int32_t *dtype, // (in)
330  void *val, // (in)
331  int32_t *size, // (in)
332  int32_t *precision, // (in)
333  int32_t *error, // (out)
334  int32_t name_len, // (in)
335  int32_t desc_len, // (in)
336  int32_t units_len, // (in)
337  int32_t dim_name_len) // (in)
338 {
339  char _name[File_HSHORT+1];
340  char _desc[File_HMID+1];
341  char _units[File_HMID+1];
342  char _dim_name[File_HSHORT+1];
343  int len;
344 
345  len = name_len > File_HSHORT ? File_HSHORT : name_len;
346  fstr2cstr(_name, name, len);
347 
348  len = desc_len > File_HMID ? File_HMID : desc_len;
349  fstr2cstr(_desc, desc, len);
350 
351  len = units_len > File_HMID ? File_HMID : units_len;
352  fstr2cstr(_units, units, len);
353 
354  len = dim_name_len > File_HSHORT ? File_HSHORT : dim_name_len;
355  fstr2cstr(_dim_name, dim_name, len);
356 
357  *error = file_put_axis( *fid, _name, _desc, _units, _dim_name, *dtype, val, *size, *precision );
358 }
359 
360 void file_def_axis_( int32_t *fid, // (in)
361  char *name, // (in)
362  char *desc, // (in)
363  char *units, // (in)
364  char *dim_name, // (in)
365  int32_t *dtype, // (in)
366  int32_t *dim_size, // (in)
367  int32_t *error, // (out)
368  int32_t name_len, // (in)
369  int32_t desc_len, // (in)
370  int32_t units_len, // (in)
371  int32_t dim_name_len) // (in)
372 {
373  char _name[File_HSHORT+1];
374  char _desc[File_HMID+1];
375  char _units[File_HMID+1];
376  char _dim_name[File_HSHORT+1];
377  int len;
378 
379  len = name_len > File_HSHORT ? File_HSHORT : name_len;
380  fstr2cstr(_name, name, len);
381 
382  len = desc_len > File_HMID ? File_HMID : desc_len;
383  fstr2cstr(_desc, desc, len);
384 
385  len = units_len > File_HMID ? File_HMID : units_len;
386  fstr2cstr(_units, units, len);
387 
388  len = dim_name_len > File_HSHORT ? File_HSHORT : dim_name_len;
389  fstr2cstr(_dim_name, dim_name, len);
390 
391  *error = file_def_axis( *fid, _name, _desc, _units, _dim_name, *dtype, *dim_size );
392 }
393 
394 void file_write_axis_( int32_t *fid, // (in)
395  char *name, // (in)
396  void *val, // (in)
397  int32_t *precision, // (in)
398  int32_t *start, // (in)
399  int32_t *count, // (in)
400  int32_t *error, // (out)
401  int32_t name_len) // (in)
402 {
403  char _name[File_HSHORT+1];
404  int len;
405  MPI_Offset start_[1], count_[1];
406 
407  len = name_len > File_HSHORT ? File_HSHORT : name_len;
408  fstr2cstr(_name, name, len);
409 
410  /* all axes are 1D */
411  start_[0] = *start - 1; /* C index is 0-based */
412  count_[0] = *count;
413 
414  *error = file_write_axis( *fid, _name, val, *precision, start_, count_ );
415 }
416 
417 void file_put_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  void *val, // (in)
425  int32_t *precision, // (in)
426  int32_t *error, // (out)
427  int32_t name_len, // (in)
428  int32_t desc_len, // (in)
429  int32_t units_len, // (in)
430  int32_t dim_name_len) // (in)
431 {
432  char _name[File_HSHORT+1];
433  char _desc[File_HMID+1];
434  char _units[File_HMID+1];
435  char **_dim_names;
436  int len;
437  int i;
438 
439  len = name_len > File_HSHORT ? File_HSHORT : name_len;
440  fstr2cstr(_name, name, len);
441 
442  len = desc_len > File_HMID ? File_HMID : desc_len;
443  fstr2cstr(_desc, desc, len);
444 
445  len = units_len > File_HMID ? File_HMID : units_len;
446  fstr2cstr(_units, units, len);
447 
448  _dim_names = (char**) malloc(sizeof(char*)*(*ndims));
449  len = dim_name_len > File_HSHORT ? File_HSHORT : dim_name_len;
450  for ( i=0; i<*ndims; i++ ) {
451  _dim_names[i] = (char*) malloc(sizeof(char)*(File_HSHORT+1));
452  fstr2cstr(_dim_names[i], dim_names+i*dim_name_len, len);
453  }
454  *error = file_put_associated_coordinates( *fid, _name, _desc, _units, _dim_names, *ndims, *dtype, val, *precision );
455 }
456 
457 void file_def_associated_coordinates_( int32_t *fid, // (in)
458  char *name, // (in)
459  char *desc, // (in)
460  char *units, // (in)
461  char *dim_names, // (in)
462  int32_t *ndims, // (in)
463  int32_t *dtype, // (in)
464  int32_t *error, // (out)
465  int32_t name_len, // (in)
466  int32_t desc_len, // (in)
467  int32_t units_len, // (in)
468  int32_t dim_name_len) // (in)
469 {
470  char _name[File_HSHORT+1];
471  char _desc[File_HMID+1];
472  char _units[File_HMID+1];
473  char **_dim_names;
474  int len;
475  int i;
476 
477  len = name_len > File_HSHORT ? File_HSHORT : name_len;
478  fstr2cstr(_name, name, len);
479 
480  len = desc_len > File_HMID ? File_HMID : desc_len;
481  fstr2cstr(_desc, desc, len);
482 
483  len = units_len > File_HMID ? File_HMID : units_len;
484  fstr2cstr(_units, units, len);
485 
486  _dim_names = (char**) malloc(sizeof(char*)*(*ndims));
487  len = dim_name_len > File_HSHORT ? File_HSHORT : dim_name_len;
488  for ( i=0; i<*ndims; i++ ) {
489  _dim_names[i] = (char*) malloc(sizeof(char)*(File_HSHORT+1));
490  fstr2cstr(_dim_names[i], dim_names+i*dim_name_len, len);
491  }
492  *error = file_def_associated_coordinates( *fid, _name, _desc, _units, _dim_names, *ndims, *dtype );
493 }
494 
495 void file_write_associated_coordinates_( int32_t *fid, // (in)
496  char *name, // (in)
497  void *val, // (in)
498  int32_t *precision, // (in)
499  int32_t *ndims, // (in)
500  int32_t *start, // (in)
501  int32_t *count, // (in)
502  int32_t *error, // (out)
503  int32_t name_len) // (in)
504 {
505  char _name[File_HSHORT+1];
506  int i, len;
507  MPI_Offset start_[4], count_[4];
508  /* all associated coordinates are up to 4D */
509 
510  len = name_len > File_HSHORT ? File_HSHORT : name_len;
511  fstr2cstr(_name, name, len);
512 
513  for (i=0; i<*ndims; i++) {
514  start_[i] = start[*ndims - i - 1] - 1;
515  count_[i] = count[*ndims - i - 1];
516  }
517  *error = file_write_associated_coordinates( *fid, _name, val, *precision, start_, count_ );
518 }
519 
520 void file_add_variable_( int32_t *vid, // (out)
521  int32_t *fid, // (in)
522  char *varname, // (in)
523  char *desc, // (in)
524  char *units, // (in)
525  char *dims, // (in)
526  int32_t *ndims, // (in)
527  int32_t *dtype, // (in)
528  real64_t *tint, // (in)
529  int32_t *tavg, // (in)
530  int32_t *error, // (out)
531  int32_t varname_len, // (in)
532  int32_t desc_len, // (in)
533  int32_t units_len, // (in)
534  int32_t dims_len) // (in)
535 {
536  char _varname[File_HSHORT+1];
537  char _desc[File_HMID+1];
538  char _units[File_HMID+1];
539  char **_dims;
540  int len;
541  int i;
542 
543  len = varname_len > File_HSHORT ? File_HSHORT : varname_len;
544  fstr2cstr(_varname, varname, len);
545 
546  len = desc_len > File_HMID ? File_HMID : desc_len;
547  fstr2cstr(_desc, desc, len);
548 
549  len = units_len > File_HMID ? File_HMID : units_len;
550  fstr2cstr(_units, units, len);
551 
552  _dims = (char**) malloc(sizeof(char*)*(*ndims));
553  len = dims_len > File_HSHORT ? File_HSHORT : dims_len;
554  for ( i=0; i<*ndims; i++ ) {
555  _dims[i] = (char*) malloc(sizeof(char)*(File_HSHORT+1));
556  fstr2cstr(_dims[i], dims+i*dims_len, len);
557  }
558 
559  *error = file_add_variable( vid, *fid, _varname, _desc, _units, _dims, *ndims, *dtype, *tint, *tavg );
560 
561  for ( i=0; i<*ndims; i++ )
562  free( _dims[i] );
563  free( _dims );
564 }
565 
566 void file_write_data_( int32_t *fid, // (in)
567  int32_t *vid, // (in)
568  void *var, // (in)
569  real64_t *t_start, // (in)
570  real64_t *t_end, // (in)
571  int32_t *precision, // (in)
572  int32_t *ndims, // (in)
573  int32_t *start, // (in)
574  int32_t *count, // (in)
575  int32_t *error) // (out)
576 {
577  int i;
578  MPI_Offset start_[4], count_[4]; /* assume max ndims is 4 */
579 
580  for (i=0; i<*ndims; i++) {
581  start_[i] = start[*ndims - i - 1] - 1;
582  count_[i] = count[*ndims - i - 1];
583  }
584  *error = file_write_data( *fid, *vid, var, *t_start, *t_end, *precision, start_, count_ );
585 }
586 
587 void file_close_( int32_t *fid , // (in)
588  int32_t *error ) // (out)
589 {
590  *error = file_close( *fid );
591 }
592 
593 void file_enddef_( int32_t *fid , // (in)
594  int32_t *error ) // (out)
595 {
596  *error = file_enddef( *fid );
597 }
598 
599 void file_attach_buffer_( int32_t *fid , // (in)
600  int32_t *buf_amount, // (out)
601  int32_t *error ) // (out)
602 {
603  *error = file_attach_buffer( *fid, *buf_amount );
604 }
605 
606 void file_detach_buffer_( int32_t *fid , // (in)
607  int32_t *error ) // (out)
608 {
609  *error = file_detach_buffer( *fid );
610 }
611 
612 void file_flush_( int32_t *fid , // (in)
613  int32_t *error ) // (out)
614 {
615  *error = file_flush( *fid );
616 }
int32_t file_set_tunits(int32_t fid, char *time_units)
Definition: gtool_netcdf.c:647
#define File_HMID
Definition: gtool_file.h:13
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:417
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:81
void file_close_(int32_t *fid, int32_t *error)
Definition: gtool_file_f.c:587
int32_t file_open(int32_t *fid, char *fname, int32_t mode, MPI_Comm comm)
Definition: gtool_netcdf.c:132
#define MAX_RANK
Definition: gtool_file.h:35
void file_open_(int32_t *fid, char *fname, int32_t *mode, int32_t *comm, int32_t *error, int32_t fname_len)
Definition: gtool_file_f.c:39
int32_t file_set_tattr(int32_t fid, char *vname, char *key, char *val)
Definition: gtool_netcdf.c:655
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:298
void file_attach_buffer_(int32_t *fid, int32_t *buf_amount, int32_t *error)
Definition: gtool_file_f.c:599
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:324
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:253
int32_t file_set_global_attribute_text(int32_t fid, char *key, char *value)
Definition: gtool_netcdf.c:540
int32_t file_attach_buffer(int32_t fid, int32_t buf_amount)
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:269
int32_t file_set_global_attribute_double(int32_t fid, char *key, double *value, size_t len)
Definition: gtool_netcdf.c:620
int32_t file_set_global_attribute_float(int32_t fid, char *key, float *value, size_t len)
Definition: gtool_netcdf.c:593
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:504
char dim_name[File_HSHORT *MAX_RANK]
Definition: gtool_file.h:48
char description[File_HMID]
Definition: gtool_file.h:44
int32_t file_get_datainfo(datainfo_t *dinfo, int32_t fid, char *varname, int32_t step, int32_t suppress)
Definition: gtool_netcdf.c:218
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:285
void file_enddef_(int32_t *fid, int32_t *error)
Definition: gtool_file_f.c:593
#define File_HSHORT
Definition: gtool_file.h:12
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:202
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:55
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 *ndims, int32_t *start, int32_t *count, int32_t *error)
Definition: gtool_file_f.c:566
int32_t file_get_global_attribute_double(int32_t fid, char *key, double *value, size_t len)
Definition: gtool_netcdf.c:522
void file_read_data_par_(void *var, datainfo_t *dinfo, int32_t *ndims, int32_t *ntypes, int32_t *dtype, int32_t *start, int32_t *count, int32_t *error)
Definition: gtool_file_f.c:122
void file_read_data_(void *var, datainfo_t *dinfo, int32_t *precision, int32_t *error)
Definition: gtool_file_f.c:105
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:694
void file_detach_buffer_(int32_t *fid, int32_t *error)
Definition: gtool_file_f.c:606
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:748
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:218
void file_write_associated_coordinates_(int32_t *fid, char *name, void *val, int32_t *precision, int32_t *ndims, int32_t *start, int32_t *count, int32_t *error, int32_t name_len)
Definition: gtool_file_f.c:495
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:238
int32_t file_read_data_par(void *var, datainfo_t *dinfo, MPI_Offset ntypes, MPI_Datatype dtype, MPI_Offset *start, MPI_Offset *count)
Definition: gtool_netcdf.c:439
int32_t file_write_axis(int32_t fid, char *name, void *val, int32_t precision, MPI_Offset *start, MPI_Offset *count)
Definition: gtool_netcdf.c:797
void file_write_axis_(int32_t *fid, char *name, void *val, int32_t *precision, int32_t *start, int32_t *count, int32_t *error, int32_t name_len)
Definition: gtool_file_f.c:394
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:457
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:170
int32_t file_get_global_attribute_text(int32_t fid, char *key, char *value, int32_t len)
Definition: gtool_netcdf.c:466
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:150
void file_flush_(int32_t *fid, int32_t *error)
Definition: gtool_file_f.c:612
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:520
char time_units[File_HMID]
Definition: gtool_file.h:53
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:186
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:900
int32_t file_write_data(int32_t fid, int32_t vid, void *var, real64_t t_start, real64_t t_end, int32_t precision, MPI_Offset *start, MPI_Offset *count)
#define File_HLONG
Definition: gtool_file.h:14
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:360
char units[File_HSHORT]
Definition: gtool_file.h:45
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:842
int32_t file_write_associated_coordinates(int32_t fid, char *name, void *val, int32_t precision, MPI_Offset *start, MPI_Offset *count)
Definition: gtool_netcdf.c:956
char varname[File_HSHORT]
Definition: gtool_file.h:43
int32_t file_read_data(void *var, datainfo_t *dinfo, int32_t precision)
Definition: gtool_netcdf.c:390
int32_t file_flush(int32_t fid)
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)
int32_t file_detach_buffer(int32_t fid)
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:202