      subroutine _name_(suntheta,sunphi, Eddif,Eddir)
c 
c     user template on file h41\template\skyirrad.txt
c
c     This template shows the form required for subroutines that 
c     return the sky irradiance distribution.  
c
c     The subroutines on files h41\maincode\gcirrad.f and cosirrad.f are
c     specific examples of how to implement this template.
c
c     A skyirrad routine is called by Hydrolight core routines to obtain
c     the direct and diffuse downwelling sky plane irradiances incident
c     onte the sea surface.  The skyirrad routine is incorporated into 
c     the Hydrolight core routines via include statements of the form
c        INCLUDE 'SKYIRRAD.INC'
c     The include file SKYIRRAD.INC is created by the front-end program
c     when the user selects the sky irradiance model to be used in the run.
c
c     The required format of the subroutine is
c
c     INPUT:
c     suntheta and sunphi give the sun's position (in radians, relative 
c          to phi = 0.0 in the sun's direction and thetas = 0.0 being
c          the zenith direction)
c
c**** Note: any other input needed by the user's irradiance model, such as
c           the current wavelength, can be passed via common blocks.
c
c     OUTPUT:
c
c     Eddif is the diffuse (background sky) downwelling spectral plane 
c         irradiance incident onto the sea surface, in units of W/(m^2 nm)
c     Eddir is the direct (solar beam) downwelling spectral plane irradiance
c         incident onto the sea surface, in units of W/(m^2 nm)
c
c     MUST save values between subroutine calls:
      save kall
      data kall/0/
c
      if(kall.eq.0) then
c
c        Initialization on the first call:
c
c        In this section, perform any initialization calculations that
c        need to be done only once, such as computing the parameters of
c        a model or reading in a data file.  
c
c------- Add user initialization code here: ---------------------------
c
c------- End user initialization code ---------------------------------
c
         kall = 1
      endif
c
c     Subsequent calls to the routine execute only the following code.
c     Use this code to define the sky irradiances for the given input
c     directions.  Make this code as efficient as possible.  
c
c---- Add user code here: -----------------------------------------------
c
c******* Note: be sure to define the sky irradiances by statements of the form
c        Eddir = ...
c        Eddif = ...
c
c---- End user code -----------------------------------------------------   
c
      return
      end
