write_kmesh Subroutine

public subroutine write_kmesh(common_data, istdout, istderr, ierr)

Uses

  • proc~~write_kmesh~~UsesGraph proc~write_kmesh write_kmesh module~w90_comms w90_comms proc~write_kmesh->module~w90_comms module~w90_error w90_error proc~write_kmesh->module~w90_error module~w90_error_base w90_error_base proc~write_kmesh->module~w90_error_base module~w90_kmesh w90_kmesh proc~write_kmesh->module~w90_kmesh module~w90_comms->module~w90_error_base module~w90_constants w90_constants module~w90_comms->module~w90_constants module~w90_error->module~w90_comms module~w90_error->module~w90_error_base module~w90_kmesh->module~w90_comms module~w90_kmesh->module~w90_error module~w90_kmesh->module~w90_constants module~w90_types w90_types module~w90_kmesh->module~w90_types module~w90_types->module~w90_constants

Writes the .nnkp file instructing a DFT code what projections and overlaps to construct

Arguments

Type IntentOptional Attributes Name
type(lib_common_type), intent(inout) :: common_data
integer, intent(in) :: istdout
integer, intent(in) :: istderr
integer, intent(out) :: ierr

Calls

proc~~write_kmesh~~CallsGraph proc~write_kmesh write_kmesh proc~kmesh_write kmesh_write proc~write_kmesh->proc~kmesh_write proc~mpirank mpirank proc~write_kmesh->proc~mpirank proc~prterr prterr proc~write_kmesh->proc~prterr proc~set_error_fatal set_error_fatal proc~write_kmesh->proc~set_error_fatal proc~w90_create_kmesh w90_create_kmesh proc~write_kmesh->proc~w90_create_kmesh proc~io_date io_date proc~kmesh_write->proc~io_date proc~io_stopwatch_start io_stopwatch_start proc~kmesh_write->proc~io_stopwatch_start proc~io_stopwatch_stop io_stopwatch_stop proc~kmesh_write->proc~io_stopwatch_stop proc~utility_recip_lattice_base utility_recip_lattice_base proc~kmesh_write->proc~utility_recip_lattice_base proc~prterr->proc~mpirank interface~comms_no_sync_bcast comms_no_sync_bcast proc~prterr->interface~comms_no_sync_bcast interface~comms_no_sync_recv comms_no_sync_recv proc~prterr->interface~comms_no_sync_recv interface~comms_no_sync_send comms_no_sync_send proc~prterr->interface~comms_no_sync_send proc~mpisize mpisize proc~prterr->proc~mpisize proc~comms_sync_error comms_sync_error proc~set_error_fatal->proc~comms_sync_error proc~set_base_error set_base_error proc~set_error_fatal->proc~set_base_error proc~w90_create_kmesh->proc~prterr proc~kmesh_get kmesh_get proc~w90_create_kmesh->proc~kmesh_get proc~comms_no_sync_bcast_char comms_no_sync_bcast_char interface~comms_no_sync_bcast->proc~comms_no_sync_bcast_char proc~comms_no_sync_bcast_cmplx comms_no_sync_bcast_cmplx interface~comms_no_sync_bcast->proc~comms_no_sync_bcast_cmplx proc~comms_no_sync_bcast_int comms_no_sync_bcast_int interface~comms_no_sync_bcast->proc~comms_no_sync_bcast_int proc~comms_no_sync_bcast_logical comms_no_sync_bcast_logical interface~comms_no_sync_bcast->proc~comms_no_sync_bcast_logical proc~comms_no_sync_bcast_real comms_no_sync_bcast_real interface~comms_no_sync_bcast->proc~comms_no_sync_bcast_real proc~comms_no_sync_recv_char comms_no_sync_recv_char interface~comms_no_sync_recv->proc~comms_no_sync_recv_char proc~comms_no_sync_recv_cmplx comms_no_sync_recv_cmplx interface~comms_no_sync_recv->proc~comms_no_sync_recv_cmplx proc~comms_no_sync_recv_int comms_no_sync_recv_int interface~comms_no_sync_recv->proc~comms_no_sync_recv_int proc~comms_no_sync_recv_logical comms_no_sync_recv_logical interface~comms_no_sync_recv->proc~comms_no_sync_recv_logical proc~comms_no_sync_recv_real comms_no_sync_recv_real interface~comms_no_sync_recv->proc~comms_no_sync_recv_real proc~comms_no_sync_send_char comms_no_sync_send_char interface~comms_no_sync_send->proc~comms_no_sync_send_char proc~comms_no_sync_send_cmplx comms_no_sync_send_cmplx interface~comms_no_sync_send->proc~comms_no_sync_send_cmplx proc~comms_no_sync_send_int comms_no_sync_send_int interface~comms_no_sync_send->proc~comms_no_sync_send_int proc~comms_no_sync_send_logical comms_no_sync_send_logical interface~comms_no_sync_send->proc~comms_no_sync_send_logical proc~comms_no_sync_send_real comms_no_sync_send_real interface~comms_no_sync_send->proc~comms_no_sync_send_real proc~kmesh_get->proc~set_error_fatal proc~kmesh_get->proc~io_stopwatch_start proc~kmesh_get->proc~io_stopwatch_stop proc~kmesh_bvectors_perm kmesh_bvectors_perm proc~kmesh_get->proc~kmesh_bvectors_perm proc~kmesh_get_bvectors kmesh_get_bvectors proc~kmesh_get->proc~kmesh_get_bvectors proc~kmesh_shell_automatic kmesh_shell_automatic proc~kmesh_get->proc~kmesh_shell_automatic proc~kmesh_shell_fixed kmesh_shell_fixed proc~kmesh_get->proc~kmesh_shell_fixed proc~kmesh_shell_from_file kmesh_shell_from_file proc~kmesh_get->proc~kmesh_shell_from_file proc~kmesh_shell_reconstruct kmesh_shell_reconstruct proc~kmesh_get->proc~kmesh_shell_reconstruct proc~kmesh_supercell_sort kmesh_supercell_sort proc~kmesh_get->proc~kmesh_supercell_sort proc~set_error_alloc set_error_alloc proc~kmesh_get->proc~set_error_alloc proc~set_error_dealloc set_error_dealloc proc~kmesh_get->proc~set_error_dealloc proc~set_error_input set_error_input proc~kmesh_get->proc~set_error_input proc~utility_cart_to_frac utility_cart_to_frac proc~kmesh_get->proc~utility_cart_to_frac proc~utility_compar utility_compar proc~kmesh_get->proc~utility_compar proc~utility_frac_to_cart utility_frac_to_cart proc~kmesh_get->proc~utility_frac_to_cart proc~utility_inverse_mat utility_inverse_mat proc~kmesh_get->proc~utility_inverse_mat proc~utility_recip_lattice utility_recip_lattice proc~kmesh_get->proc~utility_recip_lattice proc~utility_inv3 utility_inv3 proc~utility_recip_lattice_base->proc~utility_inv3 proc~kmesh_bvectors_perm->proc~set_error_fatal proc~kmesh_get_bvectors->proc~set_error_fatal proc~kmesh_get_bvectors->proc~io_stopwatch_start proc~kmesh_get_bvectors->proc~io_stopwatch_stop proc~kmesh_shell_automatic->proc~set_error_fatal proc~kmesh_shell_automatic->proc~io_stopwatch_start proc~kmesh_shell_automatic->proc~io_stopwatch_stop proc~kmesh_shell_automatic->proc~kmesh_get_bvectors proc~kmesh_shell_automatic->proc~set_error_alloc proc~kmesh_shell_automatic->proc~set_error_dealloc dgesvd dgesvd proc~kmesh_shell_automatic->dgesvd proc~kmesh_check_condition kmesh_check_condition proc~kmesh_shell_automatic->proc~kmesh_check_condition proc~kmesh_get_amat kmesh_get_amat proc~kmesh_shell_automatic->proc~kmesh_get_amat proc~kmesh_shell_fixed->proc~set_error_fatal proc~kmesh_shell_fixed->proc~io_stopwatch_start proc~kmesh_shell_fixed->proc~io_stopwatch_stop proc~kmesh_shell_fixed->proc~kmesh_get_bvectors proc~kmesh_shell_fixed->proc~set_error_alloc proc~kmesh_shell_fixed->dgesvd proc~kmesh_shell_from_file->proc~set_error_fatal proc~kmesh_shell_from_file->proc~io_stopwatch_start proc~kmesh_shell_from_file->proc~io_stopwatch_stop proc~kmesh_shell_from_file->proc~kmesh_get_bvectors proc~kmesh_shell_from_file->proc~set_error_alloc proc~kmesh_shell_from_file->proc~set_error_input proc~kmesh_shell_from_file->dgesvd proc~set_error_file set_error_file proc~kmesh_shell_from_file->proc~set_error_file proc~kmesh_supercell_sort->proc~io_stopwatch_start proc~kmesh_supercell_sort->proc~io_stopwatch_stop proc~internal_maxloc internal_maxloc proc~kmesh_supercell_sort->proc~internal_maxloc proc~set_error_alloc->proc~comms_sync_error proc~set_error_alloc->proc~set_base_error proc~set_error_dealloc->proc~comms_sync_error proc~set_error_dealloc->proc~set_base_error proc~set_error_input->proc~comms_sync_error proc~set_error_input->proc~set_base_error proc~utility_inverse_mat->proc~utility_inv3 proc~utility_recip_lattice->proc~set_error_fatal proc~utility_recip_lattice->proc~utility_recip_lattice_base proc~set_error_file->proc~comms_sync_error proc~set_error_file->proc~set_base_error

Called by

proc~~write_kmesh~~CalledByGraph proc~write_kmesh write_kmesh program~wannier wannier program~wannier->proc~write_kmesh

Source Code

  subroutine write_kmesh(common_data, istdout, istderr, ierr)
    !! Writes the .nnkp file instructing a DFT code what projections and overlaps to construct

    use w90_comms, only: mpirank, comms_sync_error
    use w90_error_base, only: w90_error_type
    use w90_error, only: set_error_fatal
    use w90_kmesh, only: kmesh_write

    implicit none

    ! arguments
    integer, intent(in) :: istdout, istderr
    integer, intent(out) :: ierr
    type(lib_common_type), intent(inout) :: common_data

    ! local variables
    type(w90_error_type), allocatable :: error

    ierr = 0

    if (.not. allocated(common_data%kmesh_info%nnlist)) then
      ! should be called by all ranks
      call w90_create_kmesh(common_data, istdout, istderr, ierr)
      if (ierr /= 0) then
        call set_error_fatal(error, 'Error in setting up k-mesh!', common_data%comm)
      end if
    end if

    if (allocated(error)) then
      call prterr(error, ierr, istdout, istderr, common_data%comm)
      return
    end if

    if (mpirank(common_data%comm) == 0) then ! root only; no error condition
      call kmesh_write(common_data%exclude_bands, common_data%kmesh_info, &
                       common_data%select_proj%auto_projections, common_data%proj_input, &
                       common_data%print_output, common_data%kpt_latt, common_data%real_lattice, &
                       common_data%num_kpts, common_data%num_proj, common_data%calc_only_A, &
                       common_data%w90_system%spinors, common_data%seedname, common_data%timer)
    end if
  end subroutine write_kmesh