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

Dear all,
Actually, I have tried many times for compiling WRF-Chem. I tried use wrf-chem 4.6.0. also I tried to use previous flex (flex 2.5.39). I also follow your step to setthe env but unfortunately, every time, the fatal error is below, there are some mod missing and caused fatal error. I do not know how to solve the error . if there are any people faced same problem, could you please give me some suggestion to modify that. Thank you so much.


time mpif90 -o start_em.o -c -O2 -ftree-vectorize -funroll-loops -w -ffree-form -ffree-line-length-none -fconvert=big-endian -frecord-marker=4 -fallow-argument-mismatch -fallow-invalid-boz -I../dyn_em -I/disk/r091/envryuzj/WRF_test/WRFV4.4-chem/external/esmf_time_f90 -I/disk/r091/envryuzj/WRF_test/WRFV4.4-chem/main -I/disk/r091/envryuzj/WRF_test/WRFV4.4-chem/external/io_netcdf -I/disk/r091/envryuzj/WRF_test/WRFV4.4-chem/external/io_int -I/disk/r091/envryuzj/WRF_test/WRFV4.4-chem/frame -I/disk/r091/envryuzj/WRF_test/WRFV4.4-chem/share -I/disk/r091/envryuzj/WRF_test/WRFV4.4-chem/phys -I/disk/r091/envryuzj/WRF_test/WRFV4.4-chem/wrftladj -I/disk/r091/envryuzj/WRF_test/WRFV4.4-chem/chem -I/disk/r091/envryuzj/WRF_test/WRFV4.4-chem/inc -I/home/envryuzj/install/netcdf/include start_em.f90
start_em.f90:46:8:

46 | USE module_aerosols_sorgam, ONLY: sum_pm_sorgam
| 1
Fatal Error: Cannot open module file ‘module_aerosols_sorgam.mod’ for reading at (1): No such file or directory
compilation terminated.
Command exited with non-zero status 1
12.24user 0.16system 0:12.49elapsed 99%CPU (0avgtext+0avgdata 325380maxresident)k
0inputs+8outputs (0major+47155minor)pagefaults 0swaps
make[2]: [../configure.wrf:364: start_em.o] Error 1 (ignored)
 
Hi, Thanks for your reply. I have checked that again, I think maybe I found the error, there is a mod in WRFChem called module_aerosols_sorgam.F and My compiler is :
GNU Fortran (GCC) 11.4.1 20231218 (Red Hat 11.4.1-3)
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.

I test using WRF 4.6.0, 4.4, 4.3.1 and each time, the only problem is I can not compile this file to mod . I tried to compile this file separately and here shows many error and warning for that in compile.log. I am not sure is that a bug for gfortran compile WRF-Chem or not, because I use same env compile WRF and WPS correctly.
 

Attachments

  • module_aerosols_sorgam.F
    321.7 KB · Views: 1
  • compile.log
    328.4 KB · Views: 1
the linux distro for this drive is ubuntu-22.04 you can try open that using wsl or vm
Thank you so much for the patient reply. you really help me a lot. But I am a beginner for WRF-Chem, also I am not sure how to check that, even I am not manager in my server, so.. sorry about that.
 
I am trying to compile WRF-Chem verison 4.6.0 in HPC by using GNU compiler. During the time of compilation few modules where missing. And how to check the FLEX_LIB_DIR path .If someone could help me that will be great add on for my work. Here i am attaching the log files.
 

Attachments

  • wrfchem_compile.log
    1.3 MB · Views: 1
  • bashrc2.png
    bashrc2.png
    89.6 KB · Views: 2
  • bashrc1.png
    bashrc1.png
    172.8 KB · Views: 2
I am trying to compile WRF-Chem verison 4.6.0 in HPC by using GNU compiler. During the time of compilation few modules where missing. And how to check the FLEX_LIB_DIR path .If someone could help me that will be great add on for my work. Here i am attaching the log files.
do you already change all the typo on your bash script? looks like theres so many typo in it, send your bashrc file here
 
do you already change all the typo on your bash script? looks like theres so many typo in it, send your bashrc file here
export CC=gcc
export FC=gfortran
export F90=gfortran
export CXX=g++
export CFLAGS="-fPIC -fPIE -O3 "
export FFLAGS="$fallow_argument -m64"
export FCFLAGS="$fallow_argument -m64"
export F77=gfortran
export fallow_argument=-fallow-argument-mismatch
export boz_argument=-fallow-invalid-boz

export WRF_FOLDER=~/Purnima/Build_WRF
export DIR=~/Purnima/Build_WRF/LIBS
export PATH=$DIR/MPICH/bin:$PATH
export MPIFC=$DIR/MPICH/bin/mpifort
export MPIF77=$DIR/MPICH/bin/mpifort
export MPIF90=$DIR/MPICH/bin/mpifort
export MPICC=$DIR/MPICH/bin/mpicc
export MPICXX=$DIR/MPICH/bin/mpicxx
export JASPERLIB=$DIR/grib2/lib
export JASPERINC=$DIR/grib2/include
export HDF5=$DIR/grib2
export PHDF5=$DIR/grib2
export LD_LIBRARY_PATH=$DIR/grib2/lib:$LD_LIBRARY_PATH
export PNETCDF=$DIR/grib2

export PATH=$DIR/NETCDF/bin:$PATH
export NETCDF=$DIR/NETCDF
export LD_LIBRARY_PATH=$DIR/NETCDF/lib:$LD_LIBRARY_PATH
export CPPFLAGS="-I$DIR/NETCDF/include -I$DIR/grib2/include"
export LDFLAGS="-L$DIR/NETCDF/lib -L$DIR/grib2/lib"
export LIBS="-lnetcdf -lpnetcdf -lcurl -lhdf5_hl -lhdf5 -lz -lm -ldl -lgcc -lgfortran"
export FCFLAGS="$fallow_argument -m64"

#---------------------------------------------------------------------------------------------
#WRF and WRF-Chem settings
#---------------------------------------------------------------------------------------------
export WRFIO_NCD_NO_LARGE_FILE_SUPPORT=1

export WRF_CHEM=1
export WRF_NMM_CORE=0
export WRF_EM_CORE=1
export WRF_KPP=1


#-----------------------------------------------------------------------------------------------
#FLEX
#----------------------------------------------------------------------------------------------
export FLEX=/usr/bin/flex
export KPP HOME=/u/sgunthe/Purnima/Build_WRF/WRFV4.5/chem/KPP/kpp/kpp-2.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
#export WRF_DIR=$WRF_FOLDER/WRFV4.5


This is my bash file . In the bashrc file i have exported all the library command and the flex 2.6.4 .Here i am getting another error like no libfl.a and libfl.so. Can you please suggest me how to install that libfl.a and libfl.so in my hpc. And few modules are also missing.

Thank you
 

Attachments

  • wrfchem_compile.log
    1.3 MB · Views: 0
  • error.png
    error.png
    206.3 KB · Views: 1
Last edited:
after look your script and error, i see you use wrfv4.6, i think we can make the script more simple, also make sure you make the right path on bashrc, mostly libfl error because of wrong path, also you can install this too

sudo apt install -y tcsh git libcurl4-openssl-dev
sudo apt install -y make gcc cpp gfortran openmpi-bin libopenmpi-dev
sudo apt install libtool automake autoconf make m4 default-jre default-jdk csh ksh git ncview ncl-ncarg build-essential unzip mlocate byacc flex
sudo apt install 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

#directory
export DIR=~/Purnima/Build_WRF/LIBS
# mpich
export PATH=$DIR/mpich/bin:$PATH
# hdf5
export PATH=$DIR/hdf5/bin:$PATH
export LD_LIBRARY_PATH=$DIR/hdf5/lib:$LD_LIBRARY_PATH
# netcdf
export PATH=$DIR/netcdf/bin:$PATH
export NETCDF=$DIR/netcdf
export LD_LIBRARY_PATH=$NETCDF/lib:$LD_LIBRARY_PATH
# libpng
export LD_LIBRARY_PATH=$DIR/libpng/lib:$LD_LIBRARY_PATH
# jasper
export PATH=$DIR/jasper/bin:$PATH
export LD_LIBRARY_PATH=$DIR/jasper/lib:$LD_LIBRARY_PATH
export JASPERLIB=$DIRjasper/lib
export JASPERINC=$DIR/jasper/include

#for_chem_install
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
 
I am trying to compile WRF-Chem verison 4.6.0 in HPC by using GNU compiler. During the time of compilation few modules where missing. And how to check the FLEX_LIB_DIR path .If someone could help me that will be great add on for my work. Here i am attaching the log files.
btw i also got error at first compile, just re compile em_real, sometimes it works, also you can try to compile convert emiss to see that chem really got install or not
 
Top