C+ C NAME: C Get4Dval C PURPOSE: C 4D linear interpolationInterpolates values from positions C specified as XC,XL,RP (modified Carrington variable, latitude (deg) and C distance (AU) C CATEGORY: C Data processing C CALLING SEQUENCE: C call Get4Dval(NN,XCbe,XCtbeg,XCtend,RR,dRR,nLng,nLat,nMap,nT, C F4D,N,TI,XC,XL,RP,FF) C INPUTS: (all input is read-only) C NN integer # of F4D parameters C XCbeg real Beginning Carrington variable for longitude C XCend real End Carrington variable for longitude C XCbe(2,nT) real Beginning and ending Carrington variables C XCtbeg real Beginning of time intervals C Xctend real Ending of time intervals C xInt real time ofset (in XC) C RR real Beginning map distance C dRR real Distance between individual maps (in AU) C nLng integer # longitudes C nLat integer # latitudes C nMap integer # DF maps formed (height begins ~0 AU) C nT integer # time points C F4D(nLng,nLat,nMap,nT) real 4D array (longitude, latitude, radial distance, time) C N integer # points C C TI(N) real Carrington variable value from first time C XC(N) real Modified Carrington variable C XL(N) real Heliographic latitude (deg) C RP(N) real Heliocentric distance (AU) C OUTPUTS: C FF(NN,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 distance is mapped to the range [1,nMap] 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 Get4Dval(NN,XCbe,XCtbeg,XCtend,RR,dRR,nLng,nLat,nMap,nT, & F4D,N,TI,XC,XL,RP,FF) real F4D(nLng,nLat,nMap,nT,NN), & XCbe(2,nT),XCbeg,XCend, & XC(N), XL(N), RP(N), FF(NN,N) real*8 TI(N) real*8 XCtbeg,XCtend,XCtfull,X integer ND(4) real PP(4) include 'MAPCOORDINATES.H' ND(1) = nLng ND(2) = nLat ND(3) = nMap ND(4) = nT do N5 = 1, NN do I=1,N PP(4) = XCtvar(TI(I)) II = Itvar(PP(4)) ! Nearest interval time index C PP(4) = max(XCtbeg,min(XCtend,PP(4))) XCbeg = XCbe(1,II) XCend = XCbe(2,II) C print *, ' In Get4dval 1 - XCtvar II XCbeg XCend',PP(4),II,XCbeg,XCend PP(1) = XCvar(XC(I)) PP(2) = XLindx(XL(I)) PP(3) = RRindx(RP(I)) C print *, ' In Get4dval 2 - PP(1) to PP(4)', PP(1), PP(2), PP(3), PP(4) FF(N5,I) = FLINT(-4,ND,F4D(1,1,1,1,N5),PP,0.00002) ! Minus sign forces check for bad values end do end do return end