WRF | unrecognized command line option ‘-f90=gfortran’ & ungrib.exe compile error
Issue
When compiling WPSv4.0/v4.2/v3.8.1
gfortran: error: unrecognized command line option ‘-f90=gfortran’
Solution
1 |
|
modify DM_FC to
DM_FC = mpif90
without -f90-gfortran
Finally,
- geogrid.exe and metgrid.exe
- link_grib.csh
are generated.
But, no ungrib.exe !!!
Error
Error: Arguments of ‘iand’ have different kind type parameters at (1)
References
- (RESOLVED) ungrib.exe compile error: Arguments of ‘iand’ have different kind type parameters at (1)ted
- To dd those two extra lines to ungrib/src/ngl/g2/intmath.f (based on https://github.com/wrf-model/WPS/pull/119)
- (RESOLVED) Not generating ungrib.exe
Solution
Fix mismatch integer kind in IAND intrinsic calls in g2 librar
ungrib/src/ngl/g2/intmath.f
1 |
|
to 1
2
3
4
5
6
7
8 ilog2_2=0
i=i_in
if(i<=0) return
! WPS modification for the XL compiler
! if(iand(i,i-1)/=0) then
if(iand(i,i-1_2)/=0) then
!write(0,*) 'iand i-1'
ilog2_2=11
2
3
4
5
6ilog2_1=0
i=i_in
if(i<=0) return
if(iand(i,i-1)/=0) then
!write(0,*) 'iand i-1'
ilog2_1=11
2
3
4
5
6
7
8 ilog2_1=0
i=i_in
if(i<=0) return
! WPS modification for the XL compiler
! if(iand(i,i-1)/=0) then
if(iand(i,i-1_1)/=0) then
!write(0,*) 'iand i-1'
ilog2_1=1
Works!!!