C+ C NAME: C GetLOSValue C PURPOSE: C 4D linear interpolation. Interpolates values from positions C specified as modified Carrington variable (XC), latitude (XL), heliocentric C distance (RP) and time (XT). C CATEGORY: C Data processing C CALLING SEQUENCE: subroutine GetLOSValue(iRow,nRow,XCbegMAT,XCendMAT,F3D,N,PPlos,FFlos) C INPUTS: C iRow integer coordinate to interpolate on (1..nRow) C nRow integer # coordinates C XCbegMAT(nTim) real Start Carrington variable C XCendMAT(nTim) real End Carrington variable C C F3D(nRow,nLng,nLat,nRad,nTim)real 5D array (coordinate, longitude, latitude, C radial distance, time) C N integer # points C PPlos(4,N) real Lng/lat/rad/time of points on los C OUTPUTS: C FFlos(nRow,N) real Interpolated function values C (Only FFlos(iRow,*) is modified) C CALLS: C T3D_iget, T3D_get_grid, FLINT C INCLUDE: include 't3d_param.h' include 't3d_array.h' include 't3d_index.h' C include 't3d_grid_fnc.h' C include 't3d_loc_fnc.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,nRad] 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/CASS; pphick@ucsd.edu) C- integer iRow integer nRow real XCbegMAT(*) real XCendMAT(*) real F3D(*) integer N real PPlos(*) real FFlos(*) integer ND(5) real PP(5) logical bMod real Tiny /0.0/ include 't3d_grid_fnc.h' include 't3d_loc_fnc.h' call T3D_iget(T3D__MODE,0,MODE) call T3D_get_grid(TT,dTT,RR,dRR, nLng,nLat,nRad,nTim,dTTi,nLng1,nLat1) ND(1) = nRow ND(2) = nLng ND(3) = nLat ND(4) = nRad ND(5) = nTim PP(1) = float(iRow) bMod = iand(MODE,TOM__MOD) .ne. 0 J = iRow-nRow do I=1,N L = locPOS(0,I,1) locXC = L+LOS__XC locXL = L+LOS__XL locRR = L+LOS__RR locTT = L+LOS__TT XCbeg = FLINT(1,nTim,XCbegMAT,PPlos( locTT ),Tiny) ! Needed for statement fncs XCmod, XCindx XCend = FLINT(1,nTim,XCendMAT,PPlos( locTT ),Tiny) XCrange = XCend-XCbeg PP(2) = PPlos( locXC ) if (bMod) PP(2) = XCmod(PP(2)) PP(2) = XCindx(PP(2)) PP(3) = XLindx(PPlos( locXL )) PP(4) = RRindx(PPlos( locRR )) PP(5) = TTindx(PPlos( locTT )) J = J+nRow FFlos(J) = FLINT(-5,ND,F3D,PP,Tiny) ! Minus sign forces check for bad values end do return end