Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update RUC snowfall variables, add to diagnostic and restart output #224

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 12 additions & 15 deletions physics/GFS_debug.F90
Original file line number Diff line number Diff line change
Expand Up @@ -196,16 +196,18 @@ subroutine GFS_diagtoscreen_run (Model, Statein, Stateout, Sfcprop, Coupling,
end if
! CCPP/RUC only
if (Model%lsm == Model%lsm_ruc) then
call print_var(mpirank,omprank, blkno, 'Sfcprop%sh2o', Sfcprop%sh2o)
call print_var(mpirank,omprank, blkno, 'Sfcprop%smois', Sfcprop%smois)
call print_var(mpirank,omprank, blkno, 'Sfcprop%tslb', Sfcprop%tslb)
call print_var(mpirank,omprank, blkno, 'Sfcprop%zs', Sfcprop%zs)
call print_var(mpirank,omprank, blkno, 'Sfcprop%clw_surf', Sfcprop%clw_surf)
call print_var(mpirank,omprank, blkno, 'Sfcprop%qwv_surf', Sfcprop%qwv_surf)
call print_var(mpirank,omprank, blkno, 'Sfcprop%cndm_surf', Sfcprop%cndm_surf)
call print_var(mpirank,omprank, blkno, 'Sfcprop%flag_frsoil', Sfcprop%flag_frsoil)
call print_var(mpirank,omprank, blkno, 'Sfcprop%rhofr', Sfcprop%rhofr)
call print_var(mpirank,omprank, blkno, 'Sfcprop%tsnow', Sfcprop%tsnow)
call print_var(mpirank,omprank, blkno, 'Sfcprop%sh2o', Sfcprop%sh2o)
call print_var(mpirank,omprank, blkno, 'Sfcprop%smois', Sfcprop%smois)
call print_var(mpirank,omprank, blkno, 'Sfcprop%tslb', Sfcprop%tslb)
call print_var(mpirank,omprank, blkno, 'Sfcprop%zs', Sfcprop%zs)
call print_var(mpirank,omprank, blkno, 'Sfcprop%clw_surf', Sfcprop%clw_surf)
call print_var(mpirank,omprank, blkno, 'Sfcprop%qwv_surf', Sfcprop%qwv_surf)
call print_var(mpirank,omprank, blkno, 'Sfcprop%cndm_surf', Sfcprop%cndm_surf)
call print_var(mpirank,omprank, blkno, 'Sfcprop%flag_frsoil', Sfcprop%flag_frsoil)
call print_var(mpirank,omprank, blkno, 'Sfcprop%rhofr', Sfcprop%rhofr)
call print_var(mpirank,omprank, blkno, 'Sfcprop%tsnow', Sfcprop%tsnow)
call print_var(mpirank,omprank, blkno, 'Sfcprop%snowfallac ', Sfcprop%snowfallac)
call print_var(mpirank,omprank, blkno, 'Sfcprop%acsnow ', Sfcprop%acsnow)
end if
! Radtend
call print_var(mpirank,omprank, blkno, 'Radtend%sfcfsw%upfxc', Radtend%sfcfsw(:)%upfxc)
Expand Down Expand Up @@ -317,11 +319,6 @@ subroutine GFS_diagtoscreen_run (Model, Statein, Stateout, Sfcprop, Coupling,
call print_var(mpirank,omprank, blkno, 'Diag%tdomzr ', Diag%tdomzr)
call print_var(mpirank,omprank, blkno, 'Diag%tdomip ', Diag%tdomip)
call print_var(mpirank,omprank, blkno, 'Diag%tdoms ', Diag%tdoms)
! CCPP/RUC only
if (Model%lsm == Model%lsm_ruc) then
call print_var(mpirank,omprank, blkno, 'Diag%snowfallac ', Diag%snowfallac)
call print_var(mpirank,omprank, blkno, 'Diag%acsnow ', Diag%acsnow)
endif
call print_var(mpirank,omprank, blkno, 'Diag%skebu_wts ', Diag%skebu_wts)
call print_var(mpirank,omprank, blkno, 'Diag%skebv_wts ', Diag%skebv_wts)
call print_var(mpirank,omprank, blkno, 'Diag%sppt_wts ', Diag%sppt_wts)
Expand Down
2 changes: 1 addition & 1 deletion physics/sfc_drv.f
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ end subroutine lsm_noah_finalize
!! | trans | transpiration_flux | total plant transpiration rate | kg m-2 s-1 | 1 | real | kind_phys | inout | F |
!! | tsurf | surface_skin_temperature_after_iteration | surface skin temperature after iteration | K | 1 | real | kind_phys | inout | F |
!! | zorl | surface_roughness_length | surface roughness length | cm | 1 | real | kind_phys | inout | F |
!! | sncovr1 | surface_snow_area_fraction_for_diagnostics | surface snow area fraction | frac | 1 | real | kind_phys | inout | F |
!! | sncovr1 | surface_snow_area_fraction | surface snow area fraction | frac | 1 | real | kind_phys | inout | F |
!! | qsurf | surface_specific_humidity | surface specific humidity | kg kg-1 | 1 | real | kind_phys | inout | F |
!! | gflux | upward_heat_flux_in_soil | upward soil heat flux | W m-2 | 1 | real | kind_phys | inout | F |
!! | drain | subsurface_runoff_flux | subsurface runoff flux | g m-2 s-1 | 1 | real | kind_phys | inout | F |
Expand Down
82 changes: 50 additions & 32 deletions physics/sfc_drv_ruc.F90
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ end subroutine lsm_ruc_finalize
! evbs - real, direct soil evaporation (m/s) im !
! evcw - real, canopy water evaporation (m/s) im !
! sbsno - real, sublimation/deposit from snopack (m/s) im !
! snowc - real, fractional snow cover im !
! stm - real, total soil column moisture content (m) im !
! zorl - real, surface roughness im !
! wet1 - real, normalized soil wetness im !
Expand Down Expand Up @@ -167,8 +166,7 @@ end subroutine lsm_ruc_finalize
!! | snow | lwe_thickness_of_snow_amount_from_previous_timestep | snow amount from previous timestep | m | 1 | real | kind_phys | in | F |
!! | graupel | lwe_thickness_of_graupel_amount_from_previous_timestep | graupel amount from previous timestep | m | 1 | real | kind_phys | in | F |
!! | srflag | flag_for_precipitation_type | snow/rain flag for precipitation | flag | 1 | real | kind_phys | in | F |
!! | sncovr1 | surface_snow_area_fraction_for_diagnostics | surface snow area fraction | frac | 1 | real | kind_phys | inout | F |
!! | snowc | surface_snow_area_fraction | surface snow area fraction | frac | 1 | real | kind_phys | inout | F |
!! | sncovr1 | surface_snow_area_fraction | surface snow area fraction | frac | 1 | real | kind_phys | inout | F |
!! | weasd | water_equivalent_accumulated_snow_depth | water equiv of acc snow depth over land and sea ice | mm | 1 | real | kind_phys | inout | F |
!! | snwdph | surface_snow_thickness_water_equivalent | water equivalent snow depth over land | mm | 1 | real | kind_phys | inout | F |
!! | sr | ratio_of_snowfall_to_rainfall | snow ratio: ratio of snow to total precipitation | frac | 1 | real | kind_phys | in | F |
Expand Down Expand Up @@ -272,7 +270,7 @@ subroutine lsm_ruc_run &
! --- outputs
& sncovr1, qsurf, gflux, drain, evap, hflx, &
& rhosnf, runof, runoff, srunoff, &
& chh, cmm, evbs, evcw, sbsno, snowc, stm, wet1, &
& chh, cmm, evbs, evcw, sbsno, stm, wet1, &
& acsnow, snowfallac, &
& flag_init, flag_restart, errmsg, errflg &
& )
Expand Down Expand Up @@ -325,7 +323,7 @@ subroutine lsm_ruc_run &
real (kind=kind_phys), dimension(im), intent(inout) :: sncovr1, &
& qsurf , gflux , evap , runof , drain , &
& runoff, srunoff, hflx, cmm, chh, &
& rhosnf, evbs, evcw, sbsno, snowc, stm, wet1, &
& rhosnf, evbs, evcw, sbsno, stm, wet1, &
& acsnow, snowfallac

logical, intent(in) :: flag_init, flag_restart
Expand All @@ -335,14 +333,16 @@ subroutine lsm_ruc_run &
! --- locals:
real (kind=kind_phys), dimension(im) :: rch, rho, &
& q0, qs1, wind, weasd_old, snwdph_old, &
& tprcp_old, srflag_old, sr_old, tskin_old, canopy_old
& tprcp_old, srflag_old, sr_old, tskin_old, canopy_old, &
& tsnow_old, snowfallac_old, acsnow_old, sfalb_old, &
& sfcqv_old, sfcqc_old, wet1_old, zorl_old, sncovr1_old

real (kind=kind_phys), dimension(lsoil_ruc) :: et

real (kind=kind_phys), dimension(im,lsoil_ruc,1) :: smsoil, &
real (kind=kind_phys), dimension(im,lsoil_ruc,1) :: smsoil, &
slsoil, stsoil, smfrsoil, keepfrsoil

real (kind=kind_phys), dimension(im,lsoil_ruc) :: smois_old, &
real (kind=kind_phys), dimension(im,lsoil_ruc) :: smois_old, &
& tslb_old, sh2o_old, keepfr_old, smfrkeep_old

real (kind=kind_phys),dimension (im,1,1) :: &
Expand Down Expand Up @@ -507,16 +507,24 @@ subroutine lsm_ruc_run &

do i = 1, im ! i - horizontal loop
if (flag(i) .and. flag_guess(i)) then
!if(me==0 .and. i==ipr) print *,'before call to RUC guess run', i
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)
sr_old(i) = sr(i)

!> - Save land-related prognostic fields for guess run.
!if(me==0 .and. i==ipr) print *,'before call to RUC guess run', i
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)
sr_old(i) = sr(i)
tsnow_old(i) = tsnow(i)
snowfallac_old(i) = snowfallac(i)
acsnow_old(i) = acsnow(i)
sfalb_old(i) = sfalb(i)
sfcqv_old(i) = sfcqv(i)
sfcqc_old(i) = sfcqc(i)
wet1_old(i) = wet1(i)
zorl_old(i) = zorl(i)
sncovr1_old(i) = sncovr1(i)
do k = 1, lsoil_ruc
smois_old(i,k) = smois(i,k)
tslb_old(i,k) = tslb(i,k)
Expand Down Expand Up @@ -544,7 +552,6 @@ subroutine lsm_ruc_run &
evcw (i) = 0.0
trans(i) = 0.0
sbsno(i) = 0.0
snowc(i) = 0.0

!local i,j arrays
dew(i,j) = 0.0
Expand Down Expand Up @@ -799,7 +806,6 @@ subroutine lsm_ruc_run &
endif
endif

!sncovr(i,j) = snowc(i)
sncovr(i,j) = sncovr1(i)

chs(i,j) = ch(i) * wind(i) ! compute conductance
Expand Down Expand Up @@ -1017,12 +1023,12 @@ subroutine lsm_ruc_run &
!sbsno(i) = esnow(i,j)
!snohf(i) = snoh(i,j)

sfcdew(i) = dew(i,j)
qsurf(i) = qsfc(i,j)
snowc(i) = sncovr(i,j)
stm(i) = soilm(i,j)
tsurf(i) = soilt(i,j)
tice(i) = tsurf(i)
sfcdew(i) = dew(i,j)
qsurf(i) = qsfc(i,j)
sncovr1(i) = sncovr(i,j)
stm(i) = soilm(i,j)
tsurf(i) = soilt(i,j)
tice(i) = tsurf(i)
! --- ... units [m/s] = [g m-2 s-1]
runof (i) = runoff1(i,j)
drain (i) = runoff2(i,j)
Expand All @@ -1039,6 +1045,10 @@ subroutine lsm_ruc_run &
runoff(i) = runoff(i) + (drain(i)+runof(i)) * delt * 0.001 ! kg m-2
srunoff(i) = srunoff(i) + runof(i) * delt * 0.001 ! kg m-2

! --- ... accumulated frozen precipitation (accumulation in lsmruc)
snowfallac(i) = snfallac(i,j) ! kg m-2
acsnow(i) = acsn(i,j) ! kg m-2

! --- ... unit conversion (from m to mm)
snwdph(i) = snowh(i,j) * 1000.0

Expand Down Expand Up @@ -1094,13 +1104,21 @@ subroutine lsm_ruc_run &
if(debug_print) print *,'end ',i,flag_guess(i),flag_iter(i)
if (flag_guess(i)) then
if(debug_print) print *,'guess run'
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)

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)
tsnow(i) = tsnow_old(i)
snowfallac(i) = snowfallac_old(i)
acsnow(i) = acsnow_old(i)
sfalb(i) = sfalb_old(i)
sfcqv(i) = sfcqv_old(i)
sfcqc(i) = sfcqc_old(i)
wet1(i) = wet1_old(i)
zorl(i) = zorl_old(i)
sncovr1(i) = sncovr1_old(i)
do k = 1, lsoil_ruc
smois(i,k) = smois_old(i,k)
tslb(i,k) = tslb_old(i,k)
Expand Down