Write formatted checkpoint file
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=20), | intent(in) | :: | checkpoint | |||
| integer, | intent(in) | :: | stdout | |||
| character(len=50), | intent(in) | :: | seedname |
subroutine conv_write_chkpt_fmt(checkpoint, stdout, seedname) !================================================! ! !! Write formatted checkpoint file ! !================================================! use w90_io, only: io_date use w90chk_parameters use wannchk_data implicit none integer, intent(in) :: stdout character(len=20), intent(in) :: checkpoint character(len=50), intent(in) :: seedname integer :: chk_unit, nkp, i, j, k, l !character(len=9) :: cdate, ctime write (stdout, '(/1x,3a)', advance='no') 'Writing formatted checkpoint file ', trim(seedname), '.chk.fmt...' open (newunit=chk_unit, file=trim(seedname)//'.chk.fmt', form='formatted', status='replace', position='rewind') write (chk_unit, '(A33)') header ! Date and time from the read file write (chk_unit, '(I0)') num_bands ! Number of bands write (chk_unit, '(I0)') num_exclude_bands ! Number of excluded bands do i = 1, num_exclude_bands write (chk_unit, '(I0)') exclude_bands(i) ! Excluded bands end do write (chk_unit, '(9G25.17)') ((real_lattice(i, j), i=1, 3), j=1, 3) ! Real lattice write (chk_unit, '(9G25.17)') ((recip_lattice(i, j), i=1, 3), j=1, 3) ! Reciprocal lattice write (chk_unit, '(I0)') num_kpts ! Number of k-points write (chk_unit, '(I0," ",I0," ",I0)') (mp_grid(i), i=1, 3) ! M-P grid do nkp = 1, num_kpts write (chk_unit, '(3G25.17)') (kpt_latt(i, nkp), i=1, 3) ! K-points end do write (chk_unit, '(I0)') kmesh_info%nntot ! Number of nearest k-point neighbours write (chk_unit, '(I0)') num_wann ! Number of wannier functions write (chk_unit, '(A20)') checkpoint ! Position of checkpoint if (have_disentangled) then write (chk_unit, '(I1)') 1 ! Whether a disentanglement has been performed else write (chk_unit, '(I1)') 0 ! Whether a disentanglement has been performed end if if (have_disentangled) then write (chk_unit, '(G25.17)') omega_invariant ! Omega invariant ! lwindow, ndimwin and U_matrix_opt do nkp = 1, num_kpts do i = 1, num_bands if (dis_manifold%lwindow(i, nkp)) then write (chk_unit, '(I1)') 1 else write (chk_unit, '(I1)') 0 end if end do end do do nkp = 1, num_kpts write (chk_unit, '(I0)') dis_manifold%ndimwin(nkp) end do do nkp = 1, num_kpts do j = 1, num_wann do i = 1, num_bands write (chk_unit, '(2G25.17)') u_matrix_opt(i, j, nkp) end do end do end do end if do k = 1, num_kpts do j = 1, num_wann do i = 1, num_wann write (chk_unit, '(2G25.17)') u_matrix(i, j, k) end do end do end do do l = 1, num_kpts do k = 1, kmesh_info%nntot do j = 1, num_wann do i = 1, num_wann write (chk_unit, '(2G25.17)') m_matrix(i, j, k, l) end do end do end do end do do j = 1, num_wann write (chk_unit, '(3G25.17)') (wannier_data%centres(i, j), i=1, 3) end do do i = 1, num_wann write (chk_unit, '(G25.17)') wannier_data%spreads(i) end do close (chk_unit) write (stdout, '(a/)') ' done' end subroutine conv_write_chkpt_fmt