Skip to content

Commit

Permalink
Heat conservation when enthalpy is via coupler
Browse files Browse the repository at this point in the history
* If fluxes%heat_content_evap is associated, which will only happens in CESM
and when ENTHALPY_FROM_COUPLER=True, the heat contribution from mass
entering/leaving the ocean is accounted for using the six enthalpy terms
provided by the coupler: heat_content_evap, heat_content_lprec,
heat_content_fprec, heat_content_cond, heat_content_lrunoff, and
heat_content_frunoff. If fluxes%heat_content_evap is not associated,
these terms are accounted for via tv%TempxPmE;

* TODO: check that these changes do not change answers for GFDL.
  • Loading branch information
gustavo-marques authored and alperaltuntas committed Apr 21, 2022
1 parent 72daf7b commit b7665f4
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/diagnostics/MOM_sum_output.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1008,7 +1008,14 @@ subroutine accumulate_net_input(fluxes, sfc_state, tv, dt, G, US, CS)
! enddo ; enddo ; endif

! smg: old code
if (associated(tv%TempxPmE)) then
if (associated(fluxes%heat_content_evap)) then
do j=js,je ; do i=is,ie
heat_in(i,j) = heat_in(i,j) + dt * QRZL2_to_J * G%areaT(i,j) * &
(fluxes%heat_content_evap(i,j) + fluxes%heat_content_lprec(i,j) + &
fluxes%heat_content_cond(i,j) + fluxes%heat_content_fprec(i,j) + &
fluxes%heat_content_lrunoff(i,j) + fluxes%heat_content_frunoff(i,j))
enddo ; enddo
elseif (associated(tv%TempxPmE)) then
do j=js,je ; do i=is,ie
heat_in(i,j) = heat_in(i,j) + (fluxes%C_p * QRZL2_to_J*G%areaT(i,j)) * tv%TempxPmE(i,j)
enddo ; enddo
Expand Down

0 comments on commit b7665f4

Please sign in to comment.