From d9237ab2712385c34cf4fb2d09856dad34992b6e Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Mon, 3 Jan 2022 01:43:01 +0100 Subject: [PATCH] Fix ECP part --- devel/trexio/LIB | 2 +- devel/trexio/export_trexio.irp.f | 8 ++++---- devel/trexio/qp_import_trexio.py | 10 ++++------ 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/devel/trexio/LIB b/devel/trexio/LIB index 91c0923..ec7867d 100644 --- a/devel/trexio/LIB +++ b/devel/trexio/LIB @@ -1,2 +1,2 @@ --ltrexio +-ltrexio -L/home/scemama/.conda/envs/trexio_v2/lib diff --git a/devel/trexio/export_trexio.irp.f b/devel/trexio/export_trexio.irp.f index 7468108..51ec111 100644 --- a/devel/trexio/export_trexio.irp.f +++ b/devel/trexio/export_trexio.irp.f @@ -84,7 +84,7 @@ subroutine run end do end do - do l=1,pseudo_lmax + do l=0,pseudo_lmax do k=1,pseudo_kmax do i=1,nucl_num if (pseudo_dz_kl(i,k,l) /= 0.d0) then @@ -101,8 +101,8 @@ subroutine run lmax(nucl_num) ) do i=1,nucl_num - lmax(i) = 0 - do l=1,pseudo_lmax + lmax(i) = -1 + do l=0,pseudo_lmax do k=1,pseudo_kmax if (pseudo_dz_kl_transp(k,l,i) /= 0.d0) then lmax(i) = max(lmax(i), l) @@ -124,7 +124,7 @@ subroutine run end if end do - do l=1,lmax(i) + do l=0,lmax(i) do k=1,pseudo_kmax if (pseudo_dz_kl_transp(k,l,i) /= 0.d0) then j = j+1 diff --git a/devel/trexio/qp_import_trexio.py b/devel/trexio/qp_import_trexio.py index b46393b..a713330 100755 --- a/devel/trexio/qp_import_trexio.py +++ b/devel/trexio/qp_import_trexio.py @@ -297,8 +297,8 @@ def write_ezfio(trexio_filename, filename): ecp[center] = { "lmax": max_ang_mom_plus_1[center], "zcore": z_core[center], "contr": {} } - for i in range(max_ang_mom_plus_1[center]+1): - ecp[center]["contr"][i] = [] + for j in range(max_ang_mom_plus_1[center]+1): + ecp[center]["contr"][j] = [] ecp[center]["contr"][ang_mom[i]].append( (coefficient[i], power[i], exponent[i]) ) prev_center = center @@ -328,7 +328,7 @@ def write_ezfio(trexio_filename, filename): pseudo_dz_kl = [[[0. for _ in range(nucl_num)] for _ in range(kmax)] for _ in range(lmax+1)] for center in ecp_loc: for k in range( len(ecp_loc[center]) ): - v, n, dz = ecp_loc[center] + v, n, dz = ecp_loc[center][k] pseudo_n_k[k][center] = n pseudo_v_k[k][center] = v pseudo_dz_k[k][center] = dz @@ -340,7 +340,7 @@ def write_ezfio(trexio_filename, filename): for center in ecp_nl: for k in range( len(ecp_nl[center]) ): for l in range( len(ecp_nl[center][k]) ): - v, n, dz = ecp_nl[center][k] + v, n, dz = ecp_nl[center][k][l] pseudo_n_kl[l][k][center] = n pseudo_v_kl[l][k][center] = v pseudo_dz_kl[l][k][center] = dz @@ -349,8 +349,6 @@ def write_ezfio(trexio_filename, filename): ezfio.set_pseudo_pseudo_v_kl(pseudo_v_kl) ezfio.set_pseudo_pseudo_dz_kl(pseudo_dz_kl) - charge = [ x-y for x,y in zip(charge,z_core) ] - ezfio.set_nuclei_nucl_charge(charge) print("OK")