Hello,
I am trying to build WRF on my Mac (macOS Catalina v10.15.4, Intel CPU) but am having some difficulties. First thing's first, I know my environment is correct as I passed every test listed here: https://www2.mmm.ucar.edu/wrf/OnLineTutorial/compilation_tutorial.php
Originally I used the Homebrew gfortran installation and everything worked fine, but when I went to compile WPS, geogrid.exe and ungrib.exe were compiled, but not metgrid.exe. Looking into the log file, it seems that the metgrid executable was skipped because some of the modules it referenced were "Compiled with a different version of GNU fortran". I noticed that when I installed netcdf via Homebrew, the gcc package was installed, which conflicts with the gfortran package. So I decided to uninstall the gfortran package and use the gfortran-9 binary that came with the gcc package and recompile WRF in hopes that the modules would end up all on the correct version.
The binary for gfortran in that package is called gfortran-9, so I edited the top of the WRF configure script to contain this alias:
Configuration works perfectly, but compilation gives some errors. The first of these is "Unclassifiable Statement" from line 6065 of module_mp_fast_sbm.f90:
The function DM_BCAST_MACRO_R16 is not defined in the file or in the ones it includes. It is defined by module_mp_fast_sbm.F, which looks like it is converted to the .f90 format just before in the compile script.
What's going wrong here? Is there anyway to fix this?
Output of gfortran -v:
I am trying to build WRF on my Mac (macOS Catalina v10.15.4, Intel CPU) but am having some difficulties. First thing's first, I know my environment is correct as I passed every test listed here: https://www2.mmm.ucar.edu/wrf/OnLineTutorial/compilation_tutorial.php
Originally I used the Homebrew gfortran installation and everything worked fine, but when I went to compile WPS, geogrid.exe and ungrib.exe were compiled, but not metgrid.exe. Looking into the log file, it seems that the metgrid executable was skipped because some of the modules it referenced were "Compiled with a different version of GNU fortran". I noticed that when I installed netcdf via Homebrew, the gcc package was installed, which conflicts with the gfortran package. So I decided to uninstall the gfortran package and use the gfortran-9 binary that came with the gcc package and recompile WRF in hopes that the modules would end up all on the correct version.
The binary for gfortran in that package is called gfortran-9, so I edited the top of the WRF configure script to contain this alias:
Code:
alias gfortran=gfortran-9
Configuration works perfectly, but compilation gives some errors. The first of these is "Unclassifiable Statement" from line 6065 of module_mp_fast_sbm.f90:
Code:
DM_BCAST_MACRO_R16 ( FAF1 )
What's going wrong here? Is there anyway to fix this?
Output of gfortran -v:
Code:
Using built-in specs.
COLLECT_GCC=gfortran-9
COLLECT_LTO_WRAPPER=/usr/local/Cellar/gcc/9.3.0_1/libexec/gcc/x86_64-apple-darwin19/9.3.0/lto-wrapper
Target: x86_64-apple-darwin19
Configured with: ../configure --build=x86_64-apple-darwin19 --prefix=/usr/local/Cellar/gcc/9.3.0_1 --libdir=/usr/local/Cellar/gcc/9.3.0_1/lib/gcc/9 --disable-nls --enable-checking=release --enable-languages=c,c++,objc,obj-c++,fortran --program-suffix=-9 --with-gmp=/usr/local/opt/gmp --with-mpfr=/usr/local/opt/mpfr --with-mpc=/usr/local/opt/libmpc --with-isl=/usr/local/opt/isl --with-system-zlib --with-pkgversion='Homebrew GCC 9.3.0_1' --with-bugurl=https://github.com/Homebrew/homebrew-core/issues --disable-multilib --with-native-system-header-dir=/usr/include --with-sysroot=/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk SED=/usr/bin/sed
Thread model: posix
gcc version 9.3.0 (Homebrew GCC 9.3.0_1)