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 NOT USED (pph) C CALLS: 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 /0.1/ double precision XCtbeg,XCtend,XCtfull,X include 'mapcoordinates.h' C If no common time values are present, then average the interpolated C non-Bad time values. Bad = BadR4() ExpPWC = 50.0 ConstL = nLng/(XCbe(2,1)-XCbe(1,1)) ! Loop over all times unless nTTVa is set to a valid time index NVa = 1 NTT = nT if (1 .le. nTTVa .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 !if (1 .le. nTTVa .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)) !end if !if(I.eq.1.and.J.eq.1.and.N.eq.1) print *, I,J,N,DMap(I,J,N) !if(I.eq.40.and.J.eq.9.and.N.eq.1) print *, I,J,N,DMap(I,J,N) DMNT = 0.0 ANDMNT = 0.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) DMF = FLINT(-1,nLng,DMap(1,J,NN),XC,0.00002) if (DMF .ne. Bad) then ExpPW = ((N-NN)/CONST)**2 Expot = 999999.0 if (ExpPW .gt. ExpPWC) Expot = 0.0 if (Expot .ne. 0.0) Expot = exp(-ExpPW) DMNT = DMNT + DMF*Expot ANDMNT = ANDMNT + Expot end if !if(I.eq.40.and.J.eq.4) print *, I,J,NN,XC,DMF,DMNT,ANDMNT !if(I.eq.40.and.J.eq.4) print *, DMp end if end do if (ANDMNT .ne. 0.0) then DMap(I,J,N) = DMNT/ANDMNT else DMap(I,J,N) = Bad end if end if !if(I.eq.1.and.J.eq.1.and.N.eq.1) print *, I,J,N,DMap(I,J,N) !if(I.eq.40.and.J.eq.4) print *, I,J,N,DMap(I,J,N) end do end do end do return end