strings with = in input files

Noam Bernstein no... at bollweevil.gdbg.org
Thu Jun 19 23:37:18 UTC 2014


Hi - we're working on a new contribution to cp2k, and it's dependent on
getting a string from the input file that can have spaces and '=' in it.
 We've discovered we need to put the string in "" for the parser to read it
correctly (it otherwise turns the = into a space), which is no problem.
 However, as far as we can tell the code that writes the restart file
doesn't put the "" back in, so the restart files are unreadable until they
are manually fixed.

Is it plausible that this problem has never been detected before, or are we
just missing something obvious?

I was just going to patch that code (val_write() in
input/input_val_types.F, starting around line 617 in the version I have),
but I'm not entirely clear on the difference between char_t and lchar_t,
and why the bits of code that write each of them are so different.

If this is something one of the more experienced developers could fix
quickly, that'd be great.  If not, I'd be happy to work on a fix, but I'd
appreciate a bit of a tutorial on why that code is written in the way that
it is.

     thanks,
     Noam
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.cp2k.org/archives/cp2k-user/attachments/20140620/eeef7c35/attachment.htm>


More information about the CP2K-user mailing list