!--------( PCHKCOMP : plot mag.prof. of compensation effect )-------- implicit none integer :: lwkdir, lrtrim real,parameter :: ras = (2.54/300.) ! assume 300dpi, ras (cm) = 1 raster size ! 2100 data / full width (2100 rasters = 17.78 cm) ! 3.5 min. (= 210 sec.) data if 0.1 sec. intv. sampling integer :: mc(2100), icol(2) real :: f(2,2100) character(80) :: wdr, flog, fnin, fnam character(150) :: buf; character(27) :: label; character(20) :: sdtm character(8) :: lnam integer :: ldr, kend, irow, n, iymd, km, k, i, IER integer :: mv, m1, m2, m2r, kor real :: fid, flat, flon, falt, tmag, tcor, fx, fy, fz, utc real :: tres, corr, rand, trend, yo, x, y real(8) :: tms icol(1) = 255 icol(2) = 255*256*256 call premsg('PCHKCOMP : plot mag.prof. of compensation effect') call opnpin() ldr = lwkdir(50,wdr) + 1 flog = wdr; fnin = wdr; fnam = wdr call gparma('Enter LOG filename ==> ', 81-ldr, flog(ldr:80)) call gparma('Enter Input data filename ==> ', 81-ldr, fnin(ldr:80)) open(1,file=fnin,status='old') call gparma('Enter Output PS filename ==> ', 81-ldr, fnam(ldr:80)) call clspin() if (fnam(ldr:ldr) == ' ') fnam(1:1) = char(0) if (fnam(80:80) /= ' ') call abendm('too long filename') write(6,'(a)') '----------------------------------------' write(6,'(a)') 'PCHKCOMP : plot mag.prof. of compensation effect' write(6,'(a,a)') ' Input data filename : ', fnin(1:lrtrim(fnin)) write(6,'(a,a)') ' Output PS filename : ', fnam(1:lrtrim(fnam)) call psopn(fnam, 'A4P') kend = 0; lnam = ' '; IER = 0 call plots(1.5, 2.0) call lstyle('T', 0.4, 0., 0, -999) irow = 10 ! 10 rows / page do n = 0 do read(1,'(a)',iostat=IER) buf if (IER < 0) then; kend = 1; exit; endif if ((buf(1:1) == '&') .or. (buf(1:1) == '%')) then read(buf,'(1x,a8)') lnam if (n > 0) exit else read(buf,*) fid,iymd,tms,km,flat,flon,falt,tmag,tcor, & fx,fy,fz,utc,tres,corr,rand,trend if (n == 0) write(label,'(a8,1x,i8,1x,f9.2)') lnam,iymd,tms n = n + 1; f(1,n) = tres; f(2,n) = tcor if (n == 2100) exit endif enddo if (n == 0) exit irow = irow - 1 if (irow < 0) then call ptext(fnin, 80, 0., -1., 0) call plote() call plots(1.5, 2.0) call lstyle('T', 0.4, 0., 0, -999) irow = 9 endif x = 0.; yo = ras * float(irow*300) ! 300 dots (=2.54 cm) / row call ptext(label, 27, 0., yo+1.9, 0) do k=1,2 call penatr(0, icol(k), 0, 0.01) call plot(x, yo+1.143, 3) kor = 0 ! kor: 10% overrange control do i=1,n mv = nint(f(k,i)*5.) ! convert to 120 dots (300dpi) / 25nT m2 = mv/125; m1 = mv - m2*125 if (m1 < 0) then m2 = m2 - 1; m1 = m1 + 125 endif if ((m1 < 12) .and. (kor == 1) .and. (m2 == (m2r+1))) then m2 = m2-1; m1 = m1+125 else if (m1 < 69) then kor = 0 else kor = 1 endif m2r = m2; m2 = m2 - m2/40*40 if (m2 < 0) m2 = m2 + 40; mc(i) = m2 ! Fine (m1) full range size : 125 dots (+10%) ! Fine (m1) full range : 25nT (+10%) [5 dots / nT] ! Coarse (m2) full range : (25x40=) 1000nT ! Coarse (m2) full range size : 80 dots y = yo + ras*float(m1) call plot(x, y, 2) x = ras*float(i) call plot(x, y, 2) enddo do i=n,1,-1 y = yo + ras*float(mc(i)*2+140) call plot(x, y, 2) x = ras*float(i-1) call plot(x, y, 2) enddo call plot(x, yo+1.143, 2) enddo if (kend == 1) exit enddo call ptext(fnin, 80, 0., -1., 0) call plote() call pscls() if (flog(ldr:ldr) /= ' ') then open(99,file=flog,access='append') write(99,'(//a)') 'PCHKCOMP : plot mag.prof. of compensation effect' write(99,'(a,a)') ' Input data filename : ', fnin(1:lrtrim(fnin)) write(99,'(a,a)') ' Output PS filename : ', fnam(1:lrtrim(fnam)) call strdtm(sdtm) write(99,'(a,a,a)') '=============== ', sdtm, '===============' close(99) endif stop end