Go to the documentation of this file.
3 static void fstr2cstr(
char *cstr,
10 for (
i=0;
i<len;
i++ )
13 for (
i=len-1;
i>=0;
i-- ) {
14 if ( cstr[
i] !=
' ' )
break;
19 static void cstr2fstr(
char *fstr,
26 for (
i=0;
i<len;
i++ )
29 for (
i=0;
i<len;
i++ )
30 if ( cstr[
i] ==
'\0' )
break;
32 for ( ;
i < len;
i++ )
41 const int32_t fname_len)
47 fstr2cstr(_fname, fname, len);
49 *error =
file_open_c( fid, _fname, *mode, MPI_Comm_f2c(*comm) );
56 const int32_t dimname_len )
62 fstr2cstr(_dimname, dimname, clen);
72 const int32_t filetype_len,
73 const int32_t key_len,
74 const int32_t val_len)
82 fstr2cstr(_filetype, filetype, len);
85 fstr2cstr(_key, key, len);
88 fstr2cstr(_val, val, len);
104 const int32_t varname_len )
112 cstr2fstr(varname, _varname, len);
119 const int32_t *suppress,
121 const int32_t varname_len)
128 fstr2cstr(_varname, varname, len);
140 for (
i=0;
i<dinfo->
rank;
i++ )
150 const int32_t varname_len )
156 fstr2cstr(_varname, varname, clen);
163 const int32_t *precision,
164 const int32_t *ntypes,
165 const int32_t *dtype,
166 const int32_t *start,
167 const int32_t *count,
193 ntypes_ = (MPI_Offset) (*ntypes);
195 dtype_ = dtype==0 ? MPI_DATATYPE_NULL : MPI_Type_f2c(*dtype);
198 *error =
file_read_data_c( var, &cdinfo, *precision, ntypes_, dtype_, NULL, NULL );
200 *error =
file_read_data_c( var, &cdinfo, *precision, ntypes_, dtype_, start, count );
206 const int32_t *suppress,
209 const int32_t vname_len,
210 const int32_t key_len,
211 const int32_t value_len )
219 fstr2cstr(_vname, vname, l);
222 fstr2cstr(_key, key, l);
229 cstr2fstr(value, _value, l);
236 const int32_t *suppress,
239 const int32_t vname_len,
240 const int32_t key_len )
247 fstr2cstr(_vname, vname, l);
250 fstr2cstr(_key, key, l);
259 const int32_t *suppress,
262 const int32_t vname_len,
263 const int32_t key_len )
270 fstr2cstr(_vname, vname, l);
273 fstr2cstr(_key, key, l);
282 const int32_t *suppress,
285 const int32_t vname_len,
286 const int32_t key_len )
293 fstr2cstr(_vname, vname, l);
296 fstr2cstr(_key, key, l);
306 const int32_t vname_len,
307 const int32_t key_len,
308 const int32_t value_len )
316 fstr2cstr(_vname, vname, l);
319 fstr2cstr(_key, key, l);
322 fstr2cstr(_value, value, l);
330 const int32_t *value,
333 const int32_t vname_len,
334 const int32_t key_len )
341 fstr2cstr(_vname, vname, l);
344 fstr2cstr(_key, key, l);
355 const int32_t vname_len,
356 const int32_t key_len )
363 fstr2cstr(_vname, vname, l);
366 fstr2cstr(_key, key, l);
377 const int32_t vname_len,
378 const int32_t key_len )
385 fstr2cstr(_vname, vname, l);
388 fstr2cstr(_key, key, l);
396 const int32_t vname_len )
402 fstr2cstr(_vname, vname, l);
408 const char *time_units,
409 const char *calendar,
411 const int32_t unit_len,
412 const int32_t cal_len)
419 fstr2cstr(_time_units, time_units, l);
422 fstr2cstr(_calendar, calendar, l);
431 const char *dim_name,
432 const int32_t *dtype,
435 const int32_t *precision,
437 const int32_t name_len,
438 const int32_t desc_len,
439 const int32_t units_len,
440 const int32_t dim_name_len)
449 fstr2cstr(_name,
name, len);
452 fstr2cstr(_desc, desc, len);
455 fstr2cstr(_units, units, len);
458 fstr2cstr(_dim_name, dim_name, len);
460 *error =
file_put_axis_c( *fid, _name, _desc, _units, _dim_name, *dtype, val, *size, *precision );
467 const char *dim_name,
468 const int32_t *dtype,
469 const int32_t *dim_size,
470 const int32_t *bounds,
472 const int32_t name_len,
473 const int32_t desc_len,
474 const int32_t units_len,
475 const int32_t dim_name_len)
484 fstr2cstr(_name,
name, len);
487 fstr2cstr(_desc, desc, len);
490 fstr2cstr(_units, units, len);
493 fstr2cstr(_dim_name, dim_name, len);
495 *error =
file_def_axis_c( *fid, _name, _desc, _units, _dim_name, *dtype, *dim_size, *bounds );
501 const int32_t *precision,
502 const int32_t *start,
503 const int32_t *count,
505 const int32_t name_len)
509 MPI_Offset start_[1], count_[1];
512 fstr2cstr(_name,
name, len);
515 start_[0] = *start - 1;
525 const char *dim_names,
526 const int32_t *ndims,
527 const int32_t *dtype,
529 const int32_t *precision,
531 const int32_t name_len,
532 const int32_t desc_len,
533 const int32_t units_len,
534 const int32_t dim_name_len)
544 fstr2cstr(_name,
name, len);
547 fstr2cstr(_desc, desc, len);
550 fstr2cstr(_units, units, len);
552 _dim_names = (
char**) malloc(
sizeof(
char*)*(*ndims));
554 for (
i=0;
i<*ndims;
i++ ) {
555 _dim_names[
i] = (
char*) malloc(
sizeof(
char)*(
File_HSHORT+1));
556 fstr2cstr(_dim_names[
i], dim_names+
i*dim_name_len, len);
561 for (
i=0;
i<*ndims;
i++ ) free(_dim_names[
i]);
569 const char *dim_names,
570 const int32_t *ndims,
571 const int32_t *dtype,
573 const int32_t name_len,
574 const int32_t desc_len,
575 const int32_t units_len,
576 const int32_t dim_name_len)
586 fstr2cstr(_name,
name, len);
589 fstr2cstr(_desc, desc, len);
592 fstr2cstr(_units, units, len);
594 _dim_names = (
char**) malloc(
sizeof(
char*)*(*ndims));
596 for (
i=0;
i<*ndims;
i++ ) {
597 _dim_names[
i] = (
char*) malloc(
sizeof(
char)*(
File_HSHORT+1));
598 fstr2cstr(_dim_names[
i], dim_names+
i*dim_name_len, len);
603 for (
i=0;
i<*ndims;
i++ ) free(_dim_names[
i]);
610 const int32_t *precision,
611 const int32_t *ndims,
612 const int32_t *start,
613 const int32_t *count,
615 const int32_t name_len)
619 MPI_Offset start_[4], count_[4];
623 fstr2cstr(_name,
name, len);
625 for (
i=0;
i<*ndims;
i++) {
626 start_[
i] = start[*ndims -
i - 1] - 1;
627 count_[
i] = count[*ndims -
i - 1];
636 const char *standard_name,
638 const int32_t *ndims,
639 const int32_t *dtype,
640 const real64_t *tint,
644 const int32_t varname_len,
645 const int32_t desc_len,
646 const int32_t units_len,
647 const int32_t stdname_len,
648 const int32_t dims_len)
659 fstr2cstr(_varname, varname, len);
662 fstr2cstr(_desc, desc, len);
665 fstr2cstr(_stdname, standard_name, len);
668 fstr2cstr(_units, units, len);
670 _dims = (
char**) malloc(
sizeof(
char*)*(*ndims));
672 for (
i=0;
i<*ndims;
i++ ) {
673 _dims[
i] = (
char*) malloc(
sizeof(
char)*(
File_HSHORT+1));
674 fstr2cstr(_dims[
i], dims+
i*dims_len, len);
677 *error =
file_add_variable_c( *fid, _varname, _desc, _units, _stdname, (
const char**)_dims, *ndims, *dtype, *tint, *tavg, vid );
679 for (
i=0;
i<*ndims;
i++ ) free( _dims[
i] );
686 const real64_t *t_start,
687 const real64_t *t_end,
688 const int32_t *precision,
689 const int32_t *ndims,
690 const int32_t *start,
691 const int32_t *count,
694 *error =
file_write_data_c( *fid, *vid, var, *t_start, *t_end, *precision, *ndims, start, count );
698 const int32_t *abort,
717 const int64_t *buf_amount,
int32_t file_put_associatedcoordinate_c(const int32_t fid, const char *name, const char *desc, const char *units, const char **dim_names, const int32_t ndims, const int32_t dtype, const void *val, const int32_t precision)
int32_t file_get_nvars_c(const int32_t fid, int32_t *nvars)
void file_get_attribute_int_c_(const int32_t *fid, const char *vname, const char *key, const int32_t *len, const int32_t *suppress, int32_t *value, int32_t *error, const int32_t vname_len, const int32_t key_len)
int32_t file_set_attribute_text_c(const int32_t fid, const char *vname, const char *key, const char *value)
void file_flush_c_(const int32_t *fid, int32_t *error)
void file_set_option_c_(const int32_t *fid, const char *filetype, const char *key, const char *val, int32_t *error, const int32_t filetype_len, const int32_t key_len, const int32_t val_len)
int32_t file_write_axis_c(const int32_t fid, const char *name, const void *val, const int32_t precision, const MPI_Offset *start, const MPI_Offset *count)
int32_t file_set_option_c(const int32_t fid, const char *filetype, const char *key, const char *val)
int32_t file_flush_c(const int32_t fid)
void file_get_attribute_text_c_(const int32_t *fid, const char *vname, const char *key, const int32_t *suppress, char *value, int32_t *error, const int32_t vname_len, const int32_t key_len, const int32_t value_len)
void file_set_attribute_text_c_(const int32_t *fid, const char *vname, const char *key, const char *value, int32_t *error, const int32_t vname_len, const int32_t key_len, const int32_t value_len)
void file_get_dim_length_c_(const int32_t *fid, const char *dimname, int32_t *len, int32_t *error, const int32_t dimname_len)
void file_redef_c_(const int32_t *fid, int32_t *error)
void file_detach_buffer_c_(const int32_t *fid, int32_t *error)
int32_t file_get_dim_length_c(const int32_t fid, const char *dimname, int32_t *len)
void file_add_variable_c_(const int32_t *fid, const char *varname, const char *desc, const char *units, const char *standard_name, const char *dims, const int32_t *ndims, const int32_t *dtype, const real64_t *tint, const int32_t *tavg, int32_t *vid, int32_t *error, const int32_t varname_len, const int32_t desc_len, const int32_t units_len, const int32_t stdname_len, const int32_t dims_len)
int32_t file_add_associatedvariable_c(const int32_t fid, const char *vname)
int32_t file_def_axis_c(const int32_t fid, const char *name, const char *desc, const char *units, const char *dim_name, const int32_t dtype, const int32_t dim_size, const int32_t bounds)
int32_t file_add_variable_c(const int32_t fid, const char *varname, const char *desc, const char *units, const char *stdname, const char **dims, const int32_t ndims, const int32_t dtype, const real64_t tint, const int32_t tavg, int32_t *vid)
int32_t file_close_c(const int32_t fid, const int32_t abort)
int32_t file_attach_buffer_c(const int32_t fid, const int64_t buf_amount)
void file_open_c_(int32_t *fid, const char *fname, const int32_t *mode, const int32_t *comm, int32_t *error, const int32_t fname_len)
char calendar[File_HSHORT]
void file_put_axis_c_(const int32_t *fid, const char *name, const char *desc, const char *units, const char *dim_name, const int32_t *dtype, const void *val, const int32_t *size, const int32_t *precision, int32_t *error, const int32_t name_len, const int32_t desc_len, const int32_t units_len, const int32_t dim_name_len)
int32_t dim_size[RANK_MAX]
void file_set_tunits_c_(const int32_t *fid, const char *time_units, const char *calendar, int32_t *error, const int32_t unit_len, const int32_t cal_len)
char att_name[File_HSHORT *ATT_MAX]
int32_t file_get_step_size_c(const int32_t fid, const char *varname, int32_t *len)
int32_t file_set_attribute_double_c(const int32_t fid, const char *vname, const char *key, const double *value, const size_t len)
char standard_name[File_HMID]
void file_set_attribute_float_c_(const int32_t *fid, const char *vname, const char *key, const float *value, const int32_t *len, int32_t *error, const int32_t vname_len, const int32_t key_len)
char description[File_HMID]
char time_units[File_HMID]
void file_put_associatedcoordinate_c_(const int32_t *fid, const char *name, const char *desc, const char *units, const char *dim_names, const int32_t *ndims, const int32_t *dtype, const void *val, const int32_t *precision, int32_t *error, const int32_t name_len, const int32_t desc_len, const int32_t units_len, const int32_t dim_name_len)
int32_t file_redef_c(const int32_t fid)
void file_set_attribute_int_c_(const int32_t *fid, const char *vname, const char *key, const int32_t *value, const int32_t *len, int32_t *error, const int32_t vname_len, const int32_t key_len)
int32_t file_get_varname_c(const int32_t fid, const int32_t vid, char *name, const int32_t len)
void file_def_axis_c_(const int32_t *fid, const char *name, const char *desc, const char *units, const char *dim_name, const int32_t *dtype, const int32_t *dim_size, const int32_t *bounds, int32_t *error, const int32_t name_len, const int32_t desc_len, const int32_t units_len, const int32_t dim_name_len)
int32_t file_write_associatedcoordinate_c(const int32_t fid, const char *name, const void *val, const int32_t precision, const MPI_Offset *start, const MPI_Offset *count)
int32_t file_set_attribute_int_c(const int32_t fid, const char *vname, const char *key, const int32_t *value, const size_t len)
int32_t file_open_c(int32_t *fid, const char *fname, const int32_t mode, const MPI_Comm comm)
int32_t file_set_attribute_float_c(const int32_t fid, const char *vname, const char *key, const float *value, const size_t len)
int32_t file_get_attribute_int_c(const int32_t fid, const char *vname, const char *key, const int32_t suppress, int32_t *value, const size_t len)
void file_close_c_(const int32_t *fid, const int32_t *abort, int32_t *error)
void file_set_attribute_double_c_(const int32_t *fid, const char *vname, const char *key, const double *value, const int32_t *len, int32_t *error, const int32_t vname_len, const int32_t key_len)
void file_get_varname_c_(const int32_t *fid, const int32_t *vid, char *varname, int32_t *error, const int32_t varname_len)
void file_get_step_size_c_(const int32_t *fid, const char *varname, int32_t *len, int32_t *error, const int32_t varname_len)
int32_t file_get_attribute_double_c(const int32_t fid, const char *vname, const char *key, const int32_t suppress, double *value, const size_t len)
void file_read_data_c_(void *var, const datainfo_t *dinfo, const int32_t *precision, const int32_t *ntypes, const int32_t *dtype, const int32_t *start, const int32_t *count, int32_t *error)
void file_write_data_c_(const int32_t *fid, const int32_t *vid, const void *var, const real64_t *t_start, const real64_t *t_end, const int32_t *precision, const int32_t *ndims, const int32_t *start, const int32_t *count, int32_t *error)
void file_write_associatedcoordinate_c_(const int32_t *fid, const char *name, const void *val, const int32_t *precision, const int32_t *ndims, const int32_t *start, const int32_t *count, int32_t *error, const int32_t name_len)
int32_t file_get_datainfo_c(datainfo_t *dinfo, const int32_t fid, const char *varname, const int32_t step, const int32_t suppress)
int32_t file_read_data_c(void *var, const datainfo_t *dinfo, const int32_t precision, const MPI_Offset ntypes, const MPI_Datatype dtype, const int32_t *start, const int32_t *count)
char dim_name[File_HSHORT *RANK_MAX]
void file_get_attribute_double_c_(const int32_t *fid, const char *vname, const char *key, const int32_t *len, const int32_t *suppress, double *value, int32_t *error, const int32_t vname_len, const int32_t key_len)
void file_attach_buffer_c_(const int32_t *fid, const int64_t *buf_amount, int32_t *error)
void file_get_attribute_float_c_(const int32_t *fid, const char *vname, const char *key, const int32_t *len, const int32_t *suppress, float *value, int32_t *error, const int32_t vname_len, const int32_t key_len)
void file_get_datainfo_c_(datainfo_t *dinfo, const int32_t *fid, const char *varname, const int32_t *step, const int32_t *suppress, int32_t *error, const int32_t varname_len)
int32_t file_put_axis_c(const int32_t fid, const char *name, const char *desc, const char *units, const char *dim_name, const int32_t dtype, const void *val, const int32_t size, const int32_t precision)
char varname[File_HSHORT]
void file_def_associatedcoordinate_c_(const int32_t *fid, const char *name, const char *desc, const char *units, const char *dim_names, const int32_t *ndims, const int32_t *dtype, int32_t *error, const int32_t name_len, const int32_t desc_len, const int32_t units_len, const int32_t dim_name_len)
int32_t file_get_attribute_text_c(const int32_t fid, const char *vname, const char *key, const int32_t suppress, char *value, const int32_t len)
int32_t file_get_attribute_float_c(const int32_t fid, const char *vname, const char *key, const int32_t suppress, float *value, const size_t len)
void file_enddef_c_(const int32_t *fid, int32_t *error)
int32_t file_set_tunits_c(const int32_t fid, const char *time_units, const char *calendar)
void file_write_axis_c_(const int32_t *fid, const char *name, const void *val, const int32_t *precision, const int32_t *start, const int32_t *count, int32_t *error, const int32_t name_len)
int32_t file_def_associatedcoordinate_c(const int32_t fid, const char *name, const char *desc, const char *units, const char **dim_names, const int32_t ndims, const int32_t dtype)
character(len=h_short), public name
void file_get_nvars_c_(const int32_t *fid, int32_t *nvars, int32_t *error)
void file_add_associatedvariable_c_(const int32_t *fid, const char *vname, int32_t *error, const int32_t vname_len)
int32_t file_detach_buffer_c(const int32_t fid)
int32_t file_write_data_c(const int32_t fid, const int32_t vid, const void *var, const real64_t t_start, const real64_t t_end, const int32_t precision, const int32_t ndims, const int32_t *start, const int32_t *count)
int32_t file_enddef_c(const int32_t fid)