Skip to content

Commit

Permalink
Merge pull request #7 from barlage/fix_noahmp_todo
Browse files Browse the repository at this point in the history
Fix noahmp driver TODO
  • Loading branch information
climbfuji authored Feb 26, 2021
2 parents f2d2b12 + bfba6d7 commit 659a891
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
2 changes: 1 addition & 1 deletion physics/noahmp_tables.f90
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,7 @@ module noahmp_tables
real :: refkdt_table = 3.0 !parameter in the surface runoff parameterization
real :: frzk_table =0.15 !frozen ground parameter
real :: zbot_table = -8.0 !depth [m] of lower boundary soil temperature
real :: czil_table = 0.01 !parameter used in the calculation of the roughness length for heat
real :: czil_table = 0.1 !parameter used in the calculation of the roughness length for heat

! mptable.tbl radiation parameters

Expand Down
22 changes: 10 additions & 12 deletions physics/sfc_noahmp_drv.F90
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ subroutine noahmpdrv_run &
real(kind=kind_phys), parameter :: a4 = 35.86
real(kind=kind_phys), parameter :: a23m4 = a2*(a3-a4)

real, parameter :: undefined = -1.e36 ! TODO change to smaller value
real, parameter :: undefined = 9.99e20_kind_phys

integer, parameter :: nsoil = 4 ! hardwired to Noah
integer, parameter :: nsnow = 3 ! max. snow layers
Expand Down Expand Up @@ -657,7 +657,7 @@ subroutine noahmpdrv_run &
cloud_water_forcing = -9999.0
sw_radiation_forcing = dswsfc(i)
radiation_lw_forcing = dlwflx(i)
precipitation_forcing = rhoh2o * tprcp(i) / delt !1000.0 * tprcp(i) / delt
precipitation_forcing = 1000.0 * tprcp(i) / delt
precip_convective = rainc_mp(i)
precip_non_convective = rainn_mp(i)
precip_sh_convective = 0.
Expand All @@ -681,28 +681,27 @@ subroutine noahmpdrv_run &
soil_liquid_vol = slc(i,:)
soil_moisture_vol = smc(i,:)
temperature_canopy_air = tahxy(i)
vapor_pres_canopy_air = (air_pressure_surface*spec_humidity_forcing)/(0.622+spec_humidity_forcing)
! TODO recalculated? set to eahxy
vapor_pres_canopy_air = eahxy(i)
canopy_wet_fraction = fwetxy(i)
canopy_liquid = canliqxy(i)
canopy_ice = canicexy(i)
temperature_leaf = tvxy(i)
temperature_ground = tgxy(i)
spec_humidity_surface = undefined ! doesn't need inout; should be out
snowfall = qsnowxy(i) ! doesn't need inout; should be out
! rainfall ! doesn't need inout; should be out TODO
rainfall = -9999.0 ! doesn't need inout; should be out
snow_levels = nint(snowxy(i))
interface_depth = zsnsoxy(i,:)
snow_depth = snwdph(i) * 0.001 ! convert from mm to m
snow_water_equiv = weasd(i)
if (snow_water_equiv /= 0.0 .and. snow_depth == 0.0) then !TODO this should be done elsewhere
if (snow_water_equiv /= 0.0 .and. snow_depth == 0.0) then
snow_depth = 10.0 * snow_water_equiv /1000.0
endif
snow_level_ice = snicexy(i,:)
snow_level_liquid = snliqxy(i,:)
depth_water_table = zwtxy(i)
aquifer_water = waxy(i)
saturated_water = waxy(i) ! why not wta !!! TODO
saturated_water = wtxy(i)
lake_water = wslakexy(i)
leaf_carbon = lfmassxy(i)
root_carbon = rtmassxy(i)
Expand Down Expand Up @@ -753,8 +752,8 @@ subroutine noahmpdrv_run &
if ( vegetation_category == isice_table ) then

if (precipitation_forcing > 0.0) then
if (srflag(i) > 0.0) then ! TODO rain/snow flag, one condition is enough?
snowfall = srflag(i) * precipitation_forcing/10.0 ! still use rho water?
if (srflag(i) > 0.0) then
snowfall = srflag(i) * precipitation_forcing ! need snowfall for glacier snow age
endif
endif

Expand Down Expand Up @@ -926,7 +925,7 @@ subroutine noahmpdrv_run &
snicexy (i,:) = snow_level_ice
snliqxy (i,:) = snow_level_liquid
snwdph (i) = snow_depth * 1000.0 ! convert from mm to m
canopy (i) = canopy_ice + canopy_liquid ! TODO check units
canopy (i) = canopy_ice + canopy_liquid
canliqxy (i) = canopy_liquid
canicexy (i) = canopy_ice
zwtxy (i) = depth_water_table
Expand All @@ -947,8 +946,7 @@ subroutine noahmpdrv_run &

snowc (i) = snow_cover_fraction
sncovr1 (i) = snow_cover_fraction
! TODO check this eqn shoud lthis be q2 not q1 why two con_cp
qsurf (i) = q1(i) + evap(i) / (con_hvap / con_cp * density * con_cp * ch(i) * wind(i))
qsurf (i) = q1(i) + evap(i) / (con_hvap / con_cp * density * ch(i) * wind(i))
tskin (i) = temperature_radiative
tsurf (i) = temperature_radiative
tvxy (i) = temperature_leaf
Expand Down

0 comments on commit 659a891

Please sign in to comment.