The Elk Code
writestulr.f90
Go to the documentation of this file.
1 
2 ! Copyright (C) 2018 T. Mueller, J. K. Dewhurst, S. Sharma and E. K. U. Gross.
3 ! This file is distributed under the terms of the GNU General Public License.
4 ! See the file COPYING for license details.
5 
6 subroutine writestulr
7 use modmain
8 use modulr
9 implicit none
10 ! local variables
11 integer ifq,idm
12 open(100,file='STATE_ULR.OUT',form='UNFORMATTED',action='WRITE')
13 write(100) version
14 write(100) natmtot
15 write(100) npcmtmax
16 write(100) ngtc
17 write(100) ngtot
18 write(100) ndmag
19 write(100) fsmtype
20 write(100) nqpt
21 write(100) nfqrz
22 write(100) ivq
23 write(100) iqrzf
24 write(100) efermi
25 ! write the ultra long-range density in Q-space
26 do ifq=1,nfqrz
27  write(100) rhoqmt(:,:,ifq)
28  write(100) rhoqir(:,ifq)
29 end do
30 ! write the Kohn-Sham effective potential in Q-space
31 do ifq=1,nfqrz
32  write(100) vsqmt(:,:,ifq)
33  write(100) vsqir(:,ifq)
34 end do
35 ! write the external Coulomb potential in Q-space
36 do ifq=1,nfqrz
37  write(100) vclq(ifq)
38 end do
39 if (spinpol) then
40 ! write the magnetisation in Q-space
41  do ifq=1,nfqrz
42  do idm=1,ndmag
43  write(100) magqmt(:,:,idm,ifq)
44  write(100) magqir(:,idm,ifq)
45  end do
46  end do
47 ! write the Kohn-Sham effective magnetic field in Q-space
48  do ifq=1,nfqrz
49  do idm=1,ndmag
50  write(100) bsqmt(:,:,idm,ifq)
51  write(100) bsqir(:,idm,ifq)
52  end do
53  end do
54 ! write the external magnetic fields in Q-space
55  do ifq=1,nfqrz
56  do idm=1,ndmag
57  write(100) bfcq(idm,ifq)
58  write(100) bfcmtq(:,idm,ifq)
59  end do
60  end do
61 ! write fixed spin moment magnetic fields
62  if (fsmtype /= 0) then
63  write(100) bfsmc
64  write(100) bfsmcmt
65  end if
66 end if
67 close(100)
68 end subroutine
69 
complex(8), dimension(:,:,:), pointer, contiguous vsqmt
Definition: modulr.f90:84
real(8) efermi
Definition: modmain.f90:907
integer npcmtmax
Definition: modmain.f90:216
integer ngtot
Definition: modmain.f90:390
integer ngtc
Definition: modmain.f90:392
logical spinpol
Definition: modmain.f90:228
integer nqpt
Definition: modmain.f90:525
complex(8), dimension(:,:), pointer, contiguous vsqir
Definition: modulr.f90:84
integer ndmag
Definition: modmain.f90:238
integer, dimension(:,:), allocatable ivq
Definition: modmain.f90:529
integer, dimension(:), allocatable iqrzf
Definition: modmain.f90:543
real(8), dimension(3) bfsmc
Definition: modmain.f90:257
complex(8), dimension(:,:,:,:), allocatable magqmt
Definition: modulr.f90:61
complex(8), dimension(:,:,:), pointer, contiguous bsqir
Definition: modulr.f90:85
complex(8), dimension(:,:,:), allocatable magqir
Definition: modulr.f90:61
complex(8), dimension(:), allocatable vclq
Definition: modulr.f90:66
subroutine writestulr
Definition: writestulr.f90:7
complex(8), dimension(:,:,:,:), pointer, contiguous bsqmt
Definition: modulr.f90:85
integer nfqrz
Definition: modmain.f90:539
complex(8), dimension(:,:,:), allocatable bfcmtq
Definition: modulr.f90:73
real(8), dimension(:,:), allocatable bfsmcmt
Definition: modmain.f90:263
integer, dimension(3), parameter version
Definition: modmain.f90:1289
complex(8), dimension(:,:,:), allocatable rhoqmt
Definition: modulr.f90:60
complex(8), dimension(:,:), allocatable bfcq
Definition: modulr.f90:71
integer natmtot
Definition: modmain.f90:40
Definition: modulr.f90:6
integer fsmtype
Definition: modmain.f90:251
complex(8), dimension(:,:), allocatable rhoqir
Definition: modulr.f90:60