Commit 0ec46f54 authored by Daniel Wortmann's avatar Daniel Wortmann

Made field type intent(in)

parent f24cee50
......@@ -16,7 +16,6 @@ MODULE m_types_field
REAL :: zsigma = 10.0 ! Distance to the charged plates
REAL :: sigma ! charge at the plates
REAL :: sig_b(2)= 0.0 ! Extra charge for the top/bottom plate
COMPLEX :: vslope = 0.0 ! Dirichlet bnd. cond.: Slope
REAL, ALLOCATABLE :: sigEF(:,:,:) ! (nx, ny, nvac)
COMPLEX, ALLOCATABLE :: rhoEF(:,:) ! (g_||, nvac)
COMPLEX, ALLOCATABLE :: C1(:), C2(:) ! Coeff. for Dirichlet bnd.cond.
......@@ -64,7 +63,6 @@ CONTAINS
CALL mpi_bc(this%efield%sigma ,rank,mpi_comm)
CALL mpi_bc(this%efield%sig_b(1),rank,mpi_comm)
CALL mpi_bc(this%efield%sig_b(2),rank,mpi_comm)
CALL mpi_bc(this%efield%vslope ,rank,mpi_comm)
CALL mpi_bc(this%efield%sigEF ,rank,mpi_comm)
CALL mpi_bc(this%efield%rhoEF ,rank,mpi_comm)
CALL MPI_BC(THIS%EFIELD%C1,RANK,MPI_COMM)
......
......@@ -84,7 +84,7 @@ CONTAINS
TYPE(t_mpi),INTENT(IN) :: mpi
TYPE(t_input),INTENT(IN) :: input
TYPE(t_field),INTENT(INOUT) :: field !This should become INTENT(IN)!!
TYPE(t_field),INTENT(IN) :: field
TYPE(t_atoms),INTENT(IN) :: atoms
TYPE(t_sphhar),INTENT(IN) :: sphhar
TYPE(t_cell),INTENT(IN) :: cell
......
......@@ -42,7 +42,7 @@ CONTAINS
TYPE(t_oneD), INTENT(IN) :: oneD
TYPE(t_sliceplot), INTENT(IN) :: sliceplot
TYPE(t_input), INTENT(IN) :: input
TYPE(t_field), INTENT(INOUT) :: field !efield can be modified
TYPE(t_field), INTENT(IN) :: field
TYPE(t_vacuum), INTENT(IN) :: vacuum
TYPE(t_noco), INTENT(IN) :: noco
TYPE(t_nococonv), INTENT(INOUT) :: nococonv
......
......@@ -57,7 +57,7 @@ SUBROUTINE rdmft(eig_id,mpi,input,kpts,banddos,sliceplot,cell,atoms,enpara,stars
TYPE(t_vacuum), INTENT(IN) :: vacuum
TYPE(t_sphhar), INTENT(IN) :: sphhar
TYPE(t_sym), INTENT(IN) :: sym
TYPE(t_field), INTENT(INOUT) :: field
TYPE(t_field), INTENT(IN) :: field
TYPE(t_potden), INTENT(INOUT) :: vTot
TYPE(t_potden), INTENT(INOUT) :: vCoul
TYPE(t_oneD), INTENT(IN) :: oneD
......
......@@ -43,7 +43,7 @@ contains
type(t_oneD), intent(in) :: oneD
type(t_input), intent(in) :: input
type(t_field), intent(inout) :: field
type(t_field), intent(in) :: field
type(t_vacuum), intent(in) :: vacuum
type(t_sym), intent(in) :: sym
type(t_stars), intent(in) :: stars
......@@ -55,7 +55,7 @@ contains
type(t_potden), intent(inout) :: vCoul
type(t_results), intent(inout), optional :: results
complex :: vintcza, xint, rhobar
complex :: vintcza, xint, rhobar,vslope
integer :: i, i3, irec2, irec3, ivac, j, js, k, k3
integer :: lh, n, nzst1
integer :: imz, imzxy, ichsmrg, ivfft
......@@ -100,7 +100,7 @@ contains
elseif ( input%film .and. .not. oneD%odi%d1 ) then
! ----> potential in the vacuum region
call timestart( "Vacuum" )
call vvac( vacuum, stars, cell, sym, input, field, psq, den%vacz(:,:,ispin), vCoul%vacz(:,:,ispin), rhobar, sig1dh, vz1dh )
call vvac( vacuum, stars, cell, sym, input, field, psq, den%vacz(:,:,ispin), vCoul%vacz(:,:,ispin), rhobar, sig1dh, vz1dh,vslope )
call vvacis( stars, vacuum, sym, cell, psq, input, field, vCoul%vacxy(:,:,:,ispin) )
call vvacxy( stars, vacuum, cell, sym, input, field, den%vacxy(:,:,:,ispin), vCoul%vacxy(:,:,:,ispin), alphm )
call timestop( "Vacuum" )
......@@ -125,7 +125,7 @@ contains
if ( z > cell%amat(3,3) / 2. ) z = z - cell%amat(3,3)
vintcza = vintcz( stars, vacuum, cell, sym, input, field, z, irec2, psq, &
vCoul%vacxy(:,:,:,ispin), vCoul%vacz(:,:,ispin), &
rhobar, sig1dh, vz1dh, alphm )
rhobar, sig1dh, vz1dh, alphm,vslope )
af1(i) = real( vintcza )
bf1(i) = aimag( vintcza )
end do
......
......@@ -24,7 +24,7 @@ CONTAINS
IMPLICIT NONE
TYPE(t_mpi), INTENT(IN) :: mpi
TYPE(t_oneD), INTENT(IN) :: oneD
TYPE(t_field), INTENT(INOUT) :: field
TYPE(t_field), INTENT(IN) :: field
TYPE(t_cell), INTENT(IN) :: cell
TYPE(t_vacuum),INTENT(IN) :: vacuum
TYPE(t_noco),INTENT(IN) :: noco
......
......@@ -8,7 +8,7 @@ MODULE m_vintcz
CONTAINS
COMPLEX FUNCTION vintcz(&
& stars,vacuum,cell,sym,input,field,&
& z,nrec2,psq,vxy,vz,rhobar,sig1dh,vz1dh,alphm)
& z,nrec2,psq,vxy,vz,rhobar,sig1dh,vz1dh,alphm,vslope)
USE m_constants
USE m_types
......@@ -22,7 +22,7 @@ CONTAINS
TYPE(t_input),INTENT(IN) :: input
TYPE(t_field),INTENT(IN) :: field
INTEGER, INTENT (IN) :: nrec2
COMPLEX, INTENT (IN) :: rhobar
COMPLEX, INTENT (IN) :: rhobar,vslope
REAL, INTENT (IN) :: sig1dh,vz1dh ,z
! ..
! .. Array Arguments ..
......@@ -97,8 +97,8 @@ CONTAINS
! -----> v2(z)
vintcz = vintcz + vz1dh - fpi_const* (dh-z)*&
& (sig1dh-rhobar/2.* (dh-z))
IF (field%efield%dirichlet .AND. field%efield%vslope /= 0.0) THEN
vintcz = vintcz + field%efield%vslope * (dh-z)
IF (field%efield%dirichlet .AND. vslope /= 0.0) THEN
vintcz = vintcz + vslope * (dh-z)
END IF
! ----> (g.ne.0) coefficients
ELSE
......
......@@ -5,7 +5,7 @@ module m_vvac
! ****************************************************************
contains
subroutine vvac( vacuum, stars, cell, sym, input, field, psq, rht, vz, rhobar, sig1dh, vz1dh )
subroutine vvac( vacuum, stars, cell, sym, input, field, psq, rht, vz, rhobar, sig1dh, vz1dh ,vslope)
use m_constants
use m_qsf
......@@ -20,7 +20,8 @@ module m_vvac
complex, intent(out) :: rhobar
real, intent(out) :: sig1dh, vz1dh
type(t_input), intent(in) :: input
type(t_field), intent(inout) :: field ! efield is modified here
type(t_field), intent(in) :: field
COMPLEX,INTENT(OUT) :: vslope
real, intent(in) :: rht(vacuum%nmzd,2)
complex, intent(in) :: psq(stars%ng3)
......@@ -92,14 +93,14 @@ module m_vvac
end do
! force matching on the other side
field%efield%vslope = ( field%efield%sig_b(2) - vz(ncsh,1) ) / ( 2 * vacuum%delz * ( ncsh + 1 ) + vacuum%dvac )
vslope = ( field%efield%sig_b(2) - vz(ncsh,1) ) / ( 2 * vacuum%delz * ( ncsh + 1 ) + vacuum%dvac )
ivac = 1
do imz = 1, ncsh
vz(imz,ivac) = vz(imz,ivac) + field%efield%vslope * vacuum%delz * ( ncsh - imz + 1 )
vz(imz,ivac) = vz(imz,ivac) + vslope * vacuum%delz * ( ncsh - imz + 1 )
end do
ivac = 2
do imz = 1, ncsh
vz(imz,ivac) = vz(imz,ivac) + field%efield%vslope * ( vacuum%dvac + vacuum%delz * imz + vacuum%delz * ncsh )
vz(imz,ivac) = vz(imz,ivac) + vslope * ( vacuum%dvac + vacuum%delz * imz + vacuum%delz * ncsh )
end do
vz(ncsh+1:vacuum%nmz,ivac) = field%efield%sig_b(2)
......
......@@ -110,7 +110,7 @@ CONTAINS
! A field of the same form will also be calculated.
TYPE(t_mpi), INTENT(IN) :: mpi
TYPE(t_field), INTENT(INOUT) :: field
TYPE(t_field), INTENT(IN) :: field
TYPE(t_stars), INTENT(IN) :: stars
TYPE(t_atoms), INTENT(IN) :: atoms
TYPE(t_sphhar), INTENT(IN) :: sphhar
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment