era52arl compile issue

Post questions and find resources to convert meteorological data into a format HYSPLIT can read.
Post Reply
draba914
Posts: 5
Joined: December 9th, 2022, 10:44 am
Registered HYSPLIT User: No

era52arl compile issue

Post by draba914 »

Hi,
I am trying to work with era52arl and am currently at the stage of installing eccodes.
I have installed my eccodes at /opt/eccodes and followed through the explanation on viewtopic.php?f=14&t=2141&p=7413&hilit=makefile#p7413 already. However, I am still getting the error message of "Cannot open module file ‘eccodes.mod’ for reading at (1): No such file or directory" when compiling with

Code: Select all

gfortran -o era52arl era52arl.f90
This is my /opt/eccodes folder:
Screenshot 2023-04-17 002613.png
This is what I have for my make file:

Code: Select all

include ../../Makefile.inc

EXE=../../exec
PGM=era52arl

ECCODES_TOPDIR= /opt/eccodes
ECCODESINC= -I/opt/eccodes/include
ECCODESLIBS= -L/opt/eccodes/lib -libeccodes_f90.so -libeccodes.so
FC=gfortran
FFLAGS_FREEFORM= -ffree-form
FFLAGS=$(OPTIMIZATION) -fconvert=big-endian -frecord-marker=4 -fPIC -falign-commons -finit-local-zero

LIBHYS = -L../../library -lhysplit

FCFLAGS = -g $(FFLAGS) $(FFLAGS_FREEFORM)

api2arl_DEPENDENCIES =  \
	$(ECCODES_TOPDIR)/lib/libeccodes_f90.so \
	$(ECCODES_TOPDIR)/lib/libeccodes.so
FCCOMPILE = $(FC) $(ECCODESINC) $(FCFLAGS)
FCLD = $(FC)
FCLINK = $(FCLD) $(FCFLAGS) $(AM_LDFLAGS) \
	 $(LDFLAGS) -o $(EXE)/$@

.SUFFIXES:
.SUFFIXES: .f .lo .o .obj

$(PGM): $(PGM).o $(api2arl_DEPENDENCIES) 
	@rm -f $(PGM)
	$(FCLINK) $(PGM).o $(ECCODESLIBS) $(LIBHYS)


.f.o:
	$(FCCOMPILE) -c -o $@ $<  

clean :
	 rm -f $(EXE)/apidump
	 rm -f $(EXE)/$(PGM)
	 rm -f *.o
What edits should I make?
sonny.zinn
Posts: 360
Joined: May 8th, 2019, 1:31 pm
Registered HYSPLIT User: Yes

Re: era52arl compile issue

Post by sonny.zinn »

The era52arl program is built by running the make command, not by directly running the gfortran compiler. The make command will invoke the compiler with necessary options as specified by Makefile. I suppose you are building era52arl using the files in the data2arl/era52arl directory. A few things that caught my eyes are:

1) The Makefile file is meant to be used as is, without modification.

2) Create or modify Makefile.inc in the ../.. directory as explained in the other forum post. This ../../Makefile.inc will be included by the above Makefile.

3) Check if eccodes.mod exists in your /opt/eccodes/include directory. If it is missing, you might want to double check your ECCODES installation.
draba914
Posts: 5
Joined: December 9th, 2022, 10:44 am
Registered HYSPLIT User: No

Re: era52arl compile issue

Post by draba914 »

Thank you! It worked after I created the Makefile.inc document. When I was reading through the other posts, I thought the Makefile showing up in the folder is the same as the Makefile.inc.
Post Reply

Return to “Conversion programs”