Skip to content

fix WRFDA CRTM Cray Fortran build#1595

Merged
jamiebresch merged 1 commit intowrf-model:release-v4.3.2from
jamiebresch:crtm_ftn
Dec 9, 2021
Merged

fix WRFDA CRTM Cray Fortran build#1595
jamiebresch merged 1 commit intowrf-model:release-v4.3.2from
jamiebresch:crtm_ftn

Conversation

@jamiebresch
Copy link
Contributor

@jamiebresch jamiebresch commented Dec 9, 2021

TYPE: bug fix (?)

KEYWORDS: WRFDA, CRTM, ftn compiler

SOURCE: Jamie Bresch (NCAR)

DESCRIPTION OF CHANGES:
Problem:
One of the CRTM modules does not compile with Cray Fortran : Version 12.0.3 with default or -O2 optimization.
ftn -hnoomp -c -N1023 -f free -h byteswapio SOI_Module.f90

ERROR - Trying to add using unusual type properties
  op1_type :: <array[t$90] of real*8>
  op2_type :: <array[t$90] of real*8>
   Error message      ::  Optimization internal error
   Error detected     ::  File 'pdgcs/v_expr_pls.c', line 197
   Optimizer built    ::  2021-08-16 (production)
   File               ::  SOI_Module.f90
   Function           ::  crtm_soi_ad
   at or near line    ::  656

Solution:
Edit CRTM makefile to compile SOI_Module.f90 with -O1 flag when ftn compiler is used.

LIST OF MODIFIED FILES:
M var/external/crtm_2.3.0/libsrc/makefile

TESTS CONDUCTED:

  1. WRFDA builds on Cheyenne crayenv after the fix. (note that configure.wrf has to be edited to uncomment two lines that specify LIB_LOCAL as noted in 207c89e)
  2. Jenkins tests passed.

RELEASE NOTE: N/A

@davegill
Copy link
Contributor

davegill commented Dec 9, 2021

@jamiebresch
Jamie,
Is this in a portion of the code that is going to be a problem by not using default optimization? For example, removing optimization from some top-level or I/O based routines is usually not a problem. Removing optimization for computationally intensive routines is a big deal. I realize that you have no choice here - it did not compile before. But it might be worth mentioning in the release notes if users would see a substantial slowdown compared to other compilers.

@davegill
Copy link
Contributor

davegill commented Dec 9, 2021

@jamiebresch
Screen Shot 2021-12-09 at 8 25 19 AM

@jamiebresch
Copy link
Contributor Author

@jamiebresch Jamie, Is this in a portion of the code that is going to be a problem by not using default optimization? For example, removing optimization from some top-level or I/O based routines is usually not a problem. Removing optimization for computationally intensive routines is a big deal. I realize that you have no choice here - it did not compile before. But it might be worth mentioning in the release notes if users would see a substantial slowdown compared to other compilers.

Thanks @davegill, it is a good point (and an accurate pic). I will see if I can gather more information about the impact on timing.

@davegill
Copy link
Contributor

davegill commented Dec 9, 2021

@jamiebresch
When your PR is ready for review, explicitly ask for people to review it. Also, we now require two approvals (since no one is in the office to talk to each other).

@jamiebresch
Copy link
Contributor Author

SOI_Module is used only when opt%RT_Algorithm_Id = RT_SOI is explicitly set (which is not the case in WRFDA). The default radiative transfer algorithm used for scattering calculation is RT_Algorithm_Id=RT_ADA. Reducing the optimization level of SOI_Module.f90 for Cray Fortran compiler should have no impact on the WRFDA CRTM timing.

@jamiebresch jamiebresch merged commit 8f8984e into wrf-model:release-v4.3.2 Dec 9, 2021
@jamiebresch jamiebresch deleted the crtm_ftn branch December 9, 2021 19:13
vlakshmanan-scala pushed a commit to scala-computing/WRF that referenced this pull request Apr 4, 2024
TYPE: bug fix (?)

KEYWORDS: WRFDA, CRTM, ftn compiler

SOURCE: Jamie Bresch (NCAR)

DESCRIPTION OF CHANGES:
Problem:
One of the CRTM modules does not compile with Cray Fortran : Version 12.0.3 with default or -O2 optimization.
ftn -hnoomp -c -N1023 -f free -h byteswapio SOI_Module.f90

ERROR - Trying to add using unusual type properties
  op1_type :: <array[t$90] of real*8>
  op2_type :: <array[t$90] of real*8>
   Error message      ::  Optimization internal error
   Error detected     ::  File 'pdgcs/v_expr_pls.c', line 197
   Optimizer built    ::  2021-08-16 (production)
   File               ::  SOI_Module.f90
   Function           ::  crtm_soi_ad
   at or near line    ::  656

Solution:
Edit CRTM makefile to compile SOI_Module.f90 with -O1 flag when ftn compiler is used.

LIST OF MODIFIED FILES:
M var/external/crtm_2.3.0/libsrc/makefile

TESTS CONDUCTED:
1. WRFDA builds on Cheyenne crayenv after the fix. (note that configure.wrf has to be edited to uncomment two lines that specify LIB_LOCAL as noted in 207c89e)
2. Jenkins tests passed.

RELEASE NOTE: N/A
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants