C+ C NAME: C FillMaptN C PURPOSE: C To fill maps at a given time with an average of the data from C the other time maps from the same longitude and latitude. C Error found in this subroutine 10/15/00 B. Jackson (improper C DMNT initalization) C CATEGORY: C Data processing C CALLING SEQUENCE: C call FillMaptN(nTTVa,XCbe,nLng,nLat,nT,CONST,DMap,DMp) C INPUTS: C nTTVa integer 0 - cycle through all values of nT C >0 - use nTTVa as the one and only value of nT to correct C XCbe real Beginning (and ending) rotation values C nLng integer # Longitude points C nLat integer # Latitude points C nT integer # DMap times C CONST real Time filter constant (in terms of the time interval) C DMap(nLng,nLat,nT) real Input map C OUTPUTS: C DMap(nLng,nLat,nT) real Output map C SCRATCH ARRAY: C DMp(nLng) real C FUNCTIONS/SUBROUTINES: C PROCEDURE: C Bad values (indicated by BadR4()) are not processed C MODIFICATION HISTORY: C MAY, 1999 B. Jackson (STEL,UCSD) C- subroutine FillMaptN(nTTVa,XCbe,nLng,nLat,nT,CONST,DMap,DMp) real DMap(nLng,nLat,nT) ! Map real XCbe(2,nT) ! Map longitude index real DMp(nLng) real dRR /.1/ real*8 XCtbeg,XCtend,XCtfull,X ! Probably not needed since XCTfull is never called C include 'MAPCOORDINATES.H' C C If no common time values are present, then average the interpolated C non-Bad time values. C Bad = BadR4() ExpPWC = 50. ConstL = nLng/(XCbe(2,1)-XCbe(1,1)) C C print *,'Into FillMaptN',ConstL,nTTVa,nT,CONST,XCbe(2,1),XCbe(1,1) NVa = 1 NTT = nT if(nTTVa.gt.0.and.nTTVa.le.nT) then NVa = nTTVa NTT = nTTVa end if do I=1,nLng do J=1,nLat do N=NVa,NTT if(DMap(I,J,N).eq.Bad) then C if(nTTVa.gt.0.and.nTTVa.le.nT) then XCbeg = XCbe(1,N) XCend = XCbe(2,N) call FillMapL(0,XCbeg,XCend,nLng,nLat,ConstL,DMap(1,1,N)) C end if C if(I.eq.1.and.J.eq.1.and.N.eq.49) print *, I,J,N,DMap(I,J,N) C if(I.eq.40.and.J.eq.9.and.N.eq.1) print *, I,J,N,DMap(I,J,N) DMNT = 0. ANDMNT = 0. do NN=1,nT if(NN.ne.N) then XCbeg = XCbe(1,NN) XCend = XCbe(2,NN) XC = XCvar(XCfull(I)) do II=1,nLng DMp(II) = DMap(II,J,NN) end do DMF = FLINT(-1,nLng,DMp,XC,0.00002) if(DMF.ne.Bad) then ExpPW = ((N-NN)/CONST)**2 Expot = 999999. if(ExpPW.gt.ExpPWC) Expot = 0. if(Expot.ne.0.) Expot = Exp(-ExpPW) DMNT = DMNT + DMF*Expot ANDMNT = ANDMNT + Expot end if C if(I.eq.40.and.J.eq.4) print *, I,J,NN,XC,DMF,DMNT,ANDMNT C if(I.eq.40.and.J.eq.4) print *, DMp end if end do if(ANDMNT.ne.0.) then DMap(I,J,N) = DMNT/ANDMNT else DMap(I,J,N) = BAD end if end if C if(I.eq.1.and.J.eq.1.and.N.eq.1) print *, I,J,N,DMap(I,J,N) C if(I.eq.40.and.J.eq.4) print *, I,J,N,DMap(I,J,N) end do end do end do C print *, 'out of fillmaptn' return end