SUBROUTINE MASKINPUT C C MASKINPUT READS IN MASK DATA FROM MASKCHOICE.D AND C ORGANIZES IT. cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc c c Parameter c c maxmask - maximum number of masks c cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc parameter (maxmask=100) cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc c c Character Arrays: c c cfile - file names for masks, read in from maskchoice.d c text - dummy character for reading irrelevant lines c ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc character cfile*80 character text*80 cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc c c Common Blocks: c c maskfile - contains cfile, which stores mask file names c mfileinf - The mask file information gleened from maskchoice.d. c From this information, the masks to be used in this c iteration of the main program are drawn, depending c on the requested probe type. This information is c number of each type of mask, parameter of each c mask, and probe of each type of mask. c c Mask types are: c c 1. Inclusive Sequential Read c 2. Exclusive Sequential Read c 3. Exclusive Depth Read c 4. Sequential Write c 5. Depth Exclusion Write c ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc common /maskfile/ cfile(maxmask) common /mfileinf/ nmask(5),ipar(0:maxmask), * ipro(0:maxmask) call arrayinit(nmask,1,5) ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc c c Open maskchoice.d c ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc open(9, file='./maskchoice.d', status='old') ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc c c Skip the first fourteen lines. c ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc do 70 n=1,14 70 read(9,'(a1)') text cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc c c Do a two through loop, once for reading masks, once for c writing masks. Reading masks may also be written to, but c writing masks are always opened as new masks, whereas reading c masks are opened as old masks. c cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc do 79 j0=0,1 do 80 i0=1,3 i= i0 + 3*j0 if ( i .gt. 5 ) goto 80 ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc c c Read in the number of masks for this type of mask c ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc read(9,'(a40,i2)') text,nmask(i) c write(6,*) 'text',i,nmask(i) if ( i .gt. 1 ) then nmstart=nmask(i-1) else nmstart=0 endif ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc c c For each mask, assigned a successive number greater than the c number of the last previous type of mask, read the probe and c parameter type and the file name. c ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc do 71 n=nmstart+1,nmstart+nmask(i) read(9,*) ipar(n), ipro(n) read(9,*) cfile(n) cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc c c findchar outputs the distance from the beginning of a c character array to the first occurance of a character. c Here, n1 is the distance, the second variable is the array c in question, the third is the maximum length of a variable c and the last is the character to be searched for. So the c length of an array is the distance to the first space minus one c c Add a C end of array symbol to the file name. c cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc call findchar(n1,cfile(n),80,' ') cfile(n)(n1:n1+1)=CHAR(0) c write(6,*) 'n',n,n1,cfile(n)(1:n1+1) 71 continue cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc c c Set the value of this type of mask to the number of this type c of masks plus the number of all previous mask types. c cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc if ( i .gt. 1 ) nmask(i)=nmask(i-1)+nmask(i) c write(6,*) 'nm',i,nmask(i) 80 continue cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc c c Skip intervening lines c cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc if (j0 .eq. 0) then read(9,'(a1)') text read(9,'(a1)') text read(9,'(a1)') text endif 79 continue close(9) return end