23 integer,
intent(in) :: lugb, lugi, idxver
24 character*(*) :: filename
25 integer,
intent(out) :: iret
27 integer (kind = 8) :: msk1, msk2
28 parameter(msk1 = 32000_8, msk2 = 4000_8)
29 character(len=1),
pointer,
dimension(:) :: cbuf
30 integer :: numtot, nnum, nlen, mnum, kw
31 integer :: irgi, iw, nmess
34 subroutine getg2i2r(lugb, msk1, msk2, mnum, idxver, cbuf, &
35 nlen, nnum, nmess, iret)
36 integer,
intent(in) :: lugb
37 integer (kind = 8),
intent(in) :: msk1, msk2
38 integer,
intent(in) :: mnum, idxver
39 character(len = 1),
pointer,
dimension(:) :: cbuf
40 integer,
intent(out) :: nlen, nnum, nmess, iret
52 call getg2i2r(lugb, msk1, msk2, mnum, idxver, cbuf, &
53 nlen, nnum, nmess, irgi)
54 if (irgi .gt. 1 .or. nnum .eq. 0 .or. nlen .eq. 0)
then
56 if (
associated(cbuf))
then
62 numtot = numtot + nnum
70 call bawrite(lugi, iw, nlen, kw, cbuf)
75 do while (irgi .eq. 1 .and. nnum .gt. 0)
76 if (
associated(cbuf))
then
80 call getg2i2r(11, msk1, msk2, mnum, idxver, cbuf, &
81 nlen, nnum, nmess, irgi)
82 if (irgi .le. 1 .and. nnum .gt. 0)
then
83 numtot = numtot + nnum
85 call bawrite(lugi, iw, nlen, kw, cbuf)
269subroutine getidx2(lugb, lugi, idxver, cindex, nlen, nnum, iret)
273 integer,
intent(in) :: lugb, lugi
274 integer,
intent(inout) :: idxver
275 character(len = 1),
pointer,
dimension(:) :: cindex
276 integer,
intent(out) :: nlen, nnum, iret
278 integer,
parameter :: maxidx = 10000
279 integer (kind = 8),
parameter :: msk1 = 32000_8, msk2 = 4000_8
281 integer :: irgi, mskp, nmess, i
287 character(len = 1),
pointer,
dimension(:) :: cbuf
290 type(gindex),
save :: idxlist(10000)
296 subroutine getg2i2(lugi, cbuf, idxver, nlen, nnum, iret)
297 integer,
intent(in) :: lugi
298 character(len=1),
pointer,
dimension(:) :: cbuf
299 integer,
intent(out) :: idxver, nlen, nnum, iret
301 subroutine getg2i2r(lugb, msk1, msk2, mnum, idxver, cbuf, &
302 nlen, nnum, nmess, iret)
303 integer,
intent(in) :: lugb
304 integer (kind = 8),
intent(in) :: msk1, msk2
305 integer,
intent(in) :: mnum, idxver
306 character(len = 1),
pointer,
dimension(:) :: cbuf
307 integer,
intent(out) :: nlen, nnum, nmess, iret
313 write(
g2_log_msg,
'(a, i2, a, i2, a, i1)')
'getidx2: lugb ', lugb,
' lugi ', lugi, &
319 if (lugb .eq. 0)
then
322 if (
associated(idxlist(i)%cbuf))
then
324 deallocate(idxlist(i)%cbuf)
325 nullify(idxlist(i)%cbuf)
335 if (lugb .le. 0 .or. lugb .gt. 9999)
then
336 print *,
' file unit number out of range'
337 print *,
' use unit numbers in range: 0 - 9999 '
343 if (lugi .eq. lugb)
then
344 if (
associated(idxlist(lugb)%cbuf)) &
345 deallocate(idxlist(lugb)%cbuf)
347 nullify(idxlist(lugb)%cbuf)
348 idxlist(lugb)%nlen = 0
349 idxlist(lugb)%nnum = 0
354 if (lugi .lt. 0)
then
356 if (
associated(idxlist(lugb)%cbuf)) &
357 deallocate(idxlist(lugb)%cbuf)
359 nullify(idxlist(lugb)%cbuf)
360 idxlist(lugb)%nlen = 0
361 idxlist(lugb)%nnum = 0
366 if (
associated(idxlist(lugb)%cbuf))
then
368 cindex => idxlist(lugb)%cbuf
369 nlen = idxlist(lugb)%nlen
370 nnum = idxlist(lugb)%nnum
371 idxver = idxlist(lugb)%idxver
380 call getg2i2(lux, idxlist(lugb)%cbuf, idxver, nlen, nnum, irgi)
381 elseif (lux .le. 0)
then
383 call getg2i2r(lugb, msk1, msk2, mskp, idxver, idxlist(lugb)%cbuf, &
384 nlen, nnum, nmess, irgi)
388 if (irgi .ne. 0)
then
391 print *,
' error reading index file '
397 cindex => idxlist(lugb)%cbuf
398 idxlist(lugb)%nlen = nlen
399 idxlist(lugb)%nnum = nnum
400 idxlist(lugb)%idxver = idxver
652subroutine getg2i2r(lugb, msk1, msk2, mnum, idxver, cbuf, nlen, nnum, nmess, iret)
657 integer,
intent(in) :: lugb
658 integer (kind = 8),
intent(in) :: msk1, msk2
659 integer,
intent(in) :: mnum, idxver
660 character(len = 1),
pointer,
dimension(:) :: cbuf
661 integer,
intent(out) :: nlen, nnum, nmess, iret
663 character(len = 1),
pointer,
dimension(:) :: cbuftmp
664 integer :: nbytes, newsize, next, numfld, m, mbuf
665 integer (kind = 8) :: iseek, lskip, lgrib
666 integer :: istat, init, iret1, lgrib4
667 parameter(init = 50000, next = 10000)
670 subroutine ix2gb2(lugb, lskip8, idxver, lgrib8, cbuf, numfld, mlen, iret)
671 integer,
intent(in) :: lugb
672 integer (kind = 8),
intent(in) :: lskip8
673 integer,
intent(in) :: idxver
674 integer (kind = 8),
intent(in) :: lgrib8
675 character(len = 1),
pointer,
intent(inout),
dimension(:) :: cbuf
676 integer,
intent(out) :: numfld, mlen, iret
682 write(
g2_log_msg, *)
'getg2i2r: lugb ', lugb,
' msk1 ', msk1,
' msk2 ', msk2,
'idxver', idxver
690 allocate(cbuf(mbuf), stat = istat)
691 if (istat .ne. 0)
then
698 call skgb8(lugb, iseek, msk1, lskip, lgrib)
700 if (lgrib .gt. 0)
then
701 iseek = lskip + lgrib
702 call skgb8(lugb, iseek, msk2, lskip, lgrib)
710 do while (iret .eq. 0 .and. lgrib .gt. 0)
711 lgrib4 = int(lgrib, kind(4))
712 call ix2gb2(lugb, lskip, idxver, lgrib, cbuftmp, numfld, nbytes, iret1)
713 if (iret1 .ne. 0) print *,
' SAGT ', numfld, nbytes, iret1
714 if (nbytes + nlen .gt. mbuf)
then
715 newsize = max(mbuf + next, mbuf + nbytes)
716 call realloc(cbuf, nlen, newsize, istat)
717 if (istat .ne. 0)
then
726 if (
associated(cbuftmp))
then
727 cbuf(nlen + 1 : nlen + nbytes) = cbuftmp(1 : nbytes)
728 deallocate(cbuftmp, stat = istat)
729 if (istat .ne. 0)
then
730 print *,
' deallocating cbuftmp ... ', istat
741 iseek = lskip + lgrib
742 call skgb8(lugb, iseek, msk2, lskip, lgrib)
818subroutine getgb2s(cbuf, nlen, nnum, j, jdisc, jids, jpdtn, jpdt, jgdtn, &
819 jgdt, k, gfld, lpos, iret)
823 character(len = 1),
intent(in) :: cbuf(nlen)
824 integer,
intent(in) :: nlen, nnum, j, jdisc
825 integer,
dimension(:) :: jids(*)
826 integer,
intent(in) :: jpdtn
827 integer,
dimension(:) :: jpdt(*)
828 integer,
intent(in) :: jgdtn
829 integer,
dimension(:) :: jgdt(*)
830 integer,
intent(out) :: k
832 integer,
intent(out) :: lpos, iret
835 subroutine getgb2s2(cbuf, idxver, nlen, nnum, j, jdisc, jids, jpdtn, jpdt, jgdtn, &
836 jgdt, k, gfld, lpos, iret)
838 character(len = 1),
intent(in) :: cbuf(nlen)
839 integer,
intent(in) :: idxver, nlen, nnum, j, jdisc
840 integer,
dimension(:) :: jids(*)
841 integer,
intent(in) :: jpdtn
842 integer,
dimension(:) :: jpdt(*)
843 integer,
intent(in) :: jgdtn
844 integer,
dimension(:) :: jgdt(*)
845 integer,
intent(out) :: k
847 integer,
intent(out) :: lpos, iret
853 call getgb2s2(cbuf, 1, nlen, nnum, j, jdisc, jids, jpdtn, jpdt, jgdtn, &
854 jgdt, k, gfld, lpos, iret)
931subroutine getgb2s2(cbuf, idxver, nlen, nnum, j, jdisc, jids, jpdtn, jpdt, jgdtn, &
932 jgdt, k, gfld, lpos, iret)
937 character(len = 1),
intent(in) :: cbuf(nlen)
938 integer,
intent(in) :: idxver, nlen, nnum, j, jdisc
939 integer,
dimension(:) :: jids(*)
940 integer,
intent(in) :: jpdtn
941 integer,
dimension(:) :: jpdt(*)
942 integer,
intent(in) :: jgdtn
943 integer,
dimension(:) :: jgdt(*)
944 integer,
intent(out) :: k
946 integer,
intent(out) :: lpos, iret
949 logical :: match1, match3, match4
950 integer :: i, icnd, inlen, iof, ipos, jpos, lsec1, lsec3, lsec4, lsec5, numgdt, numpdt, inc
953 subroutine g2_gbytec1(in, siout, iskip, nbits)
954 character*1,
intent(in) :: in(*)
955 integer,
intent(inout) :: siout
956 integer,
intent(in) :: iskip, nbits
958 subroutine gf_unpack1(cgrib, lcgrib, iofst, ids, idslen, ierr)
959 character(len = 1),
intent(in) :: cgrib(lcgrib)
960 integer,
intent(in) :: lcgrib
961 integer,
intent(inout) :: iofst
962 integer,
pointer,
dimension(:) :: ids
963 integer,
intent(out) :: ierr, idslen
965 subroutine gf_unpack3(cgrib, lcgrib, iofst, igds, igdstmpl, &
966 mapgridlen, ideflist, idefnum, ierr)
967 character(len = 1),
intent(in) :: cgrib(lcgrib)
968 integer,
intent(in) :: lcgrib
969 integer,
intent(inout) :: iofst
970 integer,
pointer,
dimension(:) :: igdstmpl, ideflist
971 integer,
intent(out) :: igds(5)
972 integer,
intent(out) :: ierr, idefnum
974 subroutine gf_unpack4(cgrib, lcgrib, iofst, ipdsnum, ipdstmpl, &
975 mappdslen, coordlist, numcoord, ierr)
976 character(len = 1),
intent(in) :: cgrib(lcgrib)
977 integer,
intent(in) :: lcgrib
978 integer,
intent(inout) :: iofst
979 real,
pointer,
dimension(:) :: coordlist
980 integer,
pointer,
dimension(:) :: ipdstmpl
981 integer,
intent(out) :: ipdsnum
982 integer,
intent(out) :: ierr, numcoord
984 subroutine gf_unpack5(cgrib, lcgrib, iofst, ndpts, idrsnum, &
985 idrstmpl, mapdrslen, ierr)
986 character(len = 1),
intent(in) :: cgrib(lcgrib)
987 integer,
intent(in) :: lcgrib
988 integer,
intent(inout) :: iofst
989 integer,
intent(out) :: ndpts, idrsnum
990 integer,
pointer,
dimension(:) :: idrstmpl
991 integer,
intent(out) :: ierr
997 write(
g2_log_msg, *)
'getgb2s2: idxver ', idxver,
' nlen ', nlen, &
998 ' nnum ', nnum,
' j ', j,
' jdisc ', jdisc
1007 nullify(gfld%idsect, gfld%local)
1008 nullify(gfld%list_opt, gfld%igdtmpl, gfld%ipdtmpl)
1009 nullify(gfld%coord_list, gfld%idrtmpl, gfld%bmap, gfld%fld)
1010 if (idxver .eq. 1)
then
1019 do while (iret .ne. 0 .and. k .lt. nnum)
1022 call g2_gbytec1(cbuf, inlen, ipos * 8, 4 * 8)
1029 call g2_gbytec1(cbuf, gfld%discipline, (ipos + inc + 41) * 8, 1 * 8)
1030 if (jdisc .ne. -1 .and. jdisc .ne. gfld%discipline)
then
1038 call g2_gbytec1(cbuf, lsec1, (ipos + inc + 44) * 8, 4 * 8)
1040 call gf_unpack1(cbuf(ipos + inc + 45), lsec1, iof, gfld%idsect, gfld%idsectlen, icnd)
1041 if (icnd .eq. 0)
then
1043 do i = 1, gfld%idsectlen
1044 if (jids(i) .ne. -9999 .and. jids(i) .ne. gfld%idsect(i))
then
1050 if (.not. match1)
then
1051 deallocate(gfld%idsect)
1057 jpos = ipos + 44 + inc + lsec1
1059 call g2_gbytec1(cbuf, lsec3, jpos * 8, 4 * 8)
1060 if (jgdtn .eq. -1)
then
1063 call g2_gbytec1(cbuf, numgdt, (jpos + 12) * 8, 2 * 8)
1064 if (jgdtn .eq. numgdt)
then
1066 call gf_unpack3(cbuf(jpos + 1), lsec3, iof, kgds, gfld%igdtmpl, &
1067 gfld%igdtlen, gfld%list_opt, gfld%num_opt, icnd)
1068 if (icnd .eq. 0)
then
1070 do i = 1, gfld%igdtlen
1071 if (jgdt(i) .ne. -9999 .and. jgdt(i).ne.gfld%igdtmpl(i))
then
1079 if (.not. match3)
then
1080 if (
associated(gfld%idsect))
deallocate(gfld%idsect)
1081 if (
associated(gfld%igdtmpl))
deallocate(gfld%igdtmpl)
1082 if (
associated(gfld%list_opt))
deallocate(gfld%list_opt)
1086 gfld%griddef = kgds(1)
1087 gfld%ngrdpts = kgds(2)
1088 gfld%numoct_opt = kgds(3)
1089 gfld%interp_opt = kgds(4)
1090 gfld%igdtnum = kgds(5)
1098 call g2_gbytec1(cbuf, lsec4, jpos * 8, 4 * 8)
1099 if (jpdtn .eq. -1)
then
1103 call g2_gbytec1(cbuf, numpdt, (jpos + 7) * 8, 2 * 8)
1104 if (jpdtn .eq. numpdt)
then
1106 call gf_unpack4(cbuf(jpos + 1), lsec4, iof, gfld%ipdtnum, &
1107 gfld%ipdtmpl, gfld%ipdtlen, gfld%coord_list, gfld%num_coord, icnd)
1108 if (icnd .eq. 0)
then
1110 do i = 1, gfld%ipdtlen
1111 if (jpdt(i) .ne. -9999 .and. jpdt(i) .ne. gfld%ipdtmpl(i))
then
1119 if (.not. match4)
then
1120 if (
associated(gfld%idsect))
deallocate(gfld%idsect)
1121 if (
associated(gfld%ipdtmpl))
deallocate(gfld%ipdtmpl)
1122 if (
associated(gfld%coord_list))
deallocate(gfld%coord_list)
1126 if (match1 .and. match3 .and. match4)
then
1128 call g2_gbytec1(cbuf, gfld%version, (ipos + inc + 40) * 8, 1 * 8)
1129 call g2_gbytec1(cbuf, gfld%ifldnum, (ipos + inc + 42) * 8, 2 * 8)
1130 gfld%unpacked = .false.
1131 jpos = ipos + 44 + inc + lsec1
1132 if (jgdtn .eq. -1)
then
1134 call gf_unpack3(cbuf(jpos + 1), lsec3, iof, kgds, gfld%igdtmpl, &
1135 gfld%igdtlen, gfld%list_opt, gfld%num_opt, icnd)
1136 gfld%griddef = kgds(1)
1137 gfld%ngrdpts = kgds(2)
1138 gfld%numoct_opt = kgds(3)
1139 gfld%interp_opt = kgds(4)
1140 gfld%igdtnum = kgds(5)
1143 if (jpdtn .eq. -1)
then
1145 call gf_unpack4(cbuf(jpos + 1), lsec4, iof, gfld%ipdtnum, &
1146 gfld%ipdtmpl, gfld%ipdtlen, gfld%coord_list, gfld%num_coord, icnd)
1149 call g2_gbytec1(cbuf, lsec5, jpos * 8, 4 * 8)
1151 call gf_unpack5(cbuf(jpos + 1), lsec5, iof, gfld%ndpts, &
1152 gfld%idrtnum, gfld%idrtmpl, gfld%idrtlen, icnd)
1154 call g2_gbytec1(cbuf, gfld%ibmap, (jpos + 5) * 8, 1 * 8)
1259subroutine ix2gb2(lugb, lskip8, idxver, lgrib8, cbuf, numfld, mlen, iret)
1265 integer,
intent(in) :: lugb
1266 integer (kind = 8),
intent(in) :: lskip8
1267 integer,
intent(in) :: idxver
1268 integer (kind = 8),
intent(in) :: lgrib8
1269 character(len = 1),
pointer,
intent(inout),
dimension(:) :: cbuf
1270 integer,
intent(out) :: numfld, mlen, iret
1272 character cver, cdisc
1273 character(len = 4) :: ctemp
1274 integer (kind = 8) :: loclus8, locgds8, locbms8
1276 integer :: indbmp, numsec, newsize, g2_mova2i, mbuf, lindex
1278 integer :: ilndrs, ilnpds, istat
1279 integer (kind = 8) :: ibread8, lbread8, ibskip8, lengds8
1280 integer (kind = 8) :: ilnpds8, ilndrs8
1281 integer :: lensec, lensec1
1282 integer :: mypos, inc
1287 parameter(linmax = 5000)
1290 parameter(init = 50000)
1293 parameter(next = 10000)
1296 parameter(mxbms = 6)
1297 integer :: IXDS1, IXDS2
1298 parameter(ixds1 = 28, ixds2 = 52)
1301 parameter(ixids = 44)
1303 parameter(ixsdr = 20)
1305 integer :: IXBMS1, IXBMS2
1306 parameter(ixbms1 = 24, ixbms2 = 44)
1308 integer :: INT1_BITS, INT2_BITS, INT4_BITS, INT8_BITS
1309 parameter(int1_bits = 8, int2_bits = 16, int4_bits = 32, int8_bits = 64)
1311 integer :: IXDRS1, IXDRS2
1312 parameter(ixdrs1 = 20, ixdrs2 = 36)
1315 character cbread(LINMAX), cindex(LINMAX)
1316 character cids(LINMAX), cgds(LINMAX)
1319 subroutine g2_gbytec1(in, siout, iskip, nbits)
1320 character*1,
intent(in) :: in(*)
1321 integer,
intent(inout) :: siout
1322 integer,
intent(in) :: iskip, nbits
1325 character*1,
intent(inout) :: out(*)
1326 integer (kind = 8),
intent(in) :: sin
1327 integer,
intent(in) :: iskip, nbits
1330 character*1,
intent(inout) :: out(*)
1331 integer,
intent(in) :: in
1332 integer,
intent(in) :: iskip, nbits
1338 write(
g2_log_msg, *)
'ix2gb2: lugb ', lugb,
' lskip8 ', lskip8,
' idxver ', idxver
1344 if (idxver .eq. 1)
then
1364 allocate(cbuf(mbuf), stat = istat)
1365 if (istat .ne. 0)
then
1372 ibread8 = min(lgrib8, linmax)
1373 call bareadl(lugb, lskip8, ibread8, lbread8, cbread)
1374 if (lbread8 .ne. ibread8)
then
1380 if (cbread(8) .ne. char(2))
then
1390 call g2_gbytec1(cbread, lensec1, 16 * int1_bits, int4_bits)
1391 lensec1 = min(lensec1, int(ibread8, kind(lensec1)))
1394 cids(1:lensec1) = cbread(17:16 + lensec1)
1400 ibskip8 = lskip8 + 16_8 + int(lensec1, kind(8))
1404 ibread8 = max(5, mxbms)
1408 call bareadl(lugb, ibskip8, ibread8, lbread8, cbread)
1412 ctemp = cbread(1)//cbread(2)//cbread(3)//cbread(4)
1413 if (ctemp .eq.
'7777')
return
1416 if (lbread8 .ne. ibread8)
then
1423 call g2_gbytec1(cbread, lensec, 0, int4_bits)
1424 call g2_gbytec1(cbread, numsec, int4_bits, int1_bits)
1428 if (numsec .eq. 2)
then
1430 loclus8 = ibskip8 - lskip8
1431 elseif (numsec .eq. 3)
then
1436 call bareadl(lugb, ibskip8, lengds8, lbread8, cgds)
1437 if (lbread8 .ne. lengds8)
then
1442 locgds8 = ibskip8 - lskip8
1443 elseif (numsec .eq. 4)
then
1456 if (idxver .eq. 1)
then
1458 lskip = int(lskip8, kind(4))
1459 call g2_sbytec1(cindex, lskip, mypos, int4_bits)
1460 mypos = mypos + int4_bits
1461 call g2_sbytec1(cindex, int(loclus8, kind(4)), mypos, int4_bits)
1462 mypos = mypos + int4_bits
1463 call g2_sbytec1(cindex, int(locgds8, kind(4)), mypos, int4_bits)
1464 mypos = mypos + int4_bits
1465 call g2_sbytec1(cindex, int(ibskip8 - lskip8, kind(4)), mypos, int4_bits)
1467 write(
g2_log_msg, *)
' writing pds location to index: mypos/8 ', mypos/8, &
1468 ' loc ', int(ibskip8 - lskip8, kind(4))
1471 mypos = mypos + int4_bits * 4
1474 call g2_sbytec81(cindex, lskip8, mypos, int8_bits)
1475 mypos = mypos + int8_bits
1476 call g2_sbytec81(cindex, loclus8, mypos, int8_bits)
1477 mypos = mypos + int8_bits
1478 call g2_sbytec81(cindex, locgds8, mypos, int8_bits)
1479 mypos = mypos + int8_bits
1480 call g2_sbytec81(cindex, ibskip8 - lskip8, mypos, int8_bits)
1481 mypos = mypos + int8_bits * 4
1485 write(
g2_log_msg, *)
' writing total len to index: mypos/8 ', mypos/8, lgrib8
1490 call g2_sbytec81(cindex, lgrib8, mypos, int8_bits)
1491 mypos = mypos + int8_bits
1492 cindex((mypos / 8) + 1) = cver
1493 mypos = mypos + int1_bits
1494 cindex((mypos / 8) + 1) = cdisc
1495 mypos = mypos + int1_bits
1496 call g2_sbytec1(cindex, numfld + 1, mypos, int2_bits)
1497 mypos = mypos + int2_bits
1500 cindex(ixids + 1 + inc:ixids + lensec1 + inc) = cids(1:lensec1)
1501 lindex = ixids + lensec1 + inc
1504 cindex(lindex + 1:lindex + lengds8) = cgds(1:lengds8)
1505 lindex = lindex + int(lengds8, kind(lindex))
1510 call bareadl(lugb, ibskip8, ilnpds8, lbread8, cindex(lindex + 1))
1511 if (lbread8 .ne. ilnpds8)
then
1515 lindex = lindex + ilnpds
1516 mypos = mypos + ilnpds
1518 write(
g2_log_msg, *)
' after writing pds location to index: mypos/8 ', mypos/8
1521 elseif (numsec .eq. 5)
then
1525 write(
g2_log_msg, *)
' before writing drs to index: ibskip8 - lskip8 ', ibskip8 - lskip8, ixdrs2
1529 if (idxver .eq. 1)
then
1530 call g2_sbytec1(cindex, int(ibskip8 - lskip8, kind(4)), ixdrs1 * int1_bits, int4_bits)
1532 call g2_sbytec81(cindex, ibskip8 - lskip8, ixdrs2 * int1_bits, int8_bits)
1538 call bareadl(lugb, ibskip8, ilndrs8, lbread8, cindex(lindex + 1))
1539 if (lbread8 .ne. ilndrs8)
then
1543 lindex = lindex + ilndrs
1544 elseif (numsec .eq. 6)
then
1547 indbmp = g2_mova2i(cbread(6))
1549 write(
g2_log_msg, *)
' section 6: indbmp', indbmp
1553 if (indbmp .lt. 254)
then
1554 if (idxver .eq. 1)
then
1555 locbms = int(ibskip8 - lskip8, kind(4))
1556 call g2_sbytec1(cindex, locbms, ixbms1 * int1_bits, int4_bits)
1558 locbms8 = ibskip8 - lskip8
1559 call g2_sbytec81(cindex, locbms8, ixbms2 * int1_bits, int8_bits)
1562 write(
g2_log_msg, *)
' section 6: locbms', locbms,
'locbms8', locbms8
1565 elseif (indbmp .eq. 254)
then
1566 if (idxver .eq. 1)
then
1567 call g2_sbytec1(cindex, locbms, ixbms1 * int1_bits, int4_bits)
1569 call g2_sbytec81(cindex, locbms8, ixbms2 * int1_bits, int8_bits)
1571 elseif (indbmp .eq. 255)
then
1572 if (idxver .eq. 1)
then
1573 call g2_sbytec1(cindex, int(ibskip8 - lskip8, kind(4)), ixbms1 * int1_bits, int4_bits)
1575 call g2_sbytec81(cindex, ibskip8 - lskip8, ixbms2 * int1_bits, int8_bits)
1580 cindex(lindex + 1:lindex + mxbms) = cbread(1:mxbms)
1581 lindex = lindex + mxbms
1585 call g2_sbytec1(cindex, lindex, 0, int4_bits)
1586 elseif (numsec .eq. 7)
then
1589 write(
g2_log_msg, *)
' writing offset to the data in cindex: ibskip8 - lskip8 ', ibskip8 - lskip8, &
1594 if (idxver .eq. 1)
then
1595 call g2_sbytec1(cindex, int(ibskip8 - lskip8, kind(4)), ixds1 * int1_bits, int4_bits)
1597 call g2_sbytec81(cindex, ibskip8 - lskip8, ixds2 * int1_bits, int8_bits)
1605 if (lindex + mlen .gt. mbuf)
then
1606 newsize = max(mbuf + next, mbuf + lindex)
1607 call realloc(cbuf, mlen, newsize, istat)
1608 if (istat .ne. 0)
then
1617 cbuf(mlen + 1:mlen + lindex) = cindex(1:lindex)
1618 mlen = mlen + lindex
1626 ibskip8 = ibskip8 + lensec