diff --git a/src/error.F90 b/src/error.F90 index d3cc686..3012cc7 100644 --- a/src/error.F90 +++ b/src/error.F90 @@ -27,30 +27,44 @@ ! module error +! module variables are not implicit by default +! implicit none +!- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +! contains ! !=============================================================================== ! -! print_error: subroutine prints error +! subroutine PRINT_ERROR: +! ---------------------- +! +! Subroutine prints an error message with the module/subroutine where +! the error occured. +! +! Arguments: +! +! loc - string informing about the place where the error occured +! (for example 'module name::subroutine name:[line]'); +! msg - string of the actual error message; ! !=============================================================================== ! - subroutine print_error(position, text) + subroutine print_error(loc, msg) +! local variables are not implicit by default +! implicit none -! input arguments +! subroutine arguments ! - character(len=*), intent(in) :: position, text + character(len=*), intent(in) :: loc, msg ! !------------------------------------------------------------------------------- ! write(*,*) - write(*,"('[error in ', a, ']: ', a)") trim(position), trim(text) - write(*,*) - stop + write(*,"('[ERROR in ', a, ']: ', a)") trim(loc), trim(msg) !------------------------------------------------------------------------------- ! @@ -58,23 +72,34 @@ module error ! !=============================================================================== ! -! print_warning: subroutine prints warning +! subroutine PRINT_WARNING: +! ------------------------ +! +! Subroutine prints a warning message with the module/subroutine where +! the warning occured. +! +! Arguments: +! +! loc - string informing about the place where the warning occured +! (for example 'module name::subroutine name:[line]'); +! msg - string of the actual warning message; ! !=============================================================================== ! - subroutine print_warning(position, text) + subroutine print_warning(loc, msg) +! local variables are not implicit by default +! implicit none -! input arguments +! subroutine arguments ! - character(len=*), intent(in) :: position, text + character(len=*), intent(in) :: loc, msg ! !------------------------------------------------------------------------------- ! write(*,*) - write(*,"('[warning in ', a, ']: ', a)") trim(position), trim(text) - write(*,*) + write(*,"('[WARNING in ', a, ']: ', a)") trim(loc), trim(msg) !------------------------------------------------------------------------------- ! @@ -82,27 +107,38 @@ module error ! !=============================================================================== ! -! print_info: subroutine prints information +! subroutine PRINT_NOTIFICATION: +! ----------------------------- +! +! Subroutine prints a notification message with the module/subroutine where +! the notification occured. +! +! Arguments: +! +! loc - string informing about the place where the notification occured +! (for example 'module name::subroutine name:[line]'); +! msg - string of the actual notification message; ! !=============================================================================== ! - subroutine print_info(position, text) + subroutine print_notification(loc, msg) +! local variables are not implicit by default +! implicit none -! input arguments +! subroutine arguments ! - character(len=*), intent(in) :: position, text + character(len=*), intent(in) :: loc, msg ! !------------------------------------------------------------------------------- ! write(*,*) - write(*,"('[info in ', a, ']: ', a)") trim(position), trim(text) - write(*,*) + write(*,"('[NOTIFICATION in ', a, ']: ', a)") trim(loc), trim(msg) !------------------------------------------------------------------------------- ! - end subroutine print_info + end subroutine print_notification !=============================================================================== ! diff --git a/src/io.F90 b/src/io.F90 index ebf83bc..62852a2 100644 --- a/src/io.F90 +++ b/src/io.F90 @@ -1180,7 +1180,7 @@ module io use coordinates, only : nn, ng, in, jn, kn, maxlev, toplev, ir, jr, kr use coordinates, only : initialize_coordinates, finalize_coordinates use coordinates, only : xmin, xmax, ymin, ymax, zmin, zmax - use error , only : print_error, print_warning + use error , only : print_error use evolution, only : step, time, dt, dtn use hdf5 , only : hid_t, hsize_t use hdf5 , only : h5gopen_f, h5gclose_f, h5aget_num_attrs_f & diff --git a/src/mesh.F90 b/src/mesh.F90 index abfbecb..8f3e484 100644 --- a/src/mesh.F90 +++ b/src/mesh.F90 @@ -462,7 +462,7 @@ module mesh use blocks , only : get_mblocks, get_nleafs use coordinates , only : minlev, maxlev, res use domains , only : setup_domain - use error , only : print_info, print_error + use error , only : print_error use mpitools , only : master, nproc, nprocs use problems , only : setup_problem use refinement , only : check_refinement_criterion @@ -787,7 +787,7 @@ module mesh use blocks , only : append_datablock, remove_datablock, link_blocks use coordinates , only : minlev, maxlev, toplev, im, jm, km, res use equations , only : nv - use error , only : print_info, print_error + use error , only : print_error #ifdef MPI use mpitools , only : master, nprocs, nproc use mpitools , only : reduce_sum_integer_array