Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: UW-Hydro/VIC
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: UW-Hydro/VIC
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: support/VIC.4.2.glacier
Choose a head ref
Can’t automatically merge. Don’t worry, you can still create the pull request.

Commits on Feb 26, 2014

  1. Copy the full SHA
    8b83ceb View commit details
  2. initial commit of VIC glacier port from Bibi Nazs VIC glacier code (b…

    …ased on VIC 4.1.2 beta 1) to the current VIC version (4.1.2.k)
    Joe Hamman committed Feb 26, 2014
    Copy the full SHA
    66f371a View commit details

Commits on Feb 27, 2014

  1. Remove glacier model from full_energy.c, add shell function for volum…

    …e area scaling.
    Joe Hamman committed Feb 27, 2014
    Copy the full SHA
    49723b5 View commit details

Commits on Mar 3, 2014

  1. Add volume-area scaling glacier model.

    Changes include:
    - new option for GLACIER (FALSE, DYNAMIC, SCALING) in global parameter file
    - rearanged soil and snow parameter file to put glacier parameters at the end of those files
    - add V-A scaling constants to vicNl.h
    Joe Hamman committed Mar 3, 2014
    Copy the full SHA
    4976dce View commit details
  2. Added clean (simplified without comments) global parameter file and m…

    …oved equal area and grid resolution parameters from Lakes section to Land Surface Files and Parameters.
    Joe Hamman committed Mar 3, 2014
    Copy the full SHA
    957900a View commit details
  3. add file suffixes .txt and .bin to ascii and binary outputs resepecti…

    …vely.
    Joe Hamman committed Mar 3, 2014
    Copy the full SHA
    5b2f377 View commit details

Commits on Mar 5, 2014

  1. remove sun1999 albedo option

    Joe Hamman committed Mar 5, 2014
    Copy the full SHA
    04642a7 View commit details
  2. Copy the full SHA
    9f2ca4a View commit details

Commits on Mar 7, 2014

  1. Fixes to glacier implementation

    - Applied timescaling in V-A scaling glacier model
    - Fixed bugs in snow->ice conversion in solve_snow.c
    Joe Hamman committed Mar 7, 2014
    Copy the full SHA
    5e606de View commit details

Commits on Mar 8, 2014

  1. Add snow density output variables, add iwq to state files, added glac…

    …ier specific parameters to vicNl_def.h, formating changes to display_current_settings.c
    Joe Hamman committed Mar 8, 2014
    Copy the full SHA
    9c175c2 View commit details

Commits on Mar 10, 2014

  1. add check to make sure elevation bands are ordered from high to low w…

    …hen glacier model is on
    Joe Hamman committed Mar 10, 2014
    Copy the full SHA
    35476a4 View commit details

Commits on Mar 13, 2014

  1. Port DHSVM glacier snow melt code to VIC.

    Joe Hamman committed Mar 13, 2014
    Copy the full SHA
    a26602b View commit details

Commits on Mar 17, 2014

  1. Fixes to snow_melt.c to ovoid nan propogation (divide by zero) when P…

    …ackSwq is depleted.
    Joe Hamman committed Mar 17, 2014
    Copy the full SHA
    4589427 View commit details

Commits on Mar 18, 2014

  1. read gl_active regardless of whether or not GLACIER is True (same beh…

    …avior as fs_active)
    Joe Hamman committed Mar 18, 2014
    Copy the full SHA
    313f9f6 View commit details
  2. add glacier variables to default snow and snowbands output files when…

    … options.glacier > 0
    Joe Hamman committed Mar 18, 2014
    Copy the full SHA
    dc523cb View commit details

Commits on Mar 24, 2014

  1. Fixes to glacier model application:

    - formating and style changes
    - strengthened warnings and errors when inputs were not correct
    - add default glacier variables to snow and snow_band ouput files
    - removed unused variables
    - removed commented out code
    - fixes to snow_melt.c code (IN PROGRESS)
    Joe Hamman committed Mar 24, 2014
    Copy the full SHA
    3321c2c View commit details

Commits on Mar 28, 2014

  1. Copy the full SHA
    b765510 View commit details
  2. Merge branch 'feature/glacier-snowmelt' into feature/glacier

    Conflicts:
    	src/output_list_utils.c
    	src/read_soilparam.c
    	src/set_output_defaults.c
    Joe Hamman committed Mar 28, 2014
    Copy the full SHA
    ebd59ae View commit details

Commits on Apr 29, 2014

  1. updates to snow_melt.c for glacier code.

    Joe Hamman committed Apr 29, 2014
    Copy the full SHA
    d5dc8ea View commit details

Commits on May 6, 2014

  1. Merge remote-tracking branch 'upstream/develop' into feature/glacier

    Conflicts:
    	src/display_current_settings.c
    	src/full_energy.c
    	src/global.h
    	src/solve_snow.c
    	src/vicNl.h
    	src/write_snow_data.c
    Joe Hamman committed May 6, 2014
    Copy the full SHA
    697004f View commit details

Commits on May 8, 2014

  1. remove old gl_flow code, replaced with vicerror. Bibi Naz is currentl…

    …y developing the gl_flow code and will be included later.
    Joe Hamman committed May 8, 2014
    Copy the full SHA
    e0c4acb View commit details

Commits on May 21, 2014

  1. ran uncrustify on snow_melt.c

    Joe Hamman committed May 21, 2014
    Copy the full SHA
    4a725a3 View commit details

Commits on May 22, 2014

  1. Copy the full SHA
    0e0b911 View commit details

Commits on May 23, 2014

  1. clean up of snow_melt.c

    Joe Hamman committed May 23, 2014
    Copy the full SHA
    4a63574 View commit details

Commits on May 27, 2014

  1. Copy the full SHA
    3244bd8 View commit details

Commits on May 28, 2014

  1. clean up calc_surf_energy_bal.c using uncrustify, remove old commente…

    …d out code.
    Joe Hamman committed May 28, 2014
    Copy the full SHA
    e223274 View commit details
  2. clean up snow_melt code

    Joe Hamman committed May 28, 2014
    Copy the full SHA
    3028d98 View commit details

Commits on May 30, 2014

  1. Copy the full SHA
    512fe7c View commit details

Commits on Jul 1, 2014

  1. updates to glacier model

    Joe Hamman committed Jul 1, 2014
    Copy the full SHA
    8414b45 View commit details
  2. revert snow_melt.c to develop branch version

    Joe Hamman committed Jul 1, 2014
    Copy the full SHA
    e2cd723 View commit details

Commits on Jul 10, 2014

  1. refactor of snow_melt routine for glacier model, small fix to v-a sca…

    …ling alg.
    Joe Hamman committed Jul 10, 2014
    Copy the full SHA
    c4089ba View commit details

Commits on Jul 14, 2014

  1. fixes to snow_depth and removal of debugging code

    Joe Hamman committed Jul 14, 2014
    Copy the full SHA
    42bcc45 View commit details

Commits on Aug 26, 2014

  1. Merge remote-tracking branch 'upstream/develop' into feature/glacier

    Conflicts:
    	src/calc_surf_energy_bal.c
    	src/display_current_settings.c
    	src/full_energy.c
    	src/global.h
    	src/vicNl_def.h
    Joe Hamman committed Aug 26, 2014
    Copy the full SHA
    7173d01 View commit details

Commits on Aug 28, 2014

  1. remove unused variables from snow routines

    Joe Hamman committed Aug 28, 2014
    Copy the full SHA
    6cb0551 View commit details
  2. remove old version of snow_melt code

    Joe Hamman committed Aug 28, 2014
    Copy the full SHA
    a4b6605 View commit details
  3. remove hard coded literals from snow routines

    Joe Hamman committed Aug 28, 2014
    Copy the full SHA
    e084d01 View commit details

Commits on Aug 29, 2014

  1. add validation checks for Glacier option, currently disallowing all s…

    …patial snow, blowing snow, and compute treeline options -- eventually these should work.
    Joe Hamman committed Aug 29, 2014
    Copy the full SHA
    ad8ee0d View commit details
  2. add validation checks for Glacier option, currently disallowing all s…

    …patial snow, blowing snow, and compute treeline options -- eventually these should work.
    Joe Hamman committed Aug 29, 2014
    Copy the full SHA
    6ab7843 View commit details
  3. Merge branch 'feature/glacier' of github.com:jhamman/VIC into feature…

    …/glacier
    
    Conflicts:
    	src/get_global_param.c
    Joe Hamman committed Aug 29, 2014
    Copy the full SHA
    d75fa6c View commit details

Commits on Sep 3, 2014

  1. clean up of snow routines, ran uncrustify and moved frequently used f…

    …ormulas to functions in snow_utility.c
    Joe Hamman committed Sep 3, 2014
    Copy the full SHA
    c6a4a06 View commit details
  2. created physics.c to handle frequently used functions such as the Ste…

    …fan Boltzman Law, latent heat of vaporization, etc.
    Joe Hamman committed Sep 3, 2014
    Copy the full SHA
    d95738f View commit details
  3. Copy the full SHA
    a541fc7 View commit details
  4. clean up hard coded literals in code, move some lake and blowing snow…

    … constants to vicNl_def.h
    Joe Hamman committed Sep 3, 2014
    Copy the full SHA
    905ef48 View commit details
  5. update gitignore file

    Joe Hamman committed Sep 3, 2014
    Copy the full SHA
    e3592f0 View commit details

Commits on Sep 4, 2014

  1. Copy the full SHA
    97bfaca View commit details
  2. remove debugging code from glacier.c

    Joe Hamman committed Sep 4, 2014
    Copy the full SHA
    7d28cb0 View commit details
  3. fixes to snow_to_ice conversion and addition of coldcontent conservat…

    …ion to glacier model
    Joe Hamman committed Sep 4, 2014
    Copy the full SHA
    14696ab View commit details

Commits on Sep 24, 2014

  1. Merge branch 'feature/print_library' into feature/glacier

    Conflicts:
    	src/Makefile
    	src/vicNl_def.h
    Joe Hamman committed Sep 24, 2014
    Copy the full SHA
    119d42f View commit details
  2. Copy the full SHA
    d3c59ba View commit details
  3. add glacier outflow option

    Joe Hamman committed Sep 24, 2014
    Copy the full SHA
    7c50e1d View commit details
Showing with 4,059 additions and 3,092 deletions.
  1. +8 −0 .gitignore
  2. +154 −0 samples/global.param.clean.sample
  3. +4 −2 samples/global.param.sample
  4. +2 −8 src/CalcBlowingSnow.c
  5. +1 −3 src/IceEnergyBalance.c
  6. +0 −6 src/LAKE.h
  7. +3 −3 src/Makefile
  8. +7 −7 src/SnowPackEnergyBalance.c
  9. +1 −1 src/advected_sensible_heat.c
  10. +4 −4 src/arno_evap.c
  11. +1 −1 src/calc_longwave.c
  12. +1,119 −1,032 src/calc_surf_energy_bal.c
  13. +1 −1 src/canopy_evap.c
  14. +1 −1 src/compute_coszen.c
  15. +1 −1 src/compute_pot_evap.c
  16. +3 −3 src/compute_soil_resp.c
  17. +35 −29 src/display_current_settings.c
  18. +22 −10 src/full_energy.c
  19. +1 −2 src/func_atmos_energy_bal.c
  20. +1 −1 src/func_atmos_moist_bal.c
  21. +6 −7 src/func_canopy_energy_bal.c
  22. +5 −5 src/func_surf_energy_bal.c
  23. +55 −3 src/get_global_param.c
  24. +141 −0 src/glacier.c
  25. +1 −1 src/global.h
  26. +11 −11 src/ice_melt.c
  27. +175 −174 src/initialize_atmos.c
  28. +1 −0 src/initialize_global.c
  29. +2 −2 src/initialize_lake.c
  30. +7 −6 src/initialize_model_state.c
  31. +20 −5 src/initialize_snow.c
  32. +35 −35 src/lakes.eb.c
  33. +1 −1 src/latent_heat_from_snow.c
  34. +7 −7 src/make_dmy.c
  35. +8 −3 src/make_in_and_outfiles.c
  36. +5 −5 src/mtclim_vic.c
  37. +18 −18 src/mtclim_wrapper.c
  38. +29 −0 src/output_list_utils.c
  39. +2 −3 src/penman.c
  40. +81 −0 src/physics.c
  41. +2 −2 src/prepare_full_energy.c
  42. +12 −1 src/print_library.c
  43. +71 −36 src/put_data.c
  44. +1 −1 src/read_atmos_data.c
  45. +21 −10 src/read_initial_model_state.c
  46. +1 −1 src/read_lakeparam.c
  47. +50 −3 src/read_snowband.c
  48. +42 −27 src/read_soilparam.c
  49. +3 −3 src/runoff.c
  50. +20 −3 src/set_output_defaults.c
  51. +1 −1 src/snow.h
  52. +8 −8 src/snow_intercept.c
  53. +781 −766 src/snow_melt.c
  54. +341 −217 src/snow_utility.c
  55. +2 −2 src/soil_carbon_balance.c
  56. +6 −6 src/soil_conduction.c
  57. +578 −544 src/solve_snow.c
  58. +8 −9 src/surface_fluxes.c
  59. +1 −1 src/svp.c
  60. +3 −0 src/vicNl.c
  61. +15 −5 src/vicNl.h
  62. +84 −20 src/vicNl_def.h
  63. +4 −4 src/water_energy_balance.c
  64. +2 −2 src/write_data.c
  65. +3 −3 src/write_forcing_file.c
  66. +5 −7 src/write_header.c
  67. +15 −9 src/write_model_state.c
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -15,5 +15,13 @@
*.dylib

vicNl
DEPEND
.depend
VIC.sublime-project
VIC.sublime-workspace
*.sublime-project
*.sublime-workspace

.DS_Store

*.uncrustify
154 changes: 154 additions & 0 deletions samples/global.param.clean.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
#######################################################################
# VIC Model Parameters - 4.1.x
#######################################################################

#######################################################################
# Simulation Parameters
#######################################################################
NLAYER 3
NODES 10
TIME_STEP 3
SNOW_STEP 3
STARTYEAR 2000
STARTMONTH 01
STARTDAY 01
STARTHOUR 00
ENDYEAR 2000
ENDMONTH 12
ENDDAY 31

#######################################################################
# Energy Balance Parameters
#######################################################################
FULL_ENERGY FALSE
#CLOSE_ENERGY FALSE

#######################################################################
# Soil Temperature Parameters
#######################################################################
FROZEN_SOIL FALSE
#QUICK_FLUX FALSE
#IMPLICIT TRUE
#QUICK_SOLVE FALSE
#NO_FLUX FALSE
#EXP_TRANS TRUE
#GRND_FLUX_TYPE GF_410

#TFALLBACK TRUE
#SPATIAL_FROST FALSE (Nfrost)

#######################################################################
# Precip (Rain and Snow) Parameters
# Generally these default values do not need to be overridden
#######################################################################
#SNOW_DENSITY DENS_BRAS
#BLOWING FALSE
#GLACIER FALSE
#GLACIER_OVERFLOW TRUE
#COMPUTE_TREELINE FALSE
#DIST_PRCP FALSE
#PREC_EXPT 0.6
#CORRPREC FALSE
#MAX_SNOW_TEMP 0.5
#MIN_RAIN_TEMP -0.5

#######################################################################
# Turbulent Flux Parameters
# Generally these default values do not need to be overridden
#######################################################################
#MIN_WIND_SPEED 0.1
#AERO_RESIST_CANSNOW AR_406_FULL

#######################################################################
# Meteorological Forcing Disaggregation Parameters
# Generally these default values do not need to be overridden
#######################################################################
#OUTPUT_FORCE FALSE
#PLAPSE TRUE
#SW_PREC_THRESH 0
#MTCLIM_SWE_CORR TRUE
#VP_ITER VP_ITER_ANNUAL
#VP_INTERP TRUE
#LW_TYPE LW_PRATA
#LW_CLOUD LW_CLOUD_DEARDORFF

#######################################################################
# Miscellaneous Simulation Parameters
# Generally these default values do not need to be overridden
#######################################################################
#CONTINUEONERROR TRUE
#LOG_MATRIC FALSE
#SPATIAL_SNOW FALSE

#######################################################################
# State Files and Parameters
#######################################################################
#INIT_STATE (put the initial state path/filename here)
#STATENAME (put the path/prefix of output state file here)
#STATEYEAR 2000
#STATEMONTH 12
#STATEDAY 31
#BINARY_STATE_FILE FALSE

#######################################################################
# Forcing Files and Parameters
#######################################################################
FORCING1 (put the forcing path/prefix here)
FORCE_FORMAT BINARY
FORCE_ENDIAN LITTLE
N_TYPES 4
FORCE_TYPE PREC UNSIGNED 40
FORCE_TYPE TMAX SIGNED 100
FORCE_TYPE TMIN SIGNED 100
FORCE_TYPE WIND SIGNED 100
FORCE_DT 24
FORCEYEAR 2000
FORCEMONTH 01
FORCEDAY 01
FORCEHOUR 00
GRID_DECIMAL 4
WIND_H 10.0
MEASURE_H 2.0
ALMA_INPUT FALSE

#######################################################################
# Land Surface Files and Parameters
#######################################################################
SOIL (put the soil parameter path/file here)
ARC_SOIL FALSE
#SOIL_DIR (soil param directory)
BASEFLOW ARNO
JULY_TAVG_SUPPLIED FALSE
ORGANIC_FRACT FALSE
VEGLIB (put the veg library path/file here)
VEGPARAM (put the veg parameter path/file here)
ROOT_ZONES 3
VEGPARAM_LAI TRUE
LAI_SRC LAI_FROM_VEGLIB
SNOW_BAND 1
#EQUAL_AREA FALSE
#RESOLUTION 0.125

#######################################################################
# Lake Simulation Parameters
# These need to be un-commented and set to correct values only when running lake model (LAKES is not FALSE)
#######################################################################
#LAKES (put lake parameter path/file here)
#LAKE_PROFILE FALSE

#######################################################################
# Output Files and Parameters
#######################################################################
RESULT_DIR (put the result directory path here)
OUT_STEP 0
SKIPYEAR 0
COMPRESS FALSE
BINARY_OUTPUT FALSE
ALMA_OUTPUT FALSE
MOISTFRACT FALSE
PRT_HEADER FALSE
PRT_SNOW_BAND FALSE

#######################################################################
# Output File Contents
#######################################################################
6 changes: 4 additions & 2 deletions samples/global.param.sample
Original file line number Diff line number Diff line change
@@ -48,6 +48,8 @@ FROZEN_SOIL FALSE # TRUE = calculate frozen soils. Default = FALSE.
#######################################################################
#SNOW_DENSITY DENS_BRAS # DENS_BRAS = use traditional VIC algorithm taken from Bras, 1990; DENS_SNTHRM = use algorithm taken from SNTHRM model.
#BLOWING FALSE # TRUE = compute evaporative fluxes due to blowing snow
#GLACIER FALSE # DYNAMIC = use dynamic glacier model, SCALING = use V-A scaling glacier model
#GLACIER_OVERFLOW TRUE
#COMPUTE_TREELINE FALSE # Can be either FALSE or the id number of an understory veg class; FALSE = turn treeline computation off; VEG_CLASS_ID = replace any overstory veg types with the this understory veg type in all snow bands for which the average July Temperature <= 10 C (e.g. "COMPUTE_TREELINE 10" replaces any overstory veg cover with class 10)
#CORRPREC FALSE # TRUE = correct precipitation for gauge undercatch
#MAX_SNOW_TEMP 0.5 # maximum temperature (C) at which snow can fall
@@ -170,15 +172,15 @@ ROOT_ZONES 3 # Number of root zones (must match format of veg param file)
#ALB_SRC FROM_VEGLIB # FROM_VEGPARAM = read albedo from veg param file; FROM_VEGLIB = read albedo from veg library file
#VEGCOVER_SRC FROM_VEGLIB # FROM_VEGPARAM = read veg_cover from veg param file; FROM_VEGLIB = read veg_cover from veg library file
SNOW_BAND 1 # Number of snow bands; if number of snow bands > 1, you must insert the snow band path/file after the number of bands (e.g. SNOW_BAND 5 my_path/my_snow_band_file)
#EQUAL_AREA FALSE # TRUE = grid cells are from an equal-area projection; FALSE = grid cells are on a regular lat-lon grid. Only needed when either LAKES or GLACIER is being used.
#RESOLUTION 0.125 # Grid cell resolution (degrees if EQUAL_AREA is FALSE, km^2 if EQUAL_AREA is TRUE); ignored if LAKES is FALSE. Only needed when either LAKES or GLACIER is being used.

#######################################################################
# Lake Simulation Parameters
# These need to be un-commented and set to correct values only when running lake model (LAKES is not FALSE)
#######################################################################
#LAKES (put lake parameter path/file here) # Lake parameter path/file
#LAKE_PROFILE FALSE # TRUE = User-specified depth-area parameters in lake parameter file; FALSE = VIC computes a parabolic depth-area profile
#EQUAL_AREA FALSE # TRUE = grid cells are from an equal-area projection; FALSE = grid cells are on a regular lat-lon grid
#RESOLUTION 0.125 # Grid cell resolution (degrees if EQUAL_AREA is FALSE, km^2 if EQUAL_AREA is TRUE); ignored if LAKES is FALSE

#######################################################################
# Output Files and Parameters
10 changes: 2 additions & 8 deletions src/CalcBlowingSnow.c
Original file line number Diff line number Diff line change
@@ -32,13 +32,7 @@

static char vcid[] = "$Id$";

#define GRAMSPKG 1000.
#define CH_WATER 4186.8e3
#define JOULESPCAL 4.1868 /* Joules per calorie */
#define Ka .0245187 /* thermal conductivity of air (W/mK) */
#define CSALT 0.68 /* saltation constant m/s */
#define UTHRESH 0.25 /* threshold shear velocity m/s */
#define KIN_VIS 1.3e-5 /* Kinemativ viscosity of air (m2/s) */
#define MAX_ITER 100 /* Max. iterations for numerical integration */
#define K 5
#define MACHEPS 1.0e-6 /* Accuracy tolerance for numerical integration */
@@ -146,7 +140,7 @@ double CalcBlowingSnow( double Dt,
double Transport;
int count=0;

Lv = (2.501e6 - 0.002361e6 * Tsnow);
Lv = calc_latent_heat_of_vaporization(Tsnow);
/*******************************************************************/
/* Calculate some general variables, that don't depend on wind speed. */

@@ -156,7 +150,7 @@ double CalcBlowingSnow( double Dt,
/* Saturation density of water vapor, Liston A-8 */
es = svp(Tair);

Tk = Tair + KELVIN;
Tk = Tair + KELVIN;

Ros = 0.622*es/(287*Tk);

4 changes: 1 addition & 3 deletions src/IceEnergyBalance.c
Original file line number Diff line number Diff line change
@@ -201,9 +201,7 @@ double IceEnergyBalance(double TSurf, va_list ap)
*Ra_used = HUGE_RESIST;

/* Calculate longwave exchange and net radiation */

*LongRadOut = LongRadIn - STEFAN_B * (TMean+273.15) * (TMean+273.15)
* (TMean+273.15) * (TMean+273.15);
*LongRadOut = LongRadIn - calc_outgoing_longwave(TMean+KELVIN, EMISS);
NetRad = ShortRad + *LongRadOut;

/* Calculate the sensible heat flux */
6 changes: 0 additions & 6 deletions src/LAKE.h
Original file line number Diff line number Diff line change
@@ -35,11 +35,6 @@

#define LAKE_SET
#define TMELT 0.0
#define EMICE 0.97 /* Ice emissivity */
#define EMH2O .98
#define RHOSNOW 250. /* densities of water and snow */
#define RHOICE 917. /* ice density*/
#define rhosurf 1.275 /* surface air density */
#define MAX_SURFACE_LAKE .6 /* max. surface layer thickness for E-B (m) */
#define BETA 0.001 /* Curve shape parameter for lake profile. */
#define FRACMIN 0.10 /* min ice thickness in meters */
@@ -65,7 +60,6 @@
#define a1 0.7 /* Percent of radiation in visible band. */
#define a2 0.3 /* Percent of radiation in infrared band. */
#define QWTAU 86400./2. /* D. Pollard sub-ice time constant. */
#define RADIUS 6371.228 /* Earth radius in km. */

//#endif // LAKE_SET

6 changes: 3 additions & 3 deletions src/Makefile
Original file line number Diff line number Diff line change
@@ -105,15 +105,15 @@ OBJS = CalcAerodynamic.o CalcBlowingSnow.o SnowPackEnergyBalance.o \
display_current_settings.o estimate_T1.o faparl.o free_all_vars.o \
free_vegcon.o frozen_soil.o full_energy.o func_atmos_energy_bal.o \
func_atmos_moist_bal.o func_canopy_energy_bal.o \
func_surf_energy_bal.o get_dist.o get_force_type.o get_global_param.o \
func_surf_energy_bal.o get_dist.o get_force_type.o get_global_param.o glacier.o \
initialize_atmos.o initialize_model_state.o \
initialize_global.o initialize_snow.o \
initialize_soil.o initialize_veg.o latent_heat_from_snow.o \
make_cell_data.o make_all_vars.o make_dmy.o make_energy_bal.o \
make_in_and_outfiles.o make_snow_data.o make_veg_var.o massrelease.o \
modify_Ksat.o mtclim_vic.o mtclim_wrapper.o newt_raph_func_fast.o \
nrerror.o open_file.o open_state_file.o \
output_list_utils.o parse_output_info.o penman.o photosynth.o \
output_list_utils.o parse_output_info.o penman.o photosynth.o physics.o\
prepare_full_energy.o print_library.o put_data.o \
read_atmos_data.o read_forcing_data.o read_initial_model_state.o \
read_snowband.o read_soilparam.o read_veglib.o \
@@ -147,7 +147,7 @@ full:
make model

clean::
/bin/rm -f *.o core log *~
/bin/rm -f *.o core log vicNl DEPEND *~

model: $(OBJS)
$(CC) -o vicNl$(EXT) $(OBJS) $(CFLAGS) $(LIBRARY)
14 changes: 7 additions & 7 deletions src/SnowPackEnergyBalance.c
Original file line number Diff line number Diff line change
@@ -247,25 +247,25 @@ double SnowPackEnergyBalance(double TSurf, va_list ap)
/* Calculate longwave exchange and net radiation */

Tmp = TMean + KELVIN;
(*NetLongUnder) = LongSnowIn - STEFAN_B * Tmp * Tmp * Tmp * Tmp;
(*NetLongUnder) = LongSnowIn - calc_outgoing_longwave(Tmp, EMISS);
NetRad = NetShortUnder + (*NetLongUnder);

/* Calculate the sensible heat flux */

*SensibleHeat = AirDens * Cp * (Tair - TMean) / Ra_used[0];
*SensibleHeat = calc_sensible_heat(AirDens, Tair, TMean, Ra_used[0]);

if (options.SPATIAL_SNOW) {
/* Add in Sensible heat flux turbulent exchange from surrounding
snow free patches - if present */
if ( SnowCoverFract > 0 ) {
if ( SnowCoverFract > 0. ) {
*(AdvectedSensibleHeat) = advected_sensible_heat(SnowCoverFract,
AirDens, Tair, TGrnd,
Ra_used[0]);
}
else (*AdvectedSensibleHeat) = 0;
else (*AdvectedSensibleHeat) = 0.;
}
else {
(*AdvectedSensibleHeat) = 0;
(*AdvectedSensibleHeat) = 0.;
}

/* Convert sublimation terms from m/timestep to kg/m2s */
@@ -290,7 +290,7 @@ double SnowPackEnergyBalance(double TSurf, va_list ap)
/* Calculate advected heat flux from rain
Equation 7.3.12 from H.B.H. for rain falling on melting snowpack */

if ( TMean == 0 )
if ( TMean == 0. )
*AdvectedEnergy = (CH_WATER * (Tair) * Rain) / (Dt);
else
*AdvectedEnergy = 0.;
@@ -304,7 +304,7 @@ double SnowPackEnergyBalance(double TSurf, va_list ap)
*GroundFlux = 2.9302e-6 * SnowDensity * SnowDensity
* (TGrnd - TMean) / SnowDepth / (Dt);
}
else *GroundFlux=0;
else *GroundFlux = 0.;
*DeltaColdContent -= *GroundFlux;

/* Calculate energy balance error at the snowpack surface */
2 changes: 1 addition & 1 deletion src/advected_sensible_heat.c
Original file line number Diff line number Diff line change
@@ -27,7 +27,7 @@ double advected_sensible_heat(double SnowCoverFract,
double val;

/* Compute sensible heat flux from bare patches */
Qbare = AirDens * Cp * (Tair - TGrnd) / Ra;
Qbare = calc_sensible_heat(AirDens, Tair, TGrnd, Ra);

/* Compute fraction of sensible heat that contributes to snowmelt */
if ( SnowCoverFract > 0.6 ) Fs = 1.0;
8 changes: 4 additions & 4 deletions src/arno_evap.c
Original file line number Diff line number Diff line change
@@ -183,10 +183,10 @@ double arno_evap(layer_data_struct *layer,

/* only consider positive evaporation; we won't put limits on condensation */
if (evap > 0.0) {
if (moist > moist_resid * depth1 * 1000.) {
if (moist > moist_resid * depth1 * MMPERMETER) {
/* there is liquid moisture available; cap evap at available liquid moisture */
if (evap > moist - moist_resid * depth1 * 1000.) {
evap = moist - moist_resid * depth1 * 1000.;
if (evap > moist - moist_resid * depth1 * MMPERMETER) {
evap = moist - moist_resid * depth1 * MMPERMETER;
}
}
else {
@@ -196,7 +196,7 @@ double arno_evap(layer_data_struct *layer,
}

layer[0].evap = evap;
Evap += evap / 1000. / delta_t;
Evap += evap / MMPERMETER / delta_t;

return(Evap);

2 changes: 1 addition & 1 deletion src/calc_longwave.c
Original file line number Diff line number Diff line change
@@ -70,7 +70,7 @@ void calc_longwave(double *longwave,
emissivity = cloudfactor*emissivity_clear;
}

*longwave = emissivity * STEFAN_B * air_temp * air_temp * air_temp * air_temp;
*longwave = calc_outgoing_longwave(air_temp, emissivity);

}

Loading