You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are violations of the Fortran standard that prevent module_bl_mynn.F90 and perhaps other components of CCPP physics from compiling with the Cray compiler on Narwhal (the DoD HPC system we’re using).
Gnu generates warning messages but compiles anyway. Cray just flat out generates an error:
The Fortran standard explicitly (and, I would say, arbitrarily) disallows consecutive operators and requires the order of operations be made explicit with parentheses:
5481 & + dtz(k) * -(vd1(ic)*chem1(1,ic)) &
I was able to find a reference:
“Fortran doesn’t allow consecutive operators! (Many compilers, Intel Fortran for example,
will let you do this as an extension, but it’s non-standard). To conform to the standard you would
have to write this [using explicit parentheses]).”
This issue was reported by @michalakes
Description
There are violations of the Fortran standard that prevent module_bl_mynn.F90 and perhaps other components of CCPP physics from compiling with the Cray compiler on Narwhal (the DoD HPC system we’re using).
Gnu generates warning messages but compiles anyway. Cray just flat out generates an error:
ftn-855 ftn: ERROR MODULE_BL_MYNN, File = ccpp/ccpp-physics/physics/module_bl_mynn.F90, Line = 239, Column = 8
The compiler has detected errors in module "MODULE_BL_MYNN". No module information file will be created for this module.
ftn-1725 ftn: ERROR MYNN_MIX_CHEM, File = /ccpp/ccpp-physics/physics/module_bl_mynn.F90, Line = 5481, Column = 26
Unexpected syntax while parsing the assignment statement : "operand" was expected but found "-".
ftn-1725 ftn: ERROR PHIM, File = /ccpp/ccpp-physics/physics/module_bl_mynn.F90, Line = 7675, Column = 45
Unexpected syntax while parsing the assignment statement : "operand" was expected but found "-".
ftn-1725 ftn: ERROR PHIH, File = ccpp/ccpp-physics/physics/module_bl_mynn.F90, Line = 7726, Column = 45
Unexpected syntax while parsing the assignment statement : "operand" was expected but found "-".
In each of the referenced lines, there is an instance of a binary operator (*) followed immediately by a unary operator (-); for example,
5474 DO ic = 1,nchem
5475 k=kts
5476
5477 a(k)= -dtz(k)*khdz(k)*rhoinv(k)
5478 b(k)=1.+dtz(k)*(khdz(k+1)+khdz(k))rhoinv(k) - 0.5dtz(k)*rhoinv(k)*s_aw(k+1)
5479 c(k)= -dtz(k)*khdz(k+1)rhoinv(k) - 0.5dtz(k)*rhoinv(k)*s_aw(k+1)
5480 d(k)=chem1(k,ic) & !dtz(k)*flt !neglecting surface sources
5481 & + dtz(k) * -vd1(ic)*chem1(1,ic) &
5482 & - dtz(k)*rhoinv(k)*s_awchem(k+1,ic)
The Fortran standard explicitly (and, I would say, arbitrarily) disallows consecutive operators and requires the order of operations be made explicit with parentheses:
5481 & + dtz(k) * -(vd1(ic)*chem1(1,ic)) &
I was able to find a reference:
“Fortran doesn’t allow consecutive operators! (Many compilers, Intel Fortran for example,
will let you do this as an extension, but it’s non-standard). To conform to the standard you would
have to write this [using explicit parentheses]).”
https://stevelionel.com/drfortran/2021/04/03/doctor-fortran-in-order-order/
Steps to Reproduce
Compile module_bl_mynn.F90 with Cray compiler. Note that the GNU compiler issues warnings for this same issue.
The text was updated successfully, but these errors were encountered: