C+ C NAME: C Get3DTval C PURPOSE: C 3D linear interpolationInterpolates values from positions C specified as XC,XL,RP (modified Carrington variable, latitude (deg) and C time (in XC) C CATEGORY: C Data processing C CALLING SEQUENCE: C call Get3TDval(XCbe,XCtbeg,XCtend,nLng,nLat,nT,F3D,N,XC,XL,TI,FF) C INPUTS: (all input is read-only) C XCbe(2,nT) real Beginning and ending Carrington variables C XCtbeg real*8 Beginning of time intervals C Xctend real*8 Ending of time intervals C nLng integer # longitudes C nLat integer # latitudes C nT integer # time points C F3D(nLng,nLat,nT) real 3D array (longitude, latitude, time) C N integer # points C C XC(N) real Modified Carrington variable C XL(N) real Heliographic latitude (deg) C TI(N) real*8 Carrington variable value from first time C OUTPUTS: C FF(N) real Interpolated function values C FUNCTIONS/SUBROUTINES: C FLINT C INCLUDE: C include 'MAPANGLES.H' C PROCEDURE: C > The modified Carrington variable is mapped to the range [1,nLng] C The latitude is mapped to the range [1,nLat] C The time is mapped to the range [1,nT] C > For each point, if any of the neighbours contains a bad value, or if any of the C coordinates is more than one bin width outside the index ranges, then the value C BadR4() is returned (see FLINT). C MODIFICATION HISTORY: C MAY-1997, Paul Hick (UCSD; pphick@ucsd.edu) C- subroutine Get3DTval(XCbe,XCtbeg,XCtend,nLng,nLat,nT,F3D,N, & XC,XL,TI,FF) real F3D(nLng,nLat,nT), & XCbe(2,nT),dRR/0.1/, & XC(N), XL(N), FF(N) real*8 TI(N) real*8 XCtbeg,XCtend,XCtfull,X integer ND(3) real PP(3) include 'MAPCOORDINATES.H' ND(1) = nLng ND(2) = nLat ND(3) = nT do I=1,N PP(3) = XCtvar(TI(I)) II = Itvar(PP(3)) ! Nearest interval time index C PP(3) = max(XCtbeg,min(XCtend,PP(3))) XCbeg = XCbe(1,II) XCend = XCbe(2,II) PP(1) = XCvar(XC(I)) PP(2) = XLindx(XL(I)) C print *, I,II,XCbeg,XCend,XCtbeg,XCtend,PP(1),PP(2),PP(3) FF(I) = FLINT(-3,ND,F3D,PP,0.00002) ! Minus sign forces check for bad values C if(ff(i).lt.0.) print *, I,II,XCbeg,XCend,XCtbeg,XCtend,PP(1),PP(2),PP(3) end do return end