___________________________________________________________________
 |                                                                 |
 |                                PRCOMG                           |
 |_________________________________________________________________|

 MEANING: PREDPP common
 CONTEXT: For use with PREDPP

 This feature is not fully documented.  The interested user may be able  L
 to  obtain  more  information  by studying the appropriate sections of  L
 PREDPP code.                                                            L

 USAGE:
 $PK
 "FIRST
 " COMMON /PRCOMG/ MITER,METH,IMAX,ISTFLG,INTFLG
 " INTEGER MITER,METH,IMAX,ISTFLG,INTFLG
 " IMAX=200000

 DISCUSSION:
 The common allows the user to over-ride certain  default  settings  in
 ADVAN6, ADVAN8, ADVAN9, and SS6.

 MITER and METH

   PREDPP sets MITER and METH to default values with every new  indivi-
   dual or reset record.

   ADVAN8
        Always use METH=2.  If user set MITER, use his  value.   Other-
        wise, use MITER=2.

   ADVAN9
        If user set METH, use MF=METH*10 in call to LSODI.   Otherwise,
        use MF=20

        If user did not set MITER, then set MITER to 1 (if  no  popula-
        tion etas) or 2 (if population etas).

        If user did set MITER, use his value.

 IMAX

   ADVAN6, ADVAN8, ADVAN9, SS6
        The variable MAXCAL gives the maximum number of calls  to  FCN1
        (ADVAN6,  ADVAN8,  SS6)  or  RES (ADVAN9) during an integration
        interval.
        Each of the above routines sets MAXCAL to the  value  given  by  |
        MAXFCN (a parameter in the include file SIZES) at the start of   |
        each integration interval unless the user supplies a  value  in
        IMAX, in which case the user's value is used.

 ISTFLG

   ADVAN9
        ISTFLG controls how ADVAN9 calls LSODI1 and  what  it  does  if
        LSODI1  returns  and  indicates  that  an  integration  failed.
        ISTFLG is set to 0 (default) at ICALL=0.   If  changed  by  the
        user,  it  retains  the changed value until the user changes it
        again.  ISTATE is a variable that  is  passed  from  ADVAN9  to
        LSODI1.   ISTATE=1  indicates that the integration is starting.
        ISTATE=2 indicates that this call  is  a  continuation  from  a
        prior  successful  integration.   Default: Use ISTATE=1 for the
        first integration, and ISTATE=2 for a continuation when nothing
        external  to  ADVAN9  has  changed.   In  case  of failure with
        ISTATE=2, restore original inputs and try again with ISTATE=1.

   ISTFLG=1
        Never try ISTATE=2, always use ISTATE=1.

   ISTFLG=2
        Never retry (only try ISTATE=2).

 INTFLG

   ADVAN6, SS6, ADVAN8

   INTFLG stands for "Integration Flag" and affects the number of calls
   to  the  integrating  subroutine during each advance.  It is only of
   interest when second derivatives of the state vector are calculated.

   It is present because there may be some trade-off between  run  time
   and  accuracy  of computation.  More calls to the integrator, with a
   smaller number of derivatives obtained with  each  call,  result  in
   longer  run times, but might also produce more accurate derivatives.
   Also, it might provide more consistent computations when the  number
   of comparments and/or etas is to be changed.

   Default is -1.  User may set to any other value in user-written code
   (e.g., with verbatim code in $PK).

   PREDPP examines this value after the first call to PK for an indivi-
   dual  record,  so  that it can be set on an individual-by-individual
   basis.  PREDPP examines INTFLG when NEWIND=0  or  1  (i.e.,  at  the
   start  of  an individual's data).  Presumably, this is the only time
   that NONMEM might change the LVOUT array in ROCM15.

   When INTFLG is set to any other value than -1, ADVAN6 and SS6 calcu-
   late second derivatives "one group at a time".

   E.g., suppose etas 1, 2, 3 are active.

        1) call DVERK to obtain 2nd derivatives 1,1
        2) call DVERK to obtain 2nd derivatives 1,2 and 2,2
        3) call DVERK to obtain 2nd derivatives 1,3 and 2,3 and 3,3

        (Each calculation involves the integration of the state vector,
        augmented  by  the  relevant first derivative(s) and the second
        derivatives for one eta.)

        Thus, the maximum number of differential equations  that  would
        ever be integrated at one time is

            PW=2*PE*PM+PM
        Where:  (PE is the maximum number of etas; currently 10)
        (PM is the maximum number of compartments - 1; currently 9)
        PW is the size defined for various work arrays  in  the  source
        code.
        It is currently defined as above (189).

   When INTFLG is -1, ADVAN6/SS6 makes the most efficient  use  of  the
   work  arrays when computing second derivatives, to reduce the number
   of calls to DVERK.

   At NEWIND=0 or 1, PREDPP looks at the number of active etas for this
   individual  and  the  number of user-defined compartments defined by
   the MODEL subroutine (NCM), and creates a  scheme  to  calculate  as
   many  groups  of 2nd. derivatives at once as it can.  (Although com-
   partments may be turned on and off within the data set, PREDPP  does
   not revise the scheme of integration each time.)

        E.g., with the current values of PE, PM, and PW, here are  some
        schemes  of  integration.  Under "nth. call" are the etas whose
        second derivatives are computed with that call to DVERK.

        # compts.  1st. call     2nd. call    3d. call  4th. call
           9       etas 1 - 5    etas 6 - 7   eta 8     eta 9
           8       etas 1 - 5    etas 6 - 7   eta 8     eta 9
           7       etas 1 - 5    etas 6 - 7   eta 8 - 9
           6       etas 1 - 6    etas 7 - 8   eta 9
           5       etas 1 - 7    etas 8 - 9
           4       etas 1 - 8    etas 9
           3       etas 1 - 9

   Changing the size of the work arrays:

   If the system is large enought that integration involves  more  than
   one call to DVERK, and the user would like all second derivatives to
   be computed with a single call to DVERK, the  source  code  must  be
   changed to define a larger value for PW.

   To integrate the maximum number of  etas  and  compartments  in  one
   call, set:

     PW=PM*(1+PE+PE*(PE+1)/2)

   With the current values of PE and PM, PW=594

   Suppose PW is changed, but by accident  is  made  smaller  than  the
   default  (2*PE*PM+PM=189).   Then for problems with large numbers of
   compartments and/or etas, the work arrays will not be large  enough,
   with either INTFLG=-1 or INTFLG!=-1.

   A new error message exists in PREDPP, for which PRED exit code is  2
   (always abort).

   WORK ARRAYS ARE TOO SMALL FOR 2ND. DERIVS.  INCREASE PW, OR DECREASE
   NO. OF. COMPTS AND/OR ETAS, OR USE DERIV2=NO

   Again, this message cannot occur unless the source code of PREDPP is
   changed incorrectly.

   REFERENCES: None.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   


  
Go to main index.
  
Created by nmhelp2html v. 1.0 written by Niclas Jonsson (Modified by AJB 5/2006,11/2007)