Skip to content

Debugging and inspecting

nabajour edited this page Jul 15, 2020 · 3 revisions

There are some ways to debug and get more insight at how the radiative transfer computation ran.

Binary compatibility

The Alfrodull class also support binary compatibility checks, if it’s enabled in THOR, it also gets enabled in Alfrodull. See the THOR Wiki page on debugging.

By default, it only prints the top level data at the end of Alfrodull’s run.

By uncommenting #define DETAILED_BENCHMARK in src/alfrodull_engine.cu, you can enable detailed bincomp tracing. Note that Alfrodull processes data by batches of columns, if you change the number of columns processed, the output files won’t contain the same columns and the binary compatibility will not work.

Text dump of TP profiles

in src/two_streams_radiative_transfer.cu, uncomment the line #define DUMP_HELIOS_TP

This dumps TP profiles in the output directory, under alfprof, with information about mu_star in the file header, that can be used as input for HELIOS.

Text dump of EVERYTHING

in src/two_streams_radiative_transfer.cu, uncomment the line #define DEBUG_PRINTOUT_ARRAYS. This will add a directory `alfprof` directory to the output directory. It will dump a lot of internal values to text files in folders per step and columns.

Some example of how one specific column can be studied by tinkering around with the development script tools/devel/debug_data_plot.ipynb.

Checks

Uncomment those lines in src/kernels/math_helpers.cu to run checks:

  • #define MATH_HELPER_THOMAS_DD_CHECK: checks if the block thomas algorithm matrix is diagonaly dominant.
  • #define MATH_HELPER_THOMAS_SOL_CHECK: check solution of block thomas algorithm by running the matrix multiplication on the solution and check the output vector.

debug

#define ZERO_PLANCK_FUNCTION: set the planck function to 0.