23 subroutine specunpack(cpack,len,idrstmpl,ndpts,JJ,KK,MM,fld)
25 character(len=1),
intent(in) :: cpack(len)
26 integer,
intent(in) :: ndpts,len,JJ,KK,MM
27 integer,
intent(in) :: idrstmpl(*)
28 real,
intent(out) :: fld(ndpts)
30 integer :: ifld(ndpts),Ts
32 real :: ref,bscale,dscale,unpk(ndpts)
33 real,
allocatable :: pscale(:)
37 bscale = 2.0**real(idrstmpl(2))
38 dscale = 10.0**real(-idrstmpl(3))
45 if (idrstmpl(10).eq.1)
then
49 call g2_gbytesc(cpack,ifld,iofst,nbits,0,ndpts-ts)
53 allocate(pscale(jj+mm))
54 tscale=real(idrstmpl(5))*1e-6
56 pscale(n)=real(n*(n+1))**(-tscale)
66 if ( kk .eq. jj+mm ) nm=jj+m
68 if ( ks .eq. js+ms ) ns=js+m
70 if (n.le.ns .AND. m.le.ms)
then
72 fld(inc+1)=unpk(incu+1)
76 fld(inc)=((real(ifld(incp))*bscale)+ref)*
78 fld(inc+1)=((real(ifld(incp+1))*bscale)+ref)*
89 print *,
'specunpack: Cannot handle 64 or 128-bit floats.'