operin
C OPERIN SOURCE CB215821 20/11/25 13:35:27 10792 ************************************************************************ * NOM : ENTI * DESCRIPTION : Convertit si possible un objet en nombre entier ************************************************************************ * APPELE PAR : pilot.eso ************************************************************************ * ENTREES :: aucune * SORTIES :: aucune ************************************************************************ * SYNTAXE (GIBIANE) : * * OBJ2 = ENTI (|'TRONCATURE'|) OBJ1 ; * |'INFERIEUR' | * |'SUPERIEUR' | * |'PROCHE' | * ************************************************************************ SUBROUTINE OPERIN IMPLICIT INTEGER(I-N) IMPLICIT REAL*8(A-H,O-Z) -INC PPARAM -INC CCOPTIO -INC SMLENTI -INC SMLREEL -INC SMLMOTS -INC SMCHPOI * CHARACTER*8 CHA8 CHARACTER*32 CH32 * PARAMETER (NBRTYP=6) & 'LISTMOTS'/ * PARAMETER (NBROPT=4) CHARACTER*4 LISOPT(NBROPT) DATA LISOPT/'TRON','INFE','SUPE','PROC'/ * * * LECTURE DU TYPE DE CONVERSION * * LECTURE DU TYPE D'OBJET A CONVERTIR IF (IERR.NE.0) RETURN IF (NUMTYP.EQ.0) THEN * "On ne veut pas d'objet de type %m1:8" MOTERR(1:8)=CHA8 RETURN ENDIF * * * * +---------------------------------------------------------------+ * | O B J E T = E N T I E R | * +---------------------------------------------------------------+ * IF (NUMTYP.EQ.1) THEN IF (IERR.NE.0) RETURN * * RETURN * * * * +---------------------------------------------------------------+ * | O B J E T = F L O T T A N T | * +---------------------------------------------------------------+ * ELSEIF (NUMTYP.EQ.2) THEN IF (IERR.NE.0) RETURN * IVAL1=INT(XVAL1) IVAL1=FLOOR(XVAL1) IVAL1=CEILING(XVAL1) IVAL1=NINT(XVAL1) ENDIF * * RETURN * * * * +---------------------------------------------------------------+ * | O B J E T = L I S T R E E L | * +---------------------------------------------------------------+ * ELSEIF (NUMTYP.EQ.3) THEN IF (IERR.NE.0) RETURN * SEGACT,MLREEL SEGINI,MLENTI * DO 10 I=1,JG 10 CONTINUE DO 11 I=1,JG 11 CONTINUE DO 12 I=1,JG 12 CONTINUE DO 13 I=1,JG 13 CONTINUE ENDIF * SEGDES,MLREEL,MLENTI * * RETURN * * * * +---------------------------------------------------------------+ * | O B J E T = C H P O I N T | * +---------------------------------------------------------------+ * ELSEIF (NUMTYP.EQ.4) THEN IF (IERR.NE.0) RETURN * SEGINI,MCHPO1=MCHPOI NSOUPO=MCHPO1.IPCHP(/1) DO 20 I=1,NSOUPO MSOUPO=MCHPO1.IPCHP(I) SEGINI,MSOUP1=MSOUPO MCHPO1.IPCHP(I)=MSOUP1 * MPOVAL=MSOUP1.IPOVAL SEGINI,MPOVA1=MPOVAL MSOUP1.IPOVAL=MPOVA1 * N=MPOVA1.VPOCHA(/1) NC=MPOVA1.VPOCHA(/2) DO 210 J=1,NC DO 220 K=1,N MPOVA1.VPOCHA(K,J)=INT(MPOVA1.VPOCHA(K,J)) 220 CONTINUE 210 CONTINUE DO 230 J=1,NC DO 240 K=1,N MPOVA1.VPOCHA(K,J)=FLOOR(MPOVA1.VPOCHA(K,J)) 240 CONTINUE 230 CONTINUE DO 250 J=1,NC DO 260 K=1,N MPOVA1.VPOCHA(K,J)=CEILING(MPOVA1.VPOCHA(K,J)) 260 CONTINUE 250 CONTINUE DO 270 J=1,NC DO 280 K=1,N MPOVA1.VPOCHA(K,J)=NINT(MPOVA1.VPOCHA(K,J)) 280 CONTINUE 270 CONTINUE ENDIF * SEGDES,MSOUP1,MPOVA1 20 CONTINUE * SEGDES,MCHPO1 * * RETURN * * * * +---------------------------------------------------------------+ * | O B J E T = M O T | * +---------------------------------------------------------------+ * ELSEIF (NUMTYP.EQ.5) THEN IF (IERR.NE.0) RETURN * WRITE(CHA8,FMT='("(I",I2,")")') IRETOU READ(CH32(1:IRETOU),FMT=CHA8,IOSTAT=IOS) IVAL1 IF (IOS.NE.0) THEN WRITE(CHA8,FMT='("(F",I2,".0)")') IRETOU READ(CH32(1:IRETOU),FMT=CHA8,ERR=999) XVAL1 IVAL1=INT(XVAL1) IVAL1=FLOOR(XVAL1) IVAL1=CEILING(XVAL1) IVAL1=NINT(XVAL1) ENDIF ENDIF * * RETURN * * * * +---------------------------------------------------------------+ * | O B J E T = L I S T M O T S | * +---------------------------------------------------------------+ * ELSEIF (NUMTYP.EQ.6) THEN IF (IERR.NE.0) RETURN * SEGACT MLMOTS SEGINI MLENTI * DO 30 I=1,JG IF (IOS.NE.0) THEN LECT(I)=INT(XVAL1) ENDIF 30 CONTINUE DO 31 I=1,JG IF (IOS.NE.0) THEN LECT(I)=FLOOR(XVAL1) ENDIF 31 CONTINUE DO 32 I=1,JG IF (IOS.NE.0) THEN LECT(I)=CEILING(XVAL1) ENDIF 32 CONTINUE DO 33 I=1,JG IF (IOS.NE.0) THEN LECT(I)=NINT(XVAL1) ENDIF 33 CONTINUE ENDIF * SEGDES,MLMOTS,MLENTI * * RETURN ENDIF * * * * /!\ ERREUR LORS DE LA CONVERSION MOT=>FLOTTANT RETURN * END *
© Cast3M 2003 - Tous droits réservés.
Mentions légales