Documentation

8.5 Unsupported constructs and diagnostic boundaries

nlmx intentionally interprets abbreviated code rather than embedding a Fortran compiler. A physical line beginning with " denotes verbatim Fortran and is rejected with exit code 5 (unsupported feature) and a hint to move the logic into abbreviated statements.

The Chapter 8 fixture ctlunsupported-verbatim.ctl exercises this boundary. It fails during model startup before fitting, and the captured log contains the exact rejected line.

Other hard boundaries

Model construction rejects:

  • user-supplied routines named in $SUBROUTINES;
  • an ADVAN number not in the implemented library;
  • an unsupported TRANS for a supported ADVAN;
  • nonlinear general ADVANs without $DES;
  • general models without $MODEL compartments;
  • missing required PK variables for the selected TRANS;
  • undefined names or illegal array targets;
  • simultaneous $PRED and $PK;
  • a compartment model without $ERROR or code that never assigns Y.

Runtime checks add further boundaries: negative/non-finite rates, invalid compartments, missing Rn/Dn for modelled infusions, negative lag times, ODE step exhaustion, non-finite amounts and non-terminating loops.

Accepted but not equivalent

Ignored CALL, COMRES and related directives are safe only when they truly do not affect the likelihood. $TABLE records may be read while nlmx writes its own tables. A note that $DES is ignored under an analytic ADVAN means the analytic library, not the written ODE, controls predictions.

Unsupported behavior should fail loudly. A parser that accepts syntax but changes meaning is more dangerous than one that refuses it.

Compatibility inventory

For a control stream imported from NONMEM, create a line-by-line inventory:

Construct nlmx status Evidence
$PK assignment executed parser test + prediction
CALL accepted/ignored build note or source classification
Verbatim block rejected exit 5 fixture
User routine rejected startup validation

Common mistakes

  • Equating parse success with semantic equivalence.
  • Removing unsupported code without proving it was irrelevant.
  • Suppressing startup notes during automated validation.

Checklist

  • Inventory every nontrivial construct.
  • Require a loud failure for unsupported scientific behavior.
  • Preserve negative fixtures and their expected exit codes.

Further reading

See control-flow support, accuracy boundaries and the captured txtunsupported-verbatim log.