2009-12-09 23:28:19 +01:00
|
|
|
program to_cube
|
2009-12-09 09:48:50 +01:00
|
|
|
implicit none
|
|
|
|
|
|
|
|
integer :: i
|
|
|
|
integer :: l
|
|
|
|
integer :: ix, iy, iz
|
2009-12-09 23:28:19 +01:00
|
|
|
integer :: iargc
|
2009-12-10 00:58:43 +01:00
|
|
|
character*(128) :: filename
|
|
|
|
character*(128) :: grid_type
|
|
|
|
real, allocatable :: grid4D(:,:,:,:)
|
|
|
|
real, allocatable :: grid3D(:,:,:)
|
2009-12-09 09:48:50 +01:00
|
|
|
|
|
|
|
if (.not.mpi_master) then
|
|
|
|
return
|
|
|
|
endif
|
2009-12-10 00:58:43 +01:00
|
|
|
if (iargc() /= 2) then
|
|
|
|
print *, 'usage: to_cube filename grid_type'
|
|
|
|
stop 1
|
|
|
|
endif
|
|
|
|
call getarg(2,grid_type)
|
|
|
|
filename = trim(ezfio_filename)//'_'//trim(grid_type)//'.cube'
|
|
|
|
open(unit=90,file=filename,status='UNKNOWN')
|
|
|
|
write (90,*) 'Cube File'
|
|
|
|
write (90,*) trim(ezfio_filename), ' ', trim(grid_type)
|
|
|
|
write (90,10) nucl_num,(grid_origin(i), i=1,3)
|
|
|
|
write (90,10) grid_x_num, grid_step(1), 0., 0.
|
|
|
|
write (90,10) grid_y_num, 0., grid_step(2), 0.
|
|
|
|
write (90,10) grid_z_num, 0., 0., grid_step(3)
|
2009-12-09 09:48:50 +01:00
|
|
|
do i=1,nucl_num
|
2009-12-10 00:58:43 +01:00
|
|
|
write (90,11) int(nucl_charge(i)), nucl_charge(i), &
|
2009-12-09 09:48:50 +01:00
|
|
|
(nucl_coord(i,l),l=1,3)
|
|
|
|
enddo
|
2009-12-10 00:58:43 +01:00
|
|
|
BEGIN_TEMPLATE
|
|
|
|
if (trim(grid_type) == '$X') then
|
|
|
|
allocate (grid$DimD(grid_x_num,grid_y_num,grid_z_num $D))
|
|
|
|
call get_grid_data_$X(grid$DimD)
|
|
|
|
do ix = 1, grid_x_num
|
|
|
|
do iy = 1, grid_y_num
|
|
|
|
write (90,20) (grid$DimD(ix,iy,iz $D), iz=1, grid_z_num)
|
|
|
|
enddo
|
2009-12-09 09:48:50 +01:00
|
|
|
enddo
|
2009-12-10 00:58:43 +01:00
|
|
|
deallocate(grid$DimD)
|
|
|
|
endif
|
|
|
|
SUBST [ X, Dim, D ]
|
|
|
|
eplf; 3; ;;
|
|
|
|
density;3; ;;
|
|
|
|
density_lapl;3; ;;
|
|
|
|
elf;3; ;;
|
|
|
|
eplf_lapl;3; ;;
|
|
|
|
elf_lapl;3; ;;
|
|
|
|
elf_grad;4;,4;;
|
|
|
|
density_grad;4;,4;;
|
|
|
|
elf_grad;4;,4;;
|
|
|
|
eplf_grad;4;,4;;
|
2010-06-23 18:29:18 +02:00
|
|
|
elf_partition;3; ;;
|
2010-06-24 10:40:51 +02:00
|
|
|
eplf_partition;3; ;;
|
|
|
|
density_partition;3; ;;
|
2009-12-10 00:58:43 +01:00
|
|
|
END_TEMPLATE
|
2009-12-09 09:48:50 +01:00
|
|
|
10 format (2X,I3,3(2X,F10.6))
|
|
|
|
11 format (2X,I3,4(2X,F10.6))
|
|
|
|
20 format (6(E13.5))
|
2009-12-10 00:58:43 +01:00
|
|
|
close(90)
|
2009-12-09 09:48:50 +01:00
|
|
|
|
|
|
|
end
|
|
|
|
|