Commit 51ca1499 authored by Jorn Bruggeman's avatar Jorn Bruggeman
Browse files

do not overwrite user provided state variable fields

parent a3076fae
......@@ -3041,7 +3041,9 @@ end subroutine deallocate_prefetch_vertical
! Copy from prefetch back to global data store.
do ivar=1,size(self%state_variables)
read_index = self%state_variables(ivar)%globalid%read_index
_UNPACK_TO_GLOBAL_(environment%prefetch,read_index,self%data(read_index)%p,environment%mask,self%state_variables(ivar)%missing_value)
if (self%interior_data_sources(read_index)==data_source_fabm) then
_UNPACK_TO_GLOBAL_(environment%prefetch,read_index,self%data(read_index)%p,environment%mask,self%state_variables(ivar)%missing_value)
end if
end do
call deallocate_prefetch(self,self%generic_environment,environment _ARGUMENTS_INTERIOR_IN_)
......@@ -3096,7 +3098,9 @@ end subroutine deallocate_prefetch_vertical
! Copy from prefetch back to global data store.
do ivar=1,size(self%bottom_state_variables)
read_index = self%bottom_state_variables(ivar)%globalid%read_index
_HORIZONTAL_UNPACK_TO_GLOBAL_(environment%prefetch_hz,read_index,self%data_hz(read_index)%p,environment%mask,self%bottom_state_variables(ivar)%missing_value)
if (self%horizontal_data_sources(read_index)==data_source_fabm) then
_HORIZONTAL_UNPACK_TO_GLOBAL_(environment%prefetch_hz,read_index,self%data_hz(read_index)%p,environment%mask,self%bottom_state_variables(ivar)%missing_value)
end if
end do
call deallocate_prefetch_horizontal(self,self%generic_environment,environment _ARGUMENTS_HORIZONTAL_IN_)
......@@ -3151,7 +3155,9 @@ end subroutine deallocate_prefetch_vertical
! Copy from prefetch back to global data store.
do ivar=1,size(self%surface_state_variables)
read_index = self%surface_state_variables(ivar)%globalid%read_index
_HORIZONTAL_UNPACK_TO_GLOBAL_(environment%prefetch_hz,read_index,self%data_hz(read_index)%p,environment%mask,self%surface_state_variables(ivar)%missing_value)
if (self%horizontal_data_sources(read_index)==data_source_fabm) then
_HORIZONTAL_UNPACK_TO_GLOBAL_(environment%prefetch_hz,read_index,self%data_hz(read_index)%p,environment%mask,self%surface_state_variables(ivar)%missing_value)
end if
end do
call deallocate_prefetch_horizontal(self,self%generic_environment,environment _ARGUMENTS_HORIZONTAL_IN_)
......@@ -3384,7 +3390,9 @@ end subroutine deallocate_prefetch_vertical
if (set_interior.or..not.valid) then
do ivar=1,size(self%state_variables)
read_index = self%state_variables(ivar)%globalid%read_index
_UNPACK_TO_GLOBAL_(environment%prefetch,read_index,self%data(read_index)%p,environment%mask,self%state_variables(ivar)%missing_value)
if (self%interior_data_sources(read_index)==data_source_fabm) then
_UNPACK_TO_GLOBAL_(environment%prefetch,read_index,self%data(read_index)%p,environment%mask,self%state_variables(ivar)%missing_value)
end if
end do
end if
......@@ -3532,7 +3540,9 @@ subroutine internal_check_horizontal_state(self,environment _ARGUMENTS_HORIZONTA
if (set_horizontal.or..not.valid) then
do ivar=1,size(state_variables)
read_index = state_variables(ivar)%globalid%read_index
_HORIZONTAL_UNPACK_TO_GLOBAL_(environment%prefetch_hz,read_index,self%data_hz(read_index)%p,environment%mask,state_variables(ivar)%missing_value)
if (self%horizontal_data_sources(read_index)==data_source_fabm) then
_HORIZONTAL_UNPACK_TO_GLOBAL_(environment%prefetch_hz,read_index,self%data_hz(read_index)%p,environment%mask,state_variables(ivar)%missing_value)
end if
end do
end if
......@@ -3553,7 +3563,7 @@ subroutine internal_check_horizontal_state(self,environment _ARGUMENTS_HORIZONTA
do ivar=1,size(self%state_variables)
read_index = self%state_variables(ivar)%globalid%read_index
if (self%interior_data_sources(read_index)==data_source_fabm) then
#if _FABM_BOTTOM_INDEX_==-1&&defined(_HORIZONTAL_IS_VECTORIZED_)
if (flag==1) then
#endif
......@@ -3592,7 +3602,7 @@ subroutine internal_check_horizontal_state(self,environment _ARGUMENTS_HORIZONTA
# endif
end if
#endif
end if
end do
end if
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment