From: Alan Xiao <Alan.Xiao@cognigencorp.com>
Subject: How to perform integer operations in NONMEM
Date: Tue, 01 May 2001 21:40:04 +0000
Hi, NONMEM users,
Does any one know how to perform integer operations in NONMEM?
For example, I have two variable: Var1 and Var2 and I want calculate integer VarINt as:
VarInt = the integer part of Var1/Var2
In regular FORTRAN program, it is simple: VarInt = INT(Var1/Var2)
But in NONMEM, the function INT() seems not working.
From: "Gibiansky, Ekaterina" <email@example.com>
Subject: RE: How to perform integer operations in NONMEM
Date: Wed, 2 May 2001 08:12:38 -0400
you will have to write a verbatim code to use all functions available in Fortran.
I attached the reference from NM Help below.
Ekaterina Gibiansky, PhD
7250 Parkway Drive, Suite 430
Hanover, MD 21076
Voice (410) 782-2234
FAX (410) 712-0737
| VERBATIM CODE |
MEANING: FORTRAN statements
CONTEXT: Abbreviated code
" verbatim line
Verbatim code is FORTRAN code within a block of abbreviated code that
is to be copied by NM-TRAN to the generated FORTRAN subroutine. It is
not itself regarded as abbreviated code. Such code is marked by hav-
ing the character " as the first non-blank character. The " is
dropped and the characters to the right are copied as-is to columns
1-72 of the generated subroutine. Lines of verbatim code can include
any FORTRAN statements: comment, declaration (e.g., INTEGER, COMMON),
I/O, CALL, assignment, continuation, DO, GOTO, etc.). Lower-case
characters can be used freely, if the FORTRAN compiler permits them.
NM-TRAN does make some modifications to verbatim code, as follows:
Placement of code
The verbatim code is adjusted as necessary to conform to FORTRAN
column conventions. Alphabetic text that follows the initial ",
or that follows a statement number, is moved to column 7, as
required by FORTRAN, except for:
If the character that immediately follows the initial " is C or
c, this conforms to the usual FORTRAN syntax for comment lines,
and the line is copied unchanged, including C or c. Example:
"C this is a comment
If blanks occur in positions 1-5 following the initial " and a
non-blank in position 6, this conforms to the usual FORTRAN syn-
tax for continuation lines, and the text is not moved from these
" X +D/E
In $PK, $ERROR, and $PRED, labels of items in the data record are
replaced by direct references to the data record itself (either
DATREC or EVTREC, as appropriate). Thus, for example, if the
left-hand side of an assignment statement is such a label, the
data record itself is modified ("transgenerated"). Without this
rule, only a local variable having the same label would be
affected. The character @, immediately before a label, can be
used as an "escape" to prevent the label from being replaced
under this rule.
If the character @ immediately follows the initial ", the entire line
is copied unchanged (except that the characters "@ are deleted).
By default, all verbatim code goes in the main section of code and is
called MAIN verbatim code. (The main section follows declarations and
initial executable code inserted by NM-TRAN.) Within the main section,
verbatim and abbreviated code may be freely mixed. Each line of ver-
batim code is positioned in the generated code after all code gen-
erated from the preceding line of abbreviated code. The user may
explicitly specify a different location as follows.
FIRST verbatim code
Verbatim lines which must be positioned immediately after the
declarations which are part of the normal subroutine header, and
prior to the FIRST executable statement of the subroutine, must
precede the first line of abbreviated code and must start with
the line "FIRST.
MAIN verbatim code
FIRST verbatim code is normally terminated by the first line of
abbreviated code. If there is both FIRST and MAIN verbatim code,
and/or the main section is to start with verbatim code, the line
"MAIN may be used to separate the FIRST and MAIN verbatim code.
LAST verbatim code
Verbatim lines which are to immediately precede the RETURN state-
ment from the generated subroutine must follow the last line of
abbreviated code and must be preceded by the line "LAST.
" PRINT *,HH(1,1)
This displays values after they have been assigned, immediately
prior to the return.
If any lines of verbatim code are present in a block of abbreviated
code, NM-TRAN generates COMMON statements appropriate to the kind of
abbreviated code and allows variables undefined in abbreviated code to
be used as right-hand quantities in abbreviated code.
Verbatim code is meant for use by expert users of NONMEM who are able
to understand the generated FORTRAN subroutine and check that the ver-
batim code has the desired effect.
REFERENCES: Guide IV, section IV.I (p. 52)