# unable to write source files

**URL:** <https://openmc.discourse.group/t/unable-to-write-source-files/273>\
**Category:** User Support\
**Created:** [May 31, 2017, 10:35pm UTC](https://openmc.discourse.group/t/unable-to-write-source-files/273 "2017-05-31T22:35:27Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jilang\_Miao](https://avatars.discourse-cdn.com/v4/letter/j/6f9a4e/32.png) [@Jilang\_Miao](https://openmc.discourse.group/u/Jilang_Miao)\
**Post date:** [May 31, 2017, 10:35pm UTC](https://openmc.discourse.group/t/unable-to-write-source-files/273/1 "2017-05-31T22:35:27Z")

</div>

Hi All,

I have trouble writing source files using the \<source\_point\> tag.  
pasted below is my settings.xml.

\<run\_mode\>eigenvalue\</run\_mode\>  
5  
1  
1080

\<state\_point\>  
  
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
  
\</state\_point\>

\<source\_point\>  
 3   
 true   
 xxx   
\</source\_point\>

It turns out sourcefile will not be written.  
And if i print source\_write, it is “false” no matter what I put in xxx (xxx = true, 1, .true. …).  
The value is “false” since get\_node\_value(node\_sp, “write”).

Thanks!  
Jilang

---

<div class="post-metadata">

**Author:** ![paulromano](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/paulromano/32/486_2.png) [@paulromano](https://openmc.discourse.group/u/paulromano)\
**Post date:** [June 1, 2017, 2:10am UTC](https://openmc.discourse.group/t/unable-to-write-source-files/273/2 "2017-06-01T02:10:13Z")

</div>

Hi Jilang,

What version of OpenMC and compiler are you using? I’m not able to reproduce this problem so far.

thanks,  
Paul

---

<div class="post-metadata">

**Author:** ![Jilang\_Miao](https://avatars.discourse-cdn.com/v4/letter/j/6f9a4e/32.png) [@Jilang\_Miao](https://openmc.discourse.group/u/Jilang_Miao)\
**Post date:** [June 1, 2017, 2:19am UTC](https://openmc.discourse.group/t/unable-to-write-source-files/273/3 "2017-06-01T02:19:13Z")

</div>

Hi Paul,

The last commit from upstream is 71abc38d852c7ea07c8c6280d8db4c3c6326d530

Thanks!  
Jilang

---

<div class="post-metadata">

**Author:** ![paulromano](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/paulromano/32/486_2.png) [@paulromano](https://openmc.discourse.group/u/paulromano)\
**Post date:** [June 1, 2017, 11:34am UTC](https://openmc.discourse.group/t/unable-to-write-source-files/273/4 "2017-06-01T11:34:19Z")

</div>

Even using the same commit, I am not able to reproduce the behavior you are seeing. What compilers are you using?

---

<div class="post-metadata">

**Author:** ![Jilang\_Miao](https://avatars.discourse-cdn.com/v4/letter/j/6f9a4e/32.png) [@Jilang\_Miao](https://openmc.discourse.group/u/Jilang_Miao)\
**Post date:** [June 1, 2017, 12:58pm UTC](https://openmc.discourse.group/t/unable-to-write-source-files/273/5 "2017-06-01T12:58:08Z")

</div>

Below are the output of cmake …

– The Fortran compiler identification is GNU  
– The C compiler identification is GNU 6.2.0  
– The CXX compiler identification is GNU 6.2.0  
– Check for working Fortran compiler: /home/software/nse/mpich/gnu-6.2.0/3.2/bin/mpif90  
– Check for working Fortran compiler: /home/software/nse/mpich/gnu-6.2.0/3.2/bin/mpif90 – works  
– Detecting Fortran compiler ABI info  
– Detecting Fortran compiler ABI info - done  
– Checking whether /home/software/nse/mpich/gnu-6.2.0/3.2/bin/mpif90 supports Fortran 90  
– Checking whether /home/software/nse/mpich/gnu-6.2.0/3.2/bin/mpif90 supports Fortran 90 – yes  
– Check for working C compiler: /home/software/nse/mpich/gnu-6.2.0/3.2/bin/mpicc  
– Check for working C compiler: /home/software/nse/mpich/gnu-6.2.0/3.2/bin/mpicc – works  
– Detecting C compiler ABI info  
– Detecting C compiler ABI info - done  
– Check for working CXX compiler: /home/software/gcc/6.2.0/bin/c++  
– Check for working CXX compiler: /home/software/gcc/6.2.0/bin/c++ – works  
– Detecting CXX compiler ABI info  
– Detecting CXX compiler ABI info - done  
– Detected MPI wrapper: /home/software/nse/mpich/gnu-6.2.0/3.2/bin/mpif90  
– Found HDF5: /home/software/nse/hdf5/gnu-6.2.0/1.8.17/lib/libhdf5hl\_fortran.so;/home/software/nse/hdf5/gnu-6.2.0/1.8.17/lib/libhdf5\_hl.so;/home/software/nse/hdf5/gnu-6.2.0/1.8.17/lib/libhdf5\_fortran.so;/home/software/nse/hdf5/gnu-6.2.0/1.8.17/lib/libhdf5.so;-lz;-ldl;-lm (found version “1.8.17”)  
– Fortran flags: -cpp;-std=f2008;-fbacktrace;-O2;-fopenmp  
– C flags: -cpp;-std=c99;-O2;-fopenmp  
– Linker flags: -fopenmp  
– Found PythonInterp: /home/jlmiao/miniconda3/bin/python (found version “3.6”)  
– Configuring done  
– Generating done  
– Build files have been written to: /home/jlmiao/source/openmc/build-test

Thanks!  
Jilang

---

<div class="post-metadata">

**Author:** ![paulromano](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/paulromano/32/486_2.png) [@paulromano](https://openmc.discourse.group/u/paulromano)\
**Post date:** [June 1, 2017, 2:56pm UTC](https://openmc.discourse.group/t/unable-to-write-source-files/273/6 "2017-06-01T14:56:54Z")

</div>

I don’t see anything obviously wrong. Would you be comfortable sharing your full set of input files so that I can try to run them directly?

---

<div class="post-metadata">

**Author:** ![Jilang\_Miao](https://avatars.discourse-cdn.com/v4/letter/j/6f9a4e/32.png) [@Jilang\_Miao](https://openmc.discourse.group/u/Jilang_Miao)\
**Post date:** [June 1, 2017, 4:42pm UTC](https://openmc.discourse.group/t/unable-to-write-source-files/273/7 "2017-06-01T16:42:56Z")

</div>

I’ve pasted the simplified input files below. I also made changes to openmc ([https://github.com/mjlong/openmc](https://github.com/mjlong/openmc)) on branch “mjl-delay”. I added the 3 lines below in input\_xml.F90. It will print source\_write as “F”. And if I force it to be true, I’ll have runtime error.

call get\_node\_value(node\_sp, “write”, source\_write)  
!source\_write = .true.  
write(_,_) source\_write

---

<div class="post-metadata">

**Author:** ![paulromano](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/paulromano/32/486_2.png) [@paulromano](https://openmc.discourse.group/u/paulromano)\
**Post date:** [June 1, 2017, 8:42pm UTC](https://openmc.discourse.group/t/unable-to-write-source-files/273/8 "2017-06-01T20:42:08Z")

</div>

Figured it out – this is actually caused by our switch to the pugixml XML parser. When variables are expected to be booleans like true or false, we use pugixml’s xml\_attribute::as\_bool() and xml\_text::as\_bool() methods which require that the value passed does not have extraneous whitespace. If you remove the outer whitespace in the and tags, your example should work correctly.

Best,  
Paul

---

<div class="post-metadata">

**Author:** ![Jilang\_Miao](https://avatars.discourse-cdn.com/v4/letter/j/6f9a4e/32.png) [@Jilang\_Miao](https://openmc.discourse.group/u/Jilang_Miao)\
**Post date:** [June 1, 2017, 9:12pm UTC](https://openmc.discourse.group/t/unable-to-write-source-files/273/9 "2017-06-01T21:12:43Z")

</div>

Thanks! source\_write can be correctly set now.
