WRF icon indicating copy to clipboard operation
WRF copied to clipboard

Chem: Several compile-time errors when using -DCHEM_DBG_[I,J,K]

Open lpilz opened this issue 5 years ago • 4 comments

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:

  1. 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.

lpilz avatar Oct 02 '20 17:10 lpilz

@jordanschnell Perhaps you could chime in on this :)

lpilz avatar Oct 07 '20 08:10 lpilz

@lpilz - Thanks for the ping. I will take a look.

jordanschnell avatar Oct 07 '20 13:10 jordanschnell

@jordanschnell Any news on this?

lpilz avatar Oct 25 '20 14:10 lpilz

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.

jordanschnell avatar Oct 26 '20 15:10 jordanschnell