Skip to content

Commit

Permalink
Add missing logical to control allocation of fluxes
Browse files Browse the repository at this point in the history
  • Loading branch information
gustavo-marques authored and alperaltuntas committed Apr 21, 2022
1 parent b9b67a8 commit f814147
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/core/MOM_forcing_type.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2997,7 +2997,11 @@ subroutine allocate_forcing_by_group(G, fluxes, water, heat, ustar, press, &

! Local variables
integer :: isd, ied, jsd, jed, IsdB, IedB, JsdB, JedB
logical :: heat_water
logical :: heat_water, enthalpy_mom

! if true, allocate fluxes needed to calculate enthalpy terms in MOM6
enthalpy_mom = .true.
if (present (hevap)) enthalpy_mom = .not. hevap

isd = G%isd ; ied = G%ied ; jsd = G%jsd ; jed = G%jed
IsdB = G%IsdB ; IedB = G%IedB ; JsdB = G%JsdB ; JedB = G%JedB
Expand Down Expand Up @@ -3027,14 +3031,14 @@ subroutine allocate_forcing_by_group(G, fluxes, water, heat, ustar, press, &

if (present(heat) .and. present(water)) then ; if (heat .and. water) then
call myAlloc(fluxes%heat_content_cond,isd,ied,jsd,jed, .true.)
call myAlloc(fluxes%heat_content_evap,isd,ied,jsd,jed, hevap)
call myAlloc(fluxes%heat_content_evap,isd,ied,jsd,jed, .not. enthalpy_mom)
call myAlloc(fluxes%heat_content_lprec,isd,ied,jsd,jed, .true.)
call myAlloc(fluxes%heat_content_fprec,isd,ied,jsd,jed, .true.)
call myAlloc(fluxes%heat_content_vprec,isd,ied,jsd,jed, .true.)
call myAlloc(fluxes%heat_content_lrunoff,isd,ied,jsd,jed, .true.)
call myAlloc(fluxes%heat_content_frunoff,isd,ied,jsd,jed, .true.)
call myAlloc(fluxes%heat_content_massout,isd,ied,jsd,jed, .not. hevap)
call myAlloc(fluxes%heat_content_massin,isd,ied,jsd,jed, .not. hevap)
call myAlloc(fluxes%heat_content_massout,isd,ied,jsd,jed, enthalpy_mom)
call myAlloc(fluxes%heat_content_massin,isd,ied,jsd,jed, enthalpy_mom)
endif ; endif

call myAlloc(fluxes%p_surf,isd,ied,jsd,jed, press)
Expand Down

0 comments on commit f814147

Please sign in to comment.