arw2arl compilation error

General questions and postings pertaining to the use of HYSPLIT regardless of the platform. For platform specific questions, use the HYSPLIT Platform forums.
Post Reply
SMM
Posts: 3
Joined: September 28th, 2023, 6:33 pm
Registered HYSPLIT User: No

arw2arl compilation error

Post by SMM »

Hello everyone.

I'm facing an error compilation with arw2arl and I couldn't find any solution on the forum.
I'm using LINUX 22.04, the installation of HYSPLIT was made with gfortran 11.04.

After following some tutorial examples I decided to convert my wrfout files to ARL in order to simulate some particles but the Convert to ARL -> WRF-ARW utility does not work, then I noticed that the exc arw2arl is not created (not in the exec directory or arw2arl directory).
I used NetCDF 4.8.0 for all the compilations. First I thought it was a problem with the NetCDF libraries, but maybe is something else.

This is the error after type make:
gfortran -o ../../exec/arw2arl -O2 -fconvert=big-endian -frecord-marker=4 -fPIC -falign-commons -ffree-form -I/usr/include arw2arl.f libarw.a -L/usr/lib/x86_64-linux-gnu -lnetcdff -L../../library -lhysplit
/usr/bin/ld: /tmp/cc4hMalA.o: en la función `MAIN__':
arw2arl.f:(.text+0xbcb): referencia a `getdim_' sin definir
/usr/bin/ld: arw2arl.f:(.text+0xdac): referencia a `setvar_' sin definir
/usr/bin/ld: arw2arl.f:(.text+0xe91): referencia a `get1dv_' sin definir
/usr/bin/ld: arw2arl.f:(.text+0xf65): referencia a `setvar_' sin definir
/usr/bin/ld: arw2arl.f:(.text+0x1041): referencia a `get2dv_' sin definir
/usr/bin/ld: arw2arl.f:(.text+0x1da7): referencia a `setvar_' sin definir
/usr/bin/ld: arw2arl.f:(.text+0x1e43): referencia a `setmap_' sin definir
/usr/bin/ld: arw2arl.f:(.text+0x1f12): referencia a `setvar_' sin definir
/usr/bin/ld: arw2arl.f:(.text+0x2186): referencia a `setvar_' sin definir
/usr/bin/ld: arw2arl.f:(.text+0x25c7): referencia a `setvar_' sin definir
/usr/bin/ld: arw2arl.f:(.text+0x4a9b): referencia a `setvar_' sin definir
/usr/bin/ld: arw2arl.f:(.text+0x4ad1): referencia a `get3dv_' sin definir
/usr/bin/ld: arw2arl.f:(.text+0x4dd3): referencia a `setvar_' sin definir
/usr/bin/ld: arw2arl.f:(.text+0x4e0a): referencia a `get4dv_' sin definir
/usr/bin/ld: arw2arl.f:(.text+0x5ad2): referencia a `setvar_' sin definir
/usr/bin/ld: arw2arl.f:(.text+0x5c27): referencia a `get4dv_' sin definir
/usr/bin/ld: arw2arl.f:(.text+0x657b): referencia a `get4dv_' sin definir
/usr/bin/ld: arw2arl.f:(.text+0x7829): referencia a `setvar_' sin definir
/usr/bin/ld: arw2arl.f:(.text+0x785f): referencia a `get3dv_' sin definir
/usr/bin/ld: arw2arl.f:(.text+0x7be1): referencia a `setvar_' sin definir
/usr/bin/ld: arw2arl.f:(.text+0x7c17): referencia a `get3dv_' sin definir
/usr/bin/ld: arw2arl.f:(.text+0x8262): referencia a `get4dv_' sin definir
/usr/bin/ld: arw2arl.f:(.text+0x8953): referencia a `get4dv_' sin definir
/usr/bin/ld: arw2arl.f:(.text+0x8abe): referencia a `setvar_' sin definir
/usr/bin/ld: arw2arl.f:(.text+0x8aea): referencia a `get4dv_' sin definir
/usr/bin/ld: arw2arl.f:(.text+0x8ed6): referencia a `setvar_' sin definir
/usr/bin/ld: arw2arl.f:(.text+0x8f0c): referencia a `get3dv_' sin definir
/usr/bin/ld: arw2arl.f:(.text+0x9e83): referencia a `setvar_' sin definir
/usr/bin/ld: arw2arl.f:(.text+0x9eb9): referencia a `get3dv_' sin definir
/usr/bin/ld: arw2arl.f:(.text+0xa45b): referencia a `setvar_' sin definir
/usr/bin/ld: arw2arl.f:(.text+0xa4a5): referencia a `get3dv_' sin definir
/usr/bin/ld: arw2arl.f:(.text+0xa83b): referencia a `setvar_' sin definir
/usr/bin/ld: arw2arl.f:(.text+0xa87b): referencia a `get3dv_' sin definir
/usr/bin/ld: arw2arl.f:(.text+0xda55): referencia a `setvar_' sin definir
/usr/bin/ld: arw2arl.f:(.text+0xdb38): referencia a `setvar_' sin definir
/usr/bin/ld: arw2arl.f:(.text+0xdc1a): referencia a `setvar_' sin definir
/usr/bin/ld: arw2arl.f:(.text+0xdcfc): referencia a `setvar_' sin definir
/usr/bin/ld: arw2arl.f:(.text+0xdde1): referencia a `setvar_' sin definir
/usr/bin/ld: /tmp/cc4hMalA.o:arw2arl.f:(.text+0xdea7): más referencias a `setvar_' sin definir a continuación
collect2: error: ld returned 1 exit status
make: *** [Makefile:55: arw2arl] Error 1


This is the content of the arw2arl makefile:
#------------------------------------------------------------------
# Makefile for the ../data2arl/arw2arl data converter
# Last Revised: 28 Jan 2007
# 09 Aug 2007 - support for gfortran
# 16 May 2013 - use netcdff for version 4
# 25 Aug 2014 - netCDF libaries previously exported
# 23 Aug 2019 - moved compiler options and library
# definitions to ../../Makefile.inc
# 26 Aug 2019 - redefined NETINC and NETLIBS.
#------------------------------------------------------------------

include ../../Makefile.inc
# ../Makefile.inc should define the following variables:
# NETINC - compiler flag for the NetCDF include files
# NETLIBS - linker flags for the NetCDF library

SHELL = /bin/sh
PGM = arw2arl
EXE = ../../exec
LIB = libarw.a

# exported in calling script
NETINC = -I/usr/include
NETLIBS = -L/usr/lib/x86_64-linux-gnu -lnetcdff


# library name for netCDF3=netcdf and for netCDF4=netcdff
LINKS = $(NETLIBS) -L../../library -lhysplit
# LINKS = -L$(NETLIBS) -lnetcdff -L../../library -lhysplit

LFLAGS = -vr

CODE = cfgrec.f \
cfgvar.f \
get1dv.f \
get2dv.f \
get3dv.f \
get4dv.f \
getdim.f \
setmap.f \
setvar.f

all : $(PGM)

$(LIB) : $(CODE)
for member in $?; do make member MODULE=$$member;done

member : $(MODULE)
$(FC) -c $(FFLAGS) $(FFLAGS_FREEFORM) $(NETINC) $?
$(AR) $(LFLAGS) $(LIB) $(?F:.f=.o)
ranlib $(LIB)
rm -f $(?F:.f=.o)

$(PGM) : $(PGM).f $(LIB)
$(FC) -o $(EXE)/$@ $(FFLAGS) $(FFLAGS_FREEFORM) $(NETINC) $? $(LINKS)
rm -f $(LIB)

clean :
rm -f $(EXE)/$(PGM)
rm -f $(LIB)

I've tried with the two LINKS options (commented and uncommented), and I have the same error.
Hope you can help me.
Thank you in advance.
sonny.zinn
Posts: 360
Joined: May 8th, 2019, 1:31 pm
Registered HYSPLIT User: Yes

Re: arw2arl compilation error

Post by sonny.zinn »

Could you modify the make file by adding "-larw" to LINKS and try again?

Code: Select all

LINKS = $(NETLIBS) -L../../library -lhysplit -larw
SMM
Posts: 3
Joined: September 28th, 2023, 6:33 pm
Registered HYSPLIT User: No

Re: arw2arl compilation error

Post by SMM »

Thank you for your recommendation, unfortunately does not work for me.

This is the new error with the change made:

gfortran -o ../../exec/arw2arl -O2 -fconvert=big-endian -frecord-marker=4 -fPIC -falign-commons -ffree-form -I/usr/include arw2arl.f libarw.a -L/usr/lib/x86_64-linux-gnu -lnetcdff -L../../library -lhysplit -larw
/usr/bin/ld: no se puede encontrar -larw: No existe el archivo o el directorio
collect2: error: ld returned 1 exit status
make: *** [Makefile:55: arw2arl] Error 1

Now I'm gonna uninstall and re-install the model, hope this action helps.
sonny.zinn
Posts: 360
Joined: May 8th, 2019, 1:31 pm
Registered HYSPLIT User: Yes

Re: arw2arl compilation error

Post by sonny.zinn »

It seems that the libarw.a target is not created. Have you created ../../Makefile.inc (relative to the arw2arl directory) and declared NETINC and NETLIBS? These specify the include and link options for NetCDF. For example, the followings are used on my computer:

Code: Select all

NETINC= -I/usr/include
NETLIBS= -L/usr/lib64 -lnetcdff
You might need to change the above to fit your NetCDF installation.
Post Reply

Return to “Users”