The Elk Code
maguplot.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 maguplot
7 use modmain
8 use modulr
9 use modomp
10 implicit none
11 ! local variables
12 integer ifq,idm,nthd
13 ! allocatable arrays
14 complex(8), allocatable :: magqir_(:,:,:)
15 ! initialise universal variables
16 call init0
17 call init1
18 if (.not.spinpol) then
19  write(*,*)
20  write(*,'("Error(maguplot): spin-unpolarised calculation")')
21  write(*,*)
22  stop
23 end if
24 ! initialise the ultra long-range variables
25 call initulr
26 ! read in the magnetisation from STATE_ULR.OUT
27 call readstulr
28 ! convert interstitial magnetisation from coarse to fine grid
29 allocate(magqir_(ngtot,ndmag,nfqrz))
30 call holdthd(nfqrz,nthd)
31 !$OMP PARALLEL DO DEFAULT(SHARED) &
32 !$OMP PRIVATE(idm) &
33 !$OMP SCHEDULE(DYNAMIC) &
34 !$OMP NUM_THREADS(nthd)
35 do ifq=1,nfqrz
36  do idm=1,ndmag
37  call zfirctof(magqir(:,idm,ifq),magqir_(:,idm,ifq))
38  end do
39 end do
40 !$OMP END PARALLEL DO
41 call freethd(nthd)
42 ! write the magnetisation plot to file
43 select case(task)
44 case(771)
45  open(50,file='MAGU1D.OUT',form='FORMATTED')
46  open(51,file='MAGULINES.OUT',form='FORMATTED')
47  call plotu1d(50,51,ndmag,magqmt,magqir_)
48  close(50)
49  close(51)
50  write(*,*)
51  write(*,'("Info(maguplot):")')
52  write(*,'(" 1D ultra long-range magnetisation plot written to MAGU1D.OUT")')
53  write(*,'(" vertex location lines written to MAGULINES.OUT")')
54 case(772)
55  open(50,file='MAGU2D.OUT',form='FORMATTED')
56  call plotu2d(.true.,50,ndmag,magqmt,magqir_)
57  close(50)
58  write(*,*)
59  write(*,'("Info(maguplot): 2D ultra long-range magnetisation plot written to &
60  &MAGU2D.OUT")')
61  if (ndmag == 3) then
62  write(*,'(" Note that the 3D vector field has been locally projected")')
63  write(*,'(" onto the 2D plotting plane axes")')
64  end if
65 case(773)
66  open(50,file='MAGU3D.OUT',form='FORMATTED')
67  call plotu3d(50,ndmag,magqmt,magqir_)
68  close(50)
69  write(*,*)
70  write(*,'("Info(maguplot): 3D ultra long-range magnetisation plot written to &
71  &MAGU3D.OUT")')
72 end select
73 deallocate(magqir_)
74 end subroutine
75 
subroutine readstulr
Definition: readstulr.f90:7
subroutine maguplot
Definition: maguplot.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
logical spinpol
Definition: modmain.f90:228
integer ndmag
Definition: modmain.f90:238
Definition: modomp.f90:6
complex(8), dimension(:,:,:,:), allocatable magqmt
Definition: modulr.f90:61
complex(8), dimension(:,:,:), allocatable magqir
Definition: modulr.f90:61
subroutine init1
Definition: init1.f90:10
integer nfqrz
Definition: modmain.f90:539
subroutine zfirctof(zfirc, zfir)
Definition: zfirctof.f90:7
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 initulr
Definition: initulr.f90:7