diff --git a/modules/util/util.py b/modules/util/util.py
index a954e604834a2e3a9cceeebbcbf199672bfbaa31..547e579791be0c757e20ce2ab1a48549837fbb5a 100644
--- a/modules/util/util.py
+++ b/modules/util/util.py
@@ -664,7 +664,12 @@ rho_ice = 0.917
 
 
 def compute_lwc_iwc(iphase, reff, opd):
+    xy_shape = iphase.shape
+
     iphase = iphase.flatten()
+    reff = reff.flatten()
+    opd = opd.flatten()
+
     lwp_dcomp = np.zeros(reff.shape[0])
     iwp_dcomp = np.zeros(reff.shape[0])
     lwp_dcomp[:] = np.nan
@@ -676,6 +681,9 @@ def compute_lwc_iwc(iphase, reff, opd):
     iwp_dcomp[ice] = 0.667 * opd[ice] * rho_ice * reff[ice]
     lwp_dcomp[no_ice] = 0.55 * opd[no_ice] * rho_water * reff[no_ice]
 
+    lwp_dcomp = lwp_dcomp.reshape(xy_shape)
+    iwp_dcomp = iwp_dcomp.reshape(xy_shape)
+
     return lwp_dcomp, iwp_dcomp