Re: fortran question
From: Nick Holford <n.holford@auckland.ac.nz>
Subject: Re: fortran question
Date: Tue, 28 Nov 2000 08:22:59 +1300
Joern,
Here is a working example. It illustrates use of verbatim code to extend a Fortran statement. In this case the line:
"E0=E0+
would be illegal if the next verbatim line was not recognized as a continuation line.
Note that while the first verbatim line has no preceding blanks the subsequent examples of continuation lines have exactly 5 blanks before the continuation character (I show the use of *, % and & as continuation chars which were acceptable to the Compaq Visual Fortran compiler version 6.5).
My example does not change the value of E0 so I was able to check that this gave the same output as I get without the verbatim code.
If I code the first verbatim line as:
" E0=E0+
i.e. exactly 5 blanks before E0 the compiler uses an error message. So be careful with the number of blanks you put before verbatim code statements.
$PROB theophylline pharmacodynamics
$DATA theopd.dat IGNORE #
$INPUT ID TIME THEO AGE WT GEND RACE DIAG PEFR=DV
$ESTIM
$COV
$THETA (0,150.,) ; E0
$THETA (0,200.,) ; EMAX
$THETA (.001,10,) ; EC50
$OMEGA 0.5 ; CVE0
$OMEGA 0.5 ; CVEMAX
$OMEGA 0.5 ; CVEC50
$SIGMA 100 ; SD 1
$PRED
E0= THETA(1)*EXP(ETA(1))
EMAX=THETA(2)*EXP(ETA(2))
EC50=THETA(3)*EXP(ETA(3))
"E0=E0+
" *0D0+
" %0D0+
" &0D0
Y = E0 + EMAX*THEO/(THEO+EC50) + ERR(1)
$TABLE ID TIME E0 NOPRINT ONEHEADER FILE=long.fit
A fragment of the generated FSUBS.for showing what happens is here:
C A00040 = DERIVATIVE OF EC50 W.R.T. ETA(03)
A00040=THETA(03)*B00003
E0=E0+
*0D0+
%0D0+
&0D0
B00004=THEO+EC50
Nick
--
Nick Holford, Divn Pharmacology & Clinical Pharmacology
University of Auckland, 85 Park Rd, Private Bag 92019, Auckland, New Zealand
email:n.holford@auckland.ac.nz tel:+64(9)373-7599x6730 fax:373-7556
http://www.phm.auckland.ac.nz/Staff/NHolford/nholford.htm