#
#  Set options for your computing platform following line 58
#
#-----------------------------------------------------------------------------#
#= This program is free software;  you can redistribute it and/or modify     =#
#= it under the terms of the GNU General Public License as published by the  =#
#= Free Software Foundation;  either version 2 of the license, or (at your   =#
#= option) any later version.                                                =#
#= The TUV package is distributed in the hope that it will be useful, but    =#
#= WITHOUT ANY WARRANTY;  without even the implied warranty of MERCHANTIBI-  =#
#= LITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public     =#
#= License for more details.                                                 =#
#= To obtain a copy of the GNU General Public License, write to:             =#
#= Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.   =#
#-----------------------------------------------------------------------------#
#= To contact the authors, please mail to:                                   =#
#= Sasha Madronich, NCAR/ACD, P.O.Box 3000, Boulder, CO, 80307-3000, USA  or =#
#= or send email to:  sasha@ucar.edu                                         =#
#-----------------------------------------------------------------------------#
#= Copyright (C) 1995, 96 University Corporation for Atmospheric Research    =#
#-----------------------------------------------------------------------------#
#
# v4.8
#
# Use with disort (discrete ordinate), or ps2str (2 stream approximation, 
# pseudo-spherical correction)
# Need to make sure that rtlink.f corresponds to the method used
#
#----------
# EXC      : name of excutable
# INCLUDES : required include files
# USE_INCL : object files referencing include file (params)
# FOBJS    : all required object files that do not use the include file
#

INCLUDES = params 

# loading routines to include
RSUBS =        rn.o

USE_INCL = tuv.o \
           gridck.o gridw.o gridz.o \
           rdetfl.o read1.o read2.o \
           rdo2xs.o rdso2xs.o rdno2xs.o rdo3xs.o \
           pchem.o $(RSUBS) \
           pbiol1.o  \
	   sjo2.o schu.o lymana.o \
           setair.o settmp.o \
	   seto2.o setozo.o setno2.o setso2.o \
           setaer.o setcld.o setalb.o \
           sphers.o rtlink.ps2str.o ps2str.o \
           rtlink.psndo.o psndo.o

FOBJS = addpnt.o zero1.o zero2.o inter1.o inter2.o inter3.o inter4.o fsum.o           \
        futr.o fery.o fchap.o zenith.o sundis.o refrac.o

#----------
# Set machine specific options:
 
# FC   : FORTRAN compiler 
#        Linux users:  try FC = g77 or pgf77
#        Cray users :  try FC = f90

# FFLAGS : command line options to compiler call (if not set, default is
#          probably some basic optimization level)

# LIBS  : libraries required

# Ramboll has tested TUV for CAMx on Linux with PGF and Intel compilers.
# Differences in results across platforms tend to be larger and more frequent
# using the discrete ordinates method than the 2-stream method.  However, in
# all cases results with the specific compiler options given below agreed
# within 0.1% which is considered an acceptable level of difference.

# Linux PC with Portland Group 64-bit compiler (PGF90)
FFLAGS = -O2 -Mextend -Kieee
FC = pgf90
EXC = tuv

# Linux PC with Intel compiler (IFORT)
#FFLAGS = -O2 -mieee-fp -extend_source
#FC = ifort
#EXC = tuv

# Linux PC with GNU compiler (GFORTRAN)
#FFLAGS = -O2 -frecord-marker=4 -ffixed-line-length-0
#FC = gfortran
#EXC = tuv

#----------

$(EXC):		$(FOBJS) $(USE_INCL) 
		$(FC) $(FFLAGS) $(FOBJS) $(USE_INCL) $(LIBS) -o $@

$(USE_INCL):	$(INCLUDES)

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

clean:		
		rm -f core $(USE_INCL) $(FOBJS) $(EXC)
