18 character cgb * 256, cgi * 256
21 integer :: lugb = 11, lugi = 12
22 integer :: ncgb, ncgb1
23 integer :: iret, ios,
ncbase, argnum = 0
28 integer,
intent(in) :: lugb, lugi, idxver
29 character*(*) :: filename
30 integer,
intent(out) :: iret
36 if (narg .ne. 2 .and. narg .ne. 3)
then
37 call errmsg(
'grb2index: Incorrect usage')
38 call errmsg(
'Usage: grb2index gribfile indexfile')
39 call errmsg(
'or: grb2index idxver gribfile indexfile')
43 call getarg(1, cidxver)
44 read(cidxver,
'(i1)') idxver
47 call getarg(argnum + 1, cgb)
48 call getarg(argnum + 2, cgi)
51 call baopenr(lugb, trim(cgb), ios)
53 print *,
'grb2index: Error accessing file ', trim(cgb)
58 call baopenw(lugi, trim(cgi), ios)
60 print *,
'grb2index: Error accessing file ', trim(cgi)
75 call baclose(lugb,iret)
76 if (iret .ne. 0) stop 9
77 call baclose(lugi,iret)
78 if (iret .ne. 0) stop 9
101 do while (k .ge. 1 .and. c(k:k) .ne.
'/')
subroutine g2_create_index(lugb, lugi, idxver, filename, iret)
Create a version 1 or 2 index file for a GRIB2 file.
program grb2index
This program creates an index file from a GRIB2 file.
integer function ncbase(c, n)
Locate basename of a file.