Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
FORCES
Manage
Activity
Members
Labels
Plan
Issues
14
Issue boards
Milestones
Code
Merge requests
3
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Monitor
Service Desk
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CHS
FORCES
Commits
3379b596
Commit
3379b596
authored
4 months ago
by
Maren Kaluza
Committed by
Sebastian Müller
2 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Added ToDos as comments
parent
3b5b887a
No related branches found
Branches containing commit
No related tags found
1 merge request
!81
Rework optimization routines
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/mo_likelihood.f90
+1
-0
1 addition, 0 deletions
src/mo_likelihood.f90
src/mo_optimization_types.f90
+9
-0
9 additions, 0 deletions
src/mo_optimization_types.f90
src/mo_optimization_utils.f90
+2
-0
2 additions, 0 deletions
src/mo_optimization_utils.f90
with
12 additions
and
0 deletions
src/mo_likelihood.f90
+
1
−
0
View file @
3379b596
...
...
@@ -206,6 +206,7 @@ CONTAINS
if
(
opti_sim
(
i
)
%
has
(
'runoff'
))
then
call
opti_sim
(
i
)
%
allocate
(
name
=
"runoff"
,
dim1
=
n
,
dim2
=
1
)
call
opti_sim
(
i
)
%
set_pointer
(
ptr
=
runoff
,
name
=
"runoff"
)
! ToDo fix loop (don't loop, check opti_sim only 1)
end
if
end
do
...
...
This diff is collapsed.
Click to expand it.
src/mo_optimization_types.f90
+
9
−
0
View file @
3379b596
...
...
@@ -36,6 +36,8 @@ MODULE mo_optimization_types
integer
(
i4
),
dimension
(:),
allocatable
::
opti_indices
end
type
config_t
! ToDo: documentation like mo_cli
! type opti_sim_t
! type(optidata_sim), target, dimension(:), allocatable :: data
! character(256) :: name
...
...
@@ -45,6 +47,7 @@ MODULE mo_optimization_types
contains
procedure
::
has
=>
opti_sim_t_has
procedure
::
add
=>
opti_sim_t_add
! ToDo only interface public, other private
procedure
::
opti_sim_t_allocate_1d
procedure
::
opti_sim_t_allocate_2d
procedure
::
opti_sim_t_allocate_3d
...
...
@@ -55,6 +58,7 @@ MODULE mo_optimization_types
procedure
::
opti_sim_t_set_pointer_3d
procedure
::
opti_sim_t_set_pointer_4d
procedure
::
opti_sim_t_set_pointer_5d
! ToDo: destructor
generic
::
set_pointer
=>
opti_sim_t_set_pointer_1d
,
opti_sim_t_set_pointer_2d
,
&
opti_sim_t_set_pointer_3d
,
opti_sim_t_set_pointer_4d
,
opti_sim_t_set_pointer_5d
generic
::
allocate
=>
opti_sim_t_allocate_1d
,
opti_sim_t_allocate_2d
,
&
...
...
@@ -135,6 +139,7 @@ MODULE mo_optimization_types
add_data
%
dimen
=
dim
if
(
present
(
time_avg_selector
))
add_data
%
time_avg_selector
=
time_avg_selector
! ToDo: is the if case needed?
! Tested: the else case works
if
(
allocated
(
this
%
opti_vars
))
then
this
%
opti_vars
=
[
this
%
opti_vars
,
add_data
]
else
...
...
@@ -225,6 +230,7 @@ MODULE mo_optimization_types
end
subroutine
opti_sim_t_allocate_5d
! ToDo: generate with fypp
! ToDo: switch ptr with name
subroutine
opti_sim_t_set_pointer_1d
(
this
,
ptr
,
name
)
class
(
opti_sim_t
),
target
,
intent
(
in
)
::
this
real
(
dp
),
dimension
(:),
pointer
,
intent
(
inout
)
::
ptr
...
...
@@ -232,9 +238,12 @@ MODULE mo_optimization_types
integer
(
i4
)
::
i
! ToDo: loop -> subroutine get_id
! i = this%get_id(name)
do
i
=
1
,
size
(
this
%
opti_vars
)
if
(
this
%
opti_vars
(
i
)
%
name
==
name
)
then
ptr
=>
this
%
opti_vars
(
i
)
%
data_1d
! ToDo: exit
end
if
end
do
end
subroutine
opti_sim_t_set_pointer_1d
...
...
This diff is collapsed.
Click to expand it.
src/mo_optimization_utils.f90
+
2
−
0
View file @
3379b596
...
...
@@ -30,6 +30,8 @@ module mo_optimization_utils
end
interface
!> \brief Interface for objective function.
!> \details The optional arguments are motivated by likelihood objective functions.
! ToDo: eval optional
interface
function
objective_interface
(
parameterset
,
eval
,
arg1
,
arg2
,
arg3
)
use
mo_kind
,
only
:
dp
...
...
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