Skip to content

Commit

Permalink
Merge 'origin/whannah/atm/update-cube_to_target-Makefile' (PR #6463)
Browse files Browse the repository at this point in the history
Clean up and simplify the Makefile for the cube_to_target
topography generation tool.

[BFB]
  • Loading branch information
oksanaguba committed Jul 22, 2024
2 parents cd4d69a + 7c2557d commit 56a4568
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 39 deletions.
49 changes: 11 additions & 38 deletions components/eam/tools/topo_tool/cube_to_target/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,54 +5,27 @@ 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
# Set the compiler
FC := gfortran

# Check for the NetCDF library and include directories
ifeq ($(LIB_NETCDF),$(null))
LIB_NETCDF := /usr/local/lib
endif

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 -lcurl -lhdf5 -lhdf5_hl -mcmodel=medium
LDFLAGS = -L$(LIB_NETCDF) -lnetcdf -lnetcdff -lcurl
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)
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) $<
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1489,7 +1489,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
Expand Down

0 comments on commit 56a4568

Please sign in to comment.