Replace IF with WHEN
In newer versions of the nextnano++ tool, the conditional specifier if is replaced by when. This function faciliates the corresponding syntax update of existing and custom input files, by replacing all instances of the outdated syntax with the newer syntax.