43 use const_gbl,
only: line_len, stdin, stdout
47 use mpi_gbl,
only: master, mpiint, mpi_xermsg
48 use precisn,
only: longint, wp
49 use scatci_routines,
only: rdnfto, movep, mkpt, ham_pars_io
63 integer,
allocatable :: phase_index(:)
77 integer :: ci_target_flag
79 integer :: ci_target_switch
80 real(wp) :: exotic_mass
81 integer :: diagonalization_flag
82 integer :: integral_unit
83 integer :: hamiltonian_unit
84 integer :: ci_output_unit
85 integer :: num_matrix_elements_per_rec
86 integer :: phase_correction_flag
87 integer :: num_eigenpairs
88 logical :: use_ukrmol_integrals
90 integer :: integral_ordering
91 integer :: print_dataset_heading
92 integer :: output_ci_set_number
93 integer(longint) :: total_memory
94 integer :: diagonalizer_choice
96 integer :: force_serial
97 integer :: print_flags(2)
100 character(len=NAME_LEN_MAX) :: name
101 character(len=NAME_LEN_MAX) :: diag_name
104 integer :: lambda = 0
105 real(wp) :: spin = 0.0_wp
106 real(wp) :: spin_z = 0.0_wp
107 real(wp) :: refl_quanta = 0.0_wp
108 real(wp) :: pin = 0.0_wp
109 integer :: tot_num_orbitals = 0
110 integer :: tot_num_spin_orbitals = 0
111 integer :: num_csfs = 0
112 integer :: num_electrons = 0
113 integer :: length_coeff = 0
114 integer :: matrix_eval = -1
115 integer :: num_syms = 0
116 integer :: sym_group_flag = 0
117 integer :: length_dtrs = 0
118 integer :: positron_flag = 0
119 integer :: output_flag(6)
120 real(wp) :: threshold = 0.0_wp
121 integer :: num_continuum = 0
122 integer :: maximum_num_target_states = 0
123 integer :: total_num_ci_target = 0
124 integer :: total_num_target_states = 0
125 integer :: num_target_sym = 0
126 integer :: last_continuum = 0
127 integer :: num_expanded_continuum_csf = 0
128 integer :: seq_num_last_continuum_csf = 0
129 integer :: continuum_block_size = 0
130 integer :: num_l2_csf = 0
131 integer :: actual_num_csfs = 0
132 integer :: contracted_mat_size = 0
133 integer :: total_num_tgt_states = 0
136 integer,
allocatable :: num_orbitals_sym(:)
137 integer,
allocatable :: num_electronic_orbitals_sym(:)
138 integer,
allocatable :: num_positron_orbitals_sym(:)
139 integer,
allocatable :: num_unused_orbitals_sym(:)
140 integer,
allocatable :: reference_dtrs(:)
141 integer,
allocatable :: num_dtr_csf_out(:)
142 type(
phase),
allocatable :: ci_phase(:)
143 integer,
allocatable :: phase_index(:)
144 integer,
allocatable :: num_orbitals_sym_dinf(:)
145 integer,
allocatable :: num_target_orbitals_sym_congen(:)
146 integer,
allocatable :: num_target_orbitals_sym_dinf_congen(:)
147 integer,
allocatable :: num_target_orbitals_sym(:)
148 integer,
allocatable :: num_ci_target_sym(:)
149 integer,
allocatable :: num_continuum_orbitals_target(:)
150 integer,
allocatable :: num_target_state_sym(:)
151 integer,
allocatable :: lambda_continuum_orbitals_target(:)
152 integer,
allocatable :: gerade_sym_continuum_orbital_target(:)
153 integer,
allocatable :: orbital_sequence_number(:)
154 integer,
allocatable :: ci_set_number(:)
155 integer,
allocatable :: ci_sequence_number(:)
156 real(wp),
allocatable :: energy_shifts(:)
159 integer,
allocatable :: target_multiplicity(:)
160 integer,
allocatable :: target_spatial(:)
161 logical :: multiplicity_defined = .false.
162 logical :: spatial_defined = .false.
163 logical :: all_ecp_defined = .false.
165 character(len=line_len*5) :: ecp_filename
166 integer :: exclude_rowcolumn = -1
169 integer(mpiint) :: preceding_writer = -1
170 integer(mpiint) :: following_writer = -1
173 integer :: temp_orbs(20)
175 real(wp) :: eigenvec_conv = 1d-10
176 real(wp) :: residual_conv = 1d-8
177 real(wp) :: orthog_trigger = 1d-7
178 real(wp) :: max_tolerance = 1d-12
179 integer :: max_iterations = -1
204 integer,
allocatable :: idtarg(:)
205 logical :: write_amp = .false.
206 logical :: write_dip = .false.
207 logical :: write_rmt = .false.
208 logical :: all_props = .true.
209 integer :: luprop = -1
213 character(len=1) :: cform =
'F'
214 character(len=1) :: rform =
'U'
237 integer :: num_arguments, io, err, num_input, num_cinorn, i
238 character(len=800) :: input_filename
240 num_arguments = command_argument_count()
242 if (num_arguments > 1)
then
243 write (stdout,
"('Only one argument allowed')")
244 write (stdout,
"('Command line must be:')")
245 write (stdout,
"('./mpi-scatci <input filename>')")
246 call mpi_xermsg(
'Options_module',
'read_all_namelists',
'Too many command-line arguments', 1, 1)
249 if (num_arguments == 1)
then
250 call get_command_argument(1, input_filename)
251 input_filename = trim(input_filename)
253 open (newunit = io, action =
'read', status =
'old', file = input_filename, iostat = err)
254 write (stdout,
"('Opened input file in unit = ',i4)") io
257 call mpi_xermsg(
'Options_module',
'read_all_namelists',
'Could not open input file ' // trim(input_filename), 2, 1)
263 if (
allocated(this % opts))
deallocate(this % opts)
265 num_input = this % read_all_input(io)
266 num_cinorn = this % read_all_cinorn(io)
268 call this % read_outer_interface(io)
270 if (io /= stdin)
close (io)
273 if (num_input == 0)
then
274 call mpi_xermsg(
'Options_module',
'read_all_namelists',
'Missing &INPUT namelist in the input file', 3, 1)
278 if (num_input /= num_cinorn)
then
279 call mpi_xermsg(
'Options_module',
'read_all_namelists',
'Unequal number of &INPUT and &CINORN namelists', 4, 1)
284 call this % opts(i) % read
304 integer,
intent(in) :: io
306 type(
options),
allocatable :: tmp_opts(:)
307 character(NAME_LEN_MAX) :: name
309 logical :: qmoln, ukrmolp_ints
310 integer :: icidg, icitg, iexpc, idiag, nfti, nfte, lembf, megul, nftg, ntgsym, ncont, ncorb, iord, scfuse, lusme
311 integer :: io_stat, ierr, nset, nrec, nnuc, nocsf, nstat, mgvn, nelt, k, j, iposit
313 character(1000) :: io_msg
314 real(wp) :: scalem, thrhm, spin, spinz, e0
315 integer,
allocatable :: numtgt(:), notgt(:), nctgt(:), ntgtf(:), ntgts(:), mcont(:), gucont(:), nobc(:)
317 namelist /input/ icidg, icitg, iexpc, idiag, nfti, nfte, lembf, megul, nftg, ntgsym, numtgt, notgt, nctgt, ntgtf, ntgts, &
318 mcont, gucont, ncont, ncorb, nobc, iord, name, scalem, scfuse, thrhm, qmoln, ukrmolp_ints, lusme, iposit
323 nobc(
mxint), stat = ierr)
326 call mpi_xermsg(
'Options_module',
'read_all_input',
'Input arrays allocation failure', 1, 1)
329 rewind(io, iostat = io_stat)
357 ukrmolp_ints = .true.
360 read (io, nml = input, iostat = io_stat, iomsg = io_msg,
end = 991)
361 if (io_stat /= 0)
then
362 call mpi_xermsg(
'Options_module',
'read_all_input', &
363 'Error when reading &INPUT namelist: ' // trim(io_msg), i + 1, 1)
370 if (.not.
allocated(this % opts) .or.
size(this % opts) < i)
then
371 if (
allocated(this % opts))
call move_alloc(this % opts, tmp_opts)
372 allocate (this % opts(i), stat = ierr)
374 call mpi_xermsg(
'Options_module',
'read_all_input',
'Input structures allocation failure', 2, 1)
376 if (
allocated(tmp_opts)) this % opts(1:
size(tmp_opts)) = tmp_opts(:)
380 if (ntgsym >
mxint)
then
381 call mpi_xermsg(
'Options_module',
'read_all_input',
'NTGSYM exceeds built-in limit MXINT', 3, 1)
383 this % opts(i) % total_num_tgt_states = sum(numtgt(1:ntgsym))
384 if (this % opts(i) % total_num_tgt_states >
mxint)
then
385 call mpi_xermsg(
'Options_module',
'read_all_input',
'Number of target states exceeds built-in limit MXINT', 4, 1)
389 this % opts(i) % diagonalization_flag = icidg
390 this % opts(i) % ci_target_flag = icitg
391 this % opts(i) % csf_type = iexpc
392 this % opts(i) % matrix_eval = idiag
393 this % opts(i) % integral_unit = nfti
394 this % opts(i) % hamiltonian_unit = nfte
395 this % opts(i) % num_matrix_elements_per_rec = lembf
396 this % opts(i) % megul = megul
397 this % opts(i) % ci_target_switch = nftg
398 this % opts(i) % num_target_sym = ntgsym
401 this % opts(i) % num_target_state_sym = numtgt(1:ntgsym)
402 this % opts(i) % num_continuum_orbitals_target = notgt(1:ntgsym)
403 this % opts(i) % ci_set_number = ntgtf(1:this % opts(i) % total_num_tgt_states)
404 this % opts(i) % ci_sequence_number = ntgts(1:this % opts(i) % total_num_tgt_states)
405 this % opts(i) % lambda_continuum_orbitals_target = mcont(1:ntgsym)
408 this % opts(i) % phase_correction_flag = ncorb
409 this % opts(i) % integral_ordering = iord
410 this % opts(i) % name = name
411 this % opts(i) % exotic_mass = scalem
412 this % opts(i) % use_SCF = scfuse
413 this % opts(i) % positron_flag = iposit
414 this % opts(i) % QuantaMolN = qmoln
415 this % opts(i) % use_UKRMOL_integrals = ukrmolp_ints
417 if ( this % opts(i) % positron_flag /= 0 )
then
418 call mpi_xermsg(
'Options_module',
'read_all_input', &
419 'Positrons are not yet implemented for mpi-scatci.', i, 1)
424 allocate (this % opts(i) % target_spatial(this % opts(i) % total_num_tgt_states), &
425 this % opts(i) % target_multiplicity(this % opts(i) % total_num_tgt_states))
426 do j = 1, this % opts(i) % total_num_tgt_states
427 if (this % opts(i) % ci_set_number(j) <= 0)
then
428 call mpi_xermsg(
'Options_module',
'read_all_input', &
429 'Non-zero NFTG requires setting also non-zero NTGTF/NTGTS.', i, 1)
431 call movep(nftg, this % opts(i) % ci_set_number(j), ierr, 0, 0)
433 call mpi_xermsg(
'Options_module',
'read_all_input', &
434 'CI data not found in unit', nftg, 1)
437 read (nftg) nset, nrec, name, nnuc, nocsf, nstat, mgvn, spin, spinz, nelt, e0
438 this % opts(i) % target_spatial(j) = mgvn
439 this % opts(i) % target_multiplicity(j) = nint(2 * spin + 1)
464 integer,
intent(in) :: io
466 type(
options),
allocatable :: tmp_opts(:)
468 integer :: nfta, nftw, nciset, npflg(2), npcvc, itgt, nopvec, ntgt, notgt, ncipfg, nkey, large, thrprt
469 integer :: keycsf, nstat, igh, maxiter, forse, exrc, vecstore, ecp, targmul(mxint), targspace(mxint)
470 integer :: ierr, io_stat
471 real(wp) :: critc, critr, ortho, crite, memp, eshift(mxint)
473 character(256) :: io_msg
474 character(NAME_LEN_MAX) :: name
476 namelist /cinorn/ nfta, nftw, nciset, npflg, npcvc, name, itgt, nopvec, ntgt, notgt, eshift, ncipfg, nkey, large, thrprt, &
477 keycsf, nstat, igh, critc, critr, ortho, crite, maxiter, memp, forse, exrc, vecstore, ecp, &
482 rewind(io, iostat = io_stat)
498 memp = default_archer_memory
501 vecstore = save_all_coeffs
509 read (io, nml = cinorn, iostat = io_stat, iomsg = io_msg,
end = 991)
510 if (io_stat /= 0)
then
511 call mpi_xermsg(
'Options_module',
'read_all_input', &
512 'Error when reading &CINORN namelist: ' // trim(io_msg), i + 1, 1)
519 if (.not.
allocated(this % opts) .or.
size(this % opts) < i)
then
520 if (
allocated(this % opts))
call move_alloc(this % opts, tmp_opts)
521 allocate (this % opts(i), stat = ierr)
523 call mpi_xermsg(
'Options_module',
'read_all_cinorn',
'Input structures allocation failure', 2, 1)
525 if (
allocated(tmp_opts)) this % opts(1:
size(tmp_opts)) = tmp_opts(:)
529 this % opts(i) % CI_output_unit = nftw
530 this % opts(i) % output_ci_set_number = nciset
531 this % opts(i) % print_dataset_heading = npcvc
532 this % opts(i) % diag_name = name
533 this % opts(i) % num_eigenpairs = nstat
534 this % opts(i) % diagonalizer_choice = igh
535 this % opts(i) % eigenvec_conv = critc
536 this % opts(i) % residual_conv = critr
537 this % opts(i) % orthog_trigger = ortho
538 this % opts(i) % max_tolerance = crite
539 this % opts(i) % max_iterations = maxiter
540 this % opts(i) % energy_shifts = eshift
541 this % opts(i) % print_flags = npflg
544 this % opts(i) % total_memory = int(memp * 1024_longint**3, longint)
545 this % opts(i) % force_serial = forse
546 this % opts(i) % exclude_rowcolumn = exrc
547 this % opts(i) % vector_storage_method = vecstore
548 this % opts(i) % ecp_type = ecp
569 integer,
intent(in) :: io
571 logical :: write_amp, write_dip, write_rmt, all_props
572 integer :: luprop, nfdm, io_stat, ntarg, idtarg(mxint)
573 real(wp) :: delta_r, rmatr
575 character(1) :: cform, rform
576 character(256) :: io_msg
578 namelist /outer_interface/ write_amp, write_dip, write_rmt, all_props, luprop, nfdm, delta_r, rmatr, ntarg, idtarg, &
594 rewind(io, iostat = io_stat)
595 read (io, nml = outer_interface, iostat = io_stat, iomsg = io_msg,
end = 991)
596 if (io_stat /= 0)
then
597 call mpi_xermsg(
'Options_module',
'read_outer_interface', &
598 'Error when reading &RMT_INTERFACE namelist: ' // trim(io_msg), 1, 1)
601 if (rmatr < 0 .and. (write_amp .or. write_rmt))
then
602 call mpi_xermsg(
'Options_module',
'read_outer_interface',
'Missing "rmatr" in &outer_interface namelist.', 1, 1)
605 this % write_amp = write_amp
606 this % write_dip = write_dip
607 this % write_rmt = write_rmt
608 this % all_props = all_props
609 this % luprop = luprop
611 this % delta_r = delta_r
617 this % idtarg = idtarg(1:ntarg)
618 else if (this % write_amp .or. this % write_rmt)
then
619 if (any(this % opts(:) % ci_target_switch == 0))
then
620 call mpi_xermsg(
'Options_module',
'read_outer_interface', &
621 'When NFTG = 0, outer interface requires setting NTARG and IDTARG.', 1, 1)
635 class(
options),
intent(inout) :: this
637 call this % read_congen
639 call this % compute_variables
640 call this % compute_expansions
641 call this % check_sanity_complete
643 call master_memory % construct(this % total_memory)
644 call master_memory % print_memory_report
650 class(
options),
intent(inout) :: this
660 if (this % num_csfs <= 0)
THEN
661 write (stdout,
"('Options::check_sanity_congen_header - No CSFS detected...stopping')")
662 stop
'No of CSFS = 0'
675 class(
options),
intent(inout) :: this
679 write (stdout,
"('---------------SCATCI run options------------------')")
680 write (stdout,
"('Name of run is ', a)") trim(this % name)
681 write (stdout,
"('CONGEN unit ', i4)") this % megul
682 write (stdout,
"('Hamiltonian unit ', i4)") this % hamiltonian_unit
683 write (stdout,
"('Number of hamiltonian records to write ', i4)") this % num_matrix_elements_per_rec
684 write (stdout,
"('Integral unit ', i4)") this % integral_unit
686 write (stdout,
"('Integral Type - ')", advance =
'no')
687 if (this % sym_group_flag <= 1)
then
688 write (stdout,
"('ALCHEMY')")
689 else if (this % sym_group_flag == 2 .and. this % use_UKRMOL_integrals)
then
690 write (stdout,
"('UKRMOL+')")
692 write (stdout,
"('SWEDEN')")
695 write (stdout,
"('CI target Contraction? ')", advance =
'no')
696 if (this % ci_target_flag == no_ci_target)
then
697 write (stdout,
"('No')")
699 write (stdout,
"('Yes')")
700 write (stdout,
"('Generate CI vectors? ')", advance =
'no')
701 if (this % ci_target_switch == generate_target_wf)
then
702 write (stdout,
"('Yes')")
704 write (stdout,
"('No, We are reading from unit ',i4)") this % ci_target_switch
708 write (stdout,
"('Do we diagonalize? ')", advance =
'no')
709 if (this % diagonalization_flag == no_diagonalization)
then
710 write (stdout,
"('No')")
711 else if (this % diagonalization_flag == diagonalize)
then
712 write (stdout,
"('Yes with restart for ARPACK')")
713 else if (this % diagonalization_flag == diagonalize_no_restart)
then
714 write (stdout,
"('Yes with NO restart for ARPACK')")
717 write (stdout,
"('Num eigenpairs ,',i12)") this % num_eigenpairs
719 write (stdout,
"(' -----------Molecule options------------ ')")
720 write (stdout,
"('Number of electrons = ', i10)") this % num_electrons
721 write (stdout,
"('Number of molecular orbitals = ', i10)") this % tot_num_orbitals
722 write (stdout,
"('Number of spin orbitals = ', i10)") this % tot_num_spin_orbitals
724 write (stdout,
"(' -----------CSF options------------ ')")
725 write (stdout,
"('Number of configuration state functions = ', i10)") this % num_csfs
726 write (stdout,
"('Number of continuum functions = ', i10)") this % last_continuum
727 this % num_L2_CSF = this % num_csfs - this % last_continuum
728 write (stdout,
"('Number of L2 functions = ', i10)") this % num_L2_CSF
730 write (stdout,
"(' -----------Orbital/Symmetry options------------ ')")
731 write (stdout,
"('Number of symmetries = ', i4)") this % num_syms
732 write (stdout,
"('Number of orbitals per symmetry = ', 20i4)") this % num_orbitals_sym(:)
733 write (stdout,
"('Number of electronic orbitals per symmetry = ', 20i4)") this % num_electronic_orbitals_sym(:)
734 write (stdout,
"('Number of exotic orbitals per symmetry = ', 20i4)") this % num_positron_orbitals_sym(:)
736 write (stdout,
"('Use ECP? ')", advance =
'no')
737 if (this % ecp_type == ecp_type_null)
then
738 write (stdout,
"('No')")
740 write (stdout,
"('Yes')")
756 class(
options),
intent(inout) :: this
759 integer :: dum_nobe, dum_nobp, dum_nobv, iposit, ido, nobep, ntgcon, idiagt
760 character(len=NAME_LEN_MAX) :: congen_name
764 read (this % megul) congen_name, this % lambda, this % spin, this % spin_z, this % refl_quanta, this % pin, &
765 this % tot_num_orbitals, this % tot_num_spin_orbitals, this % num_csfs, this % num_electrons, &
766 this % length_coeff,idiagt, this % num_syms, this % sym_group_flag, this % length_dtrs, &
767 this % output_flag, this % threshold, this % num_continuum, ntgcon
769 if (trim(this % name) ==
'') this % name = congen_name
770 if (this % matrix_eval < 0) this % matrix_eval = idiagt
771 if (ntgcon > 0) this % num_target_sym = ntgcon
773 call this % check_sanity_congen_header()
794 call rdnfto(this % megul, this % num_orbitals_sym, this % num_target_orbitals_sym_congen, this % num_orbitals_sym_dinf, &
795 this % num_target_orbitals_sym_dinf_congen, this % num_syms, this % reference_dtrs, this % num_electrons, &
796 this % num_dtr_csf_out, this % num_csfs, this % phase_index, this % num_continuum, this % num_ci_target_sym, &
797 this % temp_orbs, this % lambda_continuum_orbitals_target, this % gerade_sym_continuum_orbital_target, &
798 this % num_target_sym, this % num_target_sym, this % num_electronic_orbitals_sym, &
799 this % num_positron_orbitals_sym, this % num_unused_orbitals_sym, this % positron_flag)
801 do ido = 1, this % num_syms
802 if (this % num_positron_orbitals_sym(ido) == 0)
then
803 this % num_electronic_orbitals_sym(ido) = this % num_orbitals_sym(ido)
804 write (stdout, *)
'NOB(i)=', this % num_orbitals_sym(ido)
805 write (stdout, *)
'setting NOBE(i)=', this % num_electronic_orbitals_sym(ido)
807 nobep = this % num_electronic_orbitals_sym(ido) + this % num_positron_orbitals_sym(ido)
808 if (nobep /= this % num_orbitals_sym(ido))
then
809 write (stdout, *)
'ERROR on input:'
810 write (stdout, *)
'not: NOB(i)=NOBE(i)+NOBP(i)'
811 write (stdout, *)
'i=', ido
812 write (stdout, *)
'NOB(i)=', this % num_orbitals_sym(ido)
813 write (stdout, *)
'NOBE(i)=', this % num_electronic_orbitals_sym(ido)
814 write (stdout, *)
'NOBP(i)=', this % num_positron_orbitals_sym(ido)
816 if (this % num_unused_orbitals_sym(ido) == 0)
then
817 this % num_unused_orbitals_sym(ido) = this % num_target_orbitals_sym_congen(ido)
819 if (this % num_target_orbitals_sym_congen(ido) > this % num_orbitals_sym(ido))
then
820 write (stdout, *)
'ERROR on input:'
821 write (stdout, *)
'NOB0(i) > NOB(i)'
822 write (stdout, *)
'i=', ido
823 write (stdout, *)
'NOB(i)=', this % num_orbitals_sym(ido)
824 write (stdout, *)
'NOB0(i)=', this % num_target_orbitals_sym_congen(ido)
829 allocate(this % ci_phase(this % num_target_sym))
838 class(
options),
intent(inout) :: this
839 integer,
intent(in) :: temp_phase(:)
840 integer :: ido, ci_num
844 if (sum(this % num_ci_target_sym) == this % num_continuum)
then
845 do ido = 1, this % num_target_sym
846 this % ci_phase(ido) % size_phaze = this % num_ci_target_sym(ido)
847 allocate(this % ci_phase(ido) % phase_index(this % ci_phase(ido) % size_phaze))
848 this % ci_phase(ido) % phase_index(1:this % ci_phase(ido) % size_phaze) = &
849 temp_phase(ci_num + 1 : ci_num + this % ci_phase(ido) % size_phaze)
850 ci_num = ci_num + this % ci_phase(ido) % size_phaze
852 else if (this % num_continuum == 0)
then
855 stop
"[Options] Problem with phase not matching sum of NCTGT"
873 integer :: i, j, k, n
876 do i = 1,
size(this % opts)
882 if (this % opts(j) % CI_output_unit == this % opts(i) % CI_output_unit)
then
889 if (this % opts(i) % output_ci_set_number == 0)
then
890 this % opts(i) % output_ci_set_number = n + 1
895 if (this % opts(i) % output_ci_set_number <= this % opts(k) % output_ci_set_number)
then
896 call mpi_xermsg(
'Options_module',
'read_all_namelists', &
897 'The entries "nciset" must form ascending sequence.', i, 1)
899 this % opts(k) % following_writer = grid % group_master_world_rank(grid % which_group_is_work(i))
900 this % opts(i) % preceding_writer = grid % group_master_world_rank(grid % which_group_is_work(k))
913 class(
options),
intent(inout) :: this
914 integer :: itgtsym, isym, I, num_orb_temp
916 if (this % csf_type == prototype_csf)
then
917 this % num_target_orbitals_sym = 0
918 write (stdout,
"('Computing start of contiuum expansion...')", advance =
'no')
919 do itgtsym = 1, this % num_target_sym
922 if (this % sym_group_flag /= symtype_dinfh)
then
923 isym = this % lambda_continuum_orbitals_target(itgtsym) + 1
925 isym = (this % lambda_continuum_orbitals_target(itgtsym) * 2) + 1
926 if (mod(this % lambda_continuum_orbitals_target(itgtsym), 2) == 0 .and. &
927 this % gerade_sym_continuum_orbital_target(itgtsym) == -1) isym = isym + 1
928 if (mod(this % lambda_continuum_orbitals_target(itgtsym), 2) == 1 .and. &
929 this % gerade_sym_continuum_orbital_target(itgtsym) == 1) isym = isym + 1
933 if (this % num_target_orbitals_sym(isym) > 0) cycle
935 num_orb_temp = this % num_orbitals_sym(isym) - this % num_continuum_orbitals_target(itgtsym)
936 if (num_orb_temp < this % num_target_orbitals_sym_dinf_congen(isym))
then
937 call mpi_xermsg(
'Options_module',
'compute_variables', &
938 'Incompatible number of target orbitals. Wrong CONGEN file or NOTGT?', itgtsym, 1)
941 this % num_target_orbitals_sym(isym) = num_orb_temp
943 write (stdout,
"('Num eigenpairs = ',i8)") this % num_eigenpairs
944 write (stdout, 1010) this % num_target_sym, (this % num_continuum_orbitals_target(i), i = 1, this % num_target_sym)
945 1010
format(/,
' Number of target symmetries in expansion, NTGSYM =',i5,/, &
946 ' Number of continuum orbitals for each state, NOTGT =',20i5,/,(
' ',20i5))
947 write (stdout, 1020) (this % num_ci_target_sym(i), i = 1, this % num_target_sym)
948 1020
format(
' Number of CI components for each state, NCTGT =',20i10,/,(
' ',20i5))
949 write (stdout, 1025) (this % num_target_state_sym(i), i = 1, this % num_target_sym)
950 1025
format(
' Number of target states of each symmetry, NUMTGT =',20i5,/,(
' ',20i5))
951 write (stdout, 1030) (this % lambda_continuum_orbitals_target(i), i = 1, this % num_target_sym)
952 1030
format(
' Continuum M projection for each state, MCONT =',20i5,/,(
' ',20i5))
953 if (this % gerade_sym_continuum_orbital_target(1) /= 0)
then
954 write (stdout, 1040) (this % gerade_sym_continuum_orbital_target(i), i = 1, this % num_target_sym)
956 1040
format(
' Continuum G/U symmetry for each state, GUCONT =',20i5,/,(
' ',20i5))
960 else if (this % num_continuum > 0)
then
961 this % num_continuum_orbitals_target(1:this%num_target_sym) = this % temp_orbs(1:this%num_target_sym)
964 write (stdout,
"('done')")
966 this % all_ecp_defined = this % multiplicity_defined .and. this % spatial_defined
968 write (stdout,
"(' NOBC =',I10,20I4)") (this % num_target_orbitals_sym(i), i = 1, this % num_syms)
969 write (stdout,
"(' NOB =',I10,20I4)") (this % num_orbitals_sym_dinf(i), i = 1, this % num_syms)
970 write (stdout,
"(' NOB0 =',I10,20I4)") (this % num_target_orbitals_sym_dinf_congen(i), i = 1 , this % num_syms)
976 class(
options),
intent(inout) :: this
977 integer :: lusme = 0, i
979 if (this % csf_type /= normal_csf .or. this % ci_target_flag /= no_ci_target)
then
981 call mkpt(this % orbital_sequence_number, &
982 this % num_orbitals_sym_dinf, &
983 this % num_target_orbitals_sym, &
984 this % sym_group_flag, &
985 this % num_continuum_orbitals_target, &
986 this % num_ci_target_sym, &
987 this % lambda_continuum_orbitals_target, &
988 this % gerade_sym_continuum_orbital_target, &
989 this % contracted_mat_size, &
991 this % actual_num_csfs, &
992 this % last_continuum, &
993 this % num_expanded_continuum_CSF, &
994 this % num_target_sym, &
995 this % total_num_target_states, &
996 this % num_target_state_sym, &
997 this % total_num_ci_target, &
998 this % maximum_num_target_states, &
1000 this % ci_target_flag, &
1003 1050
format(
' SCATCI will expand NOCSF =',i7,
' prototype CSFs',/15x, &
1004 'into MXCSF =',i7,
' actual configurations',/15x, &
1005 'and MOCSF =',i7,
' dimension final Hamiltonian')
1006 write (stdout, 1050) this % num_csfs, this % actual_num_csfs, this % contracted_mat_size
1010 this % contracted_mat_size = this % num_csfs
1011 this % actual_num_csfs = this % num_csfs
1012 this % total_num_target_states = this % num_target_sym
1016 write (stdout,
"(/' Number of last continuum CSF, NCONT =',i7)") this % last_continuum
1018 this % seq_num_last_continuum_csf = this % contracted_mat_size - (this % num_csfs - this % last_continuum)
1019 this % continuum_block_size = this % seq_num_last_continuum_csf
1020 if (this % num_eigenpairs == 0) this % num_eigenpairs = this % contracted_mat_size
1026 class(
options),
intent(inout) :: this
1034 integer,
allocatable :: array(:)
1035 integer :: num_elms, err
1037 if (.not.
allocated(array))
then
1038 allocate(array(num_elms), stat = err)
1039 call master_memory % track_memory(kind(array),
size(array), err,
'OPTION::INT_ARRAY')
1041 write (stdout,
"('[Option] Error in allocating one of the arrays')")
1042 stop
"[Option] Array allocation error"
1064 class(
options),
intent(inout) :: option
1065 logical,
intent(in) :: write_ham_pars
1066 integer,
intent(inout) :: nelms
1067 integer :: size_phase
1069 size_phase =
size(option % phase_index)
1071 if (grid % grank /= master)
return
1073 call ham_pars_io(write_ham_pars, &
1074 option % seq_num_last_continuum_csf, &
1075 option % num_target_sym, &
1076 option % num_target_state_sym, &
1077 option % num_continuum_orbitals_target, &
1078 option % lambda_continuum_orbitals_target, &
1079 option % hamiltonian_unit, &
1081 option % sym_group_flag, &
1084 option % num_electrons, &
1086 option % integral_unit, &
1087 option % phase_index, &
1089 option % use_UKRMOL_integrals)