C+ C NAME: C T3D_write_nv C PURPOSE: C Write tomography plasma (density and velocity) output to t3d* file. C CATEGORY: C I/O C CALLING SEQUENCE: subroutine T3D_write_nv(cPrefix, t3d,VSS,DSS,V3D,D3D,iStrAdd,cStrAdd, cFile) C INPUTS: C cPrefix character*4 C prefix used to start the name of the output file C (default is 'nv3d') C t3d(*) real (not used anymore) C C VSS (nLng,nLat) real velocity map at source surface (km/s) C DSS (nLng,nlat) real normalized density at source surface (cm^-3) C V3D (nLng,nLat,nRad) real 3D velocity matrix (km/s) C D3D (nLng,nLat,nRad) real 3D normalized density matrix (cm^-3) C C iStrAdd integer # strings to be added to the file header C cStrAdd(*)*(*) character C strings to be added to file header C Only strings with non-zero length are written. C All strings receive the prefix 'User: ' C OUTPUTS: C (to file t3d*) C cFile*(*) character C name of t3d* output file C only the name and type is set. The file is C created in the current directory. C CALLS: C T3D_iget, T3D_header, itrim, WR2DARR, Str2Str C INCLUDE: include 't3d_param.h' include 't3d_array.h' C PROCEDURE: C MODIFICATION HISTORY: C DEC-2000, Kevin Nguyen, Paul Hick (UCSD; pphick@ucsd.edu) C- character cPrefix*(*) real VSS(*) real DSS(*) real V3D(*) real D3D(*) integer iStrAdd character cStrAdd(*)*(*) character cFile*(*) parameter (nStr = T3D__NELEMENTS) character cStr(nStr)*120 character cFmt*7 /'(F10.4)'/ integer Str2Str logical bSurf call T3D_iget(T3D__MODE,0,MODE) bSurf = iand(MODE,TOM__NOSURF) .eq. 0 call T3D_iget(T3D__NLNG,0,nLng) call T3D_iget(T3D__NLAT,0,nLat) call T3D_iget(T3D__NRAD,0,nRad) if (itrim(cPrefix) .eq. 0) cPrefix = 'nv3d' call T3D_header(cPrefix, cFile, nStr, cStr, J) do I=1,iStrAdd K = itrim(cStrAdd(I)) if (K .gt. 0) then J = J+1 cStr(J) = 'User: '//cStrAdd(I)(:K) end if end do J = J+1 cStr(J) = 'Velocity (km s^-1)/normalized density (cm^-3)' !------- ! Write 3D arrays (velocity, normalized density) call WR2DARR(3,nLng,nLat*nRad,V3D,cFile,cFmt,.FALSE.,J,cStr) call WR2DARR(2,nLng,nLat*nRad,D3D,cFile,cFmt,.FALSE.,0,cStr) !------- ! Write source surface maps (velocity, normalized density) if (bSurf) then I = 0 I = I+Str2Str(cStr(J) , cStr(1)(I+1:))+1 I = I+Str2Str('at source surface', cStr(1)(I+1:))+1 call WR2DARR(2,nLng,nLat,VSS,cFile,cFmt,.FALSE.,1,cStr) call WR2DARR(2,nLng,nLat,DSS,cFile,cFmt,.FALSE.,0,cStr) end if return end