|
| 1 | +/****************************************************************************** |
| 2 | +// $Id$ |
| 3 | + Modifications: |
| 4 | + 2006-Nov-07 Removed LAKE_MODEL option. TJB |
| 5 | + 2007-Aug-16 Made return value of initialize_prcp an int. JCA |
| 6 | + 2007-Aug-21 Added features for EXCESS_ICE option. JCA |
| 7 | + 2007-Oct-24 Changed get_sarea, get_volume, and get_depth to return exit |
| 8 | + status so that errors can be trapped and communicated up the |
| 9 | + chain of function calls. KAC via TJB |
| 10 | + 2007-Oct-24 Changed lakeice() to return exit status. KAC via TJB |
| 11 | + 2007-Nov-06 New lake physics parameters. Modified argument lists for |
| 12 | + various functions. Moved get_dist() to vicNl.h. LCB via TJB |
| 13 | + 2008-Apr-21 Added argument to alblake. LCB via TJB |
| 14 | + 2008-Sep-10 Updated values of CONDS and lamwlw to match Laura |
| 15 | + Bowling's lake work. LCB via TJB |
| 16 | + 2009-Jul-31 Removed lakemain() and wetland_energy(); initialize_lake |
| 17 | + no longer takes a snow structure as input. TJB |
| 18 | + 2009-Sep-28 Removed initialize_prcp and update_prcp. Modified |
| 19 | + argument list of initialize_lake. TJB |
| 20 | + 2009-Sep-30 Miscellaneous fixes for lake model. TJB |
| 21 | + 2009-Oct-05 Added functions for updating/rescaling lake and wetland |
| 22 | + fluxes and storages when lake area changes. TJB |
| 23 | + 2010-Nov-11 Added skip_hydro flag to initialize_lake() arg list. |
| 24 | + Removed rescale_lake_fluxes(). TJB |
| 25 | + 2010-Nov-26 Changed the argument list of water_balance(). TJB |
| 26 | + 2010-Dec-28 Added latitude to alblake() arglist. TJB |
| 27 | + 2011-Mar-01 Added rescale_snow_storage(). Added terms to argument |
| 28 | + list of initialize_lake(). TJB |
| 29 | + 2013-Jul-25 Added advect_carbon_storage(). TJB |
| 30 | + 2013-Dec-26 Removed EXCESS_ICE option. TJB |
| 31 | + 2014-Mar-28 Removed DIST_PRCP option. TJB |
| 32 | +******************************************************************************/ |
| 33 | + |
| 34 | +//#ifndef LAKE_SET |
| 35 | + |
| 36 | +#define LAKE_SET |
| 37 | +#define TMELT 0.0 |
| 38 | +#define EMICE 0.97 /* Ice emissivity */ |
| 39 | +#define EMH2O .98 |
| 40 | +#define RHOSNOW 250. /* densities of water and snow */ |
| 41 | +#define RHOICE 917. /* ice density*/ |
| 42 | +#define rhosurf 1.275 /* surface air density */ |
| 43 | +#define MAX_SURFACE_LAKE .6 /* max. surface layer thickness for E-B (m) */ |
| 44 | +#define BETA 0.001 /* Curve shape parameter for lake profile. */ |
| 45 | +#define FRACMIN 0.10 /* min ice thickness in meters */ |
| 46 | +#define FRACLIM 0.02 /* lower limit on fractional ice cover */ |
| 47 | +#define CPW_ICE 4200. /* specific heat of ice */ |
| 48 | +#define DM 1.38889E-07 /* molecular diffusivity of water */ |
| 49 | +#define SNOWCRIT 0.05 /* for albedo, in m */ |
| 50 | +//#define G 9.80616 |
| 51 | +#define ZWATER 0.0045 // 0.004 - original value |
| 52 | +#define ZSNOW 0.005 |
| 53 | +#define CONDI 2.3 /* thermal conductivity of ice */ |
| 54 | +#define CONDS 0.7 /* thermal conductivity of snow */ |
| 55 | + |
| 56 | +// attenuation of short and longwave radiation through ice (1/m) |
| 57 | +#define lamisw 1.5 // 1.5 in Patterson & Hamblin |
| 58 | +#define lamilw 20 // 20.0 in Patterson & Hamblin |
| 59 | +// attenuation of short and longwave radiation through snow (1/m) |
| 60 | +#define lamssw 6.0 // 6.0 in Patterson & Hamblin |
| 61 | +#define lamslw 20 // 20.0 in Patterson & Hamblin |
| 62 | +// attenuation of short and longwave radiation through water (1/m) |
| 63 | +#define lamwsw .3 // San Fran Bay data: 0.31 - 29.9 1/m (visible) |
| 64 | +#define lamwlw 1.4 // Hostetler and Bartlein assume 0.85 1/m (total) |
| 65 | +#define a1 0.7 /* Percent of radiation in visible band. */ |
| 66 | +#define a2 0.3 /* Percent of radiation in infrared band. */ |
| 67 | +#define QWTAU 86400./2. /* D. Pollard sub-ice time constant. */ |
| 68 | +#define RADIUS 6371.228 /* Earth radius in km. */ |
| 69 | + |
| 70 | +//#endif // LAKE_SET |
| 71 | + |
| 72 | +/*** Subroutine prototypes ***/ |
| 73 | + |
| 74 | +double adjflux(double, double, double ,double, double, double, double, |
| 75 | + double, double, double, double *, double *); |
| 76 | +void advect_carbon_storage(double, double, lake_var_struct *, cell_data_struct *); |
| 77 | +void advect_soil_veg_storage(double, double, double, double *, soil_con_struct *, veg_con_struct *, cell_data_struct *, veg_var_struct *, lake_con_struct); |
| 78 | +void advect_snow_storage(double, double, double, snow_data_struct *); |
| 79 | +void alblake(double, double, double *, double *, float *, float *, double, double, |
| 80 | + int, int *, double, double, char *, int, double); |
| 81 | +double calc_density(double); |
| 82 | +double CalcIcePackEnergyBalance(double Tsurf, ...); |
| 83 | +void colavg (double *, double *, double *, float, double *, int, double, double); |
| 84 | +float dragcoeff(float, double, double); |
| 85 | +void eddy (int, double, double * , double *, double *, double, int, double, double); |
| 86 | +void energycalc(double *, double *, int, double, double,double *, double *, double *); |
| 87 | +double ErrorIcePackEnergyBalance(double Tsurf, ...); |
| 88 | +double ErrorPrintIcePackEnergyBalance(double, va_list); |
| 89 | +int get_depth(lake_con_struct, double, double *); |
| 90 | +int get_sarea(lake_con_struct, double, double *); |
| 91 | +int get_volume(lake_con_struct, double, double *); |
| 92 | +void iceform (double *,double *,double ,double,double *,int, int, double, double, double *, double *, double *, double *, double *, double); |
| 93 | +void icerad(double,double ,double,double *, double *,double *); |
| 94 | +int ice_melt(double, double, double *, double, snow_data_struct *, lake_var_struct *, int, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double *, double *, double *, double *, double *, double *, double *, double *, double *, double); |
| 95 | +double IceEnergyBalance(double, va_list); |
| 96 | +int initialize_lake(lake_var_struct *, lake_con_struct, soil_con_struct *, cell_data_struct *, double, int); |
| 97 | +int lakeice(double *, double, double, double, double, int, |
| 98 | + double, double, double *, double, double, int, dmy_struct, double *, double *, double, double); |
| 99 | +void latsens(double,double, double, double, double, double, double, double, |
| 100 | + double *, double *, double); |
| 101 | +float lkdrag(float, double, double, double, double); |
| 102 | +lake_con_struct read_lakeparam(FILE *, soil_con_struct, veg_con_struct *); |
| 103 | +void rescale_soil_veg_fluxes(double, double, cell_data_struct *, veg_var_struct *); |
| 104 | +void rescale_snow_energy_fluxes(double, double, snow_data_struct *, energy_bal_struct *); |
| 105 | +void rescale_snow_storage(double, double, snow_data_struct *); |
| 106 | +void rhoinit(double *, double); |
| 107 | +int solve_lake(double, double, double, double, double, double, double, double, |
| 108 | + double, double, lake_var_struct *, lake_con_struct, |
| 109 | + soil_con_struct, int, int, double, dmy_struct, double); |
| 110 | +double specheat (double); |
| 111 | +void temp_area(double, double, double, double *, double *, double *, double *, int, double *, int, double, double, double*, double *, double *); |
| 112 | +void tracer_mixer(double *, int *, int, double*, int, double, double, double *); |
| 113 | +void tridia(int, double *, double *, double *, double *, double *); |
| 114 | +int water_balance (lake_var_struct *, lake_con_struct, int, all_vars_struct *, int, int, int, double, soil_con_struct, veg_con_struct); |
| 115 | +int water_energy_balance(int, double*, double*, int, int, double, double, double, double, double, double, double, double, double, double, double, double, double, double *, double *, double *, double*, double *, double *, double *, double, double *, double *, double *, double *, double *, double); |
| 116 | +int water_under_ice(int, double, double, double *, double *, double, int, double, double, double, double *, double *, double *, double *, int, double, double, double, double *); |
0 commit comments