From 9059762dac2364f136219d33c9d3fc265c8cfb2a Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Fri, 16 Jan 2015 16:35:11 +0000 Subject: [PATCH] GRIB-676 Accum Freezing Rain --- .../grib1/localConcepts/ecmf/cfVarName.def | 5 + definitions/grib1/localConcepts/ecmf/name.def | 5 + .../grib1/localConcepts/ecmf/paramId.def | 5 + .../grib1/localConcepts/ecmf/shortName.def | 5 + .../grib1/localConcepts/ecmf/units.def | 5 + tools/codes_info.c | 118 ++++++++++++++++++ 6 files changed, 143 insertions(+) create mode 100644 tools/codes_info.c diff --git a/definitions/grib1/localConcepts/ecmf/cfVarName.def b/definitions/grib1/localConcepts/ecmf/cfVarName.def index da2d93bed..276a458d3 100644 --- a/definitions/grib1/localConcepts/ecmf/cfVarName.def +++ b/definitions/grib1/localConcepts/ecmf/cfVarName.def @@ -9014,6 +9014,11 @@ table2Version = 228 ; indicatorOfParameter = 130 ; } +#Accumulated freezing rain +'fzra' = { + table2Version = 228 ; + indicatorOfParameter = 216 ; + } #Instantaneous large-scale surface precipitation fraction 'ilspf' = { table2Version = 228 ; diff --git a/definitions/grib1/localConcepts/ecmf/name.def b/definitions/grib1/localConcepts/ecmf/name.def index 99dccf072..387528b31 100644 --- a/definitions/grib1/localConcepts/ecmf/name.def +++ b/definitions/grib1/localConcepts/ecmf/name.def @@ -9014,6 +9014,11 @@ table2Version = 228 ; indicatorOfParameter = 130 ; } +#Accumulated freezing rain +'Accumulated freezing rain' = { + table2Version = 228 ; + indicatorOfParameter = 216 ; + } #Instantaneous large-scale surface precipitation fraction 'Instantaneous large-scale surface precipitation fraction' = { table2Version = 228 ; diff --git a/definitions/grib1/localConcepts/ecmf/paramId.def b/definitions/grib1/localConcepts/ecmf/paramId.def index 3c0170b68..953b65c8d 100644 --- a/definitions/grib1/localConcepts/ecmf/paramId.def +++ b/definitions/grib1/localConcepts/ecmf/paramId.def @@ -9014,6 +9014,11 @@ table2Version = 228 ; indicatorOfParameter = 130 ; } +#Accumulated freezing rain +'228216' = { + table2Version = 228 ; + indicatorOfParameter = 216 ; + } #Instantaneous large-scale surface precipitation fraction '228217' = { table2Version = 228 ; diff --git a/definitions/grib1/localConcepts/ecmf/shortName.def b/definitions/grib1/localConcepts/ecmf/shortName.def index 23b6cb87f..aa30e6590 100644 --- a/definitions/grib1/localConcepts/ecmf/shortName.def +++ b/definitions/grib1/localConcepts/ecmf/shortName.def @@ -9014,6 +9014,11 @@ table2Version = 228 ; indicatorOfParameter = 130 ; } +#Accumulated freezing rain +'fzra' = { + table2Version = 228 ; + indicatorOfParameter = 216 ; + } #Instantaneous large-scale surface precipitation fraction 'ilspf' = { table2Version = 228 ; diff --git a/definitions/grib1/localConcepts/ecmf/units.def b/definitions/grib1/localConcepts/ecmf/units.def index d838620db..61c1f7fbc 100644 --- a/definitions/grib1/localConcepts/ecmf/units.def +++ b/definitions/grib1/localConcepts/ecmf/units.def @@ -9014,6 +9014,11 @@ table2Version = 228 ; indicatorOfParameter = 130 ; } +#Accumulated freezing rain +'m' = { + table2Version = 228 ; + indicatorOfParameter = 216 ; + } #Instantaneous large-scale surface precipitation fraction '(0 - 1)' = { table2Version = 228 ; diff --git a/tools/codes_info.c b/tools/codes_info.c new file mode 100644 index 000000000..cc0324418 --- /dev/null +++ b/tools/codes_info.c @@ -0,0 +1,118 @@ +/* + * Copyright 2005-2015 ECMWF. + * + * This software is licensed under the terms of the Apache Licence Version 2.0 + * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. + * + * In applying this licence, ECMWF does not waive the privileges and immunities granted to it by + * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. + */ + +/* + * C Implementation: codes_info + * + * Description: + * + */ + +#include "grib_tools.h" + +void usage( char*); + +#define INFO_PRINT_ALL 0 +#define INFO_PRINT_VERSION (1<<0) +#define INFO_PRINT_DEFINITION_PATH (1<<1) +#define INFO_PRINT_SAMPLES_PATH (1<<2) + +int main( int argc,char* argv[]) +{ + char* path=NULL; + int c=0; + int nfiles=0; + unsigned long print_flags=0; + int major=GRIB_API_MAJOR_VERSION; + int minor=GRIB_API_MINOR_VERSION; + int revision=GRIB_API_REVISION_VERSION; + + while (1) { + + c = getopt (argc, argv, "vdt"); + + if (c == -1) + break; + + switch (c) { + case 'v': + print_flags|=INFO_PRINT_VERSION; + break; + case 'd': + print_flags|=INFO_PRINT_DEFINITION_PATH; + break; + case 't': + print_flags|=INFO_PRINT_SAMPLES_PATH; + break; + default: + usage(argv[0]); + } + } + + nfiles=argc-optind; + if (nfiles != 0) usage(argv[0]); + + if (print_flags == INFO_PRINT_ALL) { + printf("\n"); + printf("eccodes Version %d.%d.%d", + major,minor,revision); + if (GRIB_API_MAJOR_VERSION < 1) printf(" PRE-RELEASE"); + printf("\n"); + printf("\n"); + + + if ((path=getenv("GRIB_DEFINITION_PATH")) != NULL) { + printf("Definition files path from environment variable"); + printf(" GRIB_DEFINITION_PATH=%s\n",path); + } else { + printf("Default definition files path is used: %s\n",GRIB_DEFINITION_PATH); + printf("Definition files path can be changed setting GRIB_DEFINITION_PATH environment variable\n"); + } + printf("\n"); + + if ((path=getenv("GRIB_SAMPLES_PATH")) != NULL) { + printf("SAMPLES path from environment variable"); + printf(" GRIB_SAMPLES_PATH=%s\n",path); + } else { + printf("Default SAMPLES path is used: %s\n",GRIB_SAMPLES_PATH); + printf("SAMPLES path can be changed setting GRIB_SAMPLES_PATH environment variable\n"); + } + printf("\n"); + return 0; + } + + if (print_flags & INFO_PRINT_VERSION) + printf("%d.%d.%d ",major,minor,revision); + + if (print_flags & INFO_PRINT_DEFINITION_PATH) { + if ((path=getenv("GRIB_DEFINITION_PATH")) != NULL) { + printf("%s",path); + } else { + printf("%s",GRIB_DEFINITION_PATH); + } + } + + if (print_flags & INFO_PRINT_SAMPLES_PATH) { + if ((path=getenv("GRIB_SAMPLES_PATH")) != NULL) { + printf("%s",path); + } else { + printf("%s",GRIB_SAMPLES_PATH); + } + } + + return 0; +} + + + +void usage(char* progname) { + printf("\nUsage: %s [-v] [-d] [-t]\n",progname); + exit(1); +}