The NCEP Way of doing things
OBJS =  OBJ/DQSDT.o  		\
	OBJ/E.o  		\
	OBJ/MAIN.o  		\
	OBJ/QDATAP.o  		\
	OBJ/READCNTL.o  	\
	OBJ/SFCDIF.o  		\
	OBJ/CSNOW.o  		\
	OBJ/FRH2O.o  		\
	OBJ/SNKSRC.o  		\
	OBJ/SNOWPACK.o  	\
	OBJ/SNOW_NEW.o  	\
	OBJ/TBND.o  		\
	OBJ/CANRES.o  		\
	OBJ/DEVAP.o  		\
	OBJ/HRT.o  		\
	OBJ/HRTICE.o  		\
	OBJ/HSTEP.o  		\
	OBJ/NOPAC.o  		\
	OBJ/PENMAN.o  		\
	OBJ/REDPRM.o  		\
	OBJ/ROSR12.o  		\
	OBJ/SFLX.o  		\
	OBJ/SHFLX.o 		\
	OBJ/SMFLX.o  		\
	OBJ/SNOPAC.o  		\
	OBJ/SRT.o  		\
	OBJ/SSTEP.o  		\
	OBJ/TDFCND.o 		\
	OBJ/TRANSP.o		\
        OBJ/WDFCND.o		\
	OBJ/READ_INT_SPATIAL.o	\
	OBJ/READ_REAL_SPATIAL.o	\
	OBJ/CALC_LENGTH.o	\
	OBJ/SKIP_COMMENTS.o	\
	OBJ/READ_FORCING.o	\
	OBJ/READ_LSC.o		\
	OBJ/READ_INITIAL.o	\
	OBJ/CHECK_INITIAL.o	\
	OBJ/CHECK_FORCING.o	\
	OBJ/CALC_WEIGHTS.o	\
	OBJ/WRITE_DATA.o	\
	OBJ/WRITE_FORCINGS.o	\
	OBJ/WRITE_SINGLE.o	\
	OBJ/GRIBOUT.o		\
	OBJ/MAKEPDS.o	

# Tunable parameters 
#
# COMPILER      Compiler name
# FFLAGS	Flags to the fortran compiler
# LIBS		A list of libraries to use 
# PROGRAM	Name of the executable

COMPILER=f90
LIBS=	/ldas/home/noah/source/w3lib90/bacio_32 \
	/ldas/home/noah/source/w3lib90/w3lib_32 \
	/ldas/home/noah/source/w3lib90/iplib_32
PROGRAM=noah
FFLAGS=-c
HDRS= -I/ldas/home/noah/PILPS-2E/netcdf-3.4/include

# These are the
# actual rules which make uses to build corr.
# 
# The first line says that the program depends on the object
# files.  If the program is out of date or does not
# exist then the objects have to be linked together using
# the compiler (linker)
#
# The subsequent lines describe the dependencies for each
# object file.  Each object file depends on its source
# file and 0 or more include files.  If any include file
# or the source file have been modified, the source
# file is recompiled 

$(PROGRAM): $(OBJS)
	    $(COMPILER) $(OBJS) $(LIBS) -L/ldas/home/noah/PILPS-2E/netcdf-3.4/lib/ -lnetcdf $(HDRS) -o $(PROGRAM)

OBJ/DQSDT.o: SOURCE/DQSDT.f
	$(COMPILER) $(FFLAGS) SOURCE/DQSDT.f -o OBJ/DQSDT.o

OBJ/E.o: SOURCE/E.f
	$(COMPILER) $(FFLAGS) SOURCE/E.f -o OBJ/E.o

OBJ/WRITE_DATA.o: DRIVER/WRITE_DATA.f
	$(COMPILER) $(FFLAGS) DRIVER/WRITE_DATA.f -o OBJ/WRITE_DATA.o

OBJ/WRITE_FORCINGS.o: DRIVER/WRITE_FORCINGS.f
	$(COMPILER) $(FFLAGS) DRIVER/WRITE_FORCINGS.f -o OBJ/WRITE_FORCINGS.o

OBJ/WRITE_SINGLE.o: DRIVER/WRITE_SINGLE.f
	$(COMPILER) $(FFLAGS) DRIVER/WRITE_SINGLE.f -o OBJ/WRITE_SINGLE.o

OBJ/GRIBOUT.o: DRIVER/GRIBOUT.f
	$(COMPILER) $(FFLAGS) DRIVER/GRIBOUT.f -o OBJ/GRIBOUT.o

OBJ/MAKEPDS.o: DRIVER/MAKEPDS.f
	$(COMPILER) $(FFLAGS) DRIVER/MAKEPDS.f -o OBJ/MAKEPDS.o

OBJ/MAIN.o: DRIVER/MAIN.f DRIVER/MAIN.h
	$(COMPILER) $(FFLAGS) DRIVER/MAIN.f -o OBJ/MAIN.o

OBJ/CALC_WEIGHTS.o: DRIVER/CALC_WEIGHTS.f
	$(COMPILER) $(FFLAGS) DRIVER/CALC_WEIGHTS.f -o OBJ/CALC_WEIGHTS.o

OBJ/QDATAP.o: DRIVER/QDATAP.f
	$(COMPILER) $(FFLAGS) DRIVER/QDATAP.f -o OBJ/QDATAP.o

OBJ/READCNTL.o: DRIVER/READCNTL.f
	$(COMPILER) $(FFLAGS) DRIVER/READCNTL.f -o OBJ/READCNTL.o

OBJ/SFCDIF.o: SOURCE/SFCDIF.f
	$(COMPILER) $(FFLAGS) SOURCE/SFCDIF.f -o OBJ/SFCDIF.o

OBJ/CSNOW.o:  SOURCE/CSNOW.f
	$(COMPILER) $(FFLAGS) SOURCE/CSNOW.f -o OBJ/CSNOW.o

OBJ/FRH2O.o:  SOURCE/FRH2O.f
	$(COMPILER) $(FFLAGS) SOURCE/FRH2O.f -o OBJ/FRH2O.o

OBJ/SNKSRC.o: SOURCE/SNKSRC.f
	$(COMPILER) $(FFLAGS) SOURCE/SNKSRC.f -o OBJ/SNKSRC.o

OBJ/SNOWPACK.o: SOURCE/SNOWPACK.f
	$(COMPILER) $(FFLAGS) SOURCE/SNOWPACK.f -o OBJ/SNOWPACK.o

OBJ/SNOW_NEW.o: SOURCE/SNOW_NEW.f
	$(COMPILER) $(FFLAGS) SOURCE/SNOW_NEW.f -o OBJ/SNOW_NEW.o

OBJ/TBND.o: SOURCE/TBND.f
	$(COMPILER) $(FFLAGS) SOURCE/TBND.f -o OBJ/TBND.o

OBJ/CANRES.o: SOURCE/CANRES.f
	$(COMPILER) $(FFLAGS) SOURCE/CANRES.f -o OBJ/CANRES.o

OBJ/DEVAP.o: SOURCE/DEVAP.f
	$(COMPILER) $(FFLAGS) SOURCE/DEVAP.f -o OBJ/DEVAP.o

OBJ/HRT.o: SOURCE/HRT.f
	$(COMPILER) $(FFLAGS) SOURCE/HRT.f -o OBJ/HRT.o

OBJ/HRTICE.o: SOURCE/HRTICE.f
	$(COMPILER) $(FFLAGS) SOURCE/HRTICE.f -o OBJ/HRTICE.o

OBJ/HSTEP.o: SOURCE/HSTEP.f
	$(COMPILER) $(FFLAGS) SOURCE/HSTEP.f -o OBJ/HSTEP.o

OBJ/NOPAC.o: SOURCE/NOPAC.f
	$(COMPILER) $(FFLAGS) SOURCE/NOPAC.f -o OBJ/NOPAC.o

OBJ/PENMAN.o: SOURCE/PENMAN.f
	$(COMPILER) $(FFLAGS) SOURCE/PENMAN.f -o OBJ/PENMAN.o

OBJ/REDPRM.o: SOURCE/REDPRM.f
	$(COMPILER) $(FFLAGS) SOURCE/REDPRM.f -o OBJ/REDPRM.o

OBJ/ROSR12.o: SOURCE/ROSR12.f
	$(COMPILER) $(FFLAGS) SOURCE/ROSR12.f -o OBJ/ROSR12.o

OBJ/SFLX.o:  SOURCE/SFLX.f
	$(COMPILER) $(FFLAGS) SOURCE/SFLX.f -o OBJ/SFLX.o

OBJ/SHFLX.o: SOURCE/SHFLX.f
	$(COMPILER) $(FFLAGS) SOURCE/SHFLX.f -o OBJ/SHFLX.o

OBJ/SMFLX.o: SOURCE/SMFLX.f
	$(COMPILER) $(FFLAGS) SOURCE/SMFLX.f -o OBJ/SMFLX.o

OBJ/SNOPAC.o: SOURCE/SNOPAC.f
	$(COMPILER) $(FFLAGS) SOURCE/SNOPAC.f -o OBJ/SNOPAC.o

OBJ/SRT.o: SOURCE/SRT.f
	$(COMPILER) $(FFLAGS) SOURCE/SRT.f -o OBJ/SRT.o

OBJ/SSTEP.o: SOURCE/SSTEP.f
	$(COMPILER) $(FFLAGS) SOURCE/SSTEP.f -o OBJ/SSTEP.o

OBJ/TDFCND.o: SOURCE/TDFCND.f
	$(COMPILER) $(FFLAGS) SOURCE/TDFCND.f -o OBJ/TDFCND.o

OBJ/TRANSP.o: SOURCE/TRANSP.f
	$(COMPILER) $(FFLAGS) SOURCE/TRANSP.f -o OBJ/TRANSP.o

OBJ/WDFCND.o: SOURCE/WDFCND.f
	$(COMPILER) $(FFLAGS) SOURCE/WDFCND.f -o OBJ/WDFCND.o

OBJ/READ_INT_SPATIAL.o: DRIVER/READ_INT_SPATIAL.f
	$(COMPILER) $(FFLAGS) DRIVER/READ_INT_SPATIAL.f -o OBJ/READ_INT_SPATIAL.o

OBJ/READ_REAL_SPATIAL.o: DRIVER/READ_REAL_SPATIAL.f
	$(COMPILER) $(FFLAGS) DRIVER/READ_REAL_SPATIAL.f -o OBJ/READ_REAL_SPATIAL.o

OBJ/CALC_LENGTH.o: DRIVER/CALC_LENGTH.f
	$(COMPILER) $(FFLAGS) DRIVER/CALC_LENGTH.f -o OBJ/CALC_LENGTH.o

OBJ/SKIP_COMMENTS.o: DRIVER/SKIP_COMMENTS.f
	$(COMPILER) $(FFLAGS) DRIVER/SKIP_COMMENTS.f -o OBJ/SKIP_COMMENTS.o

OBJ/READ_FORCING.o: DRIVER/READ_FORCING.f
	$(COMPILER) $(FFLAGS) DRIVER/READ_FORCING.f -o OBJ/READ_FORCING.o

OBJ/READ_LSC.o: DRIVER/READ_LSC.f
	$(COMPILER) $(FFLAGS) DRIVER/READ_LSC.f -o OBJ/READ_LSC.o

OBJ/READ_INITIAL.o: DRIVER/READ_INITIAL.f
	$(COMPILER) $(FFLAGS) DRIVER/READ_INITIAL.f -o OBJ/READ_INITIAL.o

OBJ/CHECK_INITIAL.o: DRIVER/CHECK_INITIAL.f
	$(COMPILER) $(FFLAGS) DRIVER/CHECK_INITIAL.f -o OBJ/CHECK_INITIAL.o

OBJ/CHECK_FORCING.o: DRIVER/CHECK_FORCING.f
	$(COMPILER) $(FFLAGS) DRIVER/CHECK_FORCING.f -o OBJ/CHECK_FORCING.o