print_help Subroutine

public subroutine print_help(errormsg)

Uses

  • proc~~print_help~~UsesGraph proc~print_help print_help module~utilities utilities proc~print_help->module~utilities

Arguments

Type IntentOptional AttributesName
character(len=*), optional :: errormsg

Calls

proc~~print_help~~CallsGraph proc~print_help print_help proc~log_error log_error proc~print_help->proc~log_error proc~log_message log_message proc~log_error->proc~log_message proc~log_write log_write proc~log_message->proc~log_write proc~log_format_message log_format_message proc~log_message->proc~log_format_message proc~to_string to_string proc~log_write->proc~to_string proc~date_time_str date_time_str proc~log_format_message->proc~date_time_str proc~colourise colourise proc~log_format_message->proc~colourise proc~string_index string_index proc~colourise->proc~string_index

Called by

proc~~print_help~~CalledByGraph proc~print_help print_help proc~print_module_parameters print_module_parameters proc~print_module_parameters->proc~print_help proc~parse_commandline_arguments parse_commandline_arguments proc~parse_commandline_arguments->proc~print_help proc~initialise initialise proc~initialise->proc~print_module_parameters proc~initialise->proc~parse_commandline_arguments program~swim swim program~swim->proc~initialise

Contents

Source Code


Source Code

  subroutine print_help(errormsg)
    use utilities, only: log_error
    character(len=*), optional :: errormsg

    write(*, "(A)") &
      "usage: swim [options] [parameter-nml]", &
      "", &
      "  parameter-nml               path to the parameter namelist", &
      "", &
      "options:", &
      "  -h, --help                  show this help message", &
      "  -v, --version               print version", &
      "  -d, --defaults [module]     print default parameters", &
      "  -o, --output-variables      print output variables (requires parameter-nml)"
    ! End program either with error or silently
    if (present(errormsg)) then
      write(*, *)  ! empty line btw help and error
      call log_error("print_help", errormsg)
    end if
    stop
  end subroutine print_help