NMTRAN bug fix

From: Alison Boeckmann Date: September 25, 2000 technical Source: cognigencorp.com
From: ABoeckmann <alison@c255.ucsf.edu> Subject: NMTRAN bug fix Date: Mon, 25 Sep 2000 08:34:34 -0700 (PDT) Nick Holford and Jean Xavier Mazoit have recently sent email describing a bug in NMTRAN that affects both generated and NMTRAN Library routines when the abbreviated code contains nested IF statements. The bug does not in fact affect all codes with nested IF statements. The bug may affect abbreviated code in which a variable is defined in an ELSE block and then redefined in another ELSE block which is nested within the first ELSE block. If you can avoid such nested ELSE blocks, you will avoid the bug. The chances are good that you have not encountered this bug, and can easily avoid it in the future, because the bug *cannot* affect the following kinds of code: 1) Code defining random variables. Nested IF statements cannot be used in such code. 2) Initialization, finalization or simulation blocks, i.e., a block of code that starts with one of the following: IF (ICALL.EQ.0) THEN IF (ICALL.EQ.1) THEN IF (ICALL.EQ.3) THEN IF (ICALL.EQ.4) THEN 3) Nested IF statements that do not contain ELSE within ELSE. You can fix this bug by making changes to NM-TRAN source code, as described below. Once CPYOLD and SAVOLD source code have been changed, NMTRAN must be recompiled. (See Users Guide III, p, 125 and p. 130, in which we suggest erasing all object modules (.obj or .o) in the tr subdirectory, and using the SETUP command as it was originally typed.) Here are changes you may make to the NM-TRAN source code. 1) Changes to subroutine CPYOLD Note that character "X" must be in column 6 of the Fortran source record. Locate: IF (LHSTYP(K).EQ.35.AND.LHSPOS(K).EQ.ITEMP) THEN Replace with: IF (LHSTYP(K).EQ.35.AND. X (LHSPOS(K).EQ.SAVTRU(I).OR.LHSPOS(K).EQ.SAVELS(I))) THEN Locate: IF (RHSTYP(J).EQ.35.AND.RHSPOS(J).EQ.ITEMP) THEN Replace with: IF (RHSTYP(J).EQ.35.AND. X (RHSPOS(J).EQ.SAVTRU(I).OR.RHSPOS(J).EQ.SAVELS(I))) THEN 2) Changes to subroutine SAVOLD Locate: DO 75 J=1,KOLD Replace with: DO 75 J=KOLD,1,-1 Locate: JOLD=J Replace with: IF (SAVTRU(J).EQ.0) GO TO 80 JOLD=J
Aug 26, 2000 Nick Holford Warning: NMTRAN does not interpret conditional abbreviated code properly
Aug 29, 2000 Jean Xavier Mazoit Conditional statements and NMTRAN
Aug 30, 2000 Alison Boeckmann nested if
Sep 25, 2000 Alison Boeckmann NMTRAN bug fix