Skip to content

Commit

Permalink
Introduce 6 new variables to be used by skinsst
Browse files Browse the repository at this point in the history
  • Loading branch information
ShanSunNOAA committed Nov 29, 2024
1 parent 814b405 commit 760af27
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 216 deletions.
90 changes: 17 additions & 73 deletions physics/SFC_Layer/UFS/skinsst.f90
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ subroutine skinsst_run( &
dlwflx, & ! absorbed downwelling LW flux in
sfcnsw, & ! net SW flux, pos.down in
tsfco, & ! ocean/lake top layer temperature inout
tref, & ! foundation temperature in
psfc, & ! surface pressure in
wind, & ! atm. mid-layer 1 wind in
stress, & ! wind stress (N/m^2) in
Expand All @@ -89,13 +88,12 @@ subroutine skinsst_run( &
eps, & ! ratio of gas constants, rd/rv in
sbc, & ! stefan-boltzmann constant in
tskin, & ! skin temp inout
xzts, & ! repurposed: previous tskin inout
xt, & ! repurposed: lake mixed layer temperature inout
xv, & ! repurposed: extinction coefficient inout
xz, & ! repurposed: lake ice thickness inout
xu, & ! repurposed: previous lake ice surf. temp inout
zm, & ! repurposed: previous lake sfc heat flux inout
xs, & ! repurposed: not used, held in reserve inout
skinold, & ! repurposed: previous tskin inout
temwat, & ! repurposed: lake mixed layer temperature inout
xtinct, & ! repurposed: extinction coefficient inout
thkice, & ! repurposed: lake ice thickness inout
ticold, & ! repurposed: previous lake ice surf. temp inout
flxold, & ! repurposed: previous lake sfc heat flux inout
qsat, & ! saturation specif. humidity out
z_c, & ! sub-layer cooling thickness out
dt_warm, & ! warm-layer surface warming amount out
Expand Down Expand Up @@ -123,21 +121,21 @@ subroutine skinsst_run( &
logical, intent(in) :: lseaspray
real (kind=kind_phys), dimension(:), intent(in) :: xlon,xlat, &
sfcemis, dlwflx, sfcnsw, wind, psfc, plyr1, tlyr1, qlyr1, &
ulyr1, vlyr1, cm, ch, compres, stress, fm, fm10,oceanfrac,tref
ulyr1, vlyr1, cm, ch, compres, stress, fm, fm10,oceanfrac
real (kind=kind_phys), intent(in) :: timestep, hvap, cp, rd, eps, &
sbc

! --- inout:
real (kind=kind_phys), dimension(:), intent(inout), target :: &
ulwflx, tsfco, tskin, dt_cool, xzts, xs, xt, xu, xv, xz, zm
real (kind=kind_phys), dimension(:), intent(inout) :: &
ulwflx, tsfco, tskin, dt_cool

real, dimension(:), pointer :: &
skinold, & ! previous skin temp inout
temwat, & ! lake mixed layer temperature inout
xtinct, & ! extinction coefficient inout
thkice, & ! lake ice thickness inout
ticold, & ! previous lake ice surf. temp inout
flxold ! previous lake sfc heat flux inout
real (kind=kind_phys), dimension(:), intent(inout) :: &
skinold, & ! previous skin temperature
xtinct, & ! SW extinction coefficient
temwat, & ! lake mixed layer temperature
thkice, & ! lake ice thickness
ticold, & ! previous lake ice surface temperature
flxold ! previous lake surface heatflux

! --- output:
real (kind=kind_phys), dimension(:), intent(out) :: evap, hflx, &
Expand Down Expand Up @@ -182,43 +180,7 @@ subroutine skinsst_run( &
! --- temporary:
! print '(a,2f8.2,l5)','entering skinsst_run, testpt =',testlon,testlat

! --- point to unused arrays inherited from nsst.
! --- IMPORTANT: these arrays must remain untouched between calls to skinsst.
! --- we keep nsst array names to simplify switching between nsst and skinsst.

skinold => xzts
temwat => xt
xtinct => xv
thkice => xz
ticold => xu
flxold => zm

do i = 1,im

details=.false.

! --- check which arrays inherited from NSST are touched outside skinsst.
! if (xzts(i).ne.-.03125) details=.true.
if (xs(i).ne.-.03125) details=.true.
! if (xt(i).ne.-.03125) details=.true.
! if (xu(i).ne.-.03125) details=.true.
! if (xv(i).ne.-.03125) details=.true.
! if (xz(i).ne.-.03125) details=.true.
! if (zm(i).ne.-.03125) details=.true.
! if (c_0(i).ne.-.03125) details=.true.
! if (c_d(i).ne.-.03125) details=.true.
! if (w_0(i).ne.-.03125) details=.true.
! if (w_d(i).ne.-.03125) details=.true.
!if (d_conv(i).ne.-.03125) details=.true.
! if (ifd(i).ne.-.03125) details=.true.
if (details) then
alon=xlon(i)*rad2deg
alat=xlat(i)*rad2deg
if (doprint(alon,alat)) &
print '(a,2f8.2/13f6.3)','error: arrays overwritten at lon,lat=', &
alon,alat,xs(i)
end if

if (wet(i)) then

alon=xlon(i)*rad2deg
Expand Down Expand Up @@ -254,7 +216,6 @@ subroutine skinsst_run( &
! 'compres',compres(i), & ! midlyr-to-sfc adiab.compression
'skinold',skinold(i)-frz, & ! previous tskin
'dcoolE2',dt_cool(i)*100., & ! previous dtcool
! 'tref',tref(i)-frz, & ! foundation temp
'tsfco',tsfco(i)-frz ! ocean top layer temperature
print '(5(a13,"=",l2))','lseaspray',lseaspray
if (oceanfrac(i).eq.0.) print '(2f7.2,a)',alon,alat,' is -lake- point'
Expand Down Expand Up @@ -471,22 +432,6 @@ subroutine skinsst_run( &
evap(i) = evap(i)/(rho_air * hvap) ! m/sec

end if ! wet

! --- check which arrays inherited from NSST are touched outside skinsst.
! xzts(i) = -.03125
xs(i) = -.03125
! xt(i) = -.03125
! xu(i) = -.03125
! xv(i) = -.03125
! xz(i) = -.03125
! zm(i) = -.03125
! c_0(i) = -.03125
! c_d(i) = -.03125
! w_0(i) = -.03125
! w_d(i) = -.03125
!d_conv(i) = -.03125
! ifd(i) = -.03125

end do ! im loop

return
Expand Down Expand Up @@ -685,7 +630,7 @@ subroutine enloan(delt,surflx,thkice,temice,ticold,temwat,alon,alat,doprint)
ticold ! previous ice surface temperature

real :: &
tmelt=frz-.2, & ! melting point (deg)
tmelt=frz-.2, & ! melting point (deg K)
thin=.01, & ! min.ice thickness
rhoice=917., & ! ice density (kg/m^3)
rhowat=1000., & ! water density (kg/m^3)
Expand All @@ -695,7 +640,6 @@ subroutine enloan(delt,surflx,thkice,temice,ticold,temwat,alon,alat,doprint)
! fluctn=3./3600, & ! limit on temice fluctuation (deg/sec)
fluctn=2./3600, & ! limit on temice fluctuation (deg/sec)
spcifh=4190., & ! specific heat of water (J/kg/deg)
! dpth=20. ! nominal mixed layer depth (m)
! dpth=30. ! nominal mixed layer depth (m)
dpth=40. ! nominal mixed layer depth (m)
real :: tnew,borrow,paybak,avail
Expand Down
170 changes: 27 additions & 143 deletions physics/SFC_Layer/UFS/skinsst.meta
Original file line number Diff line number Diff line change
Expand Up @@ -125,42 +125,6 @@
type = real
kind = kind_phys
intent = inout
#[temice]
# standard_name = lake_ice_surface_temperature
# long_name = lake_ice_surface_temperature
# units = K
# dimensions = (horizontal_loop_extent)
# type = real
# kind = kind_phys
# intent = inout
# optional = True
#[thkice]
# standard_name = lake_ice_thickness
# long_name = lake_ice_thickness
# units = m
# dimensions = (horizontal_loop_extent)
# type = real
# kind = kind_phys
# intent = inout
# optional = True
[tref]
standard_name = reference_sea_surface_temperature
long_name = reference/foundation temperature
units = K
dimensions = (horizontal_loop_extent)
type = real
kind = kind_phys
intent = in
optional = True
[xzts]
standard_name = derivative_of_diurnal_thermocline_layer_thickness_wrt_surface_skin_temperature
long_name = d(xz)/d(ts)
units = m K-1
dimensions = (horizontal_loop_extent)
type = real
kind = kind_phys
intent = inout
optional = True
[tskin]
standard_name = surface_skin_temperature_over_water
long_name = surface skin temperature over water
Expand All @@ -169,19 +133,6 @@
type = real
kind = kind_phys
intent = inout
[xs]
standard_name = sea_water_salinity_in_diurnal_thermocline
long_name = salinity content in diurnal thermocline layer
units = ppt m
# - - - - - - - - - - - - - - - - - - - - -
# long name = holding place for dt_cool
# units = deg K
# - - - - - - - - - - - - - - - - - - - - -
dimensions = (horizontal_loop_extent)
type = real
kind = kind_phys
intent = inout
optional = True
[dt_warm]
standard_name = derivative_of_heat_content_in_diurnal_thermocline_wrt_surface_skin_temperature
long_name = warm-skin surface temperature increment
Expand Down Expand Up @@ -296,14 +247,6 @@
type = real
kind = kind_phys
intent = inout
#[gflux]
# standard_name = upward_heat_flux_in_soil_over_water
# long_name = soil heat flux over water
# units = W m-2
# dimensions = (horizontal_loop_extent)
# type = real
# kind = kind_phys
# intent = inout
[evap]
standard_name = kinematic_surface_upward_latent_heat_flux_over_water
long_name = kinematic surface upward latent heat flux over water
Expand Down Expand Up @@ -406,110 +349,51 @@
dimensions = ()
type = integer
intent = out
[xt]
standard_name = heat_content_in_diurnal_thermocline
long_name = heat content in diurnal thermocline layer
units = K m
# - - - - - - - - - - - - - - - - - - - - -
# long name = lake ice surface temperature
# units = deg K
# - - - - - - - - - - - - - - - - - - - - -
[skinold]
standard_name = previous_skin_temperature
long_name = previous skin temperature
units = K
dimensions = (horizontal_loop_extent)
type = real
kind = kind_phys
intent = inout
optional = True
[xu]
standard_name = x_current_in_diurnal_thermocline
long_name = u-current content in diurnal thermocline layer
units = m2 s-1
[temwat]
standard_name = mixed_layer_temperature_lake
long_name = mixed layer temperature lake
units = K
dimensions = (horizontal_loop_extent)
type = real
kind = kind_phys
intent = inout
optional = True
[xv]
standard_name = y_current_in_diurnal_thermocline
long_name = v-current content in diurnal thermocline layer
units = m2 s-1
[xtinct]
standard_name = extinction_coefficient
long_name = extinction coefficient
units = none
dimensions = (horizontal_loop_extent)
type = real
kind = kind_phys
intent = inout
optional = True
[xz]
standard_name = diurnal_thermocline_layer_thickness
long_name = diurnal thermocline layer thickness
units = m
[ticold]
standard_name = previous_lake_ice_surface_temperature
long_name = previous lake ice surface temperature
units = K
dimensions = (horizontal_loop_extent)
type = real
kind = kind_phys
intent = inout
optional = True
[zm]
standard_name = ocean_mixed_layer_thickness
long_name = mixed layer thickness
# - - - - - - - - - - - - - - - - - - - - -
# long_name = lake ice thickness
# units = m
# - - - - - - - - - - - - - - - - - - - - -
[thkice]
standard_name = lake_ice_thickness
long_name = lake ice thickness
units = m
dimensions = (horizontal_loop_extent)
type = real
kind = kind_phys
intent = inout
optional = True
#[c_0]
# standard_name = coefficient_c_0
# long_name = coefficient1 to calculate d(tz)/d(ts)
# units = none
# dimensions = (horizontal_loop_extent)
# type = real
# kind = kind_phys
# intent = inout
# optional = True
#[c_d]
# standard_name = coefficient_c_d
# long_name = coefficient2 to calculate d(tz)/d(ts)
# units = none
# dimensions = (horizontal_loop_extent)
# type = real
# kind = kind_phys
# intent = inout
# optional = True
#[w_0]
# standard_name = coefficient_w_0
# long_name = coefficient3 to calculate d(tz)/d(ts)
# units = none
# dimensions = (horizontal_loop_extent)
# type = real
# kind = kind_phys
# intent = inout
# optional = True
#[w_d]
# standard_name = coefficient_w_d
# long_name = coefficient4 to calculate d(tz)/d(ts)
# units = none
# dimensions = (horizontal_loop_extent)
# type = real
# kind = kind_phys
# intent = inout
# optional = True
#[d_conv]
# standard_name = free_convection_layer_thickness_in_sea_water
# long_name = thickness of free convection layer
# units = m
# dimensions = (horizontal_loop_extent)
# type = real
# kind = kind_phys
# intent = inout
# optional = True
#[ifd]
# standard_name = control_for_diurnal_thermocline_calculation
# long_name = index to start dtlm run or not
# units = index
# dimensions = (horizontal_loop_extent)
# type = real
# kind = kind_phys
# intent = inout
# optional = True
[flxold]
standard_name = previous_lake_surface_heatflux
long_name = previous lake surface heatflux
units = W m-2
dimensions = (horizontal_loop_extent)
type = real
kind = kind_phys
intent = inout

0 comments on commit 760af27

Please sign in to comment.