C+ C NAME: C T3D_marker C PURPOSE: C Checks a set for 3D tomography output for the number of files for a C specific Carrington rotation. A counter is appended to the input file C name which is one higher than the number of files found. C CATEGORY: C tomography C CALLING SEQUENCE: integer function T3D_marker(cFile, icount) C INPUTS: C cFile character*(*) C file name identifier of the form nv3d1234.6789 C where 1234.6789 is a modified Carrington variable C OUTPUTS: C T3D_marker C integer C effective length of return value cType C cFile character*(*) C file name identifier of the form nv3d1234.6789_nnn C where 1234.6789 is a modified Carrington variable, C and nnnnn is a 5-digit integer. C The highest counter value is determined by searching C the working directory. C If no file with a counter is found then 00001 is appended. C icount integer C value of counter C CALLS: C iSetFileSpec, iGetFileSpec, iSearch, Str2Flt, itrim, Int2Str, Str2StrSet, Str2Str C T3D_marker_num C INCLUDE: include 'filparts.h' include 'str2str_inc.h' C PROCEDURE: C All numbers in the file type part of cType (.6789_nnn) are extracted. C The 2nd number should be the integer nnn. C MODIFICATION HISTORY: C FEB-2001, Paul Hick (UCSD/CASS; pphick@ucsd.edu) C- character cFile*(*) integer icount character cTmp *120 character cFound*120 real rVec(3) integer Str2Str integer icount_prev /-1/ save icount_prev integer nStep /2/ icount = icount_prev L = itrim(cFile) if (icount .eq. -1) then icount = 0 cTmp = cFile call T3D_marker_num(0, cTmp, iNum) iStep = -1 do while (icount .eq. 0 .and. iStep .lt. nStep) iStep = iStep+1 ipm = -iStep do while (icount .eq. 0 .and. ipm .le. iStep) call T3D_marker_num(1,cTmp,iNum+ipm) !------- ! Search for files with the same file name and the same first ! four letters in the file type. iFirst = 1 do while (iSearch(iFirst, cTmp(:L)//'*', cFound) .eq. 1) iFirst = 0 I = iSetFileSpec(cFound) I = iGetFileSpec(FIL__TYPE, FIL__TYPE, cFound)! Split of .6789_nnn iVec = 2 ! Split off first two numbers call Str2Flt(cFound, iVec, rVec) ! (2nd should be nnnn) if (iVec .eq. 2) icount = max(icount, nint(rVec(2))) end do ipm = ipm+max(1,2*iStep) end do end do icount = icount+1 ! Increment counter I = Int2Str(icount, cFound) call Say('T3D_marker','I','new','marker '//cFound) end if L = L+Str2Str('_', cFile(L+1:)) I = Int2StrSet(STR__ZERORIGHTADJUST) L = L+Int2Str(icount, cFile(L+1:L+5)) I = Int2StrSet(I) T3D_marker = L icount_prev = icount return end