The Elk Code
rhouplot.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 rhouplot
7 use modmain
8 use modulr
9 use modomp
10 implicit none
11 ! local variables
12 integer ifq,nthd
13 ! allocatable arrays
14 complex(8), allocatable :: rhoqir_(:,:)
15 ! initialise universal variables
16 call init0
17 call init1
18 ! initialise the ultra long-range variables
19 call initulr
20 ! read in the density from STATE_ULR.OUT
21 call readstulr
22 ! convert interstitial density from coarse to fine grid
23 allocate(rhoqir_(ngtot,nfqrz))
24 call holdthd(nfqrz,nthd)
25 !$OMP PARALLEL DO DEFAULT(SHARED) &
26 !$OMP SCHEDULE(DYNAMIC) &
27 !$OMP NUM_THREADS(nthd)
28 do ifq=1,nfqrz
29  call zfirctof(rhoqir(:,ifq),rhoqir_(:,ifq))
30 end do
31 !$OMP END PARALLEL DO
32 call freethd(nthd)
33 ! write the density plot to file
34 select case(task)
35 case(731)
36  open(50,file='RHOU1D.OUT',form='FORMATTED')
37  open(51,file='RHOULINES.OUT',form='FORMATTED')
38  call plotu1d(50,51,1,rhoqmt,rhoqir_)
39  close(50)
40  close(51)
41  write(*,*)
42  write(*,'("Info(rhouplot):")')
43  write(*,'(" 1D ultra long-range density plot written to RHOU1D.OUT")')
44  write(*,'(" vertex location lines written to RHOULINES.OUT")')
45 case(732)
46  open(50,file='RHOU2D.OUT',form='FORMATTED')
47  call plotu2d(.false.,50,1,rhoqmt,rhoqir_)
48  close(50)
49  write(*,*)
50  write(*,'("Info(rhouplot): 2D ultra long-range density plot written to &
51  &RHOU2D.OUT")')
52 case(733)
53  open(50,file='RHOU3D.OUT',form='FORMATTED')
54  call plotu3d(50,1,rhoqmt,rhoqir_)
55  close(50)
56  write(*,*)
57  write(*,'("Info(rhouplot): 3D ultra long-range density plot written to &
58  &RHOU3D.OUT")')
59 end select
60 deallocate(rhoqir_)
61 end subroutine
62 
subroutine readstulr
Definition: readstulr.f90:7
subroutine plotu2d(tproj, fnum, nf, zfmt, zfir)
Definition: plotu2d.f90:7
integer task
Definition: modmain.f90:1299
integer ngtot
Definition: modmain.f90:390
Definition: modomp.f90:6
subroutine init1
Definition: init1.f90:10
integer nfqrz
Definition: modmain.f90:539
subroutine zfirctof(zfirc, zfir)
Definition: zfirctof.f90:7
complex(8), dimension(:,:,:), allocatable rhoqmt
Definition: modulr.f90:60
subroutine freethd(nthd)
Definition: modomp.f90:106
subroutine plotu3d(fnum, nf, zfmt, zfir)
Definition: plotu3d.f90:7
subroutine holdthd(nloop, nthd)
Definition: modomp.f90:78
subroutine init0
Definition: init0.f90:10
subroutine plotu1d(fnum1, fnum2, nf, zfmt, zfir)
Definition: plotu1d.f90:7
Definition: modulr.f90:6
subroutine rhouplot
Definition: rhouplot.f90:7
subroutine initulr
Definition: initulr.f90:7
complex(8), dimension(:,:), allocatable rhoqir
Definition: modulr.f90:60