wrf-model / WRF

The official repository for the Weather Research and Forecasting (WRF) model
Other
1.21k stars 666 forks source link

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

Open lpilz opened 3 years ago

lpilz commented 3 years ago

Describe the bug

When compiling with -DCHEMDBG[I,J,K], several compiletime errors occur:

1. chem/module_optical_averaging.F:4356

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)

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 commented 3 years ago

@jordanschnell Perhaps you could chime in on this :)

jordanschnell commented 3 years ago

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

lpilz commented 3 years ago

@jordanschnell Any news on this?

jordanschnell commented 3 years ago

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.