Merge in tigge_check branch

This commit is contained in:
Shahram Najm 2016-10-20 16:26:43 +01:00
parent a98b130e45
commit ac894bcb5d
2 changed files with 404 additions and 250 deletions

View File

@ -50,7 +50,7 @@ struct parameter {
double max1; double max1;
double max2; double max2;
pair pairs[15]; pair pairs[15];
check_proc checks[4]; check_proc checks[5];
}; };
static void point_in_time(grib_handle*,const parameter*,double,double); static void point_in_time(grib_handle*,const parameter*,double,double);
@ -65,6 +65,8 @@ static void predefined_level(grib_handle*,const parameter*,double,double);
static void predefined_thickness(grib_handle*,const parameter*,double,double); static void predefined_thickness(grib_handle*,const parameter*,double,double);
static void given_thickness(grib_handle*,const parameter*,double,double); static void given_thickness(grib_handle*,const parameter*,double,double);
static void has_bitmap(grib_handle*,const parameter*,double,double); static void has_bitmap(grib_handle*,const parameter*,double,double);
static void has_soil_level(grib_handle*,const parameter*,double,double);
static void has_soil_layer(grib_handle*,const parameter*,double,double);
static void height_level(grib_handle*,const parameter*,double,double); static void height_level(grib_handle*,const parameter*,double,double);
static void pressure_level(grib_handle*,const parameter*,double,double); static void pressure_level(grib_handle*,const parameter*,double,double);
@ -465,14 +467,7 @@ static void point_in_time(grib_handle* h,const parameter* p,double min,double ma
break; break;
} }
if (is_uerra) if (is_lam) {
{
if(get(h,"indicatorOfUnitOfTimeRange") == 1) /* hourly */
{
CHECK((eq(h,"forecastTime",1)||eq(h,"forecastTime",2)||eq(h,"forecastTime",4)||eq(h,"forecastTime",5))||(get(h,"forecastTime") % 3) == 0);
}
}
else if (is_lam) {
if(get(h,"indicatorOfUnitOfTimeRange") == 10 ) /* three hours */ if(get(h,"indicatorOfUnitOfTimeRange") == 10 ) /* three hours */
{ {
/* Three hourly is OK */ /* Three hourly is OK */
@ -483,7 +478,14 @@ static void point_in_time(grib_handle* h,const parameter* p,double min,double ma
CHECK(eq(h,"indicatorOfUnitOfTimeRange",1));/* Hours */ CHECK(eq(h,"indicatorOfUnitOfTimeRange",1));/* Hours */
CHECK((get(h,"forecastTime") % 3) == 0); /* Every three hours */ CHECK((get(h,"forecastTime") % 3) == 0); /* Every three hours */
} }
} else { }
else if (is_uerra) {
if(get(h,"indicatorOfUnitOfTimeRange") == 1) /* hourly */
{
CHECK((eq(h,"forecastTime",1)||eq(h,"forecastTime",2)||eq(h,"forecastTime",4)||eq(h,"forecastTime",5))||(get(h,"forecastTime") % 3) == 0);
}
}
else {
if(get(h,"indicatorOfUnitOfTimeRange") == 11) /* six hours */ if(get(h,"indicatorOfUnitOfTimeRange") == 11) /* six hours */
{ {
/* Six hourly is OK */ /* Six hourly is OK */
@ -673,14 +675,7 @@ static void statistical_process(grib_handle* h,const parameter* p,double min,dou
break; break;
} }
if (is_uerra) if (is_lam) {
{
if(get(h,"indicatorOfUnitOfTimeRange") == 1) /* hourly */
{
CHECK((eq(h,"forecastTime",1)||eq(h,"forecastTime",2)||eq(h,"forecastTime",4)||eq(h,"forecastTime",5))||(get(h,"forecastTime") % 3) == 0);
}
}
else if (is_lam) {
if(get(h,"indicatorOfUnitOfTimeRange") == 10 ) /* three hours */ if(get(h,"indicatorOfUnitOfTimeRange") == 10 ) /* three hours */
{ {
/* Three hourly is OK */ /* Three hourly is OK */
@ -691,7 +686,17 @@ static void statistical_process(grib_handle* h,const parameter* p,double min,dou
CHECK(eq(h,"indicatorOfUnitOfTimeRange",1));/* Hours */ CHECK(eq(h,"indicatorOfUnitOfTimeRange",1));/* Hours */
CHECK((get(h,"forecastTime") % 3) == 0); /* Every three hours */ CHECK((get(h,"forecastTime") % 3) == 0); /* Every three hours */
} }
} else { }
else if (is_uerra)
{
/* forecastTime for uerra might be all steps decreased by 1 i.e 0,1,2,3,4,5,8,11...29 too many... */
if(get(h,"indicatorOfUnitOfTimeRange") == 1)
{
CHECK(le(h,"forecastTime",30));
}
}
else
{
if(get(h,"indicatorOfUnitOfTimeRange") == 11) /* six hours */ if(get(h,"indicatorOfUnitOfTimeRange") == 11) /* six hours */
{ {
/* Six hourly is OK */ /* Six hourly is OK */
@ -734,6 +739,7 @@ static void statistical_process(grib_handle* h,const parameter* p,double min,dou
CHECK((get(h,"endStep") % 6) == 0); /* Every six hours */ CHECK((get(h,"endStep") % 6) == 0); /* Every six hours */
} }
if(get(h,"indicatorOfUnitForTimeRange") == 11) if(get(h,"indicatorOfUnitForTimeRange") == 11)
{ {
/* Six hourly is OK */ /* Six hourly is OK */
@ -757,6 +763,16 @@ static void has_bitmap(grib_handle* h,const parameter* p,double min,double max)
CHECK(eq(h,"bitMapIndicator",0)); CHECK(eq(h,"bitMapIndicator",0));
} }
static void has_soil_level(grib_handle* h,const parameter* p,double min,double max)
{
CHECK(get(h,"topLevel") == get(h,"bottomLevel"));
}
static void has_soil_layer(grib_handle* h,const parameter* p,double min,double max)
{
CHECK(get(h,"topLevel") == get(h,"bottomLevel") - 1);
}
static void six_hourly(grib_handle* h,const parameter* p,double min,double max) static void six_hourly(grib_handle* h,const parameter* p,double min,double max)
{ {
statistical_process(h,p,min,max); statistical_process(h,p,min,max);

File diff suppressed because it is too large Load Diff