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

Redundant surface variable cleanup #659

Closed
wants to merge 9 commits into from
12 changes: 6 additions & 6 deletions physics/GFS_suite_interstitial.meta
Original file line number Diff line number Diff line change
Expand Up @@ -611,26 +611,26 @@
intent = inout
optional = F
[adjsfculw_lnd]
standard_name = surface_upwelling_longwave_flux_over_land_interstitial
long_name = surface upwelling longwave flux at current time over land (temporary use as interstitial)
standard_name = surface_upwelling_longwave_flux_over_land
long_name = surface upwelling longwave flux at current time over land
units = W m-2
dimensions = (horizontal_loop_extent)
type = real
kind = kind_phys
intent = in
optional = F
[adjsfculw_ice]
standard_name = surface_upwelling_longwave_flux_over_ice_interstitial
long_name = surface upwelling longwave flux at current time over ice (temporary use as interstitial)
standard_name = surface_upwelling_longwave_flux_over_ice
long_name = surface upwelling longwave flux at current time over ice
units = W m-2
dimensions = (horizontal_loop_extent)
type = real
kind = kind_phys
intent = in
optional = F
[adjsfculw_wat]
standard_name = surface_upwelling_longwave_flux_over_water_interstitial
long_name = surface upwelling longwave flux at current time over water (temporary use as interstitial)
standard_name = surface_upwelling_longwave_flux_over_water
long_name = surface upwelling longwave flux at current time over water
units = W m-2
dimensions = (horizontal_loop_extent)
type = real
Expand Down
48 changes: 19 additions & 29 deletions physics/GFS_surface_composites.F90
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ subroutine GFS_surface_composites_pre_run (im, lkm, frac_grid, flag_cice, cplflx
landfrac, lakefrac, lakedepth, oceanfrac, frland, dry, icy, use_flake, ocean, wet, &
hice, cice, snowd, snowd_wat, snowd_lnd, snowd_ice, tprcp, tprcp_wat, &
tprcp_lnd, tprcp_ice, uustar, uustar_wat, uustar_lnd, uustar_ice, &
weasd, weasd_wat, weasd_lnd, weasd_ice, ep1d_ice, tsfc, tsfco, tsfcl, tsfc_wat, &
tsfc_lnd, tsfc_ice, tisfc, tice, tsurf, tsurf_wat, tsurf_lnd, tsurf_ice, &
weasd, weasd_wat, weasd_lnd, weasd_ice, ep1d_ice, tsfc, tsfco, tsfcl,tsfci, tsfc_wat, &
tisfc, tice, &
gflx_ice, tgice, islmsk, islmsk_cice, slmsk, semis_rad, semis_wat, semis_lnd, semis_ice, &
qss, qss_wat, qss_lnd, qss_ice, hflx, hflx_wat, hflx_lnd, hflx_ice, &
min_lakeice, min_seaice, zorlo, zorll, zorli, errmsg, errflg)
Expand All @@ -48,9 +48,9 @@ subroutine GFS_surface_composites_pre_run (im, lkm, frac_grid, flag_cice, cplflx
real(kind=kind_phys), dimension(:), intent( out) :: frland
real(kind=kind_phys), dimension(:), intent(in ) :: snowd, tprcp, uustar, weasd, qss, hflx

real(kind=kind_phys), dimension(:), intent(inout) :: tsfc, tsfco, tsfcl, tisfc, tsurf
real(kind=kind_phys), dimension(:), intent(inout) :: tsfc, tsfco, tsfcl, tsfci, tisfc
real(kind=kind_phys), dimension(:), intent(inout) :: snowd_wat, snowd_lnd, snowd_ice, tprcp_wat, &
tprcp_lnd, tprcp_ice, tsfc_wat, tsfc_lnd, tsfc_ice, tsurf_wat,tsurf_lnd, tsurf_ice, &
tprcp_lnd, tprcp_ice, tsfc_wat, &
uustar_wat, uustar_lnd, uustar_ice, weasd_wat, weasd_lnd, weasd_ice, &
qss_wat, qss_lnd, qss_ice, hflx_wat, hflx_lnd, hflx_ice, ep1d_ice, gflx_ice
real(kind=kind_phys), dimension(:), intent( out) :: tice
Expand Down Expand Up @@ -179,7 +179,6 @@ subroutine GFS_surface_composites_pre_run (im, lkm, frac_grid, flag_cice, cplflx
if (wet(i)) then ! Water
uustar_wat(i) = uustar(i)
tsfc_wat(i) = tsfco(i)
tsurf_wat(i) = tsfco(i)
! weasd_wat(i) = weasd(i)
! snowd_wat(i) = snowd(i)
weasd_wat(i) = zero
Expand All @@ -195,12 +194,10 @@ subroutine GFS_surface_composites_pre_run (im, lkm, frac_grid, flag_cice, cplflx
if (dry(i)) then ! Land
uustar_lnd(i) = uustar(i)
weasd_lnd(i) = weasd(i)
tsfc_lnd(i) = tsfcl(i)
tsurf_lnd(i) = tsfcl(i)
snowd_lnd(i) = snowd(i)
semis_lnd(i) = semis_rad(i)
qss_lnd(i) = qss(i)
hflx_lnd(i) = hflx(i)
qss_lnd(i) = qss(i)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please revert indentation changes in lines 198 and 199

hflx_lnd(i) = hflx(i)
! DH*
else
zorll(i) = huge
Expand All @@ -209,8 +206,7 @@ subroutine GFS_surface_composites_pre_run (im, lkm, frac_grid, flag_cice, cplflx
if (icy(i)) then ! Ice
uustar_ice(i) = uustar(i)
weasd_ice(i) = weasd(i)
tsfc_ice(i) = tisfc(i)
tsurf_ice(i) = tisfc(i)
tsfci(i) = tisfc(i)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, = were aligned previously.

snowd_ice(i) = snowd(i)
ep1d_ice(i) = zero
gflx_ice(i) = zero
Expand Down Expand Up @@ -352,11 +348,11 @@ subroutine GFS_surface_composites_post_run (
zorl, zorlo, zorll, zorli, &
cd, cd_wat, cd_lnd, cd_ice, cdq, cdq_wat, cdq_lnd, cdq_ice, rb, rb_wat, rb_lnd, rb_ice, stress, stress_wat, stress_lnd, &
stress_ice, ffmm, ffmm_wat, ffmm_lnd, ffmm_ice, ffhh, ffhh_wat, ffhh_lnd, ffhh_ice, uustar, uustar_wat, uustar_lnd, &
uustar_ice, fm10, fm10_wat, fm10_lnd, fm10_ice, fh2, fh2_wat, fh2_lnd, fh2_ice, tsurf, tsurf_wat, tsurf_lnd, tsurf_ice, &
uustar_ice, fm10, fm10_wat, fm10_lnd, fm10_ice, fh2, fh2_wat, fh2_lnd, fh2_ice, &
cmm, cmm_wat, cmm_lnd, cmm_ice, chh, chh_wat, chh_lnd, chh_ice, gflx, gflx_wat, gflx_lnd, gflx_ice, ep1d, ep1d_wat, &
ep1d_lnd, ep1d_ice, weasd, weasd_wat, weasd_lnd, weasd_ice, snowd, snowd_wat, snowd_lnd, snowd_ice, tprcp, tprcp_wat, &
tprcp_lnd, tprcp_ice, evap, evap_wat, evap_lnd, evap_ice, hflx, hflx_wat, hflx_lnd, hflx_ice, qss, qss_wat, qss_lnd, &
qss_ice, tsfc, tsfco, tsfcl, tsfc_wat, tsfc_lnd, tsfc_ice, tisfc, tice, hice, cice, min_seaice, tiice, stc, errmsg, errflg)
qss_ice, tsfc, tsfco, tsfcl, tsfci, tsfc_wat, tisfc, tice, hice, cice, min_seaice, tiice, stc, errmsg, errflg)

implicit none

Expand All @@ -367,13 +363,13 @@ subroutine GFS_surface_composites_post_run (
real(kind=kind_phys), dimension(:), intent(in) :: landfrac, lakefrac, oceanfrac, &
cd_wat, cd_lnd, cd_ice, cdq_wat, cdq_lnd, cdq_ice, rb_wat, rb_lnd, rb_ice, stress_wat, &
stress_lnd, stress_ice, ffmm_wat, ffmm_lnd, ffmm_ice, ffhh_wat, ffhh_lnd, ffhh_ice, uustar_wat, uustar_lnd, uustar_ice, &
fm10_wat, fm10_lnd, fm10_ice, fh2_wat, fh2_lnd, fh2_ice, tsurf_wat, tsurf_lnd, tsurf_ice, cmm_wat, cmm_lnd, cmm_ice, &
fm10_wat, fm10_lnd, fm10_ice, fh2_wat, fh2_lnd, fh2_ice, cmm_wat, cmm_lnd, cmm_ice, &
chh_wat, chh_lnd, chh_ice, gflx_wat, gflx_lnd, gflx_ice, ep1d_wat, ep1d_lnd, ep1d_ice, weasd_wat, weasd_lnd, weasd_ice, &
snowd_wat, snowd_lnd, snowd_ice,tprcp_wat, tprcp_lnd, tprcp_ice, evap_wat, evap_lnd, evap_ice, hflx_wat, hflx_lnd, &
hflx_ice, qss_wat, qss_lnd, qss_ice, tsfc_wat, tsfc_lnd, tsfc_ice
hflx_ice, qss_wat, qss_lnd, qss_ice, tsfc_wat

real(kind=kind_phys), dimension(:), intent(inout) :: zorl, zorlo, zorll, zorli, cd, cdq, rb, stress, ffmm, ffhh, uustar, fm10, &
fh2, tsurf, cmm, chh, gflx, ep1d, weasd, snowd, tprcp, evap, hflx, qss, tsfc, tsfco, tsfcl, tisfc
fh2, cmm, chh, gflx, ep1d, weasd, snowd, tprcp, evap, hflx, qss, tsfc, tsfco, tsfcl, tsfci, tisfc

real(kind=kind_phys), dimension(:), intent(in ) :: tice ! interstitial sea ice temperature
real(kind=kind_phys), dimension(:), intent(inout) :: hice, cice
Expand Down Expand Up @@ -415,8 +411,6 @@ subroutine GFS_surface_composites_post_run (
uustar(i) = txl*uustar_lnd(i) + txi*uustar_ice(i) + txo*uustar_wat(i)
fm10(i) = txl*fm10_lnd(i) + txi*fm10_ice(i) + txo*fm10_wat(i)
fh2(i) = txl*fh2_lnd(i) + txi*fh2_ice(i) + txo*fh2_wat(i)
!tsurf(i) = txl*tsurf_lnd(i) + txi*tice(i) + txo*tsurf_wat(i)
!tsurf(i) = txl*tsurf_lnd(i) + txi*tsurf_ice(i) + txo*tsurf_wat(i) ! not used again! Moorthi
cmm(i) = txl*cmm_lnd(i) + txi*cmm_ice(i) + txo*cmm_wat(i)
chh(i) = txl*chh_lnd(i) + txi*chh_ice(i) + txo*chh_wat(i)
!gflx(i) = txl*gflx_lnd(i) + txi*gflx_ice(i) + txo*gflx_wat(i)
Expand All @@ -438,10 +432,9 @@ subroutine GFS_surface_composites_post_run (
qss(i) = txl*qss_lnd(i) + txi*qss_ice(i) + txo*qss_wat(i)
gflx(i) = txl*gflx_lnd(i) + txi*gflx_ice(i) + txo*gflx_wat(i)
endif
tsfc(i) = txl*tsfc_lnd(i) + txi*tice(i) + txo*tsfc_wat(i)
tsfc(i) = txl*tsfcl(i) + txi*tice(i) + txo*tsfc_wat(i)

if (dry(i)) then
tsfcl(i) = tsfc_lnd(i) ! over land
elseif (wet(i)) then
tsfcl(i) = tsfc_wat(i) ! over water
else
Expand All @@ -452,14 +445,14 @@ subroutine GFS_surface_composites_post_run (
elseif (icy(i)) then
tsfco(i) = tice(i) ! over lake or ocean ice when uncoupled
else
tsfco(i) = tsfc_lnd(i) ! over land
tsfco(i) = tsfcl(i) ! over land
endif
if (icy(i)) then
tisfc(i) = tice(i) ! over lake or ocean ice when uncoupled
elseif (wet(i)) then
tisfc(i) = tsfc_wat(i) ! over lake or ocean when uncoupled
else
tisfc(i) = tsfc_lnd(i) ! over land
tisfc(i) = tsfcl(i) ! over land
endif
! for coupled model ocean will replace this
! if (icy(i)) tisfc(i) = tsfc_ice(i) ! over ice when uncoupled
Expand Down Expand Up @@ -499,8 +492,6 @@ subroutine GFS_surface_composites_post_run (
uustar(i) = uustar_lnd(i)
fm10(i) = fm10_lnd(i)
fh2(i) = fh2_lnd(i)
!tsurf(i) = tsurf_lnd(i)
tsfcl(i) = tsfc_lnd(i) ! over land
tsfc(i) = tsfcl(i)
tsfco(i) = tsfc(i)
tisfc(i) = tsfc(i)
Expand All @@ -527,7 +518,6 @@ subroutine GFS_surface_composites_post_run (
uustar(i) = uustar_wat(i)
fm10(i) = fm10_wat(i)
fh2(i) = fh2_wat(i)
!tsurf(i) = tsurf_wat(i)
tsfco(i) = tsfc_wat(i) ! over lake (and ocean when uncoupled)
tsfc(i) = tsfco(i)
tsfcl(i) = tsfc(i)
Expand Down Expand Up @@ -555,7 +545,6 @@ subroutine GFS_surface_composites_post_run (
fm10(i) = fm10_ice(i)
fh2(i) = fh2_ice(i)
stress(i) = stress_ice(i)
!tsurf(i) = tsurf_ice(i)
cmm(i) = cmm_ice(i)
chh(i) = chh_ice(i)
gflx(i) = gflx_ice(i)
Expand All @@ -564,22 +553,23 @@ subroutine GFS_surface_composites_post_run (
snowd(i) = snowd_ice(i)
!tprcp(i) = cice(i)*tprcp_ice(i) + (one-cice(i))*tprcp_wat(i)
qss(i) = qss_ice(i)
tsfc(i) = tsfc_ice(i)
tsfc(i) = tsfci(i)
evap(i) = evap_ice(i)
hflx(i) = hflx_ice(i)
qss(i) = qss_ice(i)
tisfc(i) = tice(i)
if (.not. flag_cice(i)) then
! tisfc(i) = tice(i) ! over lake ice (and sea ice when uncoupled)
zorl(i) = cice(i) * zorli(i) + (one - cice(i)) * zorlo(i)
tsfc(i) = tsfc_ice(i) ! over lake (and ocean when uncoupled)
tsfc(i) = tsfci(i) ! over lake (and ocean when uncoupled)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove extra blank line

elseif (wet(i)) then
if (cice(i) >= min_seaice) then ! this was already done for lake ice in sfc_sice
txi = cice(i)
txo = one - txi
evap(i) = txi * evap_ice(i) + txo * evap_wat(i)
hflx(i) = txi * hflx_ice(i) + txo * hflx_wat(i)
tsfc(i) = txi * tsfc_ice(i) + txo * tsfc_wat(i)
tsfc(i) = txi * tsfci(i) + txo * tsfc_wat(i)
stress(i) = txi * stress_ice(i) + txo * stress_wat(i)
qss(i) = txi * qss_ice(i) + txo * qss_wat(i)
ep1d(i) = txi * ep1d_ice(i) + txo * ep1d_wat(i)
Expand Down
Loading