Skip to content

Commit

Permalink
correction to enthalpy calculation, bug fix in abort code
Browse files Browse the repository at this point in the history
  • Loading branch information
jedwards4b committed Oct 9, 2023
1 parent bce11df commit 00a5b77
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cesm/driver/esmApp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ program esmApp
! Call Run for the ensemble driver
!-----------------------------------------------------------------------------
call ESMF_GridCompRun(ensemble_driver_comp, userRc=urc, rc=rc)
if (ESMF_LogFoundError(rcToCheck=urc, msg=ESMF_LOGERR_PASSTHRU, &
if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, &
line=__LINE__, &
file=__FILE__)) &
call ESMF_Finalize(endflag=ESMF_END_ABORT)
Expand Down
7 changes: 3 additions & 4 deletions mediator/med_enthalpy_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@ subroutine med_compute_enthalpy(is_local, rc)

call FB_GetFldPtr(is_local%wrap%FBImp(compatm, compocn), 'Faxa_hrain', hrain_a, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return

do n = 1,nmax
hrain(n) = (hrain_a(n) - tkfrz*rain(n)*cpfw) * ofrac(n)
enddo
Expand Down Expand Up @@ -260,10 +259,10 @@ subroutine med_compute_enthalpy(is_local, rc)
allocate(hcorr(nmax))
areas => is_local%wrap%mesh_info(compocn)%areas
do n = 1,nmax
hcorr(n) = (hrain_a(n) + hsnow_a(n) + hevap_a(n) + hrofl_a(n) + hrofi_a(n)) * &
areas(n) * glob_area_inv
! hcorr(n) = (hrain_a(n) + hsnow_a(n) + hevap_a(n) + hrofl_a(n) + hrofi_a(n)) * &
! areas(n) * glob_area_inv

! hcorr(n) = (hrofl_a(n) + hrofi_a(n)) *areas(n) *glob_area_inv
hcorr(n) = (hrofl_a(n) + hrofi_a(n)) *areas(n) *glob_area_inv
end do

! Determine sum of enthalpy correction for each hcorr index locally
Expand Down

0 comments on commit 00a5b77

Please sign in to comment.