Skip to content

WRF-Chem v4.7 fails to build with compile, KPP enabled #2237

@ppredl

Description

@ppredl

Describe the bug
When using compile, KPP introduces a syntax error by injecting incomplete code into chem/module_phot_tuv.f90

The line select case( config_flags%chem_opt ) is written into chem/KPP/inc/tuv2wrf_jvals.inc instead of inc/tuv2wrf_jvals.inc and therefore is missing in module_phot_tuv.f90. This also applies to tuvdef_jvals.inc.
I traced this to this commit. Changing line 121 in chem/KPP/compile_wkc to $WKC_HOME/util/wkc/tuv_kpp FIRST ../../../../inc/ fixes the problem.

I'm a first time contributor, should I create a pull request for this? I am not sure if this fix would impact the cmake build as I have not managed to use compile_new on my system yet.

To Reproduce
Compile WRF with KPP enabled

Expected behavior
WRF-Chem with KPP should compile without syntax error

Attachments
Error in compile log:

module_phot_tuv.f90:675:10:

  675 |      case( mozart_mosaic_4bin_aq_kpp )
      |          1
Error: Unexpected CASE statement at (1)
module_phot_tuv.f90:701:10:

  701 |      case( mozart_mosaic_4bin_kpp )
      |          1
Error: Unexpected CASE statement at (1)
module_phot_tuv.f90:727:10:

  727 |      case( mozcart_kpp )
      |          1
Error: Unexpected CASE statement at (1)
module_phot_tuv.f90:753:10:

  753 |      case( t1_mozcart_kpp )
      |          1
Error: Unexpected CASE statement at (1)
module_phot_tuv.f90:778:6:

  778 |    end select
      |      1
Error: Expecting END DO statement at (1)
module_phot_tuv.f90:1082:10:

 1082 |      case( mozart_mosaic_4bin_aq_kpp )
      |          1
Error: Unexpected CASE statement at (1)
module_phot_tuv.f90:1120:10:

 1120 |      case( mozart_mosaic_4bin_kpp )
      |          1
Error: Unexpected CASE statement at (1)
module_phot_tuv.f90:1158:10:

 1158 |      case( mozcart_kpp )
      |          1
Error: Unexpected CASE statement at (1)
module_phot_tuv.f90:1196:10:

 1196 |      case( t1_mozcart_kpp )
      |          1
Error: Unexpected CASE statement at (1)
module_phot_tuv.f90:1233:6:

 1233 |    end select
      |      1
Error: Expecting END IF statement at (1)
Command exited with non-zero status 1

Additional context

  • This used to work in version prior to v4.7

Thank you for your great work!

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions