dmsg Subroutine

public subroutine dmsg(level, prog, method, msg)

Based on the debug level input this soubroutine will output/print or skip the debug message. This subroutine is called in the starting of every other subrotune for debuging. This will be depricated in the later version.

Arguments

Type IntentOptional AttributesName
integer :: level

The message's debug level

character(len=*), optional :: prog

Module or program name

character(len=*), optional :: method

Subroutine or function name

character(len=*), optional :: msg

Message to print


Called by

add_source_term_residuewdmsg
w
add_turbulent_timew
w
add_viscous_timew
w
allocate_memoryw
w
allocate_memoryw
w
allocate_memoryw
w
apply_gradient_bcw
w
apply_interfacew
w
apply_interfacew
w
apply_interfacew
w
apply_periodic_bcw
w
apply_periodic_bcw
w
apply_periodic_bcw
w
checkpointw
w
close_filew
w
close_filew
w
compute_face_estimatesw
w
compute_face_statew
w
compute_fluxw
w
compute_fluxw
w
compute_fluxw
w
compute_fluxw
w
compute_fluxw
w
compute_fluxw
w
compute_fluxesw
w
compute_fluxesw
w
compute_fluxesw
w
compute_fluxesw
w
compute_fluxesw
w
compute_fluxesw
w
compute_geometric_parametersw
w
compute_global_time_stepw
w
compute_local_time_stepw
w
compute_time_stepw
w
deallocate_memoryw
w
deallocate_memoryw
w
destroy_allw
w
destroy_geometryw
w
destroy_gridw
w
destroy_schemew
w
destroy_schemew
w
destroy_schemew
w
destroy_schemew
w
destroy_schemew
w
destroy_schemew
w
destroy_schemew
w
destroy_schemew
w
destroy_schemew
w
destroy_schemew
w
destroy_solverw
w
destroy_surfacew
w
destroy_timew
w
destroy_wall_distw
w
dump_dataw
w
evaluate_all_gradientsw
w
extract_grid_pointw
w
extract_grid_sizew
w
find_wall_distw
w
get_next_tokenw
w
get_next_token_parallelw
w
get_residuew
w
get_residuew
w
get_residuew
w
get_residuew
w
get_residuew
w
get_residuew
w
ghost_gridw
w
initmiscw
w
iterate_one_more_time_stepw
w
link_aliasesw
w
open_filew
w
open_filew
w
populate_grid_pointsw
w
pressure_based_switchingw
w
pressure_based_switchingw
w
read_filew
w
read_gridw
w
read_gridw
w
read_headerw
w
read_headerw
w
read_layout_filew
w
read_scalarw
w
read_scalarw
w
read_velocityw
w
reconstruct_boundary_statew
w
remove_extremaw
w
setup_allw
w
setup_filew
w
setup_filew
w
setup_geometryw
w
setup_gridw
w
setup_nodefilew
w
setup_schemew
w
setup_schemew
w
setup_schemew
w
setup_schemew
w
setup_schemew
w
setup_schemew
w
setup_schemew
w
setup_schemew
w
setup_schemew
w
setup_schemew
w
setup_solverw
w
setup_surfacew
w
setup_timew
w
setup_wall_distw
w
skip_scalarw
w
skip_scalarw
w
surface_pointsw
w
unlink_aliasesw
w
write_filew
w
write_gridw
w
write_headerw
w
write_restart_logw
w
write_scalarw
w

Contents

Source Code


Source Code

        subroutine dmsg(level, prog, method, msg)
          !< Based on the debug level input this
          !< soubroutine will output/print or skip the debug
          !< message. This subroutine is called in the
          !< starting of every other subrotune for debuging.
          !< This will be depricated in the later version.
            !---------------------------------------------------------------
            ! Print a DEBUG message
            !
            ! Input arguments:
            !   level -> integer
            !       the message's debug level
            !   prog -> character
            !       module / program name
            !   method -> character
            !       subroutine / function name
            !   msg -> character
            !       message
            !---------------------------------------------------------------

            implicit none
            character(len=*), optional :: prog
            !< Module or program name
            character(len=*), optional :: method
            !< Subroutine or function name
            character(len=*), optional :: msg
            !< Message to print
            character(len=256)         :: ifmsg   
            integer :: level
            !< The message's debug level
           
!            if (process_id == 0) then
            if (level < DEBUG_LEVEL) then
                ! Don't print the message
                return
            end if


            ifmsg = ""
            if (present(msg)) then
              ifmsg = " >--> "//trim(msg)
            end if

            if (.not. present(prog) .and. .not. present(method) .and. &
                    .not. present(msg)) then
                print *, 'Please provide atleast one of the following:'
                print *, '- Module / program name'
                print *, '- Subroutine / function name'
                print *, '- A custom message'
                stop
            end if

            print '(A7,I1.1,A,I2,A2,A,A2,A,A,A1)', 'Debug: ', level," id - ", process_id, ' (', &
              trim(prog), ', ', trim(method), trim(ifmsg), ')'
!           end if

        end subroutine dmsg