Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f814147

Browse files
gustavo-marquesalperaltuntas
authored andcommitted
Add missing logical to control allocation of fluxes
1 parent b9b67a8 commit f814147

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

src/core/MOM_forcing_type.F90

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2997,7 +2997,11 @@ subroutine allocate_forcing_by_group(G, fluxes, water, heat, ustar, press, &
29972997

29982998
! Local variables
29992999
integer :: isd, ied, jsd, jed, IsdB, IedB, JsdB, JedB
3000-
logical :: heat_water
3000+
logical :: heat_water, enthalpy_mom
3001+
3002+
! if true, allocate fluxes needed to calculate enthalpy terms in MOM6
3003+
enthalpy_mom = .true.
3004+
if (present (hevap)) enthalpy_mom = .not. hevap
30013005

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

30283032
if (present(heat) .and. present(water)) then ; if (heat .and. water) then
30293033
call myAlloc(fluxes%heat_content_cond,isd,ied,jsd,jed, .true.)
3030-
call myAlloc(fluxes%heat_content_evap,isd,ied,jsd,jed, hevap)
3034+
call myAlloc(fluxes%heat_content_evap,isd,ied,jsd,jed, .not. enthalpy_mom)
30313035
call myAlloc(fluxes%heat_content_lprec,isd,ied,jsd,jed, .true.)
30323036
call myAlloc(fluxes%heat_content_fprec,isd,ied,jsd,jed, .true.)
30333037
call myAlloc(fluxes%heat_content_vprec,isd,ied,jsd,jed, .true.)
30343038
call myAlloc(fluxes%heat_content_lrunoff,isd,ied,jsd,jed, .true.)
30353039
call myAlloc(fluxes%heat_content_frunoff,isd,ied,jsd,jed, .true.)
3036-
call myAlloc(fluxes%heat_content_massout,isd,ied,jsd,jed, .not. hevap)
3037-
call myAlloc(fluxes%heat_content_massin,isd,ied,jsd,jed, .not. hevap)
3040+
call myAlloc(fluxes%heat_content_massout,isd,ied,jsd,jed, enthalpy_mom)
3041+
call myAlloc(fluxes%heat_content_massin,isd,ied,jsd,jed, enthalpy_mom)
30383042
endif ; endif
30393043

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

0 commit comments

Comments
 (0)