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 @@
nk = nk+1
spp%pj_n(nk) = spp%pjnl_n(i)
spp%pj_l(nk) = spp%pjnl_l(i)
spp%pj_j(nk) = spp%pjnl_j(i)
spp%pj_m(nk) = m
spp%pj_index(nk) = i
enddo
......@@ -670,8 +671,10 @@
!! Projectors
iret = nf90_def_var(ncid,'pjnl_l',nf90_int,nkbs_id,pjnl_l_id)
call check(iret)
if (spp%lj_projs) then
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_ekb',nf90_double,
$ nkbs_id,pjnl_ekb_id)
......@@ -740,8 +743,10 @@
if ( nkbs > 0 ) then
iret = nf90_put_var(ncid,pjnl_l_id,spp%pjnl_l,count=(/nkbs/))
call check(iret)
if (spp%lj_projs) then
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/))
call check(iret)
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