C Library Functions  - assert (3)

NAME

assert(3f) - [M_framework__msg] print filename, linenumber, and message to stderr and stop program (LICENSE:PD)

CONTENTS

Synopsis
Description
Options
Examples
Author
License

SYNOPSIS

function assert(file,linenum,expr,g1,g2,g3,g4,g5,g6,g7,g8,g9, & & ga,gb,gc,gd,ge,gf,gg,gh,gi,gj)
character(len=*),intent(in)
  :: file
character(len=*),intent(in)
  :: linenum
logical,intent(in)
  :: expr class(*),intent(in),optional :: g1,g2,g3,g4,g5,g6,g7,g8,g9 class(*),intent(in),optional :: ga,gb,gc,gd,ge,gf,gg,gh,gi,gj

DESCRIPTION

assert(3f) prints strings to stderr and then stops program with exit code 1 It labels the first string as the filename, the next integer parameter as the linenumber, and then up to twenty scalar values.

It is primarily intended for use by the prep(1) preprocessor $ASSERT directive

OPTIONS

filename
  a string assumed to be the current filename when compiling
linenum
  assumed to be the line number of the source code the ASSERT(3f) procedure was called at.
expr logical value
g[1-9a-j]
  optional value(s) to print as a message before stopping. May be of type INTEGER, LOGICAL, REAL, DOUBLEPRECISION, COMPLEX, or CHARACTER.

EXAMPLES

Sample program:

   program demo_assert
   use M_framework__msg, only : assert
   implicit none
   real :: a, toobig=1024
   a=2000
   call assert(’myroutine’, 101, a > toobig, &
           & ’The value is too large’, a, ’ > ’, toobig)
   end program demo_assert

AUTHOR

John S. Urban

LICENSE

Public Domain


Nemo Release 3.1 assert (3) February 23, 2025
Generated by manServer 1.08 from 0d549b24-2d6a-4ec1-8a45-ca34a87f3cb8 using man macros.