The F90 interface is specified in errorhandling.f90. If only a text message is needed, the following suffices:
call message(AppMsg,Verbose,'taska v1.0') call warning('diskLow','Disk capacity is low') call error('invalidIndex','invalid index for array') call fatal('invalidPointer','An invalid pointer was found; cannot continue')
When values have to be included in the message, the application programmer can write to the global errstr and then call the appropriate function:
write(errstr,*) 'invalid index for array: ',i call error('invalidIndex')and similar for the other error types.
Messages are generates with a call to message, which requires two arguments:
call message(AppMsg,Verbose,'taska v1.0')
When values have to be included in the message, the application programmer can write to the global errstr and then call message:
write(errstr,*) 'processing set ',setName call message(AppMsg,Verbose)
The following layers are available: UIMsg, MetaMsg, AppMsg, AppLibMsg, LibMsg, CoreMsg, KernelMsg. An application will normally use AppMsg; when the error is generated in a library specific to the application use AppLibMsg.
The following verbosity levels are available: Sparse, Verbose, Noisy.
The verbosity level can be inquired with the verbosity function. This can be used to prevent the overhead of setting up complex debug messages which will never be written anyway.
if (verbosity(AppMsg) >= Verbose) then do i=1,100 write(errstr,*) a(i) call message(AppMsg,Verbose) end do end if
For backwards compatibility message can also be called without the layer specification. In that case the layer defaults to AppMsg. This functionality will be phased out.