Commit cc31c56e authored by Serhiy Mochalskyy's avatar Serhiy Mochalskyy
Browse files

deleted all not necessarry files

parent bea7b78a
Pipeline #5331 skipped
......@@ -177,186 +177,3 @@ enddo
end subroutine bfield_par_par
! ----------------------------------------------------------------------
subroutine bfield_par(b_par,xp,yp,zp,xu,yu,zu,n,x,y,z,ntri,j_pot,n_pot)
! ----------------------------------------------------------------------
! 23.09.09
! purpose:
!
!
! ----------------------------------------------------------------------
implicit none
real, dimension (n) :: xp,yp,zp,xu,yu,zu
real, dimension (n,n_pot) :: b_par
real, dimension (ntri,3) :: x,y,z
integer,dimension (ntri,3) :: j_pot
integer :: n,ntri,n_pot
! ----------------------------------------------------------------------
! local variables
real :: x1,y1,z1,x2,y2,z2,x3,y3,z3,sn
real :: s1,s2,s3,d221,d232,d213,al1,al2,al3 &
,vx32,vy32,vz32,vx13,vy13,vz13 &
,ata1,ata2,ata3,v21,v32,v13,at &
,s21,s22,s23,dp1,dm1,dp2,dm2,dp3,dm3 &
,ap1,am1,ap2,am2,ap3,am3 &
,h,ln1,ln2,ln3,ar1,ar2,ar3,vx,vy,vz &
,x21,y21,z21,x32,y32,z32,x13,y13,z13 &
,tx1,ty1,tz1,tx2,ty2,tz2,tx3,ty3,tz3 &
,nx,ny,nz,pi41,area,d21,d32,d13 &
,jx1,jy1,jz1,jx2,jy2,jz2,jx3,jy3,jz3,temp3 &
,dep1,dep2,dep3,dem1,dem2,dem3,temp1,temp2
integer :: i,k,j1,j2,j3
! ----------------------------------------------------------------------
!$OMP PARALLEL DEFAULT(SHARED) PRIVATE( &
!$OMP x1,y1,z1,x2,y2,z2,x3,y3,z3,sn &
!$OMP ,s1,s2,s3,d221,d232,d213,al1,al2,al3 &
!$OMP ,vx32,vy32,vz32,vx13,vy13,vz13 &
!$OMP ,ata1,ata2,ata3,v21,v32,v13,at &
!$OMP ,s21,s22,s23,dp1,dm1,dp2,dm2,dp3,dm3 &
!$OMP ,ap1,am1,ap2,am2,ap3,am3 &
!$OMP ,h,ln1,ln2,ln3,ar1,ar2,ar3,vx,vy,vz &
!$OMP ,x21,y21,z21,x32,y32,z32,x13,y13,z13 &
!$OMP ,tx1,ty1,tz1,tx2,ty2,tz2,tx3,ty3,tz3 &
!$OMP ,nx,ny,nz,pi41,area,d21,d32,d13 &
!$OMP ,jx1,jy1,jz1,jx2,jy2,jz2,jx3,jy3,jz3,temp3 &
!$OMP ,dep1,dep2,dep3,dem1,dem2,dem3,temp1,temp2 &
!$OMP ,i,k,j1,j2,j3 )
!$OMP DO
do k=1,ntri
x21 = x(k,2) - x(k,1)
y21 = y(k,2) - y(k,1)
z21 = z(k,2) - z(k,1)
x32 = x(k,3) - x(k,2)
y32 = y(k,3) - y(k,2)
z32 = z(k,3) - z(k,2)
x13 = x(k,1) - x(k,3)
y13 = y(k,1) - y(k,3)
z13 = z(k,1) - z(k,3)
d221 =x21**2+y21**2+z21**2
d232 =x32**2+y32**2+z32**2
d213 =x13**2+y13**2+z13**2
d21 = sqrt(d221)
d32 = sqrt(d232)
d13 = sqrt(d213)
nx = -y21*z13 + z21*y13
ny = -z21*x13 + x21*z13
nz = -x21*y13 + y21*x13
area = 1./sqrt(nx*nx+ny*ny+nz*nz)
pi41 = .125/asin(1.)
jx1 = x32*area*pi41
jy1 = y32*area*pi41
jz1 = z32*area*pi41
jx2 = x13*area*pi41
jy2 = y13*area*pi41
jz2 = z13*area*pi41
jx3 = x21*area*pi41
jy3 = y21*area*pi41
jz3 = z21*area*pi41
nx = nx*area
ny = ny*area
nz = nz*area
tx1 = (y32*nz-z32*ny)
ty1 = (z32*nx-x32*nz)
tz1 = (x32*ny-y32*nx)
tx2 = (y13*nz-z13*ny)
ty2 = (z13*nx-x13*nz)
tz2 = (x13*ny-y13*nx)
tx3 = (y21*nz-z21*ny)
ty3 = (z21*nx-x21*nz)
tz3 = (x21*ny-y21*nx)
j1 = j_pot(k,1)
j2 = j_pot(k,2)
j3 = j_pot(k,3)
do i=1,n
x1 = x(k,1) - xp(i)
y1 = y(k,1) - yp(i)
z1 = z(k,1) - zp(i)
x2 = x(k,2) - xp(i)
y2 = y(k,2) - yp(i)
z2 = z(k,2) - zp(i)
x3 = x(k,3) - xp(i)
y3 = y(k,3) - yp(i)
z3 = z(k,3) - zp(i)
sn = nx*x1+ny*y1+nz*z1
h = abs(sn)
s21 = x1**2+y1**2+z1**2
s22 = x2**2+y2**2+z2**2
s23 = x3**2+y3**2+z3**2
s1 = sqrt(s21)
s2 = sqrt(s22)
s3 = sqrt(s23)
al1 = alog((s2+s1+d21)/(s1+s2-d21))
al2 = alog((s3+s2+d32)/(s3+s2-d32))
al3 = alog((s1+s3+d13)/(s1+s3-d13))
ar1 = x1*tx3+y1*ty3+z1*tz3
ar2 = x2*tx1+y2*ty1+z2*tz1
ar3 = x3*tx2+y3*ty2+z3*tz2
dp1 = .5*(s22-s21+d221)
dp2 = .5*(s23-s22+d232)
dp3 = .5*(s21-s23+d213)
dm1 = dp1-d221
dm2 = dp2-d232
dm3 = dp3-d213
ap1 = ar1*dp1
dep1 = ar1**2+h*d221*(h+s2)
ap2 = ar2*dp2
dep2 = ar2**2+h*d232*(h+s3)
ap3 = ar3*dp3
dep3 = ar3**2+h*d213*(h+s1)
am1 = ar1*dm1
dem1 = ar1**2+h*d221*(h+s1)
am2 = ar2*dm2
dem2 = ar2**2+h*d232*(h+s2)
am3 = ar3*dm3
dem3 = ar3**2+h*d213*(h+s3)
ata1 = atan2(ap1*dem1-am1*dep1,dep1*dem1+ap1*am1)
ata2 = atan2(ap2*dem2-am2*dep2,dep2*dem2+ap2*am2)
ata3 = atan2(ap3*dem3-am3*dep3,dep3*dem3+ap3*am3)
at = sign(1.,sn)*(ata1+ata2+ata3)
vx = -nx*at + al1*tx3/d21+al2*tx1/d32+al3*tx2/d13
vy = -ny*at + al1*ty3/d21+al2*ty1/d32+al3*ty2/d13
vz = -nz*at + al1*tz3/d21+al2*tz1/d32+al3*tz2/d13
temp1 = (vy*jz1-vz*jy1)*xu(i) &
+ (vz*jx1-vx*jz1)*yu(i) &
+ (vx*jy1-vy*jx1)*zu(i)
!$OMP ATOMIC
b_par(i,j1) = b_par(i,j1)+ temp1
temp2 = (vy*jz2-vz*jy2)*xu(i) &
+ (vz*jx2-vx*jz2)*yu(i) &
+ (vx*jy2-vy*jx2)*zu(i)
!$OMP ATOMIC
b_par(i,j2) = b_par(i,j2)+ temp2
temp3 = (vy*jz3-vz*jy3)*xu(i) &
+ (vz*jx3-vx*jz3)*yu(i) &
+ (vx*jy3-vy*jx3)*zu(i)
!$OMP ATOMIC
b_par(i,j3) = b_par(i,j3)+ temp3
enddo
enddo
!$OMP END DO
!$OMP END PARALLEL
end subroutine bfield_par
......@@ -17,7 +17,6 @@ F_MAIN_SRC = mod_icontr.f90\
coil_2d.f90\
linequ.f90\
simil_trafo.f90\
ideal_wall_response.f90\
resistive_wall_response.f90\
bfield_c.f90\
bfield_par.f90\
......@@ -61,12 +60,7 @@ F_MAIN_SRC = mod_icontr.f90\
get_index_dima.f90\
output.f90\
print_starwall_response.f90\
print_starwall_d_yy.f90\
print_starwall_m_ye.f90\
print_starwall_m_ey.f90\
print_starwall_m_ee.f90\
print_starwall_files_vtk.f90\
print_starwall_d_ee.f90
ideal_wall_response.f90
F_MAIN_OBJ = $(addprefix $(OBJ_DIR)/,$(F_MAIN_SRC:.f90=.o))
MAIN_OBJ = $(F_MAIN_OBJ)
......@@ -161,10 +155,6 @@ $(OBJ_DIR)/tri_contr_surf.o: \
$(OBJ_DIR)/surface_wall.o: \
$(OBJ_DIR)/mod_icontr.o $(OBJ_DIR)/mod_tri_w.o\
$(OBJ_DIR)/mod_mpi_v.o
$(OBJ_DIR)/ideal_wall_response.o: \
$(OBJ_DIR)/mod_icontr.o $(OBJ_DIR)/mod_tri_w.o\
$(OBJ_DIR)/mod_solv.o $(OBJ_DIR)/mod_contr_su.o\
$(OBJ_DIR)/mod_coil2d.o $(OBJ_DIR)/mod_sca.o
$(OBJ_DIR)/read_coil_data.o: \
$(OBJ_DIR)/mod_coil2d.o
$(OBJ_DIR)/simil_trafo.o: \
......@@ -231,22 +221,6 @@ $(OBJ_DIR)/mpi_and_scalapack_init.o:\
$(OBJ_DIR)/mod_mpi_v.o $(OBJ_DIR)/mod_time.o
$(OBJ_DIR)/output.o:\
$(OBJ_DIR)/mod_mpi_v.o
$(OBJ_DIR)/print_starwall_d_yy.o:\
$(OBJ_DIR)/mod_mpi_v.o $(OBJ_DIR)/mod_resistive.o
$(OBJ_DIR)/print_starwall_m_ye.o:\
$(OBJ_DIR)/mod_mpi_v.o $(OBJ_DIR)/mod_resistive.o\
$(OBJ_DIR)/mod_solv.o $(OBJ_DIR)/mod_sca.o
$(OBJ_DIR)/print_starwall_m_ey.o:\
$(OBJ_DIR)/mod_mpi_v.o $(OBJ_DIR)/mod_resistive.o\
$(OBJ_DIR)/mod_solv.o $(OBJ_DIR)/mod_sca.o
$(OBJ_DIR)/print_starwall_m_ee.o:\
$(OBJ_DIR)/mod_mpi_v.o $(OBJ_DIR)/mod_resistive.o\
$(OBJ_DIR)/mod_solv.o $(OBJ_DIR)/mod_sca.o
$(OBJ_DIR)/print_starwall_files_vtk.o: \
$(OBJ_DIR)/mod_coil2d.o $(OBJ_DIR)/mod_tri_w.o\
$(OBJ_DIR)/mod_icontr.o $(OBJ_DIR)/mod_contr_su.o\
$(OBJ_DIR)/mod_tri_p.o
$(OBJ_DIR)/print_starwall_d_ee.o:\
$(OBJ_DIR)/mod_mpi_v.o $(OBJ_DIR)/mod_resistive.o\
$(OBJ_DIR)/mod_solv.o $(OBJ_DIR)/mod_sca.o
$(OBJ_DIR)/bfield_par.o:\
$(OBJ_DIR)/mod_mpi_v.o
......@@ -20,8 +20,6 @@
call dpotrs('U',nd,nd_bez,a_ww,nd,a_we,nd,info)
b_ee= a_ee
!$OMP PARALLEL DEFAULT(SHARED) PRIVATE(i,j,k)
!$OMP DO
do i=1,nd_bez
do k=1,nd_bez
......@@ -31,8 +29,6 @@
enddo
enddo
!$OMP END DO
!$OMP DO
do i=1,nd_bez
do k=1,nd_bez
......@@ -42,8 +38,6 @@
enddo
enddo
!$OMP END DO
!$OMP END PARALLEL
open(60,file='starwall_m_nw',form="formatted",iostat=ier)
write(60,'(i6)') nd_bez
......
......@@ -13,9 +13,8 @@ subroutine input
integer :: i
! Namelist with input parameters
namelist / params / i_response, n_harm, n_tor, nv, delta, n_points, nwall, iwall, nu_coil
namelist / params_scalapack / NB, ORFAC, lwork_cooficient
namelist / params_output / format_type
namelist / params / i_response, n_harm, n_tor, nv, delta, n_points, nwall, iwall, nu_coil,\
NB, ORFAC, lwork_cooficient, format_type
! --- Output code information
if(rank==0) write(outp,*) '-------------------------------------------'
if(rank==0) write(outp,*) 'STARWALL-JOREK vacuum response code'
......@@ -35,6 +34,11 @@ subroutine input
ncoil=0
ntri_c=0
NB = 64
ORFAC = 0.00000001
lwork_cooficient = 3
format_type = 'unformatted'
if(n_harm>1) then
do i=1,n_harm
n_tor(i)=i
......@@ -45,20 +49,24 @@ subroutine input
! Only one task read data from input file and send them after to all tasks
if(rank==0) read(inp, params) ! Read namelist from STDIN
!==========================================================================
call MPI_BCAST(i_response, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ier)
call MPI_BCAST(n_harm, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ier)
call MPI_BCAST(n_tor, n_harm, MPI_INTEGER, 0, MPI_COMM_WORLD, ier)
call MPI_BCAST(nv, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ier)
call MPI_BCAST(delta, 1, MPI_DOUBLE_PRECISION, 0, MPI_COMM_WORLD, ier)
call MPI_BCAST(n_points, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ier)
call MPI_BCAST(nwall, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ier)
call MPI_BCAST(iwall, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ier)
call MPI_BCAST(nu_coil, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ier)
!==========================================================================
call MPI_BCAST(i_response, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ier)
call MPI_BCAST(n_harm, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ier)
call MPI_BCAST(n_tor, n_harm, MPI_INTEGER, 0, MPI_COMM_WORLD, ier)
call MPI_BCAST(nv, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ier)
call MPI_BCAST(delta, 1, MPI_DOUBLE_PRECISION, 0, MPI_COMM_WORLD, ier)
call MPI_BCAST(n_points, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ier)
call MPI_BCAST(nwall, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ier)
call MPI_BCAST(iwall, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ier)
call MPI_BCAST(nu_coil, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ier)
call MPI_BCAST(NB, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ier)
call MPI_BCAST(ORFAC, 1, MPI_DOUBLE_PRECISION, 0, MPI_COMM_WORLD, ier)
call MPI_BCAST(lwork_cooficient, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ier)
call MPI_BCAST(format_type, len(format_type), MPI_CHARACTER,0, MPI_COMM_WORLD, ier)
!==========================================================================
! --- Log input parameters
if(rank==0) then
write(outp,'(A,I4)')
write(outp,*) 'Input parameters:'
......@@ -72,30 +80,15 @@ subroutine input
write(outp,'(A,I4)') ' iwall =', iwall
write(outp,'(A,I4)') ' nu_coil =', nu_coil
write(outp,'(A,I4)')
endif
! Only one task read data from input file and send them after to all tasks
if(rank==0) read(inp, params_scalapack) ! Read namelist from STDIN
!==================================================================================
call MPI_BCAST(NB, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ier)
call MPI_BCAST(ORFAC, 1, MPI_DOUBLE_PRECISION, 0, MPI_COMM_WORLD, ier)
call MPI_BCAST(lwork_cooficient, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ier)
!==================================================================================
if(rank==0) then
write(outp,*) ' ScaLAPACK Input parameters:'
write(outp,'(A,I4)') ' NB =', NB
write(outp,'(A,ES10.3)') ' ORFAC =', ORFAC
write(outp,'(A,I4)')
endif
if(rank==0) read(inp, params_output) ! Read namelist from STDIN
!==================================================================================
call MPI_BCAST(format_type, len(format_type), MPI_CHARACTER,0, MPI_COMM_WORLD, ier)
!==================================================================================
if(rank==0) then
write(outp,'(A,I4)')
write(outp,*) 'Output starwall-response.dat:'
write(outp,'(A,A)') ' file format = ',format_type
write(outp,'(A,I4)')
endif
......@@ -126,13 +119,6 @@ subroutine input
write(outp,*) 'ERROR: lwork_cooficient must have a value between >1'
stop 1
end if
! if ( nu_coil >0 ) then
! write(outp,*) 'ERROR: nu_coil does not include in this code version. &
! The value should be 0'
! stop 1
! end if
! --- Output additional information
......
......@@ -6,36 +6,10 @@ include "mpif.h"
if(rank==0) write(*,*) 'output begings'
!======================================
!call print_starwall_d_yy
!======================================
!======================================
!call print_starwall_m_ye
!======================================
!======================================
!call print_starwall_m_ey
!======================================
!call print_starwall_m_ey2
!======================================
!call print_starwall_m_ee
!======================================
!======================================
!call print_starwall_d_ee
!======================================
!======================================
call print_starwall_response
!======================================
!======================================
!call print_starwall_files_vtk
!======================================
if(rank==0) write(*,*) 'output ends'
if(rank==0) write(*,*) '==============================================================='
......
subroutine print_starwall_d_ee
use mpi_v
use resistive
use solv
use sca
!-----------------------------------------------------------------------
implicit none
include "mpif.h"
integer :: i_loc,j_loc
real :: num
!-----------------------------------------------------------------------
CALL DESCINIT(DESCA, nd_bez, nd_bez, NB, NB, 0, 0, CONTEXT, LDA_dee, INFO_A )
if(INFO_A .NE. 0) then
write(6,*) "Something is wrong in print_starwall_d_ee CALL DESCINIT DESCA, INFO_A=",INFO_A
stop
endif
if(rank==0) then
open(60,file='starwall_d_ee',form="formatted",iostat=ier)
write(60,'(2i8)') nd_bez,nd_bez
endif
DO i_loc = 1,nd_bez
DO j_loc = 1,nd_bez
CALL pdelget('A','D',num, d_ee_loc,i_loc,j_loc,DESCA)
if(rank==0) write(60,'(2i6,1pe12.4)') i_loc,j_loc,num
END DO
END DO
if(rank==0) close(60)
end subroutine print_starwall_d_ee
subroutine print_starwall_d_yy
use mpi_v
use resistive
!-----------------------------------------------------------------------
implicit none
include "mpif.h"
integer :: i
!-----------------------------------------------------------------------
if(rank==0) then
open(60,file='starwall_d_yy',form="formatted",iostat=ier)
write(60,'(i8)') n_w
do i=1,n_w
write(60,'(i8,1pe16.8)') i,1./gamma(i)
enddo
close(60)
endif
end subroutine print_starwall_d_yy
subroutine print_starwall_files_vtk
use tri_w
use tri_p
use mpi_v
use resistive
use icontr
use contr_su
use coil2d
!-----------------------------------------------------------------------
implicit none
include "mpif.h"
integer :: i,j
!-----------------------------------------------------------------------
if(rank==0) then
140 format(a)
141 format(a,i8,a)
142 format(3es24.16)
143 format(a,2i8)
144 format(4i8)
!===========================================================
! --- VTK: Control surface
open(60, file='control.vtk')
write(60,140) '# vtk DataFile Version 2.0'
write(60,140) 'testdata'
write(60,140) 'ASCII'
write(60,140) 'DATASET POLYDATA'
write(60,141) 'POINTS', 3*ntri_p, ' float'
do i = 1, ntri_p
do j = 1, 3
write(60,142) xp(i,j), yp(i,j), zp(i,j)
end do
end do
write(60,143) 'POLYGONS', ntri_p, ntri_p*4
do i = 1, ntri_p
write(60,144) 3, 3*(i-1), 3*(i-1)+1, 3*(i-1)+2
end do
write(60,141) 'POINT_DATA', 3*ntri_p
write(60,140) 'SCALARS potentials float'
write(60,140) 'LOOKUP_TABLE default'
do i = 1, 3*ntri_p
write(60,144) mod(i/3,5) !###
end do
close(60)
!===========================================================
!===========================================================
! --- VTK: Wall
open(60, file='wall.vtk')
write(60,140) '# vtk DataFile Version 2.0'
write(60,140) 'testdata'
write(60,140) 'ASCII'
write(60,140) 'DATASET POLYDATA'
write(60,141) 'POINTS', npot_w, ' float'
do i = 1, npot_w
write(60,142) xyzpot_w(i,:)
end do
write(60,143) 'POLYGONS', ntri_w, ntri_w*4
do i = 1, ntri_w
write(60,144) 3, jpot_w(i,:)-1
end do
write(60,141) 'POINT_DATA', npot_w
write(60,140) 'SCALARS potentials float'
write(60,140) 'LOOKUP_TABLE default'
do i = 1, npot_w
write(60,144) mod(i,3) !###
end do
close(60)
!===========================================================
!===========================================================
! --- VTK: Coils
open(60, file='coils.vtk')
write(60,140) '# vtk DataFile Version 2.0'
write(60,140) 'testdata'
write(60,140) 'ASCII'
write(60,140) 'DATASET POLYDATA'
write(60,141) 'POINTS', 3*ntri_c, ' float'
do i = 1, ntri_c
write(60,142) x_coil(i,1), z_coil(i,1), y_coil(i,1)
write(60,142) x_coil(i,2), z_coil(i,2), y_coil(i,2)
write(60,142) x_coil(i,3), z_coil(i,3), y_coil(i,3)
end do
write(60,143) 'POLYGONS', ntri_c, ntri_c*4
do i = 1, ntri_c
write(60,144) 3, 3 * i - (/ 3, 2, 1 /)
end do
write(60,141) 'POINT_DATA', 3*ntri_c
write(60,140) 'SCALARS potentials float'
write(60,140) 'LOOKUP_TABLE default'
do i = 1, ntri_c
write(60,142) 0.d0
end do
close(60)
!===========================================================
endif
if(rank==0) deallocate(xyzpot_w)
end subroutine print_starwall_files_vtk
subroutine print_starwall_m_ee
use mpi_v
use resistive
use solv
use sca