SUBROUTINE UNIQFIND(jj,ju,jp,itime) C UNIQFIND RETURNS THE UNIQUE STATION NUMBER FOR A GIVEN C PROFILE NUMBER (ORDER IN FILE) c************************************** c c Passed Variables c c jj - order of profile in file c ju - unique station ID c jp - probe type c itime - set to one if file has been opened, zero to open c file and -1 to close file c c************************************* parameter (iufile=508,maxprobe=100) character*80 filename dimension iopenp(maxprobe),nuniq(maxprobe) save nuniq,inumprobes,iopenp c****************************************** c c Open unique station file if this is c the first time through subroutine c c****************************************** if ( iopenp(jp) .gt. 0 ) then c call filerewind(iopenp(jp)) else inumprobes=inumprobes+1 iopenp(jp)=iufile-inumprobes if (iopenp(jp) .lt. 501 ) iopenp(jp)=-1 call maskname('uniq.s'//CHAR(0),0,filename,jp) call fileopen(filename,'rb+'//CHAR(0),iopenp(jp)) call fileend(iopenp(jp)) call filepos(iopenp(jp),0,1,nuniq(jp)) call filerewind(iopenp(jp)) itime=1 endif c*********************************************c c c Read proper station id c c********************************************* if ( jj .le. nuniq(jp) ) then call posfile(jj,iopenp(jp)) call readmask(ju,iopenp(jp),iend) else ju=0 endif if ( itime .eq. -1 ) call onefileclose(iopenp(jp)) return end