c c Sort the set of couples in page mode , call print for every page c and prepare average computation c c input arguments c c a : atomic weight c idx : application {l1,..,l(nel-1)} -> {1,..,nel-1} c according to D-H-Z sorting c naem : end member names c ncp : number of couples in computing an average c nv : valence c oxcpd : chemical formula c sym : atom symbol c cptox : switch for WT % oxide calculation c igr : species group number c imod : resume mode c isw : analysis mode c isws : number of negative valence(s) c mato : number of cations ( geo ) c mnel : loop parameter c na : number of measured elements c nbh2o : number of water mol. c nel : total number of elements in the unknown c npol : number of poles c LEG : maximum number of elements c c output arguments c c ato : atom% or number of cations c c : W% concentration or W% of oxide c pole : end member contribution c sigsk : sigma/k c CW : W% concentration or oxyde | c c XYOUT = 0 normal exit c XYOUT = 1 error exit c function XYOUT(a,ato,c,idx,naem,NR39,nv,oxcpd,pole,XYCRD,TARG0 &,sigsk,sym,CW,cptox,igr,imod,isw,isws,mato,mnel,na,nbh2o,nel &,npol,LEG,LPO) INTEGER*4 XYZ(3) character*80 bla character*2 sym(LEG) CHARACTER*9 TARG0, TARG character*10 oxcpd(LEG) logical cptox, XYCRD character*4 naem(6) dimension a(LEG),ato(LEG),c(LEG),idx(LEG) &,nv(LEG),pole(LPO),sigsk(LEG),CW(LEG) common/lui/lu5,lu6,lu7,lu2,lu3,lu9,LU4 C C 904 format(10(1x,f7.3)) 905 format(10(1x,f8.5)) 906 format(10(5x,f4.1)) 907 format(a80) c XYOUT=0 c C C Print labels: x, y, comment C WRITE(LU2,740) 740 format(1x,',','" X "',',','" Y "',',','"Comment"') C C C Read data from label.cor and from xyzpos.dat C do 2 i=1,3 xyz(i)=0 2 continue do 1 icp=1,NR39 IF (.NOT.(XYCRD)) GO TO 6 ! if untrue, do not read xyzpos 3 READ(lu4,4,end=97) TARG,XYZ,BLA 4 FORMAT(A9,3(1X,I7),A46) IF(TARG.NE.TARG0) GO TO 3 ! skip label if inappropriate C 6 read(lu9,907,end=99) bla if(isw.ne.7) go to 666 read(lu9,904,end=99)(c(i),i=1,nel-1) read(lu9,904,end=99)(ato(i),i=1,nel-1) read(lu9,904,end=99) (pole(i),i=1,LPO) go to 667 666 read(lu9,904,end=99)(c(i),i=1,nel) read(lu9,904,end=99)(ato(i),i=1,nel) 667 continue c c c print a line of data c 6664 format(1x,',',i7,',',i7,',','"',a40,'"') c WRITE(LU2,6664) &(XYZ(I),I=1,2), ! X & Y &BLA ! COMMENT 1 continue write(lu5,6663) 6663 format(/1x,'finished writing x,y and the comment...') return c c error handling c 97 XYOUT=-1 write(lu7,313) 313 format(/1X,' error during read of xyzpos.dat file') return 99 XYOUT=-1 write(lu7,314) 314 format(/1X,' error during read of .cor file') return end