From 33ec8dfc2504337f66c98ac0853627954fc40ef8 Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Wed, 22 Jun 2022 15:32:40 +0200 Subject: [PATCH] Write out the current in the old fashion 1 v1#branch current when keep#branch is set in .spiceinit. To make the raw file compatible with ICCAP. --- src/frontend/outitf.c | 3 ++- src/frontend/rawfile.c | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/frontend/outitf.c b/src/frontend/outitf.c index 59f631cee..1c778e123 100644 --- a/src/frontend/outitf.c +++ b/src/frontend/outitf.c @@ -972,6 +972,7 @@ static void fileInit_pass2(runDesc *run) { int i, type; + bool keepbranch = cp_getvar("keep#branch", CP_BOOL, NULL, 0); for (i = 0; i < run->numData; i++) { @@ -979,7 +980,7 @@ fileInit_pass2(runDesc *run) type = guess_type(name); - if (type == SV_CURRENT) { + if (type == SV_CURRENT && !keepbranch) { char *branch = strstr(name, "#branch"); if (branch) *branch = '\0'; diff --git a/src/frontend/rawfile.c b/src/frontend/rawfile.c index a07b23a6e..81826ba13 100644 --- a/src/frontend/rawfile.c +++ b/src/frontend/rawfile.c @@ -51,8 +51,10 @@ void raw_write(char *name, struct plot *pl, bool app, bool binary) double dd; char buf[BSIZE_SP]; char *branch; + bool keepbranch = FALSE; raw_padding = !cp_getvar("nopadding", CP_BOOL, NULL, 0); + keepbranch = cp_getvar("keep#branch", CP_BOOL, NULL, 0); /* Why bother printing out an empty plot? */ if (!pl->pl_dvecs) { @@ -157,7 +159,7 @@ void raw_write(char *name, struct plot *pl, bool app, bool binary) fprintf(fp, "Variables:\n"); for (i = 0, v = pl->pl_dvecs; v; v = v->v_next) { /* write i(name) instaed of name#branch */ - if (v->v_type == SV_CURRENT) { + if (v->v_type == SV_CURRENT && !keepbranch) { branch = NULL; /* get name only*/ if ((branch = strstr(v->v_name, "#branch")) != NULL) {