Chem: Several compile-time errors when using -DCHEM_DBG_[I,J,K]
Describe the bug
When compiling with -DCHEM_DBG_[I,J,K], several compiletime errors occur:
1. chem/module_optical_averaging.F:4356
- Rank mismatch, swrefindx_col is rank 3, but write calls rank 2
https://github.com/wrf-model/WRF/blob/f311cd5e136631ebf3ebaa02b4b7be3816ed171f/chem/module_optical_averaging.F#L4240
https://github.com/wrf-model/WRF/blob/f311cd5e136631ebf3ebaa02b4b7be3816ed171f/chem/module_optical_averaging.F#L4356
2. chem/chemics_init.F (print_chem_species_index)
- Unexpected CASE statement
- And further errors in this file (e.g. variables having no IMPLICIT type, CASE labels overlapping etc.)
https://github.com/wrf-model/WRF/blob/f311cd5e136631ebf3ebaa02b4b7be3816ed171f/chem/chemics_init.F#L2461-L2471
To Reproduce
Steps to reproduce the behavior:
- Use GFortran 6.4.0 and compile e.g. commit f311cd5e1 (curr. HEAD of release-v4.2.2) with -DCHEM_DBG_I=1 -DCHEM_DBG_J=1 -DCHEM_DBG_K=1
Expected behavior
No compile-time errors should occur.
@jordanschnell Perhaps you could chime in on this :)
@lpilz - Thanks for the ping. I will take a look.
@jordanschnell Any news on this?
Hi @lpilz, For the chemics init, you can delete lines 2463, 2466 and 2467. For module_optical_averaging, you can try changing it to print swrefindx_col(ibin,k,:), but you will probably need to change the format specifiers. I'm not well-versed in that but when I get some time I can try. Since this isn't a major bug, I'll probably wait to submit a PR until I have some time to batch them, but feel free to.