io_error Subroutine

public subroutine io_error(error_msg)

Abort the code giving an error message

Arguments

Type IntentOptional AttributesName
character(len=*), intent(in) :: error_msg

Called by

proc~~io_error~~CalledByGraph proc~io_error io_error proc~conv_get_seedname conv_get_seedname proc~conv_get_seedname->proc~io_error proc~tran_lcr_2c2_sort tran_lcr_2c2_sort proc~tran_lcr_2c2_sort->proc~io_error proc~check_and_sort_similar_centres check_and_sort_similar_centres proc~tran_lcr_2c2_sort->proc~check_and_sort_similar_centres proc~tran_reduce_hr tran_reduce_hr proc~tran_lcr_2c2_sort->proc~tran_reduce_hr proc~dis_windows dis_windows proc~dis_windows->proc~io_error proc~dis_extract_gamma dis_extract_gamma proc~dis_extract_gamma->proc~io_error proc~param_get_keyword_block param_get_keyword_block proc~param_get_keyword_block->proc~io_error proc~k_path k_path proc~k_path->proc~io_error proc~get_shc_r get_SHC_R proc~k_path->proc~get_shc_r proc~get_bb_r get_BB_R proc~k_path->proc~get_bb_r proc~get_aa_r get_AA_R proc~k_path->proc~get_aa_r proc~get_hh_r get_HH_R proc~k_path->proc~get_hh_r proc~berry_get_imfgh_klist berry_get_imfgh_klist proc~k_path->proc~berry_get_imfgh_klist proc~spin_get_nk spin_get_nk proc~k_path->proc~spin_get_nk proc~berry_get_imf_klist berry_get_imf_klist proc~k_path->proc~berry_get_imf_klist proc~berry_get_shc_klist berry_get_shc_klist proc~k_path->proc~berry_get_shc_klist proc~param_read param_read proc~param_read->proc~io_error proc~param_read->proc~param_get_keyword_block proc~param_get_projections param_get_projections proc~param_read->proc~param_get_projections proc~param_get_keyword_vector param_get_keyword_vector proc~param_read->proc~param_get_keyword_vector proc~param_get_atoms param_get_atoms proc~param_read->proc~param_get_atoms proc~wann_svd_omega_i wann_svd_omega_i proc~wann_svd_omega_i->proc~io_error proc~check_and_sort_similar_centres->proc~io_error proc~get_shc_r->proc~io_error proc~wann_check_unitarity wann_check_unitarity proc~wann_check_unitarity->proc~io_error proc~tran_lcr_2c2_build_ham tran_lcr_2c2_build_ham proc~tran_lcr_2c2_build_ham->proc~io_error proc~tran_lcr_2c2_build_ham->proc~tran_reduce_hr proc~param_get_projections->proc~io_error proc~r_wz_sc R_wz_sc proc~r_wz_sc->proc~io_error proc~k_slice k_slice proc~k_slice->proc~io_error proc~k_slice->proc~get_shc_r proc~utility_recip_lattice utility_recip_lattice proc~k_slice->proc~utility_recip_lattice proc~utility_diagonalize utility_diagonalize proc~k_slice->proc~utility_diagonalize proc~k_slice->proc~get_bb_r proc~k_slice->proc~get_aa_r proc~k_slice->proc~get_hh_r proc~wham_get_eig_deleig wham_get_eig_deleig proc~k_slice->proc~wham_get_eig_deleig proc~k_slice->proc~berry_get_imfgh_klist proc~k_slice->proc~spin_get_nk proc~k_slice->proc~berry_get_imf_klist proc~k_slice->proc~berry_get_shc_klist proc~orthogonalize_u orthogonalize_u proc~orthogonalize_u->proc~io_error proc~overlap_read overlap_read proc~overlap_read->proc~io_error proc~overlap_project_gamma overlap_project_gamma proc~overlap_read->proc~overlap_project_gamma proc~overlap_project overlap_project proc~overlap_read->proc~overlap_project proc~kmesh_shell_fixed kmesh_shell_fixed proc~kmesh_shell_fixed->proc~io_error proc~symmetrize_ukirr symmetrize_ukirr proc~symmetrize_ukirr->proc~io_error proc~symmetrize_ukirr->proc~orthogonalize_u proc~hamiltonian_wigner_seitz hamiltonian_wigner_seitz proc~hamiltonian_wigner_seitz->proc~io_error proc~utility_recip_lattice->proc~io_error proc~plot_fermi_surface plot_fermi_surface proc~plot_fermi_surface->proc~io_error proc~utility_diagonalize->proc~io_error proc~wham_get_occ_mat_list wham_get_occ_mat_list proc~wham_get_occ_mat_list->proc~io_error proc~kmesh_shell_automatic kmesh_shell_automatic proc~kmesh_shell_automatic->proc~io_error proc~tran_find_integral_signatures tran_find_integral_signatures proc~tran_find_integral_signatures->proc~io_error proc~conv_get_seedname~2 conv_get_seedname proc~conv_get_seedname~2->proc~io_error proc~overlap_project_gamma->proc~io_error proc~param_get_keyword_vector->proc~io_error program~w90chk2chk w90chk2chk program~w90chk2chk->proc~io_error program~w90chk2chk->proc~conv_get_seedname proc~conv_read_chkpt_fmt conv_read_chkpt_fmt program~w90chk2chk->proc~conv_read_chkpt_fmt proc~conv_read_chkpt conv_read_chkpt program~w90chk2chk->proc~conv_read_chkpt proc~wann_main wann_main proc~wann_main->proc~io_error proc~wann_main->proc~wann_check_unitarity proc~hamiltonian_setup hamiltonian_setup proc~wann_main->proc~hamiltonian_setup proc~get_bb_r->proc~io_error proc~conv_read_chkpt_fmt->proc~io_error proc~get_aa_r->proc~io_error proc~sitesym_dis_extract_symmetry sitesym_dis_extract_symmetry proc~sitesym_dis_extract_symmetry->proc~io_error proc~kmesh_get kmesh_get proc~kmesh_get->proc~io_error proc~kmesh_get->proc~kmesh_shell_fixed proc~kmesh_get->proc~kmesh_shell_automatic proc~kmesh_shell_from_file kmesh_shell_from_file proc~kmesh_get->proc~kmesh_shell_from_file proc~tran_green tran_green proc~tran_green->proc~io_error proc~dis_extract dis_extract proc~dis_extract->proc~io_error program~w90spn2spn w90spn2spn program~w90spn2spn->proc~io_error program~w90spn2spn->proc~conv_get_seedname~2 proc~dis_proj_froz dis_proj_froz proc~dis_proj_froz->proc~io_error proc~tran_reduce_hr->proc~io_error proc~overlap_project->proc~io_error proc~io_stopwatch io_stopwatch proc~io_stopwatch->proc~io_error proc~calctdfanddos calcTDFandDOS proc~calctdfanddos->proc~io_error proc~calctdfanddos->proc~get_hh_r proc~calctdfanddos->proc~wham_get_eig_deleig proc~get_hh_r->proc~io_error proc~boltzwann_main boltzwann_main proc~boltzwann_main->proc~io_error proc~boltzwann_main->proc~calctdfanddos proc~utility_w0gauss_vec utility_w0gauss_vec proc~utility_w0gauss_vec->proc~io_error proc~plot_interpolate_bands plot_interpolate_bands proc~plot_interpolate_bands->proc~io_error proc~ws_translate_dist ws_translate_dist proc~plot_interpolate_bands->proc~ws_translate_dist proc~tran_transfer tran_transfer proc~tran_transfer->proc~io_error proc~param_get_atoms->proc~io_error proc~dis_project dis_project proc~dis_project->proc~io_error proc~kmesh_shell_from_file->proc~io_error proc~tran_lcr tran_lcr proc~tran_lcr->proc~io_error proc~tran_lcr->proc~tran_green proc~tran_lcr->proc~tran_transfer program~wannier wannier program~wannier->proc~io_error program~wannier->proc~param_read program~wannier->proc~overlap_read program~wannier->proc~wann_main proc~wann_main_gamma wann_main_gamma program~wannier->proc~wann_main_gamma proc~dis_main dis_main program~wannier->proc~dis_main proc~tran_main tran_main program~wannier->proc~tran_main proc~plot_main plot_main program~wannier->proc~plot_main proc~ws_translate_dist->proc~io_error proc~plot_wannier plot_wannier proc~plot_wannier->proc~io_error proc~conv_read_chkpt->proc~io_error program~postw90 postw90 program~postw90->proc~param_read program~postw90->proc~kmesh_get proc~tran_bulk tran_bulk proc~tran_bulk->proc~tran_green proc~tran_bulk->proc~tran_transfer proc~hamiltonian_setup->proc~hamiltonian_wigner_seitz proc~wannier_setup wannier_setup proc~wannier_setup->proc~param_read proc~wannier_run wannier_run proc~wannier_run->proc~param_read proc~wannier_run->proc~overlap_project_gamma proc~wannier_run->proc~wann_main proc~wannier_run->proc~kmesh_get proc~wannier_run->proc~overlap_project proc~wannier_run->proc~wann_main_gamma proc~wannier_run->proc~dis_main proc~wannier_run->proc~tran_main proc~wannier_run->proc~plot_main proc~wann_main_gamma->proc~wann_check_unitarity proc~dis_main->proc~dis_windows proc~dis_main->proc~dis_extract_gamma proc~dis_main->proc~dis_extract proc~dis_main->proc~dis_proj_froz proc~dis_main->proc~dis_project proc~spin_get_moment_k spin_get_moment_k proc~spin_get_moment_k->proc~utility_diagonalize proc~gyrotropic_main gyrotropic_main proc~gyrotropic_main->proc~get_bb_r proc~gyrotropic_main->proc~get_aa_r proc~gyrotropic_main->proc~io_stopwatch proc~gyrotropic_main->proc~get_hh_r proc~gyrotropic_get_k_list gyrotropic_get_k_list proc~gyrotropic_main->proc~gyrotropic_get_k_list proc~dos_main dos_main proc~dos_main->proc~utility_diagonalize proc~dos_main->proc~get_hh_r proc~dos_main->proc~wham_get_eig_deleig proc~berry_get_sc_klist berry_get_sc_klist proc~berry_get_sc_klist->proc~utility_w0gauss_vec proc~berry_get_sc_klist->proc~wham_get_eig_deleig proc~wham_get_eig_uu_hh_aa_sc_tb_conv wham_get_eig_UU_HH_AA_sc_TB_conv proc~berry_get_sc_klist->proc~wham_get_eig_uu_hh_aa_sc_tb_conv proc~wham_get_eig_uu_hh_aa_sc wham_get_eig_UU_HH_AA_sc proc~berry_get_sc_klist->proc~wham_get_eig_uu_hh_aa_sc proc~wham_get_eig_deleig->proc~utility_diagonalize proc~wham_get_eig_deleig->proc~get_hh_r proc~wham_get_eig_uu_hh_aa_sc_tb_conv->proc~utility_diagonalize proc~wham_get_eig_uu_hh_aa_sc_tb_conv->proc~get_aa_r proc~wham_get_eig_uu_hh_aa_sc_tb_conv->proc~get_hh_r proc~wham_get_eig_uu_hh_aa_sc->proc~utility_diagonalize proc~wham_get_eig_uu_hh_aa_sc->proc~get_hh_r proc~spin_get_moment spin_get_moment proc~spin_get_moment->proc~get_hh_r proc~berry_get_imfgh_klist->proc~wham_get_occ_mat_list proc~wham_get_eig_uu_hh_jjlist wham_get_eig_UU_HH_JJlist proc~berry_get_imfgh_klist->proc~wham_get_eig_uu_hh_jjlist proc~wham_get_eig_uu_hh_jjlist->proc~utility_diagonalize proc~wham_get_eig_uu_hh_jjlist->proc~get_hh_r proc~berry_main berry_main proc~berry_main->proc~get_shc_r proc~berry_main->proc~get_bb_r proc~berry_main->proc~get_aa_r proc~berry_main->proc~io_stopwatch proc~berry_main->proc~get_hh_r proc~berry_main->proc~berry_get_sc_klist proc~berry_main->proc~berry_get_imfgh_klist proc~berry_get_kubo_k berry_get_kubo_k proc~berry_main->proc~berry_get_kubo_k proc~berry_main->proc~berry_get_imf_klist proc~berry_main->proc~berry_get_shc_klist proc~spin_get_s spin_get_S proc~spin_get_s->proc~utility_diagonalize proc~geninterp_main geninterp_main proc~geninterp_main->proc~get_hh_r proc~spin_get_nk->proc~utility_diagonalize proc~tran_main->proc~tran_lcr_2c2_sort proc~tran_main->proc~tran_lcr_2c2_build_ham proc~tran_main->proc~tran_find_integral_signatures proc~tran_main->proc~tran_reduce_hr proc~tran_main->proc~tran_lcr proc~tran_main->proc~tran_bulk proc~tran_main->proc~hamiltonian_setup proc~berry_get_kubo_k->proc~utility_diagonalize proc~berry_get_kubo_k->proc~wham_get_eig_deleig proc~berry_get_kubo_k->proc~spin_get_nk proc~berry_get_imf_klist->proc~berry_get_imfgh_klist proc~plot_main->proc~hamiltonian_setup proc~gyrotropic_get_k_list->proc~wham_get_eig_deleig proc~gyrotropic_get_k_list->proc~berry_get_imfgh_klist proc~gyrotropic_get_k_list->proc~spin_get_s proc~gyrotropic_get_k_list->proc~berry_get_imf_klist proc~berry_get_shc_klist->proc~wham_get_eig_deleig

Contents

Source Code


Source Code

  subroutine io_error(error_msg)
    !========================================
    !! Abort the code giving an error message
    !========================================

    implicit none
    character(len=*), intent(in) :: error_msg

#ifdef MPI
    character(len=50) :: filename
    integer           :: stderr, ierr, whoami, num_nodes

    call mpi_comm_rank(mpi_comm_world, whoami, ierr)
    call mpi_comm_size(mpi_comm_world, num_nodes, ierr)
    if (num_nodes > 1) then
      if (whoami > 99999) then
        write (filename, '(a,a,I0,a)') trim(seedname), '.node_', whoami, '.werr'
      else
        write (filename, '(a,a,I5.5,a)') trim(seedname), '.node_', whoami, '.werr'
      endif
      stderr = io_file_unit()
      open (unit=stderr, file=trim(filename), form='formatted', err=105)
      write (stderr, '(1x,a)') trim(error_msg)
      close (stderr)
    end if

105 write (*, '(1x,a)') trim(error_msg)
106 write (*, '(1x,a,I0,a)') "Error on node ", &
      whoami, ": examine the output/error files for details"

    if (whoami == 0) then
      write (stdout, *) 'Exiting.......'
      write (stdout, '(1x,a)') trim(error_msg)
      close (stdout)
    end if

    call MPI_abort(MPI_comm_world, 1, ierr)

#else

    write (stdout, *) 'Exiting.......'
    write (stdout, '(1x,a)') trim(error_msg)

    close (stdout)

    write (*, '(1x,a)') trim(error_msg)
    write (*, '(A)') "Error: examine the output/error file for details"
#endif

#ifdef EXIT_FLAG
    call exit(1)
#else
    STOP
#endif

  end subroutine io_error