Skip to content

Commit

Permalink
cidata: add totsym value to the CIDATA_sym file
Browse files Browse the repository at this point in the history
  • Loading branch information
kohei-noda-qcrg committed Dec 22, 2024
1 parent 0ad88e8 commit fb9deb0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/casci.f90
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,9 @@ SUBROUTINE casci
key = 'nroot'
write (unit_cidata) key
write (unit_cidata) nroot
key = 'totsym'
write (unit_cidata) key
write (unit_cidata) totsym
key = 'ecas'
write (unit_cidata) key
write (unit_cidata) ecas(1:nroot)
Expand Down
11 changes: 10 additions & 1 deletion src/read_cidata.f90
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ subroutine read_cidata
character(len=len_convert_int_to_chr) :: chr_totsym
character(:), allocatable :: filename
integer :: unit, i, dict_cas_idx_size
integer :: ninact_read, nact_read, nsec_read, nelec_read, nroot_read
integer :: ninact_read, nact_read, nsec_read, nelec_read, nroot_read, totsym_read
integer(kind=int64), allocatable :: dict_cas_idx_values(:)
real(8), allocatable :: ecas(:)

Expand All @@ -23,6 +23,7 @@ subroutine read_cidata
call add_essential_input("nelec")
call add_essential_input("ndet")
call add_essential_input("nroot")
call add_essential_input("totsym")
call add_essential_input("ecas")
call add_essential_input("dict_cas_idx_values")
call add_essential_input("ci_coefficients")
Expand Down Expand Up @@ -84,6 +85,14 @@ subroutine read_cidata
call stop_with_errorcode(1)
end if
call update_esesential_input(trim(adjustl(key)), .true.)
case ("totsym")
read (unit) totsym_read
if (totsym_read /= totsym) then
if (rank == 0) print *, "Error: Invalid totsym in cidata file. totsym in cidata = ", totsym_read, &
" totsym = ", totsym
call stop_with_errorcode(1)
end if
call update_esesential_input(trim(adjustl(key)), .true.)
case ("ecas")
if (.not. essential_input_is_specified("nroot")) then
if (rank == 0) print *, "Error: ecas detected before nroot."
Expand Down

0 comments on commit fb9deb0

Please sign in to comment.