C+ C NAME: C Write3D_nv C PURPOSE: C Converts the ratios of velocity and normalized density to C velocities and normalized densities. The arrays are written to C file, and are also returned as output array. C CALLING SEQUENCE: subroutine Write3D_nv(VSS,DSS,XC3D,V3D,D3D) C INPUTS: C VSS(nLng,nLat) real source surface velocities (may contain bad values) C DSS(nLng,nLat) real source surface densities normalized to 1 AU C (may contain bad values) C XC3D(nLng,nLat,nRad) real 3D shift array C V3D (nLng,nLat,nRad) real velocity ratios C D3D (nLng,nLat,nRad real normalized density ratios C OUTPUTS: C V3D (nLng,nLat,nRad) real velocities C D3D (nLng,nLat,nRad real normalized densities C CALLS: C T3D_get_grid, T3D_get, T3D_set, BadR4, FLINT, T3D_write_nv C INCLUDE: include 't3d_array.h' C include 't3d_grid_fnc.h' C PURPOSE: C Calculate 3D velocity and normalized density arrays for C corotating tomography. C MODIFICATION HISTORY: C APR-2002, Paul Hick (UCSD/CASS; pphick@ucsd.edu) C- real VSS (*) real DSS (*) real XC3D(*) real V3D (*) real D3D (*) real Scale(4) /0.0, 1.0, 0.0, 1.0/ real PwrR(2) /0.0,2.0/ real Tiny /2.0e-5/ character cFile*512 include 't3d_grid_fnc.h' locP(iLng,iLat,iRad) = ((iRad-1)*nLat+iLat-1)*nLng+iLng Bad = BadR4() !------- ! Retrieve grid information call T3D_get_grid(TT,dTT,RR,dRR,nLng,nLat,nRad,nTim, dTTi,nLng1,nLat1) nMap = nLng*nLat ! # bins in map at fixed distance nVol = nMap*nRad ! # bins in whole volume call T3D_get(T3D__XCMAT ,0,XCbeg) ! Needed for statement fnc XCvar call T3D_get(T3D__XCMAT+1,0,XCend) XCrange = XCend-XCbeg call T3D_set(T3D__SCALE,4,Scale) ! No scale change, but set anyways call T3D_set(T3D__R_PWR,2,PwrR) do iRad=1,nRad do iLat=1,nLat do iLng=1,nLng iP = locP(iLng,iLat,iRad) ! Location grid point in 3D array iP0 = locP(1 ,iLat, 1) ! Location of start of row at source surface !------- ! Find the Carrington variable of origin at the source surface of grid point PP = XCvar(iLng)+XC3D(iP) ! Carrington variable at source surface PP = XCindx(PP) ! Index for longitude at source surface VV = FLINT(-1,nLng,VSS(iP0),PP,Tiny) if (VV .eq. Bad) then V3D(iP) = Bad else V3D(iP) = V3D(iP)*VV end if DD = FLINT(-1,nLng,DSS(iP0),PP,Tiny) if (DD .eq. Bad) then D3D(iP) = Bad else D3D(iP) = D3D(iP)*DD end if end do end do end do call T3D_write_nv('nv3d', dummy, VSS,DSS,V3D,D3D,0,' ',cFile) return end