Skip to content
Snippets Groups Projects
Commit 0764950f authored by Maren Kaluza's avatar Maren Kaluza Committed by Sebastian Müller
Browse files

optidata_sim_init now gets shape instead of dataObs as argument

dataObs was only used to derive the shape of the opti data.
parent 2daf85c8
Branches datetime_partial_string_fix
No related tags found
1 merge request!81Rework optimization routines
...@@ -193,7 +193,6 @@ MODULE mo_optimization_types ...@@ -193,7 +193,6 @@ MODULE mo_optimization_types
integer(i4) :: i integer(i4) :: i
! ToDo: loop -> subroutine get_id
i = this%get_id(name) i = this%get_id(name)
ptr => this%variables(i)%data_1d ptr => this%variables(i)%data_1d
end subroutine sim_data_set_pointer_1d end subroutine sim_data_set_pointer_1d
...@@ -242,12 +241,12 @@ MODULE mo_optimization_types ...@@ -242,12 +241,12 @@ MODULE mo_optimization_types
ptr => this%variables(i)%data_5d ptr => this%variables(i)%data_5d
end subroutine sim_data_set_pointer_5d end subroutine sim_data_set_pointer_5d
! ToDo: Pass only shape instead of optidataObs subroutine optidata_sim_init(this, data_shape)
subroutine optidata_sim_init(this, optidataObs)
class(optidata_sim), intent(inout) :: this class(optidata_sim), intent(inout) :: this
type(optidata), intent(in) :: optidataObs integer(i4), dimension(2) :: data_shape !< the shape of the simulated data
!< may often be the dimensions of optidataObs%dataObs
allocate(this%dataSim(size(optidataObs%dataObs, dim = 1), size(optidataObs%dataObs, dim = 2))) allocate(this%dataSim(data_shape(1), data_shape(2)))
this%dataSim(:, :) = 0.0_dp ! has to be intialized with zero because later summation this%dataSim(:, :) = 0.0_dp ! has to be intialized with zero because later summation
this%averageTimestep = 1 this%averageTimestep = 1
this%averageCounter = 0 this%averageCounter = 0
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment