1
0
mirror of https://github.com/TREX-CoE/trexio.git synced 2024-11-03 20:54:07 +01:00

If nelec != nup+ndn, rewrite nelec

This commit is contained in:
Anthony Scemama 2022-03-31 13:55:50 +02:00
parent 15c8e10184
commit e43dde90d9

View File

@ -1426,7 +1426,9 @@ trexio_pre_close (trexio_t* file)
if (rc != TREXIO_SUCCESS) return rc;
if (nelec != nup + ndn) {
return TREXIO_INVALID_NUM;
nelec = nup + ndn;
rc = trexio_write_electron_num(file, nelec);
if (rc != TREXIO_SUCCESS) return rc;
}
} else if (has_up && has_dn) {
rc = trexio_read_electron_up_num(file, &nup);