The Elk Code
 
Loading...
Searching...
No Matches
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
6subroutine maguplot
7use modmain
8use modulr
9use modomp
10implicit none
11! local variables
12integer ifq,idm,nthd
13! allocatable arrays
14complex(8), allocatable :: magqir_(:,:,:)
15! initialise universal variables
16call init0
17call init1
18if (.not.spinpol) then
19 write(*,*)
20 write(*,'("Error(maguplot): spin-unpolarised calculation")')
21 write(*,*)
22 stop
23end if
24! initialise the ultra long-range variables
25call initulr
26! read in the magnetisation from STATE_ULR.OUT
27call readstulr
28! convert interstitial magnetisation from coarse to fine grid
29allocate(magqir_(ngtot,ndmag,nfqrz))
30call holdthd(nfqrz,nthd)
31!$OMP PARALLEL DO DEFAULT(SHARED) &
32!$OMP PRIVATE(idm) &
33!$OMP SCHEDULE(DYNAMIC) &
34!$OMP NUM_THREADS(nthd)
35do ifq=1,nfqrz
36 do idm=1,ndmag
37 call zfirctof(magqir(:,idm,ifq),magqir_(:,idm,ifq))
38 end do
39end do
40!$OMP END PARALLEL DO
41call freethd(nthd)
42! write the magnetisation plot to file
43select case(task)
44case(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")')
54case(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
65case(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")')
72end select
73deallocate(magqir_)
74end subroutine
75
subroutine init0
Definition init0.f90:10
subroutine init1
Definition init1.f90:10
subroutine initulr
Definition initulr.f90:7
subroutine maguplot
Definition maguplot.f90:7
integer ngtot
Definition modmain.f90:390
integer nfqrz
Definition modmain.f90:539
logical spinpol
Definition modmain.f90:228
integer task
Definition modmain.f90:1298
integer ndmag
Definition modmain.f90:238
subroutine holdthd(nloop, nthd)
Definition modomp.f90:78
subroutine freethd(nthd)
Definition modomp.f90:106
complex(8), dimension(:,:,:), allocatable magqir
Definition modulr.f90:60
complex(8), dimension(:,:,:,:), allocatable magqmt
Definition modulr.f90:60
subroutine plotu1d(fnum1, fnum2, nf, zfmt, zfir)
Definition plotu1d.f90:7
subroutine plotu2d(tproj, fnum, nf, zfmt, zfir)
Definition plotu2d.f90:7
subroutine plotu3d(fnum, nf, zfmt, zfir)
Definition plotu3d.f90:7
subroutine readstulr
Definition readstulr.f90:7
subroutine zfirctof(zfirc, zfir)
Definition zfirctof.f90:7