From fc3ab450b090c3d3d64a63370d6361d305d5dc65 Mon Sep 17 00:00:00 2001 From: Gustavo Marques Date: Tue, 29 Mar 2022 17:13:34 -0600 Subject: [PATCH] Avoid rotating arrays that are not associated --- src/core/MOM_forcing_type.F90 | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/core/MOM_forcing_type.F90 b/src/core/MOM_forcing_type.F90 index 1217429791..d4afabc2de 100644 --- a/src/core/MOM_forcing_type.F90 +++ b/src/core/MOM_forcing_type.F90 @@ -3384,14 +3384,17 @@ subroutine rotate_forcing(fluxes_in, fluxes, turns) if (do_heat .and. do_water) then call rotate_array(fluxes_in%heat_content_cond, turns, fluxes%heat_content_cond) - call rotate_array(fluxes_in%heat_content_evap, turns, fluxes%heat_content_evap) call rotate_array(fluxes_in%heat_content_lprec, turns, fluxes%heat_content_lprec) call rotate_array(fluxes_in%heat_content_fprec, turns, fluxes%heat_content_fprec) call rotate_array(fluxes_in%heat_content_vprec, turns, fluxes%heat_content_vprec) call rotate_array(fluxes_in%heat_content_lrunoff, turns, fluxes%heat_content_lrunoff) call rotate_array(fluxes_in%heat_content_frunoff, turns, fluxes%heat_content_frunoff) - call rotate_array(fluxes_in%heat_content_massout, turns, fluxes%heat_content_massout) - call rotate_array(fluxes_in%heat_content_massin, turns, fluxes%heat_content_massin) + if (associated (fluxes_in%heat_content_evap)) then + call rotate_array(fluxes_in%heat_content_evap, turns, fluxes%heat_content_evap) + else + call rotate_array(fluxes_in%heat_content_massout, turns, fluxes%heat_content_massout) + call rotate_array(fluxes_in%heat_content_massin, turns, fluxes%heat_content_massin) + endif endif if (do_press) then