From 0ad88e896937c2011b511d49f58526fd7bc73bc0 Mon Sep 17 00:00:00 2001 From: Kohei Noda Date: Thu, 19 Dec 2024 13:50:02 +0000 Subject: [PATCH] read_cidata: add _sym[0-9]+ to CIDATA filename --- src/casci.f90 | 5 +++-- src/read_cidata.f90 | 6 +++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/casci.f90 b/src/casci.f90 index 7dc26176..c1df2664 100644 --- a/src/casci.f90 +++ b/src/casci.f90 @@ -22,7 +22,7 @@ SUBROUTINE casci real(8), allocatable :: mat_real(:, :) ! For realonly real(8), allocatable :: ecas(:) character(:), allocatable :: filename - character(len=len_convert_int_to_chr) :: chr_root + character(len=len_convert_int_to_chr) :: chr_root, chr_totsym character(len=cidata_key_size) :: key integer :: dict_cas_idx_size, idx integer(kind=int64), allocatable :: keys(:), vals(:) @@ -116,7 +116,8 @@ SUBROUTINE casci end if ! write CI matrix to the CIDATA file if (rank == 0) then ! Only master ranks are allowed to create files used by CASPT2 except for MDCINTNEW. - filename = 'CIDATA' + write (chr_totsym, *) totsym + filename = 'CIDATA_sym'//trim(adjustl(chr_totsym)) ! (e.g.) CIDATA_sym33 call open_unformatted_file(unit=unit_cidata, file=filename, status='replace') key = "ninact" write (unit_cidata) key diff --git a/src/read_cidata.f90 b/src/read_cidata.f90 index 83572adf..bd9515b7 100644 --- a/src/read_cidata.f90 +++ b/src/read_cidata.f90 @@ -9,6 +9,8 @@ subroutine read_cidata use module_global_variables implicit none character(len=cidata_key_size) :: key + 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(kind=int64), allocatable :: dict_cas_idx_values(:) @@ -26,7 +28,9 @@ subroutine read_cidata call add_essential_input("ci_coefficients") call add_essential_input("end") - call open_unformatted_file(unit, file="CIDATA", status="old", optional_position="append") + write (chr_totsym, *) totsym + filename = "CIDATA_sym"//trim(adjustl(chr_totsym)) + call open_unformatted_file(unit, file=filename, status="old", optional_position="append") backspace (unit) read (unit) key if (trim(adjustl(key)) /= "end") then ! cidata must be ended with "end"