From 41527dd33221e10952f9de0fdc30dcc22d4926c0 Mon Sep 17 00:00:00 2001 From: Ufuk Turuncoglu Date: Thu, 7 Nov 2024 22:59:45 -0600 Subject: [PATCH 1/7] skip land component for first time step --- physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 | 6 ++++-- physics/SFC_Models/Land/Noahmp/noahmpdrv.meta | 7 +++++++ physics/SFC_Models/Land/sfc_land.F90 | 7 ++++--- physics/SFC_Models/Land/sfc_land.meta | 7 +++++++ 4 files changed, 22 insertions(+), 5 deletions(-) diff --git a/physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 b/physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 index 1313e9ff3..56b2706b8 100644 --- a/physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 +++ b/physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 @@ -127,7 +127,8 @@ end subroutine noahmpdrv_init subroutine noahmpdrv_run & !................................... ! --- inputs: - ( im, km, lsnowl, itime, ps, u1, v1, t1, q1, soiltyp,soilcol,& + ( im, km, lsnowl, itime, flag_init, ps, u1, v1, t1, q1, & + soiltyp,soilcol, & vegtype, sigmaf, dlwflx, dswsfc, snet, delt, tg3, cm, ch, & prsl1, prslk1, prslki, prsik1, zf,pblh, dry, wind, slopetyp,& shdmin, shdmax, snoalb, sfalb, flag_iter,con_g, & @@ -233,6 +234,7 @@ subroutine noahmpdrv_run & integer , intent(in) :: km ! vertical soil layer dimension integer , intent(in) :: lsnowl ! lower bound for snow level arrays integer , intent(in) :: itime ! NOT USED + logical , intent(in) :: flag_init ! flag signaling first time step real(kind=kind_phys), dimension(:) , intent(in) :: ps ! surface pressure [Pa] real(kind=kind_phys), dimension(:) , intent(in) :: u1 ! u-component of wind [m/s] real(kind=kind_phys), dimension(:) , intent(in) :: v1 ! u-component of wind [m/s] @@ -693,7 +695,7 @@ subroutine noahmpdrv_run & ! ! --- Just return if external land component is activated for two-way interaction ! - if (cpllnd .and. cpllnd2atm) return + if (cpllnd .and. cpllnd2atm .and. (.not. flag_init)) return do i = 1, im diff --git a/physics/SFC_Models/Land/Noahmp/noahmpdrv.meta b/physics/SFC_Models/Land/Noahmp/noahmpdrv.meta index 753550016..75bd4d7e1 100644 --- a/physics/SFC_Models/Land/Noahmp/noahmpdrv.meta +++ b/physics/SFC_Models/Land/Noahmp/noahmpdrv.meta @@ -129,6 +129,13 @@ dimensions = () type = integer intent = in +[flag_init] + standard_name = flag_for_first_timestep + long_name = flag signaling first time step for time integration loop + units = flag + dimensions = () + type = logical + intent = in [ps] standard_name = surface_air_pressure long_name = surface pressure diff --git a/physics/SFC_Models/Land/sfc_land.F90 b/physics/SFC_Models/Land/sfc_land.F90 index a85e8b787..36bdcdc09 100644 --- a/physics/SFC_Models/Land/sfc_land.F90 +++ b/physics/SFC_Models/Land/sfc_land.F90 @@ -28,8 +28,8 @@ module sfc_land !! \section general General Algorithm !! \section detailed Detailed Algorithm !! @{ - subroutine sfc_land_run(im, cpllnd, cpllnd2atm, flag_iter, dry, & - sncovr1_lnd, qsurf_lnd, evap_lnd, hflx_lnd, & + subroutine sfc_land_run(im, flag_init, cpllnd, cpllnd2atm, & + flag_iter, dry, sncovr1_lnd, qsurf_lnd, evap_lnd, hflx_lnd, & ep_lnd, t2mmp_lnd, q2mp_lnd, gflux_lnd, & runoff_lnd, drain_lnd, cmm_lnd, chh_lnd, zvfun_lnd, & sncovr1, qsurf, evap, hflx, ep, t2mmp, q2mp, & @@ -40,6 +40,7 @@ subroutine sfc_land_run(im, cpllnd, cpllnd2atm, flag_iter, dry, & ! Inputs integer , intent(in) :: im + logical , intent(in) :: flag_init logical , intent(in) :: cpllnd logical , intent(in) :: cpllnd2atm logical , intent(in) :: flag_iter(:) @@ -83,7 +84,7 @@ subroutine sfc_land_run(im, cpllnd, cpllnd2atm, flag_iter, dry, & errflg = 0 ! Check coupling from component land to atmosphere - if (.not. cpllnd2atm) return + if (flag_init .or. (.not. cpllnd2atm)) return ! Fill variables do i = 1, im diff --git a/physics/SFC_Models/Land/sfc_land.meta b/physics/SFC_Models/Land/sfc_land.meta index 15790145e..84c4ccdce 100644 --- a/physics/SFC_Models/Land/sfc_land.meta +++ b/physics/SFC_Models/Land/sfc_land.meta @@ -14,6 +14,13 @@ dimensions = () type = integer intent = in +[flag_init] + standard_name = flag_for_first_timestep + long_name = flag signaling first time step for time integration loop + units = flag + dimensions = () + type = logical + intent = in [cpllnd] standard_name = flag_for_land_coupling long_name = flag controlling cpllnd collection (default off) From 727418758d115ae89bc49eaf84c4ee6acc50c975 Mon Sep 17 00:00:00 2001 From: Ufuk Turuncoglu Date: Fri, 6 Dec 2024 10:45:45 -0600 Subject: [PATCH 2/7] minor fix for restart --- physics/SFC_Models/Land/sfc_land.F90 | 12 ++++++++---- physics/SFC_Models/Land/sfc_land.meta | 7 +++++++ 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/physics/SFC_Models/Land/sfc_land.F90 b/physics/SFC_Models/Land/sfc_land.F90 index 36bdcdc09..e222115f7 100644 --- a/physics/SFC_Models/Land/sfc_land.F90 +++ b/physics/SFC_Models/Land/sfc_land.F90 @@ -28,9 +28,9 @@ module sfc_land !! \section general General Algorithm !! \section detailed Detailed Algorithm !! @{ - subroutine sfc_land_run(im, flag_init, cpllnd, cpllnd2atm, & - flag_iter, dry, sncovr1_lnd, qsurf_lnd, evap_lnd, hflx_lnd, & - ep_lnd, t2mmp_lnd, q2mp_lnd, gflux_lnd, & + subroutine sfc_land_run(im, flag_init, flag_restart, & + cpllnd, cpllnd2atm, flag_iter, dry, sncovr1_lnd, qsurf_lnd, & + evap_lnd, hflx_lnd, ep_lnd, t2mmp_lnd, q2mp_lnd, gflux_lnd, & runoff_lnd, drain_lnd, cmm_lnd, chh_lnd, zvfun_lnd, & sncovr1, qsurf, evap, hflx, ep, t2mmp, q2mp, & gflux, runoff, drain, cmm, chh, zvfun, & @@ -41,6 +41,7 @@ subroutine sfc_land_run(im, flag_init, cpllnd, cpllnd2atm, & ! Inputs integer , intent(in) :: im logical , intent(in) :: flag_init + logical , intent(in) :: flag_restart logical , intent(in) :: cpllnd logical , intent(in) :: cpllnd2atm logical , intent(in) :: flag_iter(:) @@ -84,7 +85,10 @@ subroutine sfc_land_run(im, flag_init, cpllnd, cpllnd2atm, & errflg = 0 ! Check coupling from component land to atmosphere - if (flag_init .or. (.not. cpllnd2atm)) return + if (.not. cpllnd2atm) return + + ! Check if it is cold or warm run + if (flag_init .and. .not.flag_restart) return ! Fill variables do i = 1, im diff --git a/physics/SFC_Models/Land/sfc_land.meta b/physics/SFC_Models/Land/sfc_land.meta index 84c4ccdce..13ddab00a 100644 --- a/physics/SFC_Models/Land/sfc_land.meta +++ b/physics/SFC_Models/Land/sfc_land.meta @@ -21,6 +21,13 @@ dimensions = () type = logical intent = in +[flag_restart] + standard_name = flag_for_restart + long_name = flag for restart (warmstart) or coldstart + units = flag + dimensions = () + type = logical + intent = in [cpllnd] standard_name = flag_for_land_coupling long_name = flag controlling cpllnd collection (default off) From 2be44698e7b84e2276e2f0c9ca123ad8ebd6f660 Mon Sep 17 00:00:00 2001 From: Ufuk Turuncoglu Date: Thu, 19 Dec 2024 12:48:43 -0600 Subject: [PATCH 3/7] add simple land flux calculation that is used in the initial time step --- physics/SFC_Models/Land/sfc_land.F90 | 113 ++++++++++++++++++------ physics/SFC_Models/Land/sfc_land.meta | 122 +++++++++++++++++++++++++- 2 files changed, 207 insertions(+), 28 deletions(-) diff --git a/physics/SFC_Models/Land/sfc_land.F90 b/physics/SFC_Models/Land/sfc_land.F90 index e222115f7..d606054ed 100644 --- a/physics/SFC_Models/Land/sfc_land.F90 +++ b/physics/SFC_Models/Land/sfc_land.F90 @@ -10,6 +10,7 @@ module sfc_land use machine, only : kind_phys + use funcphys, only : fpvs contains @@ -29,23 +30,40 @@ module sfc_land !! \section detailed Detailed Algorithm !! @{ subroutine sfc_land_run(im, flag_init, flag_restart, & - cpllnd, cpllnd2atm, flag_iter, dry, sncovr1_lnd, qsurf_lnd, & + cpllnd, cpllnd2atm, flag_iter, dry, & + t1, q1, prsl1, prslki, ps, tskin, wind, cm, ch, rd, eps, epsm1, & + rvrdm1, hvap, cp, sncovr1_lnd, qsurf_lnd, & evap_lnd, hflx_lnd, ep_lnd, t2mmp_lnd, q2mp_lnd, gflux_lnd, & runoff_lnd, drain_lnd, cmm_lnd, chh_lnd, zvfun_lnd, & sncovr1, qsurf, evap, hflx, ep, t2mmp, q2mp, & gflux, runoff, drain, cmm, chh, zvfun, & - errmsg, errflg) + errmsg, errflg, naux2d, aux2d) implicit none ! Inputs - integer , intent(in) :: im - logical , intent(in) :: flag_init - logical , intent(in) :: flag_restart - logical , intent(in) :: cpllnd - logical , intent(in) :: cpllnd2atm - logical , intent(in) :: flag_iter(:) - logical , intent(in) :: dry(:) + integer , intent(in) :: im + logical , intent(in) :: flag_init + logical , intent(in) :: flag_restart + logical , intent(in) :: cpllnd + logical , intent(in) :: cpllnd2atm + logical , intent(in) :: flag_iter(:) + logical , intent(in) :: dry(:) + real(kind=kind_phys), intent(in) :: t1(:) + real(kind=kind_phys), intent(in) :: q1(:) + real(kind=kind_phys), intent(in) :: prsl1(:) + real(kind=kind_phys), intent(in) :: prslki(:) + real(kind=kind_phys), intent(in) :: ps(:) + real(kind=kind_phys), intent(in) :: tskin(:) + real(kind=kind_phys), intent(in) :: wind(:) + real(kind=kind_phys), intent(in) :: cm(:) + real(kind=kind_phys), intent(in) :: ch(:) + real(kind=kind_phys), intent(in) :: rd + real(kind=kind_phys), intent(in) :: eps + real(kind=kind_phys), intent(in) :: epsm1 + real(kind=kind_phys), intent(in) :: rvrdm1 + real(kind=kind_phys), intent(in) :: hvap + real(kind=kind_phys), intent(in) :: cp real(kind=kind_phys), intent(in), optional :: sncovr1_lnd(:) real(kind=kind_phys), intent(in), optional :: qsurf_lnd(:) real(kind=kind_phys), intent(in), optional :: evap_lnd(:) @@ -77,35 +95,76 @@ subroutine sfc_land_run(im, flag_init, flag_restart, & character(len=*) , intent(out) :: errmsg integer , intent(out) :: errflg + ! Constant parameters + real(kind=kind_phys), parameter :: & + & one = 1.0_kind_phys, & + & zero = 0.0_kind_phys, & + & qmin = 1.0e-8_kind_phys + ! Locals integer :: i + real(kind=kind_phys) :: qss, rch, tem, cpinv, hvapi, elocp + real(kind=kind_phys), dimension(im) :: rho, q0 ! Initialize CCPP error handling variables errmsg = '' errflg = 0 + cpinv = one/cp + hvapi = one/hvap + elocp = hvap/cp + ! Check coupling from component land to atmosphere if (.not. cpllnd2atm) return ! Check if it is cold or warm run - if (flag_init .and. .not.flag_restart) return - - ! Fill variables - do i = 1, im - sncovr1(i) = sncovr1_lnd(i) - qsurf(i) = qsurf_lnd(i) - hflx(i) = hflx_lnd(i) - evap(i) = evap_lnd(i) - ep(i) = ep_lnd(i) - t2mmp(i) = t2mmp_lnd(i) - q2mp(i) = q2mp_lnd(i) - gflux(i) = gflux_lnd(i) - drain(i) = drain_lnd(i) - runoff(i) = runoff_lnd(i) - cmm(i) = cmm_lnd(i) - chh(i) = chh_lnd(i) - zvfun(i) = zvfun_lnd(i) - enddo + if (flag_init .and. .not. flag_restart) then + ! Calculate fluxes internally + do i = 1, im + if (dry(i)) then + q0(i) = max(q1(i), qmin) + rho(i) = prsl1(i)/(rd*t1(i)*(one+rvrdm1*q0(i))) + qss = fpvs(tskin(i)) + qss = eps*qss/(ps(i)+epsm1*qss) + rch = rho(i)*cp*ch(i)*wind(i) + tem = ch(i)*wind(i) + sncovr1(i) = zero + qsurf(i) = qss + hflx(i) = rch*(tskin(i)-t1(i)*prslki(i)) + hflx(i) = hflx(i)*(1.0/rho(i))*cpinv + evap(i) = elocp*rch*(qss-q0(i)) + ep(i) = evap(i) + evap(i) = evap(i)*(1.0/rho(i))*hvapi + t2mmp(i) = tskin(i) + q2mp(i) = qsurf(i) + gflux(i) = zero + drain(i) = zero + runoff(i) = zero + cmm(i) = cm(i)*wind(i) + chh(i) = rho(i)*tem + zvfun(i) = one + end if + enddo + else + ! Use fluxes from land component model + do i = 1, im + if (dry(i)) then + sncovr1(i) = sncovr1_lnd(i) + qsurf(i) = qsurf_lnd(i) + hflx(i) = hflx_lnd(i) + evap(i) = evap_lnd(i) + ep(i) = ep_lnd(i) + t2mmp(i) = t2mmp_lnd(i) + q2mp(i) = q2mp_lnd(i) + gflux(i) = gflux_lnd(i) + drain(i) = drain_lnd(i) + runoff(i) = runoff_lnd(i) + cmm(i) = cmm_lnd(i) + chh(i) = chh_lnd(i) + zvfun(i) = zvfun_lnd(i) + end if + enddo + endif end subroutine sfc_land_run diff --git a/physics/SFC_Models/Land/sfc_land.meta b/physics/SFC_Models/Land/sfc_land.meta index 13ddab00a..b24a6f8af 100644 --- a/physics/SFC_Models/Land/sfc_land.meta +++ b/physics/SFC_Models/Land/sfc_land.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = sfc_land type = scheme - dependencies = ../../hooks/machine.F + dependencies = ../../tools/funcphys.f90,../../hooks/machine.F ######################################################################## [ccpp-arg-table] @@ -56,6 +56,126 @@ dimensions = (horizontal_loop_extent) type = logical intent = in +[t1] + standard_name = air_temperature_at_surface_adjacent_layer + long_name = surface layer mean temperature + units = K + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = in +[q1] + standard_name = specific_humidity_at_surface_adjacent_layer + long_name = surface layer mean specific humidity + units = kg kg-1 + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = in +[ps] + standard_name = surface_air_pressure + long_name = surface pressure + units = Pa + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = in +[prsl1] + standard_name = air_pressure_at_surface_adjacent_layer + long_name = surface layer mean pressure + units = Pa + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = in +[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 + units = ratio + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = in +[tskin] + standard_name = surface_skin_temperature_over_land + long_name = surface skin temperature over land + units = K + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = in +[wind] + standard_name = wind_speed_at_lowest_model_layer + long_name = wind speed at lowest model level + units = m s-1 + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = in +[cm] + standard_name = surface_drag_coefficient_for_momentum_in_air_over_land + long_name = surface exchange coeff for momentum over land + units = none + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = in +[ch] + standard_name = surface_drag_coefficient_for_heat_and_moisture_in_air_over_land + long_name = surface exchange coeff heat & moisture over land + units = none + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = in +[eps] + standard_name = ratio_of_dry_air_to_water_vapor_gas_constants + long_name = rd/rv + units = none + dimensions = () + type = real + kind = kind_phys + intent = in +[epsm1] + standard_name = ratio_of_dry_air_to_water_vapor_gas_constants_minus_one + long_name = (rd/rv) - 1 + units = none + dimensions = () + type = real + kind = kind_phys + intent = in +[rvrdm1] + standard_name = ratio_of_vapor_to_dry_air_gas_constants_minus_one + long_name = (rv/rd) - 1 (rv = ideal gas constant for water vapor) + units = none + dimensions = () + type = real + kind = kind_phys + intent = in +[rd] + standard_name = gas_constant_of_dry_air + long_name = ideal gas constant for dry air + units = J kg-1 K-1 + dimensions = () + type = real + kind = kind_phys + intent = in +[hvap] + standard_name = latent_heat_of_vaporization_of_water_at_0C + long_name = latent heat of evaporation/sublimation + units = J kg-1 + dimensions = () + type = real + kind = kind_phys + intent = in +[cp] + standard_name = specific_heat_of_dry_air_at_constant_pressure + long_name = specific heat of dry air at constant pressure + units = J kg-1 K-1 + dimensions = () + type = real + kind = kind_phys + intent = in [sncovr1_lnd] standard_name = surface_snow_area_fraction_over_land_from_land long_name = surface snow area fraction over land for coupling From 491fbc3d77133cd02a44e2754040d7a195e9e11d Mon Sep 17 00:00:00 2001 From: Ufuk Turuncoglu Date: Thu, 19 Dec 2024 14:14:48 -0600 Subject: [PATCH 4/7] fix minor issue --- physics/SFC_Models/Land/sfc_land.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/physics/SFC_Models/Land/sfc_land.F90 b/physics/SFC_Models/Land/sfc_land.F90 index d606054ed..51a63cdae 100644 --- a/physics/SFC_Models/Land/sfc_land.F90 +++ b/physics/SFC_Models/Land/sfc_land.F90 @@ -37,7 +37,7 @@ subroutine sfc_land_run(im, flag_init, flag_restart, & runoff_lnd, drain_lnd, cmm_lnd, chh_lnd, zvfun_lnd, & sncovr1, qsurf, evap, hflx, ep, t2mmp, q2mp, & gflux, runoff, drain, cmm, chh, zvfun, & - errmsg, errflg, naux2d, aux2d) + errmsg, errflg) implicit none From 13f0f8dd0de9e9e3b57316e3685f22176e2d7b42 Mon Sep 17 00:00:00 2001 From: Ufuk Turuncoglu Date: Mon, 23 Dec 2024 13:58:06 -0600 Subject: [PATCH 5/7] remove flag_init --- physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 | 5 ++--- physics/SFC_Models/Land/Noahmp/noahmpdrv.meta | 7 ------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 b/physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 index 46749e5bb..431ff3576 100644 --- a/physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 +++ b/physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 @@ -420,7 +420,7 @@ end subroutine noahmpdrv_finalize subroutine noahmpdrv_run & !................................... ! --- inputs: - ( im, km, lsnowl, itime, flag_init, ps, u1, v1, t1, q1, & + ( im, km, lsnowl, itime, ps, u1, v1, t1, q1, & soiltyp,soilcol, & vegtype, sigmaf, dlwflx, dswsfc, snet, delt, tg3, cm, ch, & prsl1, prslk1, prslki, prsik1, zf,pblh, dry, wind, slopetyp,& @@ -527,7 +527,6 @@ subroutine noahmpdrv_run & integer , intent(in) :: km ! vertical soil layer dimension integer , intent(in) :: lsnowl ! lower bound for snow level arrays integer , intent(in) :: itime ! NOT USED - logical , intent(in) :: flag_init ! flag signaling first time step real(kind=kind_phys), dimension(:) , intent(in) :: ps ! surface pressure [Pa] real(kind=kind_phys), dimension(:) , intent(in) :: u1 ! u-component of wind [m/s] real(kind=kind_phys), dimension(:) , intent(in) :: v1 ! u-component of wind [m/s] @@ -988,7 +987,7 @@ subroutine noahmpdrv_run & ! ! --- Just return if external land component is activated for two-way interaction ! - if (cpllnd .and. cpllnd2atm .and. (.not. flag_init)) return + if (cpllnd .and. cpllnd2atm) return do i = 1, im diff --git a/physics/SFC_Models/Land/Noahmp/noahmpdrv.meta b/physics/SFC_Models/Land/Noahmp/noahmpdrv.meta index 1c08d9ab5..7d1150c80 100644 --- a/physics/SFC_Models/Land/Noahmp/noahmpdrv.meta +++ b/physics/SFC_Models/Land/Noahmp/noahmpdrv.meta @@ -356,13 +356,6 @@ dimensions = () type = integer intent = in -[flag_init] - standard_name = flag_for_first_timestep - long_name = flag signaling first time step for time integration loop - units = flag - dimensions = () - type = logical - intent = in [ps] standard_name = surface_air_pressure long_name = surface pressure From 05e017a55c8d26a0014f50a4ac77ef966eb2498b Mon Sep 17 00:00:00 2001 From: Ufuk Turuncoglu Date: Fri, 27 Dec 2024 17:29:59 -0600 Subject: [PATCH 6/7] correction for flux calculation --- physics/SFC_Models/Land/sfc_land.F90 | 44 ++++++++++++++++++----- physics/SFC_Models/Land/sfc_land.meta | 52 +++++++++++++++++++++++++-- 2 files changed, 86 insertions(+), 10 deletions(-) diff --git a/physics/SFC_Models/Land/sfc_land.F90 b/physics/SFC_Models/Land/sfc_land.F90 index 51a63cdae..1661c5c40 100644 --- a/physics/SFC_Models/Land/sfc_land.F90 +++ b/physics/SFC_Models/Land/sfc_land.F90 @@ -31,10 +31,12 @@ module sfc_land !! @{ subroutine sfc_land_run(im, flag_init, flag_restart, & cpllnd, cpllnd2atm, flag_iter, dry, & - t1, q1, prsl1, prslki, ps, tskin, wind, cm, ch, rd, eps, epsm1, & - rvrdm1, hvap, cp, sncovr1_lnd, qsurf_lnd, & + t1, q1, prsl1, prslki, ps, tskin, wind, cm, ch, & + dlwflx, dswsfc, sfalb, sfcemis, & + rd, eps, epsm1, rvrdm1, hvap, cp, con_sbc, & + sncovr1_lnd, qsurf_lnd, & evap_lnd, hflx_lnd, ep_lnd, t2mmp_lnd, q2mp_lnd, gflux_lnd, & - runoff_lnd, drain_lnd, cmm_lnd, chh_lnd, zvfun_lnd, & + runoff_lnd, drain_lnd, cmm_lnd, chh_lnd, zvfun_lnd, slc, & sncovr1, qsurf, evap, hflx, ep, t2mmp, q2mp, & gflux, runoff, drain, cmm, chh, zvfun, & errmsg, errflg) @@ -58,12 +60,17 @@ subroutine sfc_land_run(im, flag_init, flag_restart, & real(kind=kind_phys), intent(in) :: wind(:) real(kind=kind_phys), intent(in) :: cm(:) real(kind=kind_phys), intent(in) :: ch(:) + real(kind=kind_phys), intent(in) :: dlwflx(:) + real(kind=kind_phys), intent(in) :: dswsfc(:) + real(kind=kind_phys), intent(in) :: sfalb(:) + real(kind=kind_phys), intent(in) :: sfcemis(:) real(kind=kind_phys), intent(in) :: rd real(kind=kind_phys), intent(in) :: eps real(kind=kind_phys), intent(in) :: epsm1 real(kind=kind_phys), intent(in) :: rvrdm1 real(kind=kind_phys), intent(in) :: hvap real(kind=kind_phys), intent(in) :: cp + real(kind=kind_phys), intent(in) :: con_sbc real(kind=kind_phys), intent(in), optional :: sncovr1_lnd(:) real(kind=kind_phys), intent(in), optional :: qsurf_lnd(:) real(kind=kind_phys), intent(in), optional :: evap_lnd(:) @@ -77,6 +84,7 @@ subroutine sfc_land_run(im, flag_init, flag_restart, & real(kind=kind_phys), intent(in), optional :: cmm_lnd(:) real(kind=kind_phys), intent(in), optional :: chh_lnd(:) real(kind=kind_phys), intent(in), optional :: zvfun_lnd(:) + real(kind=kind_phys), intent(in), optional :: slc(:,:) ! Inputs/Outputs real(kind=kind_phys), intent(inout) :: sncovr1(:) real(kind=kind_phys), intent(inout) :: qsurf(:) @@ -99,11 +107,14 @@ subroutine sfc_land_run(im, flag_init, flag_restart, & real(kind=kind_phys), parameter :: & & one = 1.0_kind_phys, & & zero = 0.0_kind_phys, & - & qmin = 1.0e-8_kind_phys + & qmin = 1.0e-8_kind_phys, & + & slc_min = 0.05_kind_phys, & ! estimate dry limit for soil moisture + & slc_max = 0.50_kind_phys ! estimate saturated limit for soil moisture ! Locals integer :: i real(kind=kind_phys) :: qss, rch, tem, cpinv, hvapi, elocp + real(kind=kind_phys) :: available_energy, soil_stress_factor real(kind=kind_phys), dimension(im) :: rho, q0 ! Initialize CCPP error handling variables @@ -122,6 +133,11 @@ subroutine sfc_land_run(im, flag_init, flag_restart, & ! Calculate fluxes internally do i = 1, im if (dry(i)) then + soil_stress_factor = (slc(i,1)-slc_min)/(slc_max-slc_min) + soil_stress_factor = min(max(zero,soil_stress_factor),one) + available_energy = dswsfc(i)*(one-sfalb(i))+dlwflx(i)*sfcemis(i) - & + sfcemis(i)*con_sbc*tskin(i)**4 + available_energy = min(max(-200.0,available_energy),1000.0) ! set some arbitrary limits q0(i) = max(q1(i), qmin) rho(i) = prsl1(i)/(rd*t1(i)*(one+rvrdm1*q0(i))) qss = fpvs(tskin(i)) @@ -130,11 +146,23 @@ subroutine sfc_land_run(im, flag_init, flag_restart, & tem = ch(i)*wind(i) sncovr1(i) = zero qsurf(i) = qss - hflx(i) = rch*(tskin(i)-t1(i)*prslki(i)) - hflx(i) = hflx(i)*(1.0/rho(i))*cpinv - evap(i) = elocp*rch*(qss-q0(i)) + hflx(i) = rch*(tskin(i)-t1(i)*prslki(i)) ! first guess hflx [W/m2] + evap(i) = elocp*rch*(qss-q0(i)) ! first guess evap [W/m2] + evap(i) = evap(i)*soil_stress_factor ! reduce evap for soil moisture stress + hflx(i) = min(max(-100.0,hflx(i)),500.0) ! set some arbitrary limits + evap(i) = min(max(-100.0,evap(i)),500.0) ! set some arbitrary limits + if(evap(i) + hflx(i) /= zero) then + hflx(i) = available_energy * hflx(i) / (abs(evap(i)) + abs(hflx(i))) + evap(i) = available_energy * evap(i) / (abs(evap(i)) + abs(hflx(i))) + else + hflx(i) = zero + evap(i) = zero + end if + hflx(i) = min(max(-100.0,hflx(i)),500.0) ! set some arbitrary limits + evap(i) = min(max(-100.0,evap(i)),500.0) ! set some arbitrary limits + hflx(i) = hflx(i)*(1.0/rho(i))*cpinv ! convert to expected units ep(i) = evap(i) - evap(i) = evap(i)*(1.0/rho(i))*hvapi + evap(i) = evap(i)*(1.0/rho(i))*hvapi ! convert to expected units t2mmp(i) = tskin(i) q2mp(i) = qsurf(i) gflux(i) = zero diff --git a/physics/SFC_Models/Land/sfc_land.meta b/physics/SFC_Models/Land/sfc_land.meta index b24a6f8af..b443c7efb 100644 --- a/physics/SFC_Models/Land/sfc_land.meta +++ b/physics/SFC_Models/Land/sfc_land.meta @@ -128,6 +128,38 @@ type = real kind = kind_phys intent = in +[dlwflx] + standard_name = surface_downwelling_longwave_flux_absorbed_by_ground_over_land + long_name = total sky surface downward longwave flux absorbed by the ground over land + units = W m-2 + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = in +[dswsfc] + standard_name = surface_downwelling_shortwave_flux + long_name = total sky surface downward shortwave flux + units = W m-2 + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = in +[sfalb] + standard_name = surface_albedo_for_diffused_shortwave_on_radiation_timestep + long_name = mean surface diffused shortwave albedo + units = frac + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = in +[sfcemis] + standard_name = surface_longwave_emissivity_over_land + long_name = surface lw emissivity in fraction over land + units = frac + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = in [eps] standard_name = ratio_of_dry_air_to_water_vapor_gas_constants long_name = rd/rv @@ -176,6 +208,14 @@ type = real kind = kind_phys intent = in +[con_sbc] + standard_name = stefan_boltzmann_constant + long_name = Stefan-Boltzmann constant + units = W m-2 K-4 + dimensions = () + type = real + kind = kind_phys + intent = in [sncovr1_lnd] standard_name = surface_snow_area_fraction_over_land_from_land long_name = surface snow area fraction over land for coupling @@ -228,7 +268,7 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys - intent = in + intent = in optional = True [q2mp_lnd] standard_name = specific_humidity_at_2m_over_land_from_land @@ -273,7 +313,7 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys - intent = out + intent = in optional = True [chh_lnd] standard_name = surface_drag_mass_flux_for_heat_and_moisture_in_air_over_land_from_land @@ -293,6 +333,14 @@ kind = kind_phys intent = in optional = True +[slc] + standard_name = volume_fraction_of_unfrozen_water_in_soil + long_name = volume fraction of unfrozen soil moisture + units = frac + dimensions = (horizontal_loop_extent,vertical_dimension_of_soil) + type = real + kind = kind_phys + intent = in [sncovr1] standard_name = surface_snow_area_fraction_over_land long_name = surface snow area fraction From 0dbea49b47b2371738248afde26b97d8af9f6e78 Mon Sep 17 00:00:00 2001 From: Ufuk Turuncoglu Date: Tue, 7 Jan 2025 13:35:28 -0600 Subject: [PATCH 7/7] fix space issue --- physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 b/physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 index 431ff3576..d4971efd9 100644 --- a/physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 +++ b/physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 @@ -420,8 +420,7 @@ end subroutine noahmpdrv_finalize subroutine noahmpdrv_run & !................................... ! --- inputs: - ( im, km, lsnowl, itime, ps, u1, v1, t1, q1, & - soiltyp,soilcol, & + ( im, km, lsnowl, itime, ps, u1, v1, t1, q1, soiltyp,soilcol,& vegtype, sigmaf, dlwflx, dswsfc, snet, delt, tg3, cm, ch, & prsl1, prslk1, prslki, prsik1, zf,pblh, dry, wind, slopetyp,& shdmin, shdmax, snoalb, sfalb, flag_iter,con_g, &