Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Summa Actors
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Numerical_Simulations_Lab
Actors
Summa Actors
Commits
9b7fbc44
Commit
9b7fbc44
authored
2 years ago
by
Kyle
Browse files
Options
Downloads
Patches
Plain Diff
added a forgotten break statement
parent
b682efe3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
build/source/actors/hru_actor/cpp_code/hru_actor.cpp
+25
-63
25 additions, 63 deletions
build/source/actors/hru_actor/cpp_code/hru_actor.cpp
with
25 additions
and
63 deletions
build/source/actors/hru_actor/cpp_code/hru_actor.cpp
+
25
−
63
View file @
9b7fbc44
...
...
@@ -51,6 +51,7 @@ behavior hru_actor(stateful_actor<hru_state>* self, int refGRU, int indxGRU,
self
->
quit
();
}
aout
(
self
)
<<
"NumSteps = "
<<
self
->
state
.
num_steps
<<
std
::
endl
;
// Get attributes
self
->
send
(
self
->
state
.
file_access_actor
,
get_attributes_params_v
,
self
->
state
.
indxGRU
,
self
);
...
...
@@ -138,8 +139,9 @@ behavior hru_actor(stateful_actor<hru_state>* self, int refGRU, int indxGRU,
self
->
state
.
timestep
+=
1
;
// HRU has finished
if
(
self
->
state
.
timestep
>=
self
->
state
.
num_steps
)
{
self
->
send
(
self
,
done_write_v
);
if
(
self
->
state
.
timestep
>
self
->
state
.
num_steps
)
{
self
->
send
(
self
,
done_hru_v
);
break
;
}
}
...
...
@@ -151,37 +153,27 @@ behavior hru_actor(stateful_actor<hru_state>* self, int refGRU, int indxGRU,
self
->
state
.
hru_timing
.
updateEndPoint
(
"total_duration"
);
},
[
=
](
done_write
)
{
self
->
state
.
hru_timing
.
updateStartPoint
(
"total_duration"
);
// We receive a done_write message so we ensure that
// stepsInCurrentFFile remains unchanged
if
(
self
->
state
.
timestep
>=
self
->
state
.
num_steps
)
{
self
->
state
.
hru_timing
.
updateEndPoint
(
"total_duration"
);
// Tell our parent we are done, convert all timings to seconds
aout
(
self
)
<<
"
\n
________________HRU TIMING INFO RESULTS________________
\n
"
;
aout
(
self
)
<<
"Total Duration = "
<<
self
->
state
.
hru_timing
.
getDuration
(
"total_duration"
).
value_or
(
-
1.0
)
<<
" Seconds
\n
"
;
aout
(
self
)
<<
"Init Duration = "
<<
self
->
state
.
hru_timing
.
getDuration
(
"init_duration"
).
value_or
(
-
1.0
)
<<
" Seconds
\n
"
;
aout
(
self
)
<<
"Forcing Duration = "
<<
self
->
state
.
hru_timing
.
getDuration
(
"forcing_duration"
).
value_or
(
-
1.0
)
<<
" Seconds
\n
"
;
aout
(
self
)
<<
"Run Physics Duration = "
<<
self
->
state
.
hru_timing
.
getDuration
(
"run_physics_duration"
).
value_or
(
-
1.0
)
<<
" Seconds
\n
"
;
aout
(
self
)
<<
"Write Output Duration = "
<<
self
->
state
.
hru_timing
.
getDuration
(
"write_output_duration"
).
value_or
(
-
1.0
)
<<
" Seconds
\n\n
"
;
self
->
send
(
self
->
state
.
parent
,
done_hru_v
,
self
->
state
.
indxGRU
,
self
->
state
.
hru_timing
.
getDuration
(
"total_duration"
).
value_or
(
-
1.0
),
self
->
state
.
hru_timing
.
getDuration
(
"init_duration"
).
value_or
(
-
1.0
),
self
->
state
.
hru_timing
.
getDuration
(
"forcing_duration"
).
value_or
(
-
1.0
),
self
->
state
.
hru_timing
.
getDuration
(
"run_physics_duration"
).
value_or
(
-
1.0
),
self
->
state
.
hru_timing
.
getDuration
(
"write_output_duration"
).
value_or
(
-
1.0
));
self
->
quit
();
return
;
}
self
->
state
.
hru_timing
.
updateEndPoint
(
"total_duration"
);
self
->
send
(
self
,
run_hru_v
,
self
->
state
.
stepsInCurrentFFile
);
[
=
](
done_hru
)
{
// Tell our parent we are done, convert all timings to seconds
aout
(
self
)
<<
"
\n
________________HRU TIMING INFO RESULTS________________
\n
"
;
aout
(
self
)
<<
"Total Duration = "
<<
self
->
state
.
hru_timing
.
getDuration
(
"total_duration"
).
value_or
(
-
1.0
)
<<
" Seconds
\n
"
;
aout
(
self
)
<<
"Init Duration = "
<<
self
->
state
.
hru_timing
.
getDuration
(
"init_duration"
).
value_or
(
-
1.0
)
<<
" Seconds
\n
"
;
aout
(
self
)
<<
"Forcing Duration = "
<<
self
->
state
.
hru_timing
.
getDuration
(
"forcing_duration"
).
value_or
(
-
1.0
)
<<
" Seconds
\n
"
;
aout
(
self
)
<<
"Run Physics Duration = "
<<
self
->
state
.
hru_timing
.
getDuration
(
"run_physics_duration"
).
value_or
(
-
1.0
)
<<
" Seconds
\n
"
;
aout
(
self
)
<<
"Write Output Duration = "
<<
self
->
state
.
hru_timing
.
getDuration
(
"write_output_duration"
).
value_or
(
-
1.0
)
<<
" Seconds
\n\n
"
;
self
->
send
(
self
->
state
.
parent
,
done_hru_v
,
self
->
state
.
indxGRU
,
self
->
state
.
hru_timing
.
getDuration
(
"total_duration"
).
value_or
(
-
1.0
),
self
->
state
.
hru_timing
.
getDuration
(
"init_duration"
).
value_or
(
-
1.0
),
self
->
state
.
hru_timing
.
getDuration
(
"forcing_duration"
).
value_or
(
-
1.0
),
self
->
state
.
hru_timing
.
getDuration
(
"run_physics_duration"
).
value_or
(
-
1.0
),
self
->
state
.
hru_timing
.
getDuration
(
"write_output_duration"
).
value_or
(
-
1.0
));
self
->
quit
();
return
;
},
[
=
](
dt_init_factor
,
int
dt_init_factor
)
{
...
...
@@ -345,36 +337,6 @@ int Run_HRU(stateful_actor<hru_state>* self) {
return
0
;
}
// bool check_HRU(stateful_actor<hru_state>* self, int err) {
// if (err != 0) {
// // check for error
// self->send(self->state.parent, run_failure_v, self, self->state.indxGRU, err);
// self->quit();
// return false;
// } else if (self->state.timestep >= self->state.num_steps) {
// // check if simulation is finished
// self->state.hru_timing.updateEndPoint("total_duration");
// return false;
// } else if (self->state.forcingStep > self->state.stepsInCurrentFFile) {
// // we need more forcing data
// aout(self) << "Requesting File:" << self->state.iFile << "\n";
// aout(self) << "forcingStep = " << self->state.forcingStep << "\n";
// aout(self) << "stepsInCurrentFile = " << self->state.stepsInCurrentFFile << "\n";
// self->send(self->state.file_access_actor, access_forcing_v, self->state.iFile + 1, self);
// return false;
// } else {
// return true;
// }
// }
void
printOutput
(
stateful_actor
<
hru_state
>*
self
)
{
aout
(
self
)
<<
self
->
state
.
refGRU
<<
" - Timestep = "
<<
self
->
state
.
timestep
<<
std
::
endl
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment