kgen3d=gencost_msk_pointer3d(kgen)
gencost_msk_pointer3d(k) = 0
gencost_msk_pointer3d(k)=gencost_msk_k3d
kk=gencost_msk_pointer3d(k)
elseif (exst.AND.(gencost_msk_pointer3d(k).LE.
& gencost_msk_pointer3d, gencost_itracer
integer gencost_msk_pointer3d(NGENCOST)
if (gencost_msk_pointer3d(k).GT.NGENCOST3D) then