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