77 integer :: ci_target_flag
79 integer :: ci_target_switch
80 real(wp) :: exotic_mass
81 real(wp) :: enh_factor
82 integer :: enh_factor_type
83 integer :: diagonalization_flag
84 integer :: integral_unit
85 integer :: hamiltonian_unit
86 integer :: ci_output_unit
87 integer :: num_matrix_elements_per_rec
88 integer :: phase_correction_flag
89 integer :: num_eigenpairs
90 logical :: use_ukrmol_integrals
92 integer :: integral_ordering
93 integer :: print_dataset_heading
94 integer :: output_ci_set_number
95 integer(longint) :: total_memory
96 integer :: diagonalizer_choice
98 integer :: force_serial
99 integer :: print_flags(2)
102 character(len=NAME_LEN_MAX) :: name
103 character(len=NAME_LEN_MAX) :: diag_name
106 integer :: lambda = 0
107 real(wp) :: spin = 0.0_wp
108 real(wp) :: spin_z = 0.0_wp
109 real(wp) :: refl_quanta = 0.0_wp
110 real(wp) :: pin = 0.0_wp
111 integer :: tot_num_orbitals = 0
112 integer :: tot_num_spin_orbitals = 0
113 integer :: num_csfs = 0
114 integer :: num_electrons = 0
115 integer :: length_coeff = 0
116 integer :: matrix_eval = -1
117 integer :: num_syms = 0
118 integer :: sym_group_flag = 0
119 integer :: length_dtrs = 0
120 integer :: positron_flag = 0
121 integer :: output_flag(6)
122 real(wp) :: threshold = 0.0_wp
123 integer :: num_continuum = 0
124 integer :: maximum_num_target_states = 0
125 integer :: total_num_ci_target = 0
126 integer :: total_num_target_states = 0
127 integer :: num_target_sym = 0
128 integer :: last_continuum = 0
129 integer :: num_expanded_continuum_csf = 0
130 integer :: seq_num_last_continuum_csf = 0
131 integer :: continuum_block_size = 0
132 integer :: num_l2_csf = 0
133 integer :: actual_num_csfs = 0
134 integer :: contracted_mat_size = 0
135 integer :: total_num_tgt_states = 0
136 integer :: verbosity = 1
137 integer :: exchange_flag = 0
140 integer,
allocatable :: num_orbitals_sym(:)
141 integer,
allocatable :: num_electronic_orbitals_sym(:)
142 integer,
allocatable :: num_positron_orbitals_sym(:)
143 integer,
allocatable :: num_unused_orbitals_sym(:)
144 integer,
allocatable :: reference_dtrs(:)
145 integer,
allocatable :: num_dtr_csf_out(:)
146 type(phase),
allocatable :: ci_phase(:)
147 integer,
allocatable :: phase_index(:)
148 integer,
allocatable :: num_orbitals_sym_dinf(:)
149 integer,
allocatable :: num_target_orbitals_sym_congen(:)
150 integer,
allocatable :: num_target_orbitals_sym_dinf_congen(:)
151 integer,
allocatable :: num_target_orbitals_sym(:)
152 integer,
allocatable :: num_ci_target_sym(:)
153 integer,
allocatable :: num_continuum_orbitals_target(:)
154 integer,
allocatable :: num_target_state_sym(:)
155 integer,
allocatable :: lambda_continuum_orbitals_target(:)
156 integer,
allocatable :: gerade_sym_continuum_orbital_target(:)
157 integer,
allocatable :: orbital_sequence_number(:)
158 integer,
allocatable :: ci_set_number(:)
159 integer,
allocatable :: ci_sequence_number(:)
160 real(wp),
allocatable :: energy_shifts(:)
163 integer,
allocatable :: temp_orbs(:)
166 integer,
allocatable :: target_multiplicity(:)
167 integer,
allocatable :: target_spatial(:)
168 logical :: multiplicity_defined = .false.
169 logical :: spatial_defined = .false.
170 logical :: all_ecp_defined = .false.
172 character(len=line_len*5) :: ecp_filename
173 integer :: exclude_rowcolumn = -1
176 integer(mpiint) :: preceding_writer = -1
177 integer(mpiint) :: following_writer = -1
179 real(wp) :: eigenvec_conv = 1d-10
180 real(wp) :: residual_conv = 1d-8
181 real(wp) :: orthog_trigger = 1d-7
182 real(wp) :: max_tolerance = 1d-12
183 integer :: max_iterations = -1
187 procedure,
public :: read => read_input
188 procedure,
private :: read_congen
189 procedure,
private :: compute_variables
190 procedure,
private :: compute_expansions
191 procedure,
private :: check_sanity_congen_header
192 procedure,
private :: check_sanity_complete
193 procedure,
private :: arrange_phase
194 procedure,
public :: do_ci_contraction
328 integer function read_all_input (this, io)
result (i)
330 use iso_fortran_env,
only: iostat_end
332 class(optionsset),
intent(inout) :: this
333 integer,
intent(in) :: io
335 type(options),
allocatable :: tmp_opts(:)
336 character(NAME_LEN_MAX) :: name
338 logical :: qmoln, ukrmolp_ints
339 integer :: icidg, icitg, iexpc, idiag, nfti, nfte, lembf, megul, nftg, ntgsym, ncont, ncorb, iord, scfuse, lusme
340 integer :: io_stat, ierr, nset, nrec, nnuc, nocsf, nstat, mgvn, nelt, k, j, iposit, enh_factor_type, noex
342 character(1000) :: io_msg
343 real(wp) :: scalem, thrhm, spin, spinz, e0, enh_factor
344 integer,
allocatable :: numtgt(:), notgt(:), nctgt(:), ntgtf(:), ntgts(:), mcont(:), gucont(:), nobc(:)
346 namelist /input/ icidg, icitg, iexpc, idiag, nfti, nfte, lembf, megul, nftg, ntgsym, numtgt, notgt, nctgt, ntgtf, ntgts, &
347 mcont, gucont, ncont, ncorb, nobc, iord, name, scalem, scfuse, thrhm, qmoln, ukrmolp_ints, lusme, iposit, &
348 enh_factor, enh_factor_type, noex
353 nobc(
mxint), stat = ierr)
356 call mpi_xermsg(
'Options_module',
'read_all_input',
'Input arrays allocation failure', 1, 1)
359 rewind(io, iostat = io_stat)
389 ukrmolp_ints = .true.
393 read (io, nml = input, iostat = io_stat, iomsg = io_msg)
394 if (io_stat == iostat_end)
then
397 if (io_stat /= 0)
then
398 call mpi_xermsg(
'Options_module',
'read_all_input', &
399 'Error when reading &INPUT namelist: ' // trim(io_msg), i + 1, 1)
406 if (
allocated(this % opts))
then
407 call move_alloc(this % opts, tmp_opts)
409 allocate (this % opts(i), stat = ierr)
411 call mpi_xermsg(
'Options_module',
'read_all_input',
'Input structures allocation failure', 2, 1)
413 if (
allocated(tmp_opts))
then
414 this % opts(1:
size(tmp_opts)) = tmp_opts(:)
415 deallocate (tmp_opts)
419 if (ntgsym >
mxint)
then
420 call mpi_xermsg(
'Options_module',
'read_all_input',
'NTGSYM exceeds built-in limit MXINT', 3, 1)
422 this % opts(i) % total_num_tgt_states = sum(numtgt(1:ntgsym))
423 if (this % opts(i) % total_num_tgt_states >
mxint)
then
424 call mpi_xermsg(
'Options_module',
'read_all_input',
'Number of target states exceeds built-in limit MXINT', 4, 1)
428 this % opts(i) % diagonalization_flag = icidg
429 this % opts(i) % ci_target_flag = icitg
430 this % opts(i) % csf_type = iexpc
431 this % opts(i) % matrix_eval = idiag
432 this % opts(i) % integral_unit = nfti
433 this % opts(i) % hamiltonian_unit = nfte
434 this % opts(i) % num_matrix_elements_per_rec = lembf
435 this % opts(i) % megul = megul
436 this % opts(i) % ci_target_switch = nftg
437 this % opts(i) % num_target_sym = ntgsym
440 call allocate_integer_array(this % opts(i) % num_target_state_sym, ntgsym)
441 call allocate_integer_array(this % opts(i) % num_continuum_orbitals_target, ntgsym)
442 call allocate_integer_array(this % opts(i) % lambda_continuum_orbitals_target, ntgsym)
443 call allocate_integer_array(this % opts(i) % ci_set_number, this % opts(i) % total_num_tgt_states)
444 call allocate_integer_array(this % opts(i) % ci_sequence_number, this % opts(i) % total_num_tgt_states)
445 this % opts(i) % num_target_state_sym = numtgt(1:ntgsym)
446 this % opts(i) % num_continuum_orbitals_target = notgt(1:ntgsym)
447 this % opts(i) % ci_set_number = ntgtf(1:this % opts(i) % total_num_tgt_states)
448 this % opts(i) % ci_sequence_number = ntgts(1:this % opts(i) % total_num_tgt_states)
449 this % opts(i) % lambda_continuum_orbitals_target = mcont(1:ntgsym)
452 this % opts(i) % phase_correction_flag = ncorb
453 this % opts(i) % integral_ordering = iord
454 this % opts(i) % name = name
455 this % opts(i) % exotic_mass = scalem
456 this % opts(i) % use_SCF = scfuse
457 this % opts(i) % positron_flag = iposit
458 this % opts(i) % enh_factor = enh_factor
459 this % opts(i) % enh_factor_type = enh_factor_type
460 this % opts(i) % QuantaMolN = qmoln
461 this % opts(i) % use_UKRMOL_integrals = ukrmolp_ints
462 this % opts(i) % exchange_flag = noex
471 allocate (this % opts(i) % target_spatial(this % opts(i) % total_num_tgt_states), &
472 this % opts(i) % target_multiplicity(this % opts(i) % total_num_tgt_states))
473 do j = 1, this % opts(i) % total_num_tgt_states
474 if (this % opts(i) % ci_set_number(j) <= 0)
then
475 call mpi_xermsg(
'Options_module',
'read_all_input', &
476 'Non-zero NFTG requires setting also non-zero NTGTF/NTGTS.', i, 1)
478 call movep(nftg, this % opts(i) % ci_set_number(j), ierr, 0, 0)
480 call mpi_xermsg(
'Options_module',
'read_all_input', &
481 'CI data not found in unit', nftg, 1)
484 read (nftg) nset, nrec, name, nnuc, nocsf, nstat, mgvn, spin, spinz, nelt, e0
485 this % opts(i) % target_spatial(j) = mgvn
486 this % opts(i) % target_multiplicity(j) = nint(2 * spin + 1)
507 integer function read_all_cinorn (this, io)
result (i)
509 use iso_fortran_env,
only: iostat_end
510 use const_gbl,
only: set_verbosity_level
512 class(optionsset),
intent(inout) :: this
513 integer,
intent(in) :: io
515 type(options),
allocatable :: tmp_opts(:)
517 integer :: nfta, nftw, nciset, npflg(2), npcvc, itgt, nopvec, ntgt, notgt, ncipfg, nkey, large, thrprt
518 integer :: keycsf, nstat, igh, maxiter, forse, exrc, vecstore, ecp, targmul(
mxint), targspace(
mxint)
519 integer :: ierr, io_stat, nshifts, ishift, verbosity
520 real(wp) :: critc, critr, ortho, crite, memp, eshift(
mxint)
522 character(256) :: io_msg
523 character(NAME_LEN_MAX) :: name
525 namelist /cinorn/ nfta, nftw, nciset, npflg, npcvc, name, itgt, nopvec, ntgt, notgt, eshift, ncipfg, nkey, large, thrprt, &
526 keycsf, nstat, igh, critc, critr, ortho, crite, maxiter, memp, forse, exrc, vecstore, ecp, &
527 targmul, targspace, verbosity
531 rewind(io, iostat = io_stat)
559 read (io, nml = cinorn, iostat = io_stat, iomsg = io_msg)
560 if (io_stat == iostat_end)
then
563 if (io_stat /= 0)
then
564 call mpi_xermsg(
'Options_module',
'read_all_input', &
565 'Error when reading &CINORN namelist: ' // trim(io_msg), i + 1, 1)
572 if (.not.
allocated(this % opts) .or.
size(this % opts) < i)
then
573 if (
allocated(this % opts))
call move_alloc(this % opts, tmp_opts)
574 allocate (this % opts(i), stat = ierr)
576 call mpi_xermsg(
'Options_module',
'read_all_cinorn',
'Input structures allocation failure', 2, 1)
578 if (
allocated(tmp_opts)) this % opts(1:
size(tmp_opts)) = tmp_opts(:)
583 do ishift = 1,
size(eshift)
584 if (eshift(ishift) /= 0) nshifts = ishift
586 if (nstat > 0 .and. nshifts > nstat)
then
587 call mpi_xermsg(
'Options_module',
'read_all_cinorn', &
588 'Too many energy shifts given for the given number of eigenpairs', nstat, 1)
590 call allocate_real_array(this % opts(i) % energy_shifts, nshifts)
591 if (nshifts > 0)
then
592 this % opts(i) % energy_shifts = eshift(1:nshifts)
596 this % opts(i) % CI_output_unit = nftw
597 this % opts(i) % output_ci_set_number = nciset
598 this % opts(i) % print_dataset_heading = npcvc
599 this % opts(i) % diag_name = name
600 this % opts(i) % num_eigenpairs = nstat
601 this % opts(i) % diagonalizer_choice = igh
602 this % opts(i) % eigenvec_conv = critc
603 this % opts(i) % residual_conv = critr
604 this % opts(i) % orthog_trigger = ortho
605 this % opts(i) % max_tolerance = crite
606 this % opts(i) % max_iterations = maxiter
607 this % opts(i) % print_flags = npflg
610 this % opts(i) % total_memory = int(memp * 1024_longint**3, longint)
611 this % opts(i) % force_serial = forse
612 this % opts(i) % exclude_rowcolumn = exrc
613 this % opts(i) % vector_storage_method = vecstore
614 this % opts(i) % ecp_type = ecp
615 this % opts(i) % verbosity = verbosity
617 call set_verbosity_level(verbosity)
633 subroutine read_outer_interface (this, io)
635 use iso_fortran_env,
only: iostat_end
637 class(optionsset),
intent(inout) :: this
638 integer,
intent(in) :: io
640 type(interfaceoptions),
allocatable :: options(:)
641 type(interfaceoptions) :: option
643 logical :: write_amp, write_dip, write_rmt, all_props, auto_nvo, is_scattering
644 integer :: luprop, lupropw, lutdip, lutarg, luchan, lurmt, nfdm, io_stat, ntarg, idtarg(mxint), itarget_spin(mxint), isw, n
645 real(wp) :: delta_r, rmatr
647 character(1) :: cform, rform
648 character(256) :: io_msg
649 character(900) :: err_msg
651 namelist /outer_interface/ write_amp, write_dip, write_rmt, all_props, luprop, nfdm, delta_r, rmatr, ntarg, idtarg, &
652 lutdip, lutarg, lupropw, luchan, lurmt, cform, rform, isw, auto_nvo, itarget_spin
654 rewind(io, iostat = io_stat)
679 read (io, nml = outer_interface, iostat = io_stat, iomsg = io_msg)
680 if (io_stat == iostat_end)
then
683 if (io_stat /= 0)
then
684 call mpi_xermsg(
'Options_module',
'read_outer_interface', &
685 'Error when reading &OUTER_INTERFACE namelist: ' // trim(io_msg), 1, 1)
687 if (rmatr < 0 .and. (write_amp .or. write_rmt))
then
688 call mpi_xermsg(
'Options_module',
'read_outer_interface',
'Missing "rmatr" in &outer_interface namelist.', 1, 1)
691 option % write_amp = write_amp
692 option % write_dip = write_dip
693 option % write_rmt = write_rmt
694 option % all_props = all_props
695 option % auto_nvo = auto_nvo
696 option % lutdip = lutdip
697 option % lutarg = lutarg
698 option % luprop = luprop
699 option % itspin = itarget_spin
702 option % delta_r = delta_r
703 option % rmatr = rmatr
704 option % lupropw = lupropw
705 option % luchan = luchan
706 option % lurmt = lurmt
707 option % cform = cform
708 option % rform = rform
711 option % idtarg = idtarg(1:ntarg)
712 if (any(option % idtarg <= 0))
then
713 call mpi_xermsg(
'Options_module',
'read_outer_interface', &
714 'IDTARG must be provided for all NTARG target states.', 1, 1)
716 else if (option % write_amp .or. option % write_rmt)
then
717 if (any(this % opts(:) % ci_target_switch == 0))
then
718 call mpi_xermsg(
'Options_module',
'read_outer_interface', &
719 'When NFTG = 0, outer interface requires setting NTARG and IDTARG.', 1, 1)
724 is_scattering = any([(this % opts(n) % do_ci_contraction(), n = 1,
size(this % opts))])
727 if (write_amp .or. write_rmt .or. (write_dip .and. is_scattering))
then
728 open (lutarg, status =
'old', action =
'read', form =
'formatted', iostat = io_stat, iomsg = io_msg)
729 if (io_stat /= 0)
then
730 write (err_msg,
'(a,i0,a)')
'Missing target properties (lutarg = ', lutarg,
'):'//new_line(
' ')//
' * '//io_msg
731 call mpi_xermsg(
'Options_module',
'read_outer_interface', err_msg, 1, 1)
737 if (write_rmt .or. (write_dip .and. is_scattering))
then
738 open (lutdip, status =
'old', action =
'read', form =
'formatted', iostat = io_stat, iomsg = io_msg)
739 if (io_stat /= 0)
then
740 write (err_msg,
'(a,i0,a)')
'Missing target dipoles (lutdip = ', lutdip,
'):'//new_line(
' ')//
' * '//io_msg
741 call mpi_xermsg(
'Options_module',
'read_outer_interface', err_msg, 2, 1)
746 call move_alloc(this % interface_opts, options)
748 if (
allocated(options))
then
751 allocate (this % interface_opts(n + 1))
754 this % interface_opts(1 : n) = options
756 this % interface_opts(n + 1) = option
807 subroutine check_sanity_complete (this)
808 class(options),
intent(inout) :: this
811 write (stdout,
"('---------------SCATCI run options------------------')")
812 write (stdout,
"('Name of run is ', a)") trim(this % name)
813 write (stdout,
"('CONGEN unit ', i4)") this % megul
814 write (stdout,
"('Hamiltonian unit ', i4)") this % hamiltonian_unit
815 write (stdout,
"('Number of hamiltonian records to write ', i4)") this % num_matrix_elements_per_rec
816 write (stdout,
"('Integral unit ', i4)") this % integral_unit
818 write (stdout,
"('Integral Type - ')", advance =
'no')
819 if (this % sym_group_flag <= 1)
then
820 write (stdout,
"('ALCHEMY')")
821 else if (this % sym_group_flag == 2 .and. this % use_UKRMOL_integrals)
then
822 write (stdout,
"('UKRMOL+')")
824 write (stdout,
"('SWEDEN')")
827 if (this%enh_factor_type .eq. 1)
then
828 write(stdout,
'(/,"Using an enhancement factor of ",f10.7)') this%enh_factor
829 elseif (this%enh_factor_type .eq. 2)
then
830 this%enh_factor = 1.0
831 write(stdout,
'(/,"Computing MP2 enhancement factor")')
832 elseif (this%enh_factor_type .eq. 3)
then
833 write(stdout,
'(/,"Computing enhanced MP2 enhancement factor using ",f10.7)')this%enh_factor
835 this%enh_factor = 1.0
838 write (stdout,
"('CI target Contraction? ')", advance =
'no')
840 write (stdout,
"('No')")
842 write (stdout,
"('Yes')")
843 write (stdout,
"('Generate CI vectors? ')", advance =
'no')
845 write (stdout,
"('Yes')")
847 write (stdout,
"('No, We are reading from unit ',i4)") this % ci_target_switch
851 write (stdout,
"('Do we diagonalize? ')", advance =
'no')
853 write (stdout,
"('No')")
854 else if (this % diagonalization_flag ==
diagonalize)
then
855 write (stdout,
"('Yes with restart for ARPACK')")
857 write (stdout,
"('Yes with NO restart for ARPACK')")
860 write (stdout,
"('Num eigenpairs = ',i10)") this % num_eigenpairs
862 write (stdout,
"(' -----------Molecule options------------ ')")
863 write (stdout,
"('Number of electrons = ', i10)") this % num_electrons
864 write (stdout,
"('Number of molecular orbitals = ', i10)") this % tot_num_orbitals
865 write (stdout,
"('Number of spin orbitals = ', i10)") this % tot_num_spin_orbitals
867 write (stdout,
"(' -----------CSF options------------ ')")
868 write (stdout,
"('Number of configuration state functions = ', i10)") this % num_csfs
869 write (stdout,
"('Number of continuum functions = ', i10)") this % last_continuum
870 this % num_L2_CSF = this % num_csfs - this % last_continuum
871 write (stdout,
"('Number of L2 functions = ', i10)") this % num_L2_CSF
873 write (stdout,
"(' -----------Orbital/Symmetry options------------ ')")
874 write (stdout,
"('Number of symmetries = ', i4)") this % num_syms
875 write (stdout,
"('Number of orbitals per symmetry = ', 20i4)") this % num_orbitals_sym(:)
876 write (stdout,
"('Number of electronic orbitals per symmetry = ', 20i4)") this % num_electronic_orbitals_sym(:)
877 write (stdout,
"('Number of exotic orbitals per symmetry = ', 20i4)") this % num_positron_orbitals_sym(:)
879 write (stdout,
"('Use ECP? ')", advance =
'no')
881 write (stdout,
"('No')")
883 write (stdout,
"('Yes')")
897 subroutine read_congen (this)
899 class(options),
intent(inout) :: this
902 integer :: ido, nobep, ntgcon, idiagt
903 character(len=NAME_LEN_MAX) :: congen_name
907 read (this % megul) congen_name, this % lambda, this % spin, this % spin_z, this % refl_quanta, this % pin, &
908 this % tot_num_orbitals, this % tot_num_spin_orbitals, this % num_csfs, this % num_electrons, &
909 this % length_coeff,idiagt, this % num_syms, this % sym_group_flag, this % length_dtrs, &
910 this % output_flag, this % threshold, this % num_continuum, ntgcon
912 if (trim(this % name) ==
'') this % name = congen_name
913 if (this % matrix_eval < 0) this % matrix_eval = idiagt
914 if (ntgcon > 0) this % num_target_sym = ntgcon
916 call this % check_sanity_congen_header()
919 call allocate_integer_array(this % num_orbitals_sym, this % num_syms)
920 call allocate_integer_array(this % num_electronic_orbitals_sym, this % num_syms)
921 call allocate_integer_array(this % num_positron_orbitals_sym, this % num_syms)
922 call allocate_integer_array(this % num_unused_orbitals_sym, this % num_syms)
923 call allocate_integer_array(this % reference_dtrs, this % num_electrons)
924 call allocate_integer_array(this % num_dtr_csf_out, this % num_csfs)
925 call allocate_integer_array(this % phase_index, this % num_continuum)
926 call allocate_integer_array(this % num_orbitals_sym_dinf, this % num_syms * 2)
927 call allocate_integer_array(this % num_target_orbitals_sym_congen, this % num_syms)
928 call allocate_integer_array(this % num_target_orbitals_sym, this % num_syms)
929 call allocate_integer_array(this % num_target_orbitals_sym_dinf_congen, this % num_syms * 2)
930 call allocate_integer_array(this % num_ci_target_sym, this % num_target_sym)
931 call allocate_integer_array(this % temp_orbs, this % num_target_sym)
932 call allocate_integer_array(this % num_continuum_orbitals_target, this % num_target_sym)
933 call allocate_integer_array(this % lambda_continuum_orbitals_target, this % num_target_sym)
934 call allocate_integer_array(this % gerade_sym_continuum_orbital_target, this % num_target_sym)
935 call allocate_integer_array(this % num_target_state_sym, this % num_target_sym)
936 call allocate_integer_array(this % orbital_sequence_number, this % num_csfs)
938 call rdnfto(this % megul, this % num_orbitals_sym, this % num_target_orbitals_sym_congen, this % num_orbitals_sym_dinf, &
939 this % num_target_orbitals_sym_dinf_congen, this % num_syms, this % reference_dtrs, this % num_electrons, &
940 this % num_dtr_csf_out, this % num_csfs, this % phase_index, this % num_continuum, this % num_ci_target_sym, &
941 this % temp_orbs, this % lambda_continuum_orbitals_target, this % gerade_sym_continuum_orbital_target, &
942 this % num_target_sym, this % num_target_sym, this % num_electronic_orbitals_sym, &
943 this % num_positron_orbitals_sym, this % num_unused_orbitals_sym, this % positron_flag , this % exchange_flag)
945 do ido = 1, this % num_syms
946 if (this % num_positron_orbitals_sym(ido) == 0)
then
947 this % num_electronic_orbitals_sym(ido) = this % num_orbitals_sym(ido)
948 write (stdout, *)
'NOB(i)=', this % num_orbitals_sym(ido)
949 write (stdout, *)
'setting NOBE(i)=', this % num_electronic_orbitals_sym(ido)
951 nobep = this % num_electronic_orbitals_sym(ido) + this % num_positron_orbitals_sym(ido)
952 if (nobep /= this % num_orbitals_sym(ido))
then
953 write (stdout, *)
'ERROR on input:'
954 write (stdout, *)
'not: NOB(i)=NOBE(i)+NOBP(i)'
955 write (stdout, *)
'i=', ido
956 write (stdout, *)
'NOB(i)=', this % num_orbitals_sym(ido)
957 write (stdout, *)
'NOBE(i)=', this % num_electronic_orbitals_sym(ido)
958 write (stdout, *)
'NOBP(i)=', this % num_positron_orbitals_sym(ido)
960 if (this % num_unused_orbitals_sym(ido) == 0)
then
961 this % num_unused_orbitals_sym(ido) = this % num_target_orbitals_sym_congen(ido)
963 if (this % num_target_orbitals_sym_congen(ido) > this % num_orbitals_sym(ido))
then
964 write (stdout, *)
'ERROR on input:'
965 write (stdout, *)
'NOB0(i) > NOB(i)'
966 write (stdout, *)
'i=', ido
967 write (stdout, *)
'NOB(i)=', this % num_orbitals_sym(ido)
968 write (stdout, *)
'NOB0(i)=', this % num_target_orbitals_sym_congen(ido)
973 allocate(this % ci_phase(this % num_target_sym))
1056 subroutine compute_variables (this)
1057 class(options),
intent(inout) :: this
1058 integer :: itgtsym, isym, I, num_orb_temp
1061 this % num_target_orbitals_sym = 0
1062 do itgtsym = 1, this % num_target_sym
1066 isym = this % lambda_continuum_orbitals_target(itgtsym) + 1
1068 isym = (this % lambda_continuum_orbitals_target(itgtsym) * 2) + 1
1069 if (mod(this % lambda_continuum_orbitals_target(itgtsym), 2) == 0 .and. &
1070 this % gerade_sym_continuum_orbital_target(itgtsym) == -1) isym = isym + 1
1071 if (mod(this % lambda_continuum_orbitals_target(itgtsym), 2) == 1 .and. &
1072 this % gerade_sym_continuum_orbital_target(itgtsym) == 1) isym = isym + 1
1076 if (this % num_target_orbitals_sym(isym) > 0) cycle
1078 num_orb_temp = this % num_orbitals_sym(isym) - this % num_continuum_orbitals_target(itgtsym)
1080 if (num_orb_temp < this % num_target_orbitals_sym_dinf_congen(isym))
then
1081 write (stdout,
'(/,A)')
'Error: Incompatible number of target orbitals between CONGEN and SCATCI'
1082 write (stdout,
'(7X,*(A,I0))')
'Target type ', itgtsym,
' with MGVN=', isym - 1
1083 write (stdout,
'(7X,*(A,I0))')
'Total number of orbitals for MGVN=', isym - 1,
': ', &
1084 this % num_orbitals_sym(isym)
1085 write (stdout,
'(7X,*(A,I0))')
'Number of continuum orbitals associated with target type: ', &
1086 this % num_continuum_orbitals_target(itgtsym)
1087 write (stdout,
'(7X,*(A,I0))')
'Number of target orbitals for MGVN=', isym - 1,
' from CONGEN: ', &
1088 this % num_target_orbitals_sym_dinf_congen(isym)
1090 call mpi_xermsg(
'Options_module',
'compute_variables', &
1091 'Incompatible number of target orbitals. Wrong CONGEN file or NOTGT?', itgtsym, 1)
1094 this % num_target_orbitals_sym(isym) = num_orb_temp
1098 write (stdout, 1010) this % num_target_sym, (this % num_continuum_orbitals_target(i), i = 1, this % num_target_sym)
1099 1010
format(/,
' Number of target symmetries in expansion, NTGSYM =',i5,/, &
1100 ' Number of continuum orbitals for each state, NOTGT =',20i5,/,(
' ',20i5))
1101 write (stdout, 1020) (this % num_ci_target_sym(i), i = 1, this % num_target_sym)
1102 1020
format(
' Number of CI components for each state, NCTGT =',20i10,/,(
' ',20i5))
1103 write (stdout, 1025) (this % num_target_state_sym(i), i = 1, this % num_target_sym)
1104 1025
format(
' Number of target states of each symmetry, NUMTGT =',20i5,/,(
' ',20i5))
1105 write (stdout, 1030) (this % lambda_continuum_orbitals_target(i), i = 1, this % num_target_sym)
1106 1030
format(
' Continuum M projection for each state, MCONT =',20i5,/,(
' ',20i5))
1107 if (this % gerade_sym_continuum_orbital_target(1) /= 0)
then
1108 write (stdout, 1040) (this % gerade_sym_continuum_orbital_target(i), i = 1, this % num_target_sym)
1110 1040
format(
' Continuum G/U symmetry for each state, GUCONT =',20i5,/,(
' ',20i5))
1113 else if (this % num_continuum > 0)
then
1114 this % num_continuum_orbitals_target(1:this%num_target_sym) = this % temp_orbs(1:this%num_target_sym)
1117 this % all_ecp_defined = this % multiplicity_defined .and. this % spatial_defined
1119 write (stdout,
"(' NOBC =',I10,20I4)") (this % num_target_orbitals_sym(i), i = 1, this % num_syms)
1120 write (stdout,
"(' NOB =',I10,20I4)") (this % num_orbitals_sym_dinf(i), i = 1, this % num_syms)
1121 write (stdout,
"(' NOB0 =',I10,20I4)") (this % num_target_orbitals_sym_dinf_congen(i), i = 1 , this % num_syms)
1126 subroutine compute_expansions (this)
1127 class(options),
intent(inout) :: this
1128 integer :: lusme = 0
1132 call mkpt(this % orbital_sequence_number, &
1133 this % num_orbitals_sym_dinf, &
1134 this % num_target_orbitals_sym, &
1135 this % sym_group_flag, &
1136 this % num_continuum_orbitals_target, &
1137 this % num_ci_target_sym, &
1138 this % lambda_continuum_orbitals_target, &
1139 this % gerade_sym_continuum_orbital_target, &
1140 this % contracted_mat_size, &
1142 this % actual_num_csfs, &
1143 this % last_continuum, &
1144 this % num_expanded_continuum_CSF, &
1145 this % num_target_sym, &
1146 this % total_num_target_states, &
1147 this % num_target_state_sym, &
1148 this % total_num_ci_target, &
1149 this % maximum_num_target_states, &
1151 this % ci_target_flag, &
1154 1050
format(
' SCATCI will expand NOCSF =',i10,
' prototype CSFs',/15x, &
1155 'into MXCSF =',i10,
' actual configurations',/15x, &
1156 'and MOCSF =',i10,
' dimension final Hamiltonian')
1157 write (stdout, 1050) this % num_csfs, this % actual_num_csfs, this % contracted_mat_size
1161 this % contracted_mat_size = this % num_csfs
1162 this % actual_num_csfs = this % num_csfs
1163 this % total_num_target_states = this % num_target_sym
1167 write (stdout,
"(/' Number of last continuum CSF, NCONT =',i7)") this % last_continuum
1169 this % seq_num_last_continuum_csf = this % contracted_mat_size - (this % num_csfs - this % last_continuum)
1170 this % continuum_block_size = this % seq_num_last_continuum_csf
1171 if (this % num_eigenpairs == 0) this % num_eigenpairs = this % contracted_mat_size
1228 subroutine ham_pars_io_wrapper (option, write_ham_pars, nelms)
1230 class(options),
intent(inout) :: option
1231 logical,
intent(in) :: write_ham_pars
1232 integer,
intent(inout) :: nelms
1233 integer :: size_phase
1235 size_phase =
size(option % phase_index)
1237 if (grid % grank /= master)
return
1239 call ham_pars_io(write_ham_pars, &
1240 option % seq_num_last_continuum_csf, &
1241 option % num_target_sym, &
1242 option % num_target_state_sym, &
1243 option % num_continuum_orbitals_target, &
1244 option % lambda_continuum_orbitals_target, &
1245 option % hamiltonian_unit, &
1247 option % sym_group_flag, &
1250 option % num_electrons, &
1252 option % integral_unit, &
1253 option % phase_index, &
1255 option % use_UKRMOL_integrals)