The Elk Code
plotu2d.f90
Go to the documentation of this file.
1 
2 ! Copyright (C) 2019 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 plotu2d(tproj,fnum,nf,zfmt,zfir)
7 use modmain
8 implicit none
9 ! arguments
10 logical, intent(in) :: tproj
11 integer, intent(in) :: fnum,nf
12 complex(8), intent(in) :: zfmt(npcmtmax,natmtot,nf,nfqrz)
13 complex(8), intent(in) :: zfir(ngtot,nf,nfqrz)
14 ! local variables
15 integer np,jf,ip
16 real(8) vpnl(3)
17 ! allocatable arrays
18 real(8), allocatable :: vpl(:,:),vppc(:,:),fp(:,:)
19 if ((nf < 1).or.(nf > 4)) then
20  write(*,*)
21  write(*,'("Error(plotu2d): invalid number of functions : ",I0)') nf
22  write(*,*)
23  stop
24 end if
25 ! allocate local arrays
26 np=np2d(1)*np2d(2)
27 allocate(vpl(3,np),vppc(2,np),fp(np,nf))
28 ! generate the 2D plotting points
29 call plotpt2d(avec,ainv,vpnl,vpl,vppc)
30 ! evaluate the functions at the grid points
31 call plotulr(np,vpl,nf,zfmt,zfir,fp)
32 ! project the vector function onto the 2D plotting plane if required
33 if (tproj.and.(nf == 3)) then
34  call proj2d(np,fp)
35 end if
36 ! write the functions to file
37 write(fnum,'(2I6," : grid size")') np2d(:)
38 do ip=1,np
39  write(fnum,'(6G18.10)') vppc(1,ip),vppc(2,ip),(fp(ip,jf),jf=1,nf)
40 end do
41 deallocate(vpl,vppc,fp)
42 end subroutine
43 
subroutine plotpt2d(cvec, cinv, vpnl, vpl, vppc)
Definition: plotpt2d.f90:7
subroutine plotu2d(tproj, fnum, nf, zfmt, zfir)
Definition: plotu2d.f90:7
subroutine plotulr(np, vpl, nf, zfmt, zfir, fp)
Definition: plotulr.f90:7
real(8), dimension(3, 3) ainv
Definition: modmain.f90:14
real(8), dimension(3, 3) avec
Definition: modmain.f90:12
subroutine proj2d(np, fp)
Definition: proj2d.f90:7
integer, dimension(2) np2d
Definition: modmain.f90:1128