41 subroutine gf_unpack4(cgrib,lcgrib,iofst,ipdsnum,ipdstmpl,
42 & mappdslen,coordlist,numcoord,ierr)
47 character(len=1),
intent(in) :: cgrib(lcgrib)
48 integer,
intent(in) :: lcgrib
49 integer,
intent(inout) :: iofst
50 real,
pointer,
dimension(:) :: coordlist
51 integer,
pointer,
dimension(:) :: ipdstmpl
52 integer,
intent(out) :: ipdsnum
53 integer,
intent(out) :: ierr,numcoord
55 real(4),
allocatable :: coordieee(:)
56 integer,
allocatable :: mappds(:)
61 nullify(ipdstmpl,coordlist)
66 allocate(mappds(lensec))
76 if(
allocated(mappds) )
deallocate(mappds)
85 if (mappdslen.gt.0)
allocate(ipdstmpl(mappdslen),stat=istat)
89 if(
allocated(mappds) )
deallocate(mappds)
93 nbits=iabs(mappds(i))*8
94 if ( mappds(i).ge.0 )
then
95 call g2_gbytec(cgrib,ipdstmpl(i),iofst,nbits)
98 call g2_gbytec(cgrib,ipdstmpl(i),iofst+1,nbits-1)
99 if (isign.eq.1) ipdstmpl(i)=-ipdstmpl(i)
112 call realloc(ipdstmpl,mappdslen,newmappdslen,istat)
114 do i=mappdslen+1,newmappdslen
115 nbits=iabs(mappds(i))*8
116 if ( mappds(i).ge.0 )
then
117 call g2_gbytec(cgrib,ipdstmpl(i),iofst,nbits)
120 call g2_gbytec(cgrib,ipdstmpl(i),iofst+1,nbits-1)
121 if (isign.eq.1) ipdstmpl(i)=-ipdstmpl(i)
125 mappdslen=newmappdslen
127 if(
allocated(mappds) )
deallocate(mappds)
133 if ( numcoord .ne. 0 )
then
134 allocate (coordieee(numcoord),stat=istat1)
135 allocate(coordlist(numcoord),stat=istat)
136 if ((istat1+istat).ne.0)
then
139 if(
allocated(coordieee) )
deallocate(coordieee)
142 call g2_gbytesc(cgrib,coordieee,iofst,32,0,numcoord)
143 call rdieee(coordieee,coordlist,numcoord)
144 deallocate (coordieee)
145 iofst=iofst+(32*numcoord)