Commit b2e3fa89 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

cgribexlib update

parent bacac1cb
......@@ -5,6 +5,7 @@
* changed time format from hhmm to hhmmss
* changed encode/decode_time to seconds
* ieg: added support for Gaussian grids [request: Ralf Podzun]
* cdfDefLonLat2D: added attributes for Panoply
* added support for netCDF timeseries without grid
* added support for netCDF timeseries with only one grid axis
* julday_add_seconds: bug fix for adjusting negative seconds
......
......@@ -43,7 +43,7 @@ libcdi_a_SOURCES = \
file.c \
binary.c \
swap.c \
griblib.c \
cgribexlib.c \
gribapi.c \
cfortran.h \
binary.h \
......@@ -69,7 +69,7 @@ libcdi_a_SOURCES = \
stream_ieg.h \
stream_int.h \
basetime.h \
grib.h \
cgribex.h \
gribapi.h \
grid.h \
service.h \
......
......@@ -70,7 +70,7 @@ am_libcdi_a_OBJECTS = cdiFortran.$(OBJEXT) cdi_error.$(OBJEXT) \
tsteps.$(OBJEXT) stream_int.$(OBJEXT) servicelib.$(OBJEXT) \
extralib.$(OBJEXT) ieglib.$(OBJEXT) cdf.$(OBJEXT) \
cdf_int.$(OBJEXT) file.$(OBJEXT) binary.$(OBJEXT) \
swap.$(OBJEXT) griblib.$(OBJEXT) gribapi.$(OBJEXT)
swap.$(OBJEXT) cgribexlib.$(OBJEXT) gribapi.$(OBJEXT)
libcdi_a_OBJECTS = $(am_libcdi_a_OBJECTS)
DEFAULT_INCLUDES = -I.@am__isrc@
depcomp = $(SHELL) $(top_srcdir)/config/depcomp
......@@ -234,7 +234,7 @@ libcdi_a_SOURCES = \
file.c \
binary.c \
swap.c \
griblib.c \
cgribexlib.c \
gribapi.c \
cfortran.h \
binary.h \
......@@ -260,7 +260,7 @@ libcdi_a_SOURCES = \
stream_ieg.h \
stream_int.h \
basetime.h \
grib.h \
cgribex.h \
gribapi.h \
grid.h \
service.h \
......@@ -370,12 +370,12 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cdf_int.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cdiFortran.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cdi_error.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cgribexlib.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dmemory.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/error.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/extralib.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gribapi.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/griblib.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/grid.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ieglib.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/institution.Po@am__quote@
......
......@@ -86,14 +86,14 @@ c="dmemory.c \
stream_record.c \
tsteps.c \
file.c \
griblib.c \
cgribexlib.c \
gribapi.c \
swap.c \
binary.c \
cdf.c \
"
h="cdi_limits.h taxis.h error.h dtypes.h file.h grib.h gribapi.h service.h extra.h \
h="cdi_limits.h taxis.h error.h dtypes.h file.h cgribex.h gribapi.h service.h extra.h \
ieg.h cdi.h timebase.h calendar.h \
basetime.h stream_int.h stream_grb.h datetime.h stream_cdf.h \
tablepar.h table.h util.h grid.h varscan.h binary.h swap.h \
......
......@@ -14,7 +14,7 @@
#include "stream_ext.h"
#include "stream_ieg.h"
#include "file.h"
#include "grib.h"
#include "cgribex.h"
#include "gribapi.h"
#include "cdf.h"
#include "service.h"
......@@ -1951,7 +1951,7 @@ void cdiPrintVersion(void)
{
fprintf(stderr, " CDI library version : %s\n", cdiLibraryVersion());
#if defined (HAVE_LIBGRIB)
fprintf(stderr, " GRIB library version : %s\n", gribLibraryVersion());
fprintf(stderr, "C_GRIBEX library version : %s\n", cgribexLibraryVersion());
#endif
#if defined (HAVE_LIBGRIB_API)
fprintf(stderr, "GRIB_API library version : %s\n", gribapiLibraryVersion());
......
......@@ -1543,6 +1543,9 @@ void cdfDefLonLat2D(int streamID, int gridID)
if ( (len = strlen(xstdname)) )
cdf_put_att_text(fileID, ncxvarid, "standard_name", len, xstdname);
/* attribute for Panoply */
cdf_put_att_text(fileID, ncxvarid, "_CoordinateAxisType", 3, "Lon");
streamptr->ncxvarID[gridindex] = ncxvarid;
if ( gridInqXboundsPtr(gridID) )
......@@ -1566,6 +1569,9 @@ void cdfDefLonLat2D(int streamID, int gridID)
if ( (len = strlen(ystdname)) )
cdf_put_att_text(fileID, ncyvarid, "standard_name", len, ystdname);
/* attribute for Panoply */
cdf_put_att_text(fileID, ncyvarid, "_CoordinateAxisType", 3, "Lat");
streamptr->ncyvarID[gridindex] = ncyvarid;
if ( gridInqYboundsPtr(gridID) )
......
......@@ -11,7 +11,7 @@
#include "dmemory.h"
#include "cdi.h"
#include "stream_int.h"
#include "grib.h"
#include "cgribex.h"
#include "file.h"
#include "varscan.h"
#include "datetime.h"
......@@ -1152,13 +1152,13 @@ void grbScanTimestep1(int streamID)
level1 = ISEC1_Level1;
level2 = ISEC1_Level2;
gribDateTime(isec1, &vdate, &vtime);
if ( ISEC4_NumBits > 0 && ISEC4_NumBits <= 32 )
prec = ISEC4_NumBits;
else
prec = DATATYPE_PACK;
gribDateTime(isec1, &vdate, &vtime);
if ( nrecs == 0 )
{
datetime0.date = vdate;
......@@ -1738,20 +1738,20 @@ void grbReadVarSliceDP(int streamID, int varID, int levelID, double *data, int *
}
static
void grbDefInstitut(int *isec1, int center, int subcenter)
void cgribexDefInstitut(int *isec1, int center, int subcenter)
{
ISEC1_CenterID = center;
ISEC1_SubCenterID = subcenter;
}
static
void grbDefModel(int *isec1, int model)
void cgribexDefModel(int *isec1, int model)
{
ISEC1_ModelID = model;
}
static
void grbDefCode(int *isec1, int code, int codetable)
void cgribexDefCode(int *isec1, int code, int codetable)
{
ISEC1_CodeTable = codetable;
if ( code < 0 ) code = -code;
......@@ -1759,7 +1759,7 @@ void grbDefCode(int *isec1, int code, int codetable)
}
static
void grbDefTime(int *isec1, int date, int time, int numavg, int timeID)
void cgribexDefTime(int *isec1, int date, int time, int numavg, int timeID)
{
int year, month, day, hour, minute, second;
int century = 0;
......@@ -1893,9 +1893,9 @@ void grbDefTime(int *isec1, int date, int time, int numavg, int timeID)
}
static
void grbDefGrid(int *isec1, int *isec2, int gridID)
void cgribexDefGrid(int *isec1, int *isec2, int gridID)
{
static char func[] = "grbDefGrid";
static char func[] = "cgribexDefGrid";
int gridtype;
static short lwarn = TRUE;
......@@ -2079,9 +2079,9 @@ void grbDefGrid(int *isec1, int *isec2, int gridID)
}
static
void grbDefLevel(int *isec1, int *isec2, double *fsec2, int zaxisID, int levelID)
void cgribexDefLevel(int *isec1, int *isec2, double *fsec2, int zaxisID, int levelID)
{
static char func[] = "grbDefLevel";
static char func[] = "cgribexDefLevel";
double level;
int ilevel, zaxistype, ltype;
static int warning = 1;
......@@ -2278,12 +2278,12 @@ void grbDefLevel(int *isec1, int *isec2, double *fsec2, int zaxisID, int levelID
}
static
void grbDefMask(int *isec3)
void cgribexDefMask(int *isec3)
{
}
static
void grbDefData(int datatype, int *isec4, int gridID)
void cgribexDefData(int datatype, int *isec4, int gridID)
{
ISEC4_NumValues = gridInqSize(gridID);
......@@ -2301,14 +2301,14 @@ void grbDefData(int datatype, int *isec4, int gridID)
}
static
void grbDefaultSec0(int *isec0)
void cgribexDefaultSec0(int *isec0)
{
ISEC0_GRIB_Len = 0;
ISEC0_GRIB_Version = 0;
}
static
void grbDefaultSec1(int *isec1)
void cgribexDefaultSec1(int *isec1)
{
ISEC1_CenterID = 0;
ISEC1_SubCenterID = 0;
......@@ -2316,7 +2316,7 @@ void grbDefaultSec1(int *isec1)
}
static
void grbDefaultSec4(int *isec4)
void cgribexDefaultSec4(int *isec4)
{
isec4[2] = 0;
isec4[3] = 0;
......@@ -2380,9 +2380,9 @@ int grbWriteVarSliceDP(int streamID, int varID, int levelID, const double *data,
gribbuffer = (unsigned char *) malloc(gribbuffersize);
gribsize = gribbuffersize / sizeof(int);
grbDefaultSec0(isec0);
grbDefaultSec1(isec1);
grbDefaultSec4(isec4);
cgribexDefaultSec0(isec0);
cgribexDefaultSec1(isec1);
cgribexDefaultSec4(isec4);
if ( vlistInqInstitut(vlistID) != UNDEFID )
instID = vlistInqInstitut(vlistID);
......@@ -2394,7 +2394,7 @@ int grbWriteVarSliceDP(int streamID, int varID, int levelID, const double *data,
int center, subcenter;
center = institutInqCenter(instID);
subcenter = institutInqSubcenter(instID);
grbDefInstitut(isec1, center, subcenter);
cgribexDefInstitut(isec1, center, subcenter);
}
if ( vlistInqModel(vlistID) != UNDEFID )
......@@ -2403,17 +2403,17 @@ int grbWriteVarSliceDP(int streamID, int varID, int levelID, const double *data,
modelID = vlistInqVarModel(vlistID, varID);
if ( modelID != UNDEFID )
grbDefModel(isec1, modelInqGribID(modelID));
cgribexDefModel(isec1, modelInqGribID(modelID));
tableID = vlistInqVarTable(vlistID, varID);
datatype = vlistInqVarDatatype(vlistID, varID);
grbDefCode(isec1, code, tableInqNum(tableID));
grbDefTime(isec1, date, time, numavg, vlistInqTaxis(vlistID));
grbDefGrid(isec1, isec2, gridID);
grbDefLevel(isec1, isec2, fsec2, zaxisID, levelID);
grbDefMask(isec3);
grbDefData(datatype, isec4, gridID);
cgribexDefCode(isec1, code, tableInqNum(tableID));
cgribexDefTime(isec1, date, time, numavg, vlistInqTaxis(vlistID));
cgribexDefGrid(isec1, isec2, gridID);
cgribexDefLevel(isec1, isec2, fsec2, zaxisID, levelID);
cgribexDefMask(isec3);
cgribexDefData(datatype, isec4, gridID);
if ( nmiss > 0 )
{
......
#ifndef _STREAM_GRB_H
#define _STREAM_GRB_H
#ifndef _GRIB_H
# include "grib.h"
#ifndef _CGRIBEX_H
# include "cgribex.h"
#endif
int grbInqContents(int streamID);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment