From 4924d1d239a1aa79760dd1189e9ca51e765c0764 Mon Sep 17 00:00:00 2001 From: Walter Hannah Date: Mon, 10 Jun 2024 16:04:32 -0500 Subject: [PATCH 1/3] update Makefile for cube_to_target --- .../tools/topo_tool/cube_to_target/Makefile | 23 +------------------ 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/components/eam/tools/topo_tool/cube_to_target/Makefile b/components/eam/tools/topo_tool/cube_to_target/Makefile index 5a1f386b819d..98ace1a4f5bc 100644 --- a/components/eam/tools/topo_tool/cube_to_target/Makefile +++ b/components/eam/tools/topo_tool/cube_to_target/Makefile @@ -24,35 +24,14 @@ endif # Set default compile and link flags FFLAGS = -L$(LIB_NETCDF) -I$(INC_NETCDF) -#LDFLAGS = -L$(LIB_NETCDF) -lnetcdf -lnetcdff -lcurl -lhdf5 -lhdf5_hl -mcmodel=medium -LDFLAGS = -L$(LIB_NETCDF) -lnetcdf -lnetcdff -lcurl +LDFLAGS = -L$(LIB_NETCDF) -lnetcdf -lnetcdff # Determine platform UNAMES := $(shell uname -s) UNAMEM := $(findstring CRAY,$(shell uname -m)) #------------------------------------------------------------------------ -# Special flags for LF95 #------------------------------------------------------------------------ -# -ifeq ($(FC),lf95) - # - # Tramhill - # - INC_NETCDF :=/usr/local/netcdf-4.1.3-gcc-4.4.4-13-lf9581/include - LIB_NETCDF :=/usr/local/netcdf-4.1.3-gcc-4.4.4-13-lf9581/lib - - LDFLAGS = -L$(LIB_NETCDF) -lnetcdf -lnetcdff -lcurl -lhdf5 -lhdf5_hl --mcmodel=medium - FFLAGS := -c --trace --trap --wide -CcdRR8 -I$(INC_NETCDF) - ifeq ($(DEBUG),TRUE) - #FFLAGS += --chk aesu -Cpp --trace - FFLAGS += -g --chk a,e,s,u --pca - else - FFLAGS += -O - endif - -endif .F90.o: $(FC) -c $(FFLAGS) $< From 47746069761e12fee44c6cfff72c65594ae4a4a4 Mon Sep 17 00:00:00 2001 From: Walter Hannah Date: Tue, 11 Jun 2024 13:30:49 -0700 Subject: [PATCH 2/3] update variable intent --- .../eam/tools/topo_tool/cube_to_target/cube_to_target.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/eam/tools/topo_tool/cube_to_target/cube_to_target.F90 b/components/eam/tools/topo_tool/cube_to_target/cube_to_target.F90 index 97d23fa8476f..850815efdbfc 100644 --- a/components/eam/tools/topo_tool/cube_to_target/cube_to_target.F90 +++ b/components/eam/tools/topo_tool/cube_to_target/cube_to_target.F90 @@ -1576,7 +1576,7 @@ SUBROUTINE overlap_weights(weights_lgr_index_all,weights_eul_index_all,weights_a REAL(R8), DIMENSION(jall,nreconstruction) , INTENT(OUT) :: weights_all INTEGER, DIMENSION(jall) , INTENT(OUT) :: weights_lgr_index_all - REAL(R8), DIMENSION(ncorner,ntarget), INTENT(IN) :: target_corner_lon, target_corner_lat + REAL(R8), DIMENSION(ncorner,ntarget), INTENT(INOUT) :: target_corner_lon, target_corner_lat INTEGER, DIMENSION(ncorner+1) :: ipanel_array, ipanel_tmp REAL(R8), DIMENSION(ncorner) :: lat, lon From 7c2557dd47640b5b7c6d42ce7f48fcbe220f66a7 Mon Sep 17 00:00:00 2001 From: Walter Hannah Date: Tue, 11 Jun 2024 14:28:13 -0700 Subject: [PATCH 3/3] simplify Makefile some more --- .../tools/topo_tool/cube_to_target/Makefile | 28 ++++++++----------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/components/eam/tools/topo_tool/cube_to_target/Makefile b/components/eam/tools/topo_tool/cube_to_target/Makefile index 98ace1a4f5bc..72ffd73c2a43 100644 --- a/components/eam/tools/topo_tool/cube_to_target/Makefile +++ b/components/eam/tools/topo_tool/cube_to_target/Makefile @@ -5,26 +5,20 @@ RM = rm .SUFFIXES: .SUFFIXES: .F90 .o -# Set the compiler; note that on some platforms, FC may be defined as an -# environment variable, and we should not need to do anything here. If this -# is the case, skip setting FC, but if FC is null then set to a default. -ifeq ($(FC),$(null)) - FC = gfortran -endif -DEBUG = FALSE - -# Check for the NetCDF library and include directories -ifeq ($(LIB_NETCDF),$(null)) - LIB_NETCDF := /usr/local/lib -endif +# Set the compiler +FC := gfortran -ifeq ($(INC_NETCDF),$(null)) - INC_NETCDF := /usr/local/include -endif +# Set NetCDF library and include directories +LIB_NETCDF := $(shell nf-config --prefix)/lib +INC_NETCDF := $(shell nf-config --prefix)/include # Set default compile and link flags -FFLAGS = -L$(LIB_NETCDF) -I$(INC_NETCDF) -LDFLAGS = -L$(LIB_NETCDF) -lnetcdf -lnetcdff +FFLAGS += -L$(LIB_NETCDF) -I$(INC_NETCDF) +LDFLAGS += -L$(LIB_NETCDF) -lnetcdf -lnetcdff + +ifeq ($(FC),gfortran) + FFLAGS += -fallow-argument-mismatch +endif # Determine platform UNAMES := $(shell uname -s)