OBJS = module_sf_noahlsm.o \ module_model_constants.o \ module_sf_urban.o \ kwm_date_utilities.o \ module_netcdf_io.o \ module_io.o \ module_ascii_io.o \ module_Noahlsm_utility.o CMD = driver.exe urban_driver.exe graphics.exe INCLUDES = -I$(NETCDF)/include LIBS = -L$(NETCDF)/lib -lnetcdf NCARGLIBS = -L$(NCARG_ROOT)/lib -L/usr/X11R6/lib -lncarg -lncarg_gks -lncarg_c -lX11 -lXext RM = \rm -f CPP_DEFINES = # # On some linux machines, NCAR-Graphics seems to require the g2c library. # All that stuff with G2CNAME, G2CPATH, and G2CLIB is my attempt to find # out where that library resides. I don't know how robust this # investigation is (probably not very). If it's not working for you, # take it out and hard-code the G2CLIB variable, if necessary. # # # Choose your poison: # F90 = g95 # F90 = gfortran # F90 = pgf90 # F90 = ifort # F90 = xlf90 # # Options specific to pgf90 compiler: # ifeq ($(F90),pgf90) FFLAGS = -Mfree -g -C -O0 -Ktrap=fp G2CNAME = $(shell g77 -print-file-name=libg2c.a) G2CPATH = $(dir ${G2CNAME}) G2CLIB = -L${G2CPATH} -lg2c endif # # Options specific to g95 compiler: # ifeq ($(F90),g95) FFLAGS = -I. -ffree-form -ffree-line-length-huge -fbounds-check -g -O0 G2CNAME = $(shell g77 -print-file-name=libg2c.a) G2CPATH = $(dir ${G2CNAME}) G2CLIB = -L${G2CPATH} -lg2c endif # # Options specific to gfortran compiler: # ifeq ($(F90),gfortran) FFLAGS = -ffree-form -g -O0 -ffpe-trap=invalid,zero,overflow,underflow -ffree-line-length-none G2CNAME = $(shell g77 -print-file-name=libg2c.a) G2CPATH = $(dir ${G2CNAME}) G2CLIB = -L${G2CPATH} -lg2c endif # # Options specific to ifort compiler: # ifeq ($(F90),ifort) FFLAGS = -free -g -check all,noshape,nopointer -O0 -fpe0 G2CNAME = $(shell g77 -print-file-name=libg2c.a) G2CPATH = $(dir ${G2CNAME}) G2CLIB = -L${G2CPATH} -lg2c endif # # Options specific to xlf90 compiler on IBM # ifeq ($(F90),xlf90) FFLAGS = -qfree=f90 -g -O0 G2CLIB = endif all: $(CMD) driver.exe: $(OBJS) $(F90) -o $(@) $(OBJS) simple_driver.o $(LIBS) urban_driver.exe: $(OBJS) $(F90) -o $(@) $(OBJS) simple_driver_urban.o $(LIBS) graphics.exe: $(OBJS) $(F90) -o $(@) $(OBJS) graphics_compare.o $(LIBS) $(NCARGLIBS) ${G2CLIB} .F.o: $(F90) -c $(CPP_DEFINES) $(INCLUDES) $(FFLAGS) $(<) clean: $(RM) $(OBJS) simple_driver.o graphics_compare.o simple_driver_urban.o $(CMD) *.mod *~ urban_driver.exe: simple_driver_urban.o driver.exe: simple_driver.o graphics.exe: graphics_compare.o module_sf_noahlsm.o: module_sf_urban.o module_sf_noahlsm.o: module_model_constants.o simple_driver.o: module_io.o simple_driver.o: kwm_date_utilities.o simple_driver.o: module_Noahlsm_utility.o module_io.o: module_ascii_io.o module_io.o: module_netcdf_io.o