33 use const_gbl,
only: stdout
34 use mpi_gbl,
only: master
36 use scatci_routines,
only: wrtem
61 integer :: num_elements_per_record
62 integer :: matrix_unit
95 class(
options),
intent(in) :: option_val
97 this % matrix_unit = option_val % hamiltonian_unit
98 this % num_elements_per_record = option_val % num_matrix_elements_per_rec
101 call this % write_cache % construct(this % num_elements_per_record + 1)
112 integer,
intent(in) :: idx
113 integer,
intent(out) :: i, j
114 real(wp),
intent(out) :: coeff
120 stop
"get element not yet implemented"
134 integer :: record_count
136 if (this % write_cache % is_empty())
return
138 record_count = this % write_cache % get_size()
141 call wrtem(this % matrix_unit, record_count, this % num_elements_per_record, &
142 this % write_cache % matrix_arrays(1) % ij(1:2,1:record_count), &
143 this % write_cache % matrix_arrays(1) % coefficient(1:record_count))
144 call this % write_cache % clear
160 integer,
intent(in) :: row, column
161 real(wp),
intent(in) :: coefficient
162 integer :: record_count
164 if (grid % grank /= master)
then
169 if (row == column)
then
170 if (row >
size(this % diagonal))
then
171 write (stdout,
"('Row greater than size of diagonal!!!!',2i12)") row,
size(this % diagonal)
174 this % diagonal(row) = coefficient
178 if (abs(coefficient) < this % threshold)
return
180 call this % write_cache % insert_into_cache(row, column, coefficient)
181 record_count = this % write_cache % get_size()
184 this % n = this % n + 1
187 if (record_count == this % num_elements_per_record)
then
189 call this % write_cache_to_unit
204 integer :: dummy_ij(2, this % num_elements_per_record), record_count = 0
205 real(wp) :: dummy_coeff(this % num_elements_per_record)
207 if (grid % grank /= master)
return
209 write (stdout,
"('finishing unit')")
210 call this % write_cache_to_unit
212 call wrtem(this % matrix_unit, record_count, this % num_elements_per_record, dummy_ij, dummy_coeff)
213 write (stdout,
"('done')")
225 write (stdout,
"('-------TEMP CACHE---------')")
226 call this % temp_cache % print
242 call this % write_cache % clear
255 call this % write_cache % destroy