#----------------------------------------------------------------------- # Makefile for the poe_initialprblty program # # Revision History: # Date Programmer Description # ---- ---------- ----------- # 04/06/2008 J. Gross, NHC Created from awipsprblty Makefile. # 12/26/2012 A. Krautkramer, NHC Transfer to WCOSS. # 05/30/2013 M. DeMaria, NHC Update dataio routines. Newer # routines include upcase and lcase # so those do not need to be compiled # separately. Also, read_edeck.f # compiled as a separate subroutine # rather then being included in main # poe program. This of read_edeck # fixes the problem with column 4 of # new e-deck format. # 04/10/2016 C. Mattocks, NHC Added choice of compilers. # Created local test run capability. # 04/11/2016 C. Mattocks, NHC Reverted to old WCOSS compiler # flags and LIBS. Commented-out # 'install' and 'run' targets, # stripping of symbol tables. # 02/15/2017 C. Mattocks, NHC Reactivate 'install' target. #----------------------------------------------------------------------- # -------------------- # Define default shell # -------------------- SHELL = /bin/sh #------------ # Directories #------------ TOP_DIR=../.. SRC_DIR=${TOP_DIR}/sorc/prob_single_storm.fd EXE_DIR=${TOP_DIR}/exec RUN_DIR=${TOP_DIR}/run INP_DIR=${TOP_DIR}/parm # ------------------------------ # Source/Object/Executable files # ------------------------------ SRCM = prob_single_storm.f90 OBJM = prob_single_storm.o INCM = SRCS = dataio.f read_edeck.f splsubs.f90 mc_prob.f90 OBJS = dataio.o read_edeck.o splsubs.o mc_prob.o CMD = prob_single_storm.x # ------------------------- # Compiler / linker / flags # ------------------------- # COMP=intel COMP=cray # COMP=pgi # COMP=gnu ifeq ($(COMP),intel) FC = ifort FFLAGS = -g -O1 -heap-arrays -align all -static-intel -w LDFLAGS = DEBUG = -ftrapuv -check all -traceback -g else ifeq ($(COMP),cray) FC = ftn # FFLAGS = -g -O1 -heap-arrays -align all -static-intel -w FFLAGS = -g -O1 -heap-arrays -align all -w LDFLAGS = DEBUG = -ftrapuv -check_all -traceback -g else ifeq ($(COMP),pgi) FC = pgf90 FFLAGS = -m32 -nomp -O4 -fastsse -Mipa=fast,inline -Bstatic_pgi -w LDFLAGS = DEBUG= else FC = gfortran FFLAGS = -m64 -Ofast -mavx -funroll-loops -w # FFLAGS = -O0 -g -fbacktrace -ffpe-trap=invalid,zero,overflow,underflow -Wall -Wextra -pedantic LDFLAGS = DEBUG = -g -Wall -pedantic -fbounds-check -ffpe-trap=invalid,overflow,zero endif # --------- # Libraries # --------- # LIBS = -lessl -L/nwprod/lib -lbacio_4 -lip_4 -lsp_4 -lw3_4 # LIBS = -L/nwprod/lib -lbacio_4 -lip_4 -lsp_4 -lw3nco_4 LIBS = # ------------------------- # Strip symbol tables to # reduce size of executable # ------------------------- STRIP = strip -s # STRIP = strip -x # ======= # Targets # ======= all: $(CMD) debug: FFLAGS += $(DEBUG) debug: all # ---------------- # Build executable # ---------------- $(CMD): $(SRCM) $(OBJS) $(FC) $(FFLAGS) $(LDFLAGS) $(SRCM) $(OBJS) $(LIBS) -o $(CMD) # $(FC) $(FFLAGS) $(LDFLAGS) $(SRCM) $(OBJS) $(LIBS) -o $(CMD); \ # $(STRIP) $(CMD) # ------- # Install # ------- install: all mkdir -p $(EXE_DIR); cp -f $(SRC_DIR)/$(CMD) $(EXE_DIR)/ # -------- # Clean up # -------- clean: -rm -f $(OBJM) $(OBJS) *.oo *.mod clobber: clean -rm -f $(CMD) $(EXE_DIR)/$(CMD) # ------------ # Dependencies # ------------ dataio.o: dataformats.inc dataioparms.inc dataio.f $(FC) -c $(FFLAGS) dataio.f read_edeck.o: dataformats.inc read_edeck.f $(FC) -c $(FFLAGS) read_edeck.f splsubs.o: splsubs.f90 $(FC) -c $(FFLAGS) splsubs.f90 mc_prob.o: mc_prob.f90 $(FC) -c $(FFLAGS) mc_prob.f90