Scheduled Downtime
On Tuesday 24 October 2023 @ 5pm MT the forums will be in read only mode in preparation for the downtime. On Wednesday 25 October 2023 @ 5am MT, this website will be down for maintenance and expected to return online later in the morning.
Normal Operations
The forums are back online with normal operations. If you notice any issues or errors related to the forums, please reach out to help@ucar.edu

How to build interpic_new on Derecho

James King

James King
Member
Hi all,

I need to regrid a CAM IC file onto a regionally-refined CAM-SE grid for use in MUSICA. The file I am trying to regrid is:

/glade/campaign/acom/acom-weather/MUSICA/init/ne30_ne30/f.e22.FCnudged.ne30_ne30_mg17.release-cesm2.2.0_spinup.2010_2020.001.cam.i.2019-01-01-00000.nc

In order to do this, I need to build the 'interpic' executable on Derecho (as my old builds from Cheyenne days no longer seem to work). The readme says all I need to do is run gmake in the 'interpic_new' directory, but when I try this I get a load of errors which all look like this:

ld: wrap_nf.o: in function `wrap_inq_attname_':
/glade/work/jamesking/cesm2_2_derecho/components/cam/tools/interpic_new/wrap_nf.F90:302: undefined reference to `nf_inq_attname_'
ld: wrap_nf.o: in function `wrap_get_att_text_':
/glade/work/jamesking/cesm2_2_derecho/components/cam/tools/interpic_new/wrap_nf.F90:316: undefined reference to `nf_get_att_text_'
ld: wrap_nf.o: in function `wrap_copy_att_':
/glade/work/jamesking/cesm2_2_derecho/components/cam/tools/interpic_new/wrap_nf.F90:330: undefined reference to `nf_copy_att_'
gmake: *** [Makefile:116: interpic] Error 1


I had a similar problem before with a CLM tool, which I was able to compile following Peter Lawrence's fix here. However, trying this with interpic_new doesn't make any difference. I don't know enough about the various compiler/environment changes between Cheyenne and Derecho to understand the errors. How can I compile this code?

Thanks,

James
 

James King

James King
Member
Hi James, did you fix that issue? If so, may I know how cause I am facing the same problem. Many thanks.
Hi,

I did - it runs on Derecho having been compiled on Casper. Passing on the following instructions from Francis Vitt:

Load modules:

Currently Loaded Modules:
1) ncarenv/23.10 (S) 2) intel/2023.2.1 3) ncarcompilers/1.0.0 4) hdf5/1.12.2 5) netcdf/4.9.2


and make these changes to Makefile:

diff --git a/tools/interpic_new/Makefile b/tools/interpic_new/Makefile
index cd43e9fd..def73449 100644
--- a/tools/interpic_new/Makefile
+++ b/tools/interpic_new/Makefile
@@ -12,10 +12,10 @@ RM = rm
# Check whether NetCDF library and include directories specified in environment
# or on make commandline.
ifeq ($(strip $(LIB_NETCDF)),)
- LIB_NETCDF := /usr/local/lib
+ LIB_NETCDF := $(NETCDF)/lib
endif
ifeq ($(strip $(INC_NETCDF)),)
- INC_NETCDF := /usr/local/include
+ INC_NETCDF := $(NETCDF)/include
endif

# Determine platform
@@ -96,7 +96,7 @@ ifeq ($(UNAMES),Linux)
FC = ifort
FFLAGS = -c -I$(INC_NETCDF) -g -check all -fpe0 -traceback -ftz -convert big_endian -fp-model precise

-LDFLAGS = -L$(LIB_NETCDF) -lnetcdf
+LDFLAGS = -L$(LIB_NETCDF) -lnetcdff -lnetcdf
endif
 

atmospherics

atmospherics
New Member
Hi,

I did - it runs on Derecho having been compiled on Casper. Passing on the following instructions from Francis Vitt:

Load modules:

Currently Loaded Modules:
1) ncarenv/23.10 (S) 2) intel/2023.2.1 3) ncarcompilers/1.0.0 4) hdf5/1.12.2 5) netcdf/4.9.2


and make these changes to Makefile:

diff --git a/tools/interpic_new/Makefile b/tools/interpic_new/Makefile
index cd43e9fd..def73449 100644
--- a/tools/interpic_new/Makefile
+++ b/tools/interpic_new/Makefile
@@ -12,10 +12,10 @@ RM = rm
# Check whether NetCDF library and include directories specified in environment
# or on make commandline.
ifeq ($(strip $(LIB_NETCDF)),)
- LIB_NETCDF := /usr/local/lib
+ LIB_NETCDF := $(NETCDF)/lib
endif
ifeq ($(strip $(INC_NETCDF)),)
- INC_NETCDF := /usr/local/include
+ INC_NETCDF := $(NETCDF)/include
endif

# Determine platform
@@ -96,7 +96,7 @@ ifeq ($(UNAMES),Linux)
FC = ifort
FFLAGS = -c -I$(INC_NETCDF) -g -check all -fpe0 -traceback -ftz -convert big_endian -fp-model precise

-LDFLAGS = -L$(LIB_NETCDF) -lnetcdf
+LDFLAGS = -L$(LIB_NETCDF) -lnetcdff -lnetcdf
endif
Thanks a lot! That really helps.
 
Top