/*
 * SUMMARY:      rad.h header file for radiation functions for DHSVM
 * USAGE:        Part of DHSVM
 *
 * AUTHOR:       Bart Nijssen
 * ORG:          University of Washington, Department of Civil Engineering
 * E-MAIL:       nijssen@u.washington.edu
 * ORIG-DATE:    Apr-1996
 * LAST-MOD: Wed Dec  3 13:59:00 1997 by Bart Nijssen <nijssen@u.washington.edu>
 * DESCRIPTION:  header file for radiation functions for DHSVM
 * DESCRIP-END.
 * FUNCTIONS:    
 * COMMENTS:     
 */

/* 	$Id: rad.h,v 1.2 2001/03/31 00:10:46 waichler Exp $	 */

#ifndef RAD_H
#define RAD_H

#include "data.h"

#define ALBEDO  0.15            /* WORK IN PROGRESS, See InitNewStep() */

void DecodeIPW(int EndStep, int NDaySteps, unsigned int Code, char *Value);

void SeparateRadiation(float TotalSolar, float ClearIndex, 
		       float *Beam, float *Diffuse);

void SolarAngle(float Latitude, float Albedo, float Declination, 
                float CellAspect, float CellSlope, float SunMax, 
                float SineSolarAltitude, float SolarTimeStep, int DayLight,
                float SolarAzimuth, float Dt, float *Direct, float *Diffuse);

void SolarConst(float lat_deg, float lat_min, float lng_deg, 
                float lng_min, float *StandardMeridian, float *Latitude, 
                float *Longitude);

void SolarDay(int DayOfYear, float Longitude, float Latitude, 
              float StandardMeridian, float *NoonHour, float *Declination, 
              float *HalfDayLength, float *Sunrise, float *Sunset, 
              float *TimeAdjustment, float *SunEarthDist);

void SolarHour(float Latitude, float LocalHour, float Dt, float NoonHour, 
               float Declination, float Sunrise, float Sunset, 
               float TimeAdjustment, float SunEarthDist, 
               float *SineSolarAltitude, int *DayLight, float *SolarTimeStep,
               float *SunMax, float *SolarAzimuth);

/*void CalcSolarDay(int DayOfYear, SOLARGEOMETRY *SolarGeo);

void CalcSolarHour(float StartHour, float Dt, SOLARGEOMETRY *SolarGeo);*/

#endif
