53 subroutine gb_info(cgrib,lcgrib,listsec0,listsec1,
54 & numfields,numlocal,maxlocal,ierr)
56 character(len=1),
intent(in) :: cgrib(lcgrib)
57 integer,
intent(in) :: lcgrib
58 integer,
intent(out) :: listsec0(3),listsec1(13)
59 integer,
intent(out) :: numlocal,numfields,maxlocal,ierr
61 character(len=4),
parameter :: grib=
'GRIB',c7777=
'7777'
62 character(len=4) :: ctemp
63 integer,
parameter :: zero=0,one=1
64 integer,
parameter :: mapsec1len=13
66 & mapsec1(mapsec1len)=(/ 2,2,1,1,1,2,1,1,1,1,1,1,1 /)
67 integer iofst,ibeg,istart
78 ctemp=cgrib(j)//cgrib(j+1)//cgrib(j+2)//cgrib(j+3)
79 if (ctemp.eq.grib )
then
85 print *,
'gb_info: Beginning characters GRIB not found.'
106 if (listsec0(2).ne.2)
then
107 print *,
'gb_info: can only decode GRIB edition 2.'
118 if (isecnum.ne.1)
then
119 print *,
'gb_info: Could not find section 1.'
130 call g2_gbytec(cgrib,listsec1(i),iofst,nbits)
140 ctemp=cgrib(ipos)//cgrib(ipos+1)//cgrib(ipos+2)//cgrib(ipos+3)
141 if (ctemp.eq.c7777 )
then
143 if (ipos.ne.(istart+lengrib))
then
144 print *,
'gb_info: "7777" found, but not where expected.'
156 if (ipos.gt.(istart+lengrib))
then
157 print *,
'gb_info: "7777" not found at end of GRIB message.'
161 if ( isecnum.ge.2.AND.isecnum.le.7 )
then
162 if (isecnum.eq.2)
then
166 if ( lenposs.gt.maxlocal ) maxlocal=lenposs
167 elseif (isecnum.eq.4)
then
169 numfields=numfields+1
172 print *,
'gb_info: Invalid section number found in GRIB',
173 &
' message: ',isecnum