From 1664870af898026dfdbfff54cef6a1183cc897dd Mon Sep 17 00:00:00 2001 From: Edward Hartnett Date: Mon, 6 May 2024 04:28:06 -0600 Subject: [PATCH 01/19] changing some values to 8-byte ints --- src/g2index.F90 | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/src/g2index.F90 b/src/g2index.F90 index 6795d953..983fd258 100644 --- a/src/g2index.F90 +++ b/src/g2index.F90 @@ -640,10 +640,11 @@ subroutine getg2i2r(lugb, msk1, msk2, mnum, idxver, cbuf, nlen, nnum, nmess, ire parameter(init = 50000, next = 10000) interface ! required for cbuf pointer - subroutine ix2gb2(lugb, lskip8, idxver, lgrib, cbuf, numfld, mlen, iret) + subroutine ix2gb2(lugb, lskip8, idxver, lgrib8, cbuf, numfld, mlen, iret) integer :: lugb integer (kind = 8) :: lskip8 - integer :: idxver, lgrib + integer :: idxver + integer (kind = 8) :: lgrib8 character(len = 1), pointer, dimension(:) :: cbuf integer :: numfld, mlen, iret end subroutine ix2gb2 @@ -675,7 +676,7 @@ end subroutine ix2gb2 nmess = mnum do while (iret .eq. 0 .and. lgrib .gt. 0) lgrib4 = int(lgrib, kind(4)) - call ix2gb2(lugb, lskip, idxver, lgrib4, cbuftmp, numfld, nbytes, iret1) + call ix2gb2(lugb, lskip, idxver, lgrib, cbuftmp, numfld, nbytes, iret1) if (iret1 .ne. 0) print *, ' SAGT ', numfld, nbytes, iret1 if((nbytes + nlen) .gt. mbuf) then ! Allocate more space, if necessary. newsize = max(mbuf + next, mbuf + nbytes) @@ -1152,13 +1153,14 @@ subroutine ixgb2(lugb, lskip, lgrib, cbuf, numfld, mlen, iret) integer :: lugb, lskip, lgrib character(len = 1), pointer, dimension(:) :: cbuf integer :: numfld, mlen, iret - integer (kind = 8) :: lskip8 + integer (kind = 8) :: lskip8, lgrib8 interface - subroutine ix2gb2(lugb, lskip8, idxver, lgrib, cbuf, numfld, mlen, iret) + subroutine ix2gb2(lugb, lskip8, idxver, lgrib8, cbuf, numfld, mlen, iret) integer :: lugb integer (kind = 8) :: lskip8 - integer :: idxver, lgrib + integer :: idxver + integer (kind = 8) :: lgrib8 character(len = 1), pointer, dimension(:) :: cbuf integer :: numfld, mlen, iret end subroutine ix2gb2 @@ -1166,7 +1168,9 @@ end subroutine ix2gb2 ! Always use index version 1 from this subroutine. lskip8 = lskip - call ix2gb2(lugb, lskip8, 1, lgrib, cbuf, numfld, mlen, iret) + lgrib8 = lgrib + call ix2gb2(lugb, lskip8, 1, lgrib8, cbuf, numfld, mlen, iret) + lgrib = int(lgrib8, 4) end subroutine ixgb2 !> Generate a version 1 or 2 index record for each field in a GRIB2 @@ -1204,13 +1208,14 @@ end subroutine ixgb2 !> - 5 Unidentified GRIB section encountered. !> !> @author Ed Hartnett, Mark Iredell @date Feb 5, 2024 -subroutine ix2gb2(lugb, lskip8, idxver, lgrib, cbuf, numfld, mlen, iret) +subroutine ix2gb2(lugb, lskip8, idxver, lgrib8, cbuf, numfld, mlen, iret) use re_alloc ! needed for subroutine realloc implicit none integer :: lugb integer (kind = 8) :: lskip8 - integer :: idxver, lgrib + integer :: idxver + integer (kind = 8) :: lgrib8 character(len = 1), pointer, dimension(:) :: cbuf integer :: numfld, mlen, iret @@ -1259,7 +1264,7 @@ subroutine ix2gb2(lugb, lskip8, idxver, lgrib, cbuf, numfld, mlen, iret) endif ! Read sections 0 and 1 for GRIB version number and discipline. - ibread8 = min(lgrib, linmax) + ibread8 = min(lgrib8, linmax) call bareadl(lugb, lskip8, ibread8, lbread8, cbread) if (lbread8 .ne. ibread8) then iret = 2 @@ -1317,7 +1322,7 @@ subroutine ix2gb2(lugb, lskip8, idxver, lgrib, cbuf, numfld, mlen, iret) mypos = mypos + INT4_BITS call g2_sbytec(cindex, int(ibskip8 - lskip8, kind(4)), mypos, INT4_BITS) ! location of pds mypos = mypos + INT4_BITS * 4 ! skip ahead in cbuf - call g2_sbytec(cindex, lgrib, mypos, INT8_BITS) ! len of grib2 + call g2_sbytec8(cindex, lgrib8, mypos, INT8_BITS) ! len of grib2 mypos = mypos + INT8_BITS cindex((mypos / 8) + 1) = cver mypos = mypos + INT1_BITS From 86222a2be002d7ded405b6a8821fa22c13146c9e Mon Sep 17 00:00:00 2001 From: Edward Hartnett Date: Mon, 6 May 2024 04:38:15 -0600 Subject: [PATCH 02/19] fixed doxygen --- src/g2index.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/g2index.F90 b/src/g2index.F90 index 983fd258..4f16fba8 100644 --- a/src/g2index.F90 +++ b/src/g2index.F90 @@ -1189,7 +1189,7 @@ end subroutine ixgb2 !> (https://noaa-emc.github.io/NCEPLIBS-bacio/). !> @param lskip8 Number of bytes to skip before GRIB message. !> @param idxver Index version, use 1 for legacy, 2 for GRIB2 files > 2 GB. -!> @param lgrib Number of bytes in GRIB message. When subroutine is +!> @param lgrib8 Number of bytes in GRIB message. When subroutine is !> called, this must be set to the size of the cbuf buffer. !> @param cbuf Pointer to a buffer that will get the index !> records. If any memory is associated with cbuf when this subroutine From 5e577395712e7e03ab34035b367f5b919ba4d884 Mon Sep 17 00:00:00 2001 From: Edward Hartnett Date: Mon, 6 May 2024 06:17:20 -0600 Subject: [PATCH 03/19] more work --- src/g2index.F90 | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/g2index.F90 b/src/g2index.F90 index 4f16fba8..d46fe432 100644 --- a/src/g2index.F90 +++ b/src/g2index.F90 @@ -964,9 +964,9 @@ end subroutine gf_unpack5 if (idxver .eq. 1) then inc = 0 else - ! Add the extra 4 bytes in the version 2 index record, starting + ! Add the extra 8 bytes in the version 2 index record, starting ! at byte 9. - inc = 4 + inc = 8 endif ! Search for request. @@ -1221,7 +1221,8 @@ subroutine ix2gb2(lugb, lskip8, idxver, lgrib8, cbuf, numfld, mlen, iret) character cver, cdisc character(len = 4) :: ctemp - integer loclus, locgds, locbms + integer (kind = 8) :: loclus8 + integer locgds, locbms, loclus integer :: indbmp, numsec, next, newsize, g2_mova2i, mbuf, lindex integer :: linmax, ixskp integer :: mxspd, mxskp, mxsgd, mxsdr, mxsbm, mxlus @@ -1252,6 +1253,7 @@ subroutine ix2gb2(lugb, lskip8, idxver, lgrib8, cbuf, numfld, mlen, iret) endif loclus = 0 + loclus8 = 0 iret = 0 mlen = 0 numfld = 0 @@ -1295,6 +1297,7 @@ subroutine ix2gb2(lugb, lskip8, idxver, lgrib8, cbuf, numfld, mlen, iret) call g2_gbytec(cbread, numsec, INT4_BITS, INT1_BITS) if (numsec .eq. 2) then ! save local use location + loclus8 = ibskip8 - lskip8 loclus = int(ibskip8 - lskip8, kind(4)) elseif (numsec .eq. 3) then ! save gds info lengds8 = lensec @@ -1312,12 +1315,14 @@ subroutine ix2gb2(lugb, lskip8, idxver, lgrib8, cbuf, numfld, mlen, iret) lskip = int(lskip8, kind(4)) call g2_sbytec(cindex, lskip, mypos, INT4_BITS) ! bytes to skip mypos = mypos + INT4_BITS + call g2_sbytec(cindex, loclus, mypos, INT4_BITS) ! location of local use + mypos = mypos + INT4_BITS else call g2_sbytec8(cindex, lskip8, mypos, INT8_BITS) ! bytes to skip mypos = mypos + INT8_BITS + call g2_sbytec8(cindex, loclus8, mypos, INT8_BITS) ! location of local use + mypos = mypos + INT8_BITS endif - call g2_sbytec(cindex, loclus, mypos, INT4_BITS) ! location of local use - mypos = mypos + INT4_BITS call g2_sbytec(cindex, locgds, mypos, INT4_BITS) ! location of gds mypos = mypos + INT4_BITS call g2_sbytec(cindex, int(ibskip8 - lskip8, kind(4)), mypos, INT4_BITS) ! location of pds From b17bafd3015db2d53395b7280e6af637204b4e2b Mon Sep 17 00:00:00 2001 From: Edward Hartnett Date: Mon, 6 May 2024 06:28:52 -0600 Subject: [PATCH 04/19] removed no-range-check flag for gfortran --- CMakeLists.txt | 2 +- src/g2getgb2.F90 | 180 +++++++++++++++++++++++------------------------ 2 files changed, 91 insertions(+), 91 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 10723cf4..cf91a7ab 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -52,7 +52,7 @@ if(CMAKE_C_COMPILER_ID MATCHES "^(Intel|IntelLLVM)$") elseif(CMAKE_C_COMPILER_ID MATCHES "^(GNU|Clang|AppleClang)$") set(CMAKE_C_FLAGS "-g ${CMAKE_C_FLAGS}") set(CMAKE_C_FLAGS_DEBUG "-ggdb -Wall") - set(CMAKE_Fortran_FLAGS "-g -fno-range-check -funroll-loops ${CMAKE_Fortran_FLAGS}") + set(CMAKE_Fortran_FLAGS "-g -funroll-loops ${CMAKE_Fortran_FLAGS}") set(CMAKE_Fortran_FLAGS_DEBUG "-ggdb -Wall") set(fortran_d_flags "-fdefault-real-8") endif() diff --git a/src/g2getgb2.F90 b/src/g2getgb2.F90 index 7f53b71c..0965159c 100644 --- a/src/g2getgb2.F90 +++ b/src/g2getgb2.F90 @@ -667,96 +667,96 @@ end subroutine getgb2p !> - 99 Request not found. !> !> @author Mark Iredell @date 1994-04-01 -subroutine getgb2p2(lugb, lugi, j, jdisc, jids, jpdtn, jpdt, jgdtn, jgdt, & - extract, k, gribm, leng, iret) - use grib_mod - implicit none - - integer, intent(in) :: lugb, lugi, j, jdisc, jpdtn, jgdtn - integer, dimension(:) :: jids(*), jpdt(*), jgdt(*) - logical, intent(in) :: extract - integer, intent(out) :: k, iret, leng - character(len = 1), pointer, dimension(:) :: gribm - - type(gribfield) :: gfld - integer :: irgi, irgs, jk, lpos, mskp, nlen, nmess, nnum, idxver - integer(kind = 8) :: msk1, msk2 - - character(len = 1), pointer, dimension(:) :: cbuf - parameter(msk1 = 32000, msk2 = 4000) - - ! Declare interfaces (required for cbuf pointer). - interface - subroutine getg2i2(lugi, cbuf, idxver, nlen, nnum, iret) - integer, intent(in) :: lugi - character(len=1), pointer, dimension(:) :: cbuf - integer, intent(out) :: idxver, nlen, nnum, iret - end subroutine getg2i2 - subroutine getg2i2r(lugb, msk1, msk2, mnum, idxver, cbuf, & - nlen, nnum, nmess, iret) - integer, intent(in) :: lugb - integer (kind = 8), intent(in) :: msk1, msk2 - integer, intent(in) :: mnum, idxver - character(len = 1), pointer, dimension(:) :: cbuf - integer, intent(out) :: nlen, nnum, nmess, iret - end subroutine getg2i2r - subroutine getgb2s2(cbuf, idxver, nlen, nnum, j, jdisc, jids, jpdtn, jpdt, jgdtn, & - jgdt, k, gfld, lpos, iret) - import gribfield - character(len = 1), intent(in) :: cbuf(nlen) - integer, intent(in) :: idxver, nlen, nnum, j, jdisc - integer, dimension(:) :: jids(*) - integer, intent(in) :: jpdtn - integer, dimension(:) :: jpdt(*) - integer, intent(in) :: jgdtn - integer, dimension(:) :: jgdt(*) - integer, intent(out) :: k - type(gribfield), intent(out) :: gfld - integer, intent(out) :: lpos, iret - end subroutine getgb2s2 - subroutine getgb2rp2(lugb, idxver, cindex, extract, gribm, leng, iret) - integer, intent(in) :: lugb, idxver - character(len = 1), intent(in) :: cindex(*) - logical, intent(in) :: extract - character(len = 1), pointer, dimension(:) :: gribm - integer, intent(out) :: leng, iret - end subroutine getgb2rp2 - end interface - - ! Initialize the index information in cbuf. - irgi = 0 - if (lugi .gt. 0) then - call getg2i2(lugi, cbuf, idxver, nlen, nnum, irgi) - elseif (lugi .le. 0) then - mskp = 0 - call getg2i2r(lugb, msk1, msk2, mskp, 2, cbuf, nlen, nnum, nmess, irgi) - endif - if (irgi .gt. 1) then - iret = 96 - return - endif - - ! Find info from index and fill a grib_mod::gribfield variable. - call getgb2s2(cbuf, 2, nlen, nnum, j, jdisc, jids, jpdtn, jpdt, jgdtn, jgdt, & - jk, gfld, lpos, irgs) - - if (irgs .ne. 0) then - iret = 99 - call gf_free(gfld) - return - endif - - ! Extract grib message from file. - nullify(gribm) - call getgb2rp2(lugb, 2, cbuf(lpos:), .false., gribm, leng, iret) - - k = jk - - ! Free cbuf memory allocated in getg2i/getg2ir(). - if (associated(cbuf)) deallocate(cbuf) - - call gf_free(gfld) -end subroutine getgb2p2 +! subroutine getgb2p2(lugb, lugi, j, jdisc, jids, jpdtn, jpdt, jgdtn, jgdt, & +! extract, k, gribm, leng, iret) +! use grib_mod +! implicit none + +! integer, intent(in) :: lugb, lugi, j, jdisc, jpdtn, jgdtn +! integer, dimension(:) :: jids(*), jpdt(*), jgdt(*) +! logical, intent(in) :: extract +! integer, intent(out) :: k, iret, leng +! character(len = 1), pointer, dimension(:) :: gribm + +! type(gribfield) :: gfld +! integer :: irgi, irgs, jk, lpos, mskp, nlen, nmess, nnum, idxver +! integer(kind = 8) :: msk1, msk2 + +! character(len = 1), pointer, dimension(:) :: cbuf +! parameter(msk1 = 32000, msk2 = 4000) + +! ! Declare interfaces (required for cbuf pointer). +! interface +! subroutine getg2i2(lugi, cbuf, idxver, nlen, nnum, iret) +! integer, intent(in) :: lugi +! character(len=1), pointer, dimension(:) :: cbuf +! integer, intent(out) :: idxver, nlen, nnum, iret +! end subroutine getg2i2 +! subroutine getg2i2r(lugb, msk1, msk2, mnum, idxver, cbuf, & +! nlen, nnum, nmess, iret) +! integer, intent(in) :: lugb +! integer (kind = 8), intent(in) :: msk1, msk2 +! integer, intent(in) :: mnum, idxver +! character(len = 1), pointer, dimension(:) :: cbuf +! integer, intent(out) :: nlen, nnum, nmess, iret +! end subroutine getg2i2r +! subroutine getgb2s2(cbuf, idxver, nlen, nnum, j, jdisc, jids, jpdtn, jpdt, jgdtn, & +! jgdt, k, gfld, lpos, iret) +! import gribfield +! character(len = 1), intent(in) :: cbuf(nlen) +! integer, intent(in) :: idxver, nlen, nnum, j, jdisc +! integer, dimension(:) :: jids(*) +! integer, intent(in) :: jpdtn +! integer, dimension(:) :: jpdt(*) +! integer, intent(in) :: jgdtn +! integer, dimension(:) :: jgdt(*) +! integer, intent(out) :: k +! type(gribfield), intent(out) :: gfld +! integer, intent(out) :: lpos, iret +! end subroutine getgb2s2 +! subroutine getgb2rp2(lugb, idxver, cindex, extract, gribm, leng, iret) +! integer, intent(in) :: lugb, idxver +! character(len = 1), intent(in) :: cindex(*) +! logical, intent(in) :: extract +! character(len = 1), pointer, dimension(:) :: gribm +! integer, intent(out) :: leng, iret +! end subroutine getgb2rp2 +! end interface + +! ! Initialize the index information in cbuf. +! irgi = 0 +! if (lugi .gt. 0) then +! call getg2i2(lugi, cbuf, idxver, nlen, nnum, irgi) +! elseif (lugi .le. 0) then +! mskp = 0 +! call getg2i2r(lugb, msk1, msk2, mskp, 2, cbuf, nlen, nnum, nmess, irgi) +! endif +! if (irgi .gt. 1) then +! iret = 96 +! return +! endif + +! ! Find info from index and fill a grib_mod::gribfield variable. +! call getgb2s2(cbuf, 2, nlen, nnum, j, jdisc, jids, jpdtn, jpdt, jgdtn, jgdt, & +! jk, gfld, lpos, irgs) + +! if (irgs .ne. 0) then +! iret = 99 +! call gf_free(gfld) +! return +! endif + +! ! Extract grib message from file. +! nullify(gribm) +! call getgb2rp2(lugb, 2, cbuf(lpos:), .false., gribm, leng, iret) + +! k = jk + +! ! Free cbuf memory allocated in getg2i/getg2ir(). +! if (associated(cbuf)) deallocate(cbuf) + +! call gf_free(gfld) +! end subroutine getgb2p2 !> Read and unpack sections 6 and 7 from a GRIB2 message using a !> version 1 index record. From 3866c640c13beca4e043643fc38f8512374498ce Mon Sep 17 00:00:00 2001 From: Edward Hartnett Date: Mon, 6 May 2024 06:37:58 -0600 Subject: [PATCH 05/19] constant type --- tests/test_fv3.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_fv3.F90 b/tests/test_fv3.F90 index 447fb092..dbfff9eb 100644 --- a/tests/test_fv3.F90 +++ b/tests/test_fv3.F90 @@ -101,7 +101,7 @@ program test_fv3 2047490029, 2053319040, 2068293784, 2077559731, 2088558356, 2094924735, & 2104635615, 2114215568, 2116028414, 2117835186, & 2119743433, 2123583500, 2125509518, 2130199220, 2132041460, 2133848232, & - 2143838088, 2149439845, 2155300928, 2170383489, & + 2143838088, 2149439845_8, 2155300928, 2170383489, & 2180053911, 2191129897, 2197484390, 2207284167, 2216916377, 2218723149, & 2220670766, 2224486664, 2226418221, 2230977116, & 2232822567, 2234629339, 2244656492, 2250253051, 2256080669, 2270997863, & From 68a69ec02170b717fbb0e3272d38bf259c64c591 Mon Sep 17 00:00:00 2001 From: Edward Hartnett Date: Mon, 6 May 2024 06:40:17 -0600 Subject: [PATCH 06/19] fixed constants --- tests/test_fv3.F90 | 444 ++++++++++++++++++++++----------------------- 1 file changed, 222 insertions(+), 222 deletions(-) diff --git a/tests/test_fv3.F90 b/tests/test_fv3.F90 index dbfff9eb..fbaea522 100644 --- a/tests/test_fv3.F90 +++ b/tests/test_fv3.F90 @@ -22,228 +22,228 @@ program test_fv3 integer :: i integer*8 :: lskip8, lgrib8, start8 integer :: iret - integer*8 :: expected_lskip8(NUM_MSG) = (/0, 13342681, 24228864, 26958473, 28943885, 33491509, & - 35662921, 37513651, 41466849, 49796382, & - 52338669, 54145441, 59420674, 70005385, 80346316, 94134044, & - 109418487, 124174637, 135296376, 146267769, & - 160530839, 163669983, 165476755, 176358032, 178967180, 180956974, & - 185509096, 187687857, 189539360, 193442018, & - 201755899, 204248168, 206054940, 211395997, 221765391, 231845074, & - 247029419, 258193997, 269162211, 270968983, & - 281705758, 282502959, 284309731, 286116503, 291699618, 300208170, & - 304072773, 304072964, 323776602, 332190201, & - 340619636, 347064318, 355139879, 356946651, 360886552, 370720872, & - 375977362, 378424610, 380231410, 388331078, & - 400797779, 406269857, 412685033, 418813138, 420619910, 422426710, & - 424233510, 426040310, 427847110, 429653910, & - 431460682, 441754179, 447002535, 451243787, 453050587, 461065023, & - 475743186, 481235700, 488100961, 494533623, & - 496340395, 498147195, 499953995, 501760795, 503567595, 505374395, & - 507181167, 517646580, 522845984, 525489292, & - 527296092, 535328763, 545493401, 551105100, 558067631, 564682673, & - 566489445, 568296245, 570103045, 571909845, & - 573716645, 575523445, 577330217, 587207321, 592583068, 596359990, & - 598166790, 606406969, 617728930, 623453884, & - 630811823, 637722772, 639529544, 641336344, 643143144, 644949944, & - 646756744, 648563544, 650370316, 660243874, & - 665782341, 668893391, 670700191, 678999403, 692158895, 697902691, & - 706018267, 713697696, 715504468, 717311268, & - 719118068, 720924868, 722731668, 724538468, 726345240, 736003584, & - 741491761, 745446508, 747253308, 754605322, & - 768690322, 774342531, 782404130, 790158517, 791965289, 793772089, & - 795578889, 797385689, 799192526, 800999326, & - 802806098, 813778601, 819270213, 821200805, 823007870, 828611751, & - 842007876, 847558692, 855818678, 863713621, & - 865520393, 867327193, 869199887, 871006687, 872885216, 874759560, & - 876566332, 887827025, 893234524, 895429188, & - 897242426, 903101132, 913175074, 918574960, 926605176, 934364056, & - 936170828, 937977628, 939816319, 941623119, & - 943455166, 945262345, 947069117, 956539236, 962177555, 965440305, & - 967315637, 973843552, 985559340, 991280475, & - 1000260351, 1009017827, 1010824599, 1012631399, 1014596572, 1016403372, & - 1018363592, 1020173441, 1021980213, 1031670555, & - 1037269263, 1040837093, 1043996969, 1051437343, 1062293962, 1068054150, & - 1077080825, 1085824114, 1087630886, 1089437686, & - 1091632072, 1093438872, 1095608817, 1097425447, 1099232219, 1109165718, & - 1114775704, 1118828103, 1127590579, 1136236814, & - 1144401667, 1150240654, 1159272325, 1168036210, 1169842982, 1171649782, & - 1174120612, 1175927412, 1178327480, 1180142059, & - 1181948831, 1191453928, 1197002262, 1201495517, 1211216292, 1217955715, & - 1226630809, 1232592261, 1241781787, 1247721790, & - 1249528562, 1251335362, 1254250483, 1256057394, 1258730705, 1260548537, & - 1262355309, 1271911139, 1277527887, 1282467250, & - 1296500907, 1304389633, 1313594204, 1319711223, 1329269981, 1335399673, & - 1337209617, 1339016389, 1340823189, 1344298910, & - 1346106764, 1349244152, 1351064417, 1352871189, 1362453927, 1368092865, & - 1373495944, 1389049914, 1398211666, 1407854034, & - 1414094480, 1423895659, 1430136369, 1431943141, 1433750598, 1437435460, & - 1439245621, 1442903894, 1444727127, 1446533899, & - 1456117316, 1461736427, 1467592438, 1484192419, 1490888200, 1500992441, & - 1507329866, 1517344757, 1523654157, 1525880720, & - 1529365718, 1531172490, 1532983700, 1536913815, 1538739158, 1542849663, & - 1544675501, 1546482273, 1556067456, 1561651504, & - 1567575002, 1584595114, 1591881604, 1602297666, 1608702225, 1618642970, & - 1624983602, 1626790374, 1628608164, 1633070737, & - 1634920612, 1639380363, 1641208721, 1643015493, 1652586730, 1658125850, & - 1664074201, 1681193007, 1688945453, 1699565835, & - 1705991351, 1715885564, 1722223834, 1724552435, 1726359207, 1728184164, & - 1732602687, 1734468695, 1739169811, 1741000601, & - 1742807373, 1752379144, 1757871168, 1763826728, 1780837257, 1789041009, & - 1799774719, 1806193077, 1815989272, 1822288783, & - 1824095555, 1825928155, 1830210031, 1832077708, 1836918030, 1838751400, & - 1840558172, 1850167467, 1855569067, 1861451105, & - 1876595690, 1885110695, 1895927171, 1902325015, 1912013838, 1918272047, & - 1920078819, 1921923261, 1925957631, 1927845861, & - 1932710181, 1934546228, 1936353000, 1945969565, 1951454983, 1957285982, & - 1972280033, 1981096580, 1991992920, 1998371058, & - 2008018333, 2014254181, 2016060953, 2017927542, 2022006835, 2023917386, & - 2028717243, 2030555879, 2032362651, 2041946305, & - 2047490029, 2053319040, 2068293784, 2077559731, 2088558356, 2094924735, & - 2104635615, 2114215568, 2116028414, 2117835186, & - 2119743433, 2123583500, 2125509518, 2130199220, 2132041460, 2133848232, & - 2143838088, 2149439845_8, 2155300928, 2170383489, & - 2180053911, 2191129897, 2197484390, 2207284167, 2216916377, 2218723149, & - 2220670766, 2224486664, 2226418221, 2230977116, & - 2232822567, 2234629339, 2244656492, 2250253051, 2256080669, 2270997863, & - 2280853785, 2291901199, 2298188353, 2307840648, & - 2317306653, 2319113425, 2321129753, 2325008550, 2326964756, 2331428147, & - 2333276729, 2335083501, 2345172551, 2350703006, & - 2356501740, 2371322518, 2381383238, 2392418937, 2398658027, 2408227384, & - 2417595237, 2419402009, 2421517733, 2425150718, & - 2427117204, 2431475559, 2433327804, 2435134576, 2445215668, 2450865483, & - 2456688311, 2471670771, 2482148645, 2493240939, & - 2499465549, 2509096995, 2518416762, 2520228855, 2525587219, 2527393991, & - 2529648573, 2533078876, 2535061604, 2539659278, & - 2541515383, 2543322155, 2553397007, 2559120033, 2565023486, 2580080084, & - 2591000119, 2602184923, 2608414611, 2618188998, & - 2627641301, 2629448073, 2631830292, 2635279573, 2637312837, 2641771909, & - 2643632165, 2645438937, 2655456301, 2661127864, & - 2667060572, 2682018954, 2693166548, 2704363178, 2710559245, 2720300014, & - 2729728251, 2731535023, 2734073716, 2737461479, & - 2739512697, 2743916415, 2745781442, 2747588214, 2757757035, 2763512727, & - 2769471516, 2784305815, 2795664291, 2806889029, & - 2813059587, 2822774306, 2832169446, 2833976218, 2836721084, 2839963634, & - 2842146002, 2846480890, 2848350670, 2850157470, & - 2860229934, 2866026061, 2872040708, 2886839289, 2898468354, 2909783979, & - 2915952326, 2925750651, 2935224520, 2937031292, & - 2939947664, 2943198694, 2945532711, 2949762408, 2951635025, 2953441825, & - 2963507573, 2969356923, 2975427653, 2990285995, & - 2998055593, 3009494974, 3015626446, 3025579499, 3035210640, 3037017412, 3040052556, & - 3043101196, 3045573697, 3049660226, 3051531677, & - 3053338477, 3063415986, 3069235019, 3075343154, 3090198941, 3098139265, & - 3109680464, 3115822302, 3125841746, 3135552951, & - 3137359723, 3140485044, 3143402665, 3145986981 /) - integer*8 :: expected_lgrib8(NUM_MSG) = (/ 13342681, 10886183, 2729609, 1985412, 4547624, & - 2171412, 1850730, 3953198, 8329533, 2542287, & - 1806772, 5275233, 10584711, 10340931, 13787728, & - 15284443, 14756150, 11121739, 10971393, 14263070, & - 3139144, 1806772, 10881277, 2609148, 1989794, & - 4552122, 2178761, 1851503, 3902658, 8313881, & - 2492269, 1806772, 5341057, 10369394, 10079683, & - 15184345, 11164578, 10968214, 1806772, 10736775, & - 797201, 1806772, 1806772, 5583115, 8508552, & - 3864603, 191, 19703638, 8413599, 8429435, & - 6444682, 8075561, 1806772, 3939901, 9834320, & - 5256490, 2447248, 1806800, 8099668, 12466701, & - 5472078, 6415176, 6128105, 1806772, 1806800, & - 1806800, 1806800, 1806800, 1806800, 1806772, & - 10293497, 5248356, 4241252, 1806800, 8014436, & - 14678163, 5492514, 6865261, 6432662, 1806772, & - 1806800, 1806800, 1806800, 1806800, 1806800, & - 1806772, 10465413, 5199404, 2643308, 1806800, & - 8032671, 10164638, 5611699, 6962531, 6615042, & - 1806772, 1806800, 1806800, 1806800, 1806800, & - 1806800, 1806772, 9877104, 5375747, 3776922, & - 1806800, 8240179, 11321961, 5724954, 7357939, & - 6910949, 1806772, 1806800, 1806800, 1806800, & - 1806800, 1806800, 1806772, 9873558, 5538467, & - 3111050, 1806800, 8299212, 13159492, 5743796, & - 8115576, 7679429, 1806772, 1806800, 1806800, & - 1806800, 1806800, 1806800, 1806772, 9658344, & - 5488177, 3954747, 1806800, 7352014, 14085000, & - 5652209, 8061599, 7754387, 1806772, 1806800, & - 1806800, 1806800, 1806837, 1806800, 1806772, & - 10972503, 5491612, 1930592, 1807065, 5603881, & - 13396125, 5550816, 8259986, 7894943, 1806772, & - 1806800, 1872694, 1806800, 1878529, 1874344, & - 1806772, 11260693, 5407499, 2194664, 1813238, & - 5858706, 10073942, 5399886, 8030216, 7758880, & - 1806772, 1806800, 1838691, 1806800, 1832047, & - 1807179, 1806772, 9470119, 5638319, 3262750, & - 1875332, 6527915, 11715788, 5721135, 8979876, & - 8757476, 1806772, 1806800, 1965173, 1806800, & - 1960220, 1809849, 1806772, 9690342, 5598708, & - 3567830, 3159876, 7440374, 10856619, 5760188, & - 9026675, 8743289, 1806772, 1806800, 2194386, & - 1806800, 2169945, 1816630, 1806772, 9933499, & - 5609986, 4052399, 8762476, 8646235, 8164853, & - 5838987, 9031671, 8763885, 1806772, 1806800, & - 2470830, 1806800, 2400068, 1814579, 1806772, & - 9505097, 5548334, 4493255, 9720775, 6739423, & - 8675094, 5961452, 9189526, 5940003, 1806772, & - 1806800, 2915121, 1806911, 2673311, 1817832, & - 1806772, 9555830, 5616748, 4939363, 14033657, & - 7888726, 9204571, 6117019, 9558758, 6129692, & - 1809944, 1806772, 1806800, 3475721, 1807854, & - 3137388, 1820265, 1806772, 9582738, 5638938, & - 5403079, 15553970, 9161752, 9642368, 6240446, & - 9801179, 6240710, 1806772, 1807457, 3684862, & - 1810161, 3658273, 1823233, 1806772, 9583417, & - 5619111, 5856011, 16599981, 6695781, 10104241, & - 6337425, 10014891, 6309400, 2226563, 3484998, & - 1806772, 1811210, 3930115, 1825343, 4110505, & - 1825838, 1806772, 9585183, 5584048, 5923498, & - 17020112, 7286490, 10416062, 6404559, 9940745, & - 6340632, 1806772, 1817790, 4462573, 1849875, & - 4459751, 1828358, 1806772, 9571237, 5539120, & - 5948351, 17118806, 7752446, 10620382, 6425516, & - 9894213, 6338270, 2328601, 1806772, 1824957, & - 4418523, 1866008, 4701116, 1830790, 1806772, & - 9571771, 5492024, 5955560, 17010529, 8203752, & - 10733710, 6418358, 9796195, 6299511, 1806772, & - 1832600, 4281876, 1867677, 4840322, 1833370, & - 1806772, 9609295, 5401600, 5882038, 15144585, & - 8515005, 10816476, 6397844, 9688823, 6258209, & - 1806772, 1844442, 4034370, 1888230, 4864320, & - 1836047, 1806772, 9616565, 5485418, 5830999, & - 14994051, 8816547, 10896340, 6378138, 9647275, & - 6235848, 1806772, 1866589, 4079293, 1910551, & - 4799857, 1838636, 1806772, 9583654, 5543724, & - 5829011, 14974744, 9265947, 10998625, 6366379, & - 9710880, 9579953, 1812846, 1806772, 1908247, & - 3840067, 1926018, 4689702, 1842240, 1806772, & - 9989856, 5601757, 5861083, 15082561, 9670422, & - 11075986, 6354493, 9799777, 9632210, 1806772, & - 1947617, 3815898, 1931557, 4558895, 1845451, & - 1806772, 10027153, 5596559, 5827618, 14917194, & - 9855922, 11047414, 6287154, 9652295, 9466005, & - 1806772, 2016328, 3878797, 1956206, 4463391, & - 1848582, 1806772, 10089050, 5530455, 5798734, & - 14820778, 10060720, 11035699, 6239090, 9569357, & - 9367853, 1806772, 2115724, 3632985, 1966486, & - 4358355, 1852245, 1806772, 10081092, 5649815, & - 5822828, 14982460, 10477874, 11092294, 6224610, & - 9631446, 9319767, 1812093, 5358364, 1806772, & - 2254582, 3430303, 1982728, 4597674, 1856105, & - 1806772, 10074852, 5723026, 5903453, 15056598, & - 10920035, 11184804, 6229688, 9774387, 9452303, & - 1806772, 2382219, 3449281, 2033264, 4459072, & - 1860256, 1806772, 10017364, 5671563, 5932708, & - 14958382, 11147594, 11196630, 6196067, 9740769, & - 9428237, 1806772, 2538693, 3387763, 2051218, & - 4403718, 1865027, 1806772, 10168821, 5755692, & - 5958789, 14834299, 11358476, 11224738, 6170558, & - 9714719, 9395140, 1806772, 2744866, 3242550, & - 2182368, 4334888, 1869780, 1806800, 10072464, & - 5796127, 6014647, 14798581, 11629065, 11315625, & - 6168347, 9798325, 9473869, 1806772, 2916372, & - 3251030, 2334017, 4229697, 1872617, 1806800, & - 10065748, 5849350, 6070730, 14858342, 7769598, & - 11439381, 6131472, 9953053, 9631141, 1806772, & - 3035144, 3048640, 2472501, 4086529, 1871451, & - 1806800, 10077509, 5819033, 6108135, 14855787, & - 7940324, 11541199, 6141838, 10019444, 9711205, & - 1806772, 3125321, 2917621, 2584316, 3934037 /) + integer*8 :: expected_lskip8(NUM_MSG) = (/0_8, 13342681_8, 24228864_8, 26958473_8, 28943885_8, 33491509_8, & + 35662921_8, 37513651_8, 41466849_8, 49796382_8, & + 52338669_8, 54145441_8, 59420674_8, 70005385_8, 80346316_8, 94134044_8, & + 109418487_8, 124174637_8, 135296376_8, 146267769_8, & + 160530839_8, 163669983_8, 165476755_8, 176358032_8, 178967180_8, 180956974_8, & + 185509096_8, 187687857_8, 189539360_8, 193442018_8, & + 201755899_8, 204248168_8, 206054940_8, 211395997_8, 221765391_8, 231845074_8, & + 247029419_8, 258193997_8, 269162211_8, 270968983_8, & + 281705758_8, 282502959_8, 284309731_8, 286116503_8, 291699618_8, 300208170_8, & + 304072773_8, 304072964_8, 323776602_8, 332190201_8, & + 340619636_8, 347064318_8, 355139879_8, 356946651_8, 360886552_8, 370720872_8, & + 375977362_8, 378424610_8, 380231410_8, 388331078_8, & + 400797779_8, 406269857_8, 412685033_8, 418813138_8, 420619910_8, 422426710_8, & + 424233510_8, 426040310_8, 427847110_8, 429653910_8, & + 431460682_8, 441754179_8, 447002535_8, 451243787_8, 453050587_8, 461065023_8, & + 475743186_8, 481235700_8, 488100961_8, 494533623_8, & + 496340395_8, 498147195_8, 499953995_8, 501760795_8, 503567595_8, 505374395_8, & + 507181167_8, 517646580_8, 522845984_8, 525489292_8, & + 527296092_8, 535328763_8, 545493401_8, 551105100_8, 558067631_8, 564682673_8, & + 566489445_8, 568296245_8, 570103045_8, 571909845_8, & + 573716645_8, 575523445_8, 577330217_8, 587207321_8, 592583068_8, 596359990_8, & + 598166790_8, 606406969_8, 617728930_8, 623453884_8, & + 630811823_8, 637722772_8, 639529544_8, 641336344_8, 643143144_8, 644949944_8, & + 646756744_8, 648563544_8, 650370316_8, 660243874_8, & + 665782341_8, 668893391_8, 670700191_8, 678999403_8, 692158895_8, 697902691_8, & + 706018267_8, 713697696_8, 715504468_8, 717311268_8, & + 719118068_8, 720924868_8, 722731668_8, 724538468_8, 726345240_8, 736003584_8, & + 741491761_8, 745446508_8, 747253308_8, 754605322_8, & + 768690322_8, 774342531_8, 782404130_8, 790158517_8, 791965289_8, 793772089_8, & + 795578889_8, 797385689_8, 799192526_8, 800999326_8, & + 802806098_8, 813778601_8, 819270213_8, 821200805_8, 823007870_8, 828611751_8, & + 842007876_8, 847558692_8, 855818678_8, 863713621_8, & + 865520393_8, 867327193_8, 869199887_8, 871006687_8, 872885216_8, 874759560_8, & + 876566332_8, 887827025_8, 893234524_8, 895429188_8, & + 897242426_8, 903101132_8, 913175074_8, 918574960_8, 926605176_8, 934364056_8, & + 936170828_8, 937977628_8, 939816319_8, 941623119_8, & + 943455166_8, 945262345_8, 947069117_8, 956539236_8, 962177555_8, 965440305_8, & + 967315637_8, 973843552_8, 985559340_8, 991280475_8, & + 1000260351_8, 1009017827_8, 1010824599_8, 1012631399_8, 1014596572_8, 1016403372_8, & + 1018363592_8, 1020173441_8, 1021980213_8, 1031670555_8, & + 1037269263_8, 1040837093_8, 1043996969_8, 1051437343_8, 1062293962_8, 1068054150_8, & + 1077080825_8, 1085824114_8, 1087630886_8, 1089437686_8, & + 1091632072_8, 1093438872_8, 1095608817_8, 1097425447_8, 1099232219_8, 1109165718_8, & + 1114775704_8, 1118828103_8, 1127590579_8, 1136236814_8, & + 1144401667_8, 1150240654_8, 1159272325_8, 1168036210_8, 1169842982_8, 1171649782_8, & + 1174120612_8, 1175927412_8, 1178327480_8, 1180142059_8, & + 1181948831_8, 1191453928_8, 1197002262_8, 1201495517_8, 1211216292_8, 1217955715_8, & + 1226630809_8, 1232592261_8, 1241781787_8, 1247721790_8, & + 1249528562_8, 1251335362_8, 1254250483_8, 1256057394_8, 1258730705_8, 1260548537_8, & + 1262355309_8, 1271911139_8, 1277527887_8, 1282467250_8, & + 1296500907_8, 1304389633_8, 1313594204_8, 1319711223_8, 1329269981_8, 1335399673_8, & + 1337209617_8, 1339016389_8, 1340823189_8, 1344298910_8, & + 1346106764_8, 1349244152_8, 1351064417_8, 1352871189_8, 1362453927_8, 1368092865_8, & + 1373495944_8, 1389049914_8, 1398211666_8, 1407854034_8, & + 1414094480_8, 1423895659_8, 1430136369_8, 1431943141_8, 1433750598_8, 1437435460_8, & + 1439245621_8, 1442903894_8, 1444727127_8, 1446533899_8, & + 1456117316_8, 1461736427_8, 1467592438_8, 1484192419_8, 1490888200_8, 1500992441_8, & + 1507329866_8, 1517344757_8, 1523654157_8, 1525880720_8, & + 1529365718_8, 1531172490_8, 1532983700_8, 1536913815_8, 1538739158_8, 1542849663_8, & + 1544675501_8, 1546482273_8, 1556067456_8, 1561651504_8, & + 1567575002_8, 1584595114_8, 1591881604_8, 1602297666_8, 1608702225_8, 1618642970_8, & + 1624983602_8, 1626790374_8, 1628608164_8, 1633070737_8, & + 1634920612_8, 1639380363_8, 1641208721_8, 1643015493_8, 1652586730_8, 1658125850_8, & + 1664074201_8, 1681193007_8, 1688945453_8, 1699565835_8, & + 1705991351_8, 1715885564_8, 1722223834_8, 1724552435_8, 1726359207_8, 1728184164_8, & + 1732602687_8, 1734468695_8, 1739169811_8, 1741000601_8, & + 1742807373_8, 1752379144_8, 1757871168_8, 1763826728_8, 1780837257_8, 1789041009_8, & + 1799774719_8, 1806193077_8, 1815989272_8, 1822288783_8, & + 1824095555_8, 1825928155_8, 1830210031_8, 1832077708_8, 1836918030_8, 1838751400_8, & + 1840558172_8, 1850167467_8, 1855569067_8, 1861451105_8, & + 1876595690_8, 1885110695_8, 1895927171_8, 1902325015_8, 1912013838_8, 1918272047_8, & + 1920078819_8, 1921923261_8, 1925957631_8, 1927845861_8, & + 1932710181_8, 1934546228_8, 1936353000_8, 1945969565_8, 1951454983_8, 1957285982_8, & + 1972280033_8, 1981096580_8, 1991992920_8, 1998371058_8, & + 2008018333_8, 2014254181_8, 2016060953_8, 2017927542_8, 2022006835_8, 2023917386_8, & + 2028717243_8, 2030555879_8, 2032362651_8, 2041946305_8, & + 2047490029_8, 2053319040_8, 2068293784_8, 2077559731_8, 2088558356_8, 2094924735_8, & + 2104635615_8, 2114215568_8, 2116028414_8, 2117835186_8, & + 2119743433_8, 2123583500_8, 2125509518_8, 2130199220_8, 2132041460_8, 2133848232_8, & + 2143838088_8, 2149439845_8, 2155300928_8, 2170383489_8, & + 2180053911_8, 2191129897_8, 2197484390_8, 2207284167_8, 2216916377_8, 2218723149_8, & + 2220670766_8, 2224486664_8, 2226418221_8, 2230977116_8, & + 2232822567_8, 2234629339_8, 2244656492_8, 2250253051_8, 2256080669_8, 2270997863_8, & + 2280853785_8, 2291901199_8, 2298188353_8, 2307840648_8, & + 2317306653_8, 2319113425_8, 2321129753_8, 2325008550_8, 2326964756_8, 2331428147_8, & + 2333276729_8, 2335083501_8, 2345172551_8, 2350703006_8, & + 2356501740_8, 2371322518_8, 2381383238_8, 2392418937_8, 2398658027_8, 2408227384_8, & + 2417595237_8, 2419402009_8, 2421517733_8, 2425150718_8, & + 2427117204_8, 2431475559_8, 2433327804_8, 2435134576_8, 2445215668_8, 2450865483_8, & + 2456688311_8, 2471670771_8, 2482148645_8, 2493240939_8, & + 2499465549_8, 2509096995_8, 2518416762_8, 2520228855_8, 2525587219_8, 2527393991_8, & + 2529648573_8, 2533078876_8, 2535061604_8, 2539659278_8, & + 2541515383_8, 2543322155_8, 2553397007_8, 2559120033_8, 2565023486_8, 2580080084_8, & + 2591000119_8, 2602184923_8, 2608414611_8, 2618188998_8, & + 2627641301_8, 2629448073_8, 2631830292_8, 2635279573_8, 2637312837_8, 2641771909_8, & + 2643632165_8, 2645438937_8, 2655456301_8, 2661127864_8, & + 2667060572_8, 2682018954_8, 2693166548_8, 2704363178_8, 2710559245_8, 2720300014_8, & + 2729728251_8, 2731535023_8, 2734073716_8, 2737461479_8, & + 2739512697_8, 2743916415_8, 2745781442_8, 2747588214_8, 2757757035_8, 2763512727_8, & + 2769471516_8, 2784305815_8, 2795664291_8, 2806889029_8, & + 2813059587_8, 2822774306_8, 2832169446_8, 2833976218_8, 2836721084_8, 2839963634_8, & + 2842146002_8, 2846480890_8, 2848350670_8, 2850157470_8, & + 2860229934_8, 2866026061_8, 2872040708_8, 2886839289_8, 2898468354_8, 2909783979_8, & + 2915952326_8, 2925750651_8, 2935224520_8, 2937031292_8, & + 2939947664_8, 2943198694_8, 2945532711_8, 2949762408_8, 2951635025_8, 2953441825_8, & + 2963507573_8, 2969356923_8, 2975427653_8, 2990285995_8, & + 2998055593_8, 3009494974_8, 3015626446_8, 3025579499_8, 3035210640_8, 3037017412_8, 3040052556_8, & + 3043101196_8, 3045573697_8, 3049660226_8, 3051531677_8, & + 3053338477_8, 3063415986_8, 3069235019_8, 3075343154_8, 3090198941_8, 3098139265_8, & + 3109680464_8, 3115822302_8, 3125841746_8, 3135552951_8, & + 3137359723_8, 3140485044_8, 3143402665_8, 3145986981_8 /) + integer*8 :: expected_lgrib8(NUM_MSG) = (/ 13342681_8, 10886183_8, 2729609_8, 1985412_8, 4547624_8, & + 2171412_8, 1850730_8, 3953198_8, 8329533_8, 2542287_8, & + 1806772_8, 5275233_8, 10584711_8, 10340931_8, 13787728_8, & + 15284443_8, 14756150_8, 11121739_8, 10971393_8, 14263070_8, & + 3139144_8, 1806772_8, 10881277_8, 2609148_8, 1989794_8, & + 4552122_8, 2178761_8, 1851503_8, 3902658_8, 8313881_8, & + 2492269_8, 1806772_8, 5341057_8, 10369394_8, 10079683_8, & + 15184345_8, 11164578_8, 10968214_8, 1806772_8, 10736775_8, & + 797201_8, 1806772_8, 1806772_8, 5583115_8, 8508552_8, & + 3864603_8, 191_8, 19703638_8, 8413599_8, 8429435_8, & + 6444682_8, 8075561_8, 1806772_8, 3939901_8, 9834320_8, & + 5256490_8, 2447248_8, 1806800_8, 8099668_8, 12466701_8, & + 5472078_8, 6415176_8, 6128105_8, 1806772_8, 1806800_8, & + 1806800_8, 1806800_8, 1806800_8, 1806800_8, 1806772_8, & + 10293497_8, 5248356_8, 4241252_8, 1806800_8, 8014436_8, & + 14678163_8, 5492514_8, 6865261_8, 6432662_8, 1806772_8, & + 1806800_8, 1806800_8, 1806800_8, 1806800_8, 1806800_8, & + 1806772_8, 10465413_8, 5199404_8, 2643308_8, 1806800_8, & + 8032671_8, 10164638_8, 5611699_8, 6962531_8, 6615042_8, & + 1806772_8, 1806800_8, 1806800_8, 1806800_8, 1806800_8, & + 1806800_8, 1806772_8, 9877104_8, 5375747_8, 3776922_8, & + 1806800_8, 8240179_8, 11321961_8, 5724954_8, 7357939_8, & + 6910949_8, 1806772_8, 1806800_8, 1806800_8, 1806800_8, & + 1806800_8, 1806800_8, 1806772_8, 9873558_8, 5538467_8, & + 3111050_8, 1806800_8, 8299212_8, 13159492_8, 5743796_8, & + 8115576_8, 7679429_8, 1806772_8, 1806800_8, 1806800_8, & + 1806800_8, 1806800_8, 1806800_8, 1806772_8, 9658344_8, & + 5488177_8, 3954747_8, 1806800_8, 7352014_8, 14085000_8, & + 5652209_8, 8061599_8, 7754387_8, 1806772_8, 1806800_8, & + 1806800_8, 1806800_8, 1806837_8, 1806800_8, 1806772_8, & + 10972503_8, 5491612_8, 1930592_8, 1807065_8, 5603881_8, & + 13396125_8, 5550816_8, 8259986_8, 7894943_8, 1806772_8, & + 1806800_8, 1872694_8, 1806800_8, 1878529_8, 1874344_8, & + 1806772_8, 11260693_8, 5407499_8, 2194664_8, 1813238_8, & + 5858706_8, 10073942_8, 5399886_8, 8030216_8, 7758880_8, & + 1806772_8, 1806800_8, 1838691_8, 1806800_8, 1832047_8, & + 1807179_8, 1806772_8, 9470119_8, 5638319_8, 3262750_8, & + 1875332_8, 6527915_8, 11715788_8, 5721135_8, 8979876_8, & + 8757476_8, 1806772_8, 1806800_8, 1965173_8, 1806800_8, & + 1960220_8, 1809849_8, 1806772_8, 9690342_8, 5598708_8, & + 3567830_8, 3159876_8, 7440374_8, 10856619_8, 5760188_8, & + 9026675_8, 8743289_8, 1806772_8, 1806800_8, 2194386_8, & + 1806800_8, 2169945_8, 1816630_8, 1806772_8, 9933499_8, & + 5609986_8, 4052399_8, 8762476_8, 8646235_8, 8164853_8, & + 5838987_8, 9031671_8, 8763885_8, 1806772_8, 1806800_8, & + 2470830_8, 1806800_8, 2400068_8, 1814579_8, 1806772_8, & + 9505097_8, 5548334_8, 4493255_8, 9720775_8, 6739423_8, & + 8675094_8, 5961452_8, 9189526_8, 5940003_8, 1806772_8, & + 1806800_8, 2915121_8, 1806911_8, 2673311_8, 1817832_8, & + 1806772_8, 9555830_8, 5616748_8, 4939363_8, 14033657_8, & + 7888726_8, 9204571_8, 6117019_8, 9558758_8, 6129692_8, & + 1809944_8, 1806772_8, 1806800_8, 3475721_8, 1807854_8, & + 3137388_8, 1820265_8, 1806772_8, 9582738_8, 5638938_8, & + 5403079_8, 15553970_8, 9161752_8, 9642368_8, 6240446_8, & + 9801179_8, 6240710_8, 1806772_8, 1807457_8, 3684862_8, & + 1810161_8, 3658273_8, 1823233_8, 1806772_8, 9583417_8, & + 5619111_8, 5856011_8, 16599981_8, 6695781_8, 10104241_8, & + 6337425_8, 10014891_8, 6309400_8, 2226563_8, 3484998_8, & + 1806772_8, 1811210_8, 3930115_8, 1825343_8, 4110505_8, & + 1825838_8, 1806772_8, 9585183_8, 5584048_8, 5923498_8, & + 17020112_8, 7286490_8, 10416062_8, 6404559_8, 9940745_8, & + 6340632_8, 1806772_8, 1817790_8, 4462573_8, 1849875_8, & + 4459751_8, 1828358_8, 1806772_8, 9571237_8, 5539120_8, & + 5948351_8, 17118806_8, 7752446_8, 10620382_8, 6425516_8, & + 9894213_8, 6338270_8, 2328601_8, 1806772_8, 1824957_8, & + 4418523_8, 1866008_8, 4701116_8, 1830790_8, 1806772_8, & + 9571771_8, 5492024_8, 5955560_8, 17010529_8, 8203752_8, & + 10733710_8, 6418358_8, 9796195_8, 6299511_8, 1806772_8, & + 1832600_8, 4281876_8, 1867677_8, 4840322_8, 1833370_8, & + 1806772_8, 9609295_8, 5401600_8, 5882038_8, 15144585_8, & + 8515005_8, 10816476_8, 6397844_8, 9688823_8, 6258209_8, & + 1806772_8, 1844442_8, 4034370_8, 1888230_8, 4864320_8, & + 1836047_8, 1806772_8, 9616565_8, 5485418_8, 5830999_8, & + 14994051_8, 8816547_8, 10896340_8, 6378138_8, 9647275_8, & + 6235848_8, 1806772_8, 1866589_8, 4079293_8, 1910551_8, & + 4799857_8, 1838636_8, 1806772_8, 9583654_8, 5543724_8, & + 5829011_8, 14974744_8, 9265947_8, 10998625_8, 6366379_8, & + 9710880_8, 9579953_8, 1812846_8, 1806772_8, 1908247_8, & + 3840067_8, 1926018_8, 4689702_8, 1842240_8, 1806772_8, & + 9989856_8, 5601757_8, 5861083_8, 15082561_8, 9670422_8, & + 11075986_8, 6354493_8, 9799777_8, 9632210_8, 1806772_8, & + 1947617_8, 3815898_8, 1931557_8, 4558895_8, 1845451_8, & + 1806772_8, 10027153_8, 5596559_8, 5827618_8, 14917194_8, & + 9855922_8, 11047414_8, 6287154_8, 9652295_8, 9466005_8, & + 1806772_8, 2016328_8, 3878797_8, 1956206_8, 4463391_8, & + 1848582_8, 1806772_8, 10089050_8, 5530455_8, 5798734_8, & + 14820778_8, 10060720_8, 11035699_8, 6239090_8, 9569357_8, & + 9367853_8, 1806772_8, 2115724_8, 3632985_8, 1966486_8, & + 4358355_8, 1852245_8, 1806772_8, 10081092_8, 5649815_8, & + 5822828_8, 14982460_8, 10477874_8, 11092294_8, 6224610_8, & + 9631446_8, 9319767_8, 1812093_8, 5358364_8, 1806772_8, & + 2254582_8, 3430303_8, 1982728_8, 4597674_8, 1856105_8, & + 1806772_8, 10074852_8, 5723026_8, 5903453_8, 15056598_8, & + 10920035_8, 11184804_8, 6229688_8, 9774387_8, 9452303_8, & + 1806772_8, 2382219_8, 3449281_8, 2033264_8, 4459072_8, & + 1860256_8, 1806772_8, 10017364_8, 5671563_8, 5932708_8, & + 14958382_8, 11147594_8, 11196630_8, 6196067_8, 9740769_8, & + 9428237_8, 1806772_8, 2538693_8, 3387763_8, 2051218_8, & + 4403718_8, 1865027_8, 1806772_8, 10168821_8, 5755692_8, & + 5958789_8, 14834299_8, 11358476_8, 11224738_8, 6170558_8, & + 9714719_8, 9395140_8, 1806772_8, 2744866_8, 3242550_8, & + 2182368_8, 4334888_8, 1869780_8, 1806800_8, 10072464_8, & + 5796127_8, 6014647_8, 14798581_8, 11629065_8, 11315625_8, & + 6168347_8, 9798325_8, 9473869_8, 1806772_8, 2916372_8, & + 3251030_8, 2334017_8, 4229697_8, 1872617_8, 1806800_8, & + 10065748_8, 5849350_8, 6070730_8, 14858342_8, 7769598_8, & + 11439381_8, 6131472_8, 9953053_8, 9631141_8, 1806772_8, & + 3035144_8, 3048640_8, 2472501_8, 4086529_8, 1871451_8, & + 1806800_8, 10077509_8, 5819033_8, 6108135_8, 14855787_8, & + 7940324_8, 11541199_8, 6141838_8, 10019444_8, 9711205_8, & + 1806772_8, 3125321_8, 2917621_8, 2584316_8, 3934037_8 /) print *, 'Testing reading GRIB2 file ', TEST_FILE print *, 'trying getgb2()...' From 974252d5feab4849933f0bc9d3553702bbeb3ddb Mon Sep 17 00:00:00 2001 From: Edward Hartnett Date: Mon, 6 May 2024 06:51:47 -0600 Subject: [PATCH 07/19] removed doxygen --- src/g2getgb2.F90 | 87 ------------------------------------------------ 1 file changed, 87 deletions(-) diff --git a/src/g2getgb2.F90 b/src/g2getgb2.F90 index 0965159c..6d17219b 100644 --- a/src/g2getgb2.F90 +++ b/src/g2getgb2.F90 @@ -580,93 +580,6 @@ end subroutine getgb2rp call gf_free(gfld) end subroutine getgb2p -!> Find and extract a GRIB2 message from a file with idxver=2. -!> -!> This subroutine reads a GRIB index file (or optionally the GRIB -!> file itself) to get the index buffer (i.e. table of contents) for -!> the GRIB file. It finds in the index buffer a reference to the -!> GRIB field requested. -!> -!> The GRIB field request specifies the number of fields to skip and -!> the unpacked identification section, grid definition template and -!> product defintion section parameters. (A requested parameter of -!> -9999 means to allow any value of this parameter to be found.) -!> -!> If the requested GRIB field is found, then it is read from the GRIB -!> file and unpacked. If the GRIB field is not found, then the return -!> code will be nonzero. -!> -!> The derived type @ref grib_mod::gribfield contains allocated memory -!> that must be freed by the caller with subroutine gf_free(). -!> -!> @note Specifing an index file may increase speed. -!> Do not engage the same logical unit from more than one processor. -!> -!> @param[in] lugb Unit of the unblocked GRIB data file. The -!> file must have been opened with [baopen() or baopenr()] -!> (https://noaa-emc.github.io/NCEPLIBS-bacio/) before calling this -!> routine. -!> @param[in] lugi Unit of the unblocked GRIB index file. If -!> nonzero, file must have been opened with [baopen() or baopenr()] -!> (https://noaa-emc.github.io/NCEPLIBS-bacio/) before calling this -!> subroutine. Set to 0 to get index buffer from the GRIB file. -!> @param[in] j Number of fields to skip (set to 0 to search -!> from beginning). -!> @param[in] jdisc GRIB2 discipline number of requested field. See -!> [GRIB2 - TABLE 0.0 - -!> DISCIPLINE](https://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_table0-0.shtml). -!> Use -1 to accept any discipline. -!> @param[in] jids Array of values in the identification -!> section. (Set to -9999 for wildcard.) -!> - jids(1) Identification of originating centre. See [TABLE 0 - -!> NATIONAL/INTERNATIONAL ORIGINATING -!> CENTERS](https://www.nco.ncep.noaa.gov/pmb/docs/on388/table0.html). -!> - jids(2) Identification of originating sub-centre. See [TABLE C - -!> NATIONAL -!> SUB-CENTERS](https://www.nco.ncep.noaa.gov/pmb/docs/on388/tablec.html). -!> - jids(3) GRIB master tables version number. See [GRIB2 - TABLE 1.0 -!> - GRIB Master Tables Version -!> Number](https://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_table1-0.shtml). -!> - jids(4) GRIB local tables version number. See [GRIB2 - TABLE 1.1 -!> - GRIB Local Tables Version -!> Number](https://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_table1-1.shtml). -!> - jids(5) Significance of reference time. See [GRIB2 - TABLE 1.2 - -!> Significance of Reference -!> Time](https://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_table1-2.shtml). -!> - jids(6) year (4 digits) -!> - jids(7) month -!> - jids(8) day -!> - jids(9) hour -!> - jids(10) minute -!> - jids(11) second -!> - jids(12) Production status of processed data. See [GRIB2 - TABLE -!> 1.3 - Production Status of -!> Data](https://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_table1-3.shtml). -!> - jids(13) Type of processed data. See [GRIB2 - TABLE 1.4 - TYPE OF -!> DATA](https://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_table1-4.shtml). -!> @param[in] jpdtn Product Definition Template (PDT) number (n) -!> (if = -1, don't bother matching PDT - accept any) -!> @param[in] jpdt Array of values defining the Product Definition -!> Template of the field for which to search (=-9999 for wildcard). -!> @param[in] jgdtn Grid Definition Template (GDT) number (if = -1, -!> don't bother matching GDT - accept any). -!> @param[in] jgdt array of values defining the Grid Definition -!> Template of the field for which to search (=-9999 for wildcard). -!> @param[in] extract value indicating whether to return a -!> GRIB2 message with just the requested field, or the entire -!> GRIB2 message containing the requested field. -!> - .true. return GRIB2 message containing only the requested field. -!> - .false. return entire GRIB2 message containing the requested field. -!> @param[out] k field number unpacked. -!> @param[out] gribm returned GRIB message. -!> @param[out] leng length of returned GRIB message in bytes. -!> @param[out] iret integer return code -!> - 0 No error. -!> - 96 Error reading index. -!> - 97 Error reading GRIB file. -!> - 99 Request not found. -!> -!> @author Mark Iredell @date 1994-04-01 ! subroutine getgb2p2(lugb, lugi, j, jdisc, jids, jpdtn, jpdt, jgdtn, jgdt, & ! extract, k, gribm, leng, iret) ! use grib_mod From 887c4a588198f61224646789581e3b3599687f0a Mon Sep 17 00:00:00 2001 From: Edward Hartnett Date: Mon, 6 May 2024 07:50:22 -0600 Subject: [PATCH 08/19] more fixes --- CMakeLists.txt | 2 +- src/g2index.F90 | 6 +++--- tests/test_create_index.F90 | 4 +++- tests/test_g1.F90 | 14 +++++++++----- 4 files changed, 16 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 10723cf4..cf91a7ab 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -52,7 +52,7 @@ if(CMAKE_C_COMPILER_ID MATCHES "^(Intel|IntelLLVM)$") elseif(CMAKE_C_COMPILER_ID MATCHES "^(GNU|Clang|AppleClang)$") set(CMAKE_C_FLAGS "-g ${CMAKE_C_FLAGS}") set(CMAKE_C_FLAGS_DEBUG "-ggdb -Wall") - set(CMAKE_Fortran_FLAGS "-g -fno-range-check -funroll-loops ${CMAKE_Fortran_FLAGS}") + set(CMAKE_Fortran_FLAGS "-g -funroll-loops ${CMAKE_Fortran_FLAGS}") set(CMAKE_Fortran_FLAGS_DEBUG "-ggdb -Wall") set(fortran_d_flags "-fdefault-real-8") endif() diff --git a/src/g2index.F90 b/src/g2index.F90 index d46fe432..6dcc6f86 100644 --- a/src/g2index.F90 +++ b/src/g2index.F90 @@ -678,7 +678,7 @@ end subroutine ix2gb2 lgrib4 = int(lgrib, kind(4)) call ix2gb2(lugb, lskip, idxver, lgrib, cbuftmp, numfld, nbytes, iret1) if (iret1 .ne. 0) print *, ' SAGT ', numfld, nbytes, iret1 - if((nbytes + nlen) .gt. mbuf) then ! Allocate more space, if necessary. + if (nbytes + nlen .gt. mbuf) then ! Allocate more space, if necessary. newsize = max(mbuf + next, mbuf + nbytes) call realloc(cbuf, nlen, newsize, istat) if (istat .ne. 0) then @@ -1249,7 +1249,7 @@ subroutine ix2gb2(lugb, lskip8, idxver, lgrib8, cbuf, numfld, mlen, iret) else ! Add the extra 4 bytes in the version 2 index record, starting ! at byte 9. - inc = 4 + inc = 8 endif loclus = 0 @@ -1376,7 +1376,7 @@ subroutine ix2gb2(lugb, lskip8, idxver, lgrib8, cbuf, numfld, mlen, iret) mypos = (ixds + inc) * INT1_BITS call g2_sbytec(cindex, int(ibskip8 - lskip8, kind(4)), mypos, INT4_BITS) ! loc. of data sec. numfld = numfld + 1 - if ((lindex + mlen) .gt. mbuf) then ! allocate more space if necessary + if (lindex + mlen .gt. mbuf) then ! allocate more space if necessary newsize = max(mbuf + next, mbuf + lindex) call realloc(cbuf, mlen, newsize, istat) if (istat .ne. 0) then diff --git a/tests/test_create_index.F90 b/tests/test_create_index.F90 index b45025f4..8f61587c 100644 --- a/tests/test_create_index.F90 +++ b/tests/test_create_index.F90 @@ -118,9 +118,11 @@ end subroutine g2_create_index !print *, myidxver, nlen, nnum, iret if (myidxver .ne. idxver) stop 79 if (idxver .eq. 1) then + print *, nlen if (nlen .ne. 3800) stop 80 else - if (nlen .ne. 3876) stop 80 + print *, nlen + if (nlen .ne. 3952) stop 80 endif if (nnum .ne. 19 .or. iret .ne. 0) stop 81 diff --git a/tests/test_g1.F90 b/tests/test_g1.F90 index 493db6dd..6f1164fb 100644 --- a/tests/test_g1.F90 +++ b/tests/test_g1.F90 @@ -15,7 +15,8 @@ program test_g1 character(len=1), pointer, dimension(:) :: cbuf(:) integer :: lugb = 3 integer :: nlen, nnum, iret - integer :: index_rec_len, b2s_message, b2s_lus, b2s_gds, b2s_pds, b2s_drs, b2s_bms, b2s_data + integer :: index_rec_len, b2s_message, b2s_gds, b2s_pds, b2s_drs, b2s_bms, b2s_data + integer (kind = 8) :: b2s_lus integer :: total_bytes, grib_version, discipline, field_number, i, idxver integer (kind = 8) :: b2s_message8 @@ -56,7 +57,8 @@ end subroutine getidx2 if (i .eq. 1) then if (nlen .ne. 200) stop 22 else - if (nlen .ne. 204) stop 23 + print *, nlen + if (nlen .ne. 208) stop 23 endif ! do j = 1, nlen ! print '(i3, x, z2.2)', j, cbuf(j) @@ -69,21 +71,23 @@ end subroutine getidx2 if (i .eq. 1) then if (index_rec_len .ne. 200) stop 30 else - if (index_rec_len .ne. 204) stop 30 + if (index_rec_len .ne. 208) stop 30 endif if (i .eq. 1) then call g2_gbytec(cbuf, b2s_message, mypos, INT4_BITS) if (b2s_message .ne. 0) stop 31 mypos = mypos + INT4_BITS b2s_message8 = b2s_message + call g2_gbytec(cbuf, b2s_lus, mypos, INT4_BITS) + mypos = mypos + INT4_BITS else call g2_gbytec8(cbuf, b2s_message8, mypos, INT8_BITS) if (b2s_message8 .ne. 0) stop 32 mypos = mypos + INT8_BITS + call g2_gbytec8(cbuf, b2s_lus, mypos, INT8_BITS) + mypos = mypos + INT8_BITS endif - call g2_gbytec(cbuf, b2s_lus, mypos, INT4_BITS) if (b2s_lus .ne. 0) stop 33 - mypos = mypos + INT4_BITS call g2_gbytec(cbuf, b2s_gds, mypos, INT4_BITS) if (b2s_gds .ne. 37) stop 34 mypos = mypos + INT4_BITS From e694a442f5cf7e736d4d5799170763ec3488614a Mon Sep 17 00:00:00 2001 From: Edward Hartnett Date: Mon, 6 May 2024 08:44:42 -0600 Subject: [PATCH 09/19] more progress --- src/g2getgb2.F90 | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/g2getgb2.F90 b/src/g2getgb2.F90 index 7f53b71c..c3a5350e 100644 --- a/src/g2getgb2.F90 +++ b/src/g2getgb2.F90 @@ -357,7 +357,7 @@ subroutine getgb2l2(lugb, idxver, cindex, gfld, iret) integer, intent(out) :: iret integer :: lskip, skip2 - integer (kind = 8) :: lskip8, iskip8, lread8, ilen8 + integer (kind = 8) :: lskip8, iskip8, lread8, ilen8, skip28 character(len = 1):: csize(4) character(len = 1), allocatable :: ctemp(:) integer :: ilen, iofst, ierr @@ -384,15 +384,17 @@ end subroutine gf_unpack2 call g2_gbytec(cindex, lskip, mypos, INT4_BITS) mypos = mypos + INT4_BITS lskip8 = lskip + call g2_gbytec(cindex, skip2, mypos, INT4_BITS) + skip28 = skip2 else call g2_gbytec8(cindex, lskip8, mypos, INT8_BITS) mypos = mypos + INT8_BITS + call g2_gbytec8(cindex, skip28, mypos, INT8_BITS) endif - call g2_gbytec(cindex, skip2, mypos, INT4_BITS) ! Read and unpack local use section, if present. - if (skip2 .ne. 0) then - iskip8 = lskip8 + skip2 + if (skip28 .ne. 0) then + iskip8 = lskip8 + skip28 ! Get length of section. call bareadl(lugb, iskip8, 4_8, lread8, csize) From aff75d0f45bb03f62e55e6f465d4172aeb9097bc Mon Sep 17 00:00:00 2001 From: Edward Hartnett Date: Mon, 6 May 2024 08:58:41 -0600 Subject: [PATCH 10/19] more progress --- src/g2getgb2.F90 | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/g2getgb2.F90 b/src/g2getgb2.F90 index c3a5350e..fdd01bda 100644 --- a/src/g2getgb2.F90 +++ b/src/g2getgb2.F90 @@ -379,17 +379,25 @@ end subroutine gf_unpack2 ! Get info. nullify(gfld%local) iret = 0 - mypos = INT4_BITS + mypos = INT4_BITS ! Skip length of index record. + + ! These are all 4-byte ints in index format 1, and 8-byte ints in + ! index version 2. if (idxver .eq. 1) then + ! Read bytes to skip in file before message. call g2_gbytec(cindex, lskip, mypos, INT4_BITS) mypos = mypos + INT4_BITS lskip8 = lskip + ! Read bytes to skip in msg before local use. call g2_gbytec(cindex, skip2, mypos, INT4_BITS) skip28 = skip2 else + ! Read bytes to skip in file before message. call g2_gbytec8(cindex, lskip8, mypos, INT8_BITS) mypos = mypos + INT8_BITS + ! Read bytes to skip in msg before local use. call g2_gbytec8(cindex, skip28, mypos, INT8_BITS) + mypos = mypos + INT8_BITS endif ! Read and unpack local use section, if present. @@ -900,7 +908,7 @@ end subroutine gf_unpack7 call g2_gbytec(cindex, lskip, INT4_BITS, INT4_BITS) lskip8 = lskip else - inc = 4 + inc = 8 call g2_gbytec8(cindex, lskip8, INT4_BITS, INT8_BITS) lskip = int(lskip8, kind(4)) endif From 7afb210d8eaa6cc9fedb4f125f9b1d866cfea58e Mon Sep 17 00:00:00 2001 From: Edward Hartnett Date: Mon, 6 May 2024 09:07:07 -0600 Subject: [PATCH 11/19] more progress --- src/g2getgb2.F90 | 16 ++++++++++------ ..._gdaswave.t00z.wcoast.0p16.f000.grb2index2 | Bin 4038 -> 4114 bytes 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/g2getgb2.F90 b/src/g2getgb2.F90 index fdd01bda..6b4af9f9 100644 --- a/src/g2getgb2.F90 +++ b/src/g2getgb2.F90 @@ -1096,6 +1096,7 @@ subroutine getgb2rp2(lugb, idxver, cindex, extract, gribm, leng, iret) integer :: lencur, len0, ibmap = 0, ipos, iskip integer :: len7 = 0, len8 = 0, len3 = 0, len4 = 0, len5 = 0, len6 = 0, len1 = 0, len2 = 0 integer :: iskp2, iskp6, iskp7 + integer (kind = 8) :: iskp2_8 integer :: INT1_BITS, INT2_BITS, INT4_BITS, INT8_BITS parameter(INT1_BITS = 8, INT2_BITS = 16, INT4_BITS = 32, INT8_BITS = 64) integer :: mypos, inc = 0 @@ -1112,20 +1113,23 @@ subroutine getgb2rp2(lugb, idxver, cindex, extract, gribm, leng, iret) call g2_gbytec(cindex, iskip, mypos, INT4_BITS) ! bytes to skip in file mypos = mypos + INT4_BITS iskip8 = iskip + call g2_gbytec(cindex, iskp2, mypos, INT4_BITS) ! bytes to skip for section 2 + mypos = mypos + INT4_BITS + iskp2_8 = iskp2 else inc = 4 call g2_gbytec8(cindex, iskip8, mypos, INT8_BITS) ! bytes to skip in file mypos = mypos + INT8_BITS iskip = int(iskip8, kind(4)) + call g2_gbytec8(cindex, iskp2_8, mypos, INT8_BITS) ! bytes to skip for section 2 + mypos = mypos + INT8_BITS endif - call g2_gbytec(cindex, iskp2, mypos, INT4_BITS) ! bytes to skip for section 2 - mypos = mypos + INT4_BITS - if (iskp2 .gt. 0) then - call bareadl(lugb, iskip8 + iskp2, 4_8, lread8, ctemp) + if (iskp2_8 .gt. 0) then + call bareadl(lugb, iskip8 + iskp2_8, 4_8, lread8, ctemp) call g2_gbytec(ctemp, len2, 0, INT4_BITS) ! length of section 2 allocate(csec2(len2)) len2_8 = len2 - call bareadl(lugb, iskip8 + iskp2, len2_8, lread8, csec2) + call bareadl(lugb, iskip8 + iskp2_8, len2_8, lread8, csec2) else len2 = 0 endif @@ -1187,7 +1191,7 @@ subroutine getgb2rp2(lugb, idxver, cindex, extract, gribm, leng, iret) ipos = 44 + inc + len1 ! Copy Section 2, if necessary - if (iskp2 .gt. 0) then + if (iskp2_8 .gt. 0) then gribm(lencur + 1:lencur + len2) = csec2(1:len2) lencur = lencur + len2 endif diff --git a/tests/ref_gdaswave.t00z.wcoast.0p16.f000.grb2index2 b/tests/ref_gdaswave.t00z.wcoast.0p16.f000.grb2index2 index 1d4ffbce527c156079e92cfe18a9e268c10e1cdf..8594a1770ed130b4c6669a015bd92bf5069274c6 100644 GIT binary patch delta 369 zcmX>mKS^PNG_R?yftiAVrImrHm5Ief4JUp}QzHc^Ftk)qm{_aA3*vGyFfd#IVup#! zPIH183=G!OCazMNJcDs5OkfHpNFap?E^tX{;wt6IhRjQNAzB!DPk_vre2@7sR1c$B z6-dts7MLE!lrRm?6v|)4_)1@xlyY Vp8Fc4B!UlS2=kZeAORKrMF3`~W2yiE delta 307 zcmbQFa7=!JG_SF)k%5Atk(IH5m5Jp<4JTm>b29}fFtk)qC`wI>pIE8F%EiFIaAxAF z)0}633?Q(cHo1xMFpM{ab8-+9oOelSvJx|l$H;qP@+Sn(tZMQh7Pwr>n#q$`;k@O4 zCnvGNdB@*OHe!eKzB^22;(+m()C?wHLhu5%OkTtZmn-=@xrhtSTb47~i5t#){Bg1n j4~)mG_;m6k1TSRz Date: Mon, 6 May 2024 09:28:20 -0600 Subject: [PATCH 12/19] cache refresh --- .github/workflows/Linux_options.yml | 2 +- .github/workflows/Linux_shared.yml | 2 +- .github/workflows/Linux_versions.yml | 2 +- .github/workflows/developer.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/Linux_options.yml b/.github/workflows/Linux_options.yml index 85d78ba8..33eb692d 100644 --- a/.github/workflows/Linux_options.yml +++ b/.github/workflows/Linux_options.yml @@ -147,7 +147,7 @@ jobs: uses: actions/cache@v3 with: path: ~/data - key: data-4 + key: data-5 - name: build run: | diff --git a/.github/workflows/Linux_shared.yml b/.github/workflows/Linux_shared.yml index 8916a353..720550bb 100644 --- a/.github/workflows/Linux_shared.yml +++ b/.github/workflows/Linux_shared.yml @@ -147,7 +147,7 @@ jobs: uses: actions/cache@v3 with: path: ~/data - key: data-4 + key: data-5 - name: build run: | diff --git a/.github/workflows/Linux_versions.yml b/.github/workflows/Linux_versions.yml index 33c2f5f7..a0bf1e42 100644 --- a/.github/workflows/Linux_versions.yml +++ b/.github/workflows/Linux_versions.yml @@ -139,7 +139,7 @@ jobs: uses: actions/cache@v3 with: path: ~/data - key: data-4 + key: data-5 - name: build run: | diff --git a/.github/workflows/developer.yml b/.github/workflows/developer.yml index 2df9d26c..4df37c1d 100644 --- a/.github/workflows/developer.yml +++ b/.github/workflows/developer.yml @@ -103,7 +103,7 @@ jobs: uses: actions/cache@v4 with: path: ~/data - key: data-developer-1 + key: data-developer-2 - name: asan if: matrix.config == 'asan/code coverage' From 29b51e2848982b6d35d77802079f1eef524fbfeb Mon Sep 17 00:00:00 2001 From: Edward Hartnett Date: Mon, 6 May 2024 19:45:58 -0600 Subject: [PATCH 13/19] more fixes --- tests/test_create_index_gdas.F90 | 5 ++++- tests/test_create_index_seaice.F90 | 5 ++++- tests/test_getidx.F90 | 22 +++++++++++++++------- 3 files changed, 23 insertions(+), 9 deletions(-) diff --git a/tests/test_create_index_gdas.F90 b/tests/test_create_index_gdas.F90 index 8c42f4b6..887e805b 100644 --- a/tests/test_create_index_gdas.F90 +++ b/tests/test_create_index_gdas.F90 @@ -88,7 +88,10 @@ end subroutine g2_create_index if (idxver .eq. 1) then if (nlen .ne. 452) stop 80 else - if (nlen .ne. 460) stop 80 + if (nlen .ne. 468) then + print *, nlen + stop 80 + endif endif if (nnum .ne. 2 .or. iret .ne. 0) stop 81 diff --git a/tests/test_create_index_seaice.F90 b/tests/test_create_index_seaice.F90 index 1b7d8ba9..80694cbf 100644 --- a/tests/test_create_index_seaice.F90 +++ b/tests/test_create_index_seaice.F90 @@ -80,7 +80,10 @@ end subroutine g2_create_index if (idxver .eq. 1) then if (nlen .ne. 200) stop 80 else - if (nlen .ne. 204) stop 81 + if (nlen .ne. 208) then + print *, nlen + stop 81 + endif endif if (nnum .ne. 1 .or. iret .ne. 0) stop 83 diff --git a/tests/test_getidx.F90 b/tests/test_getidx.F90 index 5d0db320..929fd1af 100644 --- a/tests/test_getidx.F90 +++ b/tests/test_getidx.F90 @@ -21,6 +21,7 @@ program test_getidx integer :: lugb = 3 integer :: nlen, nnum, iret integer :: index_rec_len, b2s_message, b2s_lus, b2s_gds, b2s_pds, b2s_drs, b2s_bms, b2s_data + integer (kind = 8) :: b2s_lus8 integer :: total_bytes, grib_version, discipline, field_number, i, idxver integer (kind = 8) :: b2s_message8 @@ -67,7 +68,10 @@ end subroutine getidx2 if (i .eq. 1) then if (nlen .ne. 137600) stop 22 else - if (nlen .ne. 140352) stop 23 + if (nlen .ne. 143104) then + print *, nlen + stop 23 + endif endif ! Break out the index record into component values and check them for correctness. @@ -77,21 +81,25 @@ end subroutine getidx2 if (i .eq. 1) then if (index_rec_len .ne. 200) stop 30 else - if (index_rec_len .ne. 204) stop 30 + if (index_rec_len .ne. 208) stop 30 endif if (i .eq. 1) then - call g2_gbytec(cbuf, b2s_message, mypos, INT4_BITS) + call g2_gbytec(cbuf, b2s_message, mypos, INT4_BITS) ! msg length if (b2s_message .ne. 202) stop 31 mypos = mypos + INT4_BITS b2s_message8 = b2s_message + call g2_gbytec(cbuf, b2s_lus, mypos, INT4_BITS) ! skip to local + if (b2s_lus .ne. 0) stop 33 + mypos = mypos + INT4_BITS else - call g2_gbytec8(cbuf, b2s_message8, mypos, INT8_BITS) + call g2_gbytec8(cbuf, b2s_message8, mypos, INT8_BITS) ! msg length if (b2s_message8 .ne. 202) stop 32 mypos = mypos + INT8_BITS + call g2_gbytec8(cbuf, b2s_lus8, mypos, INT8_BITS) ! skip to local + if (b2s_lus8 .ne. 0) stop 33 + mypos = mypos + INT8_BITS + b2s_lus = b2s_lus8 endif - call g2_gbytec(cbuf, b2s_lus, mypos, INT4_BITS) - if (b2s_lus .ne. 0) stop 33 - mypos = mypos + INT4_BITS call g2_gbytec(cbuf, b2s_gds, mypos, INT4_BITS) if (b2s_gds .ne. 37) stop 34 mypos = mypos + INT4_BITS From 6ee789c9ac411bdaf783777c8723c52d43113975 Mon Sep 17 00:00:00 2001 From: Edward Hartnett Date: Mon, 6 May 2024 19:51:30 -0600 Subject: [PATCH 14/19] more progress --- tests/test_g1.F90 | 2 +- tests/test_getidx.F90 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_g1.F90 b/tests/test_g1.F90 index 6956d24e..4f1f03d5 100644 --- a/tests/test_g1.F90 +++ b/tests/test_g1.F90 @@ -80,7 +80,7 @@ end subroutine getidx2 b2s_message8 = b2s_message call g2_gbytec(cbuf, b2s_lus, mypos, INT4_BITS) mypos = mypos + INT4_BITS - b2s_lus = b2s_lus8 + b2s_lus8 = b2s_lus else call g2_gbytec8(cbuf, b2s_message8, mypos, INT8_BITS) if (b2s_message8 .ne. 0) stop 32 diff --git a/tests/test_getidx.F90 b/tests/test_getidx.F90 index 929fd1af..2126bdc6 100644 --- a/tests/test_getidx.F90 +++ b/tests/test_getidx.F90 @@ -98,7 +98,7 @@ end subroutine getidx2 call g2_gbytec8(cbuf, b2s_lus8, mypos, INT8_BITS) ! skip to local if (b2s_lus8 .ne. 0) stop 33 mypos = mypos + INT8_BITS - b2s_lus = b2s_lus8 + b2s_lus = int(b2s_lus8, kind(4)) endif call g2_gbytec(cbuf, b2s_gds, mypos, INT4_BITS) if (b2s_gds .ne. 37) stop 34 From 78c7ba0f5ce1ab2995a0e6a3732f15a218975cb2 Mon Sep 17 00:00:00 2001 From: Edward Hartnett Date: Mon, 6 May 2024 19:57:38 -0600 Subject: [PATCH 15/19] changed grib_utils workflow to use branch ejh_fix --- .github/workflows/grib_utils.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/grib_utils.yml b/.github/workflows/grib_utils.yml index 4a6a1621..c02e88b1 100644 --- a/.github/workflows/grib_utils.yml +++ b/.github/workflows/grib_utils.yml @@ -27,7 +27,7 @@ jobs: strategy: matrix: - grib_util-branch: [develop] + grib_util-branch: [ejh_fix] jasper-version: [2.0.33, 3.0.5, 4.0.0] steps: From c02460e862285f7f99b23ea50a85b449743b40b8 Mon Sep 17 00:00:00 2001 From: Edward Hartnett Date: Mon, 6 May 2024 20:14:59 -0600 Subject: [PATCH 16/19] fixes --- tests/test_create_index_fv3.F90 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/test_create_index_fv3.F90 b/tests/test_create_index_fv3.F90 index 00aaac71..3cb041ac 100644 --- a/tests/test_create_index_fv3.F90 +++ b/tests/test_create_index_fv3.F90 @@ -77,7 +77,10 @@ end subroutine g2_create_index ! Read the index file. call getg2i2(lugi, cbuf, myidxver, nlen, nnum, iret) print *, myidxver, nlen, nnum, iret - if (nlen .ne. 259722) stop 80 + if (nlen .ne. 264046) then + print *, nlen + stop 80 + endif if (nnum .ne. 1081 .or. iret .ne. 0) stop 81 ! Close the index file. From 56a00a33345ab3d445993186504010f6074ee824 Mon Sep 17 00:00:00 2001 From: Edward Hartnett Date: Tue, 7 May 2024 00:22:29 -0600 Subject: [PATCH 17/19] more --- src/g2getgb2.F90 | 2 +- src/g2index.F90 | 13 ++++++++----- tests/test_create_index_gdas.F90 | 2 +- tests/test_create_index_seaice.F90 | 2 +- tests/test_g1.F90 | 20 +++++++++++++------- tests/test_getidx.F90 | 16 +++++++++++----- 6 files changed, 35 insertions(+), 20 deletions(-) diff --git a/src/g2getgb2.F90 b/src/g2getgb2.F90 index 32cc5134..5b82f5b0 100644 --- a/src/g2getgb2.F90 +++ b/src/g2getgb2.F90 @@ -821,7 +821,7 @@ end subroutine gf_unpack7 call g2_gbytec(cindex, lskip, INT4_BITS, INT4_BITS) lskip8 = lskip else - inc = 8 + inc = 12 call g2_gbytec8(cindex, lskip8, INT4_BITS, INT8_BITS) lskip = int(lskip8, kind(4)) endif diff --git a/src/g2index.F90 b/src/g2index.F90 index 6dcc6f86..94d356dc 100644 --- a/src/g2index.F90 +++ b/src/g2index.F90 @@ -966,7 +966,7 @@ end subroutine gf_unpack5 else ! Add the extra 8 bytes in the version 2 index record, starting ! at byte 9. - inc = 8 + inc = 12 endif ! Search for request. @@ -1221,7 +1221,7 @@ subroutine ix2gb2(lugb, lskip8, idxver, lgrib8, cbuf, numfld, mlen, iret) character cver, cdisc character(len = 4) :: ctemp - integer (kind = 8) :: loclus8 + integer (kind = 8) :: loclus8, locgds8 integer locgds, locbms, loclus integer :: indbmp, numsec, next, newsize, g2_mova2i, mbuf, lindex integer :: linmax, ixskp @@ -1249,7 +1249,7 @@ subroutine ix2gb2(lugb, lskip8, idxver, lgrib8, cbuf, numfld, mlen, iret) else ! Add the extra 4 bytes in the version 2 index record, starting ! at byte 9. - inc = 8 + inc = 12 endif loclus = 0 @@ -1308,6 +1308,7 @@ subroutine ix2gb2(lugb, lskip8, idxver, lgrib8, cbuf, numfld, mlen, iret) return endif locgds = int(ibskip8 - lskip8, kind(4)) + locgds8 = ibskip8 - lskip8 elseif (numsec .eq. 4) then ! found pds cindex = char(0) mypos = INT4_BITS @@ -1317,14 +1318,16 @@ subroutine ix2gb2(lugb, lskip8, idxver, lgrib8, cbuf, numfld, mlen, iret) mypos = mypos + INT4_BITS call g2_sbytec(cindex, loclus, mypos, INT4_BITS) ! location of local use mypos = mypos + INT4_BITS + call g2_sbytec(cindex, locgds, mypos, INT4_BITS) ! location of gds + mypos = mypos + INT4_BITS else call g2_sbytec8(cindex, lskip8, mypos, INT8_BITS) ! bytes to skip mypos = mypos + INT8_BITS call g2_sbytec8(cindex, loclus8, mypos, INT8_BITS) ! location of local use mypos = mypos + INT8_BITS + call g2_sbytec8(cindex, locgds8, mypos, INT8_BITS) ! location of gds + mypos = mypos + INT8_BITS endif - call g2_sbytec(cindex, locgds, mypos, INT4_BITS) ! location of gds - mypos = mypos + INT4_BITS call g2_sbytec(cindex, int(ibskip8 - lskip8, kind(4)), mypos, INT4_BITS) ! location of pds mypos = mypos + INT4_BITS * 4 ! skip ahead in cbuf call g2_sbytec8(cindex, lgrib8, mypos, INT8_BITS) ! len of grib2 diff --git a/tests/test_create_index_gdas.F90 b/tests/test_create_index_gdas.F90 index 887e805b..324c2dc8 100644 --- a/tests/test_create_index_gdas.F90 +++ b/tests/test_create_index_gdas.F90 @@ -88,7 +88,7 @@ end subroutine g2_create_index if (idxver .eq. 1) then if (nlen .ne. 452) stop 80 else - if (nlen .ne. 468) then + if (nlen .ne. 476) then print *, nlen stop 80 endif diff --git a/tests/test_create_index_seaice.F90 b/tests/test_create_index_seaice.F90 index 80694cbf..ef8e0a24 100644 --- a/tests/test_create_index_seaice.F90 +++ b/tests/test_create_index_seaice.F90 @@ -80,7 +80,7 @@ end subroutine g2_create_index if (idxver .eq. 1) then if (nlen .ne. 200) stop 80 else - if (nlen .ne. 208) then + if (nlen .ne. 212) then print *, nlen stop 81 endif diff --git a/tests/test_g1.F90 b/tests/test_g1.F90 index 4f1f03d5..e5be964f 100644 --- a/tests/test_g1.F90 +++ b/tests/test_g1.F90 @@ -16,7 +16,7 @@ program test_g1 integer :: lugb = 3 integer :: nlen, nnum, iret integer :: index_rec_len, b2s_message, b2s_gds, b2s_pds, b2s_drs, b2s_bms, b2s_data, b2s_lus - integer (kind = 8) :: b2s_lus8 + integer (kind = 8) :: b2s_lus8, b2s_gds8 integer :: total_bytes, grib_version, discipline, field_number, i, idxver integer (kind = 8) :: b2s_message8 @@ -58,7 +58,7 @@ end subroutine getidx2 if (nlen .ne. 200) stop 22 else print *, nlen - if (nlen .ne. 208) stop 23 + if (nlen .ne. 212) stop 23 endif ! do j = 1, nlen ! print '(i3, x, z2.2)', j, cbuf(j) @@ -71,7 +71,10 @@ end subroutine getidx2 if (i .eq. 1) then if (index_rec_len .ne. 200) stop 30 else - if (index_rec_len .ne. 208) stop 30 + if (index_rec_len .ne. 212) then + print *, index_rec_len + stop 30 + endif endif if (i .eq. 1) then call g2_gbytec(cbuf, b2s_message, mypos, INT4_BITS) @@ -81,17 +84,20 @@ end subroutine getidx2 call g2_gbytec(cbuf, b2s_lus, mypos, INT4_BITS) mypos = mypos + INT4_BITS b2s_lus8 = b2s_lus + call g2_gbytec(cbuf, b2s_gds, mypos, INT4_BITS) + mypos = mypos + INT4_BITS + b2s_gds8 = b2s_gds else call g2_gbytec8(cbuf, b2s_message8, mypos, INT8_BITS) if (b2s_message8 .ne. 0) stop 32 mypos = mypos + INT8_BITS call g2_gbytec8(cbuf, b2s_lus8, mypos, INT8_BITS) mypos = mypos + INT8_BITS + call g2_gbytec8(cbuf, b2s_gds8, mypos, INT8_BITS) + mypos = mypos + INT8_BITS endif if (b2s_lus8 .ne. 0) stop 33 - call g2_gbytec(cbuf, b2s_gds, mypos, INT4_BITS) - if (b2s_gds .ne. 37) stop 34 - mypos = mypos + INT4_BITS + if (b2s_gds8 .ne. 37) stop 34 call g2_gbytec(cbuf, b2s_pds, mypos, INT4_BITS) if (b2s_pds .ne. 109) stop 35 mypos = mypos + INT4_BITS @@ -120,7 +126,7 @@ end subroutine getidx2 call g2_gbytec(cbuf, field_number, mypos, INT2_BITS) if (field_number .ne. 1) stop 42 print *, 'index_rec_len = ', index_rec_len, ' b2s_message8 = ', b2s_message8 - print *, 'b2s_lus8, b2s_gds, b2s_pds, b2s_drs, b2s_bms, b2s_data: ', b2s_lus8, b2s_gds, b2s_pds, b2s_drs, b2s_bms, b2s_data + print *, 'b2s_lus8, b2s_gds8, b2s_pds, b2s_drs, b2s_bms, b2s_data: ', b2s_lus8, b2s_gds8, b2s_pds, b2s_drs, b2s_bms, b2s_data print *, 'total_bytes, grib_version, discipline, field_number: ', total_bytes, grib_version, discipline, field_number ! Clean up. Call gf_finalize or else index will be found in diff --git a/tests/test_getidx.F90 b/tests/test_getidx.F90 index 2126bdc6..a65f0541 100644 --- a/tests/test_getidx.F90 +++ b/tests/test_getidx.F90 @@ -21,7 +21,7 @@ program test_getidx integer :: lugb = 3 integer :: nlen, nnum, iret integer :: index_rec_len, b2s_message, b2s_lus, b2s_gds, b2s_pds, b2s_drs, b2s_bms, b2s_data - integer (kind = 8) :: b2s_lus8 + integer (kind = 8) :: b2s_lus8, b2s_gds8 integer :: total_bytes, grib_version, discipline, field_number, i, idxver integer (kind = 8) :: b2s_message8 @@ -68,7 +68,7 @@ end subroutine getidx2 if (i .eq. 1) then if (nlen .ne. 137600) stop 22 else - if (nlen .ne. 143104) then + if (nlen .ne. 145856) then print *, nlen stop 23 endif @@ -81,7 +81,10 @@ end subroutine getidx2 if (i .eq. 1) then if (index_rec_len .ne. 200) stop 30 else - if (index_rec_len .ne. 208) stop 30 + if (index_rec_len .ne. 212) then + print *, index_rec_len + stop 30 + endif endif if (i .eq. 1) then call g2_gbytec(cbuf, b2s_message, mypos, INT4_BITS) ! msg length @@ -91,6 +94,8 @@ end subroutine getidx2 call g2_gbytec(cbuf, b2s_lus, mypos, INT4_BITS) ! skip to local if (b2s_lus .ne. 0) stop 33 mypos = mypos + INT4_BITS + call g2_gbytec(cbuf, b2s_gds, mypos, INT4_BITS) + mypos = mypos + INT4_BITS else call g2_gbytec8(cbuf, b2s_message8, mypos, INT8_BITS) ! msg length if (b2s_message8 .ne. 202) stop 32 @@ -99,10 +104,11 @@ end subroutine getidx2 if (b2s_lus8 .ne. 0) stop 33 mypos = mypos + INT8_BITS b2s_lus = int(b2s_lus8, kind(4)) + call g2_gbytec8(cbuf, b2s_gds8, mypos, INT8_BITS) + mypos = mypos + INT8_BITS + b2s_gds = int(b2s_gds8, kind(4)) endif - call g2_gbytec(cbuf, b2s_gds, mypos, INT4_BITS) if (b2s_gds .ne. 37) stop 34 - mypos = mypos + INT4_BITS call g2_gbytec(cbuf, b2s_pds, mypos, INT4_BITS) if (b2s_pds .ne. 109) stop 35 mypos = mypos + INT4_BITS From 0439f9aedb360c4502dca4dea9e4b554b9ffd748 Mon Sep 17 00:00:00 2001 From: Edward Hartnett Date: Tue, 7 May 2024 00:27:30 -0600 Subject: [PATCH 18/19] more progress --- src/g2getgb2.F90 | 2 +- tests/test_create_index_fv3.F90 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/g2getgb2.F90 b/src/g2getgb2.F90 index 5b82f5b0..9b125454 100644 --- a/src/g2getgb2.F90 +++ b/src/g2getgb2.F90 @@ -1030,7 +1030,7 @@ subroutine getgb2rp2(lugb, idxver, cindex, extract, gribm, leng, iret) mypos = mypos + INT4_BITS iskp2_8 = iskp2 else - inc = 4 + inc = 12 call g2_gbytec8(cindex, iskip8, mypos, INT8_BITS) ! bytes to skip in file mypos = mypos + INT8_BITS iskip = int(iskip8, kind(4)) diff --git a/tests/test_create_index_fv3.F90 b/tests/test_create_index_fv3.F90 index 3cb041ac..cce4b866 100644 --- a/tests/test_create_index_fv3.F90 +++ b/tests/test_create_index_fv3.F90 @@ -77,7 +77,7 @@ end subroutine g2_create_index ! Read the index file. call getg2i2(lugi, cbuf, myidxver, nlen, nnum, iret) print *, myidxver, nlen, nnum, iret - if (nlen .ne. 264046) then + if (nlen .ne. 268370) then print *, nlen stop 80 endif From 1979cfcbc471d2f54f7bf2a146bb4b6d479d8104 Mon Sep 17 00:00:00 2001 From: Edward Hartnett Date: Tue, 7 May 2024 01:07:30 -0600 Subject: [PATCH 19/19] more progress --- src/g2index.F90 | 2 +- ..._gdaswave.t00z.wcoast.0p16.f000.grb2index2 | Bin 4114 -> 4190 bytes tests/test_create_index.F90 | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/g2index.F90 b/src/g2index.F90 index 94d356dc..703cbb83 100644 --- a/src/g2index.F90 +++ b/src/g2index.F90 @@ -970,7 +970,7 @@ end subroutine gf_unpack5 endif ! Search for request. - do while(iret .ne. 0 .and. k .lt. nnum) + do while (iret .ne. 0 .and. k .lt. nnum) k = k + 1 ! Get length of current index record. call g2_gbytec(cbuf, inlen, ipos * 8, 4 * 8) diff --git a/tests/ref_gdaswave.t00z.wcoast.0p16.f000.grb2index2 b/tests/ref_gdaswave.t00z.wcoast.0p16.f000.grb2index2 index 8594a1770ed130b4c6669a015bd92bf5069274c6..e3578578089391703f7bf2ddca227de52db4269c 100644 GIT binary patch delta 361 zcmbQFa8F@^9GAI*fuWUwsg;4rL=8t469XfQiMbZ6R~Ud`;=v6fANNArdkjEV7Olu4e9Qut*&rT;vNxjUWFJ0Dz}ZasU7T delta 341 zcmcboFiBy89G97bfu)s!sg;SvL=8t4V@p$`iMbYx7bdPc&v}6X46LV3)?-$hyn=Bl zOk@ftSfqvtE^lV>!m0*m}Wh@`9mi=1JFt6BbcavdAojN@;> z@+ItW`R@*35f2WS2$PxtSVV>sE)uY1@;OeJ8B8UA!SYAA;PT6Iz#=oa;UbSef<