Commit f073f2f8 authored by Alberto Garcia's avatar Alberto Garcia Committed by Alberto
Browse files

Fix support for lj projectors in .ion.nc files

Due to an oversight, the "j" values were not inserted correctly in
the data structures after reading the .ion.nc netcdf files.

Also, "j" values were unconditionally written to netcdf files, even
when "lj" projectors were not in use.
parent 63da872a
...@@ -295,6 +295,7 @@ ...@@ -295,6 +295,7 @@
nk = nk+1 nk = nk+1
spp%pj_n(nk) = spp%pjnl_n(i) spp%pj_n(nk) = spp%pjnl_n(i)
spp%pj_l(nk) = spp%pjnl_l(i) spp%pj_l(nk) = spp%pjnl_l(i)
spp%pj_j(nk) = spp%pjnl_j(i)
spp%pj_m(nk) = m spp%pj_m(nk) = m
spp%pj_index(nk) = i spp%pj_index(nk) = i
enddo enddo
...@@ -670,8 +671,10 @@ ...@@ -670,8 +671,10 @@
!! Projectors !! Projectors
iret = nf90_def_var(ncid,'pjnl_l',nf90_int,nkbs_id,pjnl_l_id) iret = nf90_def_var(ncid,'pjnl_l',nf90_int,nkbs_id,pjnl_l_id)
call check(iret) call check(iret)
iret = nf90_def_var(ncid,'pjnl_j', if (spp%lj_projs) then
& nf90_double,nkbs_id,pjnl_j_id) iret = nf90_def_var(ncid,'pjnl_j',
& nf90_double,nkbs_id,pjnl_j_id)
endif
iret = nf90_def_var(ncid,'pjnl_n',nf90_int,nkbs_id,pjnl_n_id) iret = nf90_def_var(ncid,'pjnl_n',nf90_int,nkbs_id,pjnl_n_id)
iret = nf90_def_var(ncid,'pjnl_ekb',nf90_double, iret = nf90_def_var(ncid,'pjnl_ekb',nf90_double,
$ nkbs_id,pjnl_ekb_id) $ nkbs_id,pjnl_ekb_id)
...@@ -740,8 +743,10 @@ ...@@ -740,8 +743,10 @@
if ( nkbs > 0 ) then if ( nkbs > 0 ) then
iret = nf90_put_var(ncid,pjnl_l_id,spp%pjnl_l,count=(/nkbs/)) iret = nf90_put_var(ncid,pjnl_l_id,spp%pjnl_l,count=(/nkbs/))
call check(iret) call check(iret)
iret = nf90_put_var(ncid,pjnl_j_id,spp%pjnl_j,count=(/nkbs/)) if (spp%lj_projs) then
call check(iret) iret = nf90_put_var(ncid,pjnl_j_id,spp%pjnl_j,count=(/nkbs/))
call check(iret)
endif
iret = nf90_put_var(ncid,pjnl_n_id,spp%pjnl_n,count=(/nkbs/)) iret = nf90_put_var(ncid,pjnl_n_id,spp%pjnl_n,count=(/nkbs/))
call check(iret) call check(iret)
iret = nf90_put_var(ncid,pjnl_ekb_id,spp%pjnl_ekb, iret = nf90_put_var(ncid,pjnl_ekb_id,spp%pjnl_ekb,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment