Skip to content

Commit

Permalink
...EJB
Browse files Browse the repository at this point in the history
  • Loading branch information
ebylaska committed Nov 29, 2023
1 parent 1641264 commit 46eeee1
Showing 1 changed file with 18 additions and 13 deletions.
31 changes: 18 additions & 13 deletions Nwpw/nwpwlib/C3dB/Cneb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ void Cneb::g_generate1_random(double *psi)
{
int qk = ktoindex(nb);
int pk = ktop(nb);
int nbq1 = qk+1;
for (auto ms=0; ms<ispin; ++ms)
for (auto n=0; n<ne[ms]; ++n)
{
Expand All @@ -262,10 +263,10 @@ void Cneb::g_generate1_random(double *psi)
c3db::c_setpw(filling, zvalue, tmp2);
c3db::c_addrandom(tmp2);

CGrid::c_pack(1, tmp2);
CGrid::c_pack(nbq1, tmp2);
int indx = ibshiftj*qj + ibshiftk*qk;
CGrid::cc_pack_copy(1, tmp2, psi + indx);
CGrid::c_pack_noimagzero(1, psi + indx);
CGrid::cc_pack_copy(nbq1, tmp2, psi + indx);
CGrid::c_pack_noimagzero(nbq1, psi + indx);
}
}
}
Expand All @@ -284,6 +285,7 @@ void Cneb::g_generate2_random(double *psi)
{
int qk = ktoindex(nb);
int pk = ktop(nb);
int nbq1 = qk+1;
for (auto ms=0; ms<ispin; ++ms)
for (auto n=0; n<ne[ms]; ++n)
{
Expand All @@ -294,9 +296,9 @@ void Cneb::g_generate2_random(double *psi)
c3db::r_setrandom(tmp2);
c3db::rc_fft3d(tmp2);

CGrid::c_pack(1, tmp2);
CGrid::c_pack(nbq1, tmp2);
int indx = ibshiftj*qj + ibshiftk*qk;
CGrid::cc_pack_copy(1, tmp2, psi + indx);
CGrid::cc_pack_copy(nbq1, tmp2, psi + indx);
}
}
}
Expand Down Expand Up @@ -348,6 +350,7 @@ void Cneb::g_read(const int iunit, double *psi)
{
int qk = ktoindex(nb);
int pk = ktop(nb);
int nbq1 = qk+1;
for (auto ms=0; ms<ispin; ++ms)
for (auto n=0; n<ne[ms]; ++n)
{
Expand All @@ -357,8 +360,8 @@ void Cneb::g_read(const int iunit, double *psi)
if ((pj==taskid_j) && (pk==taskid_k))
{
int indx = ibshiftj*qj + ibshiftk*qk;
CGrid::c_pack(qk, tmp2);
CGrid::cc_pack_copy(qk, tmp2, psi + indx);
CGrid::c_pack(nbq1, tmp2);
CGrid::cc_pack_copy(nbq1, tmp2, psi + indx);
}
}
}
Expand All @@ -384,6 +387,7 @@ void Cneb::g_read_ne(const int iunit, const int *ne0, double *psi)
{
int qk = ktoindex(nb);
int pk = ktop(nb);
int nbq1 = qk+1;
for (auto ms=0; ms<ispin; ++ms)
for (auto n=0; n<ne[ms]; ++n)
{
Expand All @@ -402,8 +406,8 @@ void Cneb::g_read_ne(const int iunit, const int *ne0, double *psi)
if ((pj==taskid_j) && (pk==taskid_k))
{
int indx = ibshiftj*qj + ibshiftk*qk;
CGrid::c_pack(qk, tmp2);
CGrid::cc_pack_copy(qk, tmp2, psi + indx);
CGrid::c_pack(nbq1, tmp2);
CGrid::cc_pack_copy(nbq1, tmp2, psi + indx);
}
}
}
Expand Down Expand Up @@ -444,16 +448,17 @@ void Cneb::g_write(const int iunit, double *psi)
{
int qk = ktoindex(nb);
int pk = ktop(nb);
int nbq1 = qk+1;
for (auto ms=0; ms<ispin; ++ms)
for (auto n=0; n<ne[ms]; ++n)
{
int qj = msntoindex(ms, n);
int pj = msntop(ms, n);
if ((pj==taskid_j) && (pk==taskid_k))
{
int indx = ibshiftj*qj + ibshiftk+qk;
CGrid::cc_pack_copy(qk+1, psi+indx, tmp2);
CGrid::c_unpack(qk+1, tmp2);
int indx = ibshiftj*qj + ibshiftk*qk;
CGrid::cc_pack_copy(nbq1, psi+indx, tmp2);
CGrid::c_unpack(nbq1, tmp2);
}
if (io_buffer)
c_write_buffer(iunit,tmp2,pj,pk);
Expand Down Expand Up @@ -2509,7 +2514,7 @@ void Cneb::g_ortho(double *psi)

for (auto nbq=0; nbq<nbrillq; ++nbq)
{
int shiftk = nbq*ispin*(neq[0]+neq[1])*npack2;
int shiftk = nbq*(neq[0]+neq[1])*npack2;
for (auto ms=0; ms<ispin; ++ms)
{
auto shift0 = ms*neq[0]*npack2;
Expand Down

0 comments on commit 46eeee1

Please sign in to comment.