From 5a8f91c1144e2a075c56dc729d97efb798dbdb5a Mon Sep 17 00:00:00 2001 From: Luke Van Roekel Date: Mon, 4 Mar 2019 23:19:17 -0600 Subject: [PATCH] Fixes indexing issue in SurfaceAreaWeighted AM Nothing is presently being stored in workArray(1,:) leading to all values in the var_array being shifted by one index. This is causing MPAS-Analysis failures. This results in avgSurfaceTemperature values being stored in avgSurfaceSalinity in output files. This commit shifts indices back one value so the ordering is as expected. --- .../mpas_ocn_surface_area_weighted_averages.F | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/core_ocean/analysis_members/mpas_ocn_surface_area_weighted_averages.F b/src/core_ocean/analysis_members/mpas_ocn_surface_area_weighted_averages.F index c281babb92..33eac9d544 100644 --- a/src/core_ocean/analysis_members/mpas_ocn_surface_area_weighted_averages.F +++ b/src/core_ocean/analysis_members/mpas_ocn_surface_area_weighted_averages.F @@ -350,9 +350,10 @@ subroutine ocn_compute_surface_area_weighted_averages(domain, timeLevel, err)!{{ ! copy data into work array ! Note: Order of indices must match the ordering of vars in var_arrays in Registry_surface_area_weighted_averages.xml ! (and all var_arrays in Registry_surface_area_weighted_averages.xml must have same ordering!) + + !initialize workArray to zeros + workArray(:,:) = 0.0_RKIND n = 1 - workArray(n,:) = 0.0_RKIND - n = n + 1 workArray(n,:) = workMask(:) n = n + 1 workArray(n,:) = areaCell(:)