-
Notifications
You must be signed in to change notification settings - Fork 400
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
fixes for exact restarts and a few lines of cleanup #873
Open
dgergel
wants to merge
4
commits into
UW-Hydro:develop
Choose a base branch
from
dgergel:feature/fix_exact_restarts_cesm_driver
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 2 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
4ecd112
fixes for exact restarts and a few lines of cleanup
dgergel a5f6ec0
small syntax fixes
dgergel 421e16b
Merge branch 'develop' into feature/fix_exact_restarts_cesm_driver
dgergel 38f7a5b
Merge branch 'develop' into feature/fix_exact_restarts_cesm_driver
bartnijssen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -118,7 +118,7 @@ vic_cesm_put_data() | |
// that is already in the put_data routine | ||
|
||
// temperature, VIC: K, CESM: K | ||
l2x_vic[i].l2x_Sl_t = out_data[i][OUT_RAD_TEMP][0]; | ||
l2x_vic[i].l2x_Sl_t = (double) out_data[i][OUT_RAD_TEMP][0]; | ||
|
||
// albedo, VIC: fraction, CESM: fraction | ||
// Note: VIC does not partition its albedo, thus all types are | ||
|
@@ -146,27 +146,27 @@ vic_cesm_put_data() | |
|
||
// longwave up, VIC: W/m2, CESM: W/m2 | ||
// adjust sign for CESM sign convention | ||
l2x_vic[i].l2x_Fall_lwup = -1 * | ||
l2x_vic[i].l2x_Fall_lwup = (double) (-1 * | ||
(out_data[i][OUT_LWDOWN][0] - | ||
out_data[i][OUT_LWNET][0]); | ||
out_data[i][OUT_LWNET][0])); | ||
|
||
// turbulent heat fluxes | ||
// Note: both are the opposite sign from image driver | ||
// in accordance with the sign convention for coupled models | ||
// latent heat, VIC: W/m2, CESM: W/m2 | ||
l2x_vic[i].l2x_Fall_lat = -1 * out_data[i][OUT_LATENT][0]; | ||
l2x_vic[i].l2x_Fall_lat = (double) (-1 * out_data[i][OUT_LATENT][0]); | ||
|
||
// sensible heat, VIC: W/m2, CESM: W/m2 | ||
l2x_vic[i].l2x_Fall_sen += -1 * out_data[i][OUT_SENSIBLE][0]; | ||
l2x_vic[i].l2x_Fall_sen = (double) (-1 * out_data[i][OUT_SENSIBLE][0]); | ||
|
||
// evaporation, VIC: mm, CESM: kg m-2 s-1 | ||
l2x_vic[i].l2x_Fall_evap += -1 * out_data[i][OUT_EVAP][0] / | ||
global_param.dt; | ||
l2x_vic[i].l2x_Fall_evap = (double) (-1 * out_data[i][OUT_EVAP][0] / | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why did you change the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as above - this is leftover from when we were aggregating over bands. |
||
global_param.dt); | ||
|
||
// lnd->rtm input fluxes | ||
l2x_vic[i].l2x_Flrl_rofliq = (out_data[i][OUT_RUNOFF][0] + | ||
l2x_vic[i].l2x_Flrl_rofliq = (double) ((out_data[i][OUT_RUNOFF][0] + | ||
out_data[i][OUT_BASEFLOW][0]) / | ||
global_param.dt; | ||
global_param.dt); | ||
|
||
|
||
// running sum to make sure we get the full grid cell | ||
|
@@ -237,21 +237,21 @@ vic_cesm_put_data() | |
// CESM units: N m-2 | ||
wind_stress_x = out_data[i][OUT_DENSITY][0] * | ||
x2l_vic[i].x2l_Sa_u / aero_resist; | ||
l2x_vic[i].l2x_Fall_taux += AreaFactor * wind_stress_x; | ||
l2x_vic[i].l2x_Fall_taux += (double) (AreaFactor * wind_stress_x); | ||
|
||
// wind stress, meridional | ||
// CESM units: N m-2 | ||
wind_stress_y = out_data[i][OUT_DENSITY][0] * | ||
x2l_vic[i].x2l_Sa_v / aero_resist; | ||
l2x_vic[i].l2x_Fall_tauy += AreaFactor * wind_stress_y; | ||
l2x_vic[i].l2x_Fall_tauy += (double) (AreaFactor * wind_stress_y); | ||
|
||
// friction velocity | ||
// CESM units: m s-1 | ||
wind_stress = | ||
sqrt(pow(wind_stress_x, 2) + pow(wind_stress_y, 2)); | ||
l2x_vic[i].l2x_Sl_fv += AreaFactor * | ||
l2x_vic[i].l2x_Sl_fv += (double) (AreaFactor * | ||
sqrt(wind_stress / | ||
out_data[i][OUT_DENSITY][0]); | ||
out_data[i][OUT_DENSITY][0])); | ||
} | ||
} | ||
|
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you change the
+=
to=
here?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was leftover from when we were aggregating over bands - since we don't do that anymore, there's no reason to have the
+=
.