Skip to content

Commit 53aa387

Browse files
authored
discourage part of the use of c-style array in psi initializer (#4866)
1 parent 075e4a2 commit 53aa387

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

source/module_psi/psi_initializer_nao.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ void psi_initializer_nao<T, Device>::read_external_orbs(std::string* orbital_fil
194194
this->n_rgrid_.resize(this->p_ucell_->ntype);
195195
}
196196

197-
int nchi[this->p_ucell_->ntype];
197+
std::vector<int> nchi(this->p_ucell_->ntype);
198198
if (rank == 0)
199199
{
200200
for (int it = 0; it < this->p_ucell_->ntype; it++)
@@ -204,7 +204,7 @@ void psi_initializer_nao<T, Device>::read_external_orbs(std::string* orbital_fil
204204
}
205205

206206
// bcast
207-
Parallel_Common::bcast_int(nchi, this->p_ucell_->ntype);
207+
Parallel_Common::bcast_int(nchi.data(), this->p_ucell_->ntype);
208208
// resize
209209
if (rank != 0)
210210
{

0 commit comments

Comments
 (0)