Skip to content

Commit 2cd228f

Browse files
gustavo-marquesalperaltuntas
authored andcommitted
Adds conditional for setting fluxes%heat_content_*
* only writes fluxes%heat_content_* when ENTHALPY_FROM_COUPLER = True.
1 parent fc3ab45 commit 2cd228f

1 file changed

Lines changed: 14 additions & 12 deletions

File tree

config_src/drivers/nuopc_cap/mom_surface_forcing_nuopc.F90

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -544,23 +544,25 @@ subroutine convert_IOB_to_fluxes(IOB, fluxes, index_bounds, Time, valid_time, G,
544544
fluxes%sw_nir_dir(i,j) + fluxes%sw_nir_dif(i,j)
545545

546546
! enthalpy terms
547-
if (associated(IOB%hrofl)) &
548-
fluxes%heat_content_lrunoff(i,j) = US%W_m2_to_QRZ_T * IOB%hrofl(i-i0,j-j0) * G%mask2dT(i,j)
547+
if (CS%enthalpy_cpl) then
548+
if (associated(IOB%hrofl)) &
549+
fluxes%heat_content_lrunoff(i,j) = US%W_m2_to_QRZ_T * IOB%hrofl(i-i0,j-j0) * G%mask2dT(i,j)
549550

550-
if (associated(IOB%hrofi)) &
551-
fluxes%heat_content_frunoff(i,j) = US%W_m2_to_QRZ_T * IOB%hrofi(i-i0,j-j0) * G%mask2dT(i,j)
551+
if (associated(IOB%hrofi)) &
552+
fluxes%heat_content_frunoff(i,j) = US%W_m2_to_QRZ_T * IOB%hrofi(i-i0,j-j0) * G%mask2dT(i,j)
552553

553-
if (associated(IOB%hrain)) &
554-
fluxes%heat_content_lprec(i,j) = US%W_m2_to_QRZ_T * IOB%hrain(i-i0,j-j0) * G%mask2dT(i,j)
554+
if (associated(IOB%hrain)) &
555+
fluxes%heat_content_lprec(i,j) = US%W_m2_to_QRZ_T * IOB%hrain(i-i0,j-j0) * G%mask2dT(i,j)
555556

556-
if (associated(IOB%hsnow)) &
557-
fluxes%heat_content_fprec(i,j) = US%W_m2_to_QRZ_T * IOB%hsnow(i-i0,j-j0) * G%mask2dT(i,j)
557+
if (associated(IOB%hsnow)) &
558+
fluxes%heat_content_fprec(i,j) = US%W_m2_to_QRZ_T * IOB%hsnow(i-i0,j-j0) * G%mask2dT(i,j)
558559

559-
if (associated(IOB%hevap)) &
560-
fluxes%heat_content_evap(i,j) = US%W_m2_to_QRZ_T * IOB%hevap(i-i0,j-j0) * G%mask2dT(i,j)
560+
if (associated(IOB%hevap)) &
561+
fluxes%heat_content_evap(i,j) = US%W_m2_to_QRZ_T * IOB%hevap(i-i0,j-j0) * G%mask2dT(i,j)
561562

562-
if (associated(IOB%hcond)) &
563-
fluxes%heat_content_cond(i,j) = US%W_m2_to_QRZ_T * IOB%hcond(i-i0,j-j0) * G%mask2dT(i,j)
563+
if (associated(IOB%hcond)) &
564+
fluxes%heat_content_cond(i,j) = US%W_m2_to_QRZ_T * IOB%hcond(i-i0,j-j0) * G%mask2dT(i,j)
565+
endif
564566

565567
! sea ice fraction [nondim]
566568
if (associated(IOB%ice_fraction) .and. associated(fluxes%ice_fraction)) &

0 commit comments

Comments
 (0)