22 subroutine specunpack(cpack,len,idrstmpl,ndpts,JJ,KK,MM,fld)
24 character(len=1),
intent(in) :: cpack(len)
25 integer,
intent(in) :: ndpts,len,JJ,KK,MM
26 integer,
intent(in) :: idrstmpl(*)
27 real,
intent(out) :: fld(ndpts)
29 integer :: ifld(ndpts),Ts
31 real :: ref,bscale,dscale,unpk(ndpts)
32 real,
allocatable :: pscale(:)
36 bscale = 2.0**real(idrstmpl(2))
37 dscale = 10.0**real(-idrstmpl(3))
44 if (idrstmpl(10).eq.1)
then
47 call g2_gbytesc(cpack,ifld,iofst,nbits,0,ndpts-ts)
50 allocate(pscale(jj+mm))
51 tscale=real(idrstmpl(5))*1e-6
53 pscale(n)=real(n*(n+1))**(-tscale)
62 if (kk .eq. jj+mm) nm=jj+m
64 if (ks .eq. js+ms) ns=js+m
66 if (n.le.ns .AND. m.le.ms)
then
68 fld(inc+1)=unpk(incu+1)
72 fld(inc)=((real(ifld(incp))*bscale)+ref)*dscale*pscale(n)
73 fld(inc+1)=((real(ifld(incp+1))*bscale)+ref)*dscale*pscale(n)
81 print *,
'specunpack: Cannot handle 64 or 128-bit floats.'
subroutine g2_gbytesc(in, iout, iskip, nbits, nskip, n)
Extract arbitrary size values from a packed bit string, right justifying each value in the unpacked a...
subroutine rdieee(rieee, a, num)
Copy array of 32-bit IEEE floating point values to local floating point representation.
subroutine specunpack(cpack, len, idrstmpl, ndpts, JJ, KK, MM, fld)
This subroutine unpacks a spectral data field that was packed using the complex packing algorithm for...