26 subroutine gribend(cgrib, lcgrib, lengrib, ierr)
29 character(len = 1),
intent(inout) :: cgrib(lcgrib)
30 integer,
intent(in) :: lcgrib
31 integer,
intent(out) :: lengrib, ierr
34 character(len = 4),
parameter :: grib =
'GRIB', c7777 =
'7777'
35 character(len = 4):: ctemp
36 integer iofst, lencurr, len
41 ctemp = cgrib(1) // cgrib(2) // cgrib(3) // cgrib(4)
42 if (ctemp .ne. grib)
then
43 print *,
'gribend: GRIB not found in given message.'
63 if (len .eq. lencurr)
exit
67 if (len .gt. lencurr)
then
68 print *,
'gribend: Section byte counts don''t add ' &
70 print *,
'gribend: Sum of section byte counts = ', len
71 print *,
'gribend: Total byte count in Section 0 = ', &
79 if (isecnum .ne. 7)
then
80 print *,
'gribend: Section 8 can only be added after Section 7.'
81 print *,
'gribend: Section ', isecnum, &
82 ' was the last found in',
' given GRIB message.'
88 cgrib(lencurr + 1:lencurr + 4) = c7777
subroutine g2_gbytec(in, iout, iskip, nbits)
Extract arbitrary size values from a packed bit string, right justifying each value in the unpacked a...
subroutine g2_sbytec(out, in, iskip, nbits)
Put arbitrary size values into a packed bit string, taking the low order bits from each value in the ...
subroutine gribend(cgrib, lcgrib, lengrib, ierr)
Finalize a GRIB2 message after all grids and fields have been added.