mirror of https://gitlab.com/scemama/eplf
43 lines
1.1 KiB
Forth
43 lines
1.1 KiB
Forth
program to_cube
|
|
implicit none
|
|
|
|
integer :: i
|
|
integer :: l
|
|
integer :: ix, iy, iz
|
|
integer :: iargc
|
|
character*(32) :: filename
|
|
character*(32) :: grid_type
|
|
|
|
if (iragc() /= 2) then
|
|
print *, 'usage: to_cube ',trim(filename), trim(grid_type)
|
|
stop 1
|
|
endif
|
|
call getarg(1,filename)
|
|
call getarg(2,grid_type)
|
|
if (.not.mpi_master) then
|
|
return
|
|
endif
|
|
open(unit=99,file=grid_cube_filename,status='UNKNOWN',action='WRITE')
|
|
write (99,*) 'Cube File'
|
|
write (99,*) 'Analytical EPLF grid'
|
|
write (99,10) nucl_num,(grid_eplf_origin(i), i=1,3)
|
|
write (99,10) grid_eplf_x_num, grid_eplf_step(1), 0., 0.
|
|
write (99,10) grid_eplf_y_num, 0., grid_eplf_step(2), 0.
|
|
write (99,10) grid_eplf_z_num, 0., 0., grid_eplf_step(3)
|
|
do i=1,nucl_num
|
|
write (99,11) integer(nucl_charge(i)), nucl_charge(i),
|
|
(nucl_coord(i,l),l=1,3)
|
|
enddo
|
|
do ix = 1, grid_eplf_x_num
|
|
do iy = 1, grid_eplf_y_num
|
|
write (99,20) (grid_eplf(ix,iy,iz), iz=1, grid_eplf_z_num)
|
|
enddo
|
|
enddo
|
|
10 format (2X,I3,3(2X,F10.6))
|
|
11 format (2X,I3,4(2X,F10.6))
|
|
20 format (6(E13.5))
|
|
close(99)
|
|
|
|
end
|
|
|