#*************************************************************************
#                                                                        *
# GNUmakefile.sun5:                                                      *
#                                                                        *
# Script to C-preprocess, compile, and link PE_INITIAL. It creates the   *
# executable file specified in the macro BIN.                            *
#                                                                        *
# This makefile is written for GNU Make, version 3.75                    *
#                                                                        *
#    Free Software Foundation          (617) 876-3296                    *
#    675 Mass Ave.                     gnu@prep.ai.mit.edu               *
#    Cambridge, MA  02139, USA         http://www.gnu.ai.mit.edu/        *
#                                                                        *
# It is NOT compatible with the standard UNIX Make.                      *
#                                                                        *
# Executable:                                                            *
#                                                                        *
#    pe_initial        Prepare fields for input to PE model.             *
#    make_transbdy     Extract Transport Streamfunction boundary         *
#                      conditions from previous pe_initial run.          *
#                      (for nesting)                                     *
#    test_solver       Test elliptic solvers used in pressure formulation*
#                                                                        *
# GNUmake targets:                                                       *
#                                                                        *
#    all               Creates all of the above executables.  (default)  *
#    clean             Remove all intermediate files.                    *
#                                                                        *
# This makefile has been designed to allow the user to compile the       *
# PE_INITIAL source codes in a separate directory from that in which the *
# source codes are located.  The makefile searches for the code segments *
# in the following alternate paths:                                      *
#                                                                        *
#    source code:  (1) the directory containing this GNUmakefile.        *
#                  (2) the directory specified by the macro SRCDIR       *
#                                                                        *
#    include files:  (1) the directory containing this GNUmakefile.      *
#                    (2) the directory specified by the macro PARAMDIR   *
#                    (3) the directory specified by the macro SRCDIR     *
#                    (4) the directory specified by the macro NCDIR      *
#                                                                        *
# This provides the user with the flexibility for the following          *
# configurations:                                                        *
#                                                                        *
#    (1) The user needs only copies of this GNUmakefile, the parameter   *
#        file "param.h" and a path to the source codes to produce a      *
#        version of PE_INITIAL with the appropriate C-preprocessing and  *
#        compilier options.                                              *
#                                                                        *
#    (2) The user who is modifying the PE_INITIAL code, can isolate      *
#        those routines actually being changed with a copy of this       *
#        GNUmakefile in a sub-directory.                                 *
#                                                                        *
#                             Patrick J. Haley Jr.           06/21/2006  *
#                             PE_INITIAL package Version     9.11        *
#                                                                        *
#*************************************************************************
#************************ USER's tunable macros **************************
#*************************************************************************
#
# BIN           name of the executable code
# BINDIR        directory path for executable code
# BINMKTBY      name of the executable for make_transbdy
# BINTSTSLVR    name of the executable for test_solver
# CPPFLAGS      C-preprocessing flags and options
# FFLAGS        flags for the fortran compiler
# NCDIR         directory path for NetCDF include files
# PARAMDIR      directory path for include files
# SOLVRDIR      directory path for elliptic solver codes
# SRCDIR        directory path for source codes
#
#*************************************************************************
#
# C-preprocessing options:
#
# -Daixdate	AIX intrinsic date routine (IBM RS6000).
# -Dcraydate	CRAY's intrinsic date routine.
# -Ddecdate	DEC's VMS intrinsic date routine.
# -Dgendbg      Generic Debugging:  Preserves intermediate files
# -Dleqstate    Temporary option:   Linear Equation of State
# -Drmcomments  Remove comments when pre-processing.
# -Drmdocinc    Remove documentation in all include files
# -Drmpsimean   Temporary option:  removal of level by level dyn. ht. mean
# -Dsundate	SUN's intrinsic date routine.
# -Dsunflush    regularly flush output buffers in SUN systems.
# -Dsunfpe      enable SUN's Floating Point Exception trap.
# -Dunesco      Temporary option:  Unesco (1980) nonlinear eq. state: seawater
#
# New options
#
# -Dmeantracer    Compute mean tracers for shapiro mean removal
#
# -Dpepsib      Compute PSIBAR with PE model weighting (precedence over ubpsib)
# -Dubpsib      Compute PSIBAR with weighting for uniform UBARO
#
# even newer options
#
# -DbioDuse        Dusenberry biological model
# -Dtrcascii       ascii file input for biological tracers
# -Dreadbioerr     read error fields for biological tracers
# -Dmeantracer_zip Set mean tracer to initial tracer values
#
# related to surface pressure formulation
#
# -Dsurfpress   Surface pressure formulation
# -Drmpressmean Remove mean from pressure (accessible if surfpress is active) 
# -Dcoast       Coastal boundaries (accessible if surfpress is active)
# -Dcyclic      x-periodic (accessible if surfpress is active)
# -Dsolvercg    conjugate gradient (accessible if surfpress is active)
# -Dlapfilter   laplacian filter to remove chequerboard mode
# -Dlocalfilter local filter to remove chequerboard mode
# -Dcheckinversion Verify residual, after solver inversion and filters.
# -Dtestsolver  prepare solver diagnostic(accessible if surfpress is active)
#
# related only to the test_solver program
#
# -Dtestinversion  inversion test.
# -Dtimesolver     used to record execution time.
# -Dstrmtst        Testing pre-conditioner for PE streamfunction PCG.
# -Dpjhdiff        Difference streamfunction before averaging.
#
# -Derr_ts2psi     Reset streamfunction errors when resetting psi.
#
#************************************************************************

  SPARSROOT = $(HOPSHOME)/SPARSKIT2

  SRCDIR = $(HOPSHOME)/PE_initial/Src
SOLVRDIR = $(HOPSHOME)/SolverSrc
PARAMDIR = .
   NCDIR = $(NETCDF_ROOT)/include
  BINDIR = ..

       BIN = pe_initial
  BINMKTBY = make_transbdy
BINTSTSLVR = test_solver

CPPFLAGS = -Dsundate -Dsunflush -Dubpsib -Dunesco -Drmpsimean \
           -Dsurfpress -Dcoast -Drmpressmean -Dpjhdiff -Derr_ts2psi

  FFLAGS = -u -fast -fsimple=1 -ansi

#************************************************************************
#******************** End of USER's tunable macros **********************
#************************************************************************

#------------------------------------------------------------------------
#--------------------- Internal macro definitions. ----------------------
#------------------------------------------------------------------------

RMBLKLINES = rmblklines
     SHELL = /bin/sh
        RM = rm -f
      ECHO = echo
     FALSE = false
       LIB = -L$(NETCDF_ROOT)/lib -lnetcdf -lnsl
       CPP = cpp -P -C -I. -I$(PARAMDIR) -I$(SRCDIR)
        FC = f77

ifneq (,$(findstring surfpress,$(CPPFLAGS)))
      LIB := $(LIB) -L$(SPARSROOT) -lskit
      CPP := $(CPP) -I$(SOLVRDIR)
endif

      CPP := $(CPP) -I$(NCDIR)

#------------------------------------------------------------------------
#---------------- Look for bad C Pre-Processing Flags. ------------------
#------------------------------------------------------------------------

VALID_CPP_OPT = -Daixdate -DbioDuse -Dcraydate -Ddecdate -Dgendbg  \
                -Dleqstate -Dmeantracer -Dmeantracer_zip \
                -Dpepsib -Dreadbioerr  -Drmcomments -Drmdocinc \
                -Drmpsimean -Dsundate -Dsunflush -Dsunfpe -Dtrcascii \
                -Dubpsib -Dunesco \
		-Dsurfpress -Drmpressmean  -Dcoast -Dcyclic  \
                -Dsolvercg  -Dlapfilter -Dlocalfilter \
                -Dtestsolver -Dtestinversion -Dcheckinversion -Dtimesolver \
                -Dstrmtst -Dpjhdiff -Derr_ts2psi

INVALID_CPP_OPT = $(strip $(filter-out $(VALID_CPP_OPT),$(CPPFLAGS)))

#------------------------------------------------------------------------
#--------------------- Redefine compiling macros. -----------------------
#------------------------------------------------------------------------

MAKEFLAGS := -r $(MAKEFLAGS)

.SUFFIXES:

.SUFFIXES: .o .f .F .FF

%.o:	%.f
	-$(FC) -c $(FFLAGS) -o $*.o $*.f

%.o:	%.F

%.o:	%.FF

%.f:	%.F
	-$(CPP) $(CPPFLAGS) $< ./$*.cpp
	-./$(RMBLKLINES) < $*.cpp > $*.f
	-$(RM) $*.cpp

%.f:	%.FF
	-$(CPP) $(CPPFLAGS) $< ./$*.f

#------------------------------------------------------------------------
#-------------- Define alternate paths for source codes. ----------------
#------------------------------------------------------------------------

#--------------------------
#--- Define source path ---
#--------------------------

testpath = .
pathstr  =

ifeq (,$(strip $(filter $(SRCDIR),$(subst :, ,$(testpath)))))
   testpath := $(testpath):$(SRCDIR)
   pathstr  := $(SRCDIR)
endif

ifneq (,$(findstring surfpress,$(CPPFLAGS)))
   ifeq (,$(strip $(filter $(SOLVRDIR),$(subst :, ,$(testpath)))))
      testpath := $(testpath):$(SOLVRDIR)
      ifneq (,$(pathstr))
         pathstr  := $(pathstr):$(SOLVRDIR)
        else
         pathstr  := $(SOLVRDIR)
      endif
   endif
endif

ifneq (,$(pathstr))
   vpath %.F   $(pathstr)
   vpath %.FF  $(pathstr)
endif

#---------------------------
#--- Define include path ---
#---------------------------

ifeq (,$(strip $(filter $(PARAMDIR),$(subst :, ,$(testpath)))))
   testpath := $(PARAMDIR):$(testpath)
   ifneq (,$(pathstr))
      pathstr  := $(PARAMDIR):$(pathstr)
     else
      pathstr  := $(PARAMDIR)
   endif
endif

ifeq (,$(strip $(filter $(NCDIR),$(subst :, ,$(testpath)))))
   testpath := $(testpath):$(NCDIR)
   ifneq (,$(pathstr))
      pathstr  := $(pathstr):$(NCDIR)
     else
      pathstr  := $(NCDIR)
   endif
endif

ifneq (,$(pathstr))
   vpath %.h   $(pathstr)
   vpath %.inc $(pathstr)
endif

#------------------------------------------------------------------------
#-------- Define string macro to parse C Pre-Processing Flags. ----------
#------------------------------------------------------------------------

find_flag = $(findstring $(flag),$(CPPFLAGS))

#------------------------------------------------------------------------
#------- Preserve intermediate source codes only when debugging. --------
#------------------------------------------------------------------------

dbg_flags = sunfpe gendbg

ifneq (,$(strip $(foreach flag,$(dbg_flags),$(find_flag))))
   .PRECIOUS: %.f
endif

#------------------------------------------------------------------------
#--- Declare "phony" targets.  GNUmake can always run these targets. ----
#------------------------------------------------------------------------

ifeq (,$(INVALID_CPP_OPT))
.PHONY: clean
else
.PHONY: clean $(BIN)
endif

#------------------------------------------------------------------------
#---------------------------- Source Codes. -----------------------------
#------------------------------------------------------------------------

#------------------------------------------------------------------------
#  PE_initial base routines.
#------------------------------------------------------------------------

  BASESRC =		PE_initial.F					\
	all_uc.F	avg_isle.F	blank.F		blkdat.F	\
	cgpois.F	cgpois1.F	check_depths.F	cperr.F		\
	defcdf.F	dt2nd.F		errdef.F	errlim.F	\
	exitus.F	external.F	fdiagn.F	filter.F	\
	fixpland.F	fsave.F		get_cdfdat.F	get_data.F	\
	get_date.F	get_ewpt.F	get_opn.F	get_parm.F	\
	get_qbry.F	get_trc.F	get_unif.F	header_fm.F	\
	header_qg.F	head_unif.F	headln.F	inside.F	\
	interp.F	intrp2d.F	length.F	lintrp.F	\
	ll2xy.F		lnblk.F		op.F		op1.F		\
	opencdf.F	psibar.F	psibavg.F	p2pber.F	\
	psibdy.F	put_bry.F	put_init.F	put_qbry.F	\
	putdiag.F	read_grids.F	read1cdf.F	readcdf.F	\
	read_surfnm.F	reset_isle.F	rollptr.F	rotparm.F	\
	save.F		scale_err.F	set_baro.F	set_land.F	\
	set_meantrc.F	set_oerr.F	set_pmask.F	set_psi.F	\
	setbyclsd.F	setbyopn.F	setclsd.F	setdepths.F	\
	setvgd.F	shapmean.F	spline.F	splint.F	\
	state_ini.F	timediff.F	transbdy.F	transobdy.F	\
	trc_names.F	ts2psi.F	v2perr.F	v2vber.F	\
	vel_err.F	velocity.F	xread.F		xy2ll.F		\
	vertgrid.F	errio.F		f2Dcopy.F	f2Dsum.F	\
	get_tide.F	no_digit.F	read_tide.F	tid_indx.F

#------------------------------------------------------------------------
#  Surface pressure routines.
#------------------------------------------------------------------------

SURFSRC =								\
	baro_velocity.F	div.F		gradconv.F	grad_ts.F	\
	init_pbar.F	mskind.F	psrfbdy.F	reset_depths.F	\
	reset_vgrid.F	rmmean_pbar.F	rsettide.F	setpsopn.F	\
	spresobdy.F	ts2poteng.F	wrtbgrd.F

#------------------------------------------------------------------------
#  Elliptic solver routines.
#------------------------------------------------------------------------

SOLVESRC =								\
	distdot.F	ellip_sol.F	press_solve.F	psconv.F	\
	runrc.F		spars_solve.F

STRMSLV = stream_solve.F

#------------------------------------------------------------------------
#  Auxillary routine for day of the week in date stamp.
#------------------------------------------------------------------------

   DAYSRC = day_code.F

#------------------------------------------------------------------------
#  Routine for SUN's floating point exception trap.
#------------------------------------------------------------------------

   DBGSRC = my_handler.F

#------------------------------------------------------------------------
#  Routines for code to extract boundary conditions for transport
#  streamfunction.
#------------------------------------------------------------------------

MKTBYSRC =		make_transbdy.F					\
	bess1d.F	bess2d.F	bess2d_pmsk.F	blkdat.F	\
	exitus.F	get_dom.F	get_ewpt.F	get_isval.F	\
	get_nbhrs.F	get_opn.F	get_pbar.F	intrp_pbar.F	\
	isincrs.F	length.F	ll2xy.F		mktby_data.F	\
	mktby_parm.F	no_digit.F	rotparm.F	set_pmask.F	\
	wrt_transbdy.F	xtr_psiby.F	xy2ll.F

#------------------------------------------------------------------------
#  Routines for code to test elliptic solvers.
#------------------------------------------------------------------------

TSTSLVRSRC =		test_solver.F					\
	blkdat.F	div.F		exitus.F	length.F	\
	mskind.F	read_inputs.F	rmmean_pbar.F	tsslrd.F	\
	tstsol.F

#------------------------------------------------------------------------
#--------------------------- Active Objects. ----------------------------
#------------------------------------------------------------------------

     OBJS = $(BASESRC:.F=.o)
MKTBYOBJS = $(MKTBYSRC:.F=.o)
TSTSLVROBJS = $(TSTSLVRSRC:.F=.o) $(SOLVESRC:.F=.o)

day_flags = craydate decdate
ifneq (,$(strip $(foreach flag,$(day_flags),$(find_flag))))
   OBJS := $(OBJS) $(DAYSRC:.F=.o)
endif

ifneq (,$(findstring strmtst,$(CPPFLAGS)))
   TSTSLVROBJS := $(TSTSLVROBJS) $(STRMSLV:.F=.o)
endif

ifneq (,$(findstring surfpress,$(CPPFLAGS)))
   OBJS := $(OBJS) $(SURFSRC:.F=.o) $(SOLVESRC:.F=.o)
endif

ifneq (,$(findstring sunfpe,$(CPPFLAGS)))
   OBJS := $(OBJS) $(DBGSRC:.F=.o)
   MKTBYOBJS := $(MKTBYOBJS) $(DBGSRC:.F=.o)
   TSTSLVROBJS := $(TSTSLVROBJS) $(DBGSRC:.F=.o)
endif

#------------------------------------------------------------------------
#----------------------- Create all executables. ------------------------
#------------------------------------------------------------------------

ifeq (,$(INVALID_CPP_OPT))
all:	$(BIN)	$(BINMKTBY) $(BINTSTSLVR)
	@($(ECHO) "";\
	$(ECHO) "Made all executables:";\
	$(ECHO) "" )
else
all:
		@($(ECHO) "";\
                $(ECHO) "***********************************" ;\
                $(ECHO) "*** Invalid CPP options present ***" ;\
                $(ECHO) "***********************************" ;\
                $(ECHO) "" ;\
                $(ECHO) "$(INVALID_CPP_OPT)" ;\
                $(ECHO) "" ;\
                $(ECHO) "***********************************" ;\
                $(ECHO) "*** No compilation will be done ***" ;\
                $(ECHO) "***********************************" ;\
	        $(ECHO) "" ;\
                $(FALSE) )
endif

#------------------------------------------------------------------------
#-------------------- Create PE_INITIAL executable. ---------------------
#------------------------------------------------------------------------

ifeq (,$(INVALID_CPP_OPT))
$(BIN):		$(RMBLKLINES) $(OBJS)
		@($(ECHO) "";\
                $(ECHO) "Creating PE_INITIAL executable:" ;\
	        $(ECHO) "" )
		$(FC) $(FFLAGS) -o $(BINDIR)/$(BIN) $(OBJS) $(LIB)
else
$(BIN):
		@($(ECHO) "";\
                $(ECHO) "***********************************" ;\
                $(ECHO) "*** Invalid CPP options present ***" ;\
                $(ECHO) "***********************************" ;\
                $(ECHO) "" ;\
                $(ECHO) "$(INVALID_CPP_OPT)" ;\
                $(ECHO) "" ;\
                $(ECHO) "***********************************" ;\
                $(ECHO) "*** No compilation will be done ***" ;\
                $(ECHO) "***********************************" ;\
	        $(ECHO) "" ;\
                $(FALSE) )
endif

#------------------------------------------------------------------------
#------------------ Create MAKE_TRANSBDY executable. --------------------
#------------------------------------------------------------------------

ifeq (,$(INVALID_CPP_OPT))
$(BINMKTBY):	$(RMBLKLINES) $(MKTBYOBJS)
		@($(ECHO) "";\
                $(ECHO) "Creating MAKE_TRANSBDY executable:" ;\
	        $(ECHO) "" )
		$(FC) $(FFLAGS) -o $(BINDIR)/$(BINMKTBY) $(MKTBYOBJS) $(LIB)
else
$(BINMKTBY):
		@($(ECHO) "";\
                $(ECHO) "***********************************" ;\
                $(ECHO) "*** Invalid CPP options present ***" ;\
                $(ECHO) "***********************************" ;\
                $(ECHO) "" ;\
                $(ECHO) "$(INVALID_CPP_OPT)" ;\
                $(ECHO) "" ;\
                $(ECHO) "***********************************" ;\
                $(ECHO) "*** No compilation will be done ***" ;\
                $(ECHO) "***********************************" ;\
	        $(ECHO) "" ;\
                $(FALSE) )
endif

#------------------------------------------------------------------------
#------------------- Create Test Solver executable. ---------------------
#------------------------------------------------------------------------

ifeq (,$(INVALID_CPP_OPT))
$(BINTSTSLVR):	$(RMBLKLINES) $(TSTSLVROBJS)
		@($(ECHO) "";\
                $(ECHO) "Creating Test Solver executable:" ;\
	        $(ECHO) "" )
		$(FC) $(FFLAGS) -o $(BINDIR)/$(BINTSTSLVR) $(TSTSLVROBJS) $(LIB)
else
$(BINTSTSLVR):
		@($(ECHO) "";\
                $(ECHO) "***********************************" ;\
                $(ECHO) "*** Invalid CPP options present ***" ;\
                $(ECHO) "***********************************" ;\
                $(ECHO) "" ;\
                $(ECHO) "$(INVALID_CPP_OPT)" ;\
                $(ECHO) "" ;\
                $(ECHO) "***********************************" ;\
                $(ECHO) "*** No compilation will be done ***" ;\
                $(ECHO) "***********************************" ;\
	        $(ECHO) "" ;\
                $(FALSE) )
endif

#------------------------------------------------------------------------
#---------------- Create remove blank lines executable. -----------------
#------------------------------------------------------------------------

$(RMBLKLINES):	rmblklines.o
		@($(ECHO) "";\
                $(ECHO) "Making post-processing code  $(RMBLKLINES):";\
		$(ECHO) "" )
		$(FC) $(FFLAGS) -o $(RMBLKLINES) rmblklines.o
		@($(ECHO) "" )

#------------------------------------------------------------------------
#--------- Target for cleaning preprocessed and object files. -----------
#------------------------------------------------------------------------

clean:
		@$(RM) *.f *.o $(RMBLKLINES)

#------------------------------------------------------------------------
#------------- Set dependencies for C-preprocessed files. ---------------
#------------------------------------------------------------------------

PE_initial.f:		cstseg.h	curflds.h	grddat.h	\
			hybrid.h	iounits.h	moddat.h	\
			ndimen.h	param.h		pi_netcdf.h	\
			shapfil.h	switches.h	zdat.h
baro_velocity.f:	cdefs.h		cstseg.h	curflds.h	\
			grddat.h	hybrid.h	iounits.h	\
			moddat.h	ndimen.h	param.h		\
			shapfil.h	switches.h	convinfo.h	\
			zdat.h
bess1d.f:		pconst.h
bess2d.f:		pconst.h
bess2d_pmsk.f:		pconst.h
blkdat.f:		cdefs.h		cstseg.h	iounits.h	\
			param.h		pi_netcdf.h	qgfldid.h	\
			switches.h	version.h	pefldid.h       \
			convinfo.h
cgpois1.f:		cstseg.h	param.h
check_depths.f:		param.h		hybrid.h	iounits.h	\
			meants.h	ndimen.h	zdat.h
cperr.f:		param.h		ndimen.h
defcdf.f:		param.h		baropar.h	cstseg.h	\
			hybrid.h	meants.h	moddat.h	\
			ndimen.h	netcdf.inc	pi_netcdf.h	\
			switches.h	iounits.h	version.h	\
			zdat.h
dt2nd.f:		param.h
ellip_sol.f:       	cdefs.h		convinfo.h
errdef.f:		param.h		ndimen.h
errlim.f:		param.h		ndimen.h
exitus.f:		iounits.h	param.h		pi_netcdf.h
external.f:		baropar.h	cstseg.h	curflds.h	\
			grddat.h	hybrid.h	iounits.h	\
			moddat.h	ndimen.h	param.h		\
			switches.h	zdat.h
fdiagn.f:		fdiag.h		iounits.h	pefldid.h
filter.f:		iounits.h	param.h
fixpland.f:		param.h		cstseg.h
fsave.f:		cstseg.h	iounits.h	param.h
get_cdfdat.f:		curflds.h	moddat.h	ndimen.h	\
			obserr.h	param.h		pi_netcdf.h	\
			switches.h	workspa.h	zdat.h
get_data.f:		curflds.h	iounits.h	moddat.h	\
			ndimen.h	obserr.h	param.h		\
			pefldid.h	qgfldid.h	switches.h	\
			workspa.h
get_dom.f:		param.h		netcdf.inc	iounits.h
get_isval.f:		param.h		pconst.h	crs_dom.h	\
			fne_dom.h
get_nbhrs.f:		param.h		pconst.h	crs_dom.h	\
			fne_dom.h
get_parm.f:		cdefs.h		param.h		netcdf.inc	\
			baropar.h	convinfo.h	curflds.h	\
			cstseg.h	hybrid.h	iounits.h	\
			meants.h	moddat.h	ndimen.h	\
			obserr.h	pi_netcdf.h	shapfil.h	\
			switches.h	zdat.h
get_pbar.f:		param.h		netcdf.inc	iounits.h
get_qbry.f:		param.h		iounits.h	pi_netcdf.h
get_tide.f:		cdefs.h		param.h		pconst.h	\
			curflds.h	moddat.h	ndimen.h	\
			switches.h
get_trc.f:		curflds.h	iounits.h	moddat.h	\
			ndimen.h	obserr.h	param.h		\
			pefldid.h	switches.h	workspa.h
get_unif.f:		param.h		curflds.h	iounits.h	\
			moddat.h	ndimen.h	zdat.h
gradconv.f:		cdefs.h		param.h		pconst.h	\
			cstseg.h	grddat.h	moddat.h	\
			ndimen.h
header_fm.f:		iounits.h	moddat.h	ndimen.h	\
			param.h		zdat.h
header_qg.f:		iounits.h	moddat.h	ndimen.h	\
			param.h		zdat.h
head_unif.f:		param.h		iounits.h	zdat.h
headln.f:		version.h
interp.f:		ndimen.h	param.h
intrp_pbar.f:		param.h		crs_dom.h	fne_dom.h
intrp2d.f:		ndimen.h	param.h
make_transbdy.f:	param.h		fne_dom.h
mktby_data.f:		param.h		crs_dom.h	fne_dom.h	\
			iounits.h
mktby_parm.f:		iounits.h
mskind.f:		iounits.h
op1.f:			cstseg.h	param.h
opencdf.f:		iounits.h	moddat.h	ndimen.h	\
			netcdf.inc	param.h		pi_netcdf.h	\
			switches.h	zdat.h
p2pber.f:		param.h		hybrid.h	ndimen.h
press_solve.f:     	cdefs.h		switches.h	iounits.h
psconv.f:     		cdefs.h		convinfo.h
psibar.f:		curflds.h	hybrid.h	ndimen.h	\
			moddat.h	param.h		switches.h	\
			zdat.h
psibdy.f:		param.h		cstseg.h	curflds.h	\
			grddat.h	hybrid.h	iounits.h	\
			moddat.h	ndimen.h	switches.h
psrfbdy.f:		param.h		cstseg.h	curflds.h	\
			grddat.h	iounits.h	moddat.h	\
			ndimen.h	switches.h
put_bry.f:		cstseg.h	curflds.h	grddat.h	\
			iounits.h	moddat.h	ndimen.h	\
			param.h		pefldid.h	pi_netcdf.h	\
			switches.h
put_init.f:		curflds.h	iounits.h	ndimen.h	\
			obserr.h	param.h		pefldid.h	\
			pi_netcdf.h	switches.h
put_qbry.f:		param.h		iounits.h	pi_netcdf.h
putdiag.f:		param.h		curflds.h	iounits.h	\
			ndimen.h	netcdf.inc	pi_netcdf.h	\
			switches.h	zdat.h
read_grids.f:		cstseg.h	grddat.h	hybrid.h	\
			iounits.h	moddat.h	ndimen.h	\
			netcdf.inc	param.h		pi_netcdf.h	\
			switches.h	zdat.h
read_inputs.f:		iounits.h
read_tide.f:		cdefs.h		param.h		pconst.h	\
			netcdf.inc	iounits.h	pi_netcdf.h
read1cdf.f:		iounits.h
readcdf.f:		iounits.h
read_surfnm.f:		param.h		netcdf.inc	curflds.h	\
			iounits.h	ndimen.h	pi_netcdf.h
reset_depths.f:         param.h 	iounits.h 	ndimen.h  \
			curflds.h 	
reset_isle.f:		param.h		cstseg.h
reset_vgrid.f:		param.h		hybrid.h	ndimen.h
rsettide.f:		cdefs.h		param.h		curflds.h	\
			hybrid.h	ndimen.h
rsettrans.f:		pi_netcdf.h
save.f:			ndimen.h	param.h		pefldid.h	\
			qgfldid.h	switches.h	workspa.h
scale_err.f:		ndimen.h	obserr.h	param.h		\
			switches.h	zdat.h
set_baro.f:		baropar.h	curflds.h	grddat.h	\
			hybrid.h	iounits.h	moddat.h	\
			ndimen.h	param.h		switches.h	\
			zdat.h
set_land.f:		cstseg.h	ndimen.h	param.h
set_meantrc.f:		param.h		cstseg.h	curflds.h	\
			ndimen.h	switches.h	zdat.h
set_oerr.f:		fdiag.h		hybrid.h	iounits.h	\
			ndimen.h	obserr.h	param.h		\
			pefldid.h	switches.h	zdat.h
set_pmask.f:		param.h
set_psi.f:		param.h		baropar.h	curflds.h	\
			iounits.h	ndimen.h	switches.h	\
			zdat.h 
setbyclsd.f:		param.h		cstseg.h	iounits.h
setbyopn.f:		param.h		cstseg.h	iounits.h
setclsd.f:		param.h		cstseg.h
setdepths.f:		param.h		hybrid.h	iounits.h	\
			ndimen.h	switches.h
setpsopn.f:		param.h		cstseg.h	iounits.h
setvgd.f:		pconst.h
spars_solve.f:		cdefs.h		param.h		iounits.h	\
			convinfo.h
spresobdy.f:		param.h		cstseg.h	iounits.h
spline.f:		pconst.h
splint.f:		pconst.h
test_solver.f: 		cdefs.h		param.h		iounits.h	\
			convinfo.h
timediff.f: 		param.h		iounits.h	ndimen.h	\
			pi_netcdf.h	switches.h
transbdy.f:		param.h		cstseg.h
transobdy.f:		param.h		cstseg.h
trc_names.f:		pi_netcdf.h
ts2psi.f:		param.h		curflds.h	iounits.h	\
			meants.h	moddat.h	ndimen.h	\
			switches.h	zdat.h
ts2poteng.f:		param.h		curflds.h	iounits.h	\
			meants.h	moddat.h	ndimen.h	\
			switches.h	zdat.h
tstsol.f:		cdefs.h		param.h		iounits.h	\
			convinfo.h	cstseg.h	grddat.h	\
			moddat.h	ndimen.h
v2perr.f:		param.h		ndimen.h
v2vber.f:		param.h		hybrid.h	ndimen.h
vel_err.f:		param.h		cstseg.h	grddat.h	\
			hybrid.h	moddat.h
velocity.f:		curflds.h	grddat.h	hybrid.h	\
			iounits.h	moddat.h	ndimen.h	\
			param.h		switches.h	zdat.h
vertgrid.f:		param.h		hybrid.h	ndimen.h	\
			zdat.h
vertgrid_old.f:		param.h		hybrid.h	ndimen.h	\
			zdat.h
wrtbgrd.f:              param.h		iounits.h	netcdf.inc      \
                        pi_netcdf.h
wrt_transbdy.f:		iounits.h
xtr_psiby.f:		param.h		fne_dom.h
