param_get_centre_constraints Subroutine

private subroutine param_get_centre_constraints()

Uses

  • proc~~param_get_centre_constraints~~UsesGraph proc~param_get_centre_constraints param_get_centre_constraints module~w90_utility w90_utility proc~param_get_centre_constraints->module~w90_utility module~w90_io w90_io proc~param_get_centre_constraints->module~w90_io module~w90_constants w90_constants module~w90_utility->module~w90_constants module~w90_io->module~w90_constants

assigns projection centres as default centre constraints and global Lagrange multiplier as individual Lagrange multipliers then reads the centre_constraints block for individual centre constraint parameters

Arguments

None

Calls

proc~~param_get_centre_constraints~~CallsGraph proc~param_get_centre_constraints param_get_centre_constraints proc~param_get_centre_constraint_from_column param_get_centre_constraint_from_column proc~param_get_centre_constraints->proc~param_get_centre_constraint_from_column

Called by

proc~~param_get_centre_constraints~~CalledByGraph proc~param_get_centre_constraints param_get_centre_constraints proc~param_read param_read proc~param_read->proc~param_get_centre_constraints program~wannier wannier program~wannier->proc~param_read proc~wannier_run wannier_run proc~wannier_run->proc~param_read proc~wannier_setup wannier_setup proc~wannier_setup->proc~param_read program~postw90 postw90 program~postw90->proc~param_read

Contents


Source Code

  subroutine param_get_centre_constraints
    !=============================================================================!
    !                                                                             !
    !!  assigns projection centres as default centre constraints and global
    !!  Lagrange multiplier as individual Lagrange multipliers then reads
    !!  the centre_constraints block for individual centre constraint parameters
    !                                                                             !
    !=============================================================================!
    use w90_io, only: io_error
    use w90_utility, only: utility_frac_to_cart
    integer           :: loop1, index1, constraint_num, index2, loop2
    integer           :: column, start, finish, wann, ierr
    !logical           :: found
    character(len=maxlen) :: dummy

    do loop1 = 1, num_wann
      do loop2 = 1, 3
        ccentres_frac(loop1, loop2) = proj_site(loop2, loop1)
      end do
    end do

    constraint_num = 0
    do loop1 = 1, num_lines
      dummy = in_data(loop1)
      if (constraint_num > 0) then
        if (trim(dummy) == '') cycle
        index1 = index(dummy, 'begin')
        if (index1 > 0) call io_error("slwf_centres block hasn't ended yet")
        index1 = index(dummy, 'end')
        if (index1 > 0) then
          index1 = index(dummy, 'slwf_centres')
          if (index1 == 0) call io_error('Wrong ending of block (need to end slwf_centres)')
          in_data(loop1) (1:maxlen) = ' '
          exit
        end if
        column = 0
        start = 1
        finish = 1
        do loop2 = 1, len_trim(dummy)
          if (start == loop2 .and. dummy(loop2:loop2) == ' ') then
            start = loop2 + 1
          end if
          if (start < loop2) then
            if (dummy(loop2:loop2) == ' ') then
              finish = loop2 - 1
              call param_get_centre_constraint_from_column(column, start, finish, wann, dummy)
              start = loop2 + 1
              finish = start
            end if
          end if
          if (loop2 == len_trim(dummy) .and. dummy(loop2:loop2) /= ' ') then
            finish = loop2
            call param_get_centre_constraint_from_column(column, start, finish, wann, dummy)
            start = loop2 + 1
            finish = start
          end if
        end do
        in_data(loop1) (1:maxlen) = ' '
        constraint_num = constraint_num + 1
      end if
      index1 = index(dummy, 'slwf_centres')
      if (index1 > 0) then
        index1 = index(dummy, 'begin')
        if (index1 > 0) then
          constraint_num = 1
          in_data(loop1) (1:maxlen) = ' '
        end if
      end if
    end do
    do loop1 = 1, num_wann
      call utility_frac_to_cart(ccentres_frac(loop1, :), ccentres_cart(loop1, :), real_lattice)
    end do
  end subroutine param_get_centre_constraints