Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mpim-sw
libcdi
Commits
de36c84f
Commit
de36c84f
authored
Apr 02, 2013
by
Thomas Jahns
🤸
Browse files
Merge of trunk into branch cdi-pio.
parent
355a36bd
Changes
103
Expand all
Hide whitespace changes
Inline
Side-by-side
.gitattributes
View file @
de36c84f
...
...
@@ -28,6 +28,7 @@ config/missing -text
config/mkinstalldirs -text
/configure -text
/configure.ac -text
doc/Doxyfile -text
doc/cdi_cman.pdf -text
doc/cdi_fman.pdf -text
doc/coding_standards/README -text
...
...
@@ -114,6 +115,7 @@ examples/cdi_write.c -text
examples/cdi_write_ens.c -text
examples/cdi_write_f.f -text
examples/cdi_write_f2003.f90 -text
examples/cdi_write_reset.c -text
examples/compf -text
examples/pio/Makefile.am -text
examples/pio/Makefile.in -text
...
...
@@ -181,6 +183,7 @@ src/cdiFortran.c -text
src/cdi_error.c -text
src/cdi_limits.h -text
src/cdi_util.c -text
src/cdilib.c -text
src/cfortran.doc -text
src/cfortran.h -text
src/cgribex.h -text
...
...
@@ -199,6 +202,7 @@ src/file.c -text
src/file.h -text
src/gaussgrid.c -text
src/gaussgrid.h -text
src/getline.c -text
src/gribapi.c -text
src/gribapi.h -text
src/grid.c -text
...
...
@@ -282,6 +286,7 @@ src/vlist_att.h -text
src/vlist_var.c -text
src/vlist_var.h -text
src/zaxis.c -text
src/zaxis.h -text
tables/cosmo002 -text
tables/cosmo201 -text
tables/cosmo202 -text
...
...
@@ -292,6 +297,7 @@ tables/default_tables -text
tables/echam4 -text
tables/echam5 -text
tables/echam6 -text
tables/echam6cmip5 -text
tables/ecmwf -text
tables/gen_tableheaderfile -text
tables/grib_api/grib2/4.5.78.150.table -text
...
...
@@ -333,4 +339,3 @@ util/serialrun.in -text
util/sunf95preproc-wrapper -text
util/sxpreproc-wrapper -text
util/xlfpreproc-wrapper -text
/write_tornado.job -text
ChangeLog
View file @
de36c84f
2013-03-14 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* Version 1.6.0 released
* using CGRIBEX library version 1.6.0
2013-03-13 Florian Prill <Florian.Prill@dwd.de>
* Read arbitrary GRIB keys [Feature #3267]
2013-03-13 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* GRIB: added support for time step unit: seconds [Bug #3352]
2013-03-12 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* Added support for level type CLOUD_BASE, CLOUD_TOP and ISOTHERM_ZERO [Feature #3247]
* stream_gribapi: changed units for level type GRIB2_LTYPE_LANDDEPTH to m (internally mm) [Bug #3287]
* gribapiGetGrid: get gridDescriptionFile with grib_get_string() instead of grib_get_bytes() (bug fix)
2013-03-11 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* stream_gribapi: added support for local table shortName.def [Bug #3343]
2013-03-08 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* vtime2timeval: check validity of month
2013-03-07 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* cdfDefGrid: bug fix for generic grids with nx or ny > 0
* netCDF: ignore the attribute valid_min/valid_max, if the data type is inconsistent
2013-02-18 Florian Prill <Florian.Prill@dwd.de>
* Added function vlistDefVarIntKey() and vlistDefVarDblKey() to set GRIB_API Key/Value pairs
2013-02-13 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* cgribexGetTsteptype: changed default to TSTEP_INSTANT [Bug #3211]
2013-02-04 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* netCDF: ignore the attribute valid_range, if the data type is inconsistent
* netCDF: added env IGNORE_VALID_RANGE to ignore the attribute valid_range
2013-01-31 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* stream_cgribex::cgribexGetGrid: add 360 to lastLon, if lastlon <firstLon [Bug #3189]
2013-01-08 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* netCDF: check position of time dimension
2013-01-15 Thomas Jahns <jahns@dkrz.de>
* make_fint.c: added regexec support
2013-01-08 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* global netCDF attribute "source" missing (bug fix)
2012-12-18 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* reshGetValue: added caller function name to error message
2012-12-17 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* Version 1.5.9 released
* using CGRIBEX library version 1.5.6
2012-12-13 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* removed unused function streamDefineTaxis()
* fix warning in streamDefTimestep() for stream with constant fields only
2012-12-11 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* added cdfGridCompress() to compress coordinates
* added vlistDefVarChunkType() and vlistInqVarChunkType()
2012-12-03 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* vlistCopyFlag: added support for level bounds
2012-11-26 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* netCDF: added support for time axis name and long_name
2012-11-17 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* stream_cdf::define_all_vars: added txt attributes to vlistDefAttTxt() without trailing 0 [Bug #3004]
2012-11-16 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* file.c: added support for unbuffered write
2012-11-15 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* cdfReadVarSliceDP: store DATATYPE_FLT32 in a float array and convert it to double (speedup 2x)
* cdfInqTimestep: added check for timevalue = NC_FILL_DOUBLE
2012-11-14 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* app/cdi: added optional compression level -z zip[_1-9]
2012-11-09 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* file.c::file_initialize: added support for env GRIB_API_IO_BUFFER_SIZE [request: Florian Prill]
2012-11-07 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* gridGenXvals/gridGenYvals: removed changes from 1.5.8 (bug fix)
* cgribexGetGrid: bug fix for xinc/yinc recomputation
2012-11-05 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* grib2: correct endStep if timeunits is not equal stepUnits (bug fix)
* cgribexGetGrid: bug fix for yinc for odd ysize
2012-10-30 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* Version 1.5.8 released
* using CGRIBEX library version 1.5.5
2012-10-29 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* stream_cgribex.c: do not check fraction of xinc/yinc" stream_cgribex.c
* gridGenXvals/gridGenYvals: recheck xinc/yinc if (first+(size-1)*inc) > last
2012-10-26 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* stream_gribapi.c::gribapiScanTimestep: changed GRIBAPI_MISSVAL to cdiDefaultMissval
2012-10-18 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* vlistCopyFlag: copy ensdata (bug fix) [report: Jaison Ambadan]
2012-10-16 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* grib2: changed packingType from grid_jpeg to grid_simple if nmiss > 0 (bug fix)
2012-10-18 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* grib2: added stepType support for absolute time axis
2012-10-15 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* pio.h remove line 'typedef int MPI_Comm;' [Bug #2882]
2012-09-21 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* vlistInqZaxis: use zaxisGetIndexList() to get global zaxisIDs (bug fix)
2012-09-20 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* listSizeExtend: init ops, val and status
2012-09-20 Thomas Jahns <jahns@dkrz.de>
* listInitialize: set mutex type to PTHREAD_MUTEX_RECURSIVE
2012-09-11 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* cdfInqContents: make ncid local to varid
* cdfInqContents: group reading of global attribute to read_global_attributtes()
* cdfInqContents: set ntsteps to 0 if no data variable found
* netCDF: set 1D arrays to coordinate variables if axis attribute is available
2012-09-10 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* unreduced: compute nlon and nvalues from rowlon[] (bug fix)
2012-09-05 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* cgribexEncode: initialize the first 256 entries of isec1 to zero
2012-08-30 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* app/cdi: changed output format of option -s (sinfo)
2012-08-27 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* Version 1.5.7 released
* model.c::modelInq*: check instID != UNDEFID (buf fix)
* institution.c::insitutInq*: check instID != UNDEFID (buf fix)
* Merge of branch cdo-pio into trunk cdi
* using CGRIBEX library version 1.5.4
* using EXSE library version 1.3.1
2012-07-23 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* Version 1.5.6 released
...
...
Makefile.am
View file @
de36c84f
## Process this file with automake to produce Makefile.in
#
SUBDIRS
=
src interfaces app examples
tests
examples/pio
SUBDIRS
=
src interfaces app examples examples/pio
tests
#
EXTRA_DIST
=
config/default
\
doc/cdi_cman.pdf
\
...
...
Makefile.in
View file @
de36c84f
...
...
@@ -328,7 +328,7 @@ top_builddir = @top_builddir@
top_srcdir
=
@top_srcdir@
#
SUBDIRS
=
src interfaces app examples
tests
examples/pio
SUBDIRS
=
src interfaces app examples examples/pio
tests
#
EXTRA_DIST
=
config/default
\
doc/cdi_cman.pdf
\
...
...
NEWS
View file @
de36c84f
CDI NEWS
--------
Version 1.6.0 (14 March 2013):
New features:
* Added support for level type CLOUD_BASE, CLOUD_TOP and ISOTHERM_ZERO [Feature #3247]
* Read arbitrary GRIB keys [Feature #3267]
New functions:
* vlistDefVarIntKey(): Set an arbitrary keyword/integer value pair for GRIB API
* vlistDefVarDblKey(): Set an arbitrary keyword/double value pair for GRIB API
Fixed bugs:
* GRIB: added support for time step unit: seconds [Bug #3352]
* stream_gribapi: added support for local table shortName.def [Bug #3343]
* stream_gribapi: changed units for level type GRIB2_LTYPE_LANDDEPTH to m (internally mm) [Bug #3287]
* netCDF: ignore the attribute valid_range, if the data type is inconsistent
* global netCDF attribute "source" missing
* cgribexGetTsteptype: changed default to TSTEP_INSTANT [Bug #3211]
Version 1.5.9 (17 December 2012):
New features:
* file.c::file_initialize: added support for env GRIB_API_IO_BUFFER_SIZE
New functions:
* vlistDefVarChunktype(): set chunktype to CHUNK_AUTO, CHUNK_GRID, CHUNK_LINES
* vlistInqVarChunktype(): returns the chunktype
Fixed bugs:
* vlistCopyFlag: added support for level bounds
* netCDF: added support for time axis name and long_name
* cgribexGetGrid: bug fix for xinc/yinc recomputation
* stream_cdf::define_all_vars: added txt attributes to vlistDefAttTxt() without trailing 0 [Bug #3004]
Version 1.5.8 (30 October 2012):
New features:
* grib2: added stepType support for absolute time axis
* netCDF: set 1D arrays to coordinate variables if axis attribute is available
Fixed bugs:
* grib2: changed packingType from grid_jpeg to grid_simple if nmiss > 0
Version 1.5.7 (27 August 2012):
New features:
* Merge of branch cdo-pio into trunk cdi
Version 1.5.6 (27 July 2012):
New features:
...
...
README
View file @
de36c84f
...
...
@@ -10,6 +10,18 @@ CDI - Climate Data Interface
CDI is licensed under the GNU General Public License, version 2.
Read the file COPYING in the source distribution for details.
MPI-M makes no representations or warranties of any kind concerning the Software and any results
(including but not limited to any data) generated by use of the Software (hereinafter "Results"),
express or implied, and the absence of any legal or actual defects, whether discoverable or not.
The use of the Software and the Results is at your own risk.
Specifically, and not to limit the foregoing, MPI-M makes no representations or warranties
(i) regarding the fitness for a particular purpose of the Software and the Results,
(ii) that the use of the Software and the Results will not infringe any patents or other
intellectual property rights of any third party, and
(iii) that the use of the Software and the Results will not cause any damages of any kind
to you or to any third party.
Documentation:
CDI C Manual: ./doc/cdi_cman.pdf
...
...
aclocal.m4
View file @
de36c84f
...
...
@@ -14,8 +14,8 @@
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.6
9
],,
[m4_warning([this file was generated for autoconf 2.6
9
.
m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.6
8
],,
[m4_warning([this file was generated for autoconf 2.6
8
.
You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically `autoreconf'.])])
...
...
@@ -574,18 +574,6 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
[AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
])
# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
# Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 8
# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS.
AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
# Do all the work for Automake. -*- Autoconf -*-
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
...
...
app/cdi.c
View file @
de36c84f
...
...
@@ -56,7 +56,7 @@ int complevel = 0; // Compression level
static
void
version
(
void
)
{
fprintf
(
stderr
,
"CDI version 1.
7.1
\n
"
);
fprintf
(
stderr
,
"CDI version 1.
8
\n
"
);
#if defined (COMPILER)
fprintf
(
stderr
,
"Compiler: %s
\n
"
,
COMPILER
);
#endif
...
...
@@ -111,13 +111,14 @@ void version(void)
1.4.2 22 Mar 2005 : change level from int to double
1.4.3 11 Apr 2005 : change date and time format to ISO
1.5.0 22 Nov 2005 : IEG support
1.5.1 21 Feb 2006 : add option -s for short info
1.6.0 1 Aug 2006 : add option -z szip for SZIP compression of GRIB records
1.5.1 21 Feb 2006 : add
ed
option -s for short info
1.6.0 1 Aug 2006 : add
ed
option -z szip for SZIP compression of GRIB records
1.6.1 27 Feb 2007 : short info with ltype for GENERIC zaxis
1.6.2 3 Jan 2008 : changes for CDI library version 1.1.0 (compress)
1.6.3 26 Mar 2008 : call streamDefTimestep also if ntsteps = 0 (buf fix)
1.7.0 11 Apr 2008 : add option -z zip for deflate compression of netCDF4 variables
1.7.1 1 Nov 2009 : add option -z jpeg for JPEG compression of GRIB2 records
1.7.0 11 Apr 2008 : added option -z zip for deflate compression of netCDF4 variables
1.7.1 1 Nov 2009 : added option -z jpeg for JPEG compression of GRIB2 records
1.7.2 14 Nov 2012 : added optional compression level -z zip[_1-9]
*/
}
...
...
@@ -144,7 +145,7 @@ void usage(void)
fprintf
(
stderr
,
" -V Print version number
\n
"
);
fprintf
(
stderr
,
" -z szip SZIP compression of GRIB1 records
\n
"
);
fprintf
(
stderr
,
" jpeg JPEG compression of GRIB2 records
\n
"
);
fprintf
(
stderr
,
" zip
Deflate compression of netCDF4 variables
\n
"
);
fprintf
(
stderr
,
" zip
[_1-9]
Deflate compression of netCDF4 variables
\n
"
);
fprintf
(
stderr
,
"
\n
"
);
fprintf
(
stderr
,
" Report bugs to <http://code.zmaw.de/projects/cdi>
\n
"
);
}
...
...
@@ -158,25 +159,25 @@ void printInfo(int gridtype, int vdate, int vtime, char *varname, double level,
int
i
,
ivals
=
0
,
imiss
=
0
;
double
arrmean
,
arrmin
,
arrmax
;
char
vdatestr
[
32
],
vtimestr
[
32
];
if
(
!
rec
)
{
if
(
vardis
)
fprintf
(
stdout
,
" Rec : Date
Time Varna
me
Level
S
ize Miss : Minimum Mean Maximum
\n
"
);
fprintf
(
stdout
,
" Rec : Date
Ti
me Level
Grids
ize Miss : Minimum Mean Maximum
: Parameter name
\n
"
);
/* ----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+ */
else
fprintf
(
stdout
,
" Rec : Date Time
Param
Level
S
ize Miss : Minimum Mean Maximum
\n
"
);
fprintf
(
stdout
,
" Rec : Date
Time Level
Grids
ize Miss : Minimum Mean Maximum
: Parameter ID
\n
"
);
/* ----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+ */
}
date2str
(
vdate
,
vdatestr
,
sizeof
(
vdatestr
));
time2str
(
vtime
,
vtimestr
,
sizeof
(
vtimestr
));
fprintf
(
stdout
,
"%6d :%s %s
%-10s
%7g "
,
++
rec
,
vdatestr
,
vtimestr
,
varname
,
level
);
fprintf
(
stdout
,
"%6d :%s %s %7g "
,
++
rec
,
vdatestr
,
vtimestr
,
level
);
fprintf
(
stdout
,
"%
7
d "
,
datasize
);
fprintf
(
stdout
,
"%
8
d "
,
datasize
);
fprintf
(
stdout
,
"%7d :"
,
nmiss
);
...
...
@@ -222,7 +223,7 @@ void printInfo(int gridtype, int vdate, int vtime, char *varname, double level,
if
(
datasize
>
0
)
arrmean
/=
datasize
;
fprintf
(
stdout
,
"%#12.5g%#12.5g%#12.5g
\n
"
,
arrmin
,
arrmean
,
arrmax
);
fprintf
(
stdout
,
"%#12.5g%#12.5g%#12.5g"
,
arrmin
,
arrmean
,
arrmax
);
}
else
{
...
...
@@ -249,15 +250,42 @@ void printInfo(int gridtype, int vdate, int vtime, char *varname, double level,
if
(
nvals_r
>
0
)
arrmean_r
=
arrsum_r
/
nvals_r
;
if
(
nvals_i
>
0
)
arrmean_i
=
arrsum_i
/
nvals_i
;
fprintf
(
stdout
,
" - (%#12.5g,%#12.5g) -
\n
"
,
arrmean_r
,
arrmean_i
);
fprintf
(
stdout
,
" - (%#12.5g,%#12.5g) -"
,
arrmean_r
,
arrmean_i
);
}
fprintf
(
stdout
,
" : %-11s
\n
"
,
varname
);
if
(
imiss
!=
nmiss
&&
nmiss
>
0
)
fprintf
(
stdout
,
"Found %d of %d missing values!
\n
"
,
imiss
,
nmiss
);
}
#define MAXCHARS 82
const
char
*
tunit2str
(
int
tunits
)
{
if
(
tunits
==
TUNIT_YEAR
)
return
(
"years"
);
else
if
(
tunits
==
TUNIT_MONTH
)
return
(
"months"
);
else
if
(
tunits
==
TUNIT_DAY
)
return
(
"days"
);
else
if
(
tunits
==
TUNIT_12HOURS
)
return
(
"12hours"
);
else
if
(
tunits
==
TUNIT_6HOURS
)
return
(
"6hours"
);
else
if
(
tunits
==
TUNIT_3HOURS
)
return
(
"3hours"
);
else
if
(
tunits
==
TUNIT_HOUR
)
return
(
"hours"
);
else
if
(
tunits
==
TUNIT_MINUTE
)
return
(
"minutes"
);
else
if
(
tunits
==
TUNIT_SECOND
)
return
(
"seconds"
);
else
return
(
"unknown"
);
}
const
char
*
calendar2str
(
int
calendar
)
{
if
(
calendar
==
CALENDAR_STANDARD
)
return
(
"standard"
);
else
if
(
calendar
==
CALENDAR_PROLEPTIC
)
return
(
"proleptic_gregorian"
);
else
if
(
calendar
==
CALENDAR_360DAYS
)
return
(
"360_day"
);
else
if
(
calendar
==
CALENDAR_365DAYS
)
return
(
"365_day"
);
else
if
(
calendar
==
CALENDAR_366DAYS
)
return
(
"366_day"
);
else
return
(
"unknown"
);
}
static
void
printShortinfo
(
int
streamID
,
int
vlistID
,
int
vardis
)
{
...
...
@@ -287,10 +315,10 @@ void printShortinfo(int streamID, int vlistID, int vardis)
if
(
vardis
)
fprintf
(
stdout
,
" Var : Institut Source
Varname
Ttype
Dtype
Gridsize Num
Levels Num
\n
"
);
" Var : Institut Source Ttype
Levels Num
Gridsize Num
Dtype : Parameter name
\n
"
);
else
fprintf
(
stdout
,
" Var : Institut Source
Param
Ttype
Dtype
Gridsize Num
Levels Num
\n
"
);
" Var : Institut Source Ttype
Levels Num
Gridsize Num
Dtype : Parameter ID
\n
"
);
nvars
=
vlistNvars
(
vlistID
);
...
...
@@ -300,41 +328,45 @@ void printShortinfo(int streamID, int vlistID, int vardis)
gridID
=
vlistInqVarGrid
(
vlistID
,
varID
);
zaxisID
=
vlistInqVarZaxis
(
vlistID
,
varID
);
cdiParamToString
(
param
,
paramstr
,
sizeof
(
paramstr
));
if
(
vardis
)
vlistInqVarName
(
vlistID
,
varID
,
varname
);
gridsize
=
gridInqSize
(
gridID
);
fprintf
(
stdout
,
"%6d : "
,
varID
+
1
);
/* institute info */
instptr
=
institutInqNamePtr
(
vlistInqVarInstitut
(
vlistID
,
varID
));
if
(
instptr
)
fprintf
(
stdout
,
"%-8s "
,
instptr
);
else
fprintf
(
stdout
,
"unknown "
);
/* source info */
modelptr
=
modelInqNamePtr
(
vlistInqVarModel
(
vlistID
,
varID
));
if
(
modelptr
)
fprintf
(
stdout
,
"%-8s "
,
modelptr
);
else
fprintf
(
stdout
,
"unknown "
);
if
(
vardis
)
fprintf
(
stdout
,
"%-11s "
,
varname
);
else
fprintf
(
stdout
,
"%-11s "
,
paramstr
);
/* tsteptype */
tsteptype
=
vlistInqVarTsteptype
(
vlistID
,
varID
);
if
(
tsteptype
==
TSTEP_CONSTANT
)
fprintf
(
stdout
,
"%-8s"
,
"constant"
);
else
if
(
tsteptype
==
TSTEP_INSTANT
)
fprintf
(
stdout
,
"%-8s"
,
"instant"
);
else
if
(
tsteptype
==
TSTEP_MIN
)
fprintf
(
stdout
,
"%-8s"
,
"min"
);
else
if
(
tsteptype
==
TSTEP_MAX
)
fprintf
(
stdout
,
"%-8s"
,
"max"
);
else
if
(
tsteptype
==
TSTEP_ACCUM
)
fprintf
(
stdout
,
"%-8s"
,
"accum"
);
else
fprintf
(
stdout
,
"%-8s"
,
"unknown"
);
if
(
tsteptype
==
TSTEP_CONSTANT
)
fprintf
(
stdout
,
"%-8s "
,
"constant"
);
else
if
(
tsteptype
==
TSTEP_INSTANT
)
fprintf
(
stdout
,
"%-8s "
,
"instant"
);
else
if
(
tsteptype
==
TSTEP_INSTANT2
)
fprintf
(
stdout
,
"%-8s "
,
"instant"
);
else
if
(
tsteptype
==
TSTEP_INSTANT3
)
fprintf
(
stdout
,
"%-8s "
,
"instant"
);
else
if
(
tsteptype
==
TSTEP_MIN
)
fprintf
(
stdout
,
"%-8s "
,
"min"
);
else
if
(
tsteptype
==
TSTEP_MAX
)
fprintf
(
stdout
,
"%-8s "
,
"max"
);
else
if
(
tsteptype
==
TSTEP_ACCUM
)
fprintf
(
stdout
,
"%-8s "
,
"accum"
);
else
fprintf
(
stdout
,
"%-8s "
,
"unknown"
);
/* layer info */
levelsize
=
zaxisInqSize
(
zaxisID
);
fprintf
(
stdout
,
"%6d "
,
levelsize
);
fprintf
(
stdout
,
"%3d "
,
vlistZaxisIndex
(
vlistID
,
zaxisID
)
+
1
);
datatype
=
vlistInqVarDatatype
(
vlistID
,
varID
);
/* grid info */
gridsize
=
gridInqSize
(
gridID
);
fprintf
(
stdout
,
"%9d "
,
gridsize
);
fprintf
(
stdout
,
"%3d "
,
vlistGridIndex
(
vlistID
,
gridID
)
+
1
);
/* datatype */
datatype
=
vlistInqVarDatatype
(
vlistID
,
varID
);
if
(
datatype
==
DATATYPE_PACK
)
strcpy
(
pstr
,
"P0"
);
else
if
(
datatype
>
0
&&
datatype
<=
32
)
sprintf
(
pstr
,
"P%d"
,
datatype
);
else
if
(
datatype
==
DATATYPE_CPX32
)
strcpy
(
pstr
,
"C32"
);
...
...
@@ -352,26 +384,30 @@ void printShortinfo(int streamID, int vlistID, int vardis)
fprintf
(
stdout
,
" %-3s"
,
pstr
);
if
(
vlistInqVarCompType
(
vlistID
,
varID
)
==
COMPRESS_NONE
)
fprintf
(
stdout
,
" "
);
fprintf
(
stdout
,
"
"
);
else
fprintf
(
stdout
,
"z"
);
fprintf
(
stdout
,
"z
"
);
fprintf
(
stdout
,
"%9d"
,
gridsize
);
/* parameter info */
fprintf
(
stdout
,
": "
);
fprintf
(
stdout
,
" %3d "
,
vlistGridIndex
(
vlistID
,
gridID
)
+
1
);
cdiParamToString
(
param
,
paramstr
,
sizeof
(
paramstr
)
);
levelsize
=
zaxisInqSize
(
zaxisID
);
fprintf
(
stdout
,
" %6d"
,
levelsize
);
fprintf
(
stdout
,
" %3d"
,
vlistZaxisIndex
(
vlistID
,
zaxisID
)
+
1
);
if
(
vardis
)
vlistInqVarName
(
vlistID
,
varID
,
varname
);
if
(
vardis
)
fprintf
(
stdout
,
"%-11s"
,
varname
);
else
fprintf
(
stdout
,
"%-11s"
,
paramstr
);
fprintf
(
stdout
,
"
\n
"
);
}
fprintf
(
stdout
,
"
Horizontal grid
s :
\n
"
);
fprintf
(
stdout
,
"
Grid coordinate
s :
\n
"
);
printGridInfo
(
vlistID
);
nzaxis
=
vlistNzaxis
(
vlistID
);
fprintf
(
stdout
,
" Vertical
grid
s :
\n
"
);
fprintf
(
stdout
,
" Vertical
coordinate
s :
\n
"
);
for
(
index
=
0
;
index
<
nzaxis
;
index
++
)
{
zaxisID
=
vlistZaxis
(
vlistID
,
index
);
...
...
@@ -427,16 +463,16 @@ void printShortinfo(int streamID, int vlistID, int vardis)
if
(
ntsteps
!=
0
)
{
if
(
ntsteps
==
CDI_UNDEFID
)
fprintf
(
stdout
,
" Time
axis
: unlimited steps
\n
"
);
fprintf
(
stdout
,
" Time
coordinate
: unlimited steps
\n
"
);
else
fprintf
(
stdout
,
" Time
axis
: %d step%s
\n
"
,
ntsteps
,
ntsteps
==
1
?
""
:
"s"
);
fprintf
(
stdout
,
" Time
coordinate
: %d step%s
\n
"
,
ntsteps
,
ntsteps
==
1
?
""
:
"s"
);
if
(
taxisID
!=
CDI_UNDEFID
)
{
int
calendar
,
tunits
;
if
(
taxisInqType
(
taxisID
)
==
TAXIS_RELATIVE
)
{
int
calendar
,
tunits
;
vdate
=
taxisInqRdate
(
taxisID
);
vtime
=
taxisInqRtime
(
taxisID
);
...
...
@@ -447,46 +483,10 @@ void printShortinfo(int streamID, int vlistID, int vardis)
year
,
month
,
day
,
hour
,
minute
,
second
);
tunits
=
taxisInqTunit
(
taxisID
);
if
(
tunits
!=
CDI_UNDEFID
)
{
if
(
tunits
==
TUNIT_YEAR
)
fprintf
(
stdout
,
" Units = years"
);
else
if
(
tunits
==
TUNIT_MONTH
)
fprintf
(
stdout
,
" Units = months"
);
else
if
(
tunits
==
TUNIT_DAY
)
fprintf
(
stdout
,
" Units = days"
);
else
if
(
tunits
==
TUNIT_12HOURS
)
fprintf
(
stdout
,
" Units = 12hours"
);
else
if
(
tunits
==
TUNIT_6HOURS
)
fprintf
(
stdout
,
" Units = 6hours"
);
else
if
(
tunits
==
TUNIT_3HOURS
)
fprintf
(
stdout
,
" Units = 3hours"
);
else
if
(
tunits
==
TUNIT_HOUR
)
fprintf
(
stdout
,
" Units = hours"
);
else
if
(
tunits
==
TUNIT_MINUTE
)
fprintf
(
stdout
,
" Units = minutes"
);
else
if
(
tunits
==
TUNIT_SECOND
)
fprintf
(
stdout
,
" Units = seconds"
);
else
fprintf
(
stdout
,
" Units = unknown"
);