diff --git a/src/spicelib/devices/adms/admst/ngspiceMODULEdel.c.xml b/src/spicelib/devices/adms/admst/ngspiceMODULEdel.c.xml
new file mode 100644
index 000000000..a8eb7980c
--- /dev/null
+++ b/src/spicelib/devices/adms/admst/ngspiceMODULEdel.c.xml
@@ -0,0 +1,97 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+#include "ngspice.h"
+#include "$(module)defs.h"
+#include "sperror.h"
+#include "suffix.h"
+
+int $(module)delete(GENmodel *inModel, IFuid name, GENinstance **inInst)
+
+{
+ register $(module)model *model = ($(module)model*)inModel;
+ register $(module)instance **fast =($(module)instance**)inInst;
+
+ $(module)instance **prev = NULL;
+ $(module)instance *here;
+
+ for ( ; model ; model = model->$(module)nextModel ) {
+ prev = &(model->$(module)instances);
+ for (here = *prev; here ; here = *prev) {
+ if(here->$(module)name == name || (fast && here==*fast) ) {
+ *prev = here->$(module)nextInstance;
+ FREE(here);
+ return(OK);
+ }
+
+ }
+ }
+ return(E_NODEV);
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/spicelib/devices/adms/admst/ngspiceMODULEdest.c.xml b/src/spicelib/devices/adms/admst/ngspiceMODULEdest.c.xml
new file mode 100644
index 000000000..09f47c453
--- /dev/null
+++ b/src/spicelib/devices/adms/admst/ngspiceMODULEdest.c.xml
@@ -0,0 +1,97 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+#include "ngspice.h"
+#include "$(module)defs.h"
+#include "suffix.h"
+
+void $(module)destroy(GENmodel **inModel)
+
+{
+ register $(module)model **model = ($(module)model**)inModel;
+ register $(module)instance *here;
+ $(module)instance *prev = NULL;
+ $(module)model *mod = *model;
+ $(module)model *oldmod = NULL;
+
+ for ( ; mod ; mod = mod->$(module)nextModel ) {
+ if (oldmod) FREE(oldmod);
+ oldmod = mod;
+ prev = ($(module)instance *)NULL;
+ for (here = mod->$(module)instances; here ; here = here->$(module)nextInstance) {
+ if(prev) FREE(prev);
+ prev = here;
+ }
+ if(prev) FREE(prev);
+ }
+ if(oldmod) FREE(oldmod);
+ *model = NULL;
+ return;
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/spicelib/devices/adms/admst/ngspiceMODULEinit.c.xml b/src/spicelib/devices/adms/admst/ngspiceMODULEinit.c.xml
index 51ebfb811..6a26d6f79 100644
--- a/src/spicelib/devices/adms/admst/ngspiceMODULEinit.c.xml
+++ b/src/spicelib/devices/adms/admst/ngspiceMODULEinit.c.xml
@@ -3,7 +3,11 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+#include "ngspice.h"
+#include "$(module)defs.h"
+#include "sperror.h"
+#include "suffix.h"
+
+int $(module)mDelete(GENmodel **inModel, IFuid modname, GENmodel *kill)
+
+{
+ register $(module)model **model = ($(module)model**)inModel;
+ register $(module)model *modfast =($(module)model*)kill;
+ $(module)instance *here;
+ $(module)instance *prev = NULL;
+ $(module)model **oldmod;
+
+ oldmod = model;
+ for ( ; *model ; model = &((*model)->$(module)nextModel)) {
+ if ((*model)->$(module)modName == modname ||
+ (modfast && *model == modfast))
+ goto delgot;
+ oldmod = model;
+ }
+ return(E_NOMOD);
+
+ delgot:
+ *oldmod = (*model)->$(module)nextModel; /* cut deleted device out of list */
+ for (here = (*model)->$(module)instances; here; here = here->$(module)nextInstance)
+ { if(prev) FREE(prev);
+ prev = here;
+ }
+ if(prev) FREE(prev);
+ FREE(*model);
+ return(OK);
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/spicelib/devices/adms/admst/ngspiceMakefile.am.xml b/src/spicelib/devices/adms/admst/ngspiceMakefile.am.xml
index 6ee29c6f1..ed7b203e0 100644
--- a/src/spicelib/devices/adms/admst/ngspiceMakefile.am.xml
+++ b/src/spicelib/devices/adms/admst/ngspiceMakefile.am.xml
@@ -3,7 +3,11 @@