chmsl4
C CHMSL4 SOURCE CB215821 17/11/30 21:15:32 9639 C ISSU DE TRIOEF (TRSOL4 ET TREXCO) C----------------------------------------------------------------------- C DYNAMIC SELECTION OF COMPONENT TO BE SUBSTITUTED C CRITERION : IN EACH STEP, ELIMINATE COMPONENT WHOSE MAXIMUM C ABSOLUTE MASS BALANCE CONTRIBUTION IS A MINIMUM. IF TWO COM- C PONENTS ARE EQUIVALENT, TAKE THE ONE WITH HIGHER LOCAL INDEX. C----------------------------------------------------------------------- C FEBRUARY 13, 1983 M. SCHWEINGRUBER / EIR C MODIFIED MAY 6, 1983 M. SCHWEINGRUBER / EIR C----------------------------------------------------------------------- C ICTL - CONTROL OF V-VECTOR BUILD-UP C 1 : C(I) UNKNOWN FOR DISSOLVED SPECIES C 2 : GOOD C(I) GUESSES AVAILABLE FOR DISS. SPECIES C--------------------------------------------------------------------- C C VBID ET JEX DIMENSION NXDIM (remplace 60) C POUR L'INSTANT ON NE FAIT PAS UN SEGINI CAR LE SP C EST DANS DES BOUCLES C---------------------------------------------------------------------- C IMPLICIT INTEGER(I-N) IMPLICIT REAL*8 (A-H,O-Z) -INC PPARAM -INC CCOPTIO C SEGMENT IDSCHI REAL*8 GK(NYDIM),AA(NYDIM,NXDIM),FF(NZDIM,NPDIM) INTEGER IDX(NXDIM),IDY(NYDIM),IDZ(NZDIM),IDP(NPDIM),NN(6) INTEGER IDECY(NYDIM),IONZ(NXDIM) CHARACTER*32 NAME(NXDIM),NAMESP(NYDIM) ENDSEGMENT SEGMENT SP2 REAL*8 GX(NXDIM),XX(NXDIM),GS(NZDIM),SS(NZDIM) REAL*8 TOT(NXDIM),TOTAQ(NXDIM),TOTFIX(NXDIM),GKS(NZDIM) REAL*8 YY(NXDIM),ZZ(NXDIM,NXDIM),CC(NYDIM),GC(NYDIM) ENDSEGMENT SEGMENT IZVBID INTEGER JEX(NXDIM) REAL*8 VBID(NXDIM) ENDSEGMENT CHARACTER*32 NAMINT C DIMENSION JEX(60),VBID(60) C NXDIM=IDX(/1) NYDIM=IDY(/1) NZDIM=IDZ(/1) NPDIM=IDP(/1) ********************************************************************* C PRISE EN COMPTE DES SOLUTIONS SOLIDES : METHODE 1 N4S=0 * IF(NZDIM.NE.0)THEN * I3S=NN(1)+NN(2)+NN(3)+1 * I4S=NN(1)+NN(2)+NN(3)+NN(4) * DO 13 I7S=I3S,I4S * IDY7=IDY(I7S) * CALL CHIADY(IDZ,NZDIM,IDY7,ID7) * IF(ID7.NE.0)THEN * N4S=N4S+1 * CALL CHMREX(IDSCHI,LGKMOD,LGKTMP,IDY7,4,5) * CALL CHMREX(IDSCHI,LGKMOD,LGKTMP,IDY7,5,4) * ENDIF * 13 CONTINUE * ENDIF ********************************************************************* LL=NN(3)+NN(4)-N4S IF (LL.EQ.0) RETURN I0=LL+NN(1)+NN(2)+1 J0=NXDIM+1 C--------INITIALISATION V-VECTOR IF (ICTL.GT.1) GOTO 51 VV0=1.D-7 DO 10 J=1,NXDIM VV=ABS(TOT(J)) IF (IDX(J).EQ.50) VV= MAX(VV,VV0) VBID(J)=VV 10 CONTINUE GOTO 52 51 CONTINUE L1=NN(1)+NN(2) DO 20 J=1,NXDIM VBID(J)=0.D0 DO 21 I=1,L1 VV=ABS(AA(I,J)*CC(I)) VBID(J)= MAX(VBID(J),VV) 21 CONTINUE 20 CONTINUE 52 CONTINUE C.......DYNAMIC SELECTION OF JEXC DO 601 L=1,LL I0=I0-1 J0=J0-1 NEX=0 *********************************************************************** C PRISE EN COMPTE DES SOLUTIONS SOLIDES : METHODE 1 * IF(NZDIM.NE.0)THEN * IDY0=IDY(I0) * CALL CHIADY(IDZ,NZDIM,IDY0,ID0) * IF(ID0.NE.0)THEN * write(6,*)'chmsl4 idz(id0)',IDZ(ID0),'idx(j0)',IDX(J0) * J0=J0+1 * GOTO 601 * ENDIF * ENDIF ************************************************************************ C....... PRELIMINARY CHECKS DO 602 J=1,J0 IF (ABS(AA(I0,J0-(J-1))).LT.1.D-3)THEN ************************************************************************ C PRISE EN COMPTE DES SOLUTIONS SOLIDES : METHODE 1 * IF(NZDIM.NE.0)THEN * IF(J.EQ.J0)THEN * J0=J0+1 * GOTO 601 * ELSE * GOTO 602 * ENDIF * ELSE ************************************************************************* GOTO 602 ************************************************************************ * ENDIF ************************************************************************* ELSE NEX=NEX+1 JEX(NEX)=J0-(J-1) ENDIF 602 CONTINUE C C IF (NEX.EQ.0) THEN IF(IIMPI.GE.1)THEN DO 60 IIJ=1,NXDIM IDXJ = IDX(IIJ) WRITE(6,670) IDXJ,XX(IIJ),GX(IIJ),TOT(IIJ),YY(IIJ),NAME(IDXJ) 60 CONTINUE ENDIF 670 FORMAT('0',I5,2X,1PE11.4,2X,0PF8.3,2(2X,1PE11.4),5X,A10) C WRITE(6,*) 'PHASE RULE VIOLATION' c modif PhM: Probleme dans la regle des phases. c on n'arrete pas le calcul mais on signale le probleme, erreur 7 IEM=7 c WRITE(6,*) 'Probleme pour la regle des phases' c CALL ERREUR(780) c modif PhM RETURN ENDIF C C....... SELECT JEXC AMONG JEX-ELEMENTS JEXC=JEX(1) IF (NEX.EQ.1) GOTO 666 VVMIN=ABS(VBID(JEXC)/AA(I0,JEXC)) DO 610 J=2,NEX JJ=JEX(J) VV=ABS(VBID(JJ)/AA(I0,JJ)) IF (VV.GE.VVMIN) GOTO 610 JEXC=JJ VVMIN=VV 610 CONTINUE C........ EXCHANGE COLUMNS JEXC AND J0 666 CONTINUE C C CALL TREXCO(SP1,SP2,JEXC,J0) IV=IDX(J0) IDX(J0)=IDX(JEXC) IDX(JEXC)=IV VV=XX(JEXC) XX(JEXC)=XX(J0) XX(J0)=VV VV=GX(JEXC) GX(JEXC)=GX(J0) GX(J0)=VV VV=TOT(JEXC) TOT(JEXC)=TOT(J0) TOT(J0)=VV IV=IONZ(J0) IONZ(J0)=IONZ(JEXC) IONZ(JEXC)=IV NAMINT=NAME(J0) NAME(J0)=NAME(JEXC) NAME(JEXC)=NAMINT DO 603 I=1,NYDIM VV=AA(I,JEXC) AA(I,JEXC)=AA(I,J0) AA(I,J0)=VV 603 CONTINUE C * write(6,*)'chmsl4 idx(j0)',IDX(J0),'idy(i0)',IDY(I0) * write(6,*)'chmsl4 aa(i0,j0)',AA(I0,J0) VV=VBID(JEXC) VBID(JEXC)=VBID(J0) VBID(J0)=VV NXS=J0-1 NCS=I0-1 C MODIFY A,T,V DO 600 I=1,NCS * write(6,*)'chmsl4 idy',idy(i) * write(6,*)'chmsl4 aa(io,jo)',aa(i0,j0),'aa(i,jo)',aa(i,j0) DO 604 J=1,NXS AA(I,J)=AA(I,J)-AA(I0,J)*AA(I,J0)/AA(I0,J0) * write(6,*)'chmsl4 idx',idx(j) * write(6,*)'chmsl4 aa(io,j)',aa(i0,j),'aa(i,j)',aa(i,j) 604 CONTINUE 600 CONTINUE * write(6,*)'chmsl4 idy(io)',idy(i0) DO 605 J=1,NXS TOT(J)=TOT(J)-AA(I0,J)*TOT(J0)/AA(I0,J0) * write(6,*)'chmsl4 idx',idx(j),'tot',TOT(J) * write(6,*)'chmsl4 aa(io,j)',aa(i0,j),'tot(jo)',tot(j0) * write(6,*)'chmsl4 aa(io,jo)',aa(i0,j0) 605 CONTINUE *********************************************************************** C PRISE EN COMPTE DES SOLUTIONS SOLIDES : METHODE 1 * IF(NZDIM.NE.0)THEN * IDY0=IDY(I0) * CALL CHIADY(IDZ,NZDIM,IDY0,ID0) * IF(ID0.NE.0)THEN * GAJ=0.D0 * DO 606 IJ=1,NPDIM * IF(FF(ID0,IJ).NE.0.D0)THEN * GAJ=GAJ+FF(ID0,IJ)*LOG10(ABS(FF(ID0,IJ))) * ENDIF *606 CONTINUE * DO 607 I=1,NCS * GK(I)=GK(I)-AA(I,J0)*(GK(I0)-GAJ)/AA(I0,J0) *607 CONTINUE * ELSE * IF(NZDIM.NE.0)THEN * IDY0=IDY(I0) * CALL CHIADY(IDP,NPDIM,IDY0,ID0) * DO 606 K=1,NZDIM * IF(FF(K,ID0).NE.0.D0) GOTO 800 *606 CONTINUE *800 CONTINUE * DO 607 I=1,NCS * IF(FF(K,ID0).EQ.0.D0)THEN * GK(I)=GK(I)-AA(I,J0)*GK(I0)/AA(I0,J0) * ELSE * LF=LOG10(ABS(FF(K,ID0))) * GK(I)=GK(I)-AA(I,J0)*(GK(I0)-LF)/AA(I0,J0) * ENDIF ** write(6,*)'chmsl4 idy',IDY(I),'gk',GK(I) *607 CONTINUE * ELSE ************************************************************************ DO 608 I=1,NCS GK(I)=GK(I)-AA(I,J0)*GK(I0)/AA(I0,J0) 608 CONTINUE *********************************************************************** * ENDIF * ENDIF * ENDIF *********************************************************************** DO 609 J=1,NXS VV=ABS(AA(I0,J)*VBID(J0)/AA(I0,J0)) VBID(J)= MAX(VBID(J),VV) 609 CONTINUE 601 CONTINUE C RETURN END C
© Cast3M 2003 - Tous droits réservés.
Mentions légales