macro c exec init1 set XVAL 0.5 size=40 nt/cre 10 ' ' 7 ' ' 1000 om x y z n pn pe nt/rea 10 'out.'//[size] size=[size]*1.05 z=0 h1d=0 vec/cre spar(2) R [z] 0 appl comis quit real function fill real om,x,y,z,n,pn,pe,q,xq,yq,zq logical chain character*128 cfile common /pawchn/ chain,nchevt,ichevt common /pawchc/ cfile common /pawidn/ idnevt,obs(13),om,x,y,z,n,pn,pe vector spar if spar(2).eq.1 then xq=x yq=y zq=z elseif spar(2).eq.2 then xq=x yq=z zq=y elseif spar(2).eq.3 then xq=y yq=z zq=x endif if (zq.ge.-spar(1)).and.(zq.le.spar(1)) then if pn.gt.0 then q=pn/om else q=0 endif call hf2(100,xq,yq,q) endif if (xq.ge.-spar(1)).and.(xq.le.spar(1)) then if (yq.ge.-spar(1)).and.(yq.le.spar(1)) then call hf1(200,zq,q) endif endif end quit do xyz=1,3 vec/inp spar(2) [xyz] 2d 100 ' ' 21 -[size] [size] 21 -[size] [size] 1d 200 ' ' 21 -[size] [size] nt/lo 10 fill set XMGR 3 set XSIZ 21.5 set cwid 1 set ncol 58 pal 1 hi/pl 100 'col z' hi/pl 100 'cont s' if [xyz].eq.1 then atit 'x "M# m "N#' 'y "M# m "N#' elseif [xyz].eq.2 then atit 'x "M# m "N#' 'z "M# m "N#' elseif [xyz].eq.3 then atit 'y "M# m "N#' 'z "M# m "N#' endif enddo if [h1d].eq.1 then hi/pl 200 if [xyz].eq.1 then atit 'z "M# m "N#' elseif [xyz].eq.2 then atit 'y "M# m "N#' elseif [xyz].eq.3 then atit 'x "M# m "N#' endif endif exec plot1 'c_'//[size] return macro b exec init1 nt/cre 10 ' ' 8 ' ' 1000 n e x y z px py pz nt/rea 10 out2 zone 1 2 nt/pl 10.z%x (x.gt.-10).and.(x.lt.10).and.(y.gt.-10).and.(y.lt.10).and.(z.gt.-10).and.(z.lt.10) nt/pl 10.z%y (x.gt.-10).and.(x.lt.10).and.(y.gt.-10).and.(y.lt.10).and.(z.gt.-10).and.(z.lt.10) zone 1 1 nt/pl 10.x%y (x.gt.-10).and.(x.lt.10).and.(y.gt.-10).and.(y.lt.10).and.(z.gt.-10).and.(z.lt.10) zone 2 3 set dmod 1 nt/pl 10.x (x.gt.-200).and.(x.lt.200) nt/pl 10.x (x.gt.-20).and.(x.lt.20) nt/pl 10.y (y.gt.-200).and.(y.lt.200) nt/pl 10.y (y.gt.-20).and.(y.lt.20) nt/pl 10.z (z.gt.-200).and.(z.lt.200) nt/pl 10.z (z.gt.-10).and.(z.lt.10) nt/pl 10.x (x.gt.-200).and.(x.lt.200).and.(y.gt.-10).and.(y.lt.10).and.(z.gt.-10).and.(z.lt.10) nt/pl 10.x (x.gt.-20).and.(x.lt.20).and.(y.gt.-10).and.(y.lt.10).and.(z.gt.-10).and.(z.lt.10) nt/pl 10.y (x.gt.-10).and.(x.lt.10).and.(y.gt.-200).and.(y.lt.200).and.(z.gt.-10).and.(z.lt.10) nt/pl 10.y (x.gt.-10).and.(x.lt.10).and.(y.gt.-20).and.(y.lt.20).and.(z.gt.-10).and.(z.lt.10) nt/pl 10.z (x.gt.-10).and.(x.lt.10).and.(y.gt.-10).and.(y.lt.10).and.(z.gt.-200).and.(z.lt.200) nt/pl 10.z (x.gt.-10).and.(x.lt.10).and.(y.gt.-10).and.(y.lt.10).and.(z.gt.-10).and.(z.lt.10) exec plot1 b return macro a exec init1 nt/cre 10 ' ' 5 ' ' 1000 n,e,x,y,z nt/rea 10 out_om340_fn3.data zone 2 3 set dmod 1 vec/pl x null -20 20 0 1000 vec/pl x ! s vec/pl y null -20 20 0 1000 vec/pl y ! s vec/pl z null -20 20 0 3000 vec/pl z ! s exec plot1 a return * for i in `seq 337 344` `seq 379 386` `seq 421 428`; do echo $i; ./grid -rt=0.2 -om=$i > om.$i; done macro fit exec init1 qf='mc_g4' rt=[1] if [rt].eq.' ' then rt=0.25 endif MESS rt=[rt] n=11 fmin=5.4 fmax=7.1 om=480 sp1=0.2 sp2=0.4 np=6 norm=0 bmax=1000*[rt] bave=10*[rt] bmin=0.1*[rt] do om=340,340 vec/del * hi/del * MESS MESS OM [om] nt/cre 10 ' ' 7 ' ' 1000 om x y z num ave sig nt/rea 10 'om_'//[qf]//'.'//[om] if $HINFO(10,'ENTRIES').ne.1331 then nextl endif opt grid opt logy null 0 1 0.1 1000 set dmod 1 nt/pl 10.sig/ave ave.gt.0 ! ! ! s atit 'relative error' 'entries' opt ngrid opt liny appl comis quit function fit(x) dimension x(3) double precision th,phi,nr,nx,ny,nz,rx,ry,rz,rn,r2 common /pawpar/ par(6) th=par(5) phi=par(6) nr=sin(th) nx=nr*cos(phi) ny=nr*sin(phi) nz=cos(th) rx=x(1)-par(3) ry=x(2)-par(4) rz=x(3) rn=rx*nx+ry*ny+rz*nz rx=nx*rn-rx ry=ny*rn-ry rz=nz*rn-rz r2=sqrt(rx*rx+ry*ry+rz*rz) fit=par(1)*exp(-r2/par(2)) end quit vec/cre m(4) R 0 0 0 1 appl comis quit real function fmin real om,x,y,z,num,ave,sig logical chain character*128 cfile common /pawchn/ chain,nchevt,ichevt common /pawchc/ cfile common /pawidn/ idnevt,obs(13),om,x,y,z,num,ave,sig vector m if ave.gt.m(4) then m(1)=nint(x) m(2)=nint(y) m(3)=nint(z) m(4)=ave endif end quit nt/lo 10 fmin MESS maximum at x=$SIGMA(m(1)) y=$SIGMA(m(2)) z=$SIGMA(m(3)) vec/cre fn(1) R [n] n3=[n]*[n]*[n] vec/cre mmin(3) R vec/cre mmax(3) R appl comis quit subroutine mfix vector m,mmin,mmax,fn f=fn(1)-1 do i=1,3 mmin(i)=m(i)-f mmax(i)=m(i)+f if nint(mmin(i)).lt.-10 then diff=abs(nint(mmin(i))+10) mmin(i)=mmin(i)+diff mmax(i)=mmax(i)+diff endif if nint(mmax(i)).gt.10 then diff=abs(nint(mmax(i))-10) mmin(i)=mmin(i)-diff mmax(i)=mmax(i)-diff endif enddo end call mfix end quit MESS Using grid at x=($SIGMA(mmin(1)),$SIGMA(mmax(1))), y=($SIGMA(mmin(2)),$SIGMA(mmax(2))), z=($SIGMA(mmin(3)),$SIGMA(mmax(3))) vec/cre r([n3],3) R vec/cre f([n3]) R vec/cre e([n3]) R appl comis quit real function fill real om,x,y,z,num,ave,sig logical chain character*128 cfile common /pawchn/ chain,nchevt,ichevt common /pawchc/ cfile common /pawidn/ idnevt,obs(13),om,x,y,z,num,ave,sig vector r,f,e,mmin,mmax data i /0/ if (nint(x).ge.nint(mmin(1))).and.(nint(x).le.nint(mmax(1))) then if (nint(y).ge.nint(mmin(2))).and.(nint(y).le.nint(mmax(2))) then if (nint(z).ge.nint(mmin(3))).and.(nint(z).le.nint(mmax(3))) then i=i+1 r(i,1)=x r(i,2)=y r(i,3)=z f(i)=ave e(i)=sig if 1.eq.1 then if (sig/ave.gt.0.5).or.(sig/ave.lt.0.01) then e(i)=1.e9 endif endif endif endif endif end quit nt/lo 10 fill vec/inp mmax 20 20 20 sigma mmin=-mmax vec/cre par([np]) R 1 10 0 0 0 0 vec/fit r f e fit qen 6 par vec/cre chi(1) R appl comis quit subroutine chi2 COMMON/HCFITS/NCFITS,NPFITS,NFPAR,FITCHI,FITPAR(35),FITSIG(35), * FITDER(35) vector chi chi(1)=sqrt(FITCHI) write(*,*) 'Chi2=', FITCHI end call chi2 end quit if [norm].eq.1 then sigma e=e*chi(1) endif vec/fit r f e fit qn 6 par vec/cre err([np]) R [np] vec/cre zz(1) R appl comis quit subroutine perr COMMON/HCFITS/NCFITS,NPFITS,NFPAR,FITCHI,FITPAR(35),FITSIG(35), * FITDER(35) vector err,par imax=nint(err(1)) do 1 i=1,imax err(i)=fitsig(i) 1 continue write(*,*) 'Chi2=', FITCHI pi=3.141592653589793 err(5)=err(5)*180/pi err(6)=err(6)*180/pi par(5)=par(5)*180/pi par(6)=par(6)*180/pi if(par(5).lt.0) then par(5)=-par(5) endif par(6)=par(6)-int(par(6)/180)*180 par(6)=par(6)-nint(par(6)/360)*360 end call perr end quit vec/inp zz(1) 0 appl comis quit real function plot(x,y) vector zz dimension r(3) r(1)=x r(2)=y r(3)=zz(1) plot=fit(r) end quit fun2 100 plot 20 -10 10 20 -10 10 ' ' opt utit set xlab 3.5 set xmgl 4.5 set ymgu 3.5 set ymgl 5.5 set ysiz 25 if [rt].eq.5 then set ndvx -10506 set ndvy 10505 elseif [rt].eq.2 then set ndvx -10511 set ndvy 10510 endif fmin=$HINFO(100,'MIN') fmax=$HINFO(100,'MAX') diff=[fmax]-[fmin] fmin=[fmin]-[sp1]*[diff] fmax=[fmax]+[sp2]*[diff] *fmin=7.5 *fmax=8.5 vec/cre tr(3) R [rt] [fmin] [fmax] appl comis quit subroutine rtr vector tr,err,par f=10./tr(1) call hplfr3(-f,f,-f*.99,f,tr(2),tr(3),30.,30.,'WBA') call hminim(100,tr(2)) call hmaxim(100,tr(3)) end call rtr end quit MESS par: $FORMAT(par(1),f8.4) $FORMAT(par(2),f8.4) $FORMAT(par(3),f8.4) $FORMAT(par(4),f8.4) $FORMAT(par(5),f8.4) $FORMAT(par(6),f8.4) MESS err: $FORMAT(err(1),f8.4) $FORMAT(err(2),f8.4) $FORMAT(err(3),f8.4) $FORMAT(err(4),f8.4) $FORMAT(err(5),f8.4) $FORMAT(err(6),f8.4) set ncol 8 pal 1 h/pl 100 'surf1 fb bb as' 2d 200 ' ' 11 -11 11 11 -11 11 appl comis quit real function hist real om,x,y,z,num,ave,sig logical chain character*128 cfile common /pawchn/ chain,nchevt,ichevt common /pawchc/ cfile common /pawidn/ idnevt,obs(13),om,x,y,z,num,ave,sig vector zz if nint(z).eq.nint(zz(1)) then call hf2(200,x,y,ave) endif end quit nt/lo 10 hist set hcol 4 call hminim(200,[fmin]) call hmaxim(200,[fmax]) h/pl 200 'surf fb bb as' set TXCI 1 atit 'x "M#m"N#' 'y "M#m"N#' 'hit fraction' 312 null 0 1 0 1 sa set FAIS 1 set FACI 5 set BORD 1 set LWID 2 s1=1.3 s2=1.2 dbox -0.3 1.1 1.03-[s1] 1.20-[s1] set TXCI 4 set chhe 0.35 itx -0.25 1.15-[s1] A = $FORMAT(par(1),f6.3) [\261] $FORMAT(err(1),f6.3) itx -0.25 1.10-[s1] [q] = $FORMAT(par(5),f6.3) [\261] $FORMAT(err(5),f6.3) itx -0.25 1.05-[s1] [f] = $FORMAT(par(6),f6.3) [\261] $FORMAT(err(6),f6.3) itx 0.25 1.15-[s1] [d]r = $FORMAT(par(2),f6.3) [\261] $FORMAT(err(2),f6.3) "M#m"N# itx 0.25 1.10-[s1] [d]x = $FORMAT(par(3),f6.3) [\261] $FORMAT(err(3),f6.3) "M#m"N# itx 0.25 1.05-[s1] [d]y = $FORMAT(par(4),f6.3) [\261] $FORMAT(err(4),f6.3) "M#m"N# set chhe 0.5 itx 0.0 -0.17+[s2] 'log likelihood for OM '//[om]//' at z = '//$SIGMA(zz(1)/[rt])//' m' x0=par(3) y0=par(4) th=par(5) ph=par(6) sh grid.vez [x0] [y0] [th] [ph] 'out_cl_'//[qf]//'.gz' vec/del a vec/rea a a1 set xlab 2.0 set xmgl 3.0 opt logy null -100 100 0.1 1000 vec/pl a ! s 1d 10 ' ' 16 -16 16 vec/hfil a 10 vec/cre par2(3) R 1 0 10 hi/fit 10 G n ! par2 atit 'distance along the [q]='//$FORMAT(par(5),f6.3)//', [f]='//$FORMAT(par(6),f6.3)//' axis "M# m "N#' 'entries' appl comis quit function gg(x) vector par2 aux=(x-par2(2))/par2(3) pi=3.141592653589793 gg=(par2(1)/(2*pi*sqrt(par2(3))))*exp(-aux*aux/2) end quit if par2(3).gt.16 then vec/inp par2(1) $HINFO(10,'ENTRIES') vec/inp par2(2) $HINFO(10,'MEAN') vec/inp par2(3) $HINFO(10,'RMS') set hcol 1 fun/pl gg -100 100 s else hi/fit 10 G s ! par2 endif opt liny null 0 1 0 1 sa itx 0.15 0.90 'maximum at '//$FORMAT(par2(2),f6.3)//', spread '//$FORMAT(par2(3),f6.3) enddo exec plot1 grid return macro ac exec init1 set XVAL 0.2 set YVAL 0.2 set KSIZ .30 set GSIZ .30 set TSIZ .30 set ASIZ .30 set CSIZ .30 set PSIZ .30 set VSIZ .30 set SSIZ .30 set 2SIZ .30 set YHTI 0.6 set XSIZ 25.0 set XWIN 1.6 set YWIN 1.2 nt/cre 10 ' ' 8 ' ' 1000 Nall Ndir Rwei Rave Rmax Ldir Shnh Rchi nt/rea 10 ac zone 3 3 set dmod 1 nt/pl 10.Ndir Ndir.gt.0.1.and.Ndir.lt.39 nt/pl 10.Ndir/Nall Nall.gt.0.and.Ndir/Nall.gt.0.01.and.Ndir/Nall.lt.0.49 nt/pl 10.Rwei Rwei.gt.1.and.Rwei.lt.199 nt/pl 10.Rave Rave.gt.1.and.Rave.lt.199 nt/pl 10.Rwei/Rave Rave.gt.0.and.Rwei/Rave.gt.0.01.and.Rwei/Rave.lt.0.99 nt/pl 10.Rmax Rmax.gt.1.and.Rmax.lt.199 nt/pl 10.Ldir Ldir.gt.1.and.Ldir.lt.999 nt/pl 10.Shnh Shnh.gt.-0.99.and.Shnh.lt.0.99 nt/pl 10.Rchi Rchi.gt.5.and.Rchi.lt.9.99 exec plot1 ac return macro ab exec init1 set XMGR 3 set XSIZ 21.5 set cwid 1 set ncol 58 pal 1 vec/rea a,b aa 2d 10 ' ' 21 -50 50 21 -50 50 v/hfill a%b 10 h/pl 10 'col z' h/pl 10 'cont s' atit 'dx "M# m "N#' 'dy "M# m "N#' set XVAL 0.5 set XLAB -0.8 set YLAB 1.0 zone 1 2 1d 20 ' ' 21 -50 50 v/hfill a 20 max=$HINFO(20,'MAX') max=1.2*[max] null -50 50 0 [max] set dmod 1 set hcol 4 hi/pl 20 s atit 'dx "M# m "N#' 'entries' ave=$HINFO(20,'MEAN') rms=$HINFO(20,'RMS') null 0 1 0 1 sa itx 0.15 0.9 'average='//$FORMAT([ave],f6.3)//' spread='//$FORMAT([rms],f6.3) 1d 30 ' ' 21 -50 50 v/hfill b 30 max=$HINFO(30,'MAX') max=1.2*[max] null -50 50 0 [max] set dmod 1 set hcol 4 hi/pl 30 s atit 'dy "M# m "N#' ave=$HINFO(30,'MEAN') rms=$HINFO(30,'RMS') null 0 1 0 1 sa itx 0.15 0.9 'average='//$FORMAT([ave],f6.3)//' spread='//$FORMAT([rms],f6.3) exec plot1 ab return macro main exec init1 opt='lego' flag=3 fmin=6.1 fmax=6.4 set MTYP 8 nt/cre 10 ' ' 7 ' ' 1000 om x y z num ave sig nt/rea 10 out if [flag].eq.1 then color 8 1 1 1 elseif [flag].eq.2 then set cwid 1 set xmgr 4 set ncol 255 call shade.f elseif [flag].eq.3 then opt utit endif if ([flag].eq.1).or.([flag].eq.3) then call hplfr3(-10.,10.,-10.,10.,[fmin],[fmax],30.,30.,'WBA') endif i=0 do z=-10,10,2 i=[i]+1 if [z].eq.0 then sec='!' else sec='1' endif MESS layer [i] at [z] if ([flag].eq.1).or.([flag].eq.2) then 2d 100 ' ' 11 -11 11 11 -11 11 call hminim(100,[fmin]) call hmaxim(100,[fmax]) vec/cre par(10) R [z] appl comis quit real function fill real om,x,y,z,num,ave,sig logical chain character*128 cfile common /pawchn/ chain,nchevt,ichevt common /pawchc/ cfile common /pawidn/ idnevt,obs(13),om,x,y,z,num,ave,sig vector par if z.eq.par(1) then call hf2(100,x,y,ave) endif end quit nt/lo 10 fill if [flag].eq.1 then do k=1,2 if [k].eq.1 then set hcol 1 elseif ([k].eq.2).and.([i].lt.11) then wait ! [sec] set hcol 8 endif h/pl 100 [opt]//' fb bb as' enddo elseif [flag].eq.2 then if [i].eq.1 then extra='z' else extra='as' endif h/pl 100 'col '//[extra] wait ! [sec] endif vec/del par hi/del 100 elseif [flag].eq.3 then do k=1,2 if [k].eq.1 then set PLCI 3 igset PMCI 4 elseif ([k].eq.2).and.([i].lt.11) then wait ! [sec] set PLCI 0 igset PMCI 0 endif y=0 do x=-10,10,2 nt/pl 10.ave%y%x x.eq.[x].and.z.eq.[z] ! ! ! 'sl ' enddo x=0 do y=-10,10,2 nt/pl 10.ave%y%x y.eq.[y].and.z.eq.[z] ! ! ! 'sl ' enddo nt/pl 10.ave%y%x z.eq.[z] ! ! ! 's ' enddo endif enddo * exec plot1 return * a=0; for i in ????_?; do a=$[$a+1]; cat $i/log.results | awk '/^ OM / { om=$2 } /^ par: / { print '$a', om, $3, $4, $5 }'; done > out * cat out | awk '{ for(i=3;i<=5;i++) if($i>10 || $i<-10) break; if(i>=5) print }' > out.1 * cat out.1 | awk '{ om=$2; if( (om>=341 && om<=344) || (om>=383 && om<=386) || (om>=425 && om<=428) ) print }' > out.2 macro iceflow exec init1 set dmod 1 set MTYP 2 set YWIN 2.5 set YSIZ 22 zone 1 2 vec/rea i,om,x,y,z out.1 vec/cre a(10) R vec/cre b(10) R vec/cre e(10) R 10*1.e-2 vec/cre par(2) R vec/cre ppx(24) R dim=$VDIM(i,1) do ixy=1,3 if [ixy].eq.1 then xy='x' null 0 11 -20 20 elseif [ixy].eq.2 then xy='y' null 0 11 -20 20 elseif [ixy].eq.3 then xy='z' null 0 11 -20 20 endif ppn=0 do n=1,24 nom=$SIGMA(336+int(([n]-1)/8)*34+[n]) nab=0 do k=1,[dim] nno=om([k]) if [nno].eq.[nom] then nab=[nab]+1 vi=i([k]) vx=[xy]([k]) vec/inp a([nab]) [vi] vec/inp b([nab]) [vx] endif enddo if [nab].gt.2 then MESS [n] [nab] [dim] vec/pl b(1:[nab])%a(1:[nab]) ! sl vec/fit a(1:[nab]) b(1:[nab]) e(1:[nab]) P1 n 2 par p1=par(1) p2=par(2) fun/pl [p1]+([p2]*x) 1 10 s ppn=[ppn]+1 vec/inp ppx([ppn]) [p2] endif enddo if [ixy].eq.1 then atit 'season number' '[d]x "M# m "N#' elseif [ixy].eq.2 then atit 'season number' '[d]y "M# m "N#' elseif [ixy].eq.3 then atit 'season number' '[d]z "M# m "N#' endif MESS [ppn] sigma ppx=ppx/2 if [ixy].eq.1 then null -1 1 0 4 elseif [ixy].eq.2 then null -1 1 0 4 elseif [ixy].eq.3 then null -1 1 0 5 endif vec/pl ppx(1:[ppn]) 10 s * hi/fit 10 G s mean=$HINFO(10,'mean') rms=$HINFO(10,'rms') mean=$FORMAT([mean],f6.4) rms=$FORMAT([rms],f6.4) null 0 1 0 1 sa set chhe 0.4 set TXCI 2 itx 0.3 0.9 mean=[mean] itx 0.6 0.9 rms=[rms] set TXCI 1 atit 'slope "M# m/yr "N#' enddo exec plot1 a return macro init1 set * opt * pic/del * vec/del * hi/del * opt zfl opt NBOX set XMGL 3.0 set YMGL 2.4 set XVAL 0.8 set YVAL 0.4 set XLAB 2.0 set YLAB 1.4 set KSIZ .50 set GSIZ .50 set TSIZ .50 set ASIZ .50 set CSIZ .50 set PSIZ .50 set VSIZ .50 set SSIZ .50 set 2SIZ .50 igset LASI .50 igset TMSI .50 set HWID 5 set BWID 1 set PWID 5 set FWID 5 set XWID 1 set YWID 1 set CWID 5 igset LWID 5 igset TXFP -130 set CHHE .50 set cfon -40 set gfon -60 set lfon -40 set tfon -40 set vfon -40 return macro plot1 fort/file 66 [1].ps meta 66 -111 pict/plot * close 66 sh rm -f [1].ps.gz sh gzip [1].ps sh rm a.ps.gz sh ln -s [1].ps.gz a.ps.gz return