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
2bd3b36c
Commit
2bd3b36c
authored
1 year ago
by
KyleKlenk
Browse files
Options
Downloads
Patches
Plain Diff
Ensured backward compatibility with V3 Summa
parent
c638ba9b
No related branches found
No related tags found
1 merge request
!5
add in compiler def ACTORS_ACTIVE to turn on some stuff so can move...
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
build/CMakeLists.txt
+1
-8
1 addition, 8 deletions
build/CMakeLists.txt
build/source/actors/hru_actor/hru_actor.cpp
+6
-13
6 additions, 13 deletions
build/source/actors/hru_actor/hru_actor.cpp
build/source/actors/hru_actor/hru_modelRun.f90
+4
-1
4 additions, 1 deletion
build/source/actors/hru_actor/hru_modelRun.f90
with
11 additions
and
22 deletions
build/CMakeLists.txt
+
1
−
8
View file @
2bd3b36c
...
...
@@ -85,13 +85,6 @@ set(HOOKUP_DIR ${F_MASTER}/build/source/hookup)
set
(
NETCDF_DIR
${
F_MASTER
}
/build/source/netcdf
)
set
(
NOAHMP_DIR
${
F_MASTER
}
/build/source/noah-mp
)
# Define directories for source files that might be replaced by actors (identical if not using actors)
set
(
SUB_DRIVER_DIR
${
PARENT_DIR
}
/build/source/driver
)
set
(
SUB_DSHARE_DIR
${
PARENT_DIR
}
/build/source/dshare
)
set
(
SUB_ENGINE_DIR
${
PARENT_DIR
}
/build/source/engine
)
set
(
SUB_HOOKUP_DIR
${
PARENT_DIR
}
/build/source/hookup
)
set
(
SUB_NETCDF_DIR
${
PARENT_DIR
}
/build/source/netcdf
)
# Define Actors specific directories
set
(
ACTORS_DIR
${
PARENT_DIR
}
/build/source/actors
)
set
(
FILE_ACCESS_DIR
${
ACTORS_DIR
}
/file_access_actor
)
...
...
@@ -144,7 +137,7 @@ set(UTILMS
# NetCDF routines
set
(
NETCDF
${
FILE_ACCESS
_DIR
}
/def_output.f90
${
NETCDF
_DIR
}
/def_output.f90
${
NETCDF_DIR
}
/netcdf_util.f90
${
NETCDF_DIR
}
/read_icond.f90
)
...
...
This diff is collapsed.
Click to expand it.
build/source/actors/hru_actor/hru_actor.cpp
+
6
−
13
View file @
2bd3b36c
#include
"hru_actor.hpp"
// Compiler set flag for sundials
#ifdef SUNDIALS_ACTIVE
bool
sundials_active
=
true
;
#else
bool
sundials_active
=
false
;
#endif
namespace
caf
{
behavior
hru_actor
(
stateful_actor
<
hru_state
>*
self
,
int
refGRU
,
int
indxGRU
,
...
...
@@ -67,13 +60,12 @@ behavior hru_actor(stateful_actor<hru_state>* self, int refGRU, int indxGRU,
err
=
Run_HRU
(
self
);
// Simulate a Timestep
if
(
err
!=
0
)
{
if
(
sundials_active
)
{
#ifdef SUNDIALS_ACTIVE
get_sundials_tolerances
(
self
->
state
.
hru_data
,
&
self
->
state
.
rtol
,
&
self
->
state
.
atol
);
self
->
send
(
self
->
state
.
parent
,
err_atom_v
,
self
,
self
->
state
.
rtol
,
self
->
state
.
atol
);
}
else
{
#else
self
->
send
(
self
->
state
.
parent
,
hru_error
::
run_physics_unhandleable
,
self
);
}
#endif
self
->
quit
();
return
;
...
...
@@ -147,9 +139,10 @@ void Initialize_HRU(stateful_actor<hru_state>* self) {
self
->
quit
();
return
;
}
#ifdef SUNDIALS_ACTIVE
if
(
self
->
state
.
hru_actor_settings
.
rel_tol
>
0
&&
self
->
state
.
hru_actor_settings
.
abs_tol
>
0
)
set_sundials_tolerances
(
self
->
state
.
hru_data
,
&
self
->
state
.
hru_actor_settings
.
rel_tol
,
&
self
->
state
.
hru_actor_settings
.
abs_tol
);
set_sundials_tolerances
(
self
->
state
.
hru_data
,
&
self
->
state
.
hru_actor_settings
.
rel_tol
,
&
self
->
state
.
hru_actor_settings
.
abs_tol
);
#endif
}
int
Run_HRU
(
stateful_actor
<
hru_state
>*
self
)
{
...
...
This diff is collapsed.
Click to expand it.
build/source/actors/hru_actor/hru_modelRun.f90
+
4
−
1
View file @
2bd3b36c
...
...
@@ -69,8 +69,10 @@ USE mDecisions_module,only:& ! look-up values for LAI decisions
implicit
none
private
public
::
runPhysics
#ifdef SUNDIALS_ACTIVE
public
::
get_sundials_tolerances
public
::
set_sundials_tolerances
#endif
contains
! Runs the model physics for an HRU
...
...
@@ -349,6 +351,7 @@ end subroutine runPhysics
! *******************************************************************************************
! *** get_sundials_tolerances
! *******************************************************************************************
#ifdef SUNDIALS_ACTIVE
subroutine
get_sundials_tolerances
(
handle_hru_data
,
rtol
,
atol
)
bind
(
C
,
name
=
'get_sundials_tolerances'
)
USE
var_lookup
,
only
:
iLookPARAM
implicit
none
...
...
@@ -407,6 +410,6 @@ subroutine set_sundials_tolerances(handle_hru_data, rtol, atol) bind(C, name='se
hru_data
%
mparStruct
%
var
(
iLookPARAM
%
absTolMatric
)
%
dat
(
1
)
=
atol
hru_data
%
mparStruct
%
var
(
iLookPARAM
%
absTolAquifr
)
%
dat
(
1
)
=
atol
end
subroutine
set_sundials_tolerances
#endif
end
module
summa_modelRun
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