Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spring cleaning #169

Merged
merged 163 commits into from
Dec 4, 2014
Merged

Spring cleaning #169

merged 163 commits into from
Dec 4, 2014

Conversation

jhamman
Copy link
Member

@jhamman jhamman commented Dec 4, 2014

This pull request includes all of @bartnijssen's feature/reorg and feature/image changes including my feature/cleanup changes that address issue #162 .

Both drivers are compiling without errors or warnings (with one small exception in CalcBlowingSnow.c) with all gcc warning flags on (-Wall -Wextra).

Testing performed on this branch has confirmed that we are getting results in the "ballpark" of VIC 4.2 for the classic driver in both FULL_ENERGY and WATER_BALANCE modes. Below are two plots showing hourly output from a full energy run using the Rosemont example setup. Units are deg. C and mm respectively.

surft
evap

More testing is underway but I think we've met the minimum threshold to establish the develop branch as the VIC 5 threshold. Merging this now would be useful in the development of other drivers in the near future.

closes #162.

Conflicts:
	ChangeLog
	Makefile
	drivers/classic/src/initialize_model_state.c
	vic_run/include/LAKE.h
	vic_run/include/global.h
	vic_run/include/vicNl.h
	vic_run/src/full_energy.c
	vic_run/src/lakes.eb.c
global.h defined a number of global variables and was only included in
vicNl.c. There is not much of an advantage to this and is likely to lead
to confusion, since all the variables are already declared as externs in
the individual files where they are used or vicNl_def.h.
Reorganized the header files to support a clean split between the driver and the physical core of VIC.
In doing this I also separated the header files, so that they do not include other header files.
We'll keep only one header file for all the functions declarations that are part
VIC's physical core (vic_run).
I combined all the constants into a single vic_def.h file. Mainly to
avoid the problem that the same constants are defined differently in
different parts of the code. As is, there is a risk of "out of sight,
out of mind". Still need to split vic_def.h into a vic_run_def.h and
a vic_driver_def.h
Note that write_layer should NOT be part of vic_run. Instead, if
data is to be written out it should be passed to the driver.
Note that these functions need to be replaced. We need uniform logging
and within vic_run errors need to be handled in a generic manner.
Needs to be moved back to driver at some point
A few files still have dependencies on the driver that need to be
removed:
    * vic_driver_classic.h
        - dist_prec.c
        - put_data.c
        - vicerror.c
    * mtclim_constants.h
        - CalcBlowingSnow.c
        - compute_coszen.c
Main change in this commit is the removal of dist_prec

Conflicts:
	ChangeLog
	drivers/classic/src/initialize_model_state.c
	src/LAKE.h
	src/Makefile
	src/global.h
	src/vicNl.h
	vic_run/src/full_energy.c
	vic_run/src/lakes.eb.c
bartnijssen and others added 22 commits September 23, 2014 20:11
Conflicts:
	drivers/classic/src/initialize_atmos.c
	drivers/classic/src/vic_classic.c
	src/Makefile
	src/global.h
	src/vicNl.h
	vic_run/include/vic_def.h
	vic_run/src/calc_surf_energy_bal.c
	vic_run/src/canopy_evap.c
	vic_run/src/func_surf_energy_bal.c
	vic_run/src/runoff.c
	vic_run/src/solve_snow.c
	vic_run/src/surface_fluxes.c
	vic_run/src/vic_run.c

Note that this commit will break drivers/image since there have been changes in vic_run
… is used.

This is required for the code to work in image mode, where a time array of veg_hist is not available in the calling routine.
variables in Variable Argument Lists will be removed in a second commit
…resses almost all warnings and errors generated when using the -Wextra comiler flag
This commit includes the following changes:
- new header file for physical constants
- new structure for global model parameters
- new input file to allow for runtime definition of model parameters
- new initialization functions for options, global parameters, and model parameters
- removal of most, but not all, hard coded literals.
- new physics.c file in vic_run/src to handle frequently used physical computations
- new shared print library
- new global parameter options for blowing snow
- removal of model parameters from global parameter file

Uncrustify was run at the end of the changes.

The following commit will address a memory error in the model.
bartnijssen added a commit that referenced this pull request Dec 4, 2014
@bartnijssen bartnijssen merged commit 5f5435e into UW-Hydro:develop Dec 4, 2014
@jhamman jhamman deleted the feature/cleanup branch December 22, 2014 23:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants