From b85541dc50bec999f6343d0bc797d9514e313d15 Mon Sep 17 00:00:00 2001 From: Jun Wang Date: Tue, 8 Jun 2021 18:50:32 +0000 Subject: [PATCH 01/28] add Moorthis gcycle fix for tiled fixed file --- physics/gcycle.F90 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/physics/gcycle.F90 b/physics/gcycle.F90 index 558a65860..2a33a7e10 100644 --- a/physics/gcycle.F90 +++ b/physics/gcycle.F90 @@ -93,6 +93,7 @@ subroutine gcycle (me, nthrds, nx, ny, isc, jsc, nsst, tile_num, nlunit, & logical :: lake(nx*ny) + integer :: i_indx(nx*ny), j_indx(nx*ny) character(len=6) :: tile_num_ch real(kind=kind_phys) :: sig1t, dt_warm integer :: npts, nb, ix, jx, ls, ios, ll @@ -120,6 +121,9 @@ subroutine gcycle (me, nthrds, nx, ny, isc, jsc, nsst, tile_num, nlunit, & end if ! do ix=1,npts + i_indx(ix) = imap(ix) + isc - 1 + j_indx(ix) = jmap(ix) + jsc - 1 + ZORFCS(ix) = zorll (ix) if (slmsk(ix) > 1.9_kind_phys .and. .not. frac_grid) then ZORFCS(ix) = zorli (ix) @@ -190,7 +194,7 @@ subroutine gcycle (me, nthrds, nx, ny, isc, jsc, nsst, tile_num, nlunit, & nlunit, size(input_nml_file), input_nml_file, & lake, min_lakeice, min_seaice, & ialb, isot, ivegsrc, & - trim(tile_num_ch), imap, jmap) + trim(tile_num_ch), i_indx, j_indx) #ifndef INTERNAL_FILE_NML close (Model%nlunit) #endif From fbd5933952291231becf03ef1ca89924bf9e1405 Mon Sep 17 00:00:00 2001 From: Helin Wei Date: Fri, 3 Sep 2021 19:56:53 -0400 Subject: [PATCH 02/28] modification to add extra land fields to the output --- physics/GFS_surface_generic.F90 | 17 ++++-- physics/GFS_surface_generic.meta | 99 ++++++++++++++++++++++++++++++++ physics/sfc_noahmp_drv.F90 | 13 ++++- physics/sfc_noahmp_drv.meta | 36 ++++++++++++ 4 files changed, 158 insertions(+), 7 deletions(-) diff --git a/physics/GFS_surface_generic.F90 b/physics/GFS_surface_generic.F90 index d405b3821..dc5d772e5 100644 --- a/physics/GFS_surface_generic.F90 +++ b/physics/GFS_surface_generic.F90 @@ -211,12 +211,13 @@ end subroutine GFS_surface_generic_post_finalize !! subroutine GFS_surface_generic_post_run (im, cplflx, cplwav, lssav, icy, wet, dtf, ep1d, gflx, tgrs_1, qgrs_1, ugrs_1, vgrs_1,& adjsfcdlw, adjsfcdsw, adjnirbmd, adjnirdfd, adjvisbmd, adjvisdfd, adjsfculw, adjsfculw_wat, adjnirbmu, adjnirdfu, & - adjvisbmu, adjvisdfu,t2m, q2m, u10m, v10m, tsfc, tsfc_wat, pgr, xcosz, evbs, evcw, trans, sbsno, snowc, snohf, & + adjvisbmu, adjvisdfu,t2m, q2m, u10m, v10m, tsfc, tsfc_wat, pgr, xcosz, evbs, evcw, trans, sbsno, snowc, snohf,pah,pahi, & epi, gfluxi, t1, q1, u1, v1, dlwsfci_cpl, dswsfci_cpl, dlwsfc_cpl, dswsfc_cpl, dnirbmi_cpl, dnirdfi_cpl, dvisbmi_cpl, & dvisdfi_cpl, dnirbm_cpl, dnirdf_cpl, dvisbm_cpl, dvisdf_cpl, nlwsfci_cpl, nlwsfc_cpl, t2mi_cpl, q2mi_cpl, u10mi_cpl, & v10mi_cpl, tsfci_cpl, psurfi_cpl, nnirbmi_cpl, nnirdfi_cpl, nvisbmi_cpl, nvisdfi_cpl, nswsfci_cpl, nswsfc_cpl, nnirbm_cpl, & - nnirdf_cpl, nvisbm_cpl, nvisdf_cpl, gflux, evbsa, evcwa, transa, sbsnoa, snowca, snohfa, ep, & - runoff, srunoff, runof, drain, lheatstrg, z0fac, e0fac, zorl, hflx, evap, hflxq, evapq, hffac, hefac, errmsg, errflg) + nnirdf_cpl, nvisbm_cpl, nvisdf_cpl, gflux, evbsa, evcwa, transa, sbsnoa, snowca, snohfa, paha,ep,ecan,etran,edir,waxy, & + runoff, srunoff, runof, drain, tecan,tetran,tedir,twa,lheatstrg, z0fac, e0fac, zorl, hflx, evap, hflxq, evapq, hffac, & + hefac, errmsg, errflg) implicit none @@ -227,13 +228,13 @@ subroutine GFS_surface_generic_post_run (im, cplflx, cplwav, lssav, icy, wet, dt real(kind=kind_phys), dimension(:), intent(in) :: ep1d, gflx, tgrs_1, qgrs_1, ugrs_1, vgrs_1, adjsfcdlw, adjsfcdsw, & adjnirbmd, adjnirdfd, adjvisbmd, adjvisdfd, adjsfculw, adjsfculw_wat, adjnirbmu, adjnirdfu, adjvisbmu, adjvisdfu, & - t2m, q2m, u10m, v10m, tsfc, tsfc_wat, pgr, xcosz, evbs, evcw, trans, sbsno, snowc, snohf + t2m, q2m, u10m, v10m, tsfc, tsfc_wat, pgr, xcosz, evbs, evcw, trans, sbsno, snowc, snohf,pah,ecan,etran,edir,waxy real(kind=kind_phys), dimension(:), intent(inout) :: epi, gfluxi, t1, q1, u1, v1, dlwsfci_cpl, dswsfci_cpl, dlwsfc_cpl, & dswsfc_cpl, dnirbmi_cpl, dnirdfi_cpl, dvisbmi_cpl, dvisdfi_cpl, dnirbm_cpl, dnirdf_cpl, dvisbm_cpl, dvisdf_cpl, & nlwsfci_cpl, nlwsfc_cpl, t2mi_cpl, q2mi_cpl, u10mi_cpl, v10mi_cpl, tsfci_cpl, psurfi_cpl, nnirbmi_cpl, nnirdfi_cpl, & nvisbmi_cpl, nvisdfi_cpl, nswsfci_cpl, nswsfc_cpl, nnirbm_cpl, nnirdf_cpl, nvisbm_cpl, nvisdf_cpl, gflux, evbsa, & - evcwa, transa, sbsnoa, snowca, snohfa, ep + evcwa, transa, sbsnoa, snowca, snohfa, ep, paha,tecan,tetran,tedir,twa,pahi real(kind=kind_phys), dimension(:), intent(inout) :: runoff, srunoff real(kind=kind_phys), dimension(:), intent(in) :: drain, runof @@ -268,6 +269,7 @@ subroutine GFS_surface_generic_post_run (im, cplflx, cplwav, lssav, icy, wet, dt do i=1,im epi(i) = ep1d(i) gfluxi(i) = gflx(i) + pahi(i) = pah(i) t1(i) = tgrs_1(i) q1(i) = qgrs_1(i) u1(i) = ugrs_1(i) @@ -352,11 +354,16 @@ subroutine GFS_surface_generic_post_run (im, cplflx, cplwav, lssav, icy, wet, dt snowca(i) = snowca(i) + snowc(i) * dtf snohfa(i) = snohfa(i) + snohf(i) * dtf ep(i) = ep(i) + ep1d(i) * dtf + paha(i) = paha(i) + pah(i) * dtf ! --- ... total runoff is composed of drainage into water table and ! runoff at the surface and is accumulated in unit of meters runoff(i) = runoff(i) + (drain(i)+runof(i)) * dtf srunoff(i) = srunoff(i) + runof(i) * dtf + tecan(i) = tecan(i) + ecan(i) * dtf + tetran(i) = tetran(i) + etran(i) * dtf + tedir(i) = tedir(i) + edir(i) * dtf + twa(i) = waxy(i) enddo endif diff --git a/physics/GFS_surface_generic.meta b/physics/GFS_surface_generic.meta index 2cdb1dbbe..928c879e7 100644 --- a/physics/GFS_surface_generic.meta +++ b/physics/GFS_surface_generic.meta @@ -817,6 +817,24 @@ kind = kind_phys intent = in optional = F +[pah] + standard_name = total_precipitation_advected_heat + long_name = precipitation advected heat - total + units = W m-2 + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = in + optional = F +[pahi] + standard_name = instantaneous_total_precipitation_advected_heat + long_name = instantaneous precipitation advected heat - total + units = W m-2 + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = in + optional = F [epi] standard_name = instantaneous_surface_potential_evaporation long_name = instantaneous sfc potential evaporation @@ -1204,6 +1222,15 @@ kind = kind_phys intent = inout optional = F +[paha] + standard_name = cumulative_precipitation_advected_heat_flux_multiplied_by_timestep + long_name = cumulative precipitation advected heat flux multiplied by timestep + units = W m-2 s + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = inout + optional = F [ep] standard_name = cumulative_surface_upward_potential_latent_heat_flux_multiplied_by_timestep long_name = cumulative surface upward potential latent heat flux multiplied by timestep @@ -1213,6 +1240,42 @@ kind = kind_phys intent = inout optional = F +[ecan] + standard_name = evaporation_of_intercepted_water + long_name = evaporation of intercepted water + units = kg m-2 s-1 + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = in + optional = F +[etran] + standard_name = transpiration_rate + long_name = transpiration rate + units = kg m-2 s-1 + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = in + optional = F +[edir] + standard_name = soil_surface_evaporation_rate + long_name = soil surface evaporation rate + units = kg m-2 s-1 + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = in + optional = F +[waxy] + standard_name = water_storage_in_aquifer + long_name = water storage in aquifer + units = mm + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = in + optional = F [runoff] standard_name = total_runoff long_name = total water runoff @@ -1249,6 +1312,42 @@ kind = kind_phys intent = in optional = F +[tecan] + standard_name = total_evaporation_of_intercepted_water + long_name = total evaporation of intercepted water + units = kg m-2 + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = inout + optional = F +[tetran] + standard_name = total_transpiration_rate + long_name = total transpiration rate + units = kg m-2 + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = inout + optional = F +[tedir] + standard_name = total_soil_surface_evaporation_rate + long_name = total soil surface evaporation rate + units = kg m-2 + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = inout + optional = F +[twa] + standard_name = total_water_storage_in_aquifer + long_name = total water storage in aquifer + units = kg m-2 + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = inout + optional = F [lheatstrg] standard_name = flag_for_canopy_heat_storage long_name = flag for canopy heat storage parameterization diff --git a/physics/sfc_noahmp_drv.F90 b/physics/sfc_noahmp_drv.F90 index 129601e94..2e13ddb35 100644 --- a/physics/sfc_noahmp_drv.F90 +++ b/physics/sfc_noahmp_drv.F90 @@ -131,8 +131,9 @@ subroutine noahmpdrv_run & ! --- outputs: sncovr1, qsurf, gflux, drain, evap, hflx, ep, runoff, & - cmm, chh, evbs, evcw, sbsno, snowc, stm, snohf, & - smcwlt2, smcref2, wet1, t2mmp, q2mp, errmsg, errflg) + cmm, chh, evbs, evcw, sbsno, pah, ecan, etran, edir,snowc, & + stm, snohf,smcwlt2, smcref2, wet1, t2mmp, q2mp, & + errmsg, errflg) use machine , only : kind_phys use funcphys, only : fpvs @@ -288,6 +289,10 @@ subroutine noahmpdrv_run & real(kind=kind_phys), dimension(:) , intent(out) :: evbs ! direct soil evaporation [m/s] real(kind=kind_phys), dimension(:) , intent(out) :: evcw ! canopy water evaporation [m/s] real(kind=kind_phys), dimension(:) , intent(out) :: sbsno ! sublimation/deposit from snopack [W/m2] + real(kind=kind_phys), dimension(:) , intent(out) :: pah ! precipitation advected heat - total (w/m2) + real(kind=kind_phys), dimension(:) , intent(out) :: ecan ! evaporation of intercepted water (mm/s) + real(kind=kind_phys), dimension(:) , intent(out) :: etran ! transpiration rate (mm/s) + real(kind=kind_phys), dimension(:) , intent(out) :: edir ! soil surface evaporation rate (mm/s) real(kind=kind_phys), dimension(:) , intent(out) :: snowc ! fractional snow cover [-] real(kind=kind_phys), dimension(:) , intent(out) :: stm ! total soil column moisture content [mm] real(kind=kind_phys), dimension(:) , intent(out) :: snohf ! snow/freezing-rain latent heat flux [W/m2] @@ -924,6 +929,7 @@ subroutine noahmpdrv_run & gflux (i) = -1.0*ground_heat_total ! opposite sign to be consistent with noah snohf (i) = snowmelt_out * con_hfus ! only snow that exits pack sbsno (i) = snow_sublimation + pah (i) = precip_adv_heat_total cmxy (i) = cm_noahmp chxy (i) = ch_noahmp @@ -943,6 +949,9 @@ subroutine noahmpdrv_run & waxy (i) = aquifer_water wtxy (i) = saturated_water qsnowxy (i) = snowfall + ecan (i) = evaporation_canopy + etran (i) = transpiration + edir (i) = evaporation_soil drain (i) = runoff_baseflow runoff (i) = runoff_surface diff --git a/physics/sfc_noahmp_drv.meta b/physics/sfc_noahmp_drv.meta index 949f0d6a6..2b3223898 100644 --- a/physics/sfc_noahmp_drv.meta +++ b/physics/sfc_noahmp_drv.meta @@ -1195,6 +1195,42 @@ kind = kind_phys intent = out optional = F +[pah] + standard_name = total_precipitation_advected_heat + long_name = precipitation advected heat - total + units = W m-2 + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = out + optional = F +[ecan] + standard_name = evaporation_of_intercepted_water + long_name = evaporation of intercepted water + units = kg m-2 s-1 + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = out + optional = F +[etran] + standard_name = transpiration_rate + long_name = transpiration rate + units = kg m-2 s-1 + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = out + optional = F +[edir] + standard_name = soil_surface_evaporation_rate + long_name = soil surface evaporation rate + units = kg m-2 s-1 + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = out + optional = F [snowc] standard_name = surface_snow_area_fraction long_name = surface snow area fraction From 42f9ea60cf40726a4b880d6fa57b14c94cdfe102 Mon Sep 17 00:00:00 2001 From: Helin Wei Date: Sun, 5 Sep 2021 13:34:22 -0400 Subject: [PATCH 03/28] modification to add extra land fields to the output --- physics/GFS_surface_generic.F90 | 18 ++++-- physics/GFS_surface_generic.meta | 99 ++++++++++++++++++++++++++++++++ physics/sfc_noahmp_drv.F90 | 13 ++++- physics/sfc_noahmp_drv.meta | 36 ++++++++++++ 4 files changed, 159 insertions(+), 7 deletions(-) diff --git a/physics/GFS_surface_generic.F90 b/physics/GFS_surface_generic.F90 index 1ec7ff784..b1087f247 100644 --- a/physics/GFS_surface_generic.F90 +++ b/physics/GFS_surface_generic.F90 @@ -206,12 +206,14 @@ end subroutine GFS_surface_generic_post_finalize subroutine GFS_surface_generic_post_run (im, cplflx, cplchm, cplwav, lssav, dry, icy, wet, & dtf, ep1d, gflx, tgrs_1, qgrs_1, ugrs_1, vgrs_1, & adjsfcdlw, adjsfcdsw, adjnirbmd, adjnirdfd, adjvisbmd, adjvisdfd, adjsfculw, adjsfculw_wat, adjnirbmu, adjnirdfu, & - adjvisbmu, adjvisdfu,t2m, q2m, u10m, v10m, tsfc, tsfc_wat, pgr, xcosz, evbs, evcw, trans, sbsno, snowc, snohf, & + adjvisbmu, adjvisdfu,t2m, q2m, u10m, v10m, tsfc, tsfc_wat, pgr, xcosz, evbs, evcw, trans, sbsno, snowc, snohf,pah,pahi, & epi, gfluxi, t1, q1, u1, v1, dlwsfci_cpl, dswsfci_cpl, dlwsfc_cpl, dswsfc_cpl, dnirbmi_cpl, dnirdfi_cpl, dvisbmi_cpl, & dvisdfi_cpl, dnirbm_cpl, dnirdf_cpl, dvisbm_cpl, dvisdf_cpl, nlwsfci_cpl, nlwsfc_cpl, t2mi_cpl, q2mi_cpl, u10mi_cpl, & v10mi_cpl, tsfci_cpl, psurfi_cpl, nnirbmi_cpl, nnirdfi_cpl, nvisbmi_cpl, nvisdfi_cpl, nswsfci_cpl, nswsfc_cpl, nnirbm_cpl, & - nnirdf_cpl, nvisbm_cpl, nvisdf_cpl, gflux, evbsa, evcwa, transa, sbsnoa, snowca, snohfa, ep, & - runoff, srunoff, runof, drain, lheatstrg, h0facu, h0facs, zvfun, hflx, evap, hflxq, hffac, errmsg, errflg) + nnirdf_cpl, nvisbm_cpl, nvisdf_cpl, gflux, evbsa, evcwa, transa, sbsnoa, snowca, snohfa, paha,ep,ecan,etran,edir,waxy, & + runoff, srunoff, runof, drain, tecan,tetran,tedir,twa,lheatstrg, h0facu, h0facs, zvfun, hflx, evap, hflxq, hffac, & + errmsg, errflg) + implicit none @@ -222,13 +224,13 @@ subroutine GFS_surface_generic_post_run (im, cplflx, cplchm, cplwav, lssav, dry, real(kind=kind_phys), dimension(:), intent(in) :: ep1d, gflx, tgrs_1, qgrs_1, ugrs_1, vgrs_1, adjsfcdlw, adjsfcdsw, & adjnirbmd, adjnirdfd, adjvisbmd, adjvisdfd, adjsfculw, adjsfculw_wat, adjnirbmu, adjnirdfu, adjvisbmu, adjvisdfu, & - t2m, q2m, u10m, v10m, tsfc, tsfc_wat, pgr, xcosz, evbs, evcw, trans, sbsno, snowc, snohf + t2m, q2m, u10m, v10m, tsfc, tsfc_wat, pgr, xcosz, evbs, evcw, trans, sbsno, snowc, snohf,pah,ecan,etran,edir,waxy real(kind=kind_phys), dimension(:), intent(inout) :: epi, gfluxi, t1, q1, u1, v1, dlwsfci_cpl, dswsfci_cpl, dlwsfc_cpl, & dswsfc_cpl, dnirbmi_cpl, dnirdfi_cpl, dvisbmi_cpl, dvisdfi_cpl, dnirbm_cpl, dnirdf_cpl, dvisbm_cpl, dvisdf_cpl, & nlwsfci_cpl, nlwsfc_cpl, t2mi_cpl, q2mi_cpl, u10mi_cpl, v10mi_cpl, tsfci_cpl, psurfi_cpl, nnirbmi_cpl, nnirdfi_cpl, & nvisbmi_cpl, nvisdfi_cpl, nswsfci_cpl, nswsfc_cpl, nnirbm_cpl, nnirdf_cpl, nvisbm_cpl, nvisdf_cpl, gflux, evbsa, & - evcwa, transa, sbsnoa, snowca, snohfa, ep + evcwa, transa, sbsnoa, snowca, snohfa, ep, paha,tecan,tetran,tedir,twa,pahi real(kind=kind_phys), dimension(:), intent(inout) :: runoff, srunoff real(kind=kind_phys), dimension(:), intent(in) :: drain, runof @@ -258,6 +260,7 @@ subroutine GFS_surface_generic_post_run (im, cplflx, cplchm, cplwav, lssav, dry, do i=1,im epi(i) = ep1d(i) gfluxi(i) = gflx(i) + pahi(i) = pah(i) t1(i) = tgrs_1(i) q1(i) = qgrs_1(i) u1(i) = ugrs_1(i) @@ -346,11 +349,16 @@ subroutine GFS_surface_generic_post_run (im, cplflx, cplchm, cplwav, lssav, dry, snowca(i) = snowca(i) + snowc(i) * dtf snohfa(i) = snohfa(i) + snohf(i) * dtf ep(i) = ep(i) + ep1d(i) * dtf + paha(i) = paha(i) + pah(i) * dtf ! --- ... total runoff is composed of drainage into water table and ! runoff at the surface and is accumulated in unit of meters runoff(i) = runoff(i) + (drain(i)+runof(i)) * dtf srunoff(i) = srunoff(i) + runof(i) * dtf + tecan(i) = tecan(i) + ecan(i) * dtf + tetran(i) = tetran(i) + etran(i) * dtf + tedir(i) = tedir(i) + edir(i) * dtf + twa(i) = waxy(i) enddo endif diff --git a/physics/GFS_surface_generic.meta b/physics/GFS_surface_generic.meta index 54756c1b4..4fca66340 100644 --- a/physics/GFS_surface_generic.meta +++ b/physics/GFS_surface_generic.meta @@ -797,6 +797,24 @@ kind = kind_phys intent = in optional = F +[pah] + standard_name = total_precipitation_advected_heat + long_name = precipitation advected heat - total + units = W m-2 + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = in + optional = F +[pahi] + standard_name = instantaneous_total_precipitation_advected_heat + long_name = instantaneous precipitation advected heat - total + units = W m-2 + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = in + optional = F [epi] standard_name = instantaneous_surface_potential_evaporation long_name = instantaneous sfc potential evaporation @@ -1184,6 +1202,15 @@ kind = kind_phys intent = inout optional = F +[paha] + standard_name = cumulative_precipitation_advected_heat_flux_multiplied_by_timestep + long_name = cumulative precipitation advected heat flux multiplied by timestep + units = W m-2 s + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = inout + optional = F [ep] standard_name = cumulative_surface_upward_potential_latent_heat_flux_multiplied_by_timestep long_name = cumulative surface upward potential latent heat flux multiplied by timestep @@ -1193,6 +1220,42 @@ kind = kind_phys intent = inout optional = F +[ecan] + standard_name = evaporation_of_intercepted_water + long_name = evaporation of intercepted water + units = kg m-2 s-1 + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = in + optional = F +[etran] + standard_name = transpiration_rate + long_name = transpiration rate + units = kg m-2 s-1 + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = in + optional = F +[edir] + standard_name = soil_surface_evaporation_rate + long_name = soil surface evaporation rate + units = kg m-2 s-1 + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = in + optional = F +[waxy] + standard_name = water_storage_in_aquifer + long_name = water storage in aquifer + units = mm + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = in + optional = F [runoff] standard_name = total_runoff long_name = total water runoff @@ -1229,6 +1292,42 @@ kind = kind_phys intent = in optional = F +[tecan] + standard_name = total_evaporation_of_intercepted_water + long_name = total evaporation of intercepted water + units = kg m-2 + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = inout + optional = F +[tetran] + standard_name = total_transpiration_rate + long_name = total transpiration rate + units = kg m-2 + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = inout + optional = F +[tedir] + standard_name = total_soil_surface_evaporation_rate + long_name = total soil surface evaporation rate + units = kg m-2 + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = inout + optional = F +[twa] + standard_name = total_water_storage_in_aquifer + long_name = total water storage in aquifer + units = kg m-2 + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = inout + optional = F [lheatstrg] standard_name = flag_for_canopy_heat_storage_in_land_surface_scheme long_name = flag for canopy heat storage parameterization diff --git a/physics/sfc_noahmp_drv.F90 b/physics/sfc_noahmp_drv.F90 index 129601e94..2e13ddb35 100644 --- a/physics/sfc_noahmp_drv.F90 +++ b/physics/sfc_noahmp_drv.F90 @@ -131,8 +131,9 @@ subroutine noahmpdrv_run & ! --- outputs: sncovr1, qsurf, gflux, drain, evap, hflx, ep, runoff, & - cmm, chh, evbs, evcw, sbsno, snowc, stm, snohf, & - smcwlt2, smcref2, wet1, t2mmp, q2mp, errmsg, errflg) + cmm, chh, evbs, evcw, sbsno, pah, ecan, etran, edir,snowc, & + stm, snohf,smcwlt2, smcref2, wet1, t2mmp, q2mp, & + errmsg, errflg) use machine , only : kind_phys use funcphys, only : fpvs @@ -288,6 +289,10 @@ subroutine noahmpdrv_run & real(kind=kind_phys), dimension(:) , intent(out) :: evbs ! direct soil evaporation [m/s] real(kind=kind_phys), dimension(:) , intent(out) :: evcw ! canopy water evaporation [m/s] real(kind=kind_phys), dimension(:) , intent(out) :: sbsno ! sublimation/deposit from snopack [W/m2] + real(kind=kind_phys), dimension(:) , intent(out) :: pah ! precipitation advected heat - total (w/m2) + real(kind=kind_phys), dimension(:) , intent(out) :: ecan ! evaporation of intercepted water (mm/s) + real(kind=kind_phys), dimension(:) , intent(out) :: etran ! transpiration rate (mm/s) + real(kind=kind_phys), dimension(:) , intent(out) :: edir ! soil surface evaporation rate (mm/s) real(kind=kind_phys), dimension(:) , intent(out) :: snowc ! fractional snow cover [-] real(kind=kind_phys), dimension(:) , intent(out) :: stm ! total soil column moisture content [mm] real(kind=kind_phys), dimension(:) , intent(out) :: snohf ! snow/freezing-rain latent heat flux [W/m2] @@ -924,6 +929,7 @@ subroutine noahmpdrv_run & gflux (i) = -1.0*ground_heat_total ! opposite sign to be consistent with noah snohf (i) = snowmelt_out * con_hfus ! only snow that exits pack sbsno (i) = snow_sublimation + pah (i) = precip_adv_heat_total cmxy (i) = cm_noahmp chxy (i) = ch_noahmp @@ -943,6 +949,9 @@ subroutine noahmpdrv_run & waxy (i) = aquifer_water wtxy (i) = saturated_water qsnowxy (i) = snowfall + ecan (i) = evaporation_canopy + etran (i) = transpiration + edir (i) = evaporation_soil drain (i) = runoff_baseflow runoff (i) = runoff_surface diff --git a/physics/sfc_noahmp_drv.meta b/physics/sfc_noahmp_drv.meta index bed1a3de2..53524d87b 100644 --- a/physics/sfc_noahmp_drv.meta +++ b/physics/sfc_noahmp_drv.meta @@ -1195,6 +1195,42 @@ kind = kind_phys intent = out optional = F +[pah] + standard_name = total_precipitation_advected_heat + long_name = precipitation advected heat - total + units = W m-2 + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = out + optional = F +[ecan] + standard_name = evaporation_of_intercepted_water + long_name = evaporation of intercepted water + units = kg m-2 s-1 + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = out + optional = F +[etran] + standard_name = transpiration_rate + long_name = transpiration rate + units = kg m-2 s-1 + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = out + optional = F +[edir] + standard_name = soil_surface_evaporation_rate + long_name = soil surface evaporation rate + units = kg m-2 s-1 + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = out + optional = F [snowc] standard_name = surface_snow_area_fraction long_name = surface snow area fraction From 60003466462b6bf626fe4bcc8f3b025c3af9d6e5 Mon Sep 17 00:00:00 2001 From: Helin Wei Date: Mon, 6 Sep 2021 20:27:40 -0400 Subject: [PATCH 04/28] remove the iteration loop for Noah MP and implement a new coupling interface between atmos. and Noah MP --- physics/GFS_surface_loop_control.F90 | 15 +- physics/GFS_surface_loop_control.meta | 32 +++ physics/module_sf_noahmp_glacier.f90 | 28 ++- physics/module_sf_noahmplsm.f90 | 184 ++++++++++++++--- physics/sfc_diag_post.F90 | 16 +- physics/sfc_noahmp_drv.F90 | 287 +++++++++----------------- physics/sfc_noahmp_drv.meta | 126 +++++++++-- 7 files changed, 434 insertions(+), 254 deletions(-) diff --git a/physics/GFS_surface_loop_control.F90 b/physics/GFS_surface_loop_control.F90 index 82c55c4ad..e1ec2b2d7 100644 --- a/physics/GFS_surface_loop_control.F90 +++ b/physics/GFS_surface_loop_control.F90 @@ -22,7 +22,8 @@ end subroutine GFS_surface_loop_control_part1_finalize !! \section detailed Detailed Algorithm !! @{ - subroutine GFS_surface_loop_control_part1_run (im, iter, wind, flag_guess, errmsg, errflg) + subroutine GFS_surface_loop_control_part1_run (im, lsm,lsm_noahmp, iter, & + wind, flag_guess, errmsg, errflg) use machine, only: kind_phys @@ -31,6 +32,8 @@ subroutine GFS_surface_loop_control_part1_run (im, iter, wind, flag_guess, errms ! Interface variables integer, intent(in) :: im integer, intent(in) :: iter + integer, intent(in) :: lsm + integer, intent(in) :: lsm_noahmp real(kind=kind_phys), dimension(:), intent(in) :: wind logical, dimension(:), intent(inout) :: flag_guess @@ -45,7 +48,7 @@ subroutine GFS_surface_loop_control_part1_run (im, iter, wind, flag_guess, errms errflg = 0 do i=1,im - if (iter == 1 .and. wind(i) < 2.0d0) then + if (iter == 1 .and. wind(i) < 2.0d0 .and. lsm /= lsm_noahmp) then flag_guess(i) = .true. endif enddo @@ -78,8 +81,8 @@ end subroutine GFS_surface_loop_control_part2_finalize !! \section detailed Detailed Algorithm !! @{ - subroutine GFS_surface_loop_control_part2_run (im, iter, wind, & - flag_guess, flag_iter, dry, wet, icy, nstf_name1, errmsg, errflg) + subroutine GFS_surface_loop_control_part2_run (im,lsm,lsm_noahmp, iter,& + wind, flag_guess, flag_iter, dry, wet, icy, nstf_name1, errmsg, errflg) use machine, only: kind_phys @@ -88,6 +91,8 @@ subroutine GFS_surface_loop_control_part2_run (im, iter, wind, & ! Interface variables integer, intent(in) :: im integer, intent(in) :: iter + integer, intent(in) :: lsm + integer, intent(in) :: lsm_noahmp real(kind=kind_phys), dimension(:), intent(in) :: wind logical, dimension(:), intent(inout) :: flag_guess logical, dimension(:), intent(inout) :: flag_iter @@ -110,7 +115,7 @@ subroutine GFS_surface_loop_control_part2_run (im, iter, wind, & if (iter == 1 .and. wind(i) < 2.0d0) then !if (dry(i) .or. (wet(i) .and. .not.icy(i) .and. nstf_name1 > 0)) then - if (dry(i) .or. (wet(i) .and. nstf_name1 > 0)) then + if((dry(i).and.lsm /= lsm_noahmp) .or. (wet(i) .and. nstf_name1 > 0)) then flag_iter(i) = .true. endif endif diff --git a/physics/GFS_surface_loop_control.meta b/physics/GFS_surface_loop_control.meta index 47ab14280..2e3c8044b 100644 --- a/physics/GFS_surface_loop_control.meta +++ b/physics/GFS_surface_loop_control.meta @@ -15,6 +15,22 @@ type = integer intent = in optional = F +[lsm] + standard_name = control_for_land_surface_scheme + long_name = flag for land surface model + units = flag + dimensions = () + type = integer + intent = in + optional = F +[lsm_noahmp] + standard_name = identifier_for_noahmp_land_surface_scheme + long_name = flag for NOAH MP land surface model + units = flag + dimensions = () + type = integer + intent = in + optional = F [iter] standard_name = ccpp_loop_counter long_name = loop counter for subcycling loops in CCPP @@ -76,6 +92,22 @@ type = integer intent = in optional = F +[lsm] + standard_name = control_for_land_surface_scheme + long_name = flag for land surface model + units = flag + dimensions = () + type = integer + intent = in + optional = F +[lsm_noahmp] + standard_name = identifier_for_noahmp_land_surface_scheme + long_name = flag for NOAH MP land surface model + units = flag + dimensions = () + type = integer + intent = in + optional = F [iter] standard_name = ccpp_loop_counter long_name = loop counter for subcycling loops in CCPP diff --git a/physics/module_sf_noahmp_glacier.f90 b/physics/module_sf_noahmp_glacier.f90 index be24381f4..7445f7b61 100644 --- a/physics/module_sf_noahmp_glacier.f90 +++ b/physics/module_sf_noahmp_glacier.f90 @@ -119,10 +119,10 @@ subroutine noahmp_glacier (& prcp ,lwdn ,tbot ,zlvl ,ficeold ,zsoil , & ! in : forcing qsnow ,sneqvo ,albold ,cm ,ch ,isnow , & ! in/out : sneqv ,smc ,zsnso ,snowh ,snice ,snliq , & ! in/out : - tg ,stc ,sh2o ,tauss ,qsfc , & ! in/out : + tg ,stc ,sh2o ,tauss ,qsfc , & ! in/out : fsa ,fsr ,fira ,fsh ,fgev ,ssoil , & ! out : trad ,edir ,runsrf ,runsub ,sag ,albedo , & ! out : - qsnbot ,ponding ,ponding1,ponding2,t2m ,q2e , & ! out : + qsnbot ,ponding ,ponding1,ponding2,t2m,q2e,z0h_total , & ! out : #ifdef CCPP emissi, fpice ,ch2b , esnow, albsnd, albsni , & errmsg, errflg) @@ -198,6 +198,7 @@ subroutine noahmp_glacier (& real (kind=kind_phys) , intent(out) :: ponding2!< surface ponding [mm] real (kind=kind_phys) , intent(out) :: t2m !< 2-m air temperature over bare ground part [k] real (kind=kind_phys) , intent(out) :: q2e + real (kind=kind_phys) , intent(out) :: z0h_total !< roughness length for heat real (kind=kind_phys) , intent(out) :: emissi real (kind=kind_phys) , intent(out) :: fpice real (kind=kind_phys) , intent(out) :: ch2b @@ -269,7 +270,7 @@ subroutine noahmp_glacier (& imelt ,snicev ,snliqv ,epore ,qmelt ,ponding, & !out sag ,fsa ,fsr ,fira ,fsh ,fgev , & !out trad ,t2m ,ssoil ,lathea ,q2e ,emissi, & !out - ch2b ,albsnd ,albsni ) !out + ch2b ,albsnd ,albsni ,z0h_total ) !out #ifdef CCPP if (errflg /= 0) return @@ -399,7 +400,7 @@ subroutine energy_glacier (nsnow ,nsoil ,isnow ,dt ,qsnow ,rhoair , & !i imelt ,snicev ,snliqv ,epore ,qmelt ,ponding, & !out sag ,fsa ,fsr ,fira ,fsh ,fgev , & !out trad ,t2m ,ssoil ,lathea ,q2e ,emissi, & !out - ch2b ,albsnd ,albsni ) !out + ch2b ,albsnd ,albsni ,z0h_total ) !out ! -------------------------------------------------------------------------------------------------- ! -------------------------------------------------------------------------------------------------- @@ -474,6 +475,7 @@ subroutine energy_glacier (nsnow ,nsoil ,isnow ,dt ,qsnow ,rhoair , & !i real (kind=kind_phys) , intent(out) :: ch2b !< sensible heat conductance, canopy air to zlvl air (m/s) real (kind=kind_phys), dimension(1:2) , intent(out) :: albsnd !< snow albedo (direct) real (kind=kind_phys), dimension(1:2) , intent(out) :: albsni !< snow albedo (diffuse) + real (kind=kind_phys) , intent(out) :: z0h_total !< roughness length for heat ! local @@ -543,7 +545,7 @@ subroutine energy_glacier (nsnow ,nsoil ,isnow ,dt ,qsnow ,rhoair , & !i cm ,ch ,tg ,qsfc , & !inout #endif fira ,fsh ,fgev ,ssoil , & !out - t2m ,q2e ,ch2b) !out + t2m ,q2e ,ch2b ,z0h_total) !out !energy balance at surface: sag=(irb+shb+evb+ghb) @@ -978,7 +980,7 @@ subroutine glacier_flux (nsoil ,nsnow ,emg ,isnow ,df ,dzsnso ,z cm ,ch ,tgb ,qsfc , & !inout #endif irb ,shb ,evb ,ghb , & !out - t2mb ,q2b ,ehb2) !out + t2mb ,q2b ,ehb2 ,z0h_total) !out ! -------------------------------------------------------------------------------------------------- ! use newton-raphson iteration to solve ground (tg) temperature @@ -1038,6 +1040,7 @@ subroutine glacier_flux (nsoil ,nsnow ,emg ,isnow ,df ,dzsnso ,z real (kind=kind_phys), intent(out) :: t2mb !< 2 m height air temperature (k) real (kind=kind_phys), intent(out) :: q2b !< bare ground heat conductance real (kind=kind_phys), intent(out) :: ehb2 !< sensible heat conductance for diagnostics + real (kind=kind_phys), intent(out) :: z0h_total !< roughness length for heat ! local variables @@ -1058,6 +1061,7 @@ subroutine glacier_flux (nsoil ,nsnow ,emg ,isnow ,df ,dzsnso ,z real (kind=kind_phys) :: cq2b !< integer :: iter !< iteration index real (kind=kind_phys) :: z0h !< roughness length, sensible heat, ground (m) + real (kind=kind_phys) :: reyni !< Roughness Reynolds # over ice real (kind=kind_phys) :: moz !< monin-obukhov stability parameter real (kind=kind_phys) :: fm !< momentum stability correction, weighted by prior iters real (kind=kind_phys) :: fh !< sen heat stability correction, weighted by prior iters @@ -1090,13 +1094,23 @@ subroutine glacier_flux (nsoil ,nsnow ,emg ,isnow ,df ,dzsnso ,z h = 0. fv = 0.1 + reyni = fv*z0m/(1.5e-05) !introduction of fv dependent z0h for the iter + + if (reyni .gt. 2.0) then + z0h = z0m/exp(2.46*(reyni)**0.25 - log(7.4)) !Brutsaert 1982 + else + z0h = z0m/exp(-log(0.397)) !Brusaert 1982, table 4 + endif + + z0h_total = z0h + cir = emg*sb cgh = 2.*df(isnow+1)/dzsnso(isnow+1) ! ----------------------------------------------------------------- loop3: do iter = 1, niterb ! begin stability iteration - z0h = z0m +! z0h = z0m ! for now, only allow sfcdif1 until others can be fixed diff --git a/physics/module_sf_noahmplsm.f90 b/physics/module_sf_noahmplsm.f90 index 9fcb7edf8..305a662c3 100644 --- a/physics/module_sf_noahmplsm.f90 +++ b/physics/module_sf_noahmplsm.f90 @@ -389,8 +389,8 @@ subroutine noahmp_sflx (parameters, & stmass , wood , stblcp , fastcp , lai , sai , & ! in/out : cm , ch , tauss , & ! in/out : grain , gdd , pgs , & ! in/out - smcwtd ,deeprech , rech , & ! in/out : - z0wrf , & + smcwtd ,deeprech , rech , ustarx , & ! in/out : + z0wrf , z0hwrf , ts , & ! out : fsa , fsr , fira , fsh , ssoil , fcev , & ! out : fgev , fctr , ecan , etran , edir , trad , & ! out : tgb , tgv , t2mv , t2mb , q2v , q2b , & ! out : @@ -473,6 +473,7 @@ subroutine noahmp_sflx (parameters, & real (kind=kind_phys) , intent(inout) :: cm !< momentum drag coefficient real (kind=kind_phys) , intent(inout) :: ch !< sensible heat exchange coefficient real (kind=kind_phys) , intent(inout) :: tauss !< non-dimensional snow age + real (kind=kind_phys) , intent(inout) :: ustarx !< friction velocity ! prognostic variables integer , intent(inout) :: isnow !< actual no. of snow layers [-] @@ -498,6 +499,7 @@ subroutine noahmp_sflx (parameters, & ! output real (kind=kind_phys) , intent(out) :: z0wrf !< combined z0 sent to coupled model + real (kind=kind_phys) , intent(out) :: z0hwrf !< combined z0h sent to coupled model real (kind=kind_phys) , intent(out) :: fsa !< total absorbed solar radiation (w/m2) real (kind=kind_phys) , intent(out) :: fsr !< total reflected solar radiation (w/m2) real (kind=kind_phys) , intent(out) :: fira !< total net lw rad (w/m2) [+ to atm] @@ -507,7 +509,7 @@ subroutine noahmp_sflx (parameters, & real (kind=kind_phys) , intent(out) :: fctr !< transpiration heat (w/m2) [+ to atm] real (kind=kind_phys) , intent(out) :: ssoil !< ground heat flux (w/m2) [+ to soil] real (kind=kind_phys) , intent(out) :: trad !< surface radiative temperature (k) - real (kind=kind_phys) :: ts !< surface temperature (k) + real (kind=kind_phys) , intent(out) :: ts !< surface combined aero temperature (k) real (kind=kind_phys) , intent(out) :: ecan !< evaporation of intercepted water (mm/s) real (kind=kind_phys) , intent(out) :: etran !< transpiration rate (mm/s) real (kind=kind_phys) , intent(out) :: edir !< soil surface evaporation rate (mm/s] @@ -761,7 +763,7 @@ subroutine noahmp_sflx (parameters, & elai ,esai ,fwet ,foln , & !in fveg ,pahv ,pahg ,pahb , & !in qsnow ,dzsnso ,lat ,canliq ,canice ,iloc, jloc , & !in - z0wrf , & + z0wrf ,z0hwrf , & !out imelt ,snicev ,snliqv ,epore ,t2m ,fsno , & !out sav ,sag ,qmelt ,fsa ,fsr ,taux , & !out tauy ,fira ,fsh ,fcev ,fgev ,fctr , & !out @@ -770,6 +772,7 @@ subroutine noahmp_sflx (parameters, & tv ,tg ,stc ,snowh ,eah ,tah , & !inout sneqvo ,sneqv ,sh2o ,smc ,snice ,snliq , & !inout albold ,cm ,ch ,dx ,dz8w ,q2 , & !inout + ustarx , & !inout #ifdef CCPP tauss ,laisun ,laisha ,rb , errmsg ,errflg , & !inout #else @@ -1588,7 +1591,7 @@ subroutine energy (parameters,ice ,vegtyp ,ist ,nsnow ,nsoil , & !in elai ,esai ,fwet ,foln , & !in fveg ,pahv ,pahg ,pahb , & !in qsnow ,dzsnso ,lat ,canliq ,canice ,iloc , jloc, & !in - z0wrf , & + z0wrf ,z0hwrf , & !out imelt ,snicev ,snliqv ,epore ,t2m ,fsno , & !out sav ,sag ,qmelt ,fsa ,fsr ,taux , & !out tauy ,fira ,fsh ,fcev ,fgev ,fctr , & !out @@ -1597,6 +1600,7 @@ subroutine energy (parameters,ice ,vegtyp ,ist ,nsnow ,nsoil , & !in tv ,tg ,stc ,snowh ,eah ,tah , & !inout sneqvo ,sneqv ,sh2o ,smc ,snice ,snliq , & !inout albold ,cm ,ch ,dx ,dz8w ,q2 , & !inout + ustarx , & !inout #ifdef CCPP tauss ,laisun ,laisha ,rb ,errmsg ,errflg, & !inout #else @@ -1701,6 +1705,7 @@ subroutine energy (parameters,ice ,vegtyp ,ist ,nsnow ,nsoil , & !in ! outputs real (kind=kind_phys) , intent(out) :: z0wrf !combined z0 sent to coupled model + real (kind=kind_phys) , intent(out) :: z0hwrf !combined z0h sent to coupled model integer, dimension(-nsnow+1:nsoil), intent(out) :: imelt !phase change index [1-melt; 2-freeze] real (kind=kind_phys) , dimension(-nsnow+1: 0), intent(out) :: snicev !partial volume ice [m3/m3] real (kind=kind_phys) , dimension(-nsnow+1: 0), intent(out) :: snliqv !partial volume liq. water [m3/m3] @@ -1729,6 +1734,7 @@ subroutine energy (parameters,ice ,vegtyp ,ist ,nsnow ,nsoil , & !in ! real (kind=kind_phys) , intent(out) :: lathea !latent heat vap./sublimation (j/kg) real (kind=kind_phys) , intent(out) :: latheav !latent heat vap./sublimation (j/kg) real (kind=kind_phys) , intent(out) :: latheag !latent heat vap./sublimation (j/kg) + real (kind=kind_phys) , intent(out) :: ts !surface temperature (k) logical , intent(out) :: frozen_ground ! used to define latent heat pathway logical , intent(out) :: frozen_canopy ! used to define latent heat pathway @@ -1751,7 +1757,6 @@ subroutine energy (parameters,ice ,vegtyp ,ist ,nsnow ,nsoil , & !in !jref:end ! input & output - real (kind=kind_phys) , intent(inout) :: ts !surface temperature (k) real (kind=kind_phys) , intent(inout) :: tv !vegetation temperature (k) real (kind=kind_phys) , intent(inout) :: tg !ground temperature (k) real (kind=kind_phys) , dimension(-nsnow+1:nsoil), intent(inout) :: stc !snow/soil temperature [k] @@ -1769,6 +1774,7 @@ subroutine energy (parameters,ice ,vegtyp ,ist ,nsnow ,nsoil , & !in real (kind=kind_phys) , intent(inout) :: cm !momentum drag coefficient real (kind=kind_phys) , intent(inout) :: ch !sensible heat exchange coefficient real (kind=kind_phys) , intent(inout) :: q1 + real (kind=kind_phys) , intent(inout) :: ustarx !< friction velocity real , intent(inout) :: rb !leaf boundary layer resistance (s/m) real , intent(inout) :: laisun !sunlit leaf area index (m2/m2) real , intent(inout) :: laisha !shaded leaf area index (m2/m2) @@ -1861,6 +1867,24 @@ subroutine energy (parameters,ice ,vegtyp ,ist ,nsnow ,nsoil , & !in real (kind=kind_phys),intent(out) :: chv2 !sensible heat conductance, canopy air to zlvl air (m/s) real (kind=kind_phys),intent(out) :: chb2 !sensible heat conductance, canopy air to zlvl air (m/s) real (kind=kind_phys) :: noahmpres +! for new coupling + real (kind=kind_phys) :: csigmaf0 + real (kind=kind_phys) :: csigmaf1 + real (kind=kind_phys) :: csigmafveg + + real (kind=kind_phys) :: cdmnv + real (kind=kind_phys) :: ezpdv + real (kind=kind_phys) :: cdmng + real (kind=kind_phys) :: ezpdg + + real (kind=kind_phys) :: ezpd + real (kind=kind_phys) :: cdmn + real (kind=kind_phys) :: gsigma + + real (kind=kind_phys) :: kbsigmafveg + real (kind=kind_phys) :: aone + real (kind=kind_phys) :: coeffa + real (kind=kind_phys) :: coeffb !jref:end @@ -1891,6 +1915,29 @@ subroutine energy (parameters,ice ,vegtyp ,ist ,nsnow ,nsoil , & !in chv2 = 0. rb = 0. +! + cdmnv = 0. + ezpdv = 0. + + cdmng = 0. + ezpdg = 0. + + cdmn = 0. + ezpd = 0. + + gsigma = 0. + + z0hwrf = 0. + csigmaf1 = 0. + csigmaf0 = 0. + csigmafveg= 0. + kbsigmafveg = 0. + aone = 0. + coeffa = 0. + coeffb = 0. + +! + ! wind speed at reference height: ur >= 1 ur = max( sqrt(uu**2.+vv**2.), 1. ) @@ -2091,7 +2138,7 @@ subroutine energy (parameters,ice ,vegtyp ,ist ,nsnow ,nsoil , & !in rsurf ,latheav ,latheag ,parsun ,parsha ,igs , & !in foln ,co2air ,o2air ,btran ,sfcprs , & !in rhsur ,iloc ,jloc ,q2 ,pahv ,pahg , & !in - eah ,tah ,tv ,tgv ,cmv , & !inout + eah ,tah ,tv ,tgv ,cmv, ustarx , & !inout #ifdef CCPP chv ,dx ,dz8w ,errmsg ,errflg , & !inout #else @@ -2099,10 +2146,15 @@ subroutine energy (parameters,ice ,vegtyp ,ist ,nsnow ,nsoil , & !in #endif tauxv ,tauyv ,irg ,irc ,shg , & !out shc ,evg ,evc ,tr ,ghv , & !out - t2mv ,psnsun ,psnsha , & !out + t2mv ,psnsun ,psnsha ,csigmaf1, & !out !jref:start qc ,qsfc ,psfc , & !in q2v ,chv2, chleaf, chuc) !inout + + cdmnv = 0.4*0.4/log((zlvl-zpd)/z0m)**2 + aone = 2.6*(10.0*parameters%hvt/(zlvl-zpd))**0.355 + ezpdv = zpd*fveg !for the grid + !jref:end #ifdef CCPP if (errflg /= 0) return @@ -2115,19 +2167,33 @@ subroutine energy (parameters,ice ,vegtyp ,ist ,nsnow ,nsoil , & !in call bare_flux (parameters,nsnow ,nsoil ,isnow ,dt ,sag , & !in lwdn ,ur ,uu ,vv ,sfctmp , & !in thair ,qair ,eair ,rhoair ,snowh , & !in - dzsnso ,zlvl ,zpdg ,z0mg ,fsno, & !in + dzsnso ,zlvl ,zpdg ,z0mg ,fsno, & !in emg ,stc ,df ,rsurf ,latheag , & !in gammag ,rhsur ,iloc ,jloc ,q2 ,pahb , & !in #ifdef CCPP - tgb ,cmb ,chb ,errmsg ,errflg , & !inout + tgb ,cmb ,chb, ustarx,errmsg ,errflg , & !inout #else - tgb ,cmb ,chb , & !inout + tgb ,cmb ,chb, ustarx, & !inout #endif - tauxb ,tauyb ,irb ,shb ,evb , & !out + tauxb ,tauyb ,irb ,shb ,evb,csigmaf0,& !out ghb ,t2mb ,dx ,dz8w ,vegtyp , & !out !jref:start qc ,qsfc ,psfc , & !in sfcprs ,q2b, chb2) !in + + cdmng = 0.4*0.4/log((zlvl-zpdg)/z0mg)**2 + ezpdg = zpdg +! +! vegetation is optional; use the larger one +! + if (ezpdv .ge. ezpdg ) then + ezpd = ezpdv + elseif (ezpdv .gt. 0.0 .and. ezpdv .lt. ezpdg) then + ezpd = (1.0 -fveg)*ezpdg + else + ezpd = ezpdg + endif + !jref:end #ifdef CCPP if (errflg /= 0) return @@ -2148,12 +2214,31 @@ subroutine energy (parameters,ice ,vegtyp ,ist ,nsnow ,nsoil , & !in pah = fveg * pahg + (1.0 - fveg) * pahb + pahv tg = fveg * tgv + (1.0 - fveg) * tgb t2m = fveg * t2mv + (1.0 - fveg) * t2mb - ts = fveg * tv + (1.0 - fveg) * tgb + ts = fveg * tah + (1.0 - fveg) * tgb cm = fveg * cmv + (1.0 - fveg) * cmb ! better way to average? ch = fveg * chv + (1.0 - fveg) * chb q1 = fveg * (eah*0.622/(sfcprs - 0.378*eah)) + (1.0 - fveg)*qsfc q2e = fveg * q2v + (1.0 - fveg) * q2b - z0wrf = z0m + + coeffa = (csigmaf0 - csigmaf1)/(1.0 - exp(-1.0*aone)) + coeffb = csigmaf0 - coeffa + csigmafveg = coeffa * exp(-1.0*aone*fveg) + coeffb + + gsigma = fveg**0.5 + fveg*(1.0-fveg)*1.0 + +! +! 0.5 ~ 1.0 for the 0.5 place; 0 ~ 1.0 for the 1.0 place, adjustable empirical +! canopy roughness geometry parameter; currently fveg = 0.78 has the largest +! momentum flux; can test the fveg-based average by setting 0.5 to 1.0 and 1.0 +! to 0.0 ! see Blumel; JAM,1998 +! + + cdmn = gsigma*cdmnv + (1.0-gsigma)*cdmng + z0wrf = (zlvl - ezpd)*exp(-0.4/sqrt(cdmn)) + + kbsigmafveg = csigmafveg/log((zlvl-ezpd)/z0wrf) - log((zlvl-ezpd)/z0wrf) + z0hwrf = z0wrf/exp(kbsigmafveg) + else taux = tauxb tauy = tauyb @@ -2176,6 +2261,9 @@ subroutine energy (parameters,ice ,vegtyp ,ist ,nsnow ,nsoil , & !in tgv = tgb chv = chb z0wrf = z0mg + + z0hwrf =z0wrf/exp( csigmaf0/log((zlvl-ezpd)/z0wrf) - log((zlvl-ezpd)/z0wrf) ) + end if fire = lwdn + fira @@ -3484,13 +3572,13 @@ subroutine vege_flux(parameters,nsnow ,nsoil ,isnow ,vegtyp ,veg , & uu ,vv ,sfctmp ,thair ,qair , & !in eair ,rhoair ,snowh ,vai ,gammav ,gammag, & !in fwet ,laisun ,laisha ,cwp ,dzsnso , & !in - zlvl ,zpd ,z0m ,fveg , & !in + zlvl ,zpd ,z0m ,fveg, & !in z0mg ,emv ,emg ,canliq ,fsno, & !in canice ,stc ,df ,rssun ,rssha , & !in rsurf ,latheav ,latheag ,parsun ,parsha ,igs , & !in foln ,co2air ,o2air ,btran ,sfcprs , & !in rhsur ,iloc ,jloc ,q2 ,pahv ,pahg , & !in - eah ,tah ,tv ,tg ,cm , & !inout + eah ,tah ,tv ,tg ,cm,ustarx,& !inout #ifdef CCPP ch ,dx ,dz8w ,errmsg ,errflg , & !inout #else @@ -3498,7 +3586,7 @@ subroutine vege_flux(parameters,nsnow ,nsoil ,isnow ,vegtyp ,veg , & #endif tauxv ,tauyv ,irg ,irc ,shg , & !out shc ,evg ,evc ,tr ,gh , & !out - t2mv ,psnsun ,psnsha , & !out + t2mv ,psnsun ,psnsha ,csigmaf1 , & !out qc ,qsfc ,psfc , & !in q2v ,cah2 ,chleaf ,chuc ) !inout @@ -3588,6 +3676,7 @@ subroutine vege_flux(parameters,nsnow ,nsoil ,isnow ,vegtyp ,veg , & real (kind=kind_phys), intent(inout) :: tg !ground temperature (k) real (kind=kind_phys), intent(inout) :: cm !momentum drag coefficient real (kind=kind_phys), intent(inout) :: ch !sensible heat exchange coefficient + real (kind=kind_phys), intent(inout) :: ustarx !< friction velocity #ifdef CCPP character(len=*), intent(inout) :: errmsg @@ -3609,6 +3698,7 @@ subroutine vege_flux(parameters,nsnow ,nsoil ,isnow ,vegtyp ,veg , & real (kind=kind_phys), intent(out) :: t2mv !2 m height air temperature (k) real (kind=kind_phys), intent(out) :: psnsun !sunlit leaf photosynthesis (umolco2/m2/s) real (kind=kind_phys), intent(out) :: psnsha !shaded leaf photosynthesis (umolco2/m2/s) + real (kind=kind_phys), intent(out) :: csigmaf1 real (kind=kind_phys), intent(out) :: chleaf !leaf exchange coefficient real (kind=kind_phys), intent(out) :: chuc !under canopy exchange coefficient @@ -3681,6 +3771,11 @@ subroutine vege_flux(parameters,nsnow ,nsoil ,isnow ,vegtyp ,veg , & real (kind=kind_phys) :: ch2 !surface exchange at 2m real (kind=kind_phys) :: thstar !surface exchange at 2m + real (kind=kind_phys) :: dlf ! leaf dimension + real(kind=kind_phys) :: sigmaa ! momentum partition parameter + real(kind=kind_phys) :: kbsigmaf1 ! kb^-1 for fully convered by vegetation + real(kind=kind_phys) :: kbsigmafc ! kb^-1 under canopy ground + real (kind=kind_phys) :: thvair real (kind=kind_phys) :: thah real (kind=kind_phys) :: rahc2 !aerodynamic resistance for sensible heat (s/m) @@ -3719,7 +3814,8 @@ subroutine vege_flux(parameters,nsnow ,nsoil ,isnow ,vegtyp ,veg , & mpe = 1e-6 liter = 0 - fv = 0.1 + + fv = ustarx ! --------------------------------------------------------------------------------------------- ! initialization variables that do not depend on stability iteration @@ -3734,6 +3830,8 @@ subroutine vege_flux(parameters,nsnow ,nsoil ,isnow ,vegtyp ,veg , & h = 0. qfx = 0. + csigmaf1 = 0. + ! limit lai vaie = min(6.,vai ) @@ -3754,6 +3852,8 @@ subroutine vege_flux(parameters,nsnow ,nsoil ,isnow ,vegtyp ,veg , & qsfc = 0.622*eair/(psfc-0.378*eair) + dlf = parameters%dleaf !leaf dimension + ! canopy height hcan = parameters%hvt @@ -3801,13 +3901,17 @@ subroutine vege_flux(parameters,nsnow ,nsoil ,isnow ,vegtyp ,veg , & air = -emv*(1.+(1.-emv)*(1.-emg))*lwdn - emv*emg*sb*tg**4 cir = (2.-emv*(1.-emg))*emv*sb ! --------------------------------------------------------------------------------------------- + + sigmaa = 1.0 - (0.5/(0.5+vaie))*exp(-vaie**2/8.0) + kbsigmaf1 = 16.4*(sigmaa*vaie**3)**(-0.25)*sqrt(dlf*ur/log((zlvl-zpd)/z0m)) + z0h = z0m/exp(kbsigmaf1) + csigmaf1 = log((zlvl-zpd)/z0m)*(log((zlvl-zpd)/z0m)+kbsigmaf1) ! for output for interpolation + loop1: do iter = 1, niterc ! begin stability iteration if(iter == 1) then - z0h = z0m z0hg = z0mg else - z0h = z0m !* exp(-czil*0.4*258.2*sqrt(fv*z0m)) z0hg = z0mg !* exp(-czil*0.4*258.2*sqrt(fv*z0mg)) end if @@ -4054,11 +4158,11 @@ subroutine bare_flux (parameters,nsnow ,nsoil ,isnow ,dt ,sag , & emg ,stc ,df ,rsurf ,lathea , & !in gamma ,rhsur ,iloc ,jloc ,q2 ,pahb , & !in #ifdef CCPP - tgb ,cm ,ch ,errmsg ,errflg , & !inout + tgb ,cm ,ch,ustarx,errmsg ,errflg , & !inout #else - tgb ,cm ,ch , & !inout + tgb ,cm ,ch,ustarx, & !inout #endif - tauxb ,tauyb ,irb ,shb ,evb , & !out + tauxb ,tauyb ,irb ,shb ,evb,csigmaf0,& !out ghb ,t2mb ,dx ,dz8w ,ivgtyp , & !out qc ,qsfc ,psfc , & !in sfcprs ,q2b ,ehb2 ) !in @@ -4120,6 +4224,7 @@ subroutine bare_flux (parameters,nsnow ,nsoil ,isnow ,dt ,sag , & real (kind=kind_phys), intent(inout) :: tgb !ground temperature (k) real (kind=kind_phys), intent(inout) :: cm !momentum drag coefficient real (kind=kind_phys), intent(inout) :: ch !sensible heat exchange coefficient + real (kind=kind_phys), intent(inout) :: ustarx !friction velocity #ifdef CCPP character(len=*), intent(inout) :: errmsg integer, intent(inout) :: errflg @@ -4135,6 +4240,7 @@ subroutine bare_flux (parameters,nsnow ,nsoil ,isnow ,dt ,sag , & real (kind=kind_phys), intent(out) :: evb !latent heat flux (w/m2) [+ to atm] real (kind=kind_phys), intent(out) :: ghb !ground heat flux (w/m2) [+ to soil] real (kind=kind_phys), intent(out) :: t2mb !2 m height air temperature (k) + real (kind=kind_phys), intent(out) :: csigmaf0 ! !jref:start real (kind=kind_phys), intent(out) :: q2b !bare ground heat conductance real (kind=kind_phys) :: ehb !bare ground heat conductance @@ -4171,6 +4277,9 @@ subroutine bare_flux (parameters,nsnow ,nsoil ,isnow ,dt ,sag , & real (kind=kind_phys) :: cev !coefficients for ev as function of esat[ts] real (kind=kind_phys) :: cgh !coefficients for st as function of ts + real(kind=kind_phys) :: kbsigmaf0 + real(kind=kind_phys) :: reynb + !jref:start real (kind=kind_phys) :: rahb2 !aerodynamic resistance for sensible heat 2m (s/m) real (kind=kind_phys) :: rawb2 !aerodynamic resistance for water vapor 2m (s/m) @@ -4226,7 +4335,24 @@ subroutine bare_flux (parameters,nsnow ,nsoil ,isnow ,dt ,sag , & fh2 = 0. h = 0. qfx = 0. - fv = 0.1 + + csigmaf0 = 0. + kbsigmaf0 = 0. + + fv = ustarx + + reynb = fv*z0m/(1.5e-05) + + if (reynb .gt. 2.0) then + kbsigmaf0 = 2.46*reynb**0.25 - log(7.4) + else + kbsigmaf0 = - log(0.397) + endif + + csigmaf0 = log((zlvl-zpd)/z0m)*(log((zlvl-zpd)/z0m) + kbsigmaf0) + + z0h = max(z0m/exp(kbsigmaf0),1.0e-6) + cir = emg*sb cgh = 2.*df(isnow+1)/dzsnso(isnow+1) @@ -4234,11 +4360,11 @@ subroutine bare_flux (parameters,nsnow ,nsoil ,isnow ,dt ,sag , & ! ----------------------------------------------------------------- loop3: do iter = 1, niterb ! begin stability iteration - if(iter == 1) then - z0h = z0m - else - z0h = z0m !* exp(-czil*0.4*258.2*sqrt(fv*z0m)) - end if +! if(iter == 1) then +! z0h = z0m +! else +! z0h = z0m !* exp(-czil*0.4*258.2*sqrt(fv*z0m)) +! end if if(opt_sfc == 1) then call sfcdif1(parameters,iter ,sfctmp ,rhoair ,h ,qair , & !in diff --git a/physics/sfc_diag_post.F90 b/physics/sfc_diag_post.F90 index 1bf3e7e67..e5c16a5c0 100644 --- a/physics/sfc_diag_post.F90 +++ b/physics/sfc_diag_post.F90 @@ -42,14 +42,14 @@ subroutine sfc_diag_post_run (im, lsm, lsm_noahmp, dry, lssav, dtf, con_eps, con errmsg = '' errflg = 0 - if (lsm == lsm_noahmp) then - do i=1,im - if(dry(i)) then - t2m(i) = t2mmp(i) - q2m(i) = q2mp(i) - endif - enddo - endif +! if (lsm == lsm_noahmp) then +! do i=1,im +! if(dry(i)) then +! t2m(i) = t2mmp(i) +! q2m(i) = q2mp(i) +! endif +! enddo +! endif if (lssav) then do i=1,im diff --git a/physics/sfc_noahmp_drv.F90 b/physics/sfc_noahmp_drv.F90 index 2e13ddb35..8442e8782 100644 --- a/physics/sfc_noahmp_drv.F90 +++ b/physics/sfc_noahmp_drv.F90 @@ -107,18 +107,19 @@ subroutine noahmpdrv_run & ! --- inputs: ( im, km, lsnowl, itime, ps, u1, v1, t1, q1, soiltyp, & vegtype, sigmaf, dlwflx, dswsfc, snet, delt, tg3, cm, ch, & - prsl1, prslki, zf, dry, wind, slopetyp, & - shdmin, shdmax, snoalb, sfalb, flag_iter, flag_guess, & + prsl1, prslk1, prslki, prsik1, zf, dry, wind, slopetyp, & + shdmin, shdmax, snoalb, sfalb, flag_iter, & idveg, iopt_crs, iopt_btr, iopt_run, iopt_sfc, iopt_frz, & iopt_inf, iopt_rad, iopt_alb, iopt_snf, iopt_tbot, & - iopt_stc, xlatin, xcoszin, iyrlen, julian, & + iopt_stc, xlatin, xcoszin, iyrlen, julian,garea, & rainn_mp, rainc_mp, snow_mp, graupel_mp, ice_mp, & con_hvap, con_cp, con_jcal, rhoh2o, con_eps, con_epsm1, & - con_fvirt, con_rd, con_hfus, & + con_fvirt, con_rd, con_hfus,thsfc_loc, & ! --- in/outs: weasd, snwdph, tskin, tprcp, srflag, smc, stc, slc, & - canopy, trans, tsurf, zorl, & + canopy, trans, zorl, & + rb1,fm1,fh1,ustar1,stress1,fm101,fh21, & ! --- Noah MP specific @@ -132,12 +133,13 @@ subroutine noahmpdrv_run & ! --- outputs: sncovr1, qsurf, gflux, drain, evap, hflx, ep, runoff, & cmm, chh, evbs, evcw, sbsno, pah, ecan, etran, edir,snowc, & - stm, snohf,smcwlt2, smcref2, wet1, t2mmp, q2mp, & + stm, snohf,smcwlt2, smcref2, wet1, t2mmp, q2mp,zvfun, & errmsg, errflg) use machine , only : kind_phys use funcphys, only : fpvs + use sfc_diff, only : stability use module_sf_noahmplsm use module_sf_noahmp_glacier use noahmp_tables, only : isice_table, co2_table, o2_table, & @@ -151,6 +153,7 @@ subroutine noahmpdrv_run & real(kind=kind_phys), parameter :: a3 = 273.16 real(kind=kind_phys), parameter :: a4 = 35.86 real(kind=kind_phys), parameter :: a23m4 = a2*(a3-a4) + real(kind=kind_phys), parameter :: gravity = 9.81 real, parameter :: undefined = 9.99e20_kind_phys @@ -181,10 +184,14 @@ subroutine noahmpdrv_run & real(kind=kind_phys), dimension(:) , intent(in) :: snet ! total sky sfc netsw flx into ground[W/m2] real(kind=kind_phys) , intent(in) :: delt ! time interval [s] real(kind=kind_phys), dimension(:) , intent(in) :: tg3 ! deep soil temperature [K] - real(kind=kind_phys), dimension(:) , intent(in) :: cm ! surface exchange coeff for momentum [-] - real(kind=kind_phys), dimension(:) , intent(in) :: ch ! surface exchange coeff heat & moisture[-] + real(kind=kind_phys), dimension(:) , intent(inout) :: cm ! surface exchange coeff for momentum [-] + real(kind=kind_phys), dimension(:) , intent(inout) :: ch ! surface exchange coeff heat & moisture[-] real(kind=kind_phys), dimension(:) , intent(in) :: prsl1 ! sfc layer 1 mean pressure [Pa] - real(kind=kind_phys), dimension(:) , intent(in) :: prslki ! to calculate potential temperature + real(kind=kind_phys), dimension(:) , intent(in) :: prslk1 ! exner_function_at lowest model layer + + real(kind=kind_phys), dimension(:) , intent(in) :: prslki ! Exner function bt midlayer and interface at 1st layer + real(kind=kind_phys), dimension(:) , intent(in) :: prsik1 ! Exner function at the ground surfac + real(kind=kind_phys), dimension(:) , intent(in) :: zf ! height of bottom layer [m] logical , dimension(:) , intent(in) :: dry ! = T if a point with any land real(kind=kind_phys), dimension(:) , intent(in) :: wind ! wind speed [m/s] @@ -194,7 +201,6 @@ subroutine noahmpdrv_run & real(kind=kind_phys), dimension(:) , intent(in) :: snoalb ! upper bound on max albedo over deep snow real(kind=kind_phys), dimension(:) , intent(inout) :: sfalb ! mean surface albedo [fraction] logical , dimension(:) , intent(in) :: flag_iter ! - logical , dimension(:) , intent(in) :: flag_guess ! integer , intent(in) :: idveg ! option for dynamic vegetation integer , intent(in) :: iopt_crs ! option for canopy stomatal resistance integer , intent(in) :: iopt_btr ! option for soil moisture factor for stomatal resistance @@ -211,6 +217,7 @@ subroutine noahmpdrv_run & real(kind=kind_phys), dimension(:) , intent(in) :: xcoszin ! cosine of zenith angle integer , intent(in) :: iyrlen ! year length [days] real(kind=kind_phys) , intent(in) :: julian ! julian day of year + real(kind=kind_phys), dimension(:) , intent(in) :: garea ! area of the grid cell real(kind=kind_phys), dimension(:) , intent(in) :: rainn_mp ! microphysics non-convective precipitation [mm] real(kind=kind_phys), dimension(:) , intent(in) :: rainc_mp ! microphysics convective precipitation [mm] real(kind=kind_phys), dimension(:) , intent(in) :: snow_mp ! microphysics snow [mm] @@ -225,6 +232,9 @@ subroutine noahmpdrv_run & real(kind=kind_phys) , intent(in) :: con_fvirt ! Rv/Rd - 1 real(kind=kind_phys) , intent(in) :: con_rd ! gas constant air [J/kg/K] real(kind=kind_phys) , intent(in) :: con_hfus ! lat heat H2O fusion [J/kg] + + logical , intent(in) :: thsfc_loc ! Flag for reference pressure in theta calculation + real(kind=kind_phys), dimension(:) , intent(inout) :: weasd ! water equivalent accumulated snow depth [mm] real(kind=kind_phys), dimension(:) , intent(inout) :: snwdph ! snow depth [mm] real(kind=kind_phys), dimension(:) , intent(inout) :: tskin ! ground surface skin temperature [K] @@ -235,8 +245,16 @@ subroutine noahmpdrv_run & real(kind=kind_phys), dimension(:,:) , intent(inout) :: slc ! liquid soil moisture [m3/m3] real(kind=kind_phys), dimension(:) , intent(inout) :: canopy ! canopy moisture content [mm] real(kind=kind_phys), dimension(:) , intent(inout) :: trans ! total plant transpiration [m/s] - real(kind=kind_phys), dimension(:) , intent(inout) :: tsurf ! surface skin temperature [after iteration] real(kind=kind_phys), dimension(:) , intent(inout) :: zorl ! surface roughness [cm] + + real(kind=kind_phys), dimension(:) , intent(inout) :: rb1 ! bulk richardson # + real(kind=kind_phys), dimension(:) , intent(inout) :: fm1 ! Monin_Obukhov_silarity_function for momentum + real(kind=kind_phys), dimension(:) , intent(inout) :: fh1 ! Monin_Obukhov_silarity_function for heat + real(kind=kind_phys), dimension(:) , intent(inout) :: ustar1 ! friction velocity m s-1 + real(kind=kind_phys), dimension(:) , intent(inout) :: stress1 ! Wind stress m2 S-2 + real(kind=kind_phys), dimension(:) , intent(inout) :: fm101 ! MOS function for momentum evaulated @ 10 m + real(kind=kind_phys), dimension(:) , intent(inout) :: fh21 ! MOS function for heat evaulated @ 2m + real(kind=kind_phys), dimension(:) , intent(inout) :: snowxy ! actual no. of snow layers real(kind=kind_phys), dimension(:) , intent(inout) :: tvxy ! vegetation leaf temperature [K] real(kind=kind_phys), dimension(:) , intent(inout) :: tgxy ! bulk ground surface temperature [K] @@ -301,6 +319,7 @@ subroutine noahmpdrv_run & real(kind=kind_phys), dimension(:) , intent(out) :: wet1 ! normalized surface soil saturated fraction real(kind=kind_phys), dimension(:) , intent(out) :: t2mmp ! combined T2m from tiles real(kind=kind_phys), dimension(:) , intent(out) :: q2mp ! combined q2m from tiles + real(kind=kind_phys), dimension(:) , intent(out) :: zvfun character(len=*) , intent(out) :: errmsg integer , intent(out) :: errflg @@ -314,53 +333,6 @@ subroutine noahmpdrv_run & integer :: iopt_crop = 0 ! option for crop model integer :: iopt_gla = 2 ! option for glacier treatment -! -! --- guess iteration fields - target for removal -! - - real(kind=kind_phys), dimension(im) :: weasd_old - real(kind=kind_phys), dimension(im) :: snwdph_old - real(kind=kind_phys), dimension(im) :: tskin_old - real(kind=kind_phys), dimension(im) :: canopy_old - real(kind=kind_phys), dimension(im) :: tprcp_old - real(kind=kind_phys), dimension(im) :: srflag_old - real(kind=kind_phys), dimension(im) :: snow_old - real(kind=kind_phys), dimension(im) :: tv_old - real(kind=kind_phys), dimension(im) :: tg_old - real(kind=kind_phys), dimension(im) :: canice_old - real(kind=kind_phys), dimension(im) :: canliq_old - real(kind=kind_phys), dimension(im) :: eah_old - real(kind=kind_phys), dimension(im) :: tah_old - real(kind=kind_phys), dimension(im) :: fwet_old - real(kind=kind_phys), dimension(im) :: sneqvo_old - real(kind=kind_phys), dimension(im) :: albold_old - real(kind=kind_phys), dimension(im) :: qsnow_old - real(kind=kind_phys), dimension(im) :: wslake_old - real(kind=kind_phys), dimension(im) :: zwt_old - real(kind=kind_phys), dimension(im) :: wa_old - real(kind=kind_phys), dimension(im) :: wt_old - real(kind=kind_phys), dimension(im) :: lfmass_old - real(kind=kind_phys), dimension(im) :: rtmass_old - real(kind=kind_phys), dimension(im) :: stmass_old - real(kind=kind_phys), dimension(im) :: wood_old - real(kind=kind_phys), dimension(im) :: stblcp_old - real(kind=kind_phys), dimension(im) :: fastcp_old - real(kind=kind_phys), dimension(im) :: xlai_old - real(kind=kind_phys), dimension(im) :: xsai_old - real(kind=kind_phys), dimension(im) :: tauss_old - real(kind=kind_phys), dimension(im) :: smcwtd_old - real(kind=kind_phys), dimension(im) :: rech_old - real(kind=kind_phys), dimension(im) :: deeprech_old - real(kind=kind_phys), dimension(im, km) :: smc_old - real(kind=kind_phys), dimension(im, km) :: stc_old - real(kind=kind_phys), dimension(im, km) :: slc_old - real(kind=kind_phys), dimension(im, km) :: smoiseq_old - real(kind=kind_phys), dimension(im,lsnowl: 0) :: tsno_old - real(kind=kind_phys), dimension(im,lsnowl: 0) :: snice_old - real(kind=kind_phys), dimension(im,lsnowl: 0) :: snliq_old - real(kind=kind_phys), dimension(im,lsnowl:km) :: zsnso_old - real(kind=kind_phys), dimension(im,lsnowl:km) :: tsnso_old - ! ! --- local inputs to noah-mp and glacier subroutines; listed in order in noah-mp call ! @@ -411,6 +383,9 @@ subroutine noahmpdrv_run & real (kind=kind_phys), dimension(-nsnow+1:nsoil) :: temperature_snow_soil ! inout | snow/soil temperature [K] real (kind=kind_phys), dimension( 1:nsoil) :: soil_liquid_vol ! inout | volumetric liquid soil moisture [m3/m3] real (kind=kind_phys), dimension( 1:nsoil) :: soil_moisture_vol ! inout | volumetric soil moisture (ice + liq.) [m3/m3] + + real (kind=kind_phys) :: surface_temperature ! out | surface aerodynamic temp + real (kind=kind_phys) :: temperature_canopy_air! inout | canopy air tmeperature [K] real (kind=kind_phys) :: vapor_pres_canopy_air ! inout | canopy air vapor pressure [Pa] real (kind=kind_phys) :: canopy_wet_fraction ! inout | wetted or snowed fraction of canopy (-) @@ -449,6 +424,8 @@ subroutine noahmpdrv_run & real (kind=kind_phys) :: deep_recharge ! inout | (opt_run=5) recharge to or from the water table when deep [m] real (kind=kind_phys) :: recharge ! inout | (opt_run=5) recharge to or from the water table when shallow [m] (diagnostic) real (kind=kind_phys) :: z0_total ! out | weighted z0 sent to coupled model [m] + real (kind=kind_phys) :: z0h_total ! out | weighted z0h sent to coupled model [m] + real (kind=kind_phys) :: sw_absorbed_total ! out | total absorbed solar radiation [W/m2] real (kind=kind_phys) :: sw_reflected_total ! out | total reflected solar radiation [W/m2] real (kind=kind_phys) :: lw_absorbed_total ! out | total net lw rad [W/m2] [+ to atm] @@ -520,6 +497,8 @@ subroutine noahmpdrv_run & real (kind=kind_phys) :: lai_shaded ! out | shaded leaf area index [m2/m2] real (kind=kind_phys) :: leaf_air_resistance ! out | leaf boundary layer resistance [s/m] + real (kind=kind_phys) :: ustarx ! inout |surface friction velocity + ! ! --- local variable ! @@ -539,6 +518,13 @@ subroutine noahmpdrv_run & real (kind=kind_phys) :: dqsdt ! used for penman calculation real (kind=kind_phys) :: precip_freeze_frac_in ! used for penman calculation + real (kind=kind_phys) :: virtfac1 ! virtual factor + real (kind=kind_phys) :: tvs1 ! surface virtual temp + real (kind=kind_phys) :: vptemp ! virtual potential temp + + real(kind=kind_phys) :: tem1,tem2,gdx + real(kind=kind_phys), parameter :: z0lo=0.1, z0up=1.0 + logical :: is_snowing ! used for penman calculation logical :: is_freeze_rain ! used for penman calculation integer :: i, k @@ -559,67 +545,7 @@ subroutine noahmpdrv_run & errmsg = '' errflg = 0 -! -! --- save land-related prognostic fields for guess run TARGET FOR REMOVAL -! - do i = 1, im - if (dry(i) .and. flag_guess(i)) then - weasd_old(i) = weasd(i) - snwdph_old(i) = snwdph(i) - tskin_old(i) = tskin(i) - canopy_old(i) = canopy(i) - tprcp_old(i) = tprcp(i) - srflag_old(i) = srflag(i) - snow_old(i) = snowxy(i) - tv_old(i) = tvxy(i) - tg_old(i) = tgxy(i) - canice_old(i) = canicexy(i) - canliq_old(i) = canliqxy(i) - eah_old(i) = eahxy(i) - tah_old(i) = tahxy(i) - fwet_old(i) = fwetxy(i) - sneqvo_old(i) = sneqvoxy(i) - albold_old(i) = alboldxy(i) - qsnow_old(i) = qsnowxy(i) - wslake_old(i) = wslakexy(i) - zwt_old(i) = zwtxy(i) - wa_old(i) = waxy(i) - wt_old(i) = wtxy(i) - lfmass_old(i) = lfmassxy(i) - rtmass_old(i) = rtmassxy(i) - stmass_old(i) = stmassxy(i) - wood_old(i) = woodxy(i) - stblcp_old(i) = stblcpxy(i) - fastcp_old(i) = fastcpxy(i) - xlai_old(i) = xlaixy(i) - xsai_old(i) = xsaixy(i) - tauss_old(i) = taussxy(i) - smcwtd_old(i) = smcwtdxy(i) - rech_old(i) = rechxy(i) - deeprech_old(i) = deeprechxy(i) - - do k = 1, km - smc_old(i,k) = smc(i,k) - stc_old(i,k) = stc(i,k) - slc_old(i,k) = slc(i,k) - smoiseq_old(i,k) = smoiseq(i,k) - end do - - do k = -2, 0 - tsno_old(i,k) = tsnoxy(i,k) - snice_old(i,k) = snicexy(i,k) - snliq_old(i,k) = snliqxy(i,k) - end do - - do k = -2, km - zsnso_old (i,k) = zsnsoxy(i,k) - end do - - end if ! dry(i) .and. flag_guess(i) - - end do ! im _old loop - - do i = 1, im +do i = 1, im if (flag_iter(i) .and. dry(i)) then @@ -737,6 +663,8 @@ subroutine noahmpdrv_run & deep_recharge = deeprechxy(i) recharge = rechxy(i) + ustarx = ustar1(i) + snow_ice_frac_old = 0.0 do k = snow_levels+1, 0 if(snow_level_ice(k) > 0.0 ) & @@ -793,6 +721,7 @@ subroutine noahmpdrv_run & temperature_radiative,evaporation_soil ,runoff_surface ,runoff_baseflow , & sw_absorbed_ground ,albedo_total ,snowmelt_out ,snowmelt_shallow , & snowmelt_shallow_1 ,snowmelt_shallow_2 ,temperature_bare_2m ,spec_humidity_bare_2m, & + z0h_total , & emissivity_total ,precip_frozen_frac ,ch_bare_ground_2m ,snow_sublimation , & #ifdef CCPP albedo_direct ,albedo_diffuse ,errmsg ,errflg ) @@ -838,6 +767,8 @@ subroutine noahmpdrv_run & t2mmp(i) = temperature_bare_2m q2mp(i) = spec_humidity_bare_2m + tskin(i) = temperature_ground + else ! not glacier ice_flag = 0 @@ -871,8 +802,9 @@ subroutine noahmpdrv_run & soil_carbon_fast ,leaf_area_index ,stem_area_index , & cm_noahmp ,ch_noahmp ,snow_age , & grain_carbon ,growing_deg_days ,plant_growth_stage , & - soil_moisture_wtd ,deep_recharge ,recharge , & - z0_total ,sw_absorbed_total ,sw_reflected_total , & + soil_moisture_wtd ,deep_recharge ,recharge,ustarx , & + z0_total ,z0h_total ,surface_temperature , & + sw_absorbed_total ,sw_reflected_total , & lw_absorbed_total ,sensible_heat_total ,ground_heat_total , & latent_heat_canopy ,latent_heat_ground ,transpiration_heat , & evaporation_canopy ,transpiration ,evaporation_soil , & @@ -913,6 +845,8 @@ subroutine noahmpdrv_run & q2mp(i) = spec_humidity_veg_2m * vegetation_fraction + & spec_humidity_bare_2m * (1-vegetation_fraction) + tskin(i) = surface_temperature + endif ! glacial split ends ! @@ -966,9 +900,9 @@ subroutine noahmpdrv_run & snowc (i) = snow_cover_fraction sncovr1 (i) = snow_cover_fraction - qsurf (i) = q1(i) + evap(i) / (con_hvap / con_cp * density * ch(i) * wind(i)) - tskin (i) = temperature_radiative - tsurf (i) = temperature_radiative + + qsurf (i) = spec_humidity_surface + tvxy (i) = temperature_leaf tgxy (i) = temperature_ground tahxy (i) = temperature_canopy_air @@ -1005,6 +939,43 @@ subroutine noahmpdrv_run & smcwlt2(i) = smcdry_table(soil_category(1)) !!!change to wilt? smcref2(i) = smcref_table(soil_category(1)) + virtfac1 = 1.0 + con_fvirt * max(q1(i), 1.e-8) !from forcing + + if(thsfc_loc) then ! Use local potential temperature + vptemp =temperature_forcing * prslki(i)*virtfac1 !virtual potential temperature @zlvl 1 + else ! Use potential temperature reference to 1000 hPa + vptemp =temperature_forcing /prslk1(i) * virtfac1 + endif + + if(thsfc_loc) then ! Use local potential temperature + tvs1 = tskin(i) * virtfac1 + else ! Use potential temperature referenced to 1000 hPa + tvs1 = tskin(i)/prsik1(i) * virtfac1 + endif + + z0_total = max(min(z0_total,forcing_height),1.0e-6) + z0h_total = max(z0h_total,1.0e-6) + + + tem1 = (z0_total - z0lo) / (z0up - z0lo) + tem1 = min(max(tem1, 0.0_kind_phys), 1.0_kind_phys) + tem2 = max(sigmaf(i), 0.1_kind_phys) + zvfun(i) = sqrt(tem1 * tem2) + gdx=sqrt(garea(i)) + + call stability & + (zf(i), zvfun(i), gdx, virtual_temperature, vptemp,wind(i), z0_total, z0h_total, & + tvs1, gravity,thsfc_loc, & + rb1(i),fm1(i),fh1(i),fm101(i),fh21(i),cm(i),ch(i),stress1(i),ustar1(i)) + + cmxy(i) = cm(i) + chxy(i) = ch(i) + + chh (i) = chxy(i) * wind(i) * density + cmm (i) = cmxy(i) * wind(i) + + snwdph (i) = snow_depth * 1000.0 ! convert from m to mm; wait after the stability call + ! ! --- change units for output ! @@ -1029,6 +1000,11 @@ subroutine noahmpdrv_run & if (temperature_forcing <= 275.15) is_freeze_rain = .true. end if end if + +! +! using new combined ch output to compute ep +! + ch_noahmp = chxy(i) * wind(i) call penman (temperature_forcing, air_pressure_forcing , ch_noahmp , & virtual_temperature, potential_temperature, precipitation_forcing, & @@ -1043,69 +1019,6 @@ subroutine noahmpdrv_run & end do ! im loop -! -! --- restore land-related prognostic fields for guess run TARGET FOR REMOVAL -! - - do i = 1, im - if (dry(i) .and. flag_guess(i)) then - weasd(i) = weasd_old(i) - snwdph(i) = snwdph_old(i) - tskin(i) = tskin_old(i) - canopy(i) = canopy_old(i) - tprcp(i) = tprcp_old(i) - srflag(i) = srflag_old(i) - snowxy(i) = snow_old(i) - tvxy(i) = tv_old(i) - tgxy(i) = tg_old(i) - canicexy(i) = canice_old(i) - canliqxy(i) = canliq_old(i) - eahxy(i) = eah_old(i) - tahxy(i) = tah_old(i) - fwetxy(i) = fwet_old(i) - sneqvoxy(i) = sneqvo_old(i) - alboldxy(i) = albold_old(i) - qsnowxy(i) = qsnow_old(i) - wslakexy(i) = wslake_old(i) - zwtxy(i) = zwt_old(i) - waxy(i) = wa_old(i) - wtxy(i) = wt_old(i) - lfmassxy(i) = lfmass_old(i) - rtmassxy(i) = rtmass_old(i) - stmassxy(i) = stmass_old(i) - woodxy(i) = wood_old(i) - stblcpxy(i) = stblcp_old(i) - fastcpxy(i) = fastcp_old(i) - xlaixy(i) = xlai_old(i) - xsaixy(i) = xsai_old(i) - taussxy(i) = tauss_old(i) - smcwtdxy(i) = smcwtd_old(i) - rechxy(i) = rech_old(i) - deeprechxy(i) = deeprech_old(i) - - do k = 1, km - smc(i,k) = smc_old(i,k) - stc(i,k) = stc_old(i,k) - slc(i,k) = slc_old(i,k) - smoiseq(i,k) = smoiseq_old(i,k) - end do - - do k = -2,0 - tsnoxy(i,k) = tsno_old(i,k) - snicexy(i,k) = snice_old(i,k) - snliqxy(i,k) = snliq_old(i,k) - end do - - do k = -2, km - zsnsoxy(i,k) = zsnso_old(i,k) - end do - - else - tskin(i) = tsurf(i) - - end if - end do - return end subroutine noahmpdrv_run diff --git a/physics/sfc_noahmp_drv.meta b/physics/sfc_noahmp_drv.meta index 53524d87b..59a2e91f5 100644 --- a/physics/sfc_noahmp_drv.meta +++ b/physics/sfc_noahmp_drv.meta @@ -247,7 +247,7 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys - intent = in + intent = inout optional = F [ch] standard_name = surface_drag_coefficient_for_heat_and_moisture_in_air_over_land @@ -256,7 +256,7 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys - intent = in + intent = inout optional = F [prsl1] standard_name = air_pressure_at_surface_adjacent_layer @@ -267,6 +267,15 @@ kind = kind_phys intent = in optional = F +[prslk1] + standard_name = dimensionless_exner_function_at_surface_adjacent_layer + long_name = dimensionless Exner function at the lowest model layer + units = none + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = in + optional = F [prslki] standard_name = ratio_of_exner_function_between_midlayer_and_interface_at_lowest_model_layer long_name = Exner function ratio bt midlayer and interface at 1st layer @@ -276,6 +285,15 @@ kind = kind_phys intent = in optional = F +[prsik1] + standard_name = surface_dimensionless_exner_function + long_name = dimensionless Exner function at the ground surface + units = none + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = in + optional = F [zf] standard_name = height_above_ground_at_lowest_model_layer long_name = layer 1 height above ground (not MSL) @@ -354,14 +372,6 @@ type = logical intent = in optional = F -[flag_guess] - standard_name = flag_for_guess_run - long_name = flag for guess run - units = flag - dimensions = (horizontal_loop_extent) - type = logical - intent = in - optional = F [idveg] standard_name = control_for_land_surface_scheme_dynamic_vegetation long_name = choice for dynamic vegetation option (see noahmp module for definition) @@ -493,6 +503,15 @@ kind = kind_phys intent = in optional = F +[garea] + standard_name = cell_area + long_name = area of the grid cell + units = m2 + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = in + optional = F [rainn_mp] standard_name = explicit_precipitation_rate_on_previous_timestep long_name = explicit rainfall rate previous timestep @@ -619,6 +638,14 @@ kind = kind_phys intent = in optional = F +[thsfc_loc] + standard_name = flag_for_reference_pressure_theta + long_name = flag for reference pressure in theta calculation + units = flag + dimensions = () + type = logical + intent = in + optional = F [weasd] standard_name = water_equivalent_accumulated_snow_depth_over_land long_name = water equiv of acc snow depth over land @@ -709,19 +736,73 @@ kind = kind_phys intent = inout optional = F -[tsurf] - standard_name = surface_skin_temperature_after_iteration_over_land - long_name = surface skin temperature after iteration over land - units = K +[zorl] + standard_name = surface_roughness_length_over_land + long_name = surface roughness length over land (temporary use as interstitial) + units = cm dimensions = (horizontal_loop_extent) type = real kind = kind_phys intent = inout optional = F -[zorl] - standard_name = surface_roughness_length_over_land - long_name = surface roughness length over land (temporary use as interstitial) - units = cm +[rb1] + standard_name = bulk_richardson_number_at_lowest_model_level_over_land + long_name = bulk Richardson number at the surface over land + units = none + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = inout + optional = F +[fm1] + standard_name = Monin_Obukhov_similarity_function_for_momentum_over_land + long_name = Monin-Obukhov similarity function for momentum over land + units = none + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = inout + optional = F +[fh1] + standard_name = Monin_Obukhov_similarity_function_for_heat_over_land + long_name = Monin-Obukhov similarity function for heat over land + units = none + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = inout + optional = F +[ustar1] + standard_name = surface_friction_velocity_over_land + long_name = surface friction velocity over land + units = m s-1 + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = inout + optional = F +[stress1] + standard_name = surface_wind_stress_over_land + long_name = surface wind stress over land + units = m2 s-2 + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = inout + optional = F +[fm101] + standard_name = Monin_Obukhov_similarity_function_for_momentum_at_10m_over_land + long_name = Monin-Obukhov similarity parameter for momentum at 10m over land + units = none + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = inout + optional = F +[fh21] + standard_name = Monin_Obukhov_similarity_function_for_heat_at_2m_over_land + long_name = Monin-Obukhov similarity parameter for heat at 2m over land + units = none dimensions = (horizontal_loop_extent) type = real kind = kind_phys @@ -1303,6 +1384,15 @@ kind = kind_phys intent = out optional = F +[zvfun] + standard_name = function_of_surface_roughness_length_and_green_vegetation_fraction + long_name = function of surface roughness length and green vegetation fraction + units = none + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = out + optional = F [errmsg] standard_name = ccpp_error_message long_name = error message for error handling in CCPP From 2aabc3283d49648e742f6d048aa5f434831f79e3 Mon Sep 17 00:00:00 2001 From: Helin Wei Date: Wed, 8 Sep 2021 21:55:26 -0400 Subject: [PATCH 05/28] Adding GFS surface scheme to Noah MP as one of opt_sfc options --- physics/module_sf_noahmp_glacier.f90 | 183 ++++++++++++-- physics/module_sf_noahmplsm.f90 | 353 ++++++++++++++++++++++++++- physics/sfc_noahmp_drv.F90 | 37 ++- 3 files changed, 537 insertions(+), 36 deletions(-) diff --git a/physics/module_sf_noahmp_glacier.f90 b/physics/module_sf_noahmp_glacier.f90 index 7445f7b61..15016bc72 100644 --- a/physics/module_sf_noahmp_glacier.f90 +++ b/physics/module_sf_noahmp_glacier.f90 @@ -6,6 +6,8 @@ module noahmp_glacier_globals use machine , only : kind_phys + use sfc_diff, only : stability + implicit none ! ================================================================================================== @@ -59,6 +61,8 @@ module noahmp_glacier_globals INTEGER :: OPT_GLA != 1 !(suggested 1) + INTEGER :: OPT_SFC != 1 !(suggested 1) + ! adjustable parameters for snow processes REAL, PARAMETER :: Z0SNO = 0.002 !< snow surface roughness length (m) (0.002) @@ -117,6 +121,7 @@ subroutine noahmp_glacier (& iloc ,jloc ,cosz ,nsnow ,nsoil ,dt , & ! in : time/space/model-related sfctmp ,sfcprs ,uu ,vv ,q2 ,soldn , & ! in : forcing prcp ,lwdn ,tbot ,zlvl ,ficeold ,zsoil , & ! in : forcing + thsfc_loc,prslkix ,prsik1x ,prslk1x,sigmaf1,garea1 , & ! in : qsnow ,sneqvo ,albold ,cm ,ch ,isnow , & ! in/out : sneqv ,smc ,zsnso ,snowh ,snice ,snliq , & ! in/out : tg ,stc ,sh2o ,tauss ,qsfc , & ! in/out : @@ -124,10 +129,10 @@ subroutine noahmp_glacier (& trad ,edir ,runsrf ,runsub ,sag ,albedo , & ! out : qsnbot ,ponding ,ponding1,ponding2,t2m,q2e,z0h_total , & ! out : #ifdef CCPP - emissi, fpice ,ch2b , esnow, albsnd, albsni , & + emissi, fpice ,ch2b , esnow, albsnd, albsni,zvfun1, & errmsg, errflg) #else - emissi, fpice ,ch2b , esnow, albsnd, albsni) + emissi, fpice ,ch2b , esnow, albsnd, albsni,zvfun1) #endif @@ -156,6 +161,13 @@ subroutine noahmp_glacier (& real (kind=kind_phys) , intent(in) :: zlvl !< reference height (m) real (kind=kind_phys), dimension(-nsnow+1: 0), intent(in) :: ficeold!< ice fraction at last timestep real (kind=kind_phys), dimension( 1:nsoil), intent(in) :: zsoil !< layer-bottom depth from soil surf (m) + logical , intent(in) :: thsfc_loc + real (kind=kind_phys) , intent(in) :: prslkix !< pressure (pa) + real (kind=kind_phys) , intent(in) :: prsik1x !< pressure (pa) + real (kind=kind_phys) , intent(in) :: prslk1x !< pressure (pa) + real (kind=kind_phys) , intent(in) :: sigmaf1 !< areal fractional cover of green vegetation + real (kind=kind_phys) , intent(in) :: garea1 !< area of the grid cell + ! input/output : need arbitary intial values @@ -205,6 +217,7 @@ subroutine noahmp_glacier (& real (kind=kind_phys) , intent(out) :: esnow real (kind=kind_phys), dimension(1:2) , intent(out) :: albsnd !< snow albedo (direct) real (kind=kind_phys), dimension(1:2) , intent(out) :: albsni !< snow albedo (diffuse) + real (kind=kind_phys) , intent(out) :: zvfun1 #ifdef CCPP @@ -259,7 +272,8 @@ subroutine noahmp_glacier (& call energy_glacier (nsnow ,nsoil ,isnow ,dt ,qsnow ,rhoair , & !in eair ,sfcprs ,qair ,sfctmp ,lwdn ,uu , & !in vv ,solad ,solai ,cosz ,zlvl , & !in - tbot ,zbot ,zsnso ,dzsnso , & !in + tbot ,zbot ,zsnso ,dzsnso ,sigmaf1,garea1, & !in + thsfc_loc,prslkix ,prsik1x,prslk1x, & !in tg ,stc ,snowh ,sneqv ,sneqvo ,sh2o , & !inout smc ,snice ,snliq ,albold ,cm ,ch , & !inout #ifdef CCPP @@ -270,7 +284,7 @@ subroutine noahmp_glacier (& imelt ,snicev ,snliqv ,epore ,qmelt ,ponding, & !out sag ,fsa ,fsr ,fira ,fsh ,fgev , & !out trad ,t2m ,ssoil ,lathea ,q2e ,emissi, & !out - ch2b ,albsnd ,albsni ,z0h_total ) !out + ch2b ,albsnd ,albsni ,z0h_total,zvfun1 ) !out #ifdef CCPP if (errflg /= 0) return @@ -389,7 +403,8 @@ end subroutine atm_glacier subroutine energy_glacier (nsnow ,nsoil ,isnow ,dt ,qsnow ,rhoair , & !in eair ,sfcprs ,qair ,sfctmp ,lwdn ,uu , & !in vv ,solad ,solai ,cosz ,zref , & !in - tbot ,zbot ,zsnso ,dzsnso , & !in + tbot ,zbot ,zsnso ,dzsnso ,sigmaf1,garea1, & !in + thsfc_loc,prslkix ,prsik1x,prslk1x, & !in tg ,stc ,snowh ,sneqv ,sneqvo ,sh2o , & !inout smc ,snice ,snliq ,albold ,cm ,ch , & !inout #ifdef CCPP @@ -400,7 +415,7 @@ subroutine energy_glacier (nsnow ,nsoil ,isnow ,dt ,qsnow ,rhoair , & !i imelt ,snicev ,snliqv ,epore ,qmelt ,ponding, & !out sag ,fsa ,fsr ,fira ,fsh ,fgev , & !out trad ,t2m ,ssoil ,lathea ,q2e ,emissi, & !out - ch2b ,albsnd ,albsni ,z0h_total ) !out + ch2b ,albsnd ,albsni ,z0h_total,zvfun1 ) !out ! -------------------------------------------------------------------------------------------------- ! -------------------------------------------------------------------------------------------------- @@ -432,6 +447,13 @@ subroutine energy_glacier (nsnow ,nsoil ,isnow ,dt ,qsnow ,rhoair , & !i real (kind=kind_phys) , dimension(-nsnow+1:nsoil), intent(in) :: zsnso !< layer-bottom depth from snow surf [m] real (kind=kind_phys) , dimension(-nsnow+1:nsoil), intent(in) :: dzsnso !< depth of snow & soil layer-bottom [m] + logical , intent(in) :: thsfc_loc + real (kind=kind_phys) , intent(in) :: prslkix ! in exner function + real (kind=kind_phys) , intent(in) :: prsik1x ! in exner function + real (kind=kind_phys) , intent(in) :: prslk1x ! in exner function + real (kind=kind_phys) , intent(in) :: sigmaf1 !< areal fractional cover of green vegetation + real (kind=kind_phys) , intent(in) :: garea1 !< area of the grid cell + ! input & output real (kind=kind_phys) , intent(inout) :: tg !< ground temperature (k) real (kind=kind_phys) , dimension(-nsnow+1:nsoil), intent(inout) :: stc !< snow/soil temperature [k] @@ -476,6 +498,7 @@ subroutine energy_glacier (nsnow ,nsoil ,isnow ,dt ,qsnow ,rhoair , & !i real (kind=kind_phys), dimension(1:2) , intent(out) :: albsnd !< snow albedo (direct) real (kind=kind_phys), dimension(1:2) , intent(out) :: albsni !< snow albedo (diffuse) real (kind=kind_phys) , intent(out) :: z0h_total !< roughness length for heat + real (kind=kind_phys) , intent(out) :: zvfun1 ! local @@ -539,13 +562,14 @@ subroutine energy_glacier (nsnow ,nsoil ,isnow ,dt ,qsnow ,rhoair , & !i zlvl ,zpd ,qair ,sfctmp ,rhoair ,sfcprs , & !in ur ,gamma ,rsurf ,lwdn ,rhsur ,smc , & !in eair ,stc ,sag ,snowh ,lathea ,sh2o , & !in + thsfc_loc,prslkix,prsik1x ,prslk1x,sigmaf1,garea1 , & !in #ifdef CCPP cm ,ch ,tg ,qsfc ,errmsg ,errflg , & !inout #else cm ,ch ,tg ,qsfc , & !inout #endif fira ,fsh ,fgev ,ssoil , & !out - t2m ,q2e ,ch2b ,z0h_total) !out + t2m ,q2e ,ch2b ,z0h_total,zvfun1) !out !energy balance at surface: sag=(irb+shb+evb+ghb) @@ -974,13 +998,14 @@ subroutine glacier_flux (nsoil ,nsnow ,emg ,isnow ,df ,dzsnso ,z zlvl ,zpd ,qair ,sfctmp ,rhoair ,sfcprs , & !in ur ,gamma ,rsurf ,lwdn ,rhsur ,smc , & !in eair ,stc ,sag ,snowh ,lathea ,sh2o , & !in + thsfc_loc,prslkix,prsik1x ,prslk1x,sigmaf1,garea1 , & !in #ifdef CCPP cm ,ch ,tgb ,qsfc ,errmsg ,errflg , & !inout #else cm ,ch ,tgb ,qsfc , & !inout #endif irb ,shb ,evb ,ghb , & !out - t2mb ,q2b ,ehb2 ,z0h_total) !out + t2mb ,q2b ,ehb2 ,z0h_total,zvfun1) !out ! -------------------------------------------------------------------------------------------------- ! use newton-raphson iteration to solve ground (tg) temperature @@ -1020,6 +1045,13 @@ subroutine glacier_flux (nsoil ,nsnow ,emg ,isnow ,df ,dzsnso ,z real (kind=kind_phys), intent(in) :: snowh !< actual snow depth [m] real (kind=kind_phys), intent(in) :: lathea !< latent heat of vaporization/subli (j/kg) + logical , intent(in) :: thsfc_loc !way to th tmp + real (kind=kind_phys), intent(in) :: prslkix ! in exner function + real (kind=kind_phys), intent(in) :: prsik1x ! in exner function + real (kind=kind_phys), intent(in) :: prslk1x ! in exner function + real (kind=kind_phys), intent(in) :: sigmaf1 ! + real (kind=kind_phys), intent(in) :: garea1 ! + ! input/output real (kind=kind_phys), intent(inout) :: cm !< momentum drag coefficient real (kind=kind_phys), intent(inout) :: ch !< sensible heat exchange coefficient @@ -1041,10 +1073,13 @@ subroutine glacier_flux (nsoil ,nsnow ,emg ,isnow ,df ,dzsnso ,z real (kind=kind_phys), intent(out) :: q2b !< bare ground heat conductance real (kind=kind_phys), intent(out) :: ehb2 !< sensible heat conductance for diagnostics real (kind=kind_phys), intent(out) :: z0h_total !< roughness length for heat + real (kind=kind_phys), intent(out) :: zvfun1 ! ! local variables integer :: niterb !< number of iterations for surface temperature + integer :: niter !< number of iterations for surface temperature + real (kind=kind_phys) :: mpe !< prevents overflow error if division by zero real (kind=kind_phys) :: dtg !< change in tg, last iteration (k) integer :: mozsgn !< number of times moz changes sign @@ -1061,7 +1096,26 @@ subroutine glacier_flux (nsoil ,nsnow ,emg ,isnow ,df ,dzsnso ,z real (kind=kind_phys) :: cq2b !< integer :: iter !< iteration index real (kind=kind_phys) :: z0h !< roughness length, sensible heat, ground (m) - real (kind=kind_phys) :: reyni !< Roughness Reynolds # over ice + + real(kind=kind_phys) :: rb1i ! bulk richardson # + real(kind=kind_phys) :: fm10i ! fm10 over land ice + + real(kind=kind_phys) :: stress1i! wind stress m2 S-2 + + real(kind=kind_phys) :: tv1i ! virtual potential temp @ ref level + + real(kind=kind_phys) :: thv1i ! virtual potential temp @ ref level + real(kind=kind_phys) :: tvsi ! surface virtual temp + real(kind=kind_phys) :: zlvli ! ref. level + + real(kind=kind_phys) :: snwd ! snow depth in mm + + real(kind=kind_phys) :: reyni ! roughness Reynolds # + real(kind=kind_phys) :: virtfaci! virutal factor + + real(kind=kind_phys) :: tem1,tem2,gdx + real(kind=kind_phys), parameter :: z0lo=0.1, z0up=1.0 + real (kind=kind_phys) :: moz !< monin-obukhov stability parameter real (kind=kind_phys) :: fm !< momentum stability correction, weighted by prior iters real (kind=kind_phys) :: fh !< sen heat stability correction, weighted by prior iters @@ -1085,6 +1139,8 @@ subroutine glacier_flux (nsoil ,nsnow ,emg ,isnow ,df ,dzsnso ,z ! initialization variables that do not depend on stability iteration ! ----------------------------------------------------------------- niterb = 5 + niter = 1 + mpe = 1e-6 dtg = 0. mozsgn = 0 @@ -1092,26 +1148,47 @@ subroutine glacier_flux (nsoil ,nsnow ,emg ,isnow ,df ,dzsnso ,z moz = 0. h = 0. - fv = 0.1 +! the following only applies to opt_sfc =3, opt_sfc = 1 still done its old way + + snwd = snowh*1000.0 + zlvli = zlvl - zpd + +! fv = ustarx ! the input maybe too high for glacial + fv = ur*vkc/log(zlvli/z0m) reyni = fv*z0m/(1.5e-05) !introduction of fv dependent z0h for the iter - if (reyni .gt. 2.0) then + if (reyni .gt. 2.0) then z0h = z0m/exp(2.46*(reyni)**0.25 - log(7.4)) !Brutsaert 1982 else z0h = z0m/exp(-log(0.397)) !Brusaert 1982, table 4 - endif + endif z0h_total = z0h + virtfaci = 1.0 + 0.61 * max(qair, 1.e-8) + tv1i = sfctmp * virtfaci ! virt tmp @ middle + + if(thsfc_loc) then ! Use local potential temperature + thv1i = sfctmp * prslkix * virtfaci + else ! Use potential temperature reference to 1000 hPa + thv1i = sfctmp / prslk1x * virtfaci + endif + + if ( ur < 2.0) niter = 2 + cir = emg*sb cgh = 2.*df(isnow+1)/dzsnso(isnow+1) ! ----------------------------------------------------------------- + tem1 = (z0m - z0lo) / (z0up - z0lo) + tem1 = min(max(tem1, 0.0_kind_phys), 1.0_kind_phys) + tem2 = max(sigmaf1, 0.1_kind_phys) + zvfun1= sqrt(tem1 * tem2) + gdx=sqrt(garea1) + if(opt_sfc == 1 .or. opt_sfc == 2) then !Add option for sfc scheme,use '1' for both '1'/'2' loop3: do iter = 1, niterb ! begin stability iteration -! z0h = z0m - ! for now, only allow sfcdif1 until others can be fixed call sfcdif1_glacier(iter ,zlvl ,zpd ,z0h ,z0m , & !in @@ -1181,6 +1258,80 @@ subroutine glacier_flux (nsoil ,nsnow ,emg ,isnow ,df ,dzsnso ,z qsfc = 0.622*(estg*rhsur)/(sfcprs-0.378*(estg*rhsur)) end do loop3 ! end stability iteration + end if + + if (opt_sfc == 3) then + + do iter = 1, niter + + if(thsfc_loc) then ! Use local potential temperature + tvsi = tgb * virtfaci + else ! Use potential temperature referenced to 1000 hPa + tvsi = tgb/prsik1x * virtfaci + endif + + call stability & + (zlvli, zvfun1, gdx,tv1i,thv1i, ur, z0m, z0h, tvsi, grav,thsfc_loc, & + rb1i, fm,fh,fm10i,fh2,cm,ch,stress1i,fv) + +! maybe need to add some sorts of err handling if CCPP + + ramb = max(1.,1./(cm*ur)) + rahb = max(1.,1./(ch*ur)) + rawb = rahb + +! es and d(es)/dt evaluated at tg + + t = tdc(tgb) + call esat(t, esatw, esati, dsatw, dsati) + if (t .gt. 0.) then + estg = esatw + destg = dsatw + else + estg = esati + destg = dsati + end if + + csh = rhoair*cpair/rahb + + if(snowh > 0.0 .or. opt_gla == 1) then + cev = rhoair*cpair/gamma/(rsurf+rawb) + else + cev = 0.0 ! don't allow any sublimation of glacier in opt_gla=2 + end if + +! surface fluxes and dtg + + irb = cir * tgb**4 - emg*lwdn + shb = csh * (tgb - sfctmp ) + evb = cev * (estg*rhsur - eair ) + ghb = cgh * (tgb - stc(isnow+1)) + + b = sag-irb-shb-evb-ghb + a = 4.*cir*tgb**3 + csh + cev*destg + cgh + dtg = b/a + + irb = irb + 4.*cir*tgb**3*dtg + shb = shb + csh*dtg + evb = evb + cev*destg*dtg + ghb = ghb + cgh*dtg + +! update ground surface temperature to update cm/ch + + tgb = tgb + dtg + + t = tdc(tgb) + call esat(t, esatw, esati, dsatw, dsati) + if (t .gt. 0.) then + estg = esatw + else + estg = esati + end if + qsfc = 0.622*(estg*rhsur)/(sfcprs-0.378*(estg*rhsur)) + + end do !sfc_diff3 iter + end if !sfc_diff3 + ! ----------------------------------------------------------------- ! if snow on ground and tg > tfrz: reset tg = tfrz. reevaluate ground fluxes. @@ -3177,7 +3328,7 @@ end subroutine error_glacier ! ================================================================================================== !>\ingroup NoahMP_LSM - subroutine noahmp_options_glacier(iopt_alb ,iopt_snf ,iopt_tbot, iopt_stc, iopt_gla ) + subroutine noahmp_options_glacier(iopt_alb ,iopt_snf ,iopt_tbot, iopt_stc, iopt_gla, iopt_sfc) implicit none @@ -3187,6 +3338,7 @@ subroutine noahmp_options_glacier(iopt_alb ,iopt_snf ,iopt_tbot, iopt_stc, iop integer, intent(in) :: iopt_stc !< snow/soil temperature time scheme (only layer 1) !! 1 -> semi-implicit; 2 -> full implicit (original noah) integer, intent(in) :: iopt_gla !< glacier option (1->phase change; 2->simple) + integer, intent(in) :: iopt_sfc !< sfc scheme option ! ------------------------------------------------------------------------------------------------- @@ -3195,6 +3347,7 @@ subroutine noahmp_options_glacier(iopt_alb ,iopt_snf ,iopt_tbot, iopt_stc, iop opt_tbot = iopt_tbot opt_stc = iopt_stc opt_gla = iopt_gla + opt_sfc = iopt_sfc end subroutine noahmp_options_glacier diff --git a/physics/module_sf_noahmplsm.f90 b/physics/module_sf_noahmplsm.f90 index 305a662c3..810b904a7 100644 --- a/physics/module_sf_noahmplsm.f90 +++ b/physics/module_sf_noahmplsm.f90 @@ -8,6 +8,7 @@ module module_sf_noahmplsm use module_wrf_utl #endif use machine , only : kind_phys +use sfc_diff, only : stability implicit none @@ -377,8 +378,8 @@ subroutine noahmp_sflx (parameters, & dt , dx , dz8w , nsoil , zsoil , nsnow , & ! in : model configuration shdfac , shdmax , vegtyp , ice , ist , croptype, & ! in : vegetation/soil characteristics smceq , & ! in : vegetation/soil characteristics - sfctmp , sfcprs , psfc , uu , vv , q2 , & ! in : forcing - qc , soldn , lwdn , & ! in : forcing + sfctmp , sfcprs , psfc , uu , vv , q2, garea1 , & ! in : forcing + qc , soldn , lwdn,thsfc_loc, prslkix,prsik1x,prslk1x,& ! in : forcing prcpconv, prcpnonc, prcpshcv, prcpsnow, prcpgrpl, prcphail, & ! in : forcing tbot , co2air , o2air , foln , ficeold , zlvl , & ! in : forcing albold , sneqvo , & ! in/out : @@ -397,7 +398,7 @@ subroutine noahmp_sflx (parameters, & runsrf , runsub , apar , psn , sav , sag , & ! out : fsno , nee , gpp , npp , fveg , albedo , & ! out : qsnbot , ponding , ponding1, ponding2, rssun , rssha , & ! out : - albd , albi , albsnd , albsni , & ! out : + albd , albi , albsnd , albsni , zvfun1 , & ! out : bgap , wgap , chv , chb , emissi , & ! out : shg , shc , shb , evg , evb , ghv , & ! out : ghb , irg , irc , irb , tr , evc , & ! out : @@ -435,6 +436,13 @@ subroutine noahmp_sflx (parameters, & real (kind=kind_phys) , intent(in) :: soldn !< downward shortwave radiation (w/m2) real (kind=kind_phys) , intent(in) :: lwdn !< downward longwave radiation (w/m2) real (kind=kind_phys) , intent(in) :: sfcprs !< pressure (pa) + + logical , intent(in) :: thsfc_loc + real (kind=kind_phys) , intent(in) :: prslkix ! in exner function + real (kind=kind_phys) , intent(in) :: prsik1x ! in exner function + real (kind=kind_phys) , intent(in) :: prslk1x ! in exner function + real (kind=kind_phys) , intent(in) :: garea1 ! in exner function + real (kind=kind_phys) , intent(inout) :: zlvl !< reference height (m) real (kind=kind_phys) , intent(in) :: cosz !< cosine solar zenith angle [0-1] real (kind=kind_phys) , intent(in) :: tbot !< bottom condition for soil temp. [k] @@ -528,6 +536,7 @@ subroutine noahmp_sflx (parameters, & real (kind=kind_phys) , intent(out) :: ponding1!< surface ponding [mm] real (kind=kind_phys) , intent(out) :: ponding2!< surface ponding [mm] real (kind=kind_phys) , intent(out) :: esnow + real (kind=kind_phys) , intent(out) :: zvfun1 real (kind=kind_phys) , intent(out) :: rb !< leaf boundary layer resistance (s/m) real (kind=kind_phys) , intent(out) :: laisun !< sunlit leaf area index (m2/m2) real (kind=kind_phys) , intent(out) :: laisha !< shaded leaf area index (m2/m2) @@ -763,12 +772,13 @@ subroutine noahmp_sflx (parameters, & elai ,esai ,fwet ,foln , & !in fveg ,pahv ,pahg ,pahb , & !in qsnow ,dzsnso ,lat ,canliq ,canice ,iloc, jloc , & !in + thsfc_loc, prslkix,prsik1x,prslk1x,garea1, & !in z0wrf ,z0hwrf , & !out imelt ,snicev ,snliqv ,epore ,t2m ,fsno , & !out sav ,sag ,qmelt ,fsa ,fsr ,taux , & !out tauy ,fira ,fsh ,fcev ,fgev ,fctr , & !out trad ,psn ,apar ,ssoil ,btrani ,btran , & !out - ponding,ts ,latheav , latheag , frozen_canopy,frozen_ground, & !out + ponding,ts ,latheav , latheag , frozen_canopy,frozen_ground,zvfun1, & !out tv ,tg ,stc ,snowh ,eah ,tah , & !inout sneqvo ,sneqv ,sh2o ,smc ,snice ,snliq , & !inout albold ,cm ,ch ,dx ,dz8w ,q2 , & !inout @@ -785,6 +795,8 @@ subroutine noahmp_sflx (parameters, & q1 ,q2v ,q2b ,q2e ,chv ,chb , & !out emissi ,pah , & shg,shc,shb,evg,evb,ghv,ghb,irg,irc,irb,tr,evc,chleaf,chuc,chv2,chb2 ) !out + + qsfc = q1 ! !jref:end #ifdef CCPP if (errflg /= 0) return @@ -1591,12 +1603,13 @@ subroutine energy (parameters,ice ,vegtyp ,ist ,nsnow ,nsoil , & !in elai ,esai ,fwet ,foln , & !in fveg ,pahv ,pahg ,pahb , & !in qsnow ,dzsnso ,lat ,canliq ,canice ,iloc , jloc, & !in + thsfc_loc, prslkix,prsik1x,prslk1x,garea1, & !in z0wrf ,z0hwrf , & !out imelt ,snicev ,snliqv ,epore ,t2m ,fsno , & !out sav ,sag ,qmelt ,fsa ,fsr ,taux , & !out tauy ,fira ,fsh ,fcev ,fgev ,fctr , & !out trad ,psn ,apar ,ssoil ,btrani ,btran , & !out - ponding,ts ,latheav , latheag , frozen_canopy,frozen_ground, & !out + ponding,ts ,latheav , latheag , frozen_canopy,frozen_ground,zvfun1, & !out tv ,tg ,stc ,snowh ,eah ,tah , & !inout sneqvo ,sneqv ,sh2o ,smc ,snice ,snliq , & !inout albold ,cm ,ch ,dx ,dz8w ,q2 , & !inout @@ -1664,6 +1677,13 @@ subroutine energy (parameters,ice ,vegtyp ,ist ,nsnow ,nsoil , & !in real (kind=kind_phys) , intent(in) :: rhoair !density air (kg/m3) real (kind=kind_phys) , intent(in) :: eair !vapor pressure air (pa) real (kind=kind_phys) , intent(in) :: sfcprs !pressure (pa) + + logical , intent(in) :: thsfc_loc + real (kind=kind_phys) , intent(in) :: prslkix ! in exner function + real (kind=kind_phys) , intent(in) :: prsik1x ! in exner function + real (kind=kind_phys) , intent(in) :: prslk1x ! in exner function + real (kind=kind_phys) , intent(in) :: garea1 + real (kind=kind_phys) , intent(in) :: qair !specific humidity (kg/kg) real (kind=kind_phys) , intent(in) :: sfctmp !air temperature (k) real (kind=kind_phys) , intent(in) :: thair !potential temperature (k) @@ -1735,6 +1755,7 @@ subroutine energy (parameters,ice ,vegtyp ,ist ,nsnow ,nsoil , & !in real (kind=kind_phys) , intent(out) :: latheav !latent heat vap./sublimation (j/kg) real (kind=kind_phys) , intent(out) :: latheag !latent heat vap./sublimation (j/kg) real (kind=kind_phys) , intent(out) :: ts !surface temperature (k) + real (kind=kind_phys) , intent(out) :: zvfun1 logical , intent(out) :: frozen_ground ! used to define latent heat pathway logical , intent(out) :: frozen_canopy ! used to define latent heat pathway @@ -2138,6 +2159,7 @@ subroutine energy (parameters,ice ,vegtyp ,ist ,nsnow ,nsoil , & !in rsurf ,latheav ,latheag ,parsun ,parsha ,igs , & !in foln ,co2air ,o2air ,btran ,sfcprs , & !in rhsur ,iloc ,jloc ,q2 ,pahv ,pahg , & !in + thsfc_loc, prslkix,prsik1x,prslk1x, garea1, & !in eah ,tah ,tv ,tgv ,cmv, ustarx , & !inout #ifdef CCPP chv ,dx ,dz8w ,errmsg ,errflg , & !inout @@ -2146,7 +2168,7 @@ subroutine energy (parameters,ice ,vegtyp ,ist ,nsnow ,nsoil , & !in #endif tauxv ,tauyv ,irg ,irc ,shg , & !out shc ,evg ,evc ,tr ,ghv , & !out - t2mv ,psnsun ,psnsha ,csigmaf1, & !out + t2mv ,psnsun ,psnsha ,csigmaf1,zvfun1 , & !out !jref:start qc ,qsfc ,psfc , & !in q2v ,chv2, chleaf, chuc) !inout @@ -2170,12 +2192,13 @@ subroutine energy (parameters,ice ,vegtyp ,ist ,nsnow ,nsoil , & !in dzsnso ,zlvl ,zpdg ,z0mg ,fsno, & !in emg ,stc ,df ,rsurf ,latheag , & !in gammag ,rhsur ,iloc ,jloc ,q2 ,pahb , & !in + thsfc_loc, prslkix,prsik1x,prslk1x,fveg,garea1, & !in #ifdef CCPP tgb ,cmb ,chb, ustarx,errmsg ,errflg , & !inout #else tgb ,cmb ,chb, ustarx, & !inout #endif - tauxb ,tauyb ,irb ,shb ,evb,csigmaf0,& !out + tauxb ,tauyb ,irb ,shb ,evb,csigmaf0,zvfun1,& !out ghb ,t2mb ,dx ,dz8w ,vegtyp , & !out !jref:start qc ,qsfc ,psfc , & !in @@ -3578,6 +3601,7 @@ subroutine vege_flux(parameters,nsnow ,nsoil ,isnow ,vegtyp ,veg , & rsurf ,latheav ,latheag ,parsun ,parsha ,igs , & !in foln ,co2air ,o2air ,btran ,sfcprs , & !in rhsur ,iloc ,jloc ,q2 ,pahv ,pahg , & !in + thsfc_loc, prslkix,prsik1x,prslk1x, garea1, & !in eah ,tah ,tv ,tg ,cm,ustarx,& !inout #ifdef CCPP ch ,dx ,dz8w ,errmsg ,errflg , & !inout @@ -3586,7 +3610,7 @@ subroutine vege_flux(parameters,nsnow ,nsoil ,isnow ,vegtyp ,veg , & #endif tauxv ,tauyv ,irg ,irc ,shg , & !out shc ,evg ,evc ,tr ,gh , & !out - t2mv ,psnsun ,psnsha ,csigmaf1 , & !out + t2mv ,psnsun ,psnsha ,csigmaf1,zvfun1 , & !out qc ,qsfc ,psfc , & !in q2v ,cah2 ,chleaf ,chuc ) !inout @@ -3624,6 +3648,12 @@ subroutine vege_flux(parameters,nsnow ,nsoil ,isnow ,vegtyp ,veg , & real (kind=kind_phys), intent(in) :: dt !time step (s) real (kind=kind_phys), intent(in) :: fsno !snow fraction + logical , intent(in) :: thsfc_loc + real (kind=kind_phys) , intent(in) :: prslkix ! in exner function + real (kind=kind_phys) , intent(in) :: prsik1x ! in exner function + real (kind=kind_phys) , intent(in) :: prslk1x ! in exner function + real (kind=kind_phys) , intent(in) :: garea1 ! + real (kind=kind_phys), intent(in) :: snowh !actual snow depth [m] real (kind=kind_phys), intent(in) :: fwet !wetted fraction of canopy real (kind=kind_phys), intent(in) :: cwp !canopy wind parameter @@ -3699,6 +3729,7 @@ subroutine vege_flux(parameters,nsnow ,nsoil ,isnow ,vegtyp ,veg , & real (kind=kind_phys), intent(out) :: psnsun !sunlit leaf photosynthesis (umolco2/m2/s) real (kind=kind_phys), intent(out) :: psnsha !shaded leaf photosynthesis (umolco2/m2/s) real (kind=kind_phys), intent(out) :: csigmaf1 + real (kind=kind_phys), intent(out) :: zvfun1 real (kind=kind_phys), intent(out) :: chleaf !leaf exchange coefficient real (kind=kind_phys), intent(out) :: chuc !under canopy exchange coefficient @@ -3776,6 +3807,17 @@ subroutine vege_flux(parameters,nsnow ,nsoil ,isnow ,vegtyp ,veg , & real(kind=kind_phys) :: kbsigmaf1 ! kb^-1 for fully convered by vegetation real(kind=kind_phys) :: kbsigmafc ! kb^-1 under canopy ground + real (kind=kind_phys) :: fm10 !monin-obukhov momentum adjustment at 10m + real (kind=kind_phys) :: rb1v !Bulk Richardson # over vegetation + real (kind=kind_phys) :: stress1v !Stress over vegetation + real (kind=kind_phys) :: snwd + real (kind=kind_phys) :: virtfacv + real (kind=kind_phys) :: thv1v + real (kind=kind_phys) :: tvsv + real (kind=kind_phys) :: tv1v + real (kind=kind_phys) :: zlvlv + + real (kind=kind_phys) :: thvair real (kind=kind_phys) :: thah real (kind=kind_phys) :: rahc2 !aerodynamic resistance for sensible heat (s/m) @@ -3792,6 +3834,9 @@ subroutine vege_flux(parameters,nsnow ,nsoil ,isnow ,vegtyp ,veg , & real (kind=kind_phys) :: laisune !sunlit leaf area index, one-sided (m2/m2),effective real (kind=kind_phys) :: laishae !shaded leaf area index, one-sided (m2/m2),effective + real(kind=kind_phys) :: tem1,tem2,gdx + real(kind=kind_phys), parameter :: z0lo=0.1, z0up=1.0 + integer :: k !index integer :: iter !iteration index @@ -3804,6 +3849,8 @@ subroutine vege_flux(parameters,nsnow ,nsoil ,isnow ,vegtyp ,veg , & integer :: liter !last iteration + integer :: niter !for sfcdiff3 + real (kind=kind_phys) :: t, tdc !kelvin to degree celsius with limit -50 to +50 @@ -3817,6 +3864,9 @@ subroutine vege_flux(parameters,nsnow ,nsoil ,isnow ,vegtyp ,veg , & fv = ustarx + niter = 1 + if (ur < 2.0) niter = 2 + ! --------------------------------------------------------------------------------------------- ! initialization variables that do not depend on stability iteration ! --------------------------------------------------------------------------------------------- @@ -3838,6 +3888,22 @@ subroutine vege_flux(parameters,nsnow ,nsoil ,isnow ,vegtyp ,veg , & laisune = min(6.,laisun) laishae = min(6.,laisha) +! for sfcdiff3 + + snwd = snowh*1000.0 + zlvlv = zlvl - zpd + + virtfacv = 1.0 + 0.61 * max(qair, 1.e-8) + tv1v = sfctmp * virtfacv + + if(thsfc_loc) then ! Use local potential temperature + thv1v = sfctmp * prslkix * virtfacv + else ! Use potential temperature reference to 1000 hPa + thv1v = sfctmp / prslk1x * virtfacv + endif +! + + ! saturation vapor pressure at ground temperature t = tdc(tg) @@ -3907,8 +3973,18 @@ subroutine vege_flux(parameters,nsnow ,nsoil ,isnow ,vegtyp ,veg , & z0h = z0m/exp(kbsigmaf1) csigmaf1 = log((zlvl-zpd)/z0m)*(log((zlvl-zpd)/z0m)+kbsigmaf1) ! for output for interpolation +! -- + tem1 = (z0m - z0lo) / (z0up - z0lo) + tem1 = min(max(tem1, 0.0_kind_phys), 1.0_kind_phys) + tem2 = max(fveg, 0.1_kind_phys) + zvfun1= sqrt(tem1 * tem2) + gdx=sqrt(garea1) + if(opt_sfc == 1 .or. opt_sfc == 2) then + loop1: do iter = 1, niterc ! begin stability iteration +! use newly derived z0m/z0h + if(iter == 1) then z0hg = z0mg else @@ -4058,6 +4134,135 @@ subroutine vege_flux(parameters,nsnow ,nsoil ,isnow ,vegtyp ,veg , & end do loop1 ! end stability iteration + endif !opt_sfc 1 or 2 +! +! sfcdiff3 +! + if (opt_sfc == 3) then + + z0hg = z0mg + + do iter = 1, niter !1 or 2; depending on ur + + if(thsfc_loc) then ! Use local potential temperature + tvsv = tah * virtfacv + else ! Use potential temperature referenced to 1000 hPa + tvsv = tah/prsik1x * virtfacv + endif + + call stability & + (zlvlv, zvfun1, gdx,tv1v,thv1v, ur, z0m, z0h, tvsv, grav,thsfc_loc, & + rb1v, fm,fh,fm10,fh2,cm,ch,stress1v,fv) + + ramc = max(1.,1./(cm*ur)) + rahc = max(1.,1./(ch*ur)) + rawc = rahc + +! aerodyn resistance between heights z0g and d+z0v, rag, and leaf +! boundary layer resistance, rb + + call ragrb(parameters,iter ,vaie ,rhoair ,hg ,tah , & !in + zpd ,z0mg ,z0hg ,hcan ,uc , & !in + z0h ,fv ,cwp ,vegtyp ,mpe , & !in + tv ,mozg ,fhg ,iloc ,jloc , & !inout + ramg ,rahg ,rawg ,rb ) !out + +! es and d(es)/dt evaluated at tv + + t = tdc(tv) + call esat(t, esatw, esati, dsatw, dsati) + if (t .gt. 0.) then + estv = esatw + destv = dsatw + else + estv = esati + destv = dsati + end if + +! stomatal resistance + + if(iter == 1) then + if (opt_crs == 1) then ! ball-berry + call stomata (parameters,vegtyp,mpe ,parsun ,foln ,iloc , jloc , & !in + tv ,estv ,eah ,sfctmp,sfcprs, & !in + o2air ,co2air,igs ,btran ,rb , & !in + rssun ,psnsun) !out + + call stomata (parameters,vegtyp,mpe ,parsha ,foln ,iloc , jloc , & !in + tv ,estv ,eah ,sfctmp,sfcprs, & !in + o2air ,co2air,igs ,btran ,rb , & !in + rssha ,psnsha) !out + end if + + if (opt_crs == 2) then ! jarvis + call canres (parameters,parsun,tv ,btran ,eah ,sfcprs, & !in + rssun ,psnsun,iloc ,jloc ) !out + + call canres (parameters,parsha,tv ,btran ,eah ,sfcprs, & !in + rssha ,psnsha,iloc ,jloc ) !out + end if + end if + +! prepare for sensible heat flux above veg. + + cah = 1./rahc + cvh = 2.*vaie/rb + cgh = 1./rahg + cond = cah + cvh + cgh + ata = (sfctmp*cah + tg*cgh) / cond + bta = cvh/cond + csh = (1.-bta)*rhoair*cpair*cvh + +! prepare for latent heat flux above veg. + + caw = 1./rawc + cew = fwet*vaie/rb + ctw = (1.-fwet)*(laisune/(rb+rssun) + laishae/(rb+rssha)) + cgw = 1./(rawg+rsurf) + cond = caw + cew + ctw + cgw + aea = (eair*caw + estg*cgw) / cond + bea = (cew+ctw)/cond + cev = (1.-bea)*cew*rhoair*cpair/gammav ! barlage: change to vegetation v3.6 + ctr = (1.-bea)*ctw*rhoair*cpair/gammav + +! evaluate surface fluxes with current temperature and solve for dts + + tah = ata + bta*tv ! canopy air t. + eah = aea + bea*estv ! canopy air e + + irc = fveg*(air + cir*tv**4) + shc = fveg*rhoair*cpair*cvh * ( tv-tah) + evc = fveg*rhoair*cpair*cew * (estv-eah) / gammav ! barlage: change to v in v3.6 + tr = fveg*rhoair*cpair*ctw * (estv-eah) / gammav + if (tv > tfrz) then + evc = min(canliq*latheav/dt,evc) ! barlage: add if block for canice in v3.6 + else + evc = min(canice*latheav/dt,evc) + end if + + b = sav-irc-shc-evc-tr+pahv !additional w/m2 + a = fveg*(4.*cir*tv**3 + csh + (cev+ctr)*destv) !volumetric heat capacity + dtv = b/a + + irc = irc + fveg*4.*cir*tv**3*dtv + shc = shc + fveg*csh*dtv + evc = evc + fveg*cev*destv*dtv + tr = tr + fveg*ctr*destv*dtv + +! update vegetation surface temperature + tv = tv + dtv +! tah = ata + bta*tv ! canopy air t; update here for consistency + +! for computing m-o length in the next iteration + h = rhoair*cpair*(tah - sfctmp) /rahc + hg = rhoair*cpair*(tg - tah) /rahg + +! consistent specific humidity from canopy air vapor pressure + qsfc = (0.622*eah)/(sfcprs-0.378*eah) + + enddo ! iteration + endif ! sfcdiff3 + ! under-canopy fluxes and tg air = - emg*(1.-emv)*lwdn - emg*emv*sb*tv**4 @@ -4123,7 +4328,7 @@ subroutine vege_flux(parameters,nsnow ,nsoil ,isnow ,vegtyp ,veg , & ! qfx = (qsfc-qair)*rhoair*caw !*cpair/gammag ! 2m temperature over vegetation ( corrected for low cq2v values ) - if (opt_sfc == 1 .or. opt_sfc == 2) then + if (opt_sfc == 1 .or. opt_sfc == 2 .or. opt_sfc ==3 ) then ! cah2 = fv*1./vkc*log((2.+z0h)/z0h) cah2 = fv*vkc/log((2.+z0h)/z0h) cah2 = fv*vkc/(log((2.+z0h)/z0h)-fh2) @@ -4157,12 +4362,13 @@ subroutine bare_flux (parameters,nsnow ,nsoil ,isnow ,dt ,sag , & dzsnso ,zlvl ,zpd ,z0m ,fsno , & !in emg ,stc ,df ,rsurf ,lathea , & !in gamma ,rhsur ,iloc ,jloc ,q2 ,pahb , & !in + thsfc_loc, prslkix,prsik1x,prslk1x,fveg,garea1, & !in #ifdef CCPP tgb ,cm ,ch,ustarx,errmsg ,errflg , & !inout #else tgb ,cm ,ch,ustarx, & !inout #endif - tauxb ,tauyb ,irb ,shb ,evb,csigmaf0,& !out + tauxb ,tauyb ,irb ,shb ,evb,csigmaf0,zvfun1,& !out ghb ,t2mb ,dx ,dz8w ,ivgtyp , & !out qc ,qsfc ,psfc , & !in sfcprs ,q2b ,ehb2 ) !in @@ -4208,6 +4414,13 @@ subroutine bare_flux (parameters,nsnow ,nsoil ,isnow ,dt ,sag , & real (kind=kind_phys), intent(in) :: rhsur !raltive humidity in surface soil/snow air space (-) real (kind=kind_phys), intent(in) :: fsno !snow fraction + logical , intent(in) :: thsfc_loc + real (kind=kind_phys) , intent(in) :: prslkix ! in exner function + real (kind=kind_phys) , intent(in) :: prsik1x ! in exner function + real (kind=kind_phys) , intent(in) :: prslk1x ! in exner function + real (kind=kind_phys) , intent(in) :: fveg + real (kind=kind_phys) , intent(in) :: garea1 + !jref:start; in integer , intent(in) :: ivgtyp real (kind=kind_phys) , intent(in) :: qc !cloud water mixing ratio @@ -4241,6 +4454,7 @@ subroutine bare_flux (parameters,nsnow ,nsoil ,isnow ,dt ,sag , & real (kind=kind_phys), intent(out) :: ghb !ground heat flux (w/m2) [+ to soil] real (kind=kind_phys), intent(out) :: t2mb !2 m height air temperature (k) real (kind=kind_phys), intent(out) :: csigmaf0 ! + real (kind=kind_phys), intent(out) :: zvfun1 ! !jref:start real (kind=kind_phys), intent(out) :: q2b !bare ground heat conductance real (kind=kind_phys) :: ehb !bare ground heat conductance @@ -4251,6 +4465,17 @@ subroutine bare_flux (parameters,nsnow ,nsoil ,isnow ,dt ,sag , & ! local variables + real (kind=kind_phys) :: rb1b !Bulk Richardson # over bare soil + real (kind=kind_phys) :: stress1b !Stress over bare soil + real (kind=kind_phys) :: snwd + real (kind=kind_phys) :: virtfacb + real (kind=kind_phys) :: thv1b + real (kind=kind_phys) :: tvsb + real (kind=kind_phys) :: tv1b + real (kind=kind_phys) :: zlvlb + + real (kind=kind_phys) :: fm10 + real (kind=kind_phys) :: taux !wind stress: e-w (n/m2) real (kind=kind_phys) :: tauy !wind stress: n-s (n/m2) real (kind=kind_phys) :: fira !total net longwave rad (w/m2) [+ to atm] @@ -4314,8 +4539,13 @@ subroutine bare_flux (parameters,nsnow ,nsoil ,isnow ,dt ,sag , & real (kind=kind_phys) :: fh2 !monin-obukhov heat adjustment at 2m real (kind=kind_phys) :: ch2 !surface exchange at 2m + real(kind=kind_phys) :: tem1,tem2,gdx + real(kind=kind_phys), parameter :: z0lo=0.1, z0up=1.0 + integer :: iter !iteration index integer :: niterb !number of iterations for surface temperature + integer :: niter + real (kind=kind_phys) :: mpe !prevents overflow error if division by zero !jref:start ! data niterb /3/ @@ -4339,8 +4569,13 @@ subroutine bare_flux (parameters,nsnow ,nsoil ,isnow ,dt ,sag , & csigmaf0 = 0. kbsigmaf0 = 0. + niter = 1 + if (ur < 2.0) niter = 2 + fv = ustarx +! fv = ur*vkc/log((zlvl-zpd)/z0m) + reynb = fv*z0m/(1.5e-05) if (reynb .gt. 2.0) then @@ -4352,12 +4587,33 @@ subroutine bare_flux (parameters,nsnow ,nsoil ,isnow ,dt ,sag , & csigmaf0 = log((zlvl-zpd)/z0m)*(log((zlvl-zpd)/z0m) + kbsigmaf0) z0h = max(z0m/exp(kbsigmaf0),1.0e-6) +! +! for sfcdiff3; maybe should move to inside the option +! + snwd = snowh*1000.0 + zlvlb = zlvl - zpd + + virtfacb = 1.0 + 0.61 * max(qair, 1.e-8) + tv1b = sfctmp * virtfacb + if(thsfc_loc) then ! Use local potential temperature + thv1b = sfctmp * prslkix * virtfacb + else ! Use potential temperature reference to 1000 hPa + thv1b = sfctmp / prslk1x * virtfacb + endif cir = emg*sb cgh = 2.*df(isnow+1)/dzsnso(isnow+1) ! ----------------------------------------------------------------- + tem1 = (z0m - z0lo) / (z0up - z0lo) + tem1 = min(max(tem1, 0.0_kind_phys), 1.0_kind_phys) + tem2 = max(fveg, 0.1_kind_phys) + zvfun1= sqrt(tem1 * tem2) + gdx=sqrt(garea1) + + if (opt_sfc == 1 .or. opt_sfc == 2) then + loop3: do iter = 1, niterb ! begin stability iteration ! if(iter == 1) then @@ -4454,8 +4710,83 @@ subroutine bare_flux (parameters,nsnow ,nsoil ,isnow ,dt ,sag , & qfx = (qsfc-qair)*cev*gamma/cpair end do loop3 ! end stability iteration + endif ! opt_sfc 1/2 ! ----------------------------------------------------------------- + if (opt_sfc == 3) then + + do iter = 1, niter !1 or 2; depending on ur + + if(thsfc_loc) then ! Use local potential temperature + tvsb = tgb * virtfacb + else ! Use potential temperature referenced to 1000 hPa + tvsb = tgb/prsik1x * virtfacb + endif + + call stability & + (zlvlb, zvfun1, gdx,tv1b,thv1b, ur, z0m, z0h, tvsb, grav,thsfc_loc, & + rb1b, fm,fh,fm10,fh2,cm,ch,stress1b,fv) + + + ramb = max(1.,1./(cm*ur)) + rahb = max(1.,1./(ch*ur)) + rawb = rahb + +!jref - variables for diagnostics + emb = 1./ramb + ehb = 1./rahb + +! es and d(es)/dt evaluated at tg + + t = tdc(tgb) + call esat(t, esatw, esati, dsatw, dsati) + if (t .gt. 0.) then + estg = esatw + destg = dsatw + else + estg = esati + destg = dsati + end if + + csh = rhoair*cpair/rahb + cev = rhoair*cpair/gamma/(rsurf+rawb) + +! surface fluxes and dtg + + irb = cir * tgb**4 - emg*lwdn + shb = csh * (tgb - sfctmp ) + evb = cev * (estg*rhsur - eair ) + ghb = cgh * (tgb - stc(isnow+1)) + + b = sag-irb-shb-evb-ghb+pahb + a = 4.*cir*tgb**3 + csh + cev*destg + cgh + dtg = b/a + + irb = irb + 4.*cir*tgb**3*dtg + shb = shb + csh*dtg + evb = evb + cev*destg*dtg + ghb = ghb + cgh*dtg + +! update ground surface temperature + tgb = tgb + dtg + +! for m-o length +! h = csh * (tgb - sfctmp) + + t = tdc(tgb) + call esat(t, esatw, esati, dsatw, dsati) + if (t .gt. 0.) then + estg = esatw + else + estg = esati + end if + qsfc = 0.622*(estg*rhsur)/(psfc-0.378*(estg*rhsur)) + + qfx = (qsfc-qair)*cev*gamma/cpair + + end do ! end stability iteration + endif ! sfcdiff3 + ! if snow on ground and tg > tfrz: reset tg = tfrz. reevaluate ground fluxes. if(opt_stc == 1 .or. opt_stc == 3) then @@ -4476,7 +4807,7 @@ subroutine bare_flux (parameters,nsnow ,nsoil ,isnow ,dt ,sag , & !jref:start; errors in original equation corrected. ! 2m air temperature - if(opt_sfc == 1 .or. opt_sfc ==2) then + if(opt_sfc == 1 .or. opt_sfc ==2 .or. opt_sfc == 3) then ehb2 = fv*vkc/log((2.+z0h)/z0h) ehb2 = fv*vkc/(log((2.+z0h)/z0h)-fh2) cq2b = ehb2 diff --git a/physics/sfc_noahmp_drv.F90 b/physics/sfc_noahmp_drv.F90 index 8442e8782..f51301473 100644 --- a/physics/sfc_noahmp_drv.F90 +++ b/physics/sfc_noahmp_drv.F90 @@ -319,7 +319,7 @@ subroutine noahmpdrv_run & real(kind=kind_phys), dimension(:) , intent(out) :: wet1 ! normalized surface soil saturated fraction real(kind=kind_phys), dimension(:) , intent(out) :: t2mmp ! combined T2m from tiles real(kind=kind_phys), dimension(:) , intent(out) :: q2mp ! combined q2m from tiles - real(kind=kind_phys), dimension(:) , intent(out) :: zvfun + real(kind=kind_phys), dimension(:) , intent(out) :: zvfun ! character(len=*) , intent(out) :: errmsg integer , intent(out) :: errflg @@ -350,6 +350,7 @@ subroutine noahmpdrv_run & real (kind=kind_phys), dimension( 1:nsoil) :: soil_interface_depth ! in | soil layer-bottom depth from surface [m] integer :: max_snow_levels ! in | maximum number of snow levels real (kind=kind_phys) :: vegetation_frac ! in | vegetation fraction [0.0-1.0] + real (kind=kind_phys) :: area_grid ! in | real (kind=kind_phys) :: max_vegetation_frac ! in | annual maximum vegetation fraction [0.0-1.0] integer :: vegetation_category ! in | vegetation category integer :: ice_flag ! in | ice flag (1->ice) @@ -385,6 +386,7 @@ subroutine noahmpdrv_run & real (kind=kind_phys), dimension( 1:nsoil) :: soil_moisture_vol ! inout | volumetric soil moisture (ice + liq.) [m3/m3] real (kind=kind_phys) :: surface_temperature ! out | surface aerodynamic temp + real (kind=kind_phys) :: zvfun1 ! out | real (kind=kind_phys) :: temperature_canopy_air! inout | canopy air tmeperature [K] real (kind=kind_phys) :: vapor_pres_canopy_air ! inout | canopy air vapor pressure [Pa] @@ -498,6 +500,9 @@ subroutine noahmpdrv_run & real (kind=kind_phys) :: leaf_air_resistance ! out | leaf boundary layer resistance [s/m] real (kind=kind_phys) :: ustarx ! inout |surface friction velocity + real (kind=kind_phys) :: prslkix ! in exner function + real (kind=kind_phys) :: prsik1x ! in exner function + real (kind=kind_phys) :: prslk1x ! in exner function ! ! --- local variable @@ -586,6 +591,11 @@ subroutine noahmpdrv_run & air_pressure_forcing = prsl1(i) uwind_forcing = u1(i) vwind_forcing = v1(i) + area_grid = garea(i) + + prslkix = prslki(i) + prsik1x = prsik1(i) + prslk1x = prslk1(i) spec_humidity_forcing = max(q1(i), 1.e-8) ! specific humidity at level 1 (kg/kg) virtual_temperature = temperature_forcing * & @@ -704,7 +714,7 @@ subroutine noahmpdrv_run & ice_flag = -1 temperature_soil_bot = min(temperature_soil_bot,263.15) - call noahmp_options_glacier(iopt_alb, iopt_snf, iopt_tbot, iopt_stc, iopt_gla ) + call noahmp_options_glacier(iopt_alb, iopt_snf, iopt_tbot, iopt_stc, iopt_gla, iopt_sfc ) call noahmp_glacier ( & i_location ,1 ,cosine_zenith ,nsnow , & @@ -712,6 +722,7 @@ subroutine noahmpdrv_run & temperature_forcing ,air_pressure_forcing ,uwind_forcing ,vwind_forcing , & spec_humidity_forcing,sw_radiation_forcing ,precipitation_forcing,radiation_lw_forcing , & temperature_soil_bot ,forcing_height ,snow_ice_frac_old ,zsoil , & + thsfc_loc,prslkix ,prsik1x ,prslk1x,vegetation_frac,area_grid , & snowfall ,snow_water_equiv_old ,snow_albedo_old , & cm_noahmp ,ch_noahmp ,snow_levels ,snow_water_equiv , & soil_moisture_vol ,interface_depth ,snow_depth ,snow_level_ice , & @@ -724,9 +735,9 @@ subroutine noahmpdrv_run & z0h_total , & emissivity_total ,precip_frozen_frac ,ch_bare_ground_2m ,snow_sublimation , & #ifdef CCPP - albedo_direct ,albedo_diffuse ,errmsg ,errflg ) + albedo_direct ,albedo_diffuse,zvfun1, errmsg ,errflg ) #else - albedo_direct ,albedo_diffuse ) + albedo_direct ,albedo_diffuse,zvfun1 ) #endif #ifdef CCPP @@ -768,6 +779,7 @@ subroutine noahmpdrv_run & q2mp(i) = spec_humidity_bare_2m tskin(i) = temperature_ground + zvfun(i) = zvfun1 else ! not glacier @@ -782,12 +794,14 @@ subroutine noahmpdrv_run & ice_flag ,surface_type ,crop_type , & eq_soil_water_vol ,temperature_forcing ,air_pressure_forcing , & air_pressure_surface ,uwind_forcing ,vwind_forcing , & - spec_humidity_forcing ,cloud_water_forcing ,sw_radiation_forcing , & - radiation_lw_forcing ,precip_convective , & + spec_humidity_forcing ,area_grid, cloud_water_forcing , & + sw_radiation_forcing ,radiation_lw_forcing , & + thsfc_loc, prslkix,prsik1x,prslk1x , & + precip_convective , & precip_non_convective ,precip_sh_convective ,precip_snow , & precip_graupel ,precip_hail ,temperature_soil_bot , & co2_air ,o2_air ,foliage_nitrogen , & - snow_ice_frac_old , & + snow_ice_frac_old , & forcing_height ,snow_albedo_old ,snow_water_equiv_old , & temperature_snow_soil ,soil_liquid_vol ,soil_moisture_vol , & temperature_canopy_air,vapor_pres_canopy_air ,canopy_wet_fraction , & @@ -817,7 +831,8 @@ subroutine noahmpdrv_run & albedo_total ,snowmelt_out ,snowmelt_shallow , & snowmelt_shallow_1 ,snowmelt_shallow_2 ,rs_sunlit , & rs_shaded ,albedo_direct ,albedo_diffuse , & - albedo_direct_snow ,albedo_diffuse_snow ,canopy_gap_fraction , & + albedo_direct_snow ,albedo_diffuse_snow ,zvfun1 , & + canopy_gap_fraction , & incanopy_gap_fraction ,ch_vegetated ,ch_bare_ground , & emissivity_total ,sensible_heat_grd_veg ,sensible_heat_leaf , & sensible_heat_grd_bar ,latent_heat_grd_veg ,latent_heat_grd_bare , & @@ -846,6 +861,7 @@ subroutine noahmpdrv_run & spec_humidity_bare_2m * (1-vegetation_fraction) tskin(i) = surface_temperature + zvfun(i) = zvfun1 endif ! glacial split ends @@ -901,7 +917,7 @@ subroutine noahmpdrv_run & snowc (i) = snow_cover_fraction sncovr1 (i) = snow_cover_fraction - qsurf (i) = spec_humidity_surface +! qsurf (i) = spec_humidity_surface tvxy (i) = temperature_leaf tgxy (i) = temperature_ground @@ -959,7 +975,7 @@ subroutine noahmpdrv_run & tem1 = (z0_total - z0lo) / (z0up - z0lo) tem1 = min(max(tem1, 0.0_kind_phys), 1.0_kind_phys) - tem2 = max(sigmaf(i), 0.1_kind_phys) + tem2 = max(vegetation_fraction, 0.1_kind_phys) zvfun(i) = sqrt(tem1 * tem2) gdx=sqrt(garea(i)) @@ -975,6 +991,7 @@ subroutine noahmpdrv_run & cmm (i) = cmxy(i) * wind(i) snwdph (i) = snow_depth * 1000.0 ! convert from m to mm; wait after the stability call + qsurf (i) = q1(i) + evap(i)/(con_hvap*density*ch(i)*wind(i)) ! ! --- change units for output From d43f063e1be36ae613ae260a8e0046b646edb65d Mon Sep 17 00:00:00 2001 From: Helin Wei Date: Thu, 9 Sep 2021 15:33:33 -0400 Subject: [PATCH 06/28] pass the right zvfun from noahmp to PBL --- physics/module_sf_noahmp_glacier.f90 | 17 +++++++---------- physics/module_sf_noahmplsm.f90 | 22 +++++++++------------- physics/sfc_noahmp_drv.F90 | 9 +++------ 3 files changed, 19 insertions(+), 29 deletions(-) diff --git a/physics/module_sf_noahmp_glacier.f90 b/physics/module_sf_noahmp_glacier.f90 index 15016bc72..2fef0bfd0 100644 --- a/physics/module_sf_noahmp_glacier.f90 +++ b/physics/module_sf_noahmp_glacier.f90 @@ -129,10 +129,10 @@ subroutine noahmp_glacier (& trad ,edir ,runsrf ,runsub ,sag ,albedo , & ! out : qsnbot ,ponding ,ponding1,ponding2,t2m,q2e,z0h_total , & ! out : #ifdef CCPP - emissi, fpice ,ch2b , esnow, albsnd, albsni,zvfun1, & + emissi, fpice ,ch2b , esnow, albsnd, albsni, & errmsg, errflg) #else - emissi, fpice ,ch2b , esnow, albsnd, albsni,zvfun1) + emissi, fpice ,ch2b , esnow, albsnd, albsni) #endif @@ -217,7 +217,6 @@ subroutine noahmp_glacier (& real (kind=kind_phys) , intent(out) :: esnow real (kind=kind_phys), dimension(1:2) , intent(out) :: albsnd !< snow albedo (direct) real (kind=kind_phys), dimension(1:2) , intent(out) :: albsni !< snow albedo (diffuse) - real (kind=kind_phys) , intent(out) :: zvfun1 #ifdef CCPP @@ -284,7 +283,7 @@ subroutine noahmp_glacier (& imelt ,snicev ,snliqv ,epore ,qmelt ,ponding, & !out sag ,fsa ,fsr ,fira ,fsh ,fgev , & !out trad ,t2m ,ssoil ,lathea ,q2e ,emissi, & !out - ch2b ,albsnd ,albsni ,z0h_total,zvfun1 ) !out + ch2b ,albsnd ,albsni ,z0h_total) !out #ifdef CCPP if (errflg /= 0) return @@ -415,7 +414,7 @@ subroutine energy_glacier (nsnow ,nsoil ,isnow ,dt ,qsnow ,rhoair , & !i imelt ,snicev ,snliqv ,epore ,qmelt ,ponding, & !out sag ,fsa ,fsr ,fira ,fsh ,fgev , & !out trad ,t2m ,ssoil ,lathea ,q2e ,emissi, & !out - ch2b ,albsnd ,albsni ,z0h_total,zvfun1 ) !out + ch2b ,albsnd ,albsni ,z0h_total) !out ! -------------------------------------------------------------------------------------------------- ! -------------------------------------------------------------------------------------------------- @@ -498,7 +497,6 @@ subroutine energy_glacier (nsnow ,nsoil ,isnow ,dt ,qsnow ,rhoair , & !i real (kind=kind_phys), dimension(1:2) , intent(out) :: albsnd !< snow albedo (direct) real (kind=kind_phys), dimension(1:2) , intent(out) :: albsni !< snow albedo (diffuse) real (kind=kind_phys) , intent(out) :: z0h_total !< roughness length for heat - real (kind=kind_phys) , intent(out) :: zvfun1 ! local @@ -569,7 +567,7 @@ subroutine energy_glacier (nsnow ,nsoil ,isnow ,dt ,qsnow ,rhoair , & !i cm ,ch ,tg ,qsfc , & !inout #endif fira ,fsh ,fgev ,ssoil , & !out - t2m ,q2e ,ch2b ,z0h_total,zvfun1) !out + t2m ,q2e ,ch2b ,z0h_total) !out !energy balance at surface: sag=(irb+shb+evb+ghb) @@ -1005,7 +1003,7 @@ subroutine glacier_flux (nsoil ,nsnow ,emg ,isnow ,df ,dzsnso ,z cm ,ch ,tgb ,qsfc , & !inout #endif irb ,shb ,evb ,ghb , & !out - t2mb ,q2b ,ehb2 ,z0h_total,zvfun1) !out + t2mb ,q2b ,ehb2 ,z0h_total) !out ! -------------------------------------------------------------------------------------------------- ! use newton-raphson iteration to solve ground (tg) temperature @@ -1073,7 +1071,6 @@ subroutine glacier_flux (nsoil ,nsnow ,emg ,isnow ,df ,dzsnso ,z real (kind=kind_phys), intent(out) :: q2b !< bare ground heat conductance real (kind=kind_phys), intent(out) :: ehb2 !< sensible heat conductance for diagnostics real (kind=kind_phys), intent(out) :: z0h_total !< roughness length for heat - real (kind=kind_phys), intent(out) :: zvfun1 ! ! local variables @@ -1113,7 +1110,7 @@ subroutine glacier_flux (nsoil ,nsnow ,emg ,isnow ,df ,dzsnso ,z real(kind=kind_phys) :: reyni ! roughness Reynolds # real(kind=kind_phys) :: virtfaci! virutal factor - real(kind=kind_phys) :: tem1,tem2,gdx + real(kind=kind_phys) :: tem1,tem2,zvfun1,gdx real(kind=kind_phys), parameter :: z0lo=0.1, z0up=1.0 real (kind=kind_phys) :: moz !< monin-obukhov stability parameter diff --git a/physics/module_sf_noahmplsm.f90 b/physics/module_sf_noahmplsm.f90 index 810b904a7..222290245 100644 --- a/physics/module_sf_noahmplsm.f90 +++ b/physics/module_sf_noahmplsm.f90 @@ -398,7 +398,7 @@ subroutine noahmp_sflx (parameters, & runsrf , runsub , apar , psn , sav , sag , & ! out : fsno , nee , gpp , npp , fveg , albedo , & ! out : qsnbot , ponding , ponding1, ponding2, rssun , rssha , & ! out : - albd , albi , albsnd , albsni , zvfun1 , & ! out : + albd , albi , albsnd , albsni , & ! out : bgap , wgap , chv , chb , emissi , & ! out : shg , shc , shb , evg , evb , ghv , & ! out : ghb , irg , irc , irb , tr , evc , & ! out : @@ -536,7 +536,6 @@ subroutine noahmp_sflx (parameters, & real (kind=kind_phys) , intent(out) :: ponding1!< surface ponding [mm] real (kind=kind_phys) , intent(out) :: ponding2!< surface ponding [mm] real (kind=kind_phys) , intent(out) :: esnow - real (kind=kind_phys) , intent(out) :: zvfun1 real (kind=kind_phys) , intent(out) :: rb !< leaf boundary layer resistance (s/m) real (kind=kind_phys) , intent(out) :: laisun !< sunlit leaf area index (m2/m2) real (kind=kind_phys) , intent(out) :: laisha !< shaded leaf area index (m2/m2) @@ -778,7 +777,7 @@ subroutine noahmp_sflx (parameters, & sav ,sag ,qmelt ,fsa ,fsr ,taux , & !out tauy ,fira ,fsh ,fcev ,fgev ,fctr , & !out trad ,psn ,apar ,ssoil ,btrani ,btran , & !out - ponding,ts ,latheav , latheag , frozen_canopy,frozen_ground,zvfun1, & !out + ponding,ts ,latheav , latheag , frozen_canopy,frozen_ground, & !out tv ,tg ,stc ,snowh ,eah ,tah , & !inout sneqvo ,sneqv ,sh2o ,smc ,snice ,snliq , & !inout albold ,cm ,ch ,dx ,dz8w ,q2 , & !inout @@ -1609,7 +1608,7 @@ subroutine energy (parameters,ice ,vegtyp ,ist ,nsnow ,nsoil , & !in sav ,sag ,qmelt ,fsa ,fsr ,taux , & !out tauy ,fira ,fsh ,fcev ,fgev ,fctr , & !out trad ,psn ,apar ,ssoil ,btrani ,btran , & !out - ponding,ts ,latheav , latheag , frozen_canopy,frozen_ground,zvfun1, & !out + ponding,ts ,latheav , latheag , frozen_canopy,frozen_ground, & !out tv ,tg ,stc ,snowh ,eah ,tah , & !inout sneqvo ,sneqv ,sh2o ,smc ,snice ,snliq , & !inout albold ,cm ,ch ,dx ,dz8w ,q2 , & !inout @@ -1755,7 +1754,6 @@ subroutine energy (parameters,ice ,vegtyp ,ist ,nsnow ,nsoil , & !in real (kind=kind_phys) , intent(out) :: latheav !latent heat vap./sublimation (j/kg) real (kind=kind_phys) , intent(out) :: latheag !latent heat vap./sublimation (j/kg) real (kind=kind_phys) , intent(out) :: ts !surface temperature (k) - real (kind=kind_phys) , intent(out) :: zvfun1 logical , intent(out) :: frozen_ground ! used to define latent heat pathway logical , intent(out) :: frozen_canopy ! used to define latent heat pathway @@ -2168,7 +2166,7 @@ subroutine energy (parameters,ice ,vegtyp ,ist ,nsnow ,nsoil , & !in #endif tauxv ,tauyv ,irg ,irc ,shg , & !out shc ,evg ,evc ,tr ,ghv , & !out - t2mv ,psnsun ,psnsha ,csigmaf1,zvfun1 , & !out + t2mv ,psnsun ,psnsha ,csigmaf1, & !out !jref:start qc ,qsfc ,psfc , & !in q2v ,chv2, chleaf, chuc) !inout @@ -2198,7 +2196,7 @@ subroutine energy (parameters,ice ,vegtyp ,ist ,nsnow ,nsoil , & !in #else tgb ,cmb ,chb, ustarx, & !inout #endif - tauxb ,tauyb ,irb ,shb ,evb,csigmaf0,zvfun1,& !out + tauxb ,tauyb ,irb ,shb ,evb,csigmaf0,& !out ghb ,t2mb ,dx ,dz8w ,vegtyp , & !out !jref:start qc ,qsfc ,psfc , & !in @@ -3610,7 +3608,7 @@ subroutine vege_flux(parameters,nsnow ,nsoil ,isnow ,vegtyp ,veg , & #endif tauxv ,tauyv ,irg ,irc ,shg , & !out shc ,evg ,evc ,tr ,gh , & !out - t2mv ,psnsun ,psnsha ,csigmaf1,zvfun1 , & !out + t2mv ,psnsun ,psnsha ,csigmaf1, & !out qc ,qsfc ,psfc , & !in q2v ,cah2 ,chleaf ,chuc ) !inout @@ -3729,7 +3727,6 @@ subroutine vege_flux(parameters,nsnow ,nsoil ,isnow ,vegtyp ,veg , & real (kind=kind_phys), intent(out) :: psnsun !sunlit leaf photosynthesis (umolco2/m2/s) real (kind=kind_phys), intent(out) :: psnsha !shaded leaf photosynthesis (umolco2/m2/s) real (kind=kind_phys), intent(out) :: csigmaf1 - real (kind=kind_phys), intent(out) :: zvfun1 real (kind=kind_phys), intent(out) :: chleaf !leaf exchange coefficient real (kind=kind_phys), intent(out) :: chuc !under canopy exchange coefficient @@ -3834,7 +3831,7 @@ subroutine vege_flux(parameters,nsnow ,nsoil ,isnow ,vegtyp ,veg , & real (kind=kind_phys) :: laisune !sunlit leaf area index, one-sided (m2/m2),effective real (kind=kind_phys) :: laishae !shaded leaf area index, one-sided (m2/m2),effective - real(kind=kind_phys) :: tem1,tem2,gdx + real(kind=kind_phys) :: tem1,tem2,zvfun1,gdx real(kind=kind_phys), parameter :: z0lo=0.1, z0up=1.0 integer :: k !index @@ -4368,7 +4365,7 @@ subroutine bare_flux (parameters,nsnow ,nsoil ,isnow ,dt ,sag , & #else tgb ,cm ,ch,ustarx, & !inout #endif - tauxb ,tauyb ,irb ,shb ,evb,csigmaf0,zvfun1,& !out + tauxb ,tauyb ,irb ,shb ,evb,csigmaf0,& !out ghb ,t2mb ,dx ,dz8w ,ivgtyp , & !out qc ,qsfc ,psfc , & !in sfcprs ,q2b ,ehb2 ) !in @@ -4454,7 +4451,6 @@ subroutine bare_flux (parameters,nsnow ,nsoil ,isnow ,dt ,sag , & real (kind=kind_phys), intent(out) :: ghb !ground heat flux (w/m2) [+ to soil] real (kind=kind_phys), intent(out) :: t2mb !2 m height air temperature (k) real (kind=kind_phys), intent(out) :: csigmaf0 ! - real (kind=kind_phys), intent(out) :: zvfun1 ! !jref:start real (kind=kind_phys), intent(out) :: q2b !bare ground heat conductance real (kind=kind_phys) :: ehb !bare ground heat conductance @@ -4539,7 +4535,7 @@ subroutine bare_flux (parameters,nsnow ,nsoil ,isnow ,dt ,sag , & real (kind=kind_phys) :: fh2 !monin-obukhov heat adjustment at 2m real (kind=kind_phys) :: ch2 !surface exchange at 2m - real(kind=kind_phys) :: tem1,tem2,gdx + real(kind=kind_phys) :: tem1,tem2,zvfun1,gdx real(kind=kind_phys), parameter :: z0lo=0.1, z0up=1.0 integer :: iter !iteration index diff --git a/physics/sfc_noahmp_drv.F90 b/physics/sfc_noahmp_drv.F90 index f51301473..2b17e9e46 100644 --- a/physics/sfc_noahmp_drv.F90 +++ b/physics/sfc_noahmp_drv.F90 @@ -386,7 +386,6 @@ subroutine noahmpdrv_run & real (kind=kind_phys), dimension( 1:nsoil) :: soil_moisture_vol ! inout | volumetric soil moisture (ice + liq.) [m3/m3] real (kind=kind_phys) :: surface_temperature ! out | surface aerodynamic temp - real (kind=kind_phys) :: zvfun1 ! out | real (kind=kind_phys) :: temperature_canopy_air! inout | canopy air tmeperature [K] real (kind=kind_phys) :: vapor_pres_canopy_air ! inout | canopy air vapor pressure [Pa] @@ -735,9 +734,9 @@ subroutine noahmpdrv_run & z0h_total , & emissivity_total ,precip_frozen_frac ,ch_bare_ground_2m ,snow_sublimation , & #ifdef CCPP - albedo_direct ,albedo_diffuse,zvfun1, errmsg ,errflg ) + albedo_direct ,albedo_diffuse, errmsg ,errflg ) #else - albedo_direct ,albedo_diffuse,zvfun1 ) + albedo_direct ,albedo_diffuse,) #endif #ifdef CCPP @@ -779,7 +778,6 @@ subroutine noahmpdrv_run & q2mp(i) = spec_humidity_bare_2m tskin(i) = temperature_ground - zvfun(i) = zvfun1 else ! not glacier @@ -831,7 +829,7 @@ subroutine noahmpdrv_run & albedo_total ,snowmelt_out ,snowmelt_shallow , & snowmelt_shallow_1 ,snowmelt_shallow_2 ,rs_sunlit , & rs_shaded ,albedo_direct ,albedo_diffuse , & - albedo_direct_snow ,albedo_diffuse_snow ,zvfun1 , & + albedo_direct_snow ,albedo_diffuse_snow , & canopy_gap_fraction , & incanopy_gap_fraction ,ch_vegetated ,ch_bare_ground , & emissivity_total ,sensible_heat_grd_veg ,sensible_heat_leaf , & @@ -861,7 +859,6 @@ subroutine noahmpdrv_run & spec_humidity_bare_2m * (1-vegetation_fraction) tskin(i) = surface_temperature - zvfun(i) = zvfun1 endif ! glacial split ends From 714af14a2b14f4e9a3a59c9b1667a865000f2243 Mon Sep 17 00:00:00 2001 From: Helin Wei Date: Mon, 13 Sep 2021 14:00:42 -0400 Subject: [PATCH 07/28] correct the inout issue of smc in sflx.f --- physics/sflx.f | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/physics/sflx.f b/physics/sflx.f index 2740a70ff..8a8849448 100644 --- a/physics/sflx.f +++ b/physics/sflx.f @@ -1432,9 +1432,9 @@ subroutine nopac & zsoil, slope, frzx, bexp, dksat, dwsat, shdfac, & & edir1, ec1, et1, & ! --- input/outputs: - & cmc, sh2o, & + & cmc, sh2o, smc, & ! --- outputs: - & smc, runoff1, runoff2, runoff3, drip & + & runoff1, runoff2, runoff3, drip & & ) else @@ -1455,9 +1455,9 @@ subroutine nopac & zsoil, slope, frzx, bexp, dksat, dwsat, shdfac, & & edir1, ec1, et1, & ! --- input/outputs: - & cmc, sh2o, & + & cmc, sh2o, smc, & ! --- outputs: - & smc, runoff1, runoff2, runoff3, drip & + & runoff1, runoff2, runoff3, drip & & ) endif ! end if_etp_block @@ -2722,9 +2722,9 @@ subroutine snopac & zsoil, slope, frzx, bexp, dksat, dwsat, shdfac, & & edir1, ec1, et1, & ! --- input/outputs: - & cmc, sh2o, & + & cmc, sh2o, smc, & ! --- outputs: - & smc, runoff1, runoff2, runoff3, drip & + & runoff1, runoff2, runoff3, drip & & ) endif @@ -3447,9 +3447,9 @@ subroutine smflx & & zsoil, slope, frzx, bexp, dksat, dwsat, shdfac, & & edir1, ec1, et1, & ! --- input/outputs: - & cmc, sh2o, & + & cmc, sh2o, smc, & ! --- outputs: - & smc, runoff1, runoff2, runoff3, drip & + & runoff1, runoff2, runoff3, drip & & ) ! ===================================================================== ! @@ -3488,9 +3488,9 @@ subroutine smflx & ! input/outputs: ! ! cmc - real, canopy moisture content 1 ! ! sh2o - real, unfrozen soil moisture nsoil ! +! smc - real, total soil moisture nsoil ! ! ! ! outputs: ! -! smc - real, total soil moisture nsoil ! ! runoff1 - real, surface runoff not infiltrating sfc 1 ! ! runoff2 - real, sub surface runoff (baseflow) 1 ! ! runoff3 - real, excess of porosity 1 ! From 34ce3e39d60d26f83a0b8f8c595c496e98aefbea Mon Sep 17 00:00:00 2001 From: Helin Wei Date: Thu, 16 Sep 2021 22:49:33 -0400 Subject: [PATCH 08/28] remove some false values over the glacial ice --- physics/sfc_noahmp_drv.F90 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/physics/sfc_noahmp_drv.F90 b/physics/sfc_noahmp_drv.F90 index 2b17e9e46..bc5b92350 100644 --- a/physics/sfc_noahmp_drv.F90 +++ b/physics/sfc_noahmp_drv.F90 @@ -766,6 +766,10 @@ subroutine noahmpdrv_run & soil_carbon_fast = undefined leaf_area_index = undefined stem_area_index = undefined + evaporation_canopy = undefined + transpiration = undefined + aquifer_water = undefined + precip_adv_heat_total = undefined soil_moisture_wtd = 0.0 recharge = 0.0 deep_recharge = 0.0 From 20d9116e2472d81f0ff6176942774efef6c8824d Mon Sep 17 00:00:00 2001 From: HelinWei-NOAA <48133472+HelinWei-NOAA@users.noreply.github.com> Date: Mon, 1 Nov 2021 08:39:45 -0400 Subject: [PATCH 09/28] Update rte-rrtmgp --- physics/rte-rrtmgp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/physics/rte-rrtmgp b/physics/rte-rrtmgp index 9588c7bd8..d9594c46c 160000 --- a/physics/rte-rrtmgp +++ b/physics/rte-rrtmgp @@ -1 +1 @@ -Subproject commit 9588c7bd89e4f51a924f766e313bc42830fb4479 +Subproject commit d9594c46c877a2ab8001f5cd37961efdcf08ad8e From 67a593c01adbab4dac64f9f329318d38b10094ad Mon Sep 17 00:00:00 2001 From: HelinWei-NOAA <48133472+HelinWei-NOAA@users.noreply.github.com> Date: Fri, 26 Nov 2021 13:15:30 -0500 Subject: [PATCH 10/28] Update GFS_surface_loop_control.meta update because of Noah MP --- physics/GFS_surface_loop_control.meta | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/physics/GFS_surface_loop_control.meta b/physics/GFS_surface_loop_control.meta index 048c836da..bf70ca315 100644 --- a/physics/GFS_surface_loop_control.meta +++ b/physics/GFS_surface_loop_control.meta @@ -14,6 +14,20 @@ dimensions = () type = integer intent = in +[lsm] + standard_name = control_for_land_surface_scheme + long_name = flag for land surface model + units = flag + dimensions = () + type = integer + intent = in +[lsm_noahmp] + standard_name = identifier_for_noahmp_land_surface_scheme + long_name = flag for NOAH MP land surface model + units = flag + dimensions = () + type = integer + intent = in [iter] standard_name = ccpp_loop_counter long_name = loop counter for subcycling loops in CCPP From 217e309d3af76eff52405d917baa376429fdd139 Mon Sep 17 00:00:00 2001 From: HelinWei-NOAA <48133472+HelinWei-NOAA@users.noreply.github.com> Date: Fri, 26 Nov 2021 13:36:12 -0500 Subject: [PATCH 11/28] Update GFS_surface_loop_control.meta update for the modification of the Noah MP physics --- physics/GFS_surface_loop_control.meta | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/physics/GFS_surface_loop_control.meta b/physics/GFS_surface_loop_control.meta index bf70ca315..03db1e5fa 100644 --- a/physics/GFS_surface_loop_control.meta +++ b/physics/GFS_surface_loop_control.meta @@ -83,6 +83,20 @@ dimensions = () type = integer intent = in +[lsm] + standard_name = control_for_land_surface_scheme + long_name = flag for land surface model + units = flag + dimensions = () + type = integer + intent = in +[lsm_noahmp] + standard_name = identifier_for_noahmp_land_surface_scheme + long_name = flag for NOAH MP land surface model + units = flag + dimensions = () + type = integer + intent = in [iter] standard_name = ccpp_loop_counter long_name = loop counter for subcycling loops in CCPP From 7fb5bad9e053a70036a5298a0fa3ec1283fed3c5 Mon Sep 17 00:00:00 2001 From: HelinWei-NOAA <48133472+HelinWei-NOAA@users.noreply.github.com> Date: Sun, 28 Nov 2021 20:09:05 -0500 Subject: [PATCH 12/28] Update GFS_surface_generic.F90 Make those three extra land outputs as Noah MP only --- physics/GFS_surface_generic.F90 | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/physics/GFS_surface_generic.F90 b/physics/GFS_surface_generic.F90 index 407528282..370a5da29 100644 --- a/physics/GFS_surface_generic.F90 +++ b/physics/GFS_surface_generic.F90 @@ -275,7 +275,7 @@ end subroutine GFS_surface_generic_post_finalize !! \htmlinclude GFS_surface_generic_post_run.html !! subroutine GFS_surface_generic_post_run (im, cplflx, cplchm, cplwav, lssav, dry, icy, wet, & - dtf, ep1d, gflx, tgrs_1, qgrs_1, ugrs_1, vgrs_1, & + lsm,lsm_noahmp, ep1d, gflx, tgrs_1, qgrs_1, ugrs_1, vgrs_1, & adjsfcdlw, adjsfcdsw, adjnirbmd, adjnirdfd, adjvisbmd, adjvisdfd, adjsfculw, adjsfculw_wat, adjnirbmu, adjnirdfu, & adjvisbmu, adjvisdfu,t2m, q2m, u10m, v10m, tsfc, tsfc_wat, pgr, xcosz, evbs, evcw, trans, sbsno, snowc, snohf,pah,pahi, & epi, gfluxi, t1, q1, u1, v1, dlwsfci_cpl, dswsfci_cpl, dlwsfc_cpl, dswsfc_cpl, dnirbmi_cpl, dnirdfi_cpl, dvisbmi_cpl, & @@ -290,6 +290,7 @@ subroutine GFS_surface_generic_post_run (im, cplflx, cplchm, cplwav, lssav, dry, integer, intent(in) :: im logical, intent(in) :: cplflx, cplchm, cplwav, lssav logical, dimension(:), intent(in) :: dry, icy, wet + integer, intent(in) :: lsm, lsm_noahmp real(kind=kind_phys), intent(in) :: dtf real(kind=kind_phys), dimension(:), intent(in) :: ep1d, gflx, tgrs_1, qgrs_1, ugrs_1, vgrs_1, adjsfcdlw, adjsfcdsw, & @@ -422,7 +423,6 @@ subroutine GFS_surface_generic_post_run (im, cplflx, cplchm, cplwav, lssav, dry, snowca(i) = snowca(i) + snowc(i) * dtf snohfa(i) = snohfa(i) + snohf(i) * dtf ep(i) = ep(i) + ep1d(i) * dtf - paha(i) = paha(i) + pah(i) * dtf ! --- ... total runoff is composed of drainage into water table and ! runoff at the surface and is accumulated in unit of meters @@ -431,7 +431,10 @@ subroutine GFS_surface_generic_post_run (im, cplflx, cplchm, cplwav, lssav, dry, tecan(i) = tecan(i) + ecan(i) * dtf tetran(i) = tetran(i) + etran(i) * dtf tedir(i) = tedir(i) + edir(i) * dtf - twa(i) = waxy(i) + if (lsm == lsm_noahmp) then + paha(i) = paha(i) + pah(i) * dtf + twa(i) = waxy(i) + endif enddo endif From 1dfc10c766336707dda7208ce6da7e355b1120d2 Mon Sep 17 00:00:00 2001 From: HelinWei-NOAA <48133472+HelinWei-NOAA@users.noreply.github.com> Date: Sun, 28 Nov 2021 20:13:42 -0500 Subject: [PATCH 13/28] Update GFS_surface_generic.meta Make those three extra land outputs as Noah MP only --- physics/GFS_surface_generic.meta | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/physics/GFS_surface_generic.meta b/physics/GFS_surface_generic.meta index 1757d8b30..4dcf394db 100644 --- a/physics/GFS_surface_generic.meta +++ b/physics/GFS_surface_generic.meta @@ -600,6 +600,20 @@ dimensions = (horizontal_loop_extent) type = logical intent = in +[lsm] + standard_name = control_for_land_surface_scheme + long_name = flag for land surface model + units = flag + dimensions = () + type = integer + intent = in +[lsm_noahmp] + standard_name = identifier_for_noahmp_land_surface_scheme + long_name = flag for NOAH MP land surface model + units = flag + dimensions = () + type = integer + intent = in [dtf] standard_name = timestep_for_dynamics long_name = dynamics timestep From 512001a6429e78162f21a9f4d4a2d92a5e80c04b Mon Sep 17 00:00:00 2001 From: wx20hw Date: Mon, 29 Nov 2021 14:06:48 +0000 Subject: [PATCH 14/28] update rte-rrtmgp repository --- physics/rte-rrtmgp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/physics/rte-rrtmgp b/physics/rte-rrtmgp index d9594c46c..9c51cb7c3 160000 --- a/physics/rte-rrtmgp +++ b/physics/rte-rrtmgp @@ -1 +1 @@ -Subproject commit d9594c46c877a2ab8001f5cd37961efdcf08ad8e +Subproject commit 9c51cb7c3e227c9e84c2bff29ce4f438c7a54ae6 From bca852eb50c58b980eb452e96b63f9f69cba1a5b Mon Sep 17 00:00:00 2001 From: HelinWei-NOAA <48133472+HelinWei-NOAA@users.noreply.github.com> Date: Mon, 29 Nov 2021 10:21:21 -0500 Subject: [PATCH 15/28] Update GFS_surface_generic.F90 formatting codes based on review --- physics/GFS_surface_generic.F90 | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/physics/GFS_surface_generic.F90 b/physics/GFS_surface_generic.F90 index 370a5da29..5aa506e81 100644 --- a/physics/GFS_surface_generic.F90 +++ b/physics/GFS_surface_generic.F90 @@ -275,14 +275,14 @@ end subroutine GFS_surface_generic_post_finalize !! \htmlinclude GFS_surface_generic_post_run.html !! subroutine GFS_surface_generic_post_run (im, cplflx, cplchm, cplwav, lssav, dry, icy, wet, & - lsm,lsm_noahmp, ep1d, gflx, tgrs_1, qgrs_1, ugrs_1, vgrs_1, & + lsm, lsm_noahmp, ep1d, gflx, tgrs_1, qgrs_1, ugrs_1, vgrs_1, & adjsfcdlw, adjsfcdsw, adjnirbmd, adjnirdfd, adjvisbmd, adjvisdfd, adjsfculw, adjsfculw_wat, adjnirbmu, adjnirdfu, & - adjvisbmu, adjvisdfu,t2m, q2m, u10m, v10m, tsfc, tsfc_wat, pgr, xcosz, evbs, evcw, trans, sbsno, snowc, snohf,pah,pahi, & + adjvisbmu, adjvisdfu, t2m, q2m, u10m, v10m, tsfc, tsfc_wat, pgr, xcosz, evbs, evcw, trans, sbsno, snowc, snohf, pah, pahi, & epi, gfluxi, t1, q1, u1, v1, dlwsfci_cpl, dswsfci_cpl, dlwsfc_cpl, dswsfc_cpl, dnirbmi_cpl, dnirdfi_cpl, dvisbmi_cpl, & dvisdfi_cpl, dnirbm_cpl, dnirdf_cpl, dvisbm_cpl, dvisdf_cpl, nlwsfci_cpl, nlwsfc_cpl, t2mi_cpl, q2mi_cpl, u10mi_cpl, & v10mi_cpl, tsfci_cpl, psurfi_cpl, nnirbmi_cpl, nnirdfi_cpl, nvisbmi_cpl, nvisdfi_cpl, nswsfci_cpl, nswsfc_cpl, nnirbm_cpl, & - nnirdf_cpl, nvisbm_cpl, nvisdf_cpl, gflux, evbsa, evcwa, transa, sbsnoa, snowca, snohfa, paha,ep,ecan,etran,edir,waxy, & - runoff, srunoff, runof, drain, tecan,tetran,tedir,twa,lheatstrg, h0facu, h0facs, zvfun, hflx, evap, hflxq, hffac, & + nnirdf_cpl, nvisbm_cpl, nvisdf_cpl, gflux, evbsa, evcwa, transa, sbsnoa, snowca, snohfa, paha, ep, ecan, etran, edir, waxy, & + runoff, srunoff, runof, drain, tecan, tetran, tedir, twa, lheatstrg, h0facu, h0facs, zvfun, hflx, evap, hflxq, hffac, & isot, ivegsrc, islmsk, vtype, stype, slope, vtype_save, stype_save, slope_save, errmsg, errflg) implicit none @@ -295,13 +295,14 @@ subroutine GFS_surface_generic_post_run (im, cplflx, cplchm, cplwav, lssav, dry, real(kind=kind_phys), dimension(:), intent(in) :: ep1d, gflx, tgrs_1, qgrs_1, ugrs_1, vgrs_1, adjsfcdlw, adjsfcdsw, & adjnirbmd, adjnirdfd, adjvisbmd, adjvisdfd, adjsfculw, adjsfculw_wat, adjnirbmu, adjnirdfu, adjvisbmu, adjvisdfu, & - t2m, q2m, u10m, v10m, tsfc, tsfc_wat, pgr, xcosz, evbs, evcw, trans, sbsno, snowc, snohf,pah,ecan,etran,edir,waxy + t2m, q2m, u10m, v10m, tsfc, tsfc_wat, pgr, xcosz, evbs, evcw, trans, sbsno, snowc, snohf, pah, ecan, etran, edir, & + waxy real(kind=kind_phys), dimension(:), intent(inout) :: epi, gfluxi, t1, q1, u1, v1, dlwsfci_cpl, dswsfci_cpl, dlwsfc_cpl, & dswsfc_cpl, dnirbmi_cpl, dnirdfi_cpl, dvisbmi_cpl, dvisdfi_cpl, dnirbm_cpl, dnirdf_cpl, dvisbm_cpl, dvisdf_cpl, & nlwsfci_cpl, nlwsfc_cpl, t2mi_cpl, q2mi_cpl, u10mi_cpl, v10mi_cpl, tsfci_cpl, psurfi_cpl, nnirbmi_cpl, nnirdfi_cpl, & nvisbmi_cpl, nvisdfi_cpl, nswsfci_cpl, nswsfc_cpl, nnirbm_cpl, nnirdf_cpl, nvisbm_cpl, nvisdf_cpl, gflux, evbsa, & - evcwa, transa, sbsnoa, snowca, snohfa, ep, paha,tecan,tetran,tedir,twa,pahi + evcwa, transa, sbsnoa, snowca, snohfa, ep, paha, tecan, tetran, tedir, twa, pahi real(kind=kind_phys), dimension(:), intent(inout) :: runoff, srunoff real(kind=kind_phys), dimension(:), intent(in) :: drain, runof @@ -334,7 +335,7 @@ subroutine GFS_surface_generic_post_run (im, cplflx, cplchm, cplwav, lssav, dry, do i=1,im epi(i) = ep1d(i) gfluxi(i) = gflx(i) - pahi(i) = pah(i) + pahi(i) = pah(i) t1(i) = tgrs_1(i) q1(i) = qgrs_1(i) u1(i) = ugrs_1(i) @@ -429,11 +430,11 @@ subroutine GFS_surface_generic_post_run (im, cplflx, cplchm, cplwav, lssav, dry, runoff(i) = runoff(i) + (drain(i)+runof(i)) * dtf srunoff(i) = srunoff(i) + runof(i) * dtf tecan(i) = tecan(i) + ecan(i) * dtf - tetran(i) = tetran(i) + etran(i) * dtf + tetran(i) = tetran(i) + etran(i) * dtf tedir(i) = tedir(i) + edir(i) * dtf if (lsm == lsm_noahmp) then - paha(i) = paha(i) + pah(i) * dtf - twa(i) = waxy(i) + paha(i) = paha(i) + pah(i) * dtf + twa(i) = waxy(i) endif enddo endif From 5886ba1c24f548f9431d92df4e5b785eee995c09 Mon Sep 17 00:00:00 2001 From: HelinWei-NOAA <48133472+HelinWei-NOAA@users.noreply.github.com> Date: Mon, 29 Nov 2021 10:25:01 -0500 Subject: [PATCH 16/28] Update GFS_surface_loop_control.F90 formatting codes based on review --- physics/GFS_surface_loop_control.F90 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/physics/GFS_surface_loop_control.F90 b/physics/GFS_surface_loop_control.F90 index e1ec2b2d7..775e533d2 100644 --- a/physics/GFS_surface_loop_control.F90 +++ b/physics/GFS_surface_loop_control.F90 @@ -22,7 +22,7 @@ end subroutine GFS_surface_loop_control_part1_finalize !! \section detailed Detailed Algorithm !! @{ - subroutine GFS_surface_loop_control_part1_run (im, lsm,lsm_noahmp, iter, & + subroutine GFS_surface_loop_control_part1_run (im, lsm, lsm_noahmp, iter, & wind, flag_guess, errmsg, errflg) use machine, only: kind_phys @@ -81,7 +81,7 @@ end subroutine GFS_surface_loop_control_part2_finalize !! \section detailed Detailed Algorithm !! @{ - subroutine GFS_surface_loop_control_part2_run (im,lsm,lsm_noahmp, iter,& + subroutine GFS_surface_loop_control_part2_run (im, lsm, lsm_noahmp, iter,& wind, flag_guess, flag_iter, dry, wet, icy, nstf_name1, errmsg, errflg) use machine, only: kind_phys @@ -115,7 +115,7 @@ subroutine GFS_surface_loop_control_part2_run (im,lsm,lsm_noahmp, iter,& if (iter == 1 .and. wind(i) < 2.0d0) then !if (dry(i) .or. (wet(i) .and. .not.icy(i) .and. nstf_name1 > 0)) then - if((dry(i).and.lsm /= lsm_noahmp) .or. (wet(i) .and. nstf_name1 > 0)) then + if((dry(i) .and. lsm /= lsm_noahmp) .or. (wet(i) .and. nstf_name1 > 0)) then flag_iter(i) = .true. endif endif From d5d0db32f9e61307ed384c60504a828b49a5517d Mon Sep 17 00:00:00 2001 From: HelinWei-NOAA <48133472+HelinWei-NOAA@users.noreply.github.com> Date: Mon, 29 Nov 2021 11:41:14 -0500 Subject: [PATCH 17/28] Update module_sf_noahmp_glacier.f90 formatting codes based on review --- physics/module_sf_noahmp_glacier.f90 | 243 ++++++++++++++------------- 1 file changed, 122 insertions(+), 121 deletions(-) diff --git a/physics/module_sf_noahmp_glacier.f90 b/physics/module_sf_noahmp_glacier.f90 index 2fef0bfd0..39a276c94 100644 --- a/physics/module_sf_noahmp_glacier.f90 +++ b/physics/module_sf_noahmp_glacier.f90 @@ -118,21 +118,21 @@ module noahmp_glacier_routines !>\ingroup NoahMP_LSM subroutine noahmp_glacier (& - iloc ,jloc ,cosz ,nsnow ,nsoil ,dt , & ! in : time/space/model-related - sfctmp ,sfcprs ,uu ,vv ,q2 ,soldn , & ! in : forcing - prcp ,lwdn ,tbot ,zlvl ,ficeold ,zsoil , & ! in : forcing - thsfc_loc,prslkix ,prsik1x ,prslk1x,sigmaf1,garea1 , & ! in : - qsnow ,sneqvo ,albold ,cm ,ch ,isnow , & ! in/out : - sneqv ,smc ,zsnso ,snowh ,snice ,snliq , & ! in/out : - tg ,stc ,sh2o ,tauss ,qsfc , & ! in/out : - fsa ,fsr ,fira ,fsh ,fgev ,ssoil , & ! out : - trad ,edir ,runsrf ,runsub ,sag ,albedo , & ! out : - qsnbot ,ponding ,ponding1,ponding2,t2m,q2e,z0h_total , & ! out : + iloc ,jloc ,cosz ,nsnow ,nsoil ,dt , & ! in : time/space/model-related + sfctmp ,sfcprs ,uu ,vv ,q2 ,soldn , & ! in : forcing + prcp ,lwdn ,tbot ,zlvl ,ficeold ,zsoil , & ! in : forcing + thsfc_loc ,prslkix ,prsik1x ,prslk1x ,sigmaf1 ,garea1 , & ! in : + qsnow ,sneqvo ,albold ,cm ,ch ,isnow , & ! in/out : + sneqv ,smc ,zsnso ,snowh ,snice ,snliq , & ! in/out : + tg ,stc ,sh2o ,tauss ,qsfc , & ! in/out : + fsa ,fsr ,fira ,fsh ,fgev ,ssoil , & ! out : + trad ,edir ,runsrf ,runsub ,sag ,albedo , & ! out : + qsnbot ,ponding ,ponding1 ,ponding2 ,t2m,q2e ,z0h_total , & ! out : #ifdef CCPP - emissi, fpice ,ch2b , esnow, albsnd, albsni, & - errmsg, errflg) + emissi ,fpice ,ch2b , esnow , albsnd , albsni , & + errmsg ,errflg) #else - emissi, fpice ,ch2b , esnow, albsnd, albsni) + emissi ,fpice ,ch2b , esnow. , albsnd , albsni) #endif @@ -268,22 +268,22 @@ subroutine noahmp_glacier (& ! compute energy budget (momentum & energy fluxes and phase changes) - call energy_glacier (nsnow ,nsoil ,isnow ,dt ,qsnow ,rhoair , & !in - eair ,sfcprs ,qair ,sfctmp ,lwdn ,uu , & !in - vv ,solad ,solai ,cosz ,zlvl , & !in - tbot ,zbot ,zsnso ,dzsnso ,sigmaf1,garea1, & !in - thsfc_loc,prslkix ,prsik1x,prslk1x, & !in - tg ,stc ,snowh ,sneqv ,sneqvo ,sh2o , & !inout - smc ,snice ,snliq ,albold ,cm ,ch , & !inout + call energy_glacier (nsnow ,nsoil ,isnow ,dt ,qsnow ,rhoair , & !in + eair ,sfcprs ,qair ,sfctmp ,lwdn ,uu , & !in + vv ,solad ,solai ,cosz ,zlvl , & !in + tbot ,zbot ,zsnso ,dzsnso ,sigmaf1 ,garea1 , & !in + thsfc_loc ,prslkix ,prsik1x ,prslk1x , & !in + tg ,stc ,snowh ,sneqv ,sneqvo ,sh2o , & !inout + smc ,snice ,snliq ,albold ,cm ,ch , & !inout #ifdef CCPP - tauss ,qsfc ,errmsg ,errflg , & !inout + tauss ,qsfc ,errmsg ,errflg , & !inout #else - tauss ,qsfc , & !inout + tauss ,qsfc , & !inout #endif - imelt ,snicev ,snliqv ,epore ,qmelt ,ponding, & !out - sag ,fsa ,fsr ,fira ,fsh ,fgev , & !out - trad ,t2m ,ssoil ,lathea ,q2e ,emissi, & !out - ch2b ,albsnd ,albsni ,z0h_total) !out + imelt ,snicev ,snliqv ,epore ,qmelt ,ponding , & !out + sag ,fsa ,fsr ,fira ,fsh ,fgev , & !out + trad ,t2m ,ssoil ,lathea ,q2e ,emissi , & !out + ch2b ,albsnd ,albsni ,z0h_total) !out #ifdef CCPP if (errflg /= 0) return @@ -298,12 +298,12 @@ subroutine noahmp_glacier (& ! compute water budgets (water storages, et components, and runoff) - call water_glacier (nsnow ,nsoil ,imelt ,dt ,prcp ,sfctmp , & !in - qvap ,qdew ,ficeold,zsoil , & !in - isnow ,snowh ,sneqv ,snice ,snliq ,stc , & !inout - dzsnso ,sh2o ,sice ,ponding,zsnso ,fsh , & !inout - runsrf ,runsub ,qsnow ,ponding1 ,ponding2,qsnbot,fpice,esnow & !out - ) + call water_glacier (nsnow ,nsoil ,imelt ,dt ,prcp ,sfctmp , & !in + qvap ,qdew ,ficeold ,zsoil , & !in + isnow ,snowh ,sneqv ,snice ,snliq ,stc , & !inout + dzsnso ,sh2o ,sice ,ponding ,zsnso ,fsh , & !inout + runsrf ,runsub ,qsnow ,ponding1 ,ponding2 ,qsnbot , & !out + fpice ,esnow) !out if(opt_gla == 2) then edir = qvap - qdew @@ -320,7 +320,7 @@ subroutine noahmp_glacier (& call error_glacier (iloc ,jloc ,swdown ,fsa ,fsr ,fira , & fsh ,fgev ,ssoil ,sag ,prcp ,edir , & #ifdef CCPP - runsrf ,runsub ,sneqv ,dt ,beg_wb, errmsg, errflg ) + runsrf ,runsub ,sneqv ,dt ,beg_wb ,errmsg , errflg ) #else runsrf ,runsub ,sneqv ,dt ,beg_wb ) #endif @@ -399,22 +399,22 @@ end subroutine atm_glacier ! ================================================================================================== ! -------------------------------------------------------------------------------------------------- !>\ingroup NoahMP_LSM - subroutine energy_glacier (nsnow ,nsoil ,isnow ,dt ,qsnow ,rhoair , & !in - eair ,sfcprs ,qair ,sfctmp ,lwdn ,uu , & !in - vv ,solad ,solai ,cosz ,zref , & !in - tbot ,zbot ,zsnso ,dzsnso ,sigmaf1,garea1, & !in - thsfc_loc,prslkix ,prsik1x,prslk1x, & !in - tg ,stc ,snowh ,sneqv ,sneqvo ,sh2o , & !inout - smc ,snice ,snliq ,albold ,cm ,ch , & !inout + subroutine energy_glacier (nsnow ,nsoil ,isnow ,dt ,qsnow ,rhoair , & !in + eair ,sfcprs ,qair ,sfctmp ,lwdn ,uu , & !in + vv ,solad ,solai ,cosz ,zref , & !in + tbot ,zbot ,zsnso ,dzsnso ,sigmaf1 ,garea1 , & !in + thsfc_loc ,prslkix ,prsik1x ,prslk1x , & !in + tg ,stc ,snowh ,sneqv ,sneqvo ,sh2o , & !inout + smc ,snice ,snliq ,albold ,cm ,ch , & !inout #ifdef CCPP - tauss ,qsfc ,errmsg, errflg, & !inout + tauss ,qsfc ,errmsg ,errflg. , & !inout #else - tauss ,qsfc , & !inout + tauss ,qsfc , & !inout #endif - imelt ,snicev ,snliqv ,epore ,qmelt ,ponding, & !out - sag ,fsa ,fsr ,fira ,fsh ,fgev , & !out - trad ,t2m ,ssoil ,lathea ,q2e ,emissi, & !out - ch2b ,albsnd ,albsni ,z0h_total) !out + imelt ,snicev ,snliqv ,epore ,qmelt ,ponding , & !out + sag ,fsa ,fsr ,fira ,fsh ,fgev , & !out + trad ,t2m ,ssoil ,lathea ,q2e ,emissi , & !out + ch2b ,albsnd ,albsni ,z0h_total) !out ! -------------------------------------------------------------------------------------------------- ! -------------------------------------------------------------------------------------------------- @@ -538,7 +538,7 @@ subroutine energy_glacier (nsnow ,nsoil ,isnow ,dt ,qsnow ,rhoair , & !i call radiation_glacier (dt ,tg ,sneqvo ,sneqv ,cosz , & !in qsnow ,solad ,solai , & !in albold ,tauss , & !inout - sag ,fsr ,fsa , albsnd ,albsni) !out + sag ,fsr ,fsa ,albsnd ,albsni) !out ! vegetation and ground emissivity @@ -556,18 +556,18 @@ subroutine energy_glacier (nsnow ,nsoil ,isnow ,dt ,qsnow ,rhoair , & !i ! surface temperatures of the ground and energy fluxes - call glacier_flux (nsoil ,nsnow ,emg ,isnow ,df ,dzsnso ,z0mg , & !in - zlvl ,zpd ,qair ,sfctmp ,rhoair ,sfcprs , & !in - ur ,gamma ,rsurf ,lwdn ,rhsur ,smc , & !in - eair ,stc ,sag ,snowh ,lathea ,sh2o , & !in - thsfc_loc,prslkix,prsik1x ,prslk1x,sigmaf1,garea1 , & !in + call glacier_flux (nsoil ,nsnow ,emg ,isnow ,df ,dzsnso ,z0mg , & !in + zlvl ,zpd ,qair ,sfctmp ,rhoair ,sfcprs , & !in + ur ,gamma ,rsurf ,lwdn ,rhsur ,smc , & !in + eair ,stc ,sag ,snowh ,lathea ,sh2o , & !in + thsfc_loc ,prslkix ,prsik1x ,prslk1x ,sigmaf1 ,garea1 , & !in #ifdef CCPP - cm ,ch ,tg ,qsfc ,errmsg ,errflg , & !inout + cm ,ch ,tg ,qsfc ,errmsg ,errflg , & !inout #else - cm ,ch ,tg ,qsfc , & !inout + cm ,ch ,tg ,qsfc , & !inout #endif - fira ,fsh ,fgev ,ssoil , & !out - t2m ,q2e ,ch2b ,z0h_total) !out + fira ,fsh ,fgev ,ssoil , & !out + t2m ,q2e ,ch2b ,z0h_total) !out !energy balance at surface: sag=(irb+shb+evb+ghb) @@ -748,10 +748,10 @@ subroutine csnow_glacier (isnow ,nsnow ,nsoil ,snice ,snliq ,dzsnso , end subroutine csnow_glacier !=================================================================================================== !>\ingroup NoahMP_LSM - subroutine radiation_glacier (dt ,tg ,sneqvo ,sneqv ,cosz , & !in - qsnow ,solad ,solai , & !in - albold ,tauss , & !inout - sag ,fsr ,fsa,albsnd ,albsni) !out + subroutine radiation_glacier (dt ,tg ,sneqvo ,sneqv ,cosz , & !in + qsnow ,solad ,solai , & !in + albold ,tauss , & !inout + sag ,fsr ,fsa ,albsnd ,albsni) !out ! -------------------------------------------------------------------------------------------------- implicit none ! -------------------------------------------------------------------------------------------------- @@ -992,18 +992,18 @@ end subroutine snowalb_class_glacier !>\ingroup NoahMP_LSM !! use newton-raphson iteration to solve ground (tg) temperature !! that balances the surface energy budgets for glacier. - subroutine glacier_flux (nsoil ,nsnow ,emg ,isnow ,df ,dzsnso ,z0m , & !in - zlvl ,zpd ,qair ,sfctmp ,rhoair ,sfcprs , & !in - ur ,gamma ,rsurf ,lwdn ,rhsur ,smc , & !in - eair ,stc ,sag ,snowh ,lathea ,sh2o , & !in - thsfc_loc,prslkix,prsik1x ,prslk1x,sigmaf1,garea1 , & !in + subroutine glacier_flux (nsoil ,nsnow ,emg ,isnow ,df ,dzsnso ,z0m , & !in + zlvl ,zpd ,qair ,sfctmp ,rhoair ,sfcprs , & !in + ur ,gamma ,rsurf ,lwdn ,rhsur ,smc , & !in + eair ,stc ,sag ,snowh ,lathea ,sh2o , & !in + thsfc_loc ,prslkix ,prsik1x ,prslk1x ,sigmaf1 ,garea1 , & !in #ifdef CCPP - cm ,ch ,tgb ,qsfc ,errmsg ,errflg , & !inout + cm ,ch ,tgb ,qsfc ,errmsg ,errflg , & !inout #else - cm ,ch ,tgb ,qsfc , & !inout + cm ,ch ,tgb ,qsfc , & !inout #endif - irb ,shb ,evb ,ghb , & !out - t2mb ,q2b ,ehb2 ,z0h_total) !out + irb ,shb ,evb ,ghb , & !out + t2mb ,q2b ,ehb2 ,z0h_total) !out ! -------------------------------------------------------------------------------------------------- ! use newton-raphson iteration to solve ground (tg) temperature @@ -1355,7 +1355,7 @@ subroutine glacier_flux (nsoil ,nsnow ,emg ,isnow ,df ,dzsnso ,z t2mb = tgb q2b = qsfc else - t2mb = tgb - shb/(rhoair*cpair) * 1./ehb2 + t2mb = tgb - shb/(rhoair*cpair) * 1./ehb2 q2b = qsfc - evb/(lathea*rhoair)*(1./cq2b + rsurf) endif @@ -1418,14 +1418,15 @@ end subroutine esat ! ================================================================================================== !>\ingroup NoahMP_LSM !! compute surface drag coefficient cm for momentum and ch for heat - subroutine sfcdif1_glacier(iter ,zlvl ,zpd ,z0h ,z0m , & !in - qair ,sfctmp ,h ,rhoair ,mpe ,ur , & !in + subroutine sfcdif1_glacier(iter ,zlvl ,zpd ,z0h ,z0m , & !in + qair ,sfctmp ,h ,rhoair ,mpe ,ur , & !in #ifdef CCPP - & moz ,mozsgn ,fm ,fh ,fm2 ,fh2 ,errmsg ,errflg , & !inout + & moz ,mozsgn ,fm ,fh ,fm2 ,fh2 , & !inout + & errmsg ,errflg , & !inout #else - & moz ,mozsgn ,fm ,fh ,fm2 ,fh2 , & !inout + & moz ,mozsgn ,fm ,fh ,fm2 ,fh2 , & !inout #endif - & fv ,cm ,ch ,ch2 ) !out + & fv ,cm ,ch ,ch2 ) !out ! ------------------------------------------------------------------------------------------------- ! computing surface drag coefficient cm for momentum and ch for heat ! ------------------------------------------------------------------------------------------------- @@ -2261,12 +2262,12 @@ subroutine phasechange_glacier (nsnow ,nsoil ,isnow ,dt ,fact , & end subroutine phasechange_glacier ! ================================================================================================== !>\ingroup NoahMP_LSM - subroutine water_glacier (nsnow ,nsoil ,imelt ,dt ,prcp ,sfctmp , & !in - qvap ,qdew ,ficeold,zsoil , & !in - isnow ,snowh ,sneqv ,snice ,snliq ,stc , & !inout - dzsnso ,sh2o ,sice ,ponding,zsnso ,fsh , & !inout - runsrf ,runsub ,qsnow ,ponding1 ,ponding2,qsnbot,fpice,esnow & !out - ) !out + subroutine water_glacier (nsnow ,nsoil ,imelt ,dt ,prcp ,sfctmp , & !in + qvap ,qdew ,ficeold ,zsoil , & !in + isnow ,snowh ,sneqv ,snice ,snliq ,stc , & !inout + dzsnso ,sh2o ,sice ,ponding ,zsnso ,fsh , & !inout + runsrf ,runsub ,qsnow ,ponding1 ,ponding2 ,qsnbot , & !out + fpice. ,esnow) !out ! ---------------------------------------------------------------------- ! code history: ! initial code: guo-yue niu, oct. 2007 @@ -2385,13 +2386,13 @@ subroutine water_glacier (nsnow ,nsoil ,imelt ,dt ,prcp ,sfctmp , & !in qsnfro = qdew esnow = qsnsub*2.83e+6 - call snowwater_glacier (nsnow ,nsoil ,imelt ,dt ,sfctmp , & !in - snowhin,qsnow ,qsnfro ,qsnsub ,qrain , & !in - ficeold,zsoil , & !in - isnow ,snowh ,sneqv ,snice ,snliq , & !inout - sh2o ,sice ,stc ,dzsnso ,zsnso , & !inout - fsh , & !inout - qsnbot ,snoflow,ponding1 ,ponding2) !out + call snowwater_glacier (nsnow ,nsoil ,imelt ,dt ,sfctmp , & !in + snowhin ,qsnow ,qsnfro ,qsnsub ,qrain , & !in + ficeold ,zsoil , & !in + isnow ,snowh ,sneqv ,snice ,snliq , & !inout + sh2o ,sice ,stc ,dzsnso ,zsnso , & !inout + fsh , & !inout + qsnbot ,snoflow ,ponding1 ,ponding2) !out !ponding: melting water from snow when there is no layer @@ -2432,13 +2433,13 @@ end subroutine water_glacier ! ================================================================================================== ! ---------------------------------------------------------------------- !>\ingroup NoahMP_LSM - subroutine snowwater_glacier (nsnow ,nsoil ,imelt ,dt ,sfctmp , & !in - snowhin,qsnow ,qsnfro ,qsnsub ,qrain , & !in - ficeold,zsoil , & !in - isnow ,snowh ,sneqv ,snice ,snliq , & !inout - sh2o ,sice ,stc ,dzsnso ,zsnso , & !inout - fsh , & !inout - qsnbot ,snoflow,ponding1 ,ponding2) !out + subroutine snowwater_glacier (nsnow ,nsoil ,imelt ,dt ,sfctmp , & !in + snowhin ,qsnow ,qsnfro ,qsnsub ,qrain , & !in + ficeold ,zsoil , & !in + isnow ,snowh ,sneqv ,snice ,snliq , & !inout + sh2o ,sice ,stc ,dzsnso ,zsnso , & !inout + fsh , & !inout + qsnbot ,snoflow ,ponding1 ,ponding2) !out ! ---------------------------------------------------------------------- implicit none ! ---------------------------------------------------------------------- @@ -2450,8 +2451,8 @@ subroutine snowwater_glacier (nsnow ,nsoil ,imelt ,dt ,sfctmp , & !in real (kind=kind_phys), intent(in) :: sfctmp !< surface air temperature [k] real (kind=kind_phys), intent(in) :: snowhin!< snow depth increasing rate (m/s) real (kind=kind_phys), intent(in) :: qsnow !< snow at ground srf (mm/s) [+] - real (kind=kind_phys), intent(inout) :: qsnfro !< snow surface frost rate[mm/s] - real (kind=kind_phys), intent(inout) :: qsnsub !< snow surface sublimation rate[mm/s] + real (kind=kind_phys), intent(inout) :: qsnfro !< snow surface frost rate[mm/s] + real (kind=kind_phys), intent(inout) :: qsnsub !< snow surface sublimation rate[mm/s] real (kind=kind_phys), intent(in) :: qrain !< snow surface rain rate[mm/s] real (kind=kind_phys), dimension(-nsnow+1:0) , intent(in) :: ficeold!< ice fraction at last timestep real (kind=kind_phys), dimension( 1:nsoil), intent(in) :: zsoil !< layer-bottom depth from soil surf (m) @@ -2493,13 +2494,13 @@ subroutine snowwater_glacier (nsnow ,nsoil ,imelt ,dt ,sfctmp , & !in snliq ,imelt ,ficeold, & !in isnow ,dzsnso ) !inout - call combine_glacier (nsnow ,nsoil , & !in - isnow ,sh2o ,stc ,snice ,snliq , & !inout - dzsnso ,sice ,snowh ,sneqv , & !inout - ponding1 ,ponding2) !out + call combine_glacier (nsnow ,nsoil , & !in + isnow ,sh2o ,stc ,snice ,snliq , & !inout + dzsnso ,sice ,snowh ,sneqv , & !inout + ponding1 ,ponding2) !out - call divide_glacier (nsnow ,nsoil , & !in - isnow ,stc ,snice ,snliq ,dzsnso ) !inout + call divide_glacier (nsnow ,nsoil , & !in + isnow ,stc ,snice ,snliq ,dzsnso ) !inout end if !set empty snow layers to zero @@ -2512,12 +2513,12 @@ subroutine snowwater_glacier (nsnow ,nsoil ,imelt ,dt ,sfctmp , & !in zsnso(iz) = 0. enddo - call snowh2o_glacier (nsnow ,nsoil ,dt ,qsnfro ,qsnsub , & !in - qrain , & !in - isnow ,dzsnso ,snowh ,sneqv ,snice , & !inout - snliq ,sh2o ,sice ,stc , & !inout - ponding1 ,ponding2 ,fsh , & !inout - qsnbot ) !out + call snowh2o_glacier (nsnow ,nsoil ,dt ,qsnfro ,qsnsub , & !in + qrain , & !in + isnow ,dzsnso ,snowh ,sneqv ,snice , & !inout + snliq ,sh2o ,sice ,stc , & !inout + ponding1 ,ponding2 ,fsh , & !inout + qsnbot ) !out !to obtain equilibrium state of snow in glacier region @@ -2727,10 +2728,10 @@ subroutine compact_glacier (nsnow ,nsoil ,dt ,stc ,snice , & !in end subroutine compact_glacier ! ================================================================================================== !>\ingroup NoahMP_LSM - subroutine combine_glacier (nsnow ,nsoil , & !in - isnow ,sh2o ,stc ,snice ,snliq , & !inout - dzsnso ,sice ,snowh ,sneqv , & !inout - ponding1 ,ponding2) !inout + subroutine combine_glacier (nsnow ,nsoil , & !in + isnow ,sh2o ,stc ,snice ,snliq , & !inout + dzsnso ,sice ,snowh ,sneqv , & !inout + ponding1 ,ponding2) !inout ! ---------------------------------------------------------------------- implicit none ! ---------------------------------------------------------------------- @@ -3078,12 +3079,12 @@ subroutine divide_glacier (nsnow ,nsoil , & !in end subroutine divide_glacier ! ================================================================================================== !>\ingroup NoahMP_LSM - subroutine snowh2o_glacier (nsnow ,nsoil ,dt ,qsnfro ,qsnsub , & !in - qrain , & !in - isnow ,dzsnso ,snowh ,sneqv ,snice , & !inout - snliq ,sh2o ,sice ,stc , & !inout - ponding1 ,ponding2 ,fsh , & !inout - qsnbot ) !out + subroutine snowh2o_glacier (nsnow ,nsoil ,dt ,qsnfro ,qsnsub , & !in + qrain , & !in + isnow ,dzsnso ,snowh ,sneqv ,snice , & !inout + snliq ,sh2o ,sice ,stc , & !inout + ponding1 ,ponding2 ,fsh , & !inout + qsnbot ) !out ! ---------------------------------------------------------------------- !> renew the mass of ice lens (snice) and liquid (snliq) of the !! surface snow layer resulting from sublimation (frost) / evaporation (dew) @@ -3242,9 +3243,9 @@ end subroutine snowh2o_glacier subroutine error_glacier (iloc ,jloc ,swdown ,fsa ,fsr ,fira , & fsh ,fgev ,ssoil ,sag ,prcp ,edir , & #ifdef CCPP - runsrf ,runsub ,sneqv ,dt ,beg_wb, errmsg, errflg ) + runsrf ,runsub ,sneqv ,dt ,beg_wb, errmsg , errflg ) #else - runsrf ,runsub ,sneqv ,dt ,beg_wb ) + runsrf ,runsub ,sneqv ,dt ,beg_wb ) #endif ! -------------------------------------------------------------------------------------------------- !> check surface energy balance and water balance From 3c8f7ce0d29e03ee167b0e9d8cd627ef804080d0 Mon Sep 17 00:00:00 2001 From: HelinWei-NOAA <48133472+HelinWei-NOAA@users.noreply.github.com> Date: Mon, 29 Nov 2021 11:43:30 -0500 Subject: [PATCH 18/28] Update sfc_diag_post.F90 formatting codes based on review --- physics/sfc_diag_post.F90 | 9 --------- 1 file changed, 9 deletions(-) diff --git a/physics/sfc_diag_post.F90 b/physics/sfc_diag_post.F90 index e5c16a5c0..1194cef5c 100644 --- a/physics/sfc_diag_post.F90 +++ b/physics/sfc_diag_post.F90 @@ -42,15 +42,6 @@ subroutine sfc_diag_post_run (im, lsm, lsm_noahmp, dry, lssav, dtf, con_eps, con errmsg = '' errflg = 0 -! if (lsm == lsm_noahmp) then -! do i=1,im -! if(dry(i)) then -! t2m(i) = t2mmp(i) -! q2m(i) = q2mp(i) -! endif -! enddo -! endif - if (lssav) then do i=1,im tmpmax(i) = max(tmpmax(i),t2m(i)) From d250cbd132bc483468b33796d1a1171c540e61bb Mon Sep 17 00:00:00 2001 From: HelinWei-NOAA <48133472+HelinWei-NOAA@users.noreply.github.com> Date: Mon, 29 Nov 2021 11:55:26 -0500 Subject: [PATCH 19/28] Update sfc_noahmp_drv.F90 formatting codes based on review --- physics/sfc_noahmp_drv.F90 | 51 +++++++++++++++++++------------------- 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/physics/sfc_noahmp_drv.F90 b/physics/sfc_noahmp_drv.F90 index 5fc400088..dabff5386 100644 --- a/physics/sfc_noahmp_drv.F90 +++ b/physics/sfc_noahmp_drv.F90 @@ -111,15 +111,15 @@ subroutine noahmpdrv_run & shdmin, shdmax, snoalb, sfalb, flag_iter, & idveg, iopt_crs, iopt_btr, iopt_run, iopt_sfc, iopt_frz, & iopt_inf, iopt_rad, iopt_alb, iopt_snf, iopt_tbot, & - iopt_stc, xlatin, xcoszin, iyrlen, julian,garea, & + iopt_stc, xlatin, xcoszin, iyrlen, julian, garea, & rainn_mp, rainc_mp, snow_mp, graupel_mp, ice_mp, & con_hvap, con_cp, con_jcal, rhoh2o, con_eps, con_epsm1, & - con_fvirt, con_rd, con_hfus,thsfc_loc, & + con_fvirt, con_rd, con_hfus, thsfc_loc, & ! --- in/outs: weasd, snwdph, tskin, tprcp, srflag, smc, stc, slc, & canopy, trans, zorl, & - rb1,fm1,fh1,ustar1,stress1,fm101,fh21, & + rb1, fm1, fh1, ustar1, stress1, fm101, fh21, & ! --- Noah MP specific @@ -132,7 +132,7 @@ subroutine noahmpdrv_run & ! --- outputs: sncovr1, qsurf, gflux, drain, evap, hflx, ep, runoff, & - cmm, chh, evbs, evcw, sbsno, pah, ecan, etran, edir,snowc, & + cmm, chh, evbs, evcw, sbsno, pah, ecan, etran, edir, snowc,& stm, snohf,smcwlt2, smcref2, wet1, t2mmp, q2mp,zvfun, & errmsg, errflg) @@ -142,10 +142,10 @@ subroutine noahmpdrv_run & use sfc_diff, only : stability use module_sf_noahmplsm use module_sf_noahmp_glacier - use noahmp_tables, only : isice_table, co2_table, o2_table, & - isurban_table,smcref_table,smcdry_table, & - smcmax_table,co2_table,o2_table, & - saim_table,laim_table + use noahmp_tables, only : isice_table, co2_table, o2_table, & + isurban_table, smcref_table, smcdry_table, & + smcmax_table, co2_table, o2_table, & + saim_table, laim_table implicit none @@ -247,13 +247,13 @@ subroutine noahmpdrv_run & real(kind=kind_phys), dimension(:) , intent(inout) :: trans ! total plant transpiration [m/s] real(kind=kind_phys), dimension(:) , intent(inout) :: zorl ! surface roughness [cm] - real(kind=kind_phys), dimension(:) , intent(inout) :: rb1 ! bulk richardson # - real(kind=kind_phys), dimension(:) , intent(inout) :: fm1 ! Monin_Obukhov_silarity_function for momentum - real(kind=kind_phys), dimension(:) , intent(inout) :: fh1 ! Monin_Obukhov_silarity_function for heat - real(kind=kind_phys), dimension(:) , intent(inout) :: ustar1 ! friction velocity m s-1 - real(kind=kind_phys), dimension(:) , intent(inout) :: stress1 ! Wind stress m2 S-2 - real(kind=kind_phys), dimension(:) , intent(inout) :: fm101 ! MOS function for momentum evaulated @ 10 m - real(kind=kind_phys), dimension(:) , intent(inout) :: fh21 ! MOS function for heat evaulated @ 2m + real(kind=kind_phys), dimension(:) , intent(inout) :: rb1 ! bulk richardson # + real(kind=kind_phys), dimension(:) , intent(inout) :: fm1 ! Monin_Obukhov_silarity_function for momentum + real(kind=kind_phys), dimension(:) , intent(inout) :: fh1 ! Monin_Obukhov_silarity_function for heat + real(kind=kind_phys), dimension(:) , intent(inout) :: ustar1 ! friction velocity m s-1 + real(kind=kind_phys), dimension(:) , intent(inout) :: stress1 ! Wind stress m2 S-2 + real(kind=kind_phys), dimension(:) , intent(inout) :: fm101 ! MOS function for momentum evaulated @ 10 m + real(kind=kind_phys), dimension(:) , intent(inout) :: fh21 ! MOS function for heat evaulated @ 2m real(kind=kind_phys), dimension(:) , intent(inout) :: snowxy ! actual no. of snow layers real(kind=kind_phys), dimension(:) , intent(inout) :: tvxy ! vegetation leaf temperature [K] @@ -694,8 +694,8 @@ subroutine noahmpdrv_run & slope_category = slopetyp(i) soil_color_category = 4 - call transfer_mp_parameters(vegetation_category,soil_category, & - slope_category,soil_color_category,crop_type,parameters) + call transfer_mp_parameters(vegetation_category, soil_category, & + slope_category, soil_color_category, crop_type,parameters) call noahmp_options(idveg ,iopt_crs, iopt_btr , iopt_run, iopt_sfc, & iopt_frz, iopt_inf , iopt_rad, iopt_alb, & @@ -721,7 +721,8 @@ subroutine noahmpdrv_run & temperature_forcing ,air_pressure_forcing ,uwind_forcing ,vwind_forcing , & spec_humidity_forcing,sw_radiation_forcing ,precipitation_forcing,radiation_lw_forcing , & temperature_soil_bot ,forcing_height ,snow_ice_frac_old ,zsoil , & - thsfc_loc,prslkix ,prsik1x ,prslk1x,vegetation_frac,area_grid , & + thsfc_loc ,prslkix ,prsik1x ,prslk1x , & + vegetation_frac. ,area_grid , & snowfall ,snow_water_equiv_old ,snow_albedo_old , & cm_noahmp ,ch_noahmp ,snow_levels ,snow_water_equiv , & soil_moisture_vol ,interface_depth ,snow_depth ,snow_level_ice , & @@ -796,9 +797,9 @@ subroutine noahmpdrv_run & ice_flag ,surface_type ,crop_type , & eq_soil_water_vol ,temperature_forcing ,air_pressure_forcing , & air_pressure_surface ,uwind_forcing ,vwind_forcing , & - spec_humidity_forcing ,area_grid, cloud_water_forcing , & - sw_radiation_forcing ,radiation_lw_forcing , & - thsfc_loc, prslkix,prsik1x,prslk1x , & + spec_humidity_forcing ,area_grid. ,cloud_water_forcing , & + sw_radiation_forcing ,radiation_lw_forcing ,thsfc_loc , & + prslkix ,prsik1x ,prslk1x , & precip_convective , & precip_non_convective ,precip_sh_convective ,precip_snow , & precip_graupel ,precip_hail ,temperature_soil_bot , & @@ -857,10 +858,10 @@ subroutine noahmpdrv_run & latent_heat_total = latent_heat_canopy + latent_heat_ground + transpiration_heat - t2mmp(i) = temperature_veg_2m * vegetation_fraction + & - temperature_bare_2m * (1-vegetation_fraction) - q2mp(i) = spec_humidity_veg_2m * vegetation_fraction + & - spec_humidity_bare_2m * (1-vegetation_fraction) + t2mmp(i) = temperature_veg_2m * vegetation_fraction + & + temperature_bare_2m * (1-vegetation_fraction) + q2mp(i) = spec_humidity_veg_2m * vegetation_fraction + & + spec_humidity_bare_2m * (1-vegetation_fraction) tskin(i) = surface_temperature From 18834e0118c0c4b5c09122616edc78b0ced01e49 Mon Sep 17 00:00:00 2001 From: HelinWei-NOAA <48133472+HelinWei-NOAA@users.noreply.github.com> Date: Mon, 29 Nov 2021 12:28:35 -0500 Subject: [PATCH 20/28] Update module_sf_noahmp_glacier.f90 fix the typo --- physics/module_sf_noahmp_glacier.f90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/physics/module_sf_noahmp_glacier.f90 b/physics/module_sf_noahmp_glacier.f90 index 39a276c94..b2d25deed 100644 --- a/physics/module_sf_noahmp_glacier.f90 +++ b/physics/module_sf_noahmp_glacier.f90 @@ -407,7 +407,7 @@ subroutine energy_glacier (nsnow ,nsoil ,isnow ,dt ,qsnow ,rhoair tg ,stc ,snowh ,sneqv ,sneqvo ,sh2o , & !inout smc ,snice ,snliq ,albold ,cm ,ch , & !inout #ifdef CCPP - tauss ,qsfc ,errmsg ,errflg. , & !inout + tauss ,qsfc ,errmsg ,errflg , & !inout #else tauss ,qsfc , & !inout #endif @@ -2267,7 +2267,7 @@ subroutine water_glacier (nsnow ,nsoil ,imelt ,dt ,prcp ,sfctmp , isnow ,snowh ,sneqv ,snice ,snliq ,stc , & !inout dzsnso ,sh2o ,sice ,ponding ,zsnso ,fsh , & !inout runsrf ,runsub ,qsnow ,ponding1 ,ponding2 ,qsnbot , & !out - fpice. ,esnow) !out + fpice ,esnow) !out ! ---------------------------------------------------------------------- ! code history: ! initial code: guo-yue niu, oct. 2007 From 8867777febae068886f433d8e7de0feaef2d8b2e Mon Sep 17 00:00:00 2001 From: HelinWei-NOAA <48133472+HelinWei-NOAA@users.noreply.github.com> Date: Mon, 29 Nov 2021 12:41:30 -0500 Subject: [PATCH 21/28] Update GFS_surface_generic.F90 fix the typo --- physics/GFS_surface_generic.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/physics/GFS_surface_generic.F90 b/physics/GFS_surface_generic.F90 index 5aa506e81..e6ae50eaf 100644 --- a/physics/GFS_surface_generic.F90 +++ b/physics/GFS_surface_generic.F90 @@ -275,7 +275,7 @@ end subroutine GFS_surface_generic_post_finalize !! \htmlinclude GFS_surface_generic_post_run.html !! subroutine GFS_surface_generic_post_run (im, cplflx, cplchm, cplwav, lssav, dry, icy, wet, & - lsm, lsm_noahmp, ep1d, gflx, tgrs_1, qgrs_1, ugrs_1, vgrs_1, & + lsm, lsm_noahmp, dtf, ep1d, gflx, tgrs_1, qgrs_1, ugrs_1, vgrs_1, & adjsfcdlw, adjsfcdsw, adjnirbmd, adjnirdfd, adjvisbmd, adjvisdfd, adjsfculw, adjsfculw_wat, adjnirbmu, adjnirdfu, & adjvisbmu, adjvisdfu, t2m, q2m, u10m, v10m, tsfc, tsfc_wat, pgr, xcosz, evbs, evcw, trans, sbsno, snowc, snohf, pah, pahi, & epi, gfluxi, t1, q1, u1, v1, dlwsfci_cpl, dswsfci_cpl, dlwsfc_cpl, dswsfc_cpl, dnirbmi_cpl, dnirdfi_cpl, dvisbmi_cpl, & From 2a2b6a6fb183b96dbdafbf4190712294c8cf19da Mon Sep 17 00:00:00 2001 From: HelinWei-NOAA <48133472+HelinWei-NOAA@users.noreply.github.com> Date: Mon, 29 Nov 2021 12:48:41 -0500 Subject: [PATCH 22/28] Update sfc_noahmp_drv.F90 fix the typo --- physics/sfc_noahmp_drv.F90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/physics/sfc_noahmp_drv.F90 b/physics/sfc_noahmp_drv.F90 index dabff5386..c6bc8aca1 100644 --- a/physics/sfc_noahmp_drv.F90 +++ b/physics/sfc_noahmp_drv.F90 @@ -722,7 +722,7 @@ subroutine noahmpdrv_run & spec_humidity_forcing,sw_radiation_forcing ,precipitation_forcing,radiation_lw_forcing , & temperature_soil_bot ,forcing_height ,snow_ice_frac_old ,zsoil , & thsfc_loc ,prslkix ,prsik1x ,prslk1x , & - vegetation_frac. ,area_grid , & + vegetation_frac ,area_grid , & snowfall ,snow_water_equiv_old ,snow_albedo_old , & cm_noahmp ,ch_noahmp ,snow_levels ,snow_water_equiv , & soil_moisture_vol ,interface_depth ,snow_depth ,snow_level_ice , & @@ -797,7 +797,7 @@ subroutine noahmpdrv_run & ice_flag ,surface_type ,crop_type , & eq_soil_water_vol ,temperature_forcing ,air_pressure_forcing , & air_pressure_surface ,uwind_forcing ,vwind_forcing , & - spec_humidity_forcing ,area_grid. ,cloud_water_forcing , & + spec_humidity_forcing ,area_grid ,cloud_water_forcing , & sw_radiation_forcing ,radiation_lw_forcing ,thsfc_loc , & prslkix ,prsik1x ,prslk1x , & precip_convective , & From ba4bf2ea63281be002589a6842ea61ff2bb358ac Mon Sep 17 00:00:00 2001 From: wx20hw Date: Mon, 29 Nov 2021 20:37:09 +0000 Subject: [PATCH 23/28] address some comments from reviewer --- physics/gcycle.F90 | 2 +- physics/sfc_noahmp_drv.F90 | 24 ++++++++++++------------ physics/sfc_noahmp_drv.meta | 8 ++++++++ physics/sflx.f | 7 ++++--- 4 files changed, 25 insertions(+), 16 deletions(-) diff --git a/physics/gcycle.F90 b/physics/gcycle.F90 index 508590b32..5f4f959c6 100644 --- a/physics/gcycle.F90 +++ b/physics/gcycle.F90 @@ -173,7 +173,7 @@ subroutine gcycle (me, nthrds, nx, ny, isc, jsc, nsst, tile_num, nlunit, do ix=1,npts i_indx(ix) = imap(ix) + isc - 1 j_indx(ix) = jmap(ix) + jsc - 1 - + if (lakefrac(ix) > 0.0_kind_phys) then min_ice(ix) = min_lakeice else diff --git a/physics/sfc_noahmp_drv.F90 b/physics/sfc_noahmp_drv.F90 index c6bc8aca1..fe6ebc26a 100644 --- a/physics/sfc_noahmp_drv.F90 +++ b/physics/sfc_noahmp_drv.F90 @@ -108,7 +108,7 @@ subroutine noahmpdrv_run & ( im, km, lsnowl, itime, ps, u1, v1, t1, q1, soiltyp, & vegtype, sigmaf, dlwflx, dswsfc, snet, delt, tg3, cm, ch, & prsl1, prslk1, prslki, prsik1, zf, dry, wind, slopetyp, & - shdmin, shdmax, snoalb, sfalb, flag_iter, & + shdmin, shdmax, snoalb, sfalb, flag_iter,con_g, & idveg, iopt_crs, iopt_btr, iopt_run, iopt_sfc, iopt_frz, & iopt_inf, iopt_rad, iopt_alb, iopt_snf, iopt_tbot, & iopt_stc, xlatin, xcoszin, iyrlen, julian, garea, & @@ -149,16 +149,16 @@ subroutine noahmpdrv_run & implicit none - real(kind=kind_phys), parameter :: a2 = 17.2693882 - real(kind=kind_phys), parameter :: a3 = 273.16 - real(kind=kind_phys), parameter :: a4 = 35.86 - real(kind=kind_phys), parameter :: a23m4 = a2*(a3-a4) - real(kind=kind_phys), parameter :: gravity = 9.81 + real(kind=kind_phys), parameter :: a2 = 17.2693882 + real(kind=kind_phys), parameter :: a3 = 273.16 + real(kind=kind_phys), parameter :: a4 = 35.86 + real(kind=kind_phys), parameter :: a23m4 = a2*(a3-a4) + real(kind=kind_phys), intent(in) :: con_g - real, parameter :: undefined = 9.99e20_kind_phys + real, parameter :: undefined = 9.99e20_kind_phys - integer, parameter :: nsoil = 4 ! hardwired to Noah - integer, parameter :: nsnow = 3 ! max. snow layers + integer, parameter :: nsoil = 4 ! hardwired to Noah + integer, parameter :: nsnow = 3 ! max. snow layers real(kind=kind_phys), save :: zsoil(nsoil) data zsoil / -0.1, -0.4, -1.0, -2.0 / @@ -981,10 +981,10 @@ subroutine noahmpdrv_run & zvfun(i) = sqrt(tem1 * tem2) gdx=sqrt(garea(i)) - call stability & + call stability & (zf(i), zvfun(i), gdx, virtual_temperature, vptemp,wind(i), z0_total, z0h_total, & - tvs1, gravity,thsfc_loc, & - rb1(i),fm1(i),fh1(i),fm101(i),fh21(i),cm(i),ch(i),stress1(i),ustar1(i)) + tvs1, con_g, thsfc_loc, & + rb1(i), fm1(i), fh1(i), fm101(i), fh21(i), cm(i), ch(i), stress1(i), ustar1(i)) cmxy(i) = cm(i) chxy(i) = ch(i) diff --git a/physics/sfc_noahmp_drv.meta b/physics/sfc_noahmp_drv.meta index defd428f1..67d6630e5 100644 --- a/physics/sfc_noahmp_drv.meta +++ b/physics/sfc_noahmp_drv.meta @@ -332,6 +332,14 @@ dimensions = (horizontal_loop_extent) type = logical intent = in +[con_g] + standard_name = gravitational_acceleration + long_name = gravitational acceleration + units = m s-2 + dimensions = () + type = real + kind = kind_phys + intent = in [idveg] standard_name = control_for_land_surface_scheme_dynamic_vegetation long_name = choice for dynamic vegetation option (see noahmp module for definition) diff --git a/physics/sflx.f b/physics/sflx.f index e3bd8f6f0..61fe015cc 100644 --- a/physics/sflx.f +++ b/physics/sflx.f @@ -3506,11 +3506,12 @@ subroutine smflx & & edir1, ec1, et1(nsoil), zsoil(nsoil) ! --- input/outputs: - real (kind=kind_phys), intent(inout) :: cmc, sh2o(nsoil) + real (kind=kind_phys), intent(inout) :: cmc, sh2o(nsoil), & + & smc(nsoil) ! --- outputs: - real (kind=kind_phys), intent(out) :: smc(nsoil), runoff1, & - & runoff2, runoff3, drip + real (kind=kind_phys), intent(out) :: runoff1, runoff2, & + & runoff3, drip ! --- locals: real (kind=kind_phys) :: dummy, excess, pcpdrp, rhsct, trhsct, & From df0caf59af5a037c9245219dc8edebbb4c6dc269 Mon Sep 17 00:00:00 2001 From: wx20hw Date: Tue, 30 Nov 2021 00:32:08 +0000 Subject: [PATCH 24/28] address some comments from reviewers --- physics/GFS_surface_loop_control.F90 | 6 ++---- physics/GFS_surface_loop_control.meta | 14 -------------- physics/sfc_diag_post.F90 | 3 +-- physics/sfc_diag_post.meta | 16 ---------------- physics/sfc_noahmp_drv.meta | 2 +- 5 files changed, 4 insertions(+), 37 deletions(-) diff --git a/physics/GFS_surface_loop_control.F90 b/physics/GFS_surface_loop_control.F90 index 775e533d2..0de1c8ee5 100644 --- a/physics/GFS_surface_loop_control.F90 +++ b/physics/GFS_surface_loop_control.F90 @@ -22,7 +22,7 @@ end subroutine GFS_surface_loop_control_part1_finalize !! \section detailed Detailed Algorithm !! @{ - subroutine GFS_surface_loop_control_part1_run (im, lsm, lsm_noahmp, iter, & + subroutine GFS_surface_loop_control_part1_run (im, iter, & wind, flag_guess, errmsg, errflg) use machine, only: kind_phys @@ -32,8 +32,6 @@ subroutine GFS_surface_loop_control_part1_run (im, lsm, lsm_noahmp, iter, & ! Interface variables integer, intent(in) :: im integer, intent(in) :: iter - integer, intent(in) :: lsm - integer, intent(in) :: lsm_noahmp real(kind=kind_phys), dimension(:), intent(in) :: wind logical, dimension(:), intent(inout) :: flag_guess @@ -48,7 +46,7 @@ subroutine GFS_surface_loop_control_part1_run (im, lsm, lsm_noahmp, iter, & errflg = 0 do i=1,im - if (iter == 1 .and. wind(i) < 2.0d0 .and. lsm /= lsm_noahmp) then + if (iter == 1 .and. wind(i) < 2.0d0) then flag_guess(i) = .true. endif enddo diff --git a/physics/GFS_surface_loop_control.meta b/physics/GFS_surface_loop_control.meta index 03db1e5fa..edb19072a 100644 --- a/physics/GFS_surface_loop_control.meta +++ b/physics/GFS_surface_loop_control.meta @@ -14,20 +14,6 @@ dimensions = () type = integer intent = in -[lsm] - standard_name = control_for_land_surface_scheme - long_name = flag for land surface model - units = flag - dimensions = () - type = integer - intent = in -[lsm_noahmp] - standard_name = identifier_for_noahmp_land_surface_scheme - long_name = flag for NOAH MP land surface model - units = flag - dimensions = () - type = integer - intent = in [iter] standard_name = ccpp_loop_counter long_name = loop counter for subcycling loops in CCPP diff --git a/physics/sfc_diag_post.F90 b/physics/sfc_diag_post.F90 index 1194cef5c..6f14fe93d 100644 --- a/physics/sfc_diag_post.F90 +++ b/physics/sfc_diag_post.F90 @@ -16,7 +16,7 @@ end subroutine sfc_diag_post_finalize !! #endif subroutine sfc_diag_post_run (im, lsm, lsm_noahmp, dry, lssav, dtf, con_eps, con_epsm1, pgr,& - t2mmp, q2mp, t2m, q2m, u10m, v10m, tmpmin, tmpmax, spfhmin, spfhmax,& + t2m, q2m, u10m, v10m, tmpmin, tmpmax, spfhmin, spfhmax, & wind10mmax, u10mmax, v10mmax, dpt2m, errmsg, errflg) use machine, only: kind_phys @@ -28,7 +28,6 @@ subroutine sfc_diag_post_run (im, lsm, lsm_noahmp, dry, lssav, dtf, con_eps, con real(kind=kind_phys), intent(in) :: dtf, con_eps, con_epsm1 logical , dimension(:), intent(in) :: dry real(kind=kind_phys), dimension(:), intent(in) :: pgr, u10m, v10m - real(kind=kind_phys), dimension(:) , intent(in) :: t2mmp, q2mp real(kind=kind_phys), dimension(:), intent(inout) :: t2m, q2m, tmpmin, tmpmax, spfhmin, spfhmax real(kind=kind_phys), dimension(:), intent(inout) :: wind10mmax, u10mmax, v10mmax, dpt2m diff --git a/physics/sfc_diag_post.meta b/physics/sfc_diag_post.meta index d66a468fa..21d76a147 100644 --- a/physics/sfc_diag_post.meta +++ b/physics/sfc_diag_post.meta @@ -74,22 +74,6 @@ type = real kind = kind_phys intent = in -[t2mmp] - standard_name = temperature_at_2m_from_noahmp - long_name = 2 meter temperature from noahmp - units = K - dimensions = (horizontal_loop_extent) - type = real - kind = kind_phys - intent = in -[q2mp] - standard_name = specific_humidity_at_2m_from_noahmp - long_name = 2 meter specific humidity from noahmp - units = kg kg-1 - dimensions = (horizontal_loop_extent) - type = real - kind = kind_phys - intent = in [t2m] standard_name = air_temperature_at_2m long_name = 2 meter temperature diff --git a/physics/sfc_noahmp_drv.meta b/physics/sfc_noahmp_drv.meta index 67d6630e5..c9a6c0258 100644 --- a/physics/sfc_noahmp_drv.meta +++ b/physics/sfc_noahmp_drv.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = noahmpdrv type = scheme - dependencies = funcphys.f90,machine.F,module_sf_noahmp_glacier.f90,module_sf_noahmplsm.f90,noahmp_tables.f90,set_soilveg.f + dependencies = funcphys.f90,machine.F,sfc_diff.f,module_sf_noahmp_glacier.f90,module_sf_noahmplsm.f90,noahmp_tables.f90,set_soilveg.f ######################################################################## [ccpp-arg-table] From 23f86e899cea6cf4436a383dc5787cb0cb14ee9c Mon Sep 17 00:00:00 2001 From: wx20hw Date: Tue, 30 Nov 2021 01:50:41 +0000 Subject: [PATCH 25/28] fix the typo --- physics/sfc_noahmp_drv.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/physics/sfc_noahmp_drv.F90 b/physics/sfc_noahmp_drv.F90 index fe6ebc26a..f2418dafc 100644 --- a/physics/sfc_noahmp_drv.F90 +++ b/physics/sfc_noahmp_drv.F90 @@ -737,7 +737,7 @@ subroutine noahmpdrv_run & #ifdef CCPP albedo_direct ,albedo_diffuse, errmsg ,errflg ) #else - albedo_direct ,albedo_diffuse,) + albedo_direct ,albedo_diffuse) #endif #ifdef CCPP From 3b1c86d32d5af9dec7fa1e0eb185fceb5e02a702 Mon Sep 17 00:00:00 2001 From: wx20hw Date: Tue, 30 Nov 2021 04:34:00 +0000 Subject: [PATCH 26/28] limit pahi to Noah MP only --- physics/GFS_surface_generic.F90 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/physics/GFS_surface_generic.F90 b/physics/GFS_surface_generic.F90 index e6ae50eaf..1b39409b3 100644 --- a/physics/GFS_surface_generic.F90 +++ b/physics/GFS_surface_generic.F90 @@ -335,7 +335,9 @@ subroutine GFS_surface_generic_post_run (im, cplflx, cplchm, cplwav, lssav, dry, do i=1,im epi(i) = ep1d(i) gfluxi(i) = gflx(i) - pahi(i) = pah(i) + if (lsm == lsm_noahmp) then + pahi(i) = pah(i) + endif t1(i) = tgrs_1(i) q1(i) = qgrs_1(i) u1(i) = ugrs_1(i) From d344faa1c6b42a8faeadd4b359b90b817393afd9 Mon Sep 17 00:00:00 2001 From: wx20hw Date: Tue, 30 Nov 2021 14:09:55 +0000 Subject: [PATCH 27/28] fix snow depth issue in Noah MP --- physics/module_sf_noahmp_glacier.f90 | 2 ++ physics/module_sf_noahmplsm.f90 | 2 ++ 2 files changed, 4 insertions(+) diff --git a/physics/module_sf_noahmp_glacier.f90 b/physics/module_sf_noahmp_glacier.f90 index b2d25deed..b5abd871b 100644 --- a/physics/module_sf_noahmp_glacier.f90 +++ b/physics/module_sf_noahmp_glacier.f90 @@ -2534,8 +2534,10 @@ subroutine snowwater_glacier (nsnow ,nsoil ,imelt ,dt ,sfctmp , & !in if(isnow /= 0) then sneqv = 0. + snowh = 0. do iz = isnow+1,0 sneqv = sneqv + snice(iz) + snliq(iz) + snowh = snowh + dzsnso(iz) enddo end if diff --git a/physics/module_sf_noahmplsm.f90 b/physics/module_sf_noahmplsm.f90 index af495d825..81dd1dceb 100644 --- a/physics/module_sf_noahmplsm.f90 +++ b/physics/module_sf_noahmplsm.f90 @@ -6856,8 +6856,10 @@ subroutine snowwater (parameters,nsnow ,nsoil ,imelt ,dt ,zsoil , & !in if(isnow < 0) then ! mb: only do for multi-layer sneqv = 0. + snowh = 0. do iz = isnow+1,0 sneqv = sneqv + snice(iz) + snliq(iz) + snowh = snowh + dzsnso(iz) enddo end if From ec81419b981917327291a562b60bbd939bb766f1 Mon Sep 17 00:00:00 2001 From: wx20hw Date: Tue, 30 Nov 2021 17:49:07 +0000 Subject: [PATCH 28/28] fix the vfrac over glacier --- physics/sfc_noahmp_drv.F90 | 1 + 1 file changed, 1 insertion(+) diff --git a/physics/sfc_noahmp_drv.F90 b/physics/sfc_noahmp_drv.F90 index f2418dafc..7ef542f42 100644 --- a/physics/sfc_noahmp_drv.F90 +++ b/physics/sfc_noahmp_drv.F90 @@ -783,6 +783,7 @@ subroutine noahmpdrv_run & q2mp(i) = spec_humidity_bare_2m tskin(i) = temperature_ground + vegetation_fraction = vegetation_frac else ! not glacier