FV3DYCORE  Version 2.0.0
sw_core_mod Module Reference

The module 'sw_core' advances the forward step of the Lagrangian dynamics as described by [lin1997explicit], [lin2004vertically], and [harris2013two]. More...

Functions/Subroutines

subroutine, public c_sw (delpc, delp, ptc, pt, u, v, w, uc, vc, ua, va, wc, ut, vt, divg_d, nord, dt2, hydrostatic, dord4, bd, gridstruct, flagstruct)
 The subroutine 'c_sw' performs a half-timestep advance of the C-grid winds. More...
 
subroutine, public d_sw (delpc, delp, ptc, pt, u, v, w, uc, vc, ua, va, divg_d, xflux, yflux, cx, cy, crx_adv, cry_adv, xfx_adv, yfx_adv, q_con, z_rat, kgb, heat_source, diss_est, zvir, sphum, nq, q, k, km, inline_q, dt, hord_tr, hord_mt, hord_vt, hord_tm, hord_dp, nord, nord_v, nord_w, nord_t, dddmp, d2_bg, d4_bg, damp_v, damp_w, damp_t, d_con, hydrostatic, gridstruct, flagstruct, bd)
 The subroutine 'd_sw' peforms a full-timestep advance of the D-grid winds and other prognostic varaiables. More...
 
subroutine, public del6_vt_flux (nord, npx, npy, damp, q, d2, fx2, fy2, gridstruct, bd)
 The subroutine 'del6_vt_flux' applies 2nd, 4th, or 6th-order damping to fluxes ("vorticity damping") More...
 
subroutine, public divergence_corner (u, v, ua, va, divg_d, gridstruct, flagstruct, bd)
 The subroutine 'divergence_corner' computes the cell-mean divergence on the "dual grid", the native-grid positioning of the divergence. More...
 
subroutine, public divergence_corner_nest (u, v, ua, va, divg_d, gridstruct, flagstruct, bd)
 
subroutine smag_corner (dt, u, v, ua, va, smag_c, bd, npx, npy, gridstruct, ng)
 The subroutine 'smag_corner' computes Smagorinsky damping. More...
 
subroutine xtp_u (is, ie, js, je, isd, ied, jsd, jed, c, u, v, flux, iord, dx, rdx, npx, npy, grid_type, lim_fac, bounded_domain)
 
subroutine ytp_v (is, ie, js, je, isd, ied, jsd, jed, c, u, v, flux, jord, dy, rdy, npx, npy, grid_type, lim_fac, bounded_domain)
 
subroutine d2a2c_vect (u, v, ua, va, uc, vc, ut, vt, dord4, gridstruct, bd, npx, npy, bounded_domain, grid_type)
 
real function edge_interpolate4 (ua, dxa)
 
subroutine fill3_4corners (q1, q2, q3, dir, bd, npx, npy, sw_corner, se_corner, ne_corner, nw_corner)
 The subroutine 'fill3_4corners' fills the 4 corners of the scalar fileds only as needed by 'c_core'. More...
 
subroutine fill2_4corners (q1, q2, dir, bd, npx, npy, sw_corner, se_corner, ne_corner, nw_corner)
 The subroutine ' fill2_4corners' fills the 4 corners of the scalar fileds only as needed by 'c_core'. More...
 
subroutine, public fill_4corners (q, dir, bd, npx, npy, sw_corner, se_corner, ne_corner, nw_corner)
 The subroutine 'fill_4corners' fills the 4 corners of the scalar fields only as needed by c_core. More...
 

Variables

real, parameter r3 = 1./3.
 
real, parameter t11 =27./28.
 
real, parameter t12 =-13./28.
 
real, parameter t13 =3./7.
 
real, parameter t14 =6./7.
 
real, parameter t15 =3./28.
 
real, parameter s11 =11./14.
 
real, parameter s13 =-13./14.
 
real, parameter s14 =4./7.
 
real, parameter s15 =3./14.
 
real, parameter near_zero = 1.E-9
 for KE limiter More...
 
real, parameter big_number = 1.E30
 
real, parameter p1 = 7./12.
 0.58333333 More...
 
real, parameter p2 = -1./12.
 
real, parameter a1 = 0.5625
 
real, parameter a2 = -0.0625
 
real, parameter c1 = -2./14.
 
real, parameter c2 = 11./14.
 
real, parameter c3 = 5./14.
 
real, parameter b1 = 1./30.
 
real, parameter b2 = -13./60.
 
real, parameter b3 = -13./60.
 
real, parameter b4 = 0.45
 
real, parameter b5 = -0.05
 

Detailed Description

The module 'sw_core' advances the forward step of the Lagrangian dynamics as described by [lin1997explicit], [lin2004vertically], and [harris2013two].

The step is applied to the cubed sphere.

Function/Subroutine Documentation

◆ c_sw()

subroutine, public sw_core_mod::c_sw ( real, dimension(bd%isd:bd%ied, bd%jsd:bd%jed ), intent(out)  delpc,
real, dimension(bd%isd:bd%ied, bd%jsd:bd%jed ), intent(inout)  delp,
real, dimension(bd%isd:bd%ied, bd%jsd:bd%jed ), intent(out)  ptc,
real, dimension(bd%isd:bd%ied, bd%jsd:bd%jed ), intent(inout)  pt,
real, dimension(bd%isd:bd%ied, bd%jsd:bd%jed+1), intent(inout)  u,
real, dimension(bd%isd:bd%ied+1,bd%jsd:bd%jed ), intent(inout)  v,
real, dimension(bd%isd: , bd%jsd: ), intent(inout)  w,
real, dimension(bd%isd:bd%ied+1,bd%jsd:bd%jed ), intent(inout)  uc,
real, dimension(bd%isd:bd%ied, bd%jsd:bd%jed+1), intent(inout)  vc,
real, dimension(bd%isd:bd%ied, bd%jsd:bd%jed ), intent(inout)  ua,
real, dimension(bd%isd:bd%ied, bd%jsd:bd%jed ), intent(inout)  va,
real, dimension(bd%isd:bd%ied, bd%jsd:bd%jed ), intent(out)  wc,
real, dimension(bd%isd:bd%ied, bd%jsd:bd%jed ), intent(inout)  ut,
real, dimension(bd%isd:bd%ied, bd%jsd:bd%jed ), intent(inout)  vt,
real, dimension(bd%isd:bd%ied+1,bd%jsd:bd%jed+1), intent(out)  divg_d,
integer, intent(in)  nord,
real, intent(in)  dt2,
logical, intent(in)  hydrostatic,
logical, intent(in)  dord4,
type(fv_grid_bounds_type), intent(in)  bd,
type(fv_grid_type), intent(in), target  gridstruct,
type(fv_flags_type), intent(in), target  flagstruct 
)

The subroutine 'c_sw' performs a half-timestep advance of the C-grid winds.

Definition at line 105 of file sw_core.F90.

◆ d2a2c_vect()

subroutine sw_core_mod::d2a2c_vect ( real, dimension(bd%isd:bd%ied,bd%jsd:bd%jed+1), intent(in)  u,
real, dimension(bd%isd:bd%ied+1,bd%jsd:bd%jed), intent(in)  v,
real, dimension(bd%isd:bd%ied ,bd%jsd:bd%jed ), intent(out)  ua,
real, dimension(bd%isd:bd%ied ,bd%jsd:bd%jed ), intent(out)  va,
real, dimension(bd%isd:bd%ied+1,bd%jsd:bd%jed ), intent(out)  uc,
real, dimension(bd%isd:bd%ied ,bd%jsd:bd%jed+1), intent(out)  vc,
real, dimension(bd%isd:bd%ied ,bd%jsd:bd%jed ), intent(out)  ut,
real, dimension(bd%isd:bd%ied ,bd%jsd:bd%jed ), intent(out)  vt,
logical, intent(in)  dord4,
type(fv_grid_type), intent(in), target  gridstruct,
type(fv_grid_bounds_type), intent(in)  bd,
integer, intent(in)  npx,
integer, intent(in)  npy,
logical, intent(in)  bounded_domain,
integer, intent(in)  grid_type 
)
private

Definition at line 2825 of file sw_core.F90.

◆ d_sw()

subroutine, public sw_core_mod::d_sw ( real, dimension(bd%isd:bd%ied, bd%jsd:bd%jed), intent(out)  delpc,
real, dimension(bd%isd:bd%ied, bd%jsd:bd%jed), intent(inout)  delp,
real, dimension(bd%isd:bd%ied, bd%jsd:bd%jed), intent(out)  ptc,
real, dimension(bd%isd:bd%ied, bd%jsd:bd%jed), intent(inout)  pt,
real, dimension(bd%isd:bd%ied ,bd%jsd:bd%jed+1), intent(inout)  u,
real, dimension(bd%isd:bd%ied+1,bd%jsd:bd%jed ), intent(inout)  v,
real, dimension(bd%isd: , bd%jsd: ), intent(inout)  w,
real, dimension(bd%isd:bd%ied+1,bd%jsd:bd%jed ), intent(inout)  uc,
real, dimension(bd%isd:bd%ied ,bd%jsd:bd%jed+1), intent(inout)  vc,
real, dimension(bd%isd:bd%ied, bd%jsd:bd%jed), intent(inout)  ua,
real, dimension(bd%isd:bd%ied, bd%jsd:bd%jed), intent(inout)  va,
real, dimension(bd%isd:bd%ied+1,bd%jsd:bd%jed+1), intent(inout)  divg_d,
real, dimension(bd%is:bd%ie+1,bd%js:bd%je ), intent(inout)  xflux,
real, dimension(bd%is:bd%ie ,bd%js:bd%je+1), intent(inout)  yflux,
real, dimension(bd%is:bd%ie+1,bd%jsd:bd%jed ), intent(inout)  cx,
real, dimension(bd%isd:bd%ied,bd%js:bd%je+1), intent(inout)  cy,
real, dimension(bd%is:bd%ie+1,bd%jsd:bd%jed), intent(out)  crx_adv,
real, dimension(bd%isd:bd%ied,bd%js:bd%je+1), intent(out)  cry_adv,
real, dimension(bd%is:bd%ie+1,bd%jsd:bd%jed), intent(out)  xfx_adv,
real, dimension(bd%isd:bd%ied,bd%js:bd%je+1), intent(out)  yfx_adv,
real, dimension(bd%isd: , bd%jsd: ), intent(inout)  q_con,
real, dimension(bd%isd:bd%ied, bd%jsd:bd%jed), intent(in)  z_rat,
real, intent(in)  kgb,
real, dimension(bd%is:bd%ie,bd%js:bd%je), intent(out)  heat_source,
real, dimension(bd%is:bd%ie,bd%js:bd%je), intent(out)  diss_est,
real, intent(in)  zvir,
integer, intent(in)  sphum,
integer, intent(in)  nq,
real, dimension(bd%isd:bd%ied,bd%jsd:bd%jed,km,nq), intent(inout)  q,
integer, intent(in)  k,
integer, intent(in)  km,
logical, intent(in)  inline_q,
real, intent(in)  dt,
integer, intent(in)  hord_tr,
integer, intent(in)  hord_mt,
integer, intent(in)  hord_vt,
integer, intent(in)  hord_tm,
integer, intent(in)  hord_dp,
integer, intent(in)  nord,
integer, intent(in)  nord_v,
integer, intent(in)  nord_w,
integer, intent(in)  nord_t,
real, intent(in)  dddmp,
real, intent(in)  d2_bg,
real, intent(in)  d4_bg,
real, intent(in)  damp_v,
real, intent(in)  damp_w,
real, intent(in)  damp_t,
real, intent(in)  d_con,
logical, intent(in)  hydrostatic,
type(fv_grid_type), intent(in), target  gridstruct,
type(fv_flags_type), intent(in), target  flagstruct,
type(fv_grid_bounds_type), intent(in)  bd 
)

The subroutine 'd_sw' peforms a full-timestep advance of the D-grid winds and other prognostic varaiables.

Parameters
[in]nordnord=1 divergence damping; (del-4) or 3 (del-8)
[in]nord_vvorticity damping
[in]nord_wvertical velocity
[in]nord_tpt
[in,out]divg_ddivergence

Definition at line 526 of file sw_core.F90.

◆ del6_vt_flux()

subroutine, public sw_core_mod::del6_vt_flux ( integer, intent(in)  nord,
integer, intent(in)  npx,
integer, intent(in)  npy,
real, intent(in)  damp,
real, dimension(bd%isd:bd%ied, bd%jsd:bd%jed), intent(inout)  q,
real, dimension(bd%isd:bd%ied, bd%jsd:bd%jed), intent(out)  d2,
real, dimension(bd%isd:bd%ied+1,bd%jsd:bd%jed), intent(out)  fx2,
real, dimension(bd%isd:bd%ied,bd%jsd:bd%jed+1), intent(out)  fy2,
type(fv_grid_type), intent(in), target  gridstruct,
type(fv_grid_bounds_type), intent(in)  bd 
)

The subroutine 'del6_vt_flux' applies 2nd, 4th, or 6th-order damping to fluxes ("vorticity damping")

Definition at line 1581 of file sw_core.F90.

◆ divergence_corner()

subroutine, public sw_core_mod::divergence_corner ( real, dimension(bd%isd:bd%ied, bd%jsd:bd%jed+1), intent(in)  u,
real, dimension(bd%isd:bd%ied+1,bd%jsd:bd%jed ), intent(in)  v,
real, dimension(bd%isd:bd%ied,bd%jsd:bd%jed), intent(in)  ua,
real, dimension(bd%isd:bd%ied,bd%jsd:bd%jed), intent(in)  va,
real, dimension(bd%isd:bd%ied+1,bd%jsd:bd%jed+1), intent(out)  divg_d,
type(fv_grid_type), intent(in), target  gridstruct,
type(fv_flags_type), intent(in), target  flagstruct,
type(fv_grid_bounds_type), intent(in)  bd 
)

The subroutine 'divergence_corner' computes the cell-mean divergence on the "dual grid", the native-grid positioning of the divergence.

Definition at line 1696 of file sw_core.F90.

◆ divergence_corner_nest()

subroutine, public sw_core_mod::divergence_corner_nest ( real, dimension(bd%isd:bd%ied, bd%jsd:bd%jed+1), intent(in)  u,
real, dimension(bd%isd:bd%ied+1,bd%jsd:bd%jed), intent(in)  v,
real, dimension(bd%isd:bd%ied,bd%jsd:bd%jed), intent(in)  ua,
real, dimension(bd%isd:bd%ied,bd%jsd:bd%jed), intent(in)  va,
real, dimension(bd%isd:bd%ied+1,bd%jsd:bd%jed+1), intent(out)  divg_d,
type(fv_grid_type), intent(in), target  gridstruct,
type(fv_flags_type), intent(in), target  flagstruct,
type(fv_grid_bounds_type), intent(in)  bd 
)

Definition at line 1803 of file sw_core.F90.

◆ edge_interpolate4()

real function sw_core_mod::edge_interpolate4 ( real, dimension(4), intent(in)  ua,
real, dimension(4), intent(in)  dxa 
)
private

Definition at line 3166 of file sw_core.F90.

◆ fill2_4corners()

subroutine sw_core_mod::fill2_4corners ( real, dimension(bd%isd:bd%ied,bd%jsd:bd%jed), intent(inout)  q1,
real, dimension(bd%isd:bd%ied,bd%jsd:bd%jed), intent(inout)  q2,
integer, intent(in)  dir,
type(fv_grid_bounds_type), intent(in)  bd,
integer, intent(in)  npx,
integer, intent(in)  npy,
logical, intent(in)  sw_corner,
logical, intent(in)  se_corner,
logical, intent(in)  ne_corner,
logical, intent(in)  nw_corner 
)
private

The subroutine ' fill2_4corners' fills the 4 corners of the scalar fileds only as needed by 'c_core'.

Parameters
[in]dir1: x-dir; 2: y-dir

Definition at line 3251 of file sw_core.F90.

◆ fill3_4corners()

subroutine sw_core_mod::fill3_4corners ( real, dimension(bd%isd:bd%ied,bd%jsd:bd%jed), intent(inout)  q1,
real, dimension(bd%isd:bd%ied,bd%jsd:bd%jed), intent(inout)  q2,
real, dimension(bd%isd:bd%ied,bd%jsd:bd%jed), intent(inout)  q3,
integer, intent(in)  dir,
type(fv_grid_bounds_type), intent(in)  bd,
integer, intent(in)  npx,
integer, intent(in)  npy,
logical, intent(in)  sw_corner,
logical, intent(in)  se_corner,
logical, intent(in)  ne_corner,
logical, intent(in)  nw_corner 
)
private

The subroutine 'fill3_4corners' fills the 4 corners of the scalar fileds only as needed by 'c_core'.

Parameters
[in]dir1: x-dir; 2: y-dir

Definition at line 3180 of file sw_core.F90.

◆ fill_4corners()

subroutine, public sw_core_mod::fill_4corners ( real, dimension(bd%isd:bd%ied,bd%jsd:bd%jed), intent(inout)  q,
integer, intent(in)  dir,
type(fv_grid_bounds_type), intent(in)  bd,
integer, intent(in)  npx,
integer, intent(in)  npy,
logical, intent(in)  sw_corner,
logical, intent(in)  se_corner,
logical, intent(in)  ne_corner,
logical, intent(in)  nw_corner 
)

The subroutine 'fill_4corners' fills the 4 corners of the scalar fields only as needed by c_core.

Definition at line 3313 of file sw_core.F90.

◆ smag_corner()

subroutine sw_core_mod::smag_corner ( real, intent(in)  dt,
real, dimension(bd%isd:bd%ied, bd%jsd:bd%jed+1), intent(in)  u,
real, dimension(bd%isd:bd%ied+1,bd%jsd:bd%jed ), intent(in)  v,
real, dimension(bd%isd:bd%ied,bd%jsd:bd%jed), intent(in)  ua,
real, dimension(bd%isd:bd%ied,bd%jsd:bd%jed), intent(in)  va,
real, dimension(bd%isd:bd%ied,bd%jsd:bd%jed), intent(out)  smag_c,
type(fv_grid_bounds_type), intent(in)  bd,
integer, intent(in)  npx,
integer, intent(in)  npy,
type(fv_grid_type), intent(in), target  gridstruct,
integer, intent(in)  ng 
)
private

The subroutine 'smag_corner' computes Smagorinsky damping.

Parameters
[in]bdCompute the Tension_Shear strain at cell corners for Smagorinsky diffusion work only if (grid_type==4)

Definition at line 1912 of file sw_core.F90.

◆ xtp_u()

subroutine sw_core_mod::xtp_u ( integer, intent(in)  is,
integer, intent(in)  ie,
integer, intent(in)  js,
integer, intent(in)  je,
integer, intent(in)  isd,
integer, intent(in)  ied,
integer, intent(in)  jsd,
integer, intent(in)  jed,
real, dimension(is:ie+1,js:je+1), intent(in)  c,
real, dimension(isd:ied,jsd:jed+1), intent(in)  u,
real, dimension(isd:ied+1,jsd:jed), intent(in)  v,
real, dimension(is:ie+1,js:je+1), intent(out)  flux,
integer, intent(in)  iord,
real, dimension(isd:ied, jsd:jed+1), intent(in)  dx,
real, dimension(isd:ied, jsd:jed+1), intent(in)  rdx,
integer, intent(in)  npx,
integer, intent(in)  npy,
integer, intent(in)  grid_type,
real, intent(in)  lim_fac,
logical, intent(in)  bounded_domain 
)
private

Definition at line 2002 of file sw_core.F90.

◆ ytp_v()

subroutine sw_core_mod::ytp_v ( integer, intent(in)  is,
integer, intent(in)  ie,
integer, intent(in)  js,
integer, intent(in)  je,
integer, intent(in)  isd,
integer, intent(in)  ied,
integer, intent(in)  jsd,
integer, intent(in)  jed,
real, dimension(is:ie+1,js:je+1), intent(in)  c,
real, dimension(isd:ied,jsd:jed+1), intent(in)  u,
real, dimension(isd:ied+1,jsd:jed), intent(in)  v,
real, dimension(is:ie+1,js:je+1), intent(out)  flux,
integer, intent(in)  jord,
real, dimension(isd:ied+1,jsd:jed), intent(in)  dy,
real, dimension(isd:ied+1,jsd:jed), intent(in)  rdy,
integer, intent(in)  npx,
integer, intent(in)  npy,
integer, intent(in)  grid_type,
real, intent(in)  lim_fac,
logical, intent(in)  bounded_domain 
)
private
Parameters
[in]cCourant N (like FLUX)

Definition at line 2360 of file sw_core.F90.

Variable Documentation

◆ a1

real, parameter sw_core_mod::a1 = 0.5625

Definition at line 76 of file sw_core.F90.

◆ a2

real, parameter sw_core_mod::a2 = -0.0625

Definition at line 77 of file sw_core.F90.

◆ b1

real, parameter sw_core_mod::b1 = 1./30.

Definition at line 89 of file sw_core.F90.

◆ b2

real, parameter sw_core_mod::b2 = -13./60.

Definition at line 90 of file sw_core.F90.

◆ b3

real, parameter sw_core_mod::b3 = -13./60.

Definition at line 91 of file sw_core.F90.

◆ b4

real, parameter sw_core_mod::b4 = 0.45

Definition at line 92 of file sw_core.F90.

◆ b5

real, parameter sw_core_mod::b5 = -0.05

Definition at line 93 of file sw_core.F90.

◆ big_number

real, parameter sw_core_mod::big_number = 1.E30

Definition at line 66 of file sw_core.F90.

◆ c1

real, parameter sw_core_mod::c1 = -2./14.

Definition at line 80 of file sw_core.F90.

◆ c2

real, parameter sw_core_mod::c2 = 11./14.

Definition at line 81 of file sw_core.F90.

◆ c3

real, parameter sw_core_mod::c3 = 5./14.

Definition at line 82 of file sw_core.F90.

◆ near_zero

real, parameter sw_core_mod::near_zero = 1.E-9

for KE limiter

Definition at line 62 of file sw_core.F90.

◆ p1

real, parameter sw_core_mod::p1 = 7./12.

0.58333333

Definition at line 71 of file sw_core.F90.

◆ p2

real, parameter sw_core_mod::p2 = -1./12.

Definition at line 72 of file sw_core.F90.

◆ r3

real, parameter sw_core_mod::r3 = 1./3.

Definition at line 59 of file sw_core.F90.

◆ s11

real, parameter sw_core_mod::s11 =11./14.

Definition at line 61 of file sw_core.F90.

◆ s13

real, parameter sw_core_mod::s13 =-13./14.

Definition at line 61 of file sw_core.F90.

◆ s14

real, parameter sw_core_mod::s14 =4./7.

Definition at line 61 of file sw_core.F90.

◆ s15

real, parameter sw_core_mod::s15 =3./14.

Definition at line 61 of file sw_core.F90.

◆ t11

real, parameter sw_core_mod::t11 =27./28.

Definition at line 60 of file sw_core.F90.

◆ t12

real, parameter sw_core_mod::t12 =-13./28.

Definition at line 60 of file sw_core.F90.

◆ t13

real, parameter sw_core_mod::t13 =3./7.

Definition at line 60 of file sw_core.F90.

◆ t14

real, parameter sw_core_mod::t14 =6./7.

Definition at line 60 of file sw_core.F90.

◆ t15

real, parameter sw_core_mod::t15 =3./28.

Definition at line 60 of file sw_core.F90.