Commit 80b790c6 authored by Robert Schweppe's avatar Robert Schweppe
Browse files

execute_CoordUpscaler in mo_mpr_data_array_upscale.f90:

  - removed possibly costly status call in inner loop of
  - moved init of missing values out of loop
parent 720f4912
Pipeline #28189 failed with stages
in 0 seconds
......@@ -1061,16 +1061,15 @@ contains
! prepare the new arrays
allocate(newArray(product(newCoords)))
allocate(newMask(product(newCoords)))
newArray(:) = nodata_dp
newMask(:) = .false.
if (present(currentNanWeights)) then
allocate(newNanWeights(product(newCoords)))
newNanWeights(:) = 0.0_dp
! loop over cells
do iCell=1, size(newArray, kind=ix)
if (self%subcells(subcellIds(iCell)) == 0_ix) then
newArray(iCell) = nodata_dp
newMask(iCell) = .false.
newNanWeights(iCell) = 0.0_dp
else
if (self%subcells(subcellIds(iCell)) > 0_ix) then
! the effective index array for the packed currentArray declaring
! which subcells are needed for iCell of newArray
effectiveSubcellIds = (self%ids(1:self%subcells(subcellIds(iCell)), &
......@@ -1081,11 +1080,6 @@ contains
') and those weights (', self%weights(1:self%subcells(subcellIds(iCell)), subcellIds(iCell)), &
') in mode with doNeedWeights and with NanWeights'
! now execute the upscaling for the current cell
if (mod(iCell, maxval([size(newArray, kind=ix) / 10_ix, 1_ix])) == 0_ix .and. &
size(newArray, kind=ix) > 1000000_ix) then
log_debug(*) 'execute_CoordUpscaler: Upscaling iCell: ', iCell, '/', size(newArray, kind=ix)
end if
! now execute the upscaling for the current cell
call wrap_weighted_upscale(&
upscaleFunc, &
p, &
......@@ -1106,10 +1100,7 @@ contains
if (self%doNeedWeights) then
! loop over cells
do iCell=1, size(newArray, kind=ix)
if (self%subcells(subcellIds(iCell)) == 0_ix) then
newArray(iCell) = nodata_dp
newMask(iCell) = .false.
else
if (self%subcells(subcellIds(iCell)) > 0_ix) then
! the effective index array for the packed currentArray declaring
! which subcells are needed for iCell of newArray
effectiveSubcellIds = (self%ids(1:self%subcells(subcellIds(iCell)), subcellIds(iCell)) - 1) * &
......@@ -1118,11 +1109,6 @@ contains
effectiveSubcellIds, ') with these values (', currentArray(effectiveSubcellIds), &
') and those weights (', self%weights(1:self%subcells(subcellIds(iCell)), subcellIds(iCell)), &
') in mode with doNeedWeights and without NanWeights'
! now execute the upscaling for the current cell
if (mod(iCell, maxval([size(newArray, kind=ix) / 10_ix, 1_ix])) == 0_ix .and. &
size(newArray, kind=ix) > 1000000_ix) then
log_debug(*) 'execute_CoordUpscaler: Upscaling iCell: ', iCell, '/', size(newArray, kind=ix)
end if
call wrap_weighted_upscale(&
func=upscaleFunc, &
p=p, &
......@@ -1140,10 +1126,7 @@ contains
else
! loop over cells
do iCell=1, size(newArray, kind=ix)
if (self%subcells(subcellIds(iCell)) == 0_ix) then
newArray(iCell) = nodata_dp
newMask(iCell) = .false.
else
if (self%subcells(subcellIds(iCell)) > 0_ix) then
! the effective index array for the packed currentArray declaring which subcells are needed for iCell of newArray
effectiveSubcellIds = (self%ids(1:self%subcells(subcellIds(iCell)), subcellIds(iCell)) - 1) * &
idMultiplier + 1 + idAddon(iCell)
......@@ -1152,11 +1135,6 @@ contains
') and those weights (', self%weights(1:self%subcells(subcellIds(iCell)), subcellIds(iCell)), &
') in mode without doNeedWeights and without NanWeights'
! now execute the upscaling for the current cell
if (mod(iCell, maxval([size(newArray, kind=ix) / 10_ix, 1_ix])) == 0_ix .and. &
size(newArray, kind=ix) > 1000000_ix) then
log_debug(*) 'execute_CoordUpscaler: Upscaling iCell: ', iCell, '/', size(newArray, kind=ix)
end if
! now execute the upscaling for the current cell
call wrap_upscale(&
upscaleFunc, &
p, &
......
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