2021-01-07 14:20:11 +01:00
|
|
|
subroutine write_array_two_rdm(n_orb,nstates,array_tmp,name_file)
|
|
|
|
implicit none
|
|
|
|
integer, intent(in) :: n_orb,nstates
|
2023-04-17 17:03:16 +02:00
|
|
|
character*(128), intent(in) :: name_file
|
2021-01-07 14:20:11 +01:00
|
|
|
double precision, intent(in) :: array_tmp(n_orb,n_orb,n_orb,n_orb,nstates)
|
|
|
|
|
|
|
|
character*(128) :: output
|
|
|
|
integer :: i_unit_output,getUnitAndOpen
|
2023-04-17 17:03:16 +02:00
|
|
|
PROVIDE ezfio_filename
|
2021-01-07 14:20:11 +01:00
|
|
|
output=trim(ezfio_filename)//'/work/'//trim(name_file)
|
|
|
|
i_unit_output = getUnitAndOpen(output,'W')
|
2023-04-17 17:03:16 +02:00
|
|
|
call lock_io()
|
2021-01-07 14:20:11 +01:00
|
|
|
write(i_unit_output)array_tmp
|
2023-04-17 17:03:16 +02:00
|
|
|
call unlock_io()
|
2021-01-07 14:20:11 +01:00
|
|
|
close(unit=i_unit_output)
|
|
|
|
end
|
|
|
|
|
|
|
|
subroutine read_array_two_rdm(n_orb,nstates,array_tmp,name_file)
|
|
|
|
implicit none
|
|
|
|
character*(128) :: output
|
|
|
|
integer :: i_unit_output,getUnitAndOpen
|
|
|
|
integer, intent(in) :: n_orb,nstates
|
2023-04-17 17:03:16 +02:00
|
|
|
character*(128), intent(in) :: name_file
|
2021-01-07 14:20:11 +01:00
|
|
|
double precision, intent(out) :: array_tmp(n_orb,n_orb,n_orb,n_orb,N_states)
|
2023-04-17 17:03:16 +02:00
|
|
|
PROVIDE ezfio_filename
|
2021-01-07 14:20:11 +01:00
|
|
|
output=trim(ezfio_filename)//'/work/'//trim(name_file)
|
|
|
|
i_unit_output = getUnitAndOpen(output,'R')
|
2023-04-17 17:03:16 +02:00
|
|
|
call lock_io()
|
2021-01-07 14:20:11 +01:00
|
|
|
read(i_unit_output)array_tmp
|
2023-04-17 17:03:16 +02:00
|
|
|
call unlock_io()
|
2021-01-07 14:20:11 +01:00
|
|
|
close(unit=i_unit_output)
|
|
|
|
end
|
|
|
|
|
2024-02-10 12:48:29 +01:00
|
|
|
|
|
|
|
subroutine write_array_two_trans_rdm(n_orb,nstates,array_tmp,name_file)
|
|
|
|
implicit none
|
|
|
|
integer, intent(in) :: n_orb,nstates
|
|
|
|
character*(128), intent(in) :: name_file
|
|
|
|
double precision, intent(in) :: array_tmp(n_orb,n_orb,n_orb,n_orb,nstates,nstates)
|
|
|
|
|
|
|
|
character*(128) :: output
|
|
|
|
integer :: i_unit_output,getUnitAndOpen
|
|
|
|
PROVIDE ezfio_filename
|
|
|
|
output=trim(ezfio_filename)//'/work/'//trim(name_file)
|
|
|
|
i_unit_output = getUnitAndOpen(output,'W')
|
|
|
|
call lock_io()
|
|
|
|
write(i_unit_output)array_tmp
|
|
|
|
call unlock_io()
|
|
|
|
close(unit=i_unit_output)
|
|
|
|
end
|
|
|
|
|
|
|
|
subroutine read_array_two_trans_rdm(n_orb,nstates,array_tmp,name_file)
|
|
|
|
implicit none
|
|
|
|
character*(128) :: output
|
|
|
|
integer :: i_unit_output,getUnitAndOpen
|
|
|
|
integer, intent(in) :: n_orb,nstates
|
|
|
|
character*(128), intent(in) :: name_file
|
|
|
|
double precision, intent(out) :: array_tmp(n_orb,n_orb,n_orb,n_orb,N_states,nstates)
|
|
|
|
PROVIDE ezfio_filename
|
|
|
|
output=trim(ezfio_filename)//'/work/'//trim(name_file)
|
|
|
|
i_unit_output = getUnitAndOpen(output,'R')
|
|
|
|
call lock_io()
|
|
|
|
read(i_unit_output)array_tmp
|
|
|
|
call unlock_io()
|
|
|
|
close(unit=i_unit_output)
|
|
|
|
end
|
|
|
|
|