diff --git a/cesm/mod_cesm.F90 b/cesm/mod_cesm.F90
index e13dd3c7..217d0458 100644
--- a/cesm/mod_cesm.F90
+++ b/cesm/mod_cesm.F90
@@ -33,7 +33,8 @@ module mod_cesm
lamult, lasl, ustokes, vstokes, atmco2, atmbrf, &
flxdms, flxbrf, &
atmn2o, atmnh3, atmnhxdep, atmnoydep, &
- use_stream_relaxation
+ use_stream_relaxation, &
+ hmat
use mod_ben02, only: initai, rdcsic, rdctsf, fnlzai
use mod_rdcsss, only: rdcsss
use mod_idarlx, only: idarlx
@@ -66,6 +67,7 @@ module mod_cesm
real(r8), dimension(1 - nbdy:idm + nbdy,1 - nbdy:jdm + nbdy, 2) :: &
swa_da, & ! Solar heat flux [W m-2].
nsf_da, & ! Non-solar heat flux [W m-2].
+ hmat_da, & ! surf.mat.enth.flx
hmlt_da, & ! Heat flux due to melting [W m-2].
lip_da, & ! Liquid water flux [kg m-2 s-1].
sop_da, & ! Solid precipitation [kg m-2 s-1].
@@ -106,7 +108,8 @@ module mod_cesm
slp_da, abswnd_da, ficem_da, lamult_da, lasl_da, flxdms_da, &
flxbrf_da, ustokes_da, vstokes_da, atmco2_da, atmbrf_da, &
atmn2o_da, atmnh3_da, atmnhxdep_da,atmnoydep_da, smtfrc, &
- l1ci, l2ci, inivar_cesm, inicon_cesm, inifrc_cesm, getfrc_cesm
+ l1ci, l2ci, inivar_cesm, inicon_cesm, inifrc_cesm, getfrc_cesm, &
+ hmat_da
contains
@@ -229,6 +232,7 @@ subroutine getfrc_cesm
sfl(i, j) = w1*sfl_da(i, j, l1ci) + w2*sfl_da(i, j, l2ci)
swa(i, j) = w1*swa_da(i, j, l1ci) + w2*swa_da(i, j, l2ci)
nsf(i, j) = w1*nsf_da(i, j, l1ci) + w2*nsf_da(i, j, l2ci)
+ hmat(i, j) = w1*hmat_da(i, j, l1ci) + w2*hmat_da(i, j, l2ci)
hmlt(i, j) = w1*hmlt_da(i, j, l1ci) + w2*hmlt_da(i, j, l2ci)
slp(i, j) = w1*slp_da(i, j, l1ci) + w2*slp_da(i, j, l2ci)
abswnd(i, j) = w1*abswnd_da(i, j, l1ci) + w2*abswnd_da(i, j, l2ci)
@@ -272,6 +276,7 @@ subroutine getfrc_cesm
call ncdefvar('sfl_da', 'x y', ndouble, 8)
call ncdefvar('swa_da', 'x y', ndouble, 8)
call ncdefvar('nsf_da', 'x y', ndouble, 8)
+ call ncdefvar('hmat_da', 'x y', ndouble, 8)
call ncdefvar('hmlt_da', 'x y', ndouble, 8)
call ncdefvar('slp_da', 'x y', ndouble, 8)
call ncdefvar('abswnd_da', 'x y', ndouble, 8)
@@ -310,6 +315,8 @@ subroutine getfrc_cesm
ip, 1, 1._r8, 0._r8, 8)
call ncwrtr('nsf_da', 'x y', nsf_da(1 - nbdy, 1 - nbdy, l2ci), &
ip, 1, 1._r8, 0._r8, 8)
+ call ncwrtr('hmat_da', 'x y', hmat_da(1 - nbdy, 1 - nbdy, l2ci), &
+ ip, 1, 1._r8, 0._r8, 8)
call ncwrtr('hmlt_da', 'x y', hmlt_da(1 - nbdy, 1 - nbdy, l2ci), &
ip, 1, 1._r8, 0._r8, 8)
call ncwrtr('slp_da', 'x y', slp_da(1 - nbdy, 1 - nbdy, l2ci), &
@@ -362,6 +369,7 @@ subroutine getfrc_cesm
call chksum(swa, 1, halo_ps, 'swa')
call chksum(nsf, 1, halo_ps, 'nsf')
call chksum(hmlt, 1, halo_ps, 'hmlt')
+ call chksum(hmat, 1, halo_ps, 'hmat')
call chksum(slp, 1, halo_ps, 'slp')
call chksum(abswnd, 1, halo_ps, 'abswnd')
call chksum(ficem, 1, halo_ps, 'ficem')
diff --git a/cime_config/testdefs/ExpectedTestFails.xml b/cime_config/testdefs/ExpectedTestFails.xml
index dead8b66..1a5c6c90 100644
--- a/cime_config/testdefs/ExpectedTestFails.xml
+++ b/cime_config/testdefs/ExpectedTestFails.xml
@@ -44,13 +44,6 @@
-
-
- FAIL
- BLOM#664
-
-
-
FAIL
diff --git a/drivers/nuopc/ocn_comp_nuopc.F90 b/drivers/nuopc/ocn_comp_nuopc.F90
index 4715933e..35acbb0a 100644
--- a/drivers/nuopc/ocn_comp_nuopc.F90
+++ b/drivers/nuopc/ocn_comp_nuopc.F90
@@ -390,6 +390,7 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
character(len=cllen) :: msg, cvalue
logical :: isPresent, isSet
logical :: ocn2glc_coupling
+ character(len=cllen) :: component_computes_enthalpy_flux
logical :: flds_co2a, flds_co2c, flds_dms, flds_brf
logical :: hamocc_defined
#ifndef HAMOCC
@@ -538,6 +539,17 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
read(cvalue,*) flds_co2c
call blom_logwrite(subname//': flds_co2c = '//trim(cvalue))
+ ! Determine if atm computes enthalpy fluxes
+ call NUOPC_CompAttributeGet(gcomp, name="component_computes_enthalpy_flux", value=cvalue, &
+ ispresent=ispresent, isset=isset, rc=rc)
+ if (ChkErr(rc, __LINE__, u_FILE_u)) return
+ component_computes_enthalpy_flux = 'none'
+ if (isPresent .and. isSet) then
+ component_computes_enthalpy_flux = trim(cvalue)
+ end if
+ write(msg,'(a)') subname//': component_computes_enthalpy_flux is '//trim(component_computes_enthalpy_flux)
+ call blom_logwrite(msg)
+
! Determine if ocn is sending temperature and salinity data to glc
! If data is sent to glc will need to determine number of ocean
! levels and ocean level indices
@@ -594,12 +606,14 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
write(msg,'(a,l1)') subname//': export brf ', flds_brf
call blom_logwrite(msg)
+
+
! ------------------------------------------------------------------------
! Advertise import fields.
! ------------------------------------------------------------------------
call blom_advertise_imports(flds_scalar_name, fldsToOcn_num, fldsToOcn, &
- flds_co2a, flds_co2c)
+ flds_co2a, flds_co2c, component_computes_enthalpy_flux)
do n = 1,fldsToOcn_num
call NUOPC_Advertise(importState, standardName=fldsToOcn(n)%stdname, &
diff --git a/drivers/nuopc/ocn_import_export.F90 b/drivers/nuopc/ocn_import_export.F90
index 48acd7fd..5b4dd8e2 100644
--- a/drivers/nuopc/ocn_import_export.F90
+++ b/drivers/nuopc/ocn_import_export.F90
@@ -32,7 +32,7 @@ module ocn_import_export
use mod_constants, only: rearth, onem
use mod_time, only: nstep, baclin, delt1, dlt
use mod_xc
- use mod_grid, only: scuy, scvx, scp2, scuxi, scvyi, plon, plat, cosang, sinang
+ use mod_grid, only: scuy, scvx, scp2, scuxi, scvyi, plon, plat, cosang, sinang, area
use mod_state, only: u, v, dp, temp, saln, pbu, pbv, ubflxs, vbflxs, sealv
use mod_forcing, only: wavsrc_opt, wavsrc_extern, sprfac, prfac, &
flxco2, flxdms, flxbrf, flxn2o, flxnh3
@@ -44,8 +44,8 @@ module ocn_import_export
ustarw_da, slp_da, abswnd_da, ficem_da, lamult_da, &
lasl_da, ustokes_da, vstokes_da, atmco2_da, &
atmnhxdep_da, atmnoydep_da, &
- l1ci, l2ci
- use mod_utility, only: util1, util2
+ l1ci, l2ci, hmat_da
+ use mod_utility, only: util1, util2, util3, util4
use mod_checksum, only: csdiag, chksum
#ifdef HAMOCC
use mo_control_bgc, only: use_BROMO, ocn_co2_type
@@ -143,6 +143,9 @@ module ocn_import_export
index_Faxa_snow = -1, &
index_Faxa_rain = -1, &
index_Faxa_ndep = -1, &
+ index_Faxa_hmat = -1, &
+ index_Faxa_hlat = -1, &
+ index_Faxa_hmoa = -1, &
index_Sa_pslv = -1, &
index_Sa_co2diag = -1, &
index_Sa_co2prog = -1, &
@@ -216,7 +219,7 @@ end subroutine fldlist_add
! ---------------------------------------------------------------------------
subroutine blom_advertise_imports(flds_scalar_name, fldsToOcn_num, fldsToOcn, &
- flds_co2a, flds_co2c)
+ flds_co2a, flds_co2c, component_computes_enthalpy_flux)
! -------------------------------------------------------------------
! Determine fldsToOcn for import fields
@@ -227,6 +230,7 @@ subroutine blom_advertise_imports(flds_scalar_name, fldsToOcn_num, fldsToOcn, &
type(fldlist_type) , intent(inout) :: fldsToOcn(:)
logical , intent(in) :: flds_co2a
logical , intent(in) :: flds_co2c
+ character(len=*) , intent(in) :: component_computes_enthalpy_flux
integer :: index_scalar
@@ -272,6 +276,13 @@ subroutine blom_advertise_imports(flds_scalar_name, fldsToOcn_num, fldsToOcn, &
call fldlist_add(fldsToOcn_num, fldsToOcn, 'Faxa_rain' , index_Faxa_rain)
call fldlist_add(fldsToOcn_num, fldsToOcn, 'Faxa_ndep' , index_Faxa_ndep, &
ungridded_lbound=1, ungridded_ubound=2)
+ if (trim(component_computes_enthalpy_flux) == 'atm') then
+ call fldlist_add(fldsToOcn_num, fldsToOcn, 'Faxa_hmat' , index_Faxa_hmat)
+ call fldlist_add(fldsToOcn_num, fldsToOcn, 'Faxa_hmat_oa' , index_Faxa_hmoa)
+ ! Note the following was added to avoid a mapping in the mediator of
+ ! Faxa_hlat from the atm to the ocn grid - it is not used in BLOM at the moment
+ call fldlist_add(fldsToOcn_num, fldsToOcn, 'Faxa_hlat' , index_Faxa_hlat)
+ end if
if (flds_co2a .or. flds_co2c) then
call fldlist_add(fldsToOcn_num, fldsToOcn, 'Sa_co2diag' ,index_Sa_co2diag)
call fldlist_add(fldsToOcn_num, fldsToOcn, 'Sa_co2prog', index_Sa_co2prog)
@@ -725,13 +736,14 @@ subroutine blom_importflds(fldlist_num, fldlist)
real(r8), parameter :: &
mval = - 1.e12_r8, &
fval = - 1.e13_r8
+
logical :: first_call = .true.
+ integer :: hmat_method = 2
! Local variables.
- real(r8) :: afac, utmp, vtmp
- integer :: n, i, j, l
- integer :: index_co2
- real(r8):: rofi_heat_flx, snow_heat_flx
+ real(r8) :: afac, utmp, vtmp, rofi_heat_flx, snow_heat_flx, &
+ hmat_oa_asum, oocn_asum, hmat_asum, hmat_oa_avg, hmat_avg
+ integer :: n, i, j, l, index_co2
! Update time level indices.
if (l1ci == 1 .and. l2ci == 1) then
@@ -900,6 +912,111 @@ subroutine blom_importflds(fldlist_num, fldlist)
enddo
!$omp end parallel do
+ if (index_Faxa_hmat > 0 .and. index_Faxa_hmoa > 0) then
+ !$omp parallel do private(i, n, afac)
+ do j = 1, jjcpl
+ do i = 1, ii
+ if (ip(i,j) == 0) then
+ hmat_da(i,j,l1ci)= mval
+ elseif (cplmsk(i,j) == 0) then
+ hmat_da(i,j,l1ci) = 0._r8
+ else
+ n = (j - 1)*ii + i
+ afac = med2mod_areacor(n)
+ ! Heat flux components due to material material enthalpy flux of
+ ! water exchange with atmosphere [W m-2]. Here, index_Faxa_hmat
+ ! is related to enthalpy flux of evaporation and index_Faxa_hmoa
+ ! related to the ocean average of all other enthalpy flux
+ ! components.
+ util1(i,j) = fldlist(index_Faxa_hmat)%dataptr(n)*afac
+ util2(i,j) = fldlist(index_Faxa_hmoa)%dataptr(n)*afac
+ end if
+ end do
+ end do
+ !$omp end parallel do
+
+ select case (hmat_method)
+ case (1)
+ ! Apply enthalpy flux components directly.
+ do j = 1, jjcpl
+ do l = 1, isp(j)
+ do i = max(1, ifp(j,l)), min(ii, ilp(j,l))
+ hmat_da(i,j,l2ci) = util1(i,j) + util2(i,j)
+ nsf_da(i,j,l2ci) = nsf_da(i,j,l2ci) + hmat_da(i,j,l2ci)
+ enddo
+ enddo
+ enddo
+ case (2)
+ ! Redistribute 'hmat_oa' to open ocean area.
+ do j = 1, jjcpl
+ do l = 1, isp(j)
+ do i = max(1, ifp(j,l)), min(ii, ilp(j,l))
+ util3(i,j) = util2(i,j)*scp2(i,j)
+ util4(i,j) = (1._r8 - ficem_da(i,j,l2ci))*scp2(i,j)
+ enddo
+ enddo
+ enddo
+ call xcsum(hmat_oa_asum, util3, ips)
+ call xcsum(oocn_asum , util4, ips)
+ hmat_oa_avg = hmat_oa_asum/oocn_asum
+ do j = 1, jjcpl
+ do l = 1, isp(j)
+ do i = max(1, ifp(j,l)), min(ii, ilp(j,l))
+ hmat_da(i,j,l2ci) = &
+ util1(i,j) + hmat_oa_avg*(1._r8 - ficem_da(i,j,l2ci))
+ nsf_da(i,j,l2ci) = nsf_da(i,j,l2ci) + hmat_da(i,j,l2ci)
+ enddo
+ enddo
+ enddo
+ case (3)
+ ! Apply global average enthalpy flux.
+ do j = 1, jjcpl
+ do l = 1, isp(j)
+ do i = max(1, ifp(j,l)), min(ii, ilp(j,l))
+ util3(i,j) = (util1(i,j) + util2(i,j))*scp2(i,j)
+ enddo
+ enddo
+ enddo
+ call xcsum(hmat_asum, util3, ips)
+ hmat_avg = hmat_asum/area
+ do j = 1, jjcpl
+ do l = 1, isp(j)
+ do i = max(1, ifp(j,l)), min(ii, ilp(j,l))
+ hmat_da(i,j,l2ci) = hmat_avg
+ nsf_da(i,j,l2ci) = nsf_da(i,j,l2ci) + hmat_da(i,j,l2ci)
+ enddo
+ enddo
+ enddo
+ case (4)
+ ! Apply global average enthalpy flux over open ocean.
+ do j = 1, jjcpl
+ do l = 1, isp(j)
+ do i = max(1, ifp(j,l)), min(ii, ilp(j,l))
+ util3(i,j) = (util1(i,j) + util2(i,j))*scp2(i,j)
+ util4(i,j) = (1._r8 - ficem_da(i,j,l2ci))*scp2(i,j)
+ enddo
+ enddo
+ enddo
+ call xcsum(hmat_asum, util3, ips)
+ call xcsum(oocn_asum, util4, ips)
+ hmat_avg = hmat_asum/oocn_asum
+ do j = 1, jjcpl
+ do l = 1, isp(j)
+ do i = max(1, ifp(j,l)), min(ii, ilp(j,l))
+ hmat_da(i,j,l2ci) = hmat_avg*(1._r8 - ficem_da(i,j,l2ci))
+ nsf_da(i,j,l2ci) = nsf_da(i,j,l2ci) + hmat_da(i,j,l2ci)
+ enddo
+ enddo
+ enddo
+ case default
+ write(lp,*) subname//': BLOM ERROR: Unsupported hmat_method'
+ call xcstop(subname)
+ stop subname
+ end select
+ else
+ hmat_da(:,:,:) = mval
+ end if
+
if (nreg == 2) then
call xctilr(lip_da(1-nbdy,1-nbdy,l2ci), 1,1, 0,0, halo_ps)
call xctilr(sop_da(1-nbdy,1-nbdy,l2ci), 1,1, 0,0, halo_ps)
@@ -911,6 +1028,9 @@ subroutine blom_importflds(fldlist_num, fldlist)
call xctilr(swa_da(1-nbdy,1-nbdy,l2ci), 1,1, 0,0, halo_ps)
call xctilr(nsf_da(1-nbdy,1-nbdy,l2ci), 1,1, 0,0, halo_ps)
call xctilr(hmlt_da(1-nbdy,1-nbdy,l2ci), 1,1, 0,0, halo_ps)
+ if (index_Faxa_hmat > 0) then
+ call xctilr(hmat_da(1-nbdy,1-nbdy,l2ci), 1,1, 0,0, halo_ps)
+ end if
call xctilr(atmnhxdep_da(1-nbdy,1-nbdy,l2ci), 1,1, 0,0, halo_ps)
call xctilr(atmnoydep_da(1-nbdy,1-nbdy,l2ci), 1,1, 0,0, halo_ps)
endif
@@ -1069,6 +1189,9 @@ subroutine blom_importflds(fldlist_num, fldlist)
call chksum(atmco2_da (1-nbdy,1-nbdy,l2ci), 1, halo_ps, 'atmco2' )
call chksum(atmnhxdep_da(1-nbdy,1-nbdy,l2ci), 1, halo_ps, 'atmnhxdep')
call chksum(atmnoydep_da(1-nbdy,1-nbdy,l2ci), 1, halo_ps, 'atmnoydep')
+ if (index_Faxa_hmat > 0) then
+ call chksum(hmat_da(1-nbdy,1-nbdy,l2ci),1,halo_ps,'hmat')
+ end if
endif
if (first_call) then
diff --git a/phy/mod_dia.F90 b/phy/mod_dia.F90
index 365f1c19..271f0c37 100644
--- a/phy/mod_dia.F90
+++ b/phy/mod_dia.F90
@@ -57,7 +57,7 @@ module mod_dia
usflsm, vsflsm, usflld, vsflld
use mod_cmnfld, only: z, bfsql, dz, mlts
use mod_seaice, only: ficem, hicem, hsnwm, uicem, vicem, iagem
- use mod_forcing, only: swa, nsf, hmltfz, lip, sop, eva, rnf, rfi, &
+ use mod_forcing, only: swa, nsf, hmat, hmltfz, lip, sop, eva, rnf, rfi, &
fmltfz, sfl, ztx, mty, abswnd, &
lamult, lasl, ustokes, vstokes, surflx, &
surrlx, salflx, brnflx, salrlx, taux, tauy, &
@@ -196,7 +196,7 @@ module mod_dia
integer, dimension(nphymax), public :: &
H2D_ABSWND ,H2D_ALB ,H2D_BTMSTR ,H2D_BRNFLX ,H2D_BRNPD , &
H2D_DFL ,H2D_EVA ,H2D_FICE ,H2D_FMLTFZ ,H2D_HICE , &
- H2D_HMLTFZ ,H2D_HSNW ,H2D_IAGE ,H2D_IDKEDT ,H2D_LAMULT , &
+ H2D_HMLTFZ ,H2D_HSNW ,H2D_IAGE ,H2D_IDKEDT ,H2D_LAMULT , H2D_HMAT, &
H2D_LASL ,H2D_LIP ,H2D_MAXMLD ,H2D_MLD ,H2D_MLTS , &
H2D_MLTSMN ,H2D_MLTSMX ,H2D_MLTSSQ ,H2D_MTKEUS ,H2D_MTKENI , &
H2D_MTKEBF ,H2D_MTKERS ,H2D_MTKEPE ,H2D_MTKEKE ,H2D_MTY , &
@@ -233,7 +233,7 @@ module mod_dia
integer, dimension(nphymax), public :: &
ACC_ABSWND ,ACC_ALB ,ACC_BRNFLX ,ACC_BRNPD ,ACC_DFL , &
- ACC_EVA ,ACC_FICE ,ACC_FMLTFZ ,ACC_HICE ,ACC_HMLTFZ , &
+ ACC_EVA ,ACC_FICE ,ACC_FMLTFZ ,ACC_HICE ,ACC_HMAT , ACC_HMLTFZ , &
ACC_HSNW ,ACC_IAGE ,ACC_IDKEDT ,ACC_LAMULT ,ACC_LASL , &
ACC_LIP ,ACC_MAXMLD ,ACC_MLD ,ACC_MLTS ,ACC_MLTSMN , &
ACC_MLTSMX ,ACC_MLTSSQ ,ACC_MTKEUS ,ACC_MTKENI ,ACC_MTKEBF , &
@@ -284,7 +284,7 @@ module mod_dia
namelist /DIAPHY/ &
H2D_ABSWND ,H2D_ALB ,H2D_BTMSTR ,H2D_BRNFLX ,H2D_BRNPD , &
- H2D_DFL ,H2D_EVA ,H2D_FICE ,H2D_FMLTFZ ,H2D_HICE , &
+ H2D_DFL ,H2D_EVA ,H2D_FICE ,H2D_FMLTFZ ,H2D_HICE , H2D_HMAT, &
H2D_HMLTFZ ,H2D_HSNW ,H2D_IAGE ,H2D_IDKEDT ,H2D_LAMULT , &
H2D_LASL ,H2D_LIP ,H2D_MAXMLD ,H2D_MLD ,H2D_MLTS , &
H2D_MLTSMN ,H2D_MLTSMX ,H2D_MLTSSQ ,H2D_MTKEUS ,H2D_MTKENI , &
@@ -499,6 +499,7 @@ subroutine diaini
ACC_FICE(n) = H2D_FICE(n) + H2D_HICE(n) + H2D_UICE(n) &
+ H2D_VICE(n) + H2D_HSNW(n)
ACC_HICE(n) = H2D_HICE(n) + H2D_UICE(n) + H2D_VICE(n)
+ ACC_HMAT(n) = H2D_HMAT(n)
ACC_HMLTFZ(n) = H2D_HMLTFZ(n)
ACC_HSNW(n) = H2D_HSNW(n)
ACC_IAGE(n) = H2D_IAGE(n)
@@ -694,6 +695,8 @@ subroutine diaini
ACC_FICE(n) = nphyh2d*min(1,ACC_FICE(n))
if (acc_hice(n) /= 0) nphyh2d = nphyh2d+1
ACC_HICE(n) = nphyh2d*min(1,ACC_HICE(n))
+ if (acc_hmat(n) /= 0) nphyh2d = nphyh2d+1
+ ACC_HMAT(n) = nphyh2d*min(1,ACC_HMAT(n))
if (acc_hmltfz(n) /= 0) nphyh2d = nphyh2d+1
ACC_HMLTFZ(n) = nphyh2d*min(1,ACC_HMLTFZ(n))
if (acc_hsnw(n) /= 0) nphyh2d = nphyh2d+1
@@ -1351,6 +1354,9 @@ subroutine diaacc(m,n,mm,nn,k1m,k1n)
! non-solar heat flux [W/m^2]
call acch2d(ACC_NSF,nsf,dummy,0,'p')
+ ! heat flux due to material enthalpy flux [W/m^2]
+ call acch2d(ACC_HMAT,hmat,dummy,0,'p')
+
! heat flux due to melting/freezing [W/m^2]
call acch2d(ACC_HMLTFZ,hmltfz,dummy,0,'p')
@@ -2421,6 +2427,10 @@ subroutine diaout(iogrp,m,n,mm,nn,k1m,k1n)
call wrth2d(ACC_NSF(iogrp),H2D_NSF(iogrp),rnacc,0., &
cmpflg,ip,'p','nsf','Non-solar heat flux',' ','W m-2')
+ call wrth2d(ACC_HMAT(iogrp),H2D_HMAT(iogrp),rnacc,0., &
+ cmpflg,ip,'p','hmat','Heat flux due to material enthalpy flux', &
+ ' ','W m-2')
+
call wrth2d(ACC_HMLTFZ(iogrp),H2D_HMLTFZ(iogrp),rnacc,0., &
cmpflg,ip,'p','hmltfz','Heat flux due to melting/freezing',' ','W m-2')
@@ -5310,6 +5320,7 @@ subroutine inifld(iogrp)
call inih2d(ACC_ALB(iogrp),'p',0.)
call inih2d(ACC_SWA(iogrp),'p',0.)
call inih2d(ACC_NSF(iogrp),'p',0.)
+ call inih2d(ACC_HMAT(iogrp),'p',0.)
call inih2d(ACC_DFL(iogrp),'p',0.)
call inih2d(ACC_LIP(iogrp),'p',0.)
call inih2d(ACC_SOP(iogrp),'p',0.)
@@ -6224,6 +6235,9 @@ subroutine definevar(irec,iogrp,cmpflg,timeunits,calendar)
call ncdefvar3d(H2D_NSF(iogrp),cmpflg,'p','nsf', &
'Non-solar heat flux',' ','W m-2',0)
+ call ncdefvar3d(H2D_HMAT(iogrp),cmpflg,'p','hmat', &
+ 'Heat flux due to material enthalpy flux',' ','W m-2',0)
+
call ncdefvar3d(H2D_HMLTFZ(iogrp),cmpflg,'p','hmltfz', &
'Heat flux due to melting/freezing',' ','W m-2',0)
diff --git a/phy/mod_forcing.F90 b/phy/mod_forcing.F90
index 6c90cb22..f39fd6bd 100644
--- a/phy/mod_forcing.F90
+++ b/phy/mod_forcing.F90
@@ -123,6 +123,7 @@ module mod_forcing
hmltfz, & ! Heat flux due to melting and freezing [W m-2].
lip, & ! Liquid water flux [kg m-2 s-1].
sop, & ! Solid precipitation [kg m-2 s-1].
+ hmat, & ! Surface material enthalpy flux [W m-2].
eva, & ! Evaporation [kg m-2 s-1].
rnf, & ! Liquid runoff [kg m-2 s-1].
rfi, & ! Frozen runoff [kg m-2 s-1].
@@ -191,8 +192,8 @@ module mod_forcing
wavsrc, wavsrc_opt, wavsrc_none, wavsrc_param, wavsrc_extern, &
sref, tflxap, sflxap, tflxdi, sflxdi, nflxdi, &
sstclm, ricclm, sssclm, prfac, eiacc, pracc, &
- swa, nsf, hmltfz, lip, sop, eva, rnf, rfi, fmltfz, sfl, ztx, mty, &
- ustarw, slp, abswnd, lamult, lasl, ustokes, vstokes, &
+ swa, nsf, hmltfz, hmat, lip, sop, eva, rnf, rfi, fmltfz, sfl, &
+ ztx, mty, ustarw, slp, abswnd, lamult, lasl, ustokes, vstokes, &
atmco2, flxco2, flxdms, flxbrf, atmbrf, &
atmn2o,flxn2o,atmnh3,flxnh3, atmnhxdep,atmnoydep, &
surflx, surrlx, sswflx, salflx, brnflx, salrlx, taux, tauy, &
@@ -216,6 +217,7 @@ subroutine inivar_forcing
swa(:,:) = spval
nsf(:,:) = spval
hmltfz(:,:) = spval
+ hmat(:,:) = spval
lip(:,:) = spval
sop(:,:) = spval
eva(:,:) = spval
diff --git a/phy/mod_rdlim.F90 b/phy/mod_rdlim.F90
index 6be48572..5ea0b860 100644
--- a/phy/mod_rdlim.F90
+++ b/phy/mod_rdlim.F90
@@ -82,7 +82,7 @@ module mod_rdlim
msc_massgs, msc_volgs, msc_salnga, msc_tempga, msc_sssga, &
msc_sstga, &
h2d_abswnd, h2d_alb, h2d_btmstr, h2d_brnflx, h2d_brnpd, &
- h2d_dfl, h2d_eva, h2d_fice, h2d_fmltfz, h2d_hice, &
+ h2d_dfl, h2d_eva, h2d_fice, h2d_fmltfz, h2d_hice, h2d_hmat, &
h2d_hmltfz, h2d_hsnw, h2d_iage, h2d_idkedt, h2d_lamult, &
h2d_lasl, h2d_lip, h2d_maxmld, h2d_mld, h2d_mlts, &
h2d_mltsmn, h2d_mltsmx, h2d_mltssq, h2d_mtkeus, h2d_mtkeni, &
@@ -483,6 +483,7 @@ subroutine rdlim()
write (lp,*) 'H2D_FMLTFZ ',H2D_FMLTFZ(1:nphy)
write (lp,*) 'H2D_FICE ',H2D_FICE(1:nphy)
write (lp,*) 'H2D_HICE ',H2D_HICE(1:nphy)
+ write (lp,*) 'H2D_HMAT ',H2D_HMAT(1:nphy)
write (lp,*) 'H2D_HMLTFZ ',H2D_HMLTFZ(1:nphy)
write (lp,*) 'H2D_HSNW ',H2D_HSNW(1:nphy)
write (lp,*) 'H2D_IAGE ',H2D_IAGE(1:nphy)
@@ -661,6 +662,7 @@ subroutine rdlim()
call xcbcst(H2D_FICE)
call xcbcst(H2D_FMLTFZ)
call xcbcst(H2D_HICE)
+ call xcbcst(H2D_HMAT)
call xcbcst(H2D_HMLTFZ)
call xcbcst(H2D_HSNW)
call xcbcst(H2D_IAGE)
diff --git a/phy/mod_restart.F90 b/phy/mod_restart.F90
index ee626278..4eaa0e3e 100644
--- a/phy/mod_restart.F90
+++ b/phy/mod_restart.F90
@@ -59,7 +59,7 @@ module mod_restart
nphy, nacc_phy, &
acc_abswnd, acc_alb, acc_brnflx, acc_brnpd, &
acc_dfl, acc_eva, acc_fice, acc_fmltfz, &
- acc_hice, acc_hmltfz, acc_hsnw, acc_iage, &
+ acc_hice, acc_hmat, acc_hmltfz, acc_hsnw, acc_iage, &
acc_idkedt, acc_lamult, acc_lasl, acc_lip, &
acc_maxmld, acc_mld, acc_mlts, acc_mltsmn, &
acc_mltsmx, acc_mltssq, acc_mtkeus, &
@@ -122,7 +122,7 @@ module mod_restart
use mod_eddtra, only: tau_growing_hbl, tau_decaying_hbl, &
tau_growing_hml, tau_decaying_hml, &
hbl_tf, wpup_tf, hml_tf1, hml_tf
- use mod_cesm, only: frzpot, mltpot, swa_da, nsf_da, hmlt_da, &
+ use mod_cesm, only: frzpot, mltpot, swa_da, nsf_da, hmat_da, hmlt_da, &
lip_da, sop_da, eva_da, rnf_da, rfi_da, &
fmltfz_da, sfl_da, ztx_da, mty_da, ustarw_da, &
slp_da, abswnd_da, atmco2_da, atmbrf_da, &
@@ -535,6 +535,8 @@ subroutine defwrtflds(defmode)
swa_da, ip, defmode)
call defwrtfld('nsf_da', trim(c5p)//' k2 time', &
nsf_da, ip, defmode)
+ call defwrtfld('hmat_da', trim(c5p)//' k2 time', &
+ hmat_da, ip, defmode)
call defwrtfld('hmlt_da', trim(c5p)//' k2 time', &
hmlt_da, ip, defmode)
call defwrtfld('slp_da', trim(c5p)//' k2 time', &
@@ -688,6 +690,9 @@ subroutine defwrtflds(defmode)
if (ACC_NSF(n) /= 0) &
call defwrtfld('nsf_phy'//c2, trim(c5p)//' time', &
phyh2d(1-nbdy,1-nbdy,ACC_NSF(n)), ip, defmode)
+ if (ACC_HMAT(n) /= 0) &
+ call defwrtfld('hmat_phy'//c2, trim(c5p)//' time', &
+ phyh2d(1-nbdy,1-nbdy,ACC_HMAT(n)), ip, defmode)
if (ACC_DFL(n) /= 0) &
call defwrtfld('dfl_phy'//c2, trim(c5p)//' time', &
phyh2d(1-nbdy,1-nbdy,ACC_DFL(n)), ip, defmode)
@@ -1883,6 +1888,7 @@ subroutine restart_read()
call readfld('sfl_da', no_unitconv, sfl_da, ip, required = .false.)
call readfld('swa_da', no_unitconv, swa_da, ip, required = .false.)
call readfld('nsf_da', no_unitconv, nsf_da, ip, required = .false.)
+ call readfld('hmat_da', no_unitconv, hmat_da, ip, required = .false.)
call readfld('hmlt_da', no_unitconv, hmlt_da, ip, required = .false.)
call readfld('slp_da', no_unitconv, slp_da, ip, required = .false.)
call readfld('ficem_da', no_unitconv, ficem_da, ip, required = .false.)
@@ -2062,6 +2068,9 @@ subroutine restart_read()
if (ACC_NSF(n) /= 0) &
call readfld('nsf_phy'//c2, no_unitconv, &
phyh2d(1-nbdy,1-nbdy,ACC_NSF(n)), ip)
+ if (ACC_HMAT(n) /= 0) &
+ call readfld('hmat_phy'//c2, no_unitconv, &
+ phyh2d(1-nbdy,1-nbdy,ACC_HMAT(n)), ip)
if (ACC_DFL(n) /= 0) &
call readfld('dfl_phy'//c2, no_unitconv, &
phyh2d(1-nbdy,1-nbdy,ACC_DFL(n)), ip)