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] !=
' ' ) {
22 static void cstr2fstr(
char *fstr,
29 for ( i=0; i<len; i++ )
32 for ( i=0; i<len; i++ )
33 if ( cstr[i] ==
'\0' )
break;
35 for ( ; i < len; i++ )
50 fstr2cstr(_fname, fname, len);
52 *error =
file_open( fid, _fname, *mode, MPI_Comm_f2c(*comm) );
70 fstr2cstr(_filetype, filetype, len);
73 fstr2cstr(_key, key, len);
76 fstr2cstr(_val, val, len);
94 fstr2cstr(_varname, varname, len);
132 MPI_Offset ntypes_, start_[4], count_[4];
141 for (i=0; i<*ndims; i++) {
142 start_[i+1] = start[*ndims - i - 1] - 1;
143 count_[i+1] = count[*ndims - i - 1];
145 ntypes_ = (MPI_Offset)(*ntypes);
147 *error =
file_read_data_par( var, dinfo, ntypes_, MPI_Type_f2c(*dtype), start_, count_ );
162 fstr2cstr(_key, key, len);
167 cstr2fstr(value, _value, len);
181 fstr2cstr(_key, key, l);
197 fstr2cstr(_key, key, l);
213 fstr2cstr(_key, key, l);
230 fstr2cstr(_key, key, len);
233 fstr2cstr(_value, value, len);
248 fstr2cstr(_key, key, key_len);
264 fstr2cstr(_key, key, l);
280 fstr2cstr(_key, key, l);
293 fstr2cstr(_time_units, time_units, len);
313 fstr2cstr(_vname, vname, len);
316 fstr2cstr(_key, key, len);
319 fstr2cstr(_val, val, len);
337 int32_t dim_name_len)
346 fstr2cstr(_name, name, len);
349 fstr2cstr(_desc, desc, len);
352 fstr2cstr(_units, units, len);
355 fstr2cstr(_dim_name, dim_name, len);
357 *error =
file_put_axis( *fid, _name, _desc, _units, _dim_name, *dtype, val, *size, *precision );
371 int32_t dim_name_len)
380 fstr2cstr(_name, name, len);
383 fstr2cstr(_desc, desc, len);
386 fstr2cstr(_units, units, len);
389 fstr2cstr(_dim_name, dim_name, len);
391 *error =
file_def_axis( *fid, _name, _desc, _units, _dim_name, *dtype, *dim_size );
405 MPI_Offset start_[1], count_[1];
408 fstr2cstr(_name, name, len);
411 start_[0] = *start - 1;
414 *error =
file_write_axis( *fid, _name, val, *precision, start_, count_ );
430 int32_t dim_name_len)
440 fstr2cstr(_name, name, len);
443 fstr2cstr(_desc, desc, len);
446 fstr2cstr(_units, units, len);
448 _dim_names = (
char**) malloc(
sizeof(
char*)*(*ndims));
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);
468 int32_t dim_name_len)
478 fstr2cstr(_name, name, len);
481 fstr2cstr(_desc, desc, len);
484 fstr2cstr(_units, units, len);
486 _dim_names = (
char**) malloc(
sizeof(
char*)*(*ndims));
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);
507 MPI_Offset start_[4], count_[4];
511 fstr2cstr(_name, name, len);
513 for (i=0; i<*ndims; i++) {
514 start_[i] = start[*ndims - i - 1] - 1;
515 count_[i] = count[*ndims - i - 1];
544 fstr2cstr(_varname, varname, len);
547 fstr2cstr(_desc, desc, len);
550 fstr2cstr(_units, units, len);
552 _dims = (
char**) malloc(
sizeof(
char*)*(*ndims));
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);
559 *error =
file_add_variable( vid, *fid, _varname, _desc, _units, _dims, *ndims, *dtype, *tint, *tavg );
561 for ( i=0; i<*ndims; i++ )
578 MPI_Offset start_[4], count_[4];
580 for (i=0; i<*ndims; i++) {
581 start_[i] = start[*ndims - i - 1] - 1;
582 count_[i] = count[*ndims - i - 1];
584 *error =
file_write_data( *fid, *vid, var, *t_start, *t_end, *precision, start_, count_ );
char dim_name[File_HSHORT *MAX_RANK]
char description[File_HMID]
char time_units[File_HMID]
char varname[File_HSHORT]