Skip to content

Commit fc3ab45

Browse files
gustavo-marquesalperaltuntas
authored andcommitted
Avoid rotating arrays that are not associated
1 parent f814147 commit fc3ab45

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

src/core/MOM_forcing_type.F90

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3384,14 +3384,17 @@ subroutine rotate_forcing(fluxes_in, fluxes, turns)
33843384

33853385
if (do_heat .and. do_water) then
33863386
call rotate_array(fluxes_in%heat_content_cond, turns, fluxes%heat_content_cond)
3387-
call rotate_array(fluxes_in%heat_content_evap, turns, fluxes%heat_content_evap)
33883387
call rotate_array(fluxes_in%heat_content_lprec, turns, fluxes%heat_content_lprec)
33893388
call rotate_array(fluxes_in%heat_content_fprec, turns, fluxes%heat_content_fprec)
33903389
call rotate_array(fluxes_in%heat_content_vprec, turns, fluxes%heat_content_vprec)
33913390
call rotate_array(fluxes_in%heat_content_lrunoff, turns, fluxes%heat_content_lrunoff)
33923391
call rotate_array(fluxes_in%heat_content_frunoff, turns, fluxes%heat_content_frunoff)
3393-
call rotate_array(fluxes_in%heat_content_massout, turns, fluxes%heat_content_massout)
3394-
call rotate_array(fluxes_in%heat_content_massin, turns, fluxes%heat_content_massin)
3392+
if (associated (fluxes_in%heat_content_evap)) then
3393+
call rotate_array(fluxes_in%heat_content_evap, turns, fluxes%heat_content_evap)
3394+
else
3395+
call rotate_array(fluxes_in%heat_content_massout, turns, fluxes%heat_content_massout)
3396+
call rotate_array(fluxes_in%heat_content_massin, turns, fluxes%heat_content_massin)
3397+
endif
33953398
endif
33963399

33973400
if (do_press) then

0 commit comments

Comments
 (0)