C+ C NAME: C LOSProjection C PURPOSE: C Determines heliographic coordinates of los segments after projection C to the source surface C CATEGORY: C Data processing C CALLING SEQUENCE: subroutine LOSProjection(I__VD,XCbegMAT,XCendMAT,XC3D,PPlos,PPprj) C INPUTS: C XCbegMAT(nTim) real start Carrington variable C XCendMAT(nTim) real end Carrington variable C XC3D(3,nLng,nLat,nRad,nTim) C real Lng/lat/time shifts to source surface C (set by href=SW_Model_Kinematic=) C PPlos(4,NLOS,NL) real Lng/lat/rad/time of points on los C OUTPUTS: C PPprj(3,NLOS,NL) real Lng/lat/time of origin at source C surface RR for points on LOS. C INCLUDE: include 't3d_param.h' include 't3d_array.h' include 't3d_index.h' C include 't3d_loc_fnc.h' C CALLS: C T3D_iget, GetLOSValue, iArrR4ValuePresent C PROCEDURE: C > All longitudes are in Carrington variables (with an offset NCoffset C subtracted) C > PPlos is output from href=LOSPosition=. C The segment positions have been checked by href=LOSReach=, i.e. C All latitudes and radial distances lie inside the reconstruction volume. C If iand(MODE,TOM__MOD) = 0 the same is true for the longitudes C If iand(MODE,TOM__MOD) > 0 the longitudes values may lie outside C [XCbeg,XCend] but they will be mapped inside this range by GetLOSValue. C > Effectively all segments lie inside the volume covered by XC3D, and since C XC3D is output by href=SW_Model_Kinematic= without any bad values in it, interpolation C on XC3D at positions PPlos will always give a good value. C This is added to PPlos to obtain the projected PPprj at the source surface. C > The resulting projected longitudes may lie outside the range [XCbeg,XCend]. C This will be dealt with in href=BuildSourceSurface= (the only routine that uses PPprj) C C > When bMHD = iand(MODE,TOM__MHD) .ne. 0 then a general calculation is done C without making any assumptions about the shifts in longitude, latitude and time. C When the kinematic model is used then the latitude shifts is assumed zero, and C the time shift is assumed equal to the longitude shift. The general calculation C will work for the kinematic model but is much slower. C MODIFICATION HISTORY: C FEB-1999, P. Hick (UCSD/CASS), split original into two functions: C LOSPosition and LOSProjection C AUG-2001, P. Hick (UCSD/CASS; pphick@ucsd.edu), generalized for MHD model C- integer I__VD real XCbegMAT(*) real XCendMAT(*) real XC3D (*) ! Shifts to source surface real PPlos (*) ! Lng/lat/rad/time of points on los real PPprj (*) ! Projected Carrington variable of point on LOS character cSay*13 /'LOSProjection'/ logical bMHD include 't3d_loc_fnc.h' call T3D_iget(T3D__MODE,0,MODE) if (I__VD .eq. TOM__V) call T3D_iget(T3D__NL_V,0,NL) if (I__VD .eq. TOM__G) call T3D_iget(T3D__NL_G,0,NL) call T3D_iget(T3D__NLOS_V,0,NLOS) bMHD = iand(MODE,TOM__MHD) .ne. 0 Bad = BadR4() NP = NL*NLOS call GetLOSValue(PRJ__XC,PRJ__N,XCbegMAT,XCendMAT,XC3D,NP,PPlos,PPprj) if (bMHD) then call GetLOSValue(PRJ__XL,PRJ__N,XCbegMAT,XCendMAT,XC3D,NP,PPlos,PPprj) call GetLOSValue(PRJ__TT,PRJ__N,XCbegMAT,XCendMAT,XC3D,NP,PPlos,PPprj) do K=1,NL do J=1,NLOS Lprj = locPRJ(0,J,K) Llos = locPOS(0,J,K) PPprj(Lprj+PRJ__XC) = PPlos(Llos+LOS__XC)+PPprj(Lprj+PRJ__XC) ! Projected longitude PPprj(Lprj+PRJ__XL) = PPlos(Llos+LOS__XL)+PPprj(Lprj+PRJ__XL) ! Projected latitude PPprj(Lprj+PRJ__TT) = PPlos(Llos+LOS__TT)+PPprj(Lprj+PRJ__TT) ! Projected time end do end do else ! Kinematic model calculation do K=1,NL do J=1,NLOS Lprj = locPRJ(0,J,K) Llos = locPOS(0,J,K) PPprj(Lprj+PRJ__XC) = PPlos(Llos+LOS__XC)+PPprj(Lprj+PRJ__XC) ! Projected longitude PPprj(Lprj+PRJ__XL) = PPlos(Llos+LOS__XL) ! Projected latitude PPprj(Lprj+PRJ__TT) = PPlos(Llos+LOS__TT)+PPprj(Lprj+PRJ__XC) ! Projected time end do end do end if return end