22 subroutine specpack(fld,ndpts,JJ,KK,MM,idrstmpl,cpack,lcpack)
24 real,
intent(in) :: fld(ndpts)
25 integer,
intent(in) :: ndpts,JJ,KK,MM
26 integer,
intent(inout) :: idrstmpl(*)
27 character(len=1),
intent(out) :: cpack(*)
28 integer,
intent(out) :: lcpack
30 integer :: ifld(ndpts),Ts,tmplsim(5)
31 real :: bscale,dscale,unpk(ndpts),tfld(ndpts)
32 real,
allocatable :: pscale(:)
34 bscale = 2.0**real(-idrstmpl(2))
35 dscale = 10.0**real(idrstmpl(3))
45 allocate(pscale(jj+mm))
46 tscale=real(idrstmpl(5))*1e-6
48 pscale(n)=real(n*(n+1))**(tscale)
60 if ( kk .eq. jj+mm ) nm=jj+m
62 if ( ks .eq. js+ms ) ns=js+m
64 if (n.le.ns .AND. m.le.ms)
then
66 unpk(incu+1)=fld(inc+1)
71 tfld(incp)=fld(inc)*pscale(n)
72 tfld(incp+1)=fld(inc+1)*pscale(n)
82 if (incu .ne. ts)
then
83 print *,
'specpack: Incorrect number of unpacked values ',
85 print *,
'specpack: Resetting idrstmpl(9) to ',incu
96 tmplsim(2)=idrstmpl(2)
97 tmplsim(3)=idrstmpl(3)
98 tmplsim(4)=idrstmpl(4)
99 call simpack(tfld,ndpts-ts,tmplsim,cpack(ipos+1),lcpack)
104 idrstmpl(1)=tmplsim(1)
105 idrstmpl(2)=tmplsim(2)
106 idrstmpl(3)=tmplsim(3)
107 idrstmpl(4)=tmplsim(4)