Scheduled Downtime
On Friday 21 April 2023 @ 5pm MT, this website will be down for maintenance and expected to return online the morning of 24 April 2023 at the latest

wrf-chem compile error

yuzj

New member
Dear all,

I am working to compile WRF and WRF-Chem recently. I have compile WRF and WPS successfully, so I try to do more work to ocmpile wrf-chem. I use the gcc version is ( gcc (GCC) 11.4.1 20231218 (Red Hat 11.4.1-3)) and GNU Fortran (GCC) 11.4.1 20231218 (Red Hat 11.4.1-3). I believe the problem occurred in kpp section, but I am not sur detail for the problem. I have attached the confgure.wrf and compile.log in this post, Thank you so much if you have any idea to solve the error. I also attached my environment here, especially for kpp section. Thank you so much for help.
1727873555361.png
 

Attachments

  • configure.wrf.txt
    20.9 KB · Views: 6
  • compile.log
    148.8 KB · Views: 4
hi, from what i see, theres nothing wrong with your compilation, your compile KPP looks compiled correctly,
can you attach your log of compile em_real, so i can try to find if there any problem on em_real compilation or not.
 
hi, from what i see, theres nothing wrong with your compilation, your compile KPP looks compiled correctly,
can you attach your log of compile em_real, so i can try to find if there any problem on em_real compilation or not.
hi, I have attached compile em_real, maybe that is helpful for the question.
 

Attachments

  • compile_log.txt
    1.1 MB · Views: 4
theres some error while compile progress read the module, this is just my opinion based on my experience while installing chem model, maybe theres some mismatch between em_core and kpp because they work on different scheme,
other error that i see is from your libfl.so.2 file, maybe you can check first on kpp folder, also recheck your flex path,

this is some setting that i use while install wrf-chem v4.4
export WRF_CHEM=1
export WRF_KPP=1
export FLEX_LIB_DIR=/usr/lib
export YACC='/usr/bin/yacc -d'
export FLEX_LIB_DIR=/usr/lib/x86_64-linux-gnu
export FLEX=/usr/bin/flex

also you can check my video on my yt chanel about wrf chem installation, i use ubuntu22, but i think that wont make any error on redhat because we use the same version of compiler gcc g++ gfortran, maybe the different just on some command and bash file place because on ubuntu i use .profile and on redhat using .bashrc,
i hope this setting can help you fix your problem.
 
theres some error while compile progress read the module, this is just my opinion based on my experience while installing chem model, maybe theres some mismatch between em_core and kpp because they work on different scheme,
other error that i see is from your libfl.so.2 file, maybe you can check first on kpp folder, also recheck your flex path,

this is some setting that i use while install wrf-chem v4.4
export WRF_CHEM=1
export WRF_KPP=1
export FLEX_LIB_DIR=/usr/lib
export YACC='/usr/bin/yacc -d'
export FLEX_LIB_DIR=/usr/lib/x86_64-linux-gnu
export FLEX=/usr/bin/flex

also you can check my video on my yt chanel about wrf chem installation, i use ubuntu22, but i think that wont make any error on redhat because we use the same version of compiler gcc g++ gfortran, maybe the different just on some command and bash file place because on ubuntu i use .profile and on redhat using .bashrc,
i hope this setting can help you fix your problem.
I am sorry it still can not work. I have updated the bashrc for chem, but the libfl.so.2 problem still exist. I guess it still because the chem module problem, I have tried close chem module and only compile wrf, it can work. or maybe because the flex version? I use flex 2.6.4. Anyway Thank you so much for patient help.
1727945280444.png
 
By the way, I found here is a fatal error that is in graph. I am not sure why the gnu version is different and caused the fatal error.1727946185524.png
 
can i know which mpi that you install on your system?
actually was i just install default like (sudo apt install openmpi-bin libopenmpi-dev), but in redhat maybe you can try yum install openmpi-bin libopenmpi-dev, if redhat cant download that, you can try to search how to install openmpi and libopenmpi for redhat on internet maybe just different name
 
also this is all the thing that i do before do library installation
sudo apt update

sudo apt upgrade

sudo apt install -y csh m4 build-essential nasm cmake unzip libxmu-dev libcairo-dev libbz2-dev libxaw7-dev libx11-dev xorg-dev flex bison subversion liburi-perl evince tcsh cpp m4 quota cvs libomp-dev python3-pip freeglut3-dev libjpeg-dev file git libcurl4-openssl-dev make cpp openmpi-bin libopenmpi-dev libtool automake autoconf default-jre default-jdk ksh ncview ncl-ncarg build-essential unzip mlocate byacc

sudo apt install gcc g++ gfortran
 
can i know which mpi that you install on your system?
actually was i just install default like (sudo apt install openmpi-bin libopenmpi-dev), but in redhat maybe you can try yum install openmpi-bin libopenmpi-dev, if redhat cant download that, you can try to search how to install openmpi and libopenmpi for redhat on internet maybe just different name
hi, thank you so much for the reply, my mpi version is
Intel(R) MPI Library for Linux* OS, Version 2021.13 Build 20240701 (id: 179630a)
Copyright 2003-2024, Intel Corporation.
 
@yuzj

Conda environments are like mini operating systems that have everything built inside them that are separated from the main OS. IF conda isn't needed right away I would try to deactivate conda environment and install the WRF from scratch again outside of the conda environment.

So in the terminal when you open it up type this command

Bash:
conda deactivate
conda deactivate

You should see the conda environment that is usually called (base) or whatever else you have the conda environment named as in () disappear and then when you install WRF from scratch again it will run.

You will be able to run WRF outside of conda that way. Just remember that once WRF is installed and compiled it has to be run always outside of conda. Then you can open a new terminal if you need conda commands.
 
if you activate ncl_stable while installing wrf_chem, you should deactivate first, from the bashrc conda have their own environment space, maybe that thing that make the system reach wrong path, also if you want use ncl i think no need to install miniconda, but if you want use python, conda can use for that,
conda deactivate
source bash script that you use to save all your libraries path
export some necesery think,
edit configure in ($USENETCDFPAR == 1 to $USENETCDFPAR =1 )
configure, (34 using fortran compiler and 1 for default),
after that you can start compile em_real, it will compile the kpp first if you set kpp=1 after that it will automatically build the wrf model
 
if you activate ncl_stable while installing wrf_chem, you should deactivate first, from the bashrc conda have their own environment space, maybe that thing that make the system reach wrong path, also if you want use ncl i think no need to install miniconda, but if you want use python, conda can use for that,
conda deactivate
source bash script that you use to save all your libraries path
export some necesery think,
edit configure in ($USENETCDFPAR == 1 to $USENETCDFPAR =1 )
configure, (34 using fortran compiler and 1 for default),
after that you can start compile em_real, it will compile the kpp first if you set kpp=1 after that it will automatically build the wrf model

you can see some examples of how the code structure works that lazuardi is mentioning in my install codes that install everything for wrf chem
@yuzj
 
Last edited:
@yuzj

Conda environments are like mini operating systems that have everything built inside them that are separated from the main OS. IF conda isn't needed right away I would try to deactivate conda environment and install the WRF from scratch again outside of the conda environment.

So in the terminal when you open it up type this command

Bash:
conda deactivate
conda deactivate

You should see the conda environment that is usually called (base) or whatever else you have the conda environment named as in () disappear and then when you install WRF from scratch again it will run.

You will be able to run WRF outside of conda that way. Just remember that once WRF is installed and compiled it has to be run always outside of conda. Then you can open a new terminal if you need conda commands.
Thank both of you so much for patience reply, I have tried deactivate conda before my compiling, I just got the results and I think the condition is much better than before, there is no more problem caused by conda environment. But here are four fatal errors which lead to the terminate. Some errors said that is because the some mod file can not be read.
1728023503438.png
1728023536597.png
1728023569075.png
1728023621828.png
 

Attachments

  • compile_log.txt
    1.1 MB · Views: 2
V4.4
No git found or not a git repository, git commit version not available.

Compiling: WRF_EM_CORE

Linux Archangel11 5.15.153.1-microsoft-standard-WSL2 #1 SMP Fri Mar 29 23:14:13 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

GNU Fortran (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


==============================================================================================

setting parallel make -j 2

==============================================================================================

The following indicate the compilers selected to build the WRF system

Serial Fortran compiler (mostly for tool generation):
which SFC
/usr/bin/gfortran

Serial C compiler (mostly for tool generation):
which SCC
/usr/bin/gcc

Fortran compiler for the model source code:
which FC
/home/ioga1101/install/mpich/bin/mpif90
Will use 'time' to report timing information

C compiler for the model source code:
which CC
/home/ioga1101/install/mpich/bin/mpicc

==============================================================================================

make -i -r MODULE_DIRS="-I../dyn_em -I/home/ioga1101/chem/WRFV4.4/external/esmf_time_f90 -I/home/ioga1101/chem/WRFV4.4/main -I/home/ioga1101/chem/WRFV4.4/external/io_netcdf -I/home/ioga1101/chem/WRFV4.4/external/io_int -I/home/ioga1101/chem/WRFV4.4/frame -I/home/ioga1101/chem/WRFV4.4/share -I/home/ioga1101/chem/WRFV4.4/phys -I/home/ioga1101/chem/WRFV4.4/wrftladj -I/home/ioga1101/chem/WRFV4.4/chem -I/home/ioga1101/chem/WRFV4.4/inc -I/home/ioga1101/install/netcdf/include " ext
make[1]: Entering directory '/home/ioga1101/chem/WRFV4.4'
--------------------------------------
if [ 0 -eq 0 ] ; then \
( cd frame ; make -i -r externals ) ; \
else \
( cd frame ; make -i -r PLUSFLAG="-DWRFPLUS=1" externals ) ; \
fi
make[2]: Entering directory '/home/ioga1101/chem/WRFV4.4/frame'
( cd /home/ioga1101/chem/WRFV4.4/external/esmf_time_f90 ; \
make -j 2 FC="gfortran -w -ffree-form -ffree-line-length-none -fconvert=big-endian -frecord-marker=4 -fallow-argument-mismatch -fallow-invalid-boz " RANLIB="ranlib" \
CPP="/lib/cpp -P -nostdinc -I/home/ioga1101/chem/WRFV4.4/inc -I. -DEM_CORE=1 -DNMM_CORE=0 -DNMM_MAX_DIM=2600 -DDA_CORE=0 -DWRFPLUS=0 -DIWORDSIZE=4 -DDWORDSIZE=8 -DRWORDSIZE=4 -DLWORDSIZE=4 -DNONSTANDARD_SYSTEM_SUBR -DWRF_USE_CLM -DUSE_NETCDF4_FEATURES -DWRFIO_NCD_LARGE_FILE_SUPPORT -DDM_PARALLEL -DNETCDF -DLANDREAD_STUB=1 -DUSE_ALLOCATABLES -Dwrfmodel -DGRIB1 -DINTIO -DKEEP_INT_AROUND -DLIMIT_ARGS -DBUILD_RRTMG_FAST=0 -DBUILD_RRTMK=0 -DBUILD_SBM_FAST=1 -DSHOW_ALL_VARS_USED=0 -DCONFIG_BUF_LEN=65536 -DMAX_DOMAINS_F=21 -DMAX_HISTORY=25 -DNMM_NEST=0 -traditional-cpp -DUSE_NETCDF4_FEATURES -DWRFIO_NCD_LARGE_FILE_SUPPORT" AR="ar" ARFLAGS="ru" )

at this part we got some different build, so before continue with chem installation, can i see all your libraries version also how you configure your libraries,
 
V4.4
No git found or not a git repository, git commit version not available.

Compiling: WRF_EM_CORE

Linux Archangel11 5.15.153.1-microsoft-standard-WSL2 #1 SMP Fri Mar 29 23:14:13 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

GNU Fortran (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


==============================================================================================

setting parallel make -j 2

==============================================================================================

The following indicate the compilers selected to build the WRF system

Serial Fortran compiler (mostly for tool generation):
which SFC
/usr/bin/gfortran

Serial C compiler (mostly for tool generation):
which SCC
/usr/bin/gcc

Fortran compiler for the model source code:
which FC
/home/ioga1101/install/mpich/bin/mpif90
Will use 'time' to report timing information

C compiler for the model source code:
which CC
/home/ioga1101/install/mpich/bin/mpicc

==============================================================================================

make -i -r MODULE_DIRS="-I../dyn_em -I/home/ioga1101/chem/WRFV4.4/external/esmf_time_f90 -I/home/ioga1101/chem/WRFV4.4/main -I/home/ioga1101/chem/WRFV4.4/external/io_netcdf -I/home/ioga1101/chem/WRFV4.4/external/io_int -I/home/ioga1101/chem/WRFV4.4/frame -I/home/ioga1101/chem/WRFV4.4/share -I/home/ioga1101/chem/WRFV4.4/phys -I/home/ioga1101/chem/WRFV4.4/wrftladj -I/home/ioga1101/chem/WRFV4.4/chem -I/home/ioga1101/chem/WRFV4.4/inc -I/home/ioga1101/install/netcdf/include " ext
make[1]: Entering directory '/home/ioga1101/chem/WRFV4.4'
--------------------------------------
if [ 0 -eq 0 ] ; then \
( cd frame ; make -i -r externals ) ; \
else \
( cd frame ; make -i -r PLUSFLAG="-DWRFPLUS=1" externals ) ; \
fi
make[2]: Entering directory '/home/ioga1101/chem/WRFV4.4/frame'
( cd /home/ioga1101/chem/WRFV4.4/external/esmf_time_f90 ; \
make -j 2 FC="gfortran -w -ffree-form -ffree-line-length-none -fconvert=big-endian -frecord-marker=4 -fallow-argument-mismatch -fallow-invalid-boz " RANLIB="ranlib" \
CPP="/lib/cpp -P -nostdinc -I/home/ioga1101/chem/WRFV4.4/inc -I. -DEM_CORE=1 -DNMM_CORE=0 -DNMM_MAX_DIM=2600 -DDA_CORE=0 -DWRFPLUS=0 -DIWORDSIZE=4 -DDWORDSIZE=8 -DRWORDSIZE=4 -DLWORDSIZE=4 -DNONSTANDARD_SYSTEM_SUBR -DWRF_USE_CLM -DUSE_NETCDF4_FEATURES -DWRFIO_NCD_LARGE_FILE_SUPPORT -DDM_PARALLEL -DNETCDF -DLANDREAD_STUB=1 -DUSE_ALLOCATABLES -Dwrfmodel -DGRIB1 -DINTIO -DKEEP_INT_AROUND -DLIMIT_ARGS -DBUILD_RRTMG_FAST=0 -DBUILD_RRTMK=0 -DBUILD_SBM_FAST=1 -DSHOW_ALL_VARS_USED=0 -DCONFIG_BUF_LEN=65536 -DMAX_DOMAINS_F=21 -DMAX_HISTORY=25 -DNMM_NEST=0 -traditional-cpp -DUSE_NETCDF4_FEATURES -DWRFIO_NCD_LARGE_FILE_SUPPORT" AR="ar" ARFLAGS="ru" )

at this part we got some different build, so before continue with chem installation, can i see all your libraries version also how you configure your libraries,
Hi, Thanks for reply, I list all the libraries here, hdf5-1.10.5, flex-2.6.4, jasper-1.900.1,libpng-1.2.50, libtirpc-1.3.3, mpich-3.0.4, netcdf-4.1.3, zlib-1.2.7


The env setting is in below:
export WRF_DIR=/disk/r091/envryuzj/WRF_test/WRFV44
#NETCDF setting
#------------------------------------------------------------------------------------------

export NETCDF=$HOME/netcdf
export PATH=$HOME/netcdf/bin:$PATH
#export PATH=/home/envryuzj/netcdf/bin:$PATH
export NETCDF_LIB=$NETCDF/lib
export NETCDF_INC=$NETCDF/include
export NETCDF_DIR=$NETCDF
export LD_LIBRARY_PATH=$NETCDF/lib:$LD_LIBRARY_PATH

export NETCDF_classic=1
#cd /disk/r091/envryuzj/WRF_test/WRFV4.4


#/home/envryuzj/netcdf/bin/nc-config --all

#------------------------------------------------------------------------------------------
#mpich
#------------------------------------------------------------------------------------------

#export MPICH=$HOME/mpich/bin:$PATH
export PATH=$MPICH/bin:$PATH
#export MPICH_LIB=$MPICH/lib
#export MPICH_INC=$MPICH/include
export LD_LIBRARY_PATH=$MPICH/lib:$LD_LIBRARY_PATH


#------------------------------------------------------------------------------------------
#zlib
#------------------------------------------------------------------------------------------
export ZLIB_HOME=$HOME/zlib
export LD_LIBRARY_PATH=$ZLIB_HOME/lib:$LD_LIBRARY_PATH


#export ZLIB=$HOME/zlib/bin:$PATH
#export PATH=$ZLIB_HOME/bin:$PATH
#export ZLIB_LIB=$ZLIB/lib
#export ZLIB_INC=$ZLIB/include
#export LD_LIBRARY_PATH=$ZLIB/lib:$LD_LIBRARY_PATH

#------------------------------------------------------------------------------------------
#hdf5
#------------------------------------------------------------------------------------------

#export CPPFLAGS=-I$HOME/hdf5/include
#export LDFLAGS=-L$HOME/hdf5/lib
#export LD_LIBRARY_PATH=$HOME/hdf5/lib

export HDF5=$HOME/hdf5
export PATH=/home/envryuzj/hdf5/bin:$PATH
#export HDF5_LIB=$HDF5/lib
#export HDF5_INC=$HDF5/include
export LD_LIBRARY_PATH=$HDF5/lib:$LD_LIBRARY_PATH


# libpng---------------------------------------------------------------------------------
export PNG_LIB=$HOME/libpng
#export PATH=$PNG_LIB/bin:$PATH
export PNG_INC=$PNG_LIB/include
#export LD_LIBRARY_PATH=$PNG_LIB/lib:$LD_LIBRARY_PATH

# gssapi---------------------------------------------------------------------------------

export GSSAPI_LIB=$HOME/libtirpc
#export PATH=$GSSAPI_LIB/bin:$PATH
export GSSAPI_INC=$GSSAPI_LIB/include
#export LD_LIBRARY_PATH=$GSSAPI_LIB/lib:$LD_LIBRARY_PATH


#------------------------------------------------------------------------------------------
#JASPER
#------------------------------------------------------------------------------------------
export JASPER=$HOME/jasper
#export PATH=$JASPER/bin:$PATH
export JASPERLIB=$JASPER/lib
export JASPERINC=$JASPER/include/jasper
export LD_LIBRARY_PATH=$JASPERLIB:$LD_LIBRARY_PATH
export CPPFLAGS="-I$JASPERINC"
export LDFLAGS="-L$JASPERLIB -ljasper"
echo "Jasper setup completed successfully"

#------------------------------------------------------------------------------------------
#CC CXX FC F90
#------------------------------------------------------------------------------------------

export CC=gcc
export CXX=g++
export FC=/bin/gfortran
export F77=/bin/gfortran
#export FCFLAGS="-m64 -w -fallow-argument-mismatch -O2"
#export FFLAGS="$FCFLAGS -fno-allow-invalid-boz"

export fallow_argument=-fallow-argument-mismatch
export boz_argument=-fallow-invalid-boz

export FFLAGS="$fallow_argument $boz_argument -m64"
export FCFLAGS="$fallow_argument $boz_argument -m64"

#-----------------------------------------------------------------------------------------
#WRF and WRF-Chem settings
#------------------------------------------------------------------------------------------
export WRFIO_NCD_LARGE_FILE_SUPPORT=1
#the modify below is for wrf-chem, if it can not work, just zhushudiao jiuhaole
export WRF_CHEM=1
export WRF_EM_CORE=1
export WRF_NMM_CORE=0
export WRF_KPP=1

#------------------------------------------------------------------------------------------
#FLEX
#------------------------------------------------------------------------------------------
#export YACC='yacc -d'
export FLEX_LIB_DIR=$HOME/local/lib
export FLEX=$HOME/local/bin/flex
export KPP_HOME=/disk/r091/envryuzj/WRF_test/WRFV4.4-chem/chem/KPP/kpp/kpp-2.1
#export LD_LIBRARY_PATH=$HOME/local/lib:$LD_LIBRARY_PATH

#export FLEX_LIB_DIR=/usr/lib
export YACC='/usr/bin/yacc -d'
#export FLEX_LIB_DIR=/usr/lib/x86_64-linux-gnu
#export FLEX=/usr/bin/flex
echo "Environment setup completed successfully"
 
I'm not familiar with this library, what does it do?

# gssapi---------------------------------------------------------------------------------

export GSSAPI_LIB=$HOME/libtirpc
#export PATH=$GSSAPI_LIB/bin:$PATH
export GSSAPI_INC=$GSSAPI_LIB/include
#export LD_LIBRARY_PATH=$GSSAPI_LIB/lib:$LD_LIBRARY_PATH

I would try version 4.6.0, 4.4 is known to have bugs when compiling and most of it was fixed is 4.6.0
 
sudo apt update (on redhat using sudo yum update)

sudo apt upgrade

sudo apt install -y csh m4 build-essential nasm cmake unzip libxmu-dev libcairo-dev libbz2-dev libxaw7-dev libx11-dev xorg-dev flex bison subversion liburi-perl evince tcsh cpp m4 quota cvs libomp-dev python3-pip freeglut3-dev libjpeg-dev file git libcurl4-openssl-dev make cpp openmpi-bin libopenmpi-dev libtool automake autoconf default-jre default-jdk ksh ncview ncl-ncarg build-essential unzip mlocate byacc (maybe there some difference between redhat and ubuntu so you need to find the similir package on internet maybe just little bit different like dev or devel)

sudo apt install gcc g++ gfortran

------------------------------------------
edit ~./profile and source to define all path libraries (in redhat usually use ~/.bashrc for libraries path) change the directory path with yours,

# mpich
export PATH=/home/ioga1101/install/mpich/bin:$PATH
# hdf5
export PATH=/home/ioga1101/install/hdf5/bin:$PATH
export LD_LIBRARY_PATH=/home/ioga1101/install/hdf5/lib:$LD_LIBRARY_PATH
# netcdf
export PATH=/home/ioga1101/install/netcdf/bin:$PATH
export NETCDF=/home/ioga1101/install/netcdf
export LD_LIBRARY_PATH=$NETCDF/lib:$LD_LIBRARY_PATH
# libpng
export LD_LIBRARY_PATH=/home/ioga1101/install/libpng/lib:$LD_LIBRARY_PATH
# jasper
export PATH=/home/ioga1101/install/jasper/bin:$PATH
export LD_LIBRARY_PATH=/home/ioga1101/install/jasper/lib:$LD_LIBRARY_PATH
export JASPERLIB=/home/ioga1101/install/jasper/lib
export JASPERINC=/home/ioga1101/install/jasper/include
------------------------------------------

library: i use directory app(for all downloaded file), and install(for target destination all libraries)

install mpich
cd app
wget https://www.mpich.org/static/downloads/4.0.2/mpich-4.0.2.tar.gz
tar -xvzf mpich-4.0.2.tar.gz
cd mpich-4.0.2/
FFLAGS=-fallow-argument-mismatch FCFLAGS=-fallow-argument-mismatch ./configure --prefix=/home/ioga1101/install/mpich
make -j4
make install
source ~/.profile
cd ..
install zlib
wget https://www.zlib.net/fossils/zlib-1.2.11.tar.gz
tar -xvzf zlib-1.2.11.tar.gz
cd zlib-1.2.11/
./configure --prefix=/home/ioga1101/install/zlib
make
make install
cd ..

install hdf5
wget https://hdf-wordpress-1. s3. amazonaws. com/wp- content/uploads/manual/HDF5 /HDF5_ 1_12_2/source/hdf5-1. 12.2.tar.gz
tar -xvzf hdf5-1.12.2.tar.gz
cd hdf5-1.12.2/
./configure --prefix=/home/ioga1101/install/hdf5 --with-zlib=/home/ioga1101/install/zlib --enable-fortran --enable-fortran2003 --enable-cxx --with-default-api-version=v18
make
make install
source ~/.profile
cd ..

install curl
wget https://curl.se/download/curl-7.83.1.tar.gz
tar -xvzf curl-7.83.1.tar.gz
cd curl-7.83.1/
./configure --prefix=/home/ioga1101/install/curl --with-zlib=/home/ioga1101/install/zlib --without-ssl
make
make install
cd ..

install netcdf
install netcdf-c
wget https://www.gfd-dennou.org/arch/netcdf/unidata-mirror/netcdf-c-4.7.0.tar.gz
tar -xvzf netcdf-c-4.7.0.tar.gz
cd netcdf-c-4.7.0/
CFLAGS=-fPIC CPPFLAGS='-I/home/ioga1101/install/hdf5/include -I/home/ioga1101/install/curl/include' LDFLAGS='-L/home/ioga1101/install/hdf5/lib -L/home/ioga1101/install/curl/lib ' ./configure --prefix=/home/ioga1101/install/netcdf --enable-netcdf-4 --enable-netcdf4 --enable-shared --enable-dap
make -j4
make install
cd ..
install netcdf-fortran
wget https://www.gfd-dennou.org/arch/netcdf/unidata-mirror/netcdf-fortran-4.4.3.tar.gz
tar -xvzf netcdf-fortran-4.4.3.tar.gz
cd netcdf-fortran-4.4.3
CPPFLAGS='-I/home/ioga1101/install/netcdf/include' LDFLAGS='-L/home/ioga1101/install/netcdf/lib' FCFLAGS='-fallow-argument-mismatch' ./configure --prefix=/home/ioga1101/install/netcdf
make -j4
make install
source ~/.profile
cd ..

install libpng
wget https://src.fedoraproject.org/repo/...ff7d82fcefb40c0f48f88918/libpng-1.6.37.tar.gz
tar -xvzf libpng-1.6.37.tar.gz
cd libpng-1.6.37/
CPPFLAGS='-I/home/ioga1101/install/netcdf/include' FCFLAGS='-fallow-argument-mismatch' ./configure --prefix=/home/ioga1101/install/libpng
make
make install
source ~/.profile
cd ..

Install jasper
wget https://www.ece.uvic.ca/~frodo/jasper/software/jasper-2.0.10.tar.gz
tar -xvzf jasper-2.0.10.tar.gz
cmake -G "Unix Makefiles" -H/home/ioga1101/app/jasper-2.0.10 -B/home/ioga1101/app/jasper-2.0.10-build -DCMAKE_INSTALL_PREFIX=/home/ioga1101/install/jasper
cd jasper-2.0.10-build/
make install
source ~/.profile
cd ../..

------------------------------

last just download WRFV4.4

dont forget to edit configure on $USENETCDFPAR==1 to $USENETCDFPAR=1

also on chem/KPP/configure_kpp on line 68, CC_FLAGS="-O" to CC_FLAGS="-O0"

before do ./configure, export some important think:

export WRF_CHEM=1
export WRF_KPP=1
export FLEX_LIB_DIR=/usr/lib
export YACC='/usr/bin/yacc -d'
export FLEX_LIB_DIR=/usr/lib/x86_64-linux-gnu
export FLEX=/usr/bin/flex

after this all just ./configure use dmpar and gfortran (34), after that choose default(1),

./compile 2>&1 (for kpp compile)

./compile em_real (for wrfchem)

./compile emi_conv 2>1

you can try using this, if executable file not created but theres nothing important error you can retry compile em_real and that fix automatically, i already use this on my ubuntu several times and work without error
 
sudo apt update (on redhat using sudo yum update)

sudo apt upgrade

sudo apt install -y csh m4 build-essential nasm cmake unzip libxmu-dev libcairo-dev libbz2-dev libxaw7-dev libx11-dev xorg-dev flex bison subversion liburi-perl evince tcsh cpp m4 quota cvs libomp-dev python3-pip freeglut3-dev libjpeg-dev file git libcurl4-openssl-dev make cpp openmpi-bin libopenmpi-dev libtool automake autoconf default-jre default-jdk ksh ncview ncl-ncarg build-essential unzip mlocate byacc (maybe there some difference between redhat and ubuntu so you need to find the similir package on internet maybe just little bit different like dev or devel)

sudo apt install gcc g++ gfortran

------------------------------------------
edit ~./profile and source to define all path libraries (in redhat usually use ~/.bashrc for libraries path) change the directory path with yours,

# mpich
export PATH=/home/ioga1101/install/mpich/bin:$PATH
# hdf5
export PATH=/home/ioga1101/install/hdf5/bin:$PATH
export LD_LIBRARY_PATH=/home/ioga1101/install/hdf5/lib:$LD_LIBRARY_PATH
# netcdf
export PATH=/home/ioga1101/install/netcdf/bin:$PATH
export NETCDF=/home/ioga1101/install/netcdf
export LD_LIBRARY_PATH=$NETCDF/lib:$LD_LIBRARY_PATH
# libpng
export LD_LIBRARY_PATH=/home/ioga1101/install/libpng/lib:$LD_LIBRARY_PATH
# jasper
export PATH=/home/ioga1101/install/jasper/bin:$PATH
export LD_LIBRARY_PATH=/home/ioga1101/install/jasper/lib:$LD_LIBRARY_PATH
export JASPERLIB=/home/ioga1101/install/jasper/lib
export JASPERINC=/home/ioga1101/install/jasper/include
------------------------------------------

library: i use directory app(for all downloaded file), and install(for target destination all libraries)

install mpich
cd app
wget https://www.mpich.org/static/downloads/4.0.2/mpich-4.0.2.tar.gz
tar -xvzf mpich-4.0.2.tar.gz
cd mpich-4.0.2/
FFLAGS=-fallow-argument-mismatch FCFLAGS=-fallow-argument-mismatch ./configure --prefix=/home/ioga1101/install/mpich
make -j4
make install
source ~/.profile
cd ..
install zlib
wget https://www.zlib.net/fossils/zlib-1.2.11.tar.gz
tar -xvzf zlib-1.2.11.tar.gz
cd zlib-1.2.11/
./configure --prefix=/home/ioga1101/install/zlib
make
make install
cd ..

install hdf5
wget https://hdf-wordpress-1. s3. amazonaws. com/wp- content/uploads/manual/HDF5 /HDF5_ 1_12_2/source/hdf5-1. 12.2.tar.gz
tar -xvzf hdf5-1.12.2.tar.gz
cd hdf5-1.12.2/
./configure --prefix=/home/ioga1101/install/hdf5 --with-zlib=/home/ioga1101/install/zlib --enable-fortran --enable-fortran2003 --enable-cxx --with-default-api-version=v18
make
make install
source ~/.profile
cd ..

install curl
wget https://curl.se/download/curl-7.83.1.tar.gz
tar -xvzf curl-7.83.1.tar.gz
cd curl-7.83.1/
./configure --prefix=/home/ioga1101/install/curl --with-zlib=/home/ioga1101/install/zlib --without-ssl
make
make install
cd ..

install netcdf
install netcdf-c
wget https://www.gfd-dennou.org/arch/netcdf/unidata-mirror/netcdf-c-4.7.0.tar.gz
tar -xvzf netcdf-c-4.7.0.tar.gz
cd netcdf-c-4.7.0/
CFLAGS=-fPIC CPPFLAGS='-I/home/ioga1101/install/hdf5/include -I/home/ioga1101/install/curl/include' LDFLAGS='-L/home/ioga1101/install/hdf5/lib -L/home/ioga1101/install/curl/lib ' ./configure --prefix=/home/ioga1101/install/netcdf --enable-netcdf-4 --enable-netcdf4 --enable-shared --enable-dap
make -j4
make install
cd ..
install netcdf-fortran
wget https://www.gfd-dennou.org/arch/netcdf/unidata-mirror/netcdf-fortran-4.4.3.tar.gz
tar -xvzf netcdf-fortran-4.4.3.tar.gz
cd netcdf-fortran-4.4.3
CPPFLAGS='-I/home/ioga1101/install/netcdf/include' LDFLAGS='-L/home/ioga1101/install/netcdf/lib' FCFLAGS='-fallow-argument-mismatch' ./configure --prefix=/home/ioga1101/install/netcdf
make -j4
make install
source ~/.profile
cd ..

install libpng
wget https://src.fedoraproject.org/repo/...ff7d82fcefb40c0f48f88918/libpng-1.6.37.tar.gz
tar -xvzf libpng-1.6.37.tar.gz
cd libpng-1.6.37/
CPPFLAGS='-I/home/ioga1101/install/netcdf/include' FCFLAGS='-fallow-argument-mismatch' ./configure --prefix=/home/ioga1101/install/libpng
make
make install
source ~/.profile
cd ..

Install jasper
wget https://www.ece.uvic.ca/~frodo/jasper/software/jasper-2.0.10.tar.gz
tar -xvzf jasper-2.0.10.tar.gz
cmake -G "Unix Makefiles" -H/home/ioga1101/app/jasper-2.0.10 -B/home/ioga1101/app/jasper-2.0.10-build -DCMAKE_INSTALL_PREFIX=/home/ioga1101/install/jasper
cd jasper-2.0.10-build/
make install
source ~/.profile
cd ../..

------------------------------

last just download WRFV4.4

dont forget to edit configure on $USENETCDFPAR==1 to $USENETCDFPAR=1

also on chem/KPP/configure_kpp on line 68, CC_FLAGS="-O" to CC_FLAGS="-O0"

before do ./configure, export some important think:

export WRF_CHEM=1
export WRF_KPP=1
export FLEX_LIB_DIR=/usr/lib
export YACC='/usr/bin/yacc -d'
export FLEX_LIB_DIR=/usr/lib/x86_64-linux-gnu
export FLEX=/usr/bin/flex

after this all just ./configure use dmpar and gfortran (34), after that choose default(1),

./compile 2>&1 (for kpp compile)

./compile em_real (for wrfchem)

./compile emi_conv 2>1

you can try using this, if executable file not created but theres nothing important error you can retry compile em_real and that fix automatically, i already use this on my ubuntu several times and work without error
Thank you so much for the detail reply, I will try it, actually I just test wrf-chem 4.6.0, but the error is same. You are right, I need check my library again. I found in this forum, here is some same problem. Compiling WRF-chem 3.6.1 They tried use flex 2.5.3, I will test that in this weekend and keep updating in this forum. Thank you again and I believe that is a really good process for me and the new users to understand the compiling for WRF-Chem. I will update the results and my test steps. hopefully it can be solved. Thank you again.
 
Top