diff --git a/CMakeLists.txt b/CMakeLists.txt index a51ebd82..8e3e981c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,7 +17,7 @@ option(USE_HDF5 "Use HDF5?" off) option(USE_REGEX "Use Regex?" on) option(USE_TIGGE "Use tigge?" on) option(USE_MYSQL "Use MySQL?" off) -option(USE_IPOLATES "Use Ipolates" off) +option(USE_IPOLATES "Use Ipolates" on) option(USE_UDF "Use UDF?" off) option(USE_OPENMP "Use OpenMP?" on) option(USE_PROJ4 "Use Proj4?" off) @@ -29,7 +29,7 @@ option(USE_G2CLIB "Use g2c lib?" off) option(USE_PNG "Use PNG?" off) option(USE_JASPER "Use Jasper?" off) option(USE_OPENJPEG "Use OpenJPEG?" off) -option(USE_AEC "Use AEC?" off) +option(USE_AEC "Use AEC?" of) option(FTP_TEST_FILES "Fetch and test with files on FTP site." OFF) option(FTP_LARGE_TEST_FILES "Fetch and test with very large files on FTP site." OFF) option(FTP_EXTRA_TEST_FILES "Fetch even more large files from FTP and test them." OFF) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 4889a49c..84ceaf9e 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -106,6 +106,7 @@ copy_test_data(ref_sec0.gdas.t12z.pgrb2.1p00.anl.75r.grib2.txt) copy_test_data(ref_sec_len.gdaswave.t00z.wcoast.0p16.f000.grib2.txt) copy_test_data(ref_sec_len.simple_packing.grib2.txt) copy_test_data(ref_simple_packing.grib2.spread.txt) +copy_test_data(ref_wmo_rot_lat_lon.txt) # Run these shell tests. shell_test(run_wgrib2_tests) diff --git a/tests/data/ncep_grid_wmo.txt b/tests/data/ncep_grid_wmo.txt new file mode 100644 index 00000000..e4373ee6 --- /dev/null +++ b/tests/data/ncep_grid_wmo.txt @@ -0,0 +1,70 @@ +1:0:grid_template=1:winds(N/S): + rotated lat-lon grid:(665 x 657) units 1e-06 input WE:SN output WE:SN res 48 + lat -20.000000 to 21.000000 by 0.062500 + lon 342.000000 to 23.500000 by 0.062500 #points=436905 + south pole lat=-40.000000 lon=10.000000 angle of rot=0.000000:(10,12),lon=-8.771457,lat=28.498272,val=-36.4:(20,80),lon=-9.397244,lat=32.756101,val=-20.4 +2:382483:grid_template=1:winds(N/S): + rotated lat-lon grid:(665 x 657) units 1e-06 input WE:SN output WE:SN res 48 + lat -20.000000 to 21.000000 by 0.062500 + lon 342.000000 to 23.500000 by 0.062500 #points=436905 + south pole lat=-40.000000 lon=10.000000 angle of rot=0.000000:(10,12),lon=-8.771457,lat=28.498272,val=-22:(20,80),lon=-9.397244,lat=32.756101,val=-19 +3:764966:grid_template=1:winds(N/S): + rotated lat-lon grid:(665 x 657) units 1e-06 input WE:SN output WE:SN res 48 + lat -20.000000 to 21.000000 by 0.062500 + lon 342.000000 to 23.500000 by 0.062500 #points=436905 + south pole lat=-40.000000 lon=10.000000 angle of rot=0.000000:(10,12),lon=-8.771457,lat=28.498272,val=-37:(20,80),lon=-9.397244,lat=32.756101,val=-28 +4:1092836:grid_template=1:winds(N/S): + rotated lat-lon grid:(665 x 657) units 1e-06 input WE:SN output WE:SN res 48 + lat -20.000000 to 21.000000 by 0.062500 + lon 342.000000 to 23.500000 by 0.062500 #points=436905 + south pole lat=-40.000000 lon=10.000000 angle of rot=0.000000:(10,12),lon=-8.771457,lat=28.498272,val=-20:(20,80),lon=-9.397244,lat=32.756101,val=-19 +5:1475319:grid_template=1:winds(N/S): + rotated lat-lon grid:(665 x 657) units 1e-06 input WE:SN output WE:SN res 48 + lat -20.000000 to 21.000000 by 0.062500 + lon 342.000000 to 23.500000 by 0.062500 #points=436905 + south pole lat=-40.000000 lon=10.000000 angle of rot=0.000000:(10,12),lon=-8.771457,lat=28.498272,val=-21.1:(20,80),lon=-9.397244,lat=32.756101,val=-15.1 +6:1803189:grid_template=1:winds(N/S): + rotated lat-lon grid:(665 x 657) units 1e-06 input WE:SN output WE:SN res 48 + lat -20.000000 to 21.000000 by 0.062500 + lon 342.000000 to 23.500000 by 0.062500 #points=436905 + south pole lat=-40.000000 lon=10.000000 angle of rot=0.000000:(10,12),lon=-8.771457,lat=28.498272,val=-0.4:(20,80),lon=-9.397244,lat=32.756101,val=4.6 +7:2131059:grid_template=1:winds(N/S): + rotated lat-lon grid:(665 x 657) units 1e-06 input WE:SN output WE:SN res 48 + lat -20.000000 to 21.000000 by 0.062500 + lon 342.000000 to 23.500000 by 0.062500 #points=436905 + south pole lat=-40.000000 lon=10.000000 angle of rot=0.000000:(10,12),lon=-8.771457,lat=28.498272,val=-6.1:(20,80),lon=-9.397244,lat=32.756101,val=-9.1 +8:2458929:grid_template=1:winds(N/S): + rotated lat-lon grid:(665 x 657) units 1e-06 input WE:SN output WE:SN res 48 + lat -20.000000 to 21.000000 by 0.062500 + lon 342.000000 to 23.500000 by 0.062500 #points=436905 + south pole lat=-40.000000 lon=10.000000 angle of rot=0.000000:(10,12),lon=-8.771457,lat=28.498272,val=8.9:(20,80),lon=-9.397244,lat=32.756101,val=17.9 +9:2786799:grid_template=1:winds(N/S): + rotated lat-lon grid:(665 x 657) units 1e-06 input WE:SN output WE:SN res 48 + lat -20.000000 to 21.000000 by 0.062500 + lon 342.000000 to 23.500000 by 0.062500 #points=436905 + south pole lat=-40.000000 lon=10.000000 angle of rot=0.000000:(10,12),lon=-8.771457,lat=28.498272,val=1:(20,80),lon=-9.397244,lat=32.756101,val=-6 +10:3114669:grid_template=1:winds(N/S): + rotated lat-lon grid:(665 x 657) units 1e-06 input WE:SN output WE:SN res 48 + lat -20.000000 to 21.000000 by 0.062500 + lon 342.000000 to 23.500000 by 0.062500 #points=436905 + south pole lat=-40.000000 lon=10.000000 angle of rot=0.000000:(10,12),lon=-8.771457,lat=28.498272,val=11:(20,80),lon=-9.397244,lat=32.756101,val=14 +11:3442539:grid_template=1:winds(N/S): + rotated lat-lon grid:(665 x 657) units 1e-06 input WE:SN output WE:SN res 48 + lat -20.000000 to 21.000000 by 0.062500 + lon 342.000000 to 23.500000 by 0.062500 #points=436905 + south pole lat=-40.000000 lon=10.000000 angle of rot=0.000000:(10,12),lon=-8.771457,lat=28.498272,val=4.9:(20,80),lon=-9.397244,lat=32.756101,val=1.9 +12:3770409:grid_template=1:winds(N/S): + rotated lat-lon grid:(665 x 657) units 1e-06 input WE:SN output WE:SN res 48 + lat -20.000000 to 21.000000 by 0.062500 + lon 342.000000 to 23.500000 by 0.062500 #points=436905 + south pole lat=-40.000000 lon=10.000000 angle of rot=0.000000:(10,12),lon=-8.771457,lat=28.498272,val=9:(20,80),lon=-9.397244,lat=32.756101,val=6 +13:4043666:grid_template=1:winds(N/S): + rotated lat-lon grid:(665 x 657) units 1e-06 input WE:SN output WE:SN res 48 + lat -20.000000 to 21.000000 by 0.062500 + lon 342.000000 to 23.500000 by 0.062500 #points=436905 + south pole lat=-40.000000 lon=10.000000 angle of rot=0.000000:(10,12),lon=-8.771457,lat=28.498272,val=6.8:(20,80),lon=-9.397244,lat=32.756101,val=6.8 +14:4316923:grid_template=1:winds(N/S): + rotated lat-lon grid:(665 x 657) units 1e-06 input WE:SN output WE:SN res 48 + lat -20.000000 to 21.000000 by 0.062500 + lon 342.000000 to 23.500000 by 0.062500 #points=436905 + south pole lat=-40.000000 lon=10.000000 angle of rot=0.000000:(10,12),lon=-8.771457,lat=28.498272,val=2:(20,80),lon=-9.397244,lat=32.756101,val=5 diff --git a/tests/data/ref_wmo_rot_lat_lon.txt b/tests/data/ref_wmo_rot_lat_lon.txt new file mode 100644 index 00000000..e562e2ff --- /dev/null +++ b/tests/data/ref_wmo_rot_lat_lon.txt @@ -0,0 +1,70 @@ +1:0:(11,14),lon=-8.743736,lat=28.634338,val=-36.4:grid_template=1:winds(N/S): + rotated lat-lon grid:(665 x 657) units 1e-06 input WE:SN output WE:SN res 48 + lat -20.000000 to 21.000000 by 0.062500 + lon 342.000000 to 23.500000 by 0.062500 #points=436905 + south pole lat=-40.000000 lon=10.000000 angle of rot=0.000000 +2:382483:(11,14),lon=-8.743736,lat=28.634338,val=-22:grid_template=1:winds(N/S): + rotated lat-lon grid:(665 x 657) units 1e-06 input WE:SN output WE:SN res 48 + lat -20.000000 to 21.000000 by 0.062500 + lon 342.000000 to 23.500000 by 0.062500 #points=436905 + south pole lat=-40.000000 lon=10.000000 angle of rot=0.000000 +3:764966:(11,14),lon=-8.743736,lat=28.634338,val=-37:grid_template=1:winds(N/S): + rotated lat-lon grid:(665 x 657) units 1e-06 input WE:SN output WE:SN res 48 + lat -20.000000 to 21.000000 by 0.062500 + lon 342.000000 to 23.500000 by 0.062500 #points=436905 + south pole lat=-40.000000 lon=10.000000 angle of rot=0.000000 +4:1092836:(11,14),lon=-8.743736,lat=28.634338,val=-20:grid_template=1:winds(N/S): + rotated lat-lon grid:(665 x 657) units 1e-06 input WE:SN output WE:SN res 48 + lat -20.000000 to 21.000000 by 0.062500 + lon 342.000000 to 23.500000 by 0.062500 #points=436905 + south pole lat=-40.000000 lon=10.000000 angle of rot=0.000000 +5:1475319:(11,14),lon=-8.743736,lat=28.634338,val=-21.1:grid_template=1:winds(N/S): + rotated lat-lon grid:(665 x 657) units 1e-06 input WE:SN output WE:SN res 48 + lat -20.000000 to 21.000000 by 0.062500 + lon 342.000000 to 23.500000 by 0.062500 #points=436905 + south pole lat=-40.000000 lon=10.000000 angle of rot=0.000000 +6:1803189:(11,14),lon=-8.743736,lat=28.634338,val=0.6:grid_template=1:winds(N/S): + rotated lat-lon grid:(665 x 657) units 1e-06 input WE:SN output WE:SN res 48 + lat -20.000000 to 21.000000 by 0.062500 + lon 342.000000 to 23.500000 by 0.062500 #points=436905 + south pole lat=-40.000000 lon=10.000000 angle of rot=0.000000 +7:2131059:(11,14),lon=-8.743736,lat=28.634338,val=-6.1:grid_template=1:winds(N/S): + rotated lat-lon grid:(665 x 657) units 1e-06 input WE:SN output WE:SN res 48 + lat -20.000000 to 21.000000 by 0.062500 + lon 342.000000 to 23.500000 by 0.062500 #points=436905 + south pole lat=-40.000000 lon=10.000000 angle of rot=0.000000 +8:2458929:(11,14),lon=-8.743736,lat=28.634338,val=8.9:grid_template=1:winds(N/S): + rotated lat-lon grid:(665 x 657) units 1e-06 input WE:SN output WE:SN res 48 + lat -20.000000 to 21.000000 by 0.062500 + lon 342.000000 to 23.500000 by 0.062500 #points=436905 + south pole lat=-40.000000 lon=10.000000 angle of rot=0.000000 +9:2786799:(11,14),lon=-8.743736,lat=28.634338,val=1:grid_template=1:winds(N/S): + rotated lat-lon grid:(665 x 657) units 1e-06 input WE:SN output WE:SN res 48 + lat -20.000000 to 21.000000 by 0.062500 + lon 342.000000 to 23.500000 by 0.062500 #points=436905 + south pole lat=-40.000000 lon=10.000000 angle of rot=0.000000 +10:3114669:(11,14),lon=-8.743736,lat=28.634338,val=11:grid_template=1:winds(N/S): + rotated lat-lon grid:(665 x 657) units 1e-06 input WE:SN output WE:SN res 48 + lat -20.000000 to 21.000000 by 0.062500 + lon 342.000000 to 23.500000 by 0.062500 #points=436905 + south pole lat=-40.000000 lon=10.000000 angle of rot=0.000000 +11:3442539:(11,14),lon=-8.743736,lat=28.634338,val=4.9:grid_template=1:winds(N/S): + rotated lat-lon grid:(665 x 657) units 1e-06 input WE:SN output WE:SN res 48 + lat -20.000000 to 21.000000 by 0.062500 + lon 342.000000 to 23.500000 by 0.062500 #points=436905 + south pole lat=-40.000000 lon=10.000000 angle of rot=0.000000 +12:3770409:(11,14),lon=-8.743736,lat=28.634338,val=9:grid_template=1:winds(N/S): + rotated lat-lon grid:(665 x 657) units 1e-06 input WE:SN output WE:SN res 48 + lat -20.000000 to 21.000000 by 0.062500 + lon 342.000000 to 23.500000 by 0.062500 #points=436905 + south pole lat=-40.000000 lon=10.000000 angle of rot=0.000000 +13:4043666:(11,14),lon=-8.743736,lat=28.634338,val=6.8:grid_template=1:winds(N/S): + rotated lat-lon grid:(665 x 657) units 1e-06 input WE:SN output WE:SN res 48 + lat -20.000000 to 21.000000 by 0.062500 + lon 342.000000 to 23.500000 by 0.062500 #points=436905 + south pole lat=-40.000000 lon=10.000000 angle of rot=0.000000 +14:4316923:(11,14),lon=-8.743736,lat=28.634338,val=2:grid_template=1:winds(N/S): + rotated lat-lon grid:(665 x 657) units 1e-06 input WE:SN output WE:SN res 48 + lat -20.000000 to 21.000000 by 0.062500 + lon 342.000000 to 23.500000 by 0.062500 #points=436905 + south pole lat=-40.000000 lon=10.000000 angle of rot=0.000000 diff --git a/tests/run_ipolates_tests.sh b/tests/run_ipolates_tests.sh index dd1694ab..2a290d29 100644 --- a/tests/run_ipolates_tests.sh +++ b/tests/run_ipolates_tests.sh @@ -38,6 +38,11 @@ echo "*** Testing new_grid_order on file in incorrect order." touch new_grid_reorder.txt diff -w new_grid_reorder.txt new_grid.txt +echo "*** Testing conversion to wmo rot lat-lon grid" +../wgrib2/wgrib2 test.grb -new_grid_winds earth -new_grid rot-ll:10:-40:0 342:665:0.0625 -20:657:0.0625 \ + junk.grb + +exit 1 echo "*** Testing conversion to NCEP grid definition 2" ../wgrib2/wgrib2 test.grb -new_grid_winds earth -new_grid ncep grid 2 junk.grb ../wgrib2/wgrib2 junk.grb -grid -v2 -s -lon 10 12 -lon 20 80 > ncep_grid_2.txt diff --git a/wgrib2/New_grid.c b/wgrib2/New_grid.c index e03f67ec..85b1dd90 100644 --- a/wgrib2/New_grid.c +++ b/wgrib2/New_grid.c @@ -302,14 +302,7 @@ int f_new_grid(ARG4) { if (mode == -1) { // initialization decode = 1; output_order_wanted = raw; // in raw order -// ALEX use_ncep_post_arakawa(); -// fprintf(stderr,"called use_ncep_post_araka\n"); -// use_ncep_post_arakawa(); -#ifdef G95 - // initialize g95 runtime library - if (g95_runstop == 0) { g95_runtime_start(0,NULL); g95_runstop = 1; } -#endif - + use_ncep_post_arakawa(); #ifdef G95 // initialize g95 runtime library if (g95_runstop == 0) { g95_runtime_start(0,NULL); g95_runstop = 1; }