lanl / LaGriT

Los Alamos Grid Toolbox (LaGriT) is a library of user callable tools that provide mesh generation, mesh optimization and dynamic mesh maintenance in two and three dimensions.
https://lanl.github.io/LaGriT/
Other
122 stars 49 forks source link

Standardization of LaGriT errors #112

Open daniellivingston opened 6 years ago

daniellivingston commented 6 years ago

For external LG error handling, LaGriT errors standardization is not enforced in several commands, i.e.:

read/avs/test.inp/mo1

The AVS file, test.inp, does not exist.
WARNING: MO has zero nodes
WARNING: NO ACTION
finish

should be:

ERROR: The AVS file, test.inp, does not exist.
daniellivingston commented 5 years ago

In addition, we may want a universal error and warning handler. I.e.,

subroutine RAISE_ERROR_LG(error_msg,error_code)
    ! Basic Fortran90 error handler for LaGriT.

    implicit none

    integer error_code
    character(len=*),intent(in) :: error_msg
    character*132 logmess

    error_code = 1
    write(logmess,*) 'ERROR: '//trim(error_msg)
    call writloga('default',0,logmess,0, error_code)

end subroutine RAISE_ERROR_LG

integer :: ierror
call RAISE_ERROR_LG('MO has zero nodes',ierror)

prints & writes

ERROR: MO has zero nodes