Cosmoglobe/Commander

Write parameter files to output chain file

Closed this issue · 5 comments

@MetinSa wrote a commit to master that would output a parameters field to the output hdf5 file. Part of the issue is that this requires changing the comm_hdf_mod.f90.in file, which requires some fixes for the character output fields.

As it stands, hdf5 elements with character arrays as the output fields are not output correctly.

In the following commit db71ec8, I have tried to fix a bug where Commander3 would only output empty byte strings to hdf instead of the actual strings. The changes made in the commit worked for me when I tested them with the master version of Commander3.

However, it seems that in some settings, the changes in the commit are overwritten when comm_hdf_mod.f90.in is compiled @dncnwtts ?

That's right, so if anyone ever changes comm_hdf_mod.f90.in, everything is lost...

@dncnwtts and @MetinSa, I see two solutions here:

  1. Change the comm_hdf_mod.f90.in. Probably, this would require some knowledge about tempita language: https://pypi.org/project/Tempita/
  2. Disable generation of comm_hdf_mod.f90 from .in file. If you are using CMake, this is disabled. If you are using Makefile, I think you should comment these two lines:
%.f90 : %.f90.in
	$(TEMPITA) < "$<" > "$@"

Inside Commander/commander3/src/Makefile

@maksymbrl thanks. I have made some changes to comm_hdf_mod.f90.in together with @dncnwtts in 6cb2d3d so that it correctly compiles working code for character outputs through the write_hdf functions. These will be merged to devel branch from the WMAP shortly.

I think it's fixed now. Also changed things up a bit so that in Debug mode you get fewer warnings about array temporaries being created.

038d695