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

Error in compiling the prep_chem_sources code

Ankan

Member
Hello everyone,
I want to set up the executable file for PREP-CHEM-SRC (prep_chem_sources_RADM_WRF_FIM.exe) to prepare the chemistry input files for running WRF-Chem. For that, I have downloaded the tar.gz file 'prep_chem_sources_v1.5_24aug2015.tar.gz' from the WRF-Chem ftp site (ftp://aftp.fsl.noaa.gov/divisions/taq/global_emissions) as instructed in the WRF-Chem user's guide. After untaring the tar file, I change directories to the bin/build directory by giving the following command:
cd bin/build
And, after making necessary changes to the path in 'include.mk.gfortran' file, I gave the following command,

make OPT=gfortran.wrf CHEM=RADM_WRF_FIM

But, I am getting some errors (a complete error file is also attached for your convenience) in compiling the prep_chem_sources code:
use netcdf
1
Fatal Error: Can't open module file 'netcdf.mod' for reading at (1): No such file or directory
make: *** [gocart_background.o] Error 1
Also, if you look at the error file attached, you will see:
Warning: Nonexistent include directory "/scratchin/grupos/catt-brams/shared/libs/gfortran/netcdf-4.1.3/include"
I believe the error is due to the fact that it cannot locate the netcdf directory. But if you see the attached file ('include.mk.gfortran'), I changed the directory as per my system. Then why is it coming? Can anyone tell me? I also have some confusions about the NCAR Graphics portion:
# NCAR Graphics.

#---------------------------------------------------------------
# If you are using a standard installation of NCAR Graphics, set:
# LOADER=ncargf90
# in the machine-dependent sections below
#LIBNCARG=
#---------------------------------------------------------------
# If you are using the NCAR dummy libraries...

#NCARG_DIR=$(BASE)
#LIBNCARG=-L$(NCARG_DIR) -lncarg-$(UTILS_VERSION) -lncarg_c-$(UTILS_VERSION) \
# -lncarg_gks-$(UTILS_VERSION)
#LIBNCARG=-L$(NCARG_DIR) -lncarg-$(UTILS_VERSION)
#LIBNCARG=$(BASE)/libncarg-$(UTILS_VERSION)-$(OPT).a
#---------------------------------------------------------------
# If you are using a real distribution of NCAR Graphics...
NCARG_DIR=/home/maslab-3/GNULIBNEW/NCLNCARG/lib
#LIBNCARG=-L$(NCARG_DIR) -lncarg -lncarg_gks -lncarg_c -L/usr/X11R6/lib -lX11 -ldl
#---------------------------------------------------------------
How can I tell if I am using a real distribution of NCAR Graphics or dummy libraries? Is there any way to know that? I have checked that this file, 'ncl_ncarg-6.4.0-RHEL6.4_64bit_gnu447.tar.gz' is installed in my system. Then what should I use in the path? Is it necessary to set the path of LIBNCARG? If so, then what would be the correct command line to give in my case? Is it necessary to include "-L/usr/X11R6/lib -lX11 -ldl" in this line? Can anyone guide me in this regard? Any help on this would be greatly appreciated. Thank you.
With regards,
Ankan
 

Attachments

  • error_compilingprepchem.txt
    25.3 KB · Views: 5
  • include.mk.gfortran_prepchem.txt
    2.8 KB · Views: 2
Last edited:
Hello everyone,
I want to set up the executable file for PREP-CHEM-SRC (prep_chem_sources_RADM_WRF_FIM.exe) to prepare the chemistry input files for running WRF-Chem. For that, I have downloaded the tar.gz file 'prep_chem_sources_v1.5_24aug2015.tar.gz' from the WRF-Chem ftp site (ftp://aftp.fsl.noaa.gov/divisions/taq/global_emissions) as instructed in the WRF-Chem user's guide. After untaring the tar file, I change directories to the bin/build directory by giving the following command:
cd bin/build
And, after making necessary changes to the path in 'include.mk.gfortran' file, I gave the following command,

make OPT=gfortran.wrf CHEM=RADM_WRF_FIM

But, I am getting some errors (a complete error file is also attached for your convenience) in compiling the prep_chem_sources code:
use netcdf
1
Fatal Error: Can't open module file 'netcdf.mod' for reading at (1): No such file or directory
make: *** [gocart_background.o] Error 1
Also, if you look at the error file attached, you will see:
Warning: Nonexistent include directory "/scratchin/grupos/catt-brams/shared/libs/gfortran/netcdf-4.1.3/include"
I believe the error is due to the fact that it cannot locate the netcdf directory. But if you see the attached file ('include.mk.gfortran'), I changed the directory as per my system. Then why is it coming? Can anyone tell me? I also have some confusions about the NCAR Graphics portion:
# NCAR Graphics.

#---------------------------------------------------------------
# If you are using a standard installation of NCAR Graphics, set:
# LOADER=ncargf90
# in the machine-dependent sections below
#LIBNCARG=
#---------------------------------------------------------------
# If you are using the NCAR dummy libraries...

#NCARG_DIR=$(BASE)
#LIBNCARG=-L$(NCARG_DIR) -lncarg-$(UTILS_VERSION) -lncarg_c-$(UTILS_VERSION) \
# -lncarg_gks-$(UTILS_VERSION)
#LIBNCARG=-L$(NCARG_DIR) -lncarg-$(UTILS_VERSION)
#LIBNCARG=$(BASE)/libncarg-$(UTILS_VERSION)-$(OPT).a
#---------------------------------------------------------------
# If you are using a real distribution of NCAR Graphics...
NCARG_DIR=/home/maslab-3/GNULIBNEW/NCLNCARG/lib
#LIBNCARG=-L$(NCARG_DIR) -lncarg -lncarg_gks -lncarg_c -L/usr/X11R6/lib -lX11 -ldl
#---------------------------------------------------------------
How can I tell if I am using a real distribution of NCAR Graphics or dummy libraries? Is there any way to know that? I have checked that this file, 'ncl_ncarg-6.4.0-RHEL6.4_64bit_gnu447.tar.gz' is installed in my system. Then what should I use in the path? Is it necessary to set the path of LIBNCARG? If so, then what would be the correct command line to give in my case? Is it necessary to include "-L/usr/X11R6/lib -lX11 -ldl" in this line? Can anyone guide me in this regard? Any help on this would be greatly appreciated. Thank you.
With regards,
Ankan
Here are a few helpful links.



Looking at your log file it appears that your libraries are not in the $PATH and $LD_LIBRARY_PATH. Double check that they are there and make sure you have the correct linkers.
 
Hi @Whatheway,
Thank you for your response. I double checked the '$PATH' and '$LD_LIBRARY_PATH' in '.bashrc' file for my system, and the paths are okay. Now, what I learned is that last time I changed the path in 'include.mk.gfortran' file, not in 'include.mk.gfortran.wrf' file. So, this time I changed the path in 'include.mk.gfortran.wrf' file, and I think that path problem is solved. But, again another error came (complete version of error is also attached).
edgar_emissions.f90:841.15:

'AGRICULTURE',&
1
Error: Different CHARACTER lengths (11/6) in array constructor at (1)
edgar_emissions.f90:894.61:

filename=trim(edgar_data_dir)//"/"//trim(PREFIX)//trim(setor(isetor))//tr
1
Error: Function 'setor' at (1) has no IMPLICIT type
edgar_emissions.f90:916.16:

if(trim(setor(isetor)) .eq. 'AGRICULTURE' .and. trim(spc_name(ispc)) .n
1
Error: Function 'setor' at (1) has no IMPLICIT type
edgar_emissions.f90:923.30:

print*,trim(setor(isetor))," ",trim(dsetname),i, " MAX ",ma
1
Error: Function 'setor' at (1) has no IMPLICIT type
edgar_emissions.f90:924.30:

print*,trim(setor(isetor))," ",trim(dsetname),i, " MIN ",mi
1
Error: Function 'setor' at (1) has no IMPLICIT type
make: *** [edgar_emissions.o] Error 1
Can you tell me why the error is occurring now? Also, I have some confusions about the path for 'NCAR Graphics' portion, as I said earlier. In the documentation given on the BRAMS website (a screenshot is also attached with the highlighted portion for your convenience), there is no mention of changing the paths for the NCAR Graphics portion. It is said to change only the paths associated with the netcdf, hdf5, and zlib libraries. Is it mandatory to give path for NCAR Graphics then? If it is compulsory, then where and how should I change the path in the NCAR Graphics portion below (the changed line for my case during the editing of 'include.mk.gfortran.wrf' file is also shown in bold for your convenience)?

# NCAR Graphics.

#---------------------------------------------------------------
# If you are using a standard installation of NCAR Graphics, set:
# LOADER=ncargf90
# in the machine-dependent sections below
#LIBNCARG=
#---------------------------------------------------------------
# If you are using the NCAR dummy libraries...

NCARG_DIR=/home/maslab-3/GNULIBNEW/NCLNCARG/lib
#LIBNCARG=-L$(NCARG_DIR) -lncarg-$(UTILS_VERSION) -lncarg_c-$(UTILS_VERSION) \
# -lncarg_gks-$(UTILS_VERSION)
#LIBNCARG=-L$(NCARG_DIR) -lncarg-$(UTILS_VERSION)
#LIBNCARG=$(BASE)/libncarg-$(UTILS_VERSION)-$(OPT).a
#---------------------------------------------------------------
# If you are using a real distribution of NCAR Graphics...
#NCARG_DIR=/usr/local/ncarg-4.3.0/lib
#LIBNCARG=-L$(NCARG_DIR) -lncarg -lncarg_gks -lncarg_c -L/usr/X11R6/lib -lX11 -ldl
#---------------------------------------------------------------
Another question is which command line should I use for compiling PREP-CHEM-SRC?
'make OPT=gfortran.wrf CHEM=RADM_WRF_FIM'
or
'make OPT=gfortran.wrf CHEM=RADM_WRF_FIM AER=SIMPLE'?
Can you please guide me on this regard? It will be very helpful for me.
Thanking you,
Ankan
 

Attachments

  • prepchem_brams.JPG
    prepchem_brams.JPG
    65.1 KB · Views: 10
  • error_prepchemcompilation.txt
    21.1 KB · Views: 4
Last edited:
 
Dear William Hatheway,
Thank you for your very helpful scripts.

I would like to mention that I first tried "prep_chem_sources_v1.5_24aug2015.tar.gz", which I downloaded from "ftp://aftp.fsl.noaa.gov/divisions/taq/global_emissions/". However, it caused me some trouble, as I mentioned in my previous posts. Then I tried "PREP-CHEM-SRC-1.5.tar.gz" from "Downloads". This worked well.
I have made the following changes in "include.mk.gfortran.wrf":

NETCDF=/usr
HDF5=/usr
HDF5_LIB=-L$(HDF5)/lib -lhdf5hl_fortran -lhdf5_fortran -lhdf5_hl -lhdf5 -ldl -L/usr -lz -ldl
F_OPTS= -Xpreprocessor -D$(CHEM) -O2 -fconvert=big-endian -frecord-marker=4 -fallow-argument-mismatch

Therefore, I think the file in the first link (ftp) has some bugs. I recommend using the second link (brams).


Sincerely,
Ehsan
 
Top