Module: NumRu::GAnalysis::QG_sphere_div

Extended by:
QG_common, QG_sphere_common
Defined in:
lib/numru/ganalysis/qg.rb

Overview

QG on sphere with divergence in the geostrophic wind

The geostrophic wind is defined as

[ug, vg] = 1/f curl gpd,

where gpd is the geostrophic geopotential, which is the deviation of geopotential from some globally uniform background. A background can be defined as the global mean geopotential, as is done in the method gph2gpd_gpref.

Class Method Summary collapse

Methods included from QG_common

cut_bottom, div_waf, extend_bottom, gp2gpref, gpd2qzz, gph2gpd_gpref, gph2gpref, gpref2n2

Methods included from QG_sphere_common

f, f_mask0

Class Method Details

.gpd2q(gpd, n2) ⇒ Object



635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
# File 'lib/numru/ganalysis/qg.rb', line 635

def gpd2q(gpd, n2)
  ug, vg = gpd2ug_vg(gpd)

  avor = Planet::absvor_s(ug,vg)
  avor.name = "qgavor"
  avor.long_name = "QG abs vor"

  f = f_mask0(gpd)
  qzz = gpd2qzz(gpd, n2) * f

  q = avor + qzz
  q.name = "q"
  q.long_name = "QG PV"

  [q, avor, qzz, ug, vg]
end

.gpd2qb(gpd, n2) ⇒ Object

geopotential height (gpd: deviation from the reference profie) to the extended QGPV

qb: q including the contribution from the bottom boundary



655
656
657
658
659
660
# File 'lib/numru/ganalysis/qg.rb', line 655

def gpd2qb(gpd, n2)
  gpde = extend_bottom(gpd, nil)
  n2e = extend_bottom(n2, nil)
  results = gpd2q(gpde, n2e)
  results.collect{|z| cut_bottom(z)}
end

.gpd2ug_vg(gpd) ⇒ Object



662
663
664
665
666
667
668
669
670
671
672
# File 'lib/numru/ganalysis/qg.rb', line 662

def gpd2ug_vg(gpd)
  f = f_mask0(gpd)
  gpx, gpy = Planet::grad_s(gpd)
  vg = gpx/f
  ug = gpy* (-1/f)
  ug.name = "ug"
  vg.name = "vg"
  ug.long_name = "ug"
  vg.long_name = "vg"
  [ug, vg]
end

.gph2q(gph) ⇒ Object

geopotential height to quasi-geostrophic potential vorticity (QGPV)



615
616
617
618
619
# File 'lib/numru/ganalysis/qg.rb', line 615

def gph2q(gph)
  gpd, gpref = gph2gpd_gpref(gph)
  n2 = gpref2n2(gpref)
  gpd2q(gpd, n2)
end

.gph2qb(gph) ⇒ Object

same as gph2q, but the QGPV is extended to reflect the lowest-level temperature anomalies



622
623
624
625
626
# File 'lib/numru/ganalysis/qg.rb', line 622

def gph2qb(gph)
  gpd, gpref = gph2gpd_gpref(gph)
  n2 = gpref2n2(gpref)
  gpd2qb(gpd, n2)
end

.gph2ug_vg(gph) ⇒ Object

geopotential height -> geostrophic winds



629
630
631
632
# File 'lib/numru/ganalysis/qg.rb', line 629

def gph2ug_vg(gph)
  gpd, gpref = gph2gpd_gpref(gph)
  gpd2ug_vg(gpd)
end