Skip to content

KLUGE: RRTMG FAST + GNU > 6.3.0 is an internal compiler error#503

Closed
davegill wants to merge 4 commits intowrf-model:masterfrom
davegill:zap_rrtmg_fast
Closed

KLUGE: RRTMG FAST + GNU > 6.3.0 is an internal compiler error#503
davegill wants to merge 4 commits intowrf-model:masterfrom
davegill:zap_rrtmg_fast

Conversation

@davegill
Copy link
Contributor

@davegill davegill commented May 8, 2018

TYPE: bug fix

KEYWORDS: RRTMG FAST, GNU

SOURCE: internal

DESCRIPTION OF CHANGES:
With GNU version 6.40, 6.5.0, 7.1.0, 7.2.0, and 7.3.0, the WRF RRTMG FAST LW scheme causes an internal compiler error for some optimization levels. The RRTMG code looks reasonable, so there does not seem an obvious code fix to implement in the RRTMG FAST LW scheme.

module_ra_rrtmg_swf.f90:5612:0:

       use rrsw_kg21_f, only : kao, kbo, selfrefo, forrefo, sfluxrefo, &

internal compiler error: in gfc_trans_use_stmts, at fortran/trans-decl.c:4920

module_ra_rrtmg_swf.f90:5612:0: internal compiler error: Abort trap: 6
gfortran: internal compiler error: Abort trap: 6 (program f951)

The solution is to BE EASILY ABLE TO remove the RRTMG FAST code via an ifdef.

LIST OF MODIFIED FILES:
M phys/module_physics_init.F
M phys/module_ra_rrtmg_lwf.F
M phys/module_ra_rrtmg_swf.F
M phys/module_radiation_driver.F
M share/module_check_a_mundo.F
M arch/postamble_new

TESTS CONDUCTED:

  • Code builds with GNU/7.2.0 with -D optimization with mods (i.e. NO RRTMG FAST)
  • Code does not build with newer GNU with -D optimziation without mods

TYPE: bug fix

KEYWORDS: RRTMG FAST, GNU

SOURCE: internal

DESCRIPTION OF CHANGES:
With GNU version 6.40, 6.5.0, 7.1.0, 7.2.0, and 7.3.0, the WRF RRTMG FAST LW scheme causes an internal compiler error for some optimization levels. The RRTMG code looks reasonable.

module_ra_rrtmg_swf.f90:5612:0:

       use rrsw_kg21_f, only : kao, kbo, selfrefo, forrefo, sfluxrefo, &

internal compiler error: in gfc_trans_use_stmts, at fortran/trans-decl.c:4920

module_ra_rrtmg_swf.f90:5612:0: internal compiler error: Abort trap: 6
gfortran: internal compiler error: Abort trap: 6 (program f951)

The solution is to remove the RRTMG code via an ifdef.

LIST OF MODIFIED FILES:
M	   phys/module_physics_init.F
M	   phys/module_ra_rrtmg_lwf.F
M	   phys/module_ra_rrtmg_swf.F
M	   phys/module_radiation_driver.F

TESTS CONDUCTED:
 - [x] Code builds with GNU/7.2.0 with -D optimization with mods (i.e. NO RRTMG FAST)
 - [x] Code does not build with newer GNU with -D optimziation without mods
@jamiebresch
Copy link
Contributor

@davegill Does this discourage the use of RRTMG_FAST option? Should -DBUILD_RRTMG_FAST be added or mentioned somewhere in the build scripts?

@davegill
Copy link
Contributor Author

davegill commented May 9, 2018

@jamiebresch
Jamie,
I am going to add one more mod to the PR for the GNU problem with RRTMG_FAST. I am explicitly turn the build ON in the arch/postamble_new file. Then, if any users have troubles, we will have them remove that existing CPP flag from their configure.wrf.

This means that the default build is not impacted, and users can still select RRTMG_FAST. However, if there are build problems, users have a very simple fix.

@mgduda
Copy link
Collaborator

mgduda commented May 9, 2018

@davegill your mention of preamble_new just reminded me: are there any plans to rename the *_new files in the arch/ directory and drop the old build scripts for WRF v4?

@davegill
Copy link
Contributor Author

@jamiebresch
Jamie,
Now the behavior is as before. However, there is now an ifdef that is is postamble (or postamble_new, depending on the commit order). If that ifdef is removed, then a use can successfully build with "configure -D" (debug + bounds check options) with newer versions of GNU.

If this seems OK, let me know.

@jamiebresch
Copy link
Contributor

@davegill Thanks for addressing my questions. The mods seem OK now. Just another minor question about the "NOTE: Remove all files that use that CPP flag" in module_check_a_mundo.F. I guess I know what that means. But is that note helpful for general users?

! built to use them.
!-----------------------------------------------------------------------

#if( BUILD_RRTMG_FAST != 1)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jamiebresch
Jamie,
With the default behavior set up as "always build RRTMG FAST", if a user has ever modified the build to not have the RRTMG FAST code part of the executable, then the easy way to get this check_a_mundo test to be resolved is with a clean -a, configure, compile. This is much easier to understand (I think) than the previous message to users.

Copy link
Collaborator

@smileMchen smileMchen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approved

@kkeene44
Copy link
Collaborator

@davegill
This looks okay to me, and it looks like @smileMchen already approved it, so you're good!

@davegill
Copy link
Contributor Author

Replaced by PR #517
The renaming of a file in #508 caused a conflict that github was having troubles resolving.
I updated the master branch, replayed the mods here on top of that new master.

@davegill davegill closed this May 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants