Thank you Professor.
This works great for user elements. I actually used:
call formfe(np(40),np(26),np(26),np(26), .false.,.false.,.false.,.false., isw, 1,numel,1)
with isw = 30.
However, for user materials, I had to modify the solid element (in particular elements/solid2d/sld2d1.f). Indeed, I noticed that this calls the material subroutine (modlsd.f) only for specific isw values (3,5,6,13,14 and 4,8,16,22,25). So I have added a call to modlsd for isw == 30.
Perhaps the same modification is required in sld1d1 and sld3d1, isn't it?