Merge remote-tracking branch 'origin/release-v4.6.1'
[WRF.git] / external / io_grib1 / WGRIB / ec_ext.c
blob4fb98c2053efd0f91aab03c2e3459983f625fe25
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include <stddef.h>
4 #include <string.h>
6 #include "pds4.h"
7 #include "grib.h"
9 /*
10 * EC_ext v1.0 wesley ebisuzaki
12 * prints something readable from the EC stream parameter
14 * prefix and suffix are only printed if EC_ext has text
17 void EC_ext(unsigned char *pds, char *prefix, char *suffix) {
19 /* int i;
20 printf("\n");
21 for (i=0; i < PDS_LEN(pds); i++) {
22 printf("%x ",pds[i]);
26 10/03/2000: R.Rudsar : subroutine changed.
27 Tests for EcType and extra test for EcStream 1035
29 if (PDS_Center(pds) == ECMWF && PDS_LEN(pds) >= 43) {
31 switch(PDS_EcType(pds)) {
32 case 10:
33 printf("%sControl forecast%s", prefix, suffix);
34 break;
35 case 11:
36 printf("%sPerturbed forecasts%s", prefix, suffix);
37 break;
38 case 14:
39 printf("%sCluster means%s", prefix, suffix);
40 break;
41 case 15:
42 printf("%sCluster std. dev.%s", prefix, suffix);
43 break;
44 case 16:
45 printf("%sForecast probability%s", prefix, suffix);
46 break;
47 case 17:
48 printf("%sEnsemble means%s", prefix, suffix);
49 break;
50 case 18:
51 printf("%sEnsemble std. dev.%s", prefix, suffix);
52 break;
53 default:
54 printf("%sECMWF type?%s", prefix, suffix);
55 break;
58 if (PDS_Center(pds) == ECMWF && PDS_LEN(pds) >= 45) {
60 switch(PDS_EcStream(pds)) {
61 case 1035:
62 printf("%sensemble forecasts%s", prefix, suffix);
63 break;
64 case 1043:
65 printf("%smon mean%s", prefix, suffix);
66 break;
67 case 1070:
68 printf("%smon (co)var%s", prefix, suffix);
69 break;
70 case 1071:
71 printf("%smon mean from daily%s", prefix, suffix);
72 break;
73 default:
74 printf("%sECMWF stream?%s", prefix, suffix);
75 break;