#*************************************************************************
#                                                                        *
# GNUmakefile.sun5:                                                      *
#                                                                        *
# Script to C-preprocess, compile, and link PEMODEL. 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:                                                            *
#                                                                        *
#    pemodel           Primitive Equation model.        (default)        *
#                                                                        *
# GNUmake targets:                                                       *
#                                                                        *
#    clean             Remove all intermediate files.                    *
#                                                                        *
# This makefile has been designed to allow the user to compile the       *
# PEMODEL 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 the PE model with the appropriate C-preprocessing and*
#        compilier options.                                              *
#                                                                        *
#    (2) The user who is modifying the PE model, can isolate             *
#        those routines actually being changed with a copy of this       *
#        GNUmakefile in a sub-directory.                                 *
#                                                                        *
#                                                                        *
#                             Patrick J. Haley Jr.    08/21/2001         *
#                             PE model Version        9.6                *
#                                                                        *
#*************************************************************************
#************************ USER's tunable macros **************************
#*************************************************************************
#
# BIN           name of the executable code
# BINDIR        directory path for executable code
# 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
# SRCDIR        directory path for source codes
#
#*************************************************************************
#
# C-preprocessing options:
#
#  -Dadvtide         Add tidal advection to tracer eqns. (only with ext_tide).
#  -Dadvtide0        Scale down tidal advection. (only with ext_tide & advtide)
#  -Daixdate         AIX intrinsic date routine (IBM RS6000).
#  -Danalytical      Analytical initial and boundary fields.  (Do not use
#                    with both "dblprec" and "forcing" also active)
#  -Dbarotropic      barotropic model configuration (one level, KM=1)
#  -Dbioadjvert      Adjustment of biology using vertical dynamics only
#  -DbioAnder        Anderson expansion of McGillicuddy biological model
#  -DbioDuse         Dusenberry bio-optical models.
#  -DbioFasham       Fasham et al. (1990) biological model
#  -DbioMcGillic     McGillicuddy et al. (1995) biological model
#  -Dbndy_rlx        Boundary relaxation.
#  -Dbotfrc          Bottom friction.
#  -Dclose_tracers   Impose closed BCs on tracer N & S boundaries.
#  -Dcoast           Coastal boundary conditions
#  -Dcoastedge       Next to mask, average unmasked values (control noise)
#  -Dcraydate        CRAY's intrisic date/time functions
#  -Dcstfrc          Coastal friction.
#  -Dcubspl          Vertical cubic spline interpolation by slabs
#  -Dcyclic          Cyclic (west/east) boundary conditions
#  -Ddblprec         Double precision floating-point operations and output
#                    (Do not use with both "analytical" and "forcing" also
#                    active)
#  -Ddblsigma        Double "sigma" transformation in the vertical
#  -Ddecdate         DEC's intrisic date/time functions
#  -DdusDroop        Droop nutrient limitation equations
#  -Dexplicitvmix    Explicit vertical mixing
#  -Dext_tide        Enable tidal forcing, read and manage barotropic tide info.
#  -Dextraction      Extract initial and boundary data for requested sub-domains
#  -Dfcsterr         Maintain OI forecast errors.  (with "oias")
#  -Dforcing         space/time variable forcing.  (Do not use with both
#                    "analytical" and "dblprec" also active)
#  -Dfrozentrc       Initially freeze tracers for specified number of timesteps
#  -Dgendbg          Generic Debugging:  Preserves intermediate files
#  -Dgrids           Domain configuration from GRIDS NetCDF file
#  -Dhpg4            Forth order hydrostatic pressure gradient
#  -Dimp_bnd_rlx     Use semi-implicit in time scheme for boundary relaxation.
#  -Dislands         Islands are present in the model basin
#  -Dldrifters       Lagrangian Drifters option
#  -Dleqstate        Linear Equation of State
#  -Dlinear_physics  Linear physics: no adv mom, only vert. adv mean tracers
#  -Dmixtide         Add tide/turbulence interactions in vertical mixing
#                    coefficient. (only with ext_tide)
#  -Dnestnultest     Create "nested" code without the nesting routines?
#  -Dnocfl           No CFL checking.
#  -Dnotadvm         Linear Momentum Equation: no horizontal advection
#  -Dnotadvt         Linear Heat Equation: no horizontal advection
#  -Dnowcfl          Disable CFL checking in the vertical.
#  -Dnoxtrp          No extrapolation in hydrostatic pressure gradient
#  -Doias            Intermittent OI assimilation option
#  -Dpeprf           Hydrographic PE profiles
#  -Dppvmix          Pacanowski and Philander vertical mixing scheme
#  -Dpressbias       Remove bias from pressure gradient
#  -Dpressinbias     Initialize bias file
#  -Dpttrcsrc        specification of point tracer sources
#  -Dresetjulian     Start surface forcing clock from supplied value.
#  -Drmcomments      Remove all commented lines after C-preprocessing
#  -Drmdenbar        Remove mean density when computing the pressure gradient
#  -Drmdocinc        Remove documentation in all include files.
#  -Dsecondmean      enforce zero mean internal vel. after Shapiro filter
#  -Dshapiro         Shapiro filter for horizontal viscosity
#  -Dshapmean        Remove "mean" tracer field before shapiro filtering
#  -Dsimpramp        Simple ramping scheme.  (with "oias" and "fcsterr")
#  -Dsor5pt          transport solution via sequential over-relaxation
#  -Dsundate         SUN's intrisic date/time function
#  -Dsunflush        regularly flush output buffers in SUN systems.
#  -Dsunfpe          SUN's floating point exception trap
#  -Dunesco          Unesco (1980) nonlinear equation of state for seawater
#  -Dusrdiagnostic   Report user defined diagnostics.
#  -Dvbart           Vertical Simpson's integration in pressure gradient
#  -Dvel_conv        Require convergence in velocity when solving PBAR
#  -Dwgterr          An intuitive form of the OI ramping weight.  (with "oias")
#
#  New/testing
#
#  -Dadd_tide        On output, tidal velocity added to total velocity.
#  -Dbio_12_A        Additional productivity terms (bacterial, zooplankton, etc)
#  -Dbioadjloc       pseudo local biological adjustment.  Vertical diffusion
#                    is on, but advection is off.
#  -Dbottom          Second-order in time bottom stress calculation.
#  -Dcodunlim        Append cod model with unlimited response to T & zoo
#  -Dcodlim          Append cod model with limited response to T & zoo
#  -Dcodvadvect      Allow cod to be vertically advected.
#  -Dcodvmix         Enable cod vertical mixing. (only with codunlim or codlim)
#  -Dgridold         Recover old algorithm for setting vertical coordinates.
#  -Dnest2larger     Two-way nesting to larger grid via PVM.
#  -Dnest2smaller    Two-way nesting to smaller grid via PVM.
#  -Dnest_ext2lrgr   Replace fine grid transport streamfunction with coarse
#  -Dnest_ext2smlr   Send transport streamfunction to overwrite fine grid
#  -Dnesttime        Times various elements of the run.  (SUN only)
#  -Dnkfix           Revise protections & input for Niiler-Kraus mixed-layer.
#  -Dpindex          Revised streamfunction filter indices.
#  -Dposmxtid        Sets (tidal) vertical mixing in pre-defined areas and
#                    over given depth range.
#  -Drivsrc          River sources.  Use with PTTRCSRC
#  -Dshapnocoastflux Revised filter BCs.
#  -Dtide_zero       Adds tidal Reynolds stresses (zero freq.) to momemtum
#                    equations. (only with ext_tide)
#
#  -Dcod_ing         CJL's modified cod model.  Requires "codlim" also active.
#  -Dzoo_ing         zooplankton following behavior for CJL's cod
#  -Dcod_square      speed-response is the square functional
#  -DAsselinFilt     Add Asselin filter
#  -DAsselinFilt_cod Only apply Asselin filter to cod
#
#  -Dflipbc          Use 2nd order zero flux BCs for SHAPNOCOASTFLUX.
#  -Dpjhrange        Filter boundaries for SHAPNOCOASTFLUX.
#
#************************************************************************

  SRCDIR = .
PARAMDIR = .
   NCDIR = $(NETCDF_ROOT)/include
  BINDIR = .

       BIN = pemodel

CPPFLAGS = -Dsundate -Dsunflush -Ddblsigma -Drmdenbar -Dcubspl -Dvbart -Dwcfl \
           -Dunesco -Dppvmix -Dshapiro -Dsecondmean -Dvel_conv -Drmdocinc
  FFLAGS = -u -O

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

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

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

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

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

wk_flags := nest2larger nest2smaller
ifneq (,$(strip $(foreach flag,$(wk_flags),$(find_flag))))
      CPP := $(CPP) -I$(PVM_ROOT)/include
      LIB := $(LIB) -L$(PVM_ROOT)/lib/$(PVM_ARCH) -lfpvm3 -lpvm3 -lsocket
endif

       LIB := $(LIB) -lnsl

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

VALID_CPP_OPT = -Dadd_tide -Dadvtide -Dadvtide0 -Daixdate -Danalytical \
                -DAsselinFilt -DAsselinFilt_cod -Dbarotropic -DbioAnder \
                -DbioDuse -DbioFasham -DbioMcGillic -Dbio_12_A -Dbioadjloc \
                -Dbioadjvert -Dbndy_rlx -Dbotfrc -Dbottom -Dclose_tracers \
                -Dcoast -Dcoastedge -Dcod_ing -Dcod_square -Dcodlim -Dcodunlim \
                -Dcodvadvect -Dcodvmix -Dcraydate -Dcstfrc -Dcubspl -Dcyclic \
                -Ddblprec -Ddblsigma -Ddecdate -DdusDroop -Dexplicitvmix \
                -Dext_tide -Dextraction -Dfcsterr -Dforcing -Dfrozentrc \
                -Dgendbg -Dgridold -Dgrids -Dhpg4 -Dimp_bnd_rlx -Dislands \
                -Dldrifters -Dleqstate -Dlinear_physics -Dmixtide \
                -Dnest_ext2lrgr -Dnest_ext2smlr -Dnest2larger -Dnest2smaller \
                -Dnestnultest -Dnesttime -Dnkfix -Dnocfl -Dnotadvm \
                -Dnotadvt -Dnowcfl -Dnoxtrp -Doias -Dpeprf -Dpindex -Dposmxtid \
                -Dppvmix -Dpressbias -Dpressinbias -Dpttrcsrc -Dresetjulian \
                -Drivsrc -Drmcomments -Drmdenbar -Drmdocinc -Dsecondmean \
                -Dshapiro -Dshapmean -Dshapnocoastflux -Dsimpramp -Dsor5pt \
                -Dsundate -Dsunflush -Dsunfpe -Dtide_zero -Dunesco \
                -Dusrdiagnostic -Dvbart -Dvel_conv -Dwgterr -Dzoo_ing \
                -Dflipbc -Dpjhrange

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

ifeq (,$(strip $(filter $(BASEDIR),$(subst :, ,$(testpath)))))
   testpath := $(testpath):$(BASEDIR)
   ifneq (,$(pathstr))
      pathstr  := $(pathstr):$(BASEDIR)
     else
      pathstr  := $(BASEDIR)
   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

wk_flags := nest2larger nest2smaller
ifneq (,$(strip $(foreach flag,$(wk_flags),$(find_flag))))
   ifeq (,$(strip $(filter $(PVM_ROOT)/include,$(subst :, ,$(testpath)))))
      testpath := $(pathstr):$(PVM_ROOT)/include
      ifneq (,$(pathstr))
         pathstr  := $(pathstr):$(PVM_ROOT)/include
        else
         pathstr  := $(PVM_ROOT)/include
      endif
   endif
endif

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

#------------------------------------------------------------------------
#------- 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. -----------------------------
#------------------------------------------------------------------------

#------------------------------------------------------------------------
#  GFDL's PE model routines.
#------------------------------------------------------------------------

 GFDLSRC = 		ocean.F						\
	step.F		clinic.F	tracer.F	state.F		\
	relax.F		cnvmix.F	setvbc.F	cfl.F		\
	odam.F		invtri.F

#------------------------------------------------------------------------
#  Harvard's PE model routines.
#------------------------------------------------------------------------

   HUSRC = 								\
	all_uc.F	boundary.F	bdryindx.F	blkdat.F	\
	caldate.F	cdfout.F	chkparm.F	defnrg.F	\
	defout.F	depthslab.F	diag.F		errio.F		\
	exitus.F	extrap.F	extrap2.F	file_chk.F	\
	flip.F		get_date.F	get_ewpt.F	get_thick.F	\
	grad24_p.F	gregorian.F	headln.F	hvgrid.F	\
	infld.F		init_srch.F	inparm.F	int_gradrho.F	\
	lap_depth.F	lap_filt.F	lap_lev.F	length.F	\
	lintrp.F	lintslab.F	ll2xy.F		lnblk.F		\
	meanrho.F	no_digit.F	robc.F		rotangle.F	\
	rotparm.F	setvert.F	spline.F	splint.F	\
	tsource.F	vmix_aux.F	wrtcdf.F	xy2ll.F		\
	zetabar.F

#------------------------------------------------------------------------
#  Routines for Lagrangian drifters.
#------------------------------------------------------------------------

  TRKSRC = 								\
	drifters.F	bracket_z.F	derivs0.F	fsigma.F	\
	load_sig.F	rk40.F		sig2z.F		sigma2z.F	\
	sig_search.F	trackbound.F	trackinit.F	trackrefresh.F	\
	tracksout.F	trackstep.F	trackup.F	trkvscl.F	\
	vavgv.F		vntrpv.F

 TKTDSRC = drftdv.F

#------------------------------------------------------------------------
#  Routine for 1D Bessel interpolation (used for different options).
#------------------------------------------------------------------------

 BES1SRC = bes1d.F

#------------------------------------------------------------------------
#  Routines for sub-domain(s) extraction.
#------------------------------------------------------------------------

  XTRSRC = 								\
	xtrsubdom.F	xtract.F	xtr_psi.F	xtr_trc.F	\
	xtr_vel.F	xtr_vor.F

#------------------------------------------------------------------------
#  Routines for two-way nesting (via PVM).
#------------------------------------------------------------------------

  NEST_SRC =								\
	hopsrecv.F	host_check.F	nest_domain.F	nest_errchk.F	\
	nest_flags.F	nest_init.F	nest_interior.F	nest_t_align.F	\
	nest_test.F

NEST2LRG_SRC = nest_rec_bc.F

NEST2SML_SRC = bess2d.F nest_snd_bc.F bess1d.F nest_spawn.F scalvcln.F
  NL2SML_SRC = bess2d_msk.F bess2d_pmsk.F cell_ok.F set_pmask.F

#------------------------------------------------------------------------
#  Routines for Shapiro filtering.
#------------------------------------------------------------------------

VOLDATSRC = okeep.F osav.F

  SHAPSRC = shap_lev.F

#------------------------------------------------------------------------
#  Routines for setting vertical system.
#------------------------------------------------------------------------

    ZSRC = set_depths.F

 ZOLDSRC = set_depths_old.F

#------------------------------------------------------------------------
#  Routines for "bias" removal.
#------------------------------------------------------------------------

PBIASSRC = press_bias.F

PBIAS0SRC = defbias.F pb0wrtcdf.F press_bias0.F

SBAISSRC = shap_mean.F

#------------------------------------------------------------------------
#  Routines for biological models.
#------------------------------------------------------------------------

   ANDERSRC =								\
	bioparmAnder.F	biosourceAnder.F	defbparmAnder.F		\
	putbparmAnder.F

    DUSESRC =								\
	bioparmDuse.F	biosourceDuse.F		defbparmDuse.F		\
	priprod.F	putbparmDuse.F		aphread.F

  FASHAMSRC =						\
	bioparmFasham.F		biosourceFasham.F	\
	defbparmFasham.F	putbparmFasham.F

MCGILLICSRC =						\
	bioparmMcGillic.F	biosourceMcGillic.F	\
	defbparmMcGillic.F	putbparmMcGillic.F

     CODSRC = cdrspv.F

#------------------------------------------------------------------------
#  Routine for space/time variable forcing.
#------------------------------------------------------------------------

  FRCSRC = readvbc.F

#------------------------------------------------------------------------
#  Routine for domain configuration from GRIDS NetCDF.  It could be
#  used in conjunction with -Danalytical.
#------------------------------------------------------------------------

  GRDSRC = readgrids.F

#------------------------------------------------------------------------
#  Routines for coastal set-up.
#------------------------------------------------------------------------

COASTSRC = landsea.F  msk_bdy.F  ind_bdy.F

CSTAVGSRC = ip2ij.F set_edges.F upbox.F

#------------------------------------------------------------------------
#  Routines for profile sampling.
#------------------------------------------------------------------------

PEPRFSRC =	check_prf.F	readprf.F	rem_llist.F	wrt_prf.F

#------------------------------------------------------------------------
#  Routines for profile data management.
#------------------------------------------------------------------------

DATAMNGSRC =	writehydro.F	wrtstr.F

#------------------------------------------------------------------------
#  Routines for Pacanowski and Philander mixing.
#------------------------------------------------------------------------

PPMIXSRC = ppmix.F	rich_no.F

#------------------------------------------------------------------------
#  Routines for 4th order interpolation in pressure gradient.
#------------------------------------------------------------------------

CSINTSRC = splineslab.F splintslab.F

#------------------------------------------------------------------------
#  Routines for intermittent OI assimilation.
#------------------------------------------------------------------------

  IOISRC = oiassi.F assiwght.F oibndry.F

 OIERSRC = rseterr.F

#------------------------------------------------------------------------
#  Routine for analytical field initialization.
#------------------------------------------------------------------------

  ANASRC = anaflds.F

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

   DBGSRC = my_handler.F

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

   DAYSRC = day_code.F

#------------------------------------------------------------------------
#  Routine for boundary relaxation.
#------------------------------------------------------------------------

  BRLXSRC = set_brlx.F

#------------------------------------------------------------------------
#  Routine for barotropic velocity convergence in solution of PBAR.
#------------------------------------------------------------------------

  VCNVSRC = vbar_test.F

#------------------------------------------------------------------------
#  Routine for user diagnostics.
#------------------------------------------------------------------------

    UDSRC = userdiag.F

#------------------------------------------------------------------------
#  Routines for external tide
#------------------------------------------------------------------------

    TIDXSRC = 								\
	addtide.F	read_tide.F	tid_indx.F	tide_aux.F

   TIDAXSRC = reset_t_thickness.F

    TIDMXSRC = tide_depth.F tide_val.F

   TIDPMXSRC = inittdpth.F

#------------------------------------------------------------------------
#--------------------- Active Sources and Objects. ----------------------
#------------------------------------------------------------------------

    OBJS = $(GFDLSRC:.F=.o) $(HUSRC:.F=.o)

ifneq (,$(findstring analytical,$(CPPFLAGS)))
   OBJS := $(OBJS) $(ANASRC:.F=.o)
endif

ifneq (,$(findstring bioAnder,$(CPPFLAGS)))
   OBJS := $(OBJS) $(ANDERSRC:.F=.o)
endif

ifneq (,$(findstring bioDuse,$(CPPFLAGS)))
   OBJS := $(OBJS) $(DUSESRC:.F=.o)
endif

ifneq (,$(findstring bioFasham,$(CPPFLAGS)))
   OBJS := $(OBJS) $(FASHAMSRC:.F=.o)
endif

ifneq (,$(findstring bioMcGillic,$(CPPFLAGS)))
   OBJS := $(OBJS) $(MCGILLICSRC:.F=.o)
endif

wk_flags := bndy_rlx cstfrc botfrc
ifneq (,$(strip $(foreach flag,$(wk_flags),$(find_flag))))
   OBJS := $(OBJS) $(BRLXSRC:.F=.o)
endif

wk_flags := codunlim codlim
ifneq (,$(strip $(foreach flag,$(wk_flags),$(find_flag))))
   OBJS := $(OBJS) $(CODSRC:.F=.o)
endif

ifneq (,$(findstring coast,$(CPPFLAGS)))
   OBJS := $(OBJS) $(COASTSRC:.F=.o)
endif

wk_flags := coast coastedge
ifeq ($(wk_flags),$(sort $(strip $(foreach flag,$(wk_flags),$(find_flag)))))
   OBJS := $(OBJS) $(CSTAVGSRC:.F=.o)
endif

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

ifneq (,$(findstring cubspl,$(CPPFLAGS)))
   OBJS := $(OBJS) $(CSINTSRC:.F=.o)
endif

ifneq (,$(findstring ext_tide,$(CPPFLAGS)))
   OBJS := $(OBJS) $(TIDXSRC:.F=.o)
   ifneq (,$(findstring advtide,$(CPPFLAGS)))
      OBJS := $(OBJS) $(TIDAXSRC:.F=.o)
   endif
   ifneq (,$(findstring mixtide,$(CPPFLAGS)))
      OBJS := $(OBJS) $(TIDMXSRC:.F=.o)
   endif
endif

wk_flags := ext_tide mixtide
ifneq ($(wk_flags),$(sort $(strip $(foreach flag,$(wk_flags),$(find_flag)))))
   ifneq (,$(findstring posmxtid,$(CPPFLAGS)))
      OBJS := $(OBJS) $(TIDMXSRC:.F=.o) $(TIDPMXSRC:.F=.o)
   endif
endif

ifneq (,$(findstring extraction,$(CPPFLAGS)))
   OBJS := $(OBJS) $(XTRSRC:.F=.o)
endif

ifneq (,$(findstring forcing,$(CPPFLAGS)))
   OBJS := $(OBJS) $(FRCSRC:.F=.o)
endif

ifeq (,$(findstring gridold,$(CPPFLAGS)))
   OBJS := $(OBJS) $(ZSRC:.F=.o)
 else
   OBJS := $(OBJS) $(ZOLDSRC:.F=.o)
endif

ifneq (,$(findstring grids,$(CPPFLAGS)))
   OBJS := $(OBJS) $(GRDSRC:.F=.o)
endif

ifneq (,$(findstring ldrifters,$(CPPFLAGS)))
   OBJS := $(OBJS) $(TRKSRC:.F=.o)
   ifneq (,$(findstring ext_tide,$(CPPFLAGS)))
      OBJS := $(OBJS) $(TKTDSRC:.F=.o)
   endif
endif

wk_flags := ldrifters nest2larger nest2smaller
ifneq (,$(strip $(foreach flag,$(wk_flags),$(find_flag))))
   OBJS := $(OBJS) $(BES1SRC:.F=.o)
endif

ifneq (,$(findstring oias,$(CPPFLAGS)))
   OBJS := $(OBJS) $(IOISRC:.F=.o)
   ifneq (,$(findstring fcsterr,$(CPPFLAGS)))
      OBJS := $(OBJS) $(OIERSRC:.F=.o)
   endif
endif

ifneq (,$(findstring peprf,$(CPPFLAGS)))
   OBJS := $(OBJS) $(PEPRFSRC:.F=.o) $(DATAMNGSRC:.F=.o)
endif

ifneq (,$(findstring ppvmix,$(CPPFLAGS)))
   OBJS := $(OBJS) $(PPMIXSRC:.F=.o)
endif

wk_flags := pressbias pressinbias
ifeq (pressbias,$(sort $(strip $(foreach flag,$(wk_flags),$(find_flag)))))
   OBJS := $(OBJS) $(PBIASSRC:.F=.o)
endif

wk_flags := pressbias pressinbias
ifeq ($(wk_flags),$(sort $(strip $(foreach flag,$(wk_flags),$(find_flag)))))
   OBJS := $(OBJS) $(PBIAS0SRC:.F=.o)
endif

wk_flags := pressbias shapiro shapmean
ifeq ($(wk_flags),$(sort $(strip $(foreach flag,$(wk_flags),$(find_flag)))))
   OBJS := $(OBJS) $(SBAISSRC:.F=.o)
endif

ifneq (,$(findstring nest2larger,$(CPPFLAGS)))
   OBJS := $(OBJS) $(NEST2LRG_SRC:.F=.o)
endif

ifneq (,$(findstring nest2smaller,$(CPPFLAGS)))
   OBJS := $(OBJS) $(NEST2SML_SRC:.F=.o)
   ifneq (,$(findstring coast,$(CPPFLAGS)))
      OBJS := $(OBJS) $(NL2SML_SRC:.F=.o)
   endif
endif

wk_flags := nest2larger nest2smaller
ifneq (,$(strip $(foreach flag,$(wk_flags),$(find_flag))))
   OBJS := $(OBJS) $(NEST_SRC:.F=.o)
endif

wk_flags := AsselinFilt nest2larger nest2smaller shapiro
ifneq (,$(strip $(foreach flag,$(wk_flags),$(find_flag))))
   OBJS := $(OBJS) $(VOLDATSRC:.F=.o)
endif

ifneq (,$(findstring shapiro,$(CPPFLAGS)))
   OBJS := $(OBJS) $(SHAPSRC:.F=.o)
endif

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

ifneq (,$(findstring usrdiagnostic,$(CPPFLAGS)))
   OBJS := $(OBJS) $(UDSRC:.F=.o)
endif

ifneq (,$(findstring vel_conv,$(CPPFLAGS)))
   OBJS := $(OBJS) $(VCNVSRC:.F=.o)
endif

#------------------------------------------------------------------------
#--------------------------- Strip out tabs. ----------------------------
#------------------------------------------------------------------------

empty :=
space := $(empty) $(empty)
tab := $(empty)	$(empty)

OBJSnt := $(strip $(subst $(tab),$(space),$(OBJS)))

#------------------------------------------------------------------------
#-------------------------- Create PE model. ----------------------------
#------------------------------------------------------------------------

ifeq (,$(INVALID_CPP_OPT))
$(BIN):		$(RMBLKLINES) $(OBJSnt)
		@($(ECHO) "";\
                $(ECHO) "Creating PE model:" ;\
	        $(ECHO) "" )
		$(FC) $(FFLAGS) -o $(BINDIR)/$(BIN) $(OBJSnt) $(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 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. ---------------
#------------------------------------------------------------------------

addtide.f:		cdefs.h		param.h		pconst.h

anaflds.f:		cdefs.h		param.h		pconst.h	\
			netcdf.inc	bndata.h	cbiopnh.h	\
			cvbc.h		cvmix.h		fields.h	\
			fullwd.h	hybrid.h	iounits.h	\
			moddat.h	onedim.h	options.h	\
			pe_netcdf.h	rhomean.h	runid.h		\
			scalar.h	vertslabs.h	workspa.h

aphread.f:		param.h		cdefs.h		iounits.h	\
			pconst.h	cbiopnh.h

assiwght.f:		cdefs.h		param.h		pconst.h	\
			iounits.h	oiopts.h	ioi.h

bdryindx.f:		cdefs.h		param.h		pconst.h	\
			fullwd.h	onedim.h	fields.h	\
			iounits.h	vertslabs.h	edges.h

bes1d.f:		cdefs.h		pconst.h

bess1d.f:		cdefs.h		pconst.h

bess2d.f:		cdefs.h		pconst.h

bess2d_msk.f:		cdefs.h		pconst.h	iounits.h

bess2d_pmsk.f:		cdefs.h		pconst.h

bioparmAnder.f:		cdefs.h		param.h		pconst.h	\
			cbiopnh.h	iounits.h

bioparmDuse.f:		cdefs.h		param.h		pconst.h	\
			cbiopnh.h	iounits.h

bioparmFasham.f:	cdefs.h		param.h		pconst.h	\
			rhomean.h	cvmix.h		cbiopnh.h	\
			iounits.h

bioparmMcGillic.f:	cdefs.h		param.h		pconst.h	\
			cbiopnh.h	iounits.h

biosourceAnder.f:	cdefs.h		param.h		pconst.h	\
			scalar.h	workspa.h	vertslabs.h	\
			cvbc.h		cvmix.h		cbiopnh.h	\
			onedim.h

biosourceDuse.f:	cdefs.h		param.h		pconst.h	\
			scalar.h	workspa.h	rhomean.h	\
			vertslabs.h	cvbc.h		cvmix.h		\
			cbiopnh.h	onedim.h

biosourceFasham.f:	cdefs.h		param.h		pconst.h	\
			scalar.h	workspa.h	vertslabs.h	\
			cvbc.h		cvmix.h		cbiopnh.h	\
			onedim.h

biosourceMcGillic.f:	cdefs.h		param.h		pconst.h	\
			scalar.h	workspa.h	vertslabs.h	\
			cvbc.h		cvmix.h		cbiopnh.h	\
			onedim.h

blkdat.f:		cdefs.h		param.h		pconst.h	\
			scalar.h	fullwd.h	filtdat.h	\
			rhomean.h	cvmix.h		runid.h		\
			version.h	hybrid.h	moddat.h	\
			options.h	tracks.h	pe_netcdf.h	\
			iounits.h	hydro.h		prf.h		\
			ioi.h		cbiopnh.h

boundary.f:		cdefs.h		param.h		pconst.h	\
			scalar.h	fields.h	workspa.h	\
			bndata.h	options.h	iounits.h

bracket_z.f:		cdefs.h		param.h		pconst.h

caldate.f:		cdefs.h		pconst.h

cdfout.f:		cdefs.h		param.h		pconst.h	\
			scalar.h	fullwd.h	fields.h	\
			workspa.h	gradp.h		vertslabs.h	\
			rhomean.h	options.h	iounits.h	\
			cvmix.h		cbiopnh.h	pe_netcdf.h	\
			tidesp.h	ioi.h		oiopts.h	\
			onedim.h

cdrspv.f:		cdefs.h		pconst.h

cfl.f:			cdefs.h		param.h		pconst.h	\
			scalar.h	fullwd.h	onedim.h	\
			workspa.h	vertslabs.h	iounits.h	\
			ccfl.h		tidesp.h

check_prf.f:		cdefs.h		param.h		hydro.h		\
			prf.h

chkparm.f:		param.h		iounits.h	options.h

clinic.f:		cdefs.h		param.h		pconst.h	\
			fullwd.h	scalar.h	onedim.h	\
			fields.h	workspa.h	gradp.h		\
			cvmix.h		cvbc.h		cdiag.h		\
			hybrid.h	vertslabs.h	extra.h		\
			filtdat.h	bndata.h	options.h	\
			bndyrlx.h	tidesp.h

cnvmix.f:		cdefs.h		param.h		pconst.h	\
			scalar.h	fullwd.h	iounits.h	\
			workspa.h	vertslabs.h	cvmix.h

defbias.f:		cdefs.h		param.h		pconst.h	\
			moddat.h	vertslabs.h	iounits.h	\
			version.h	runid.h		netcdf.inc	\
			pe_netcdf.h

defbparmAnder.f:	cdefs.h		param.h		cbiopnh.h	\
			netcdf.inc	pe_netcdf.h

defbparmDuse.f:		cdefs.h		param.h		pconst.h	\
			cbiopnh.h	netcdf.inc	pe_netcdf.h

defbparmFasham.f:	cdefs.h		param.h		cbiopnh.h	\
			netcdf.inc	pe_netcdf.h

defbparmMcGillic.f:	cdefs.h		param.h		cbiopnh.h	\
			netcdf.inc	pe_netcdf.h

defnrg.f:		cdefs.h		param.h		pconst.h	\
			scalar.h	runid.h		iounits.h	\
			options.h	cdiag.h		moddat.h	\
			hybrid.h	netcdf.inc	pe_netcdf.h	\
			version.h	cbiopnh.h

defout.f:		cdefs.h		param.h		pconst.h	\
			scalar.h	fullwd.h	onedim.h	\
			moddat.h	filtdat.h	options.h	\
			hybrid.h	runid.h		vertslabs.h	\
			rhomean.h	cvmix.h		iounits.h	\
			version.h	bndyrlx.h	cbiopnh.h	\
			netcdf.inc	pe_netcdf.h	oiopts.h

depthslab.f:		cdefs.h		pconst.h	param.h		\
			vertical.h

derivs0.f:		cdefs.h		param.h		pconst.h	\
			fields.h	fullwd.h	onedim.h	\
			trkscl.h	workspa.h	workspb.h

diag.f:			cdefs.h		param.h		pconst.h	\
			scalar.h	fullwd.h	onedim.h	\
			workspa.h	fields.h	vertslabs.h	\
			rhomean.h	filtdat.h	cvbc.h		\
			cdiag.h		ccfl.h		options.h	\
			iounits.h	pe_netcdf.h	netcdf.inc

drftdv.f:		cdefs.h		param.h		fullwd.h	\
			scalar.h	tidesp.h

drifters.f:		cdefs.h		param.h		tracks.h	\
			pconst.h	moddat.h	iounits.h

exitus.f:		cdefs.h		param.h		fullwd.h	\
			iounits.h	pe_netcdf.h

extrap.f:		cdefs.h		pconst.h

extrap2.f:		cdefs.h		pconst.h

file_chk.f:		iounits.h

flip.f:			cdefs.h

fsigma.f:		cdefs.h		param.h		pconst.h	\
			trkfld.h

get_ewpt.f:		cdefs.h		pconst.h

get_thick.f:		cdefs.h		param.h		pconst.h

grad24_p.f:		cdefs.h		param.h		pconst.h	\
			onedim.h	fullwd.h	workspa.h	\
			vertslabs.h	rhomean.h	gradp2.h	\
			gradp4.h	gradph2.h	gradph4.h

headln.f:		version.h

hopsrecv.f:		fpvm3.h

hvgrid.f:		cdefs.h		param.h		pconst.h	\
			fullwd.h	scalar.h	onedim.h	\
			fields.h	moddat.h	options.h	\
			iounits.h	hybrid.h	vertslabs.h

ind_bdy.f:		cdefs.h		param.h		fullwd.h	\
			bndata.h

infld.f:		cdefs.h		param.h		pconst.h	\
			fullwd.h	scalar.h	fields.h	\
			workspa.h	bndata.h	moddat.h	\
			options.h	iounits.h	oiopts.h	\
			hybrid.h	runid.h		rhomean.h	\
			netcdf.inc	pe_netcdf.h	vertslabs.h

inittdpth.f:		cdefs.h		pconst.h	iounits.h

inparm.f:		cdefs.h		param.h		pconst.h	\
			fullwd.h	scalar.h	bndata.h	\
			moddat.h	filtdat.h	options.h	\
			iounits.h	hybrid.h	rhomean.h	\
			runid.h		cvmix.h		cppmix.h	\
			bndyrlx.h	cbiopnh.h

int_gradrho.f:		cdefs.h		param.h		pconst.h	\
			scalar.h

invtri.f:		cdefs.h		param.h		pconst.h

landsea.f:		cdefs.h		param.h		fullwd.h	\
			iounits.h	netcdf.inc

lap_depth.f:		cdefs.h		param.h		pconst.h	\
			onedim.h	vertslabs.h

lap_filt.f:		cdefs.h		param.h		pconst.h	\
			onedim.h	fullwd.h

lap_lev.f:		cdefs.h		param.h		pconst.h	\
			onedim.h

lintrp.f:		cdefs.h

lintslab.f:		cdefs.h		pconst.h

ll2xy.f:		cdefs.h		pconst.h

load_sig.f:		cdefs.h		param.h		rhomean.h	\
			trkfld.h

meanrho.f:		cdefs.h		param.h		pconst.h	\
			onedim.h	options.h	hybrid.h	\
			rhomean.h

msk_bdy.f:		cdefs.h		param.h		pconst.h	\
			fullwd.h	bndata.h	options.h	\
			iounits.h

nest_domain.f:		cdefs.h		param.h		pconst.h	\
			fpvm3.h		iounits.h	moddat.h	\
			nest.h

nest_errchk.f:		cdefs.h		fpvm3.h		iounits.h

nest_flags.f:		cdefs.h		param.h		pconst.h	\
			fpvm3.h		iounits.h	nest.h		\
			options.h

nest_init.f:		cdefs.h		param.h		pconst.h	\
			fpvm3.h		iounits.h	nest.h

nest_interior.f:	cdefs.h		param.h		pconst.h	\
			fpvm3.h		fields.h	iounits.h	\
			nest.h		options.h	voldat.h	\
			onedim.h	fullwd.h	vertslabs.h

nest_rec_bc.f:		cdefs.h		param.h		pconst.h	\
			fpvm3.h		bndata.h	iounits.h	\
			nest.h		options.h	rhomean.h	\
			voldat.h	fields.h	vertslabs.h

nest_snd_bc.f:		cdefs.h		param.h		pconst.h	\
			fpvm3.h		fields.h	iounits.h	\
			nest.h		options.h	rhomean.h	\
			voldat.h	fullwd.h

nest_spawn.f:		cdefs.h		param.h		pconst.h	\
			fpvm3.h		iounits.h	nest.h

nest_t_align.f:		cdefs.h		param.h		pconst.h	\
			fpvm3.h		iounits.h	nest.h

nest_test.f:		cdefs.h		param.h		pconst.h	\
			fpvm3.h		nest.h

ocean.f:		cdefs.h		param.h		pconst.h	\
			fullwd.h	scalar.h	onedim.h	\
			fields.h	workspa.h	workspb.h	\
			bndata.h	moddat.h	filtdat.h	\
			options.h	iounits.h	oiopts.h	\
			hybrid.h	vertslabs.h	pe_netcdf.h

odam.f:			cdefs.h		param.h

oiassi.f:		cdefs.h		param.h		pconst.h	\
			fullwd.h	scalar.h	onedim.h	\
			fields.h	workspa.h	options.h	\
			iounits.h	rhomean.h	oiopts.h	\
			ioi.h		bndyrlx.h	netcdf.inc	\
			pe_netcdf.h	vertslabs.h

oibndry.f:		cdefs.h		param.h		fields.h	\
			workspa.h	bndata.h	oiopts.h

okeep.f:		cdefs.h		param.h		pconst.h	\
			vertslabs.h	onedim.h	fields.h	\
			workspa.h	voldat.h

osav.f:			cdefs.h		param.h		onedim.h	\
			workspa.h	voldat.h	options.h

pb0wrtcdf.f:		cdefs.h		iounits.h

ppmix.f:		cdefs.h		param.h		pconst.h	\
			cppmix.h	cvmix.h		workspa.h	\
			vertslabs.h

press_bias.f:		cdefs.h		param.h		pconst.h	\
			iounits.h	netcdf.inc	pe_netcdf.h	\
			voldat.h

press_bias0.f:		cdefs.h		param.h		pconst.h	\
			iounits.h	netcdf.inc	pe_netcdf.h	\
			fullwd.h	workspa.h

priprod.f:		cdefs.h		param.h		pconst.h	\
			workspa.h	vertslabs.h	cvbc.h		\
			cvmix.h		rhomean.h	cbiopnh.h

putbparmAnder.f:	cdefs.h		param.h		pconst.h	\
			cbiopnh.h	netcdf.inc	pe_netcdf.h

putbparmDuse.f:		cdefs.h		param.h		pconst.h	\
			cbiopnh.h	netcdf.inc	pe_netcdf.h

putbparmFasham.f:	cdefs.h		param.h		pconst.h	\
			cbiopnh.h	rhomean.h	cvmix.h		\
			netcdf.inc	pe_netcdf.h

putbparmMcGillic.f:	cdefs.h		param.h		pconst.h	\
			cbiopnh.h	netcdf.inc	pe_netcdf.h

read_tide.f:		cdefs.h		param.h		pconst.h	\
			netcdf.inc	iounits.h	pe_netcdf.h

readgrids.f:		cdefs.h		param.h		pconst.h	\
			fields.h	moddat.h	hybrid.h	\
			netcdf.inc	pe_netcdf.h	options.h	\
			iounits.h

readprf.f:		cdefs.h		param.h		pconst.h	\
			fullwd.h	hydro.h		iounits.h	\
			moddat.h	prf.h		scalar.h	\
			options.h

readvbc.f:		cdefs.h		param.h		pconst.h	\
			fullwd.h	cinpvbc.h	netcdf.inc	\
			pe_netcdf.h	iounits.h	options.h

relax.f:		cdefs.h		param.h		pconst.h	\
			fullwd.h	scalar.h	onedim.h	\
			fields.h	workspb.h	bndata.h	\
			filtdat.h	iounits.h	vertslabs.h	\
			bndyrlx.h

reset_t_thickness.f:	cdefs.h		param.h		pconst.h	\
			vertical.h	tidesp.h

rich_no.f:		cdefs.h		param.h		pconst.h	\
			scalar.h

rk40.f:			cdefs.h		param.h		pconst.h

robc.f:			cdefs.h		param.h		pconst.h	\
			scalar.h	onedim.h	fields.h	\
			workspa.h	vertslabs.h	bndata.h	\
			fullwd.h

rotangle.f:		cdefs.h		pconst.h

rotparm.f:		cdefs.h		pconst.h

rseterr.f:		cdefs.h		pconst.h

scalvcln.f:		cdefs.h		param.h		vertslabs.h

set_brlx.f:		cdefs.h		param.h		pconst.h	\
			bndyrlx.h	fullwd.h

set_depths.f:		cdefs.h		param.h		pconst.h	\
			hybrid.h	vertslabs.h	vertical.h

set_depths_old.f:	cdefs.h		param.h		pconst.h	\
			hybrid.h	vertslabs.h	vertical.h

set_edges.f:		cdefs.h		param.h		pconst.h	\
			edges.h

set_pmask.f:		cdefs.h		param.h		fullwd.h

setvbc.f:		cdefs.h		param.h		pconst.h	\
			fullwd.h	scalar.h	workspa.h	\
			bndata.h	cinpvbc.h	cbiopnh.h	\
			cvbc.h		cvmix.h		rhomean.h	\
			options.h	tidesp.h

setvert.f:		cdefs.h		param.h		pconst.h	\
			onedim.h	workspa.h	vertslabs.h	\
			extra.h

shap_lev.f:		cdefs.h		param.h		pconst.h	\
			options.h	iounits.h	fullwd.h

shap_mean.f:		cdefs.h		param.h		voldat.h

sig2z.f:		cdefs.h		param.h		pconst.h

sig_search.f:		cdefs.h		param.h		pconst.h

sigma2z.f:		cdefs.h		param.h		pconst.h	\
			trkfld.h

spline.f:		cdefs.h		pconst.h

splineslab.f:		cdefs.h		pconst.h

splint.f:		cdefs.h		pconst.h

splintslab.f:		cdefs.h		pconst.h

state.f:		cdefs.h		param.h		rhomean.h

step.f:			cdefs.h		param.h		pconst.h	\
			fullwd.h	scalar.h	onedim.h	\
			fields.h	workspa.h	bndata.h	\
			voldat.h	filtdat.h	options.h	\
			oiopts.h	iounits.h	hybrid.h	\
			vertslabs.h	extra.h		cdiag.h		\
			rhomean.h	cbiopnh.h	tidesp.h

tide_aux.f:		cdefs.h		param.h		pconst.h	\
			fullwd.h	scalar.h	tidesp.h	\
			onedim.h

tide_depth.f:		cdefs.h		param.h		pconst.h	\
			cvmix.h

tide_val.f:		cdefs.h		param.h		pconst.h	\
			cvmix.h		tidesp.h

tracer.f:		cdefs.h		param.h		pconst.h	\
			fullwd.h	scalar.h	onedim.h	\
			fields.h	workspa.h	cvmix.h		\
			cvbc.h		cdiag.h		hybrid.h	\
			vertslabs.h	filtdat.h	options.h	\
			bndyrlx.h	rhomean.h	tidesp.h	\
			cbiopnh.h

trackbound.f:		cdefs.h		param.h		pconst.h

trackinit.f:		cdefs.h		param.h		pconst.h	\
			scalar.h	moddat.h	trkscl.h	\
			tracktime.h

trackrefresh.f:		cdefs.h		param.h		fullwd.h	\
			trkfld.h	vertslabs.h	workspa.h

tracksout.f:		cdefs.h		param.h		pconst.h	\
			fullwd.h	tracks.h	netcdf.inc	\
			pe_netcdf.h	moddat.h	runid.h		\
			iounits.h	version.h

trackstep.f:		cdefs.h		pconst.h	tracks.h	\
			tracktime.h	trkscl.h

trackup.f:		cdefs.h		param.h		pconst.h	\
			fullwd.h	scalar.h

trkvscl.f:		cdefs.h		pconst.h	param.h		\
			onedim.h	trkscl.h

tsource.f:		cdefs.h		param.h		pconst.h	\
			scalar.h	workspa.h	vertslabs.h	\
			ctsrc.h		rhomean.h	iounits.h	\
			fullwd.h

upbox.f:		cdefs.h		pconst.h

userdiag.f:		cdefs.h		param.h		pconst.h	\
			iounits.h	workspa.h	fullwd.h	\
			runid.h		scalar.h

vavgv.f:		cdefs.h		param.h		pconst.h	\
			vertical.h

vbar_test.f:		cdefs.h		param.h		pconst.h	\
			fields.h	onedim.h	fullwd.h

vmix_aux.f:		cdefs.h		param.h		pconst.h	\
			scalar.h	fullwd.h	workspa.h	\
			onedim.h	cvbc.h		rhomean.h	\
			vertslabs.h	cvmix.h

vntrpv.f:		cdefs.h		param.h		pconst.h

writehydro.f:		cdefs.h		param.h		hydro.h

wrt_prf.f:		cdefs.h		param.h		hydro.h		\
			prf.h		iounits.h	pconst.h	\
			scalar.h	vertslabs.h	fullwd.h	\
			moddat.h	workspa.h	rhomean.h	\
			options.h

wrtcdf.f:		cdefs.h		param.h		pconst.h	\
			scalar.h	fullwd.h	onedim.h	\
			rhomean.h	vertslabs.h	options.h	\
			iounits.h	pe_netcdf.h

xtr_psi.f:		cdefs.h		param.h		pconst.h	\
			fields.h	moddat.h

xtr_trc.f:		cdefs.h		param.h		pconst.h	\
			fullwd.h	moddat.h	rhomean.h

xtr_vel.f:		cdefs.h		param.h		pconst.h	\
			scalar.h	fullwd.h	moddat.h

xtr_vor.f:		cdefs.h		param.h		pconst.h	\
			scalar.h	fields.h	moddat.h

xtract.f:		cdefs.h		param.h		netcdf.inc	\
			pe_netcdf.h	iounits.h

xtrsubdom.f:		cdefs.h		param.h		pconst.h	\
			fullwd.h	scalar.h	iounits.h	\
			xtr_opts.h

xy2ll.f:		cdefs.h		pconst.h

zetabar.f:		cdefs.h		param.h		pconst.h	\
			scalar.h	onedim.h	fullwd.h	\
			fields.h	workspa.h
