1 subroutine runfit3t(nfpts, nskip, measlcl, meas, nmeas, nquant,
2 1 flag, nper, time, timdif, measout, flgout, iret )
68 #include "nav_cnst.fin"
70 integer*4 nquant, nmeas, nper
71 real*4 meas(nquant,nmeas), measout(nquant,nmeas*nper),
72 1 timdif(nmeas), measlcl(nquant,nmeas*nper)
73 integer*4 nfpts, nskip, flag(nmeas),
74 1 flgout(nmeas*nper), flglcl(maxlin), iret
75 real*8 time(nmeas*nper)
77 integer*4 ilin, iquant, line, ovrlap, ifits, nfits,
78 1 istfit, isttim, istfill, ngood,
79 1 ngood1, ngood2, nfp, nskp
81 logical lastdone, do_end, badrange
89 if (nfp.gt.nmeas) nfp = nmeas
92 print *,
' Error in setup of runfit3t: # fit points must be > 3'
99 do ilin = 1, nmeas * nper
106 nfits = ( nmeas - nfp ) / nskp + 1
113 if( ( nfits * nskp + nfp - nskp ) .lt. nmeas )
then
136 if( ifits .eq. nfits .and. do_end )
then
137 istfit = nmeas - nfp + 1
138 ovrlap = ( (nfits-1) * nskp + ( nfp - nskp ) ) - istfit
140 istfit = ( ifits - 1 ) * nskp + 1
142 isttim = ( istfit - 1 ) * nper + 1
153 do ilin = istfit, istfit + nfp - 1
155 if( flag(ilin) .eq. 0 ) ngood = ngood + 1
157 if( ilin .le. ( istfit + (nfp - 1) / 2 ) )
then
158 if( flag(ilin) .eq. 0 ) ngood1 = ngood1 + 1
160 if( flag(ilin) .eq. 0 ) ngood2 = ngood2 + 1
165 if( ( ngood .lt. 4 ) .or. ( ngood1 .lt. 2 ) .or.
168 1 ( ngood2 .lt. 2 ) ) badrange = .true.
177 call fit3t(meas(1,istfit), nfp, nquant, flag(istfit), nper,
178 1 time(isttim), timdif(istfit), measlcl, flglcl)
182 if( lastdone .and. ovrlap .gt. 0 )
then
186 fracinc = 1 / float( ovrlap * nper )
191 do ilin = 1, ovrlap * nper
192 line = ilin - 1 + isttim
193 if (flglcl(ilin).eq.0)
then
197 if (flgout(line).eq.0)
then
198 do iquant = 1, nquant
199 measout(iquant,line) = measout(iquant,line) *
200 1 ( 1 - fracinc * ilin ) +
201 1 measlcl(iquant,ilin) * fracinc * ilin
204 do iquant = 1, nquant
205 measout(iquant,line) = measlcl(iquant,ilin)
215 istfill = ovrlap * nper + 1
228 do ilin = istfill, nper * nfp
229 if (flglcl(ilin).eq.0)
then
230 line = ilin - 1 + isttim
231 do iquant = 1, nquant
232 measout(iquant,line) = measlcl(iquant,ilin)