Skip to content

Commit

Permalink
Fix two consecutive numeric operators (#1839)
Browse files Browse the repository at this point in the history
TYPE: bug fix

KEYWORDS: Fortran, Precedence of operators

SOURCE: Kengo Miyamoto ( Research Organization for Information Science and Technology or RIST, Japan)

DESCRIPTION OF CHANGES:
Problem:
In fortran, the formation rules do not permit expressions containing two consecutive numeric operators, such as A ** –B, while an expression such as A ** (–B) is permitted. This cause errors for Fujitsu Fortran compiler when building WRF load module files. gfortran warns to use parentheses.

Solution:
Adding parentheses.

LIST OF MODIFIED FILES: phys/module_bl_mynn.F

TESTS CONDUCTED:

1. Do mods fix problem? How can that be demonstrated, and was that test conducted?
I checked whether Fujitsu compiler could make WRF and WPS load module files and a tutorial case (Nested Model Run: 2-way with 2 Input Files) could be completed successfully on a Fujitsu computer system.
2. The regression tests have passed.
  • Loading branch information
Kengo-Miyamoto authored Apr 6, 2023
1 parent fab6ed7 commit ece8149
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions phys/module_bl_mynn.F
Original file line number Diff line number Diff line change
Expand Up @@ -7556,9 +7556,9 @@ FUNCTION phim(zet)

dummy_0=(1.-am_unst*zet) ! parentesis arg
dummy_1=dummy_0**0.333333 ! y
dummy_11=-0.33333*am_unst*dummy_0**-0.6666667 ! dy/dzet
dummy_2 = 0.33333*(dummy_1**2.+dummy_1+1.) ! f
dummy_22 = 0.3333*dummy_11*(2.*dummy_1+1.) ! df/dzet
dummy_11=-0.33333*am_unst*dummy_0**(-0.6666667) ! dy/dzet
dummy_2 = 0.33333*(dummy_1**2.+dummy_1+1.) ! f
dummy_22 = 0.3333*dummy_11*(2.*dummy_1+1.) ! df/dzet
dummy_3 = 0.57735*(2.*dummy_1+1.) ! g
dummy_33 = 1.1547*dummy_11 ! dg/dzet
dummy_4 = 1.5*log(dummy_2)-1.73205*atan(dummy_3)+1.813799364 !psic
Expand Down Expand Up @@ -7608,9 +7608,9 @@ FUNCTION phih(zet)

dummy_0=(1.-ah_unst*zet) ! parentesis arg
dummy_1=dummy_0**0.333333 ! y
dummy_11=-0.33333*ah_unst*dummy_0**-0.6666667 ! dy/dzet
dummy_2 = 0.33333*(dummy_1**2.+dummy_1+1.) ! f
dummy_22 = 0.3333*dummy_11*(2.*dummy_1+1.) ! df/dzet
dummy_11=-0.33333*ah_unst*dummy_0**(-0.6666667) ! dy/dzet
dummy_2 = 0.33333*(dummy_1**2.+dummy_1+1.) ! f
dummy_22 = 0.3333*dummy_11*(2.*dummy_1+1.) ! df/dzet
dummy_3 = 0.57735*(2.*dummy_1+1.) ! g
dummy_33 = 1.1547*dummy_11 ! dg/dzet
dummy_4 = 1.5*log(dummy_2)-1.73205*atan(dummy_3)+1.813799364 !psic
Expand Down

0 comments on commit ece8149

Please sign in to comment.