Skip to content

Commit 59b9fd6

Browse files
author
Joe Hamman
authored
Merge pull request #679 from UW-Hydro/revert-677-develop
Revert "Merge VIC5.0.1 release into develop branch"
2 parents 69ed683 + 0717136 commit 59b9fd6

File tree

11 files changed

+28
-106
lines changed

11 files changed

+28
-106
lines changed

docs/Development/ReleaseNotes.md

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -14,30 +14,6 @@ To check which release of VIC you are running:
1414
- For VIC 5 and later, type `vic_{classic,image}.exe -v`
1515

1616
------------------------------
17-
18-
## VIC 5.1.0
19-
20-
**Release date: (Unreleased)**
21-
22-
#### Model enhancement:
23-
24-
1. Improved calculation of drainage between soil layers ([GH#656](https://github.com/UW-Hydro/VIC/pull/656))
25-
26-
Drainage from upper layer to adjacent lower layer is calculated according to Brook & Corey curve (where drainage rate is a function of upper-layer soil moisture). In previous versions, a simple numerical solution is applied which uses the timestep-beginning upper-layer soil moisture to calculate drainage rate, and assume this constant rate over the entire timestep. This can cause unreasonably large drainage if the curve has a steep shape and when soil moisture is high. Now, the current version uses exact integral (instead of numerical solution) for layer drainage calculation.
27-
28-
2. Fixes for the CESM driver ([GH#642](https://github.com/UW-Hydro/VIC/pull/642))
29-
30-
1. Using correct fill value datatypes in MPI Gather steps
31-
2. Updated state file name time step to be period-ending rather than period-beginning
32-
3. Set the state file name to the RASM case ID
33-
4. Removed decimal point for missing values for unsigned integers
34-
5. Create dummy forcings when initializing the model (so that there is forcing data for the first time step)
35-
6. Changed pressure units from kPa to Pa
36-
7. Fixed bug that prevented using the correct local domain grid cells in `cesm_put_data.c`
37-
8. Changed reference temperature units from Celsius to Kelvin in `cesm_put_data.c`
38-
39-
------------------------------
40-
4117
## VIC 5.0.1
4218

4319
**Release date: (February 1, 2017)**
@@ -85,7 +61,7 @@ To check which release of VIC you are running:
8561

8662
------------------------------
8763

88-
## VIC 5.0.0 [![DOI](https://zenodo.org/badge/doi/10.5281/zenodo.61422.svg)](http://dx.doi.org/10.5281/zenodo.61422)
64+
## VIC 5.0.0 [![DOI](https://zenodo.org/badge/7766/UW-Hydro/VIC.svg)](https://zenodo.org/badge/latestdoi/7766/UW-Hydro/VIC)
8965

9066
**Release date: (September 2, 2016)**
9167

@@ -260,7 +236,6 @@ This is a major update from VIC 4. The VIC 5.0.0 release aims to have nearly ide
260236

261237
Fixed a bug where volumetric heat capacity of water should be used in `func_canopy_energy_bal` (previously specific heat capacity was used).
262238

263-
264239
------------------------------
265240

266241
## VIC 4.2.d [![DOI](https://zenodo.org/badge/doi/10.5281/zenodo.56058.svg)](http://dx.doi.org/10.5281/zenodo.56058)

vic/drivers/cesm/src/cesm_interface_c.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,6 @@ vic_cesm_init(vic_clock *vclock,
9696
// populate model state, either using a cold start or from a restart file
9797
vic_populate_model_state(trim(cmeta->starttype));
9898

99-
// initialize forcings
100-
vic_force();
101-
10299
// initialize output structures
103100
vic_init_output(&dmy_current);
104101

@@ -140,7 +137,6 @@ vic_cesm_run(vic_clock *vclock)
140137

141138
// if save:
142139
if (vclock->state_flag) {
143-
// write state file
144140
vic_store(&dmy_current, state_filename);
145141
write_rpointer_file(state_filename);
146142
}

vic/drivers/cesm/src/cesm_put_data.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -140,12 +140,12 @@ vic_cesm_put_data()
140140

141141
// 2m reference temperature
142142
// CESM units: K
143-
l2x_vic[i].l2x_Sl_tref += AreaFactor * (force[i].air_temp[NR] + CONST_TKFRZ);
143+
l2x_vic[i].l2x_Sl_tref += AreaFactor * force->air_temp[NR];
144144

145145
// 2m reference specific humidity
146146
// CESM units: g/g
147147
l2x_vic[i].l2x_Sl_qref += AreaFactor * CONST_EPS *
148-
force[i].vp[NR] / force[i].pressure[NR];
148+
force->vp[NR] / force->pressure[NR];
149149

150150
// Albedo Note: VIC does not partition its albedo, all returned
151151
// values will be the same
@@ -156,10 +156,10 @@ vic_cesm_put_data()
156156
// force->NetShortAtmos net shortwave flux (+ down)
157157
// SWup = force->shortwave[NR] - energy.NetShortAtmos
158158
// Set the albedo to zero for the case where there is no shortwave down
159-
if (force[i].shortwave[NR] > 0.) {
159+
if (force->shortwave[NR] > 0.) {
160160
albedo = AreaFactor *
161-
(force[i].shortwave[NR] - energy.NetShortAtmos) /
162-
force[i].shortwave[NR];
161+
(force->shortwave[NR] - energy.NetShortAtmos) /
162+
force->shortwave[NR];
163163
}
164164
else {
165165
albedo = 0.;
@@ -184,7 +184,7 @@ vic_cesm_put_data()
184184

185185
// 10m wind
186186
// CESM units: m/s
187-
l2x_vic[i].l2x_Sl_u10 += AreaFactor * force[i].wind[NR];
187+
l2x_vic[i].l2x_Sl_u10 += AreaFactor * force->wind[NR];
188188

189189
// dry deposition velocities (optional)
190190
// CESM units: ?
@@ -259,7 +259,7 @@ vic_cesm_put_data()
259259
// upward longwave heat flux
260260
// CESM units: W m-2
261261
l2x_vic[i].l2x_Fall_lwup += AreaFactor *
262-
(force[i].longwave[NR] -
262+
(force->longwave[NR] -
263263
energy.NetLongAtmos);
264264

265265
// evaporation water flux
@@ -278,7 +278,7 @@ vic_cesm_put_data()
278278

279279
// heat flux shortwave net
280280
l2x_vic[i].l2x_Fall_swnet += AreaFactor *
281-
(force[i].shortwave[NR] -
281+
(force->shortwave[NR] -
282282
energy.NetShortAtmos);
283283

284284
// co2 flux **For testing set to 0

vic/drivers/cesm/src/get_global_param.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -385,12 +385,6 @@ get_global_param(FILE *gp)
385385
"control file.");
386386
}
387387
}
388-
else if (strcasecmp("SNOW_BAND", optstr) == 0) {
389-
sscanf(cmdstr, "%*s %s", flgstr);
390-
if (str_to_bool(flgstr)) {
391-
options.SNOW_BAND = SNOW_BAND_TRUE_BUT_UNSET;
392-
}
393-
}
394388
else if (strcasecmp("LAKES", optstr) == 0) {
395389
sscanf(cmdstr, "%*s %s", flgstr);
396390
if (strcasecmp("FALSE", flgstr) == 0) {
@@ -421,9 +415,6 @@ get_global_param(FILE *gp)
421415
else if (strcasecmp("OUTVAR", optstr) == 0) {
422416
; // do nothing
423417
}
424-
else if (strcasecmp("AGGFREQ", optstr) == 0) {
425-
; // do nothing
426-
}
427418
else if (strcasecmp("OUTPUT_STEPS_PER_DAY", optstr) == 0) {
428419
; // do nothing
429420
}

vic/drivers/cesm/src/vic_cesm_start.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,6 @@ vic_cesm_start(vic_clock *vclock,
4646
// Driver specific settings
4747
if (mpi_rank == VIC_MPI_ROOT) {
4848
strcpy(filenames.global, GLOBALPARAM);
49-
50-
// assign case name to state file name
51-
strncpy(filenames.statefile, trim(cmeta->caseid),
52-
sizeof(filenames.statefile));
53-
5449
// read global settings
5550
filep.globalparam = open_file(filenames.global, "r");
5651
get_global_param(filep.globalparam);

vic/drivers/cesm/src/vic_force.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ vic_force(void)
127127
for (j = 0; j < NF; j++) {
128128
for (i = 0; i < local_domain.ncells_active; i++) {
129129
// CESM units: Pa
130-
// VIC units: Pa
131-
force[i].pressure[j] = x2l_vic[i].x2l_Sa_pbot;
130+
// VIC units: kPa
131+
force[i].pressure[j] = x2l_vic[i].x2l_Sa_pbot / PA_PER_KPA;
132132
}
133133
}
134134

vic/drivers/shared_image/src/vic_store.c

Lines changed: 9 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -48,44 +48,25 @@ vic_store(dmy_struct *dmy_current,
4848
size_t k;
4949
size_t m;
5050
size_t p;
51-
double offset;
52-
double time_num;
53-
double end_time_num;
5451
int *ivar = NULL;
5552
double *dvar = NULL;
5653
size_t d2start[2];
5754
size_t d3start[3];
5855
size_t d4start[4];
5956
size_t d5start[5];
6057
size_t d6start[6];
61-
dmy_struct end_time_date;
6258
nc_file_struct nc_state_file;
6359
nc_var_struct *nc_var;
6460

6561
set_nc_state_file_info(&nc_state_file);
6662

67-
// advance dmy_current by one timestep since dmy_current is the
68-
// timestep-beginning timestamp, and state file date should be
69-
// the end of the current time step
70-
dt_seconds_to_time_units(global_param.time_units, global_param.dt,
71-
&offset);
72-
time_num = date2num(global_param.time_origin_num, dmy_current, 0,
73-
global_param.calendar, global_param.time_units);
74-
end_time_num = time_num + offset;
75-
76-
// allocate dmy struct for end of current time step
77-
num2date(global_param.time_origin_num, end_time_num, 0.,
78-
global_param.calendar, global_param.time_units,
79-
&end_time_date);
80-
63+
// only open and initialize the netcdf file on the first thread
8164
// create netcdf file for storing model state
8265
sprintf(filename, "%s.%04i%02i%02i_%05u.nc",
83-
filenames.statefile, end_time_date.year,
84-
end_time_date.month, end_time_date.day,
85-
end_time_date.dayseconds);
86-
66+
filenames.statefile, global_param.stateyear,
67+
global_param.statemonth, global_param.stateday,
68+
global_param.statesec);
8769
initialize_state_file(filename, &nc_state_file, dmy_current);
88-
8970
if (mpi_rank == VIC_MPI_ROOT) {
9071
debug("writing state file: %s", filename);
9172
}
@@ -367,7 +348,7 @@ vic_store(dmy_struct *dmy_current,
367348
}
368349
gather_put_nc_field_int(nc_state_file.nc_id,
369350
nc_var->nc_varid,
370-
nc_state_file.i_fillvalue,
351+
nc_state_file.d_fillvalue,
371352
d4start, nc_var->nc_counts, ivar);
372353
for (i = 0; i < local_domain.ncells_active; i++) {
373354
ivar[i] = nc_state_file.i_fillvalue;
@@ -393,7 +374,7 @@ vic_store(dmy_struct *dmy_current,
393374
}
394375
gather_put_nc_field_int(nc_state_file.nc_id,
395376
nc_var->nc_varid,
396-
nc_state_file.i_fillvalue,
377+
nc_state_file.d_fillvalue,
397378
d4start, nc_var->nc_counts, ivar);
398379
for (i = 0; i < local_domain.ncells_active; i++) {
399380
ivar[i] = nc_state_file.i_fillvalue;
@@ -830,7 +811,7 @@ vic_store(dmy_struct *dmy_current,
830811
}
831812
gather_put_nc_field_int(nc_state_file.nc_id,
832813
nc_var->nc_varid,
833-
nc_state_file.i_fillvalue,
814+
nc_state_file.d_fillvalue,
834815
d2start, nc_var->nc_counts, ivar);
835816
for (i = 0; i < local_domain.ncells_active; i++) {
836817
ivar[i] = nc_state_file.i_fillvalue;
@@ -843,7 +824,7 @@ vic_store(dmy_struct *dmy_current,
843824
}
844825
gather_put_nc_field_int(nc_state_file.nc_id,
845826
nc_var->nc_varid,
846-
nc_state_file.i_fillvalue,
827+
nc_state_file.d_fillvalue,
847828
d2start, nc_var->nc_counts, ivar);
848829
for (i = 0; i < local_domain.ncells_active; i++) {
849830
ivar[i] = nc_state_file.i_fillvalue;
@@ -989,7 +970,7 @@ vic_store(dmy_struct *dmy_current,
989970
}
990971
gather_put_nc_field_int(nc_state_file.nc_id,
991972
nc_var->nc_varid,
992-
nc_state_file.i_fillvalue,
973+
nc_state_file.d_fillvalue,
993974
d2start, nc_var->nc_counts, ivar);
994975
for (i = 0; i < local_domain.ncells_active; i++) {
995976
ivar[i] = nc_state_file.i_fillvalue;

vic/drivers/shared_image/src/vic_write.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ vic_write(stream_struct *stream,
194194
}
195195
gather_put_nc_field_schar(nc_hist_file->nc_id,
196196
nc_hist_file->nc_vars[k].nc_varid,
197-
nc_hist_file->c_fillvalue,
197+
nc_hist_file->d_fillvalue,
198198
dstart, dcount, cvar);
199199
}
200200
else {

vic/vic_run/include/vic_def.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
/***** Model Constants *****/
5353
#define MAXSTRING 2048
5454
#define MISSING -99999. /**< missing value */
55-
#define MISSING_USI 99999 /**< missing value for unsigned ints */
55+
#define MISSING_USI 99999. /**< missing value for unsigned ints */
5656
#define MISSING_S "MISSING" /**< missing value for strings */
5757
#define NODATA_VH -1 /**< missing value for veg_hist inputs */
5858
#define NODATA_VEG -1 /**< flag for veg types not in grid cell */

vic/vic_run/include/vic_run.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ void compute_pot_evap(size_t, double, double, double, double, double, double,
113113
double, double *);
114114
void compute_runoff_and_asat(soil_con_struct *, double *, double, double *,
115115
double *);
116-
double calc_Q12(double, double, double, double, double);
117116
void compute_soil_resp(int, double *, double, double, double *, double *,
118117
double, double, double, double *, double *, double *);
119118
void compute_soil_layer_thermal_properties(layer_data_struct *, double *,

0 commit comments

Comments
 (0)