FV3 Bundle
gnssro_mod_transform.F90
Go to the documentation of this file.
1 !==========================================================================
3 !==========================================================================
4 
5 use kinds
7 
8 real(kind_real), parameter :: semi_major_axis = 6378.1370e3_kind_real ! (m)
9 real(kind_real), parameter :: semi_minor_axis = 6356.7523142e3_kind_real ! (m)
10 real(kind_real), parameter :: grav_polar = 9.8321849378_kind_real ! (m/s2)
11 real(kind_real), parameter :: grav_equator = 9.7803253359_kind_real ! (m/s2)
12 real(kind_real), parameter :: earth_omega = 7.292115e-5_kind_real ! (rad/s)
13 real(kind_real), parameter :: grav_constant = 3.986004418e14_kind_real !
14 real(kind_real), parameter :: flattening = (semi_major_axis-semi_minor_axis)/semi_major_axis
15 real(kind_real), parameter :: somigliana = (semi_minor_axis/semi_major_axis) * (grav_polar/grav_equator) - one
16 real(kind_real), parameter :: grav_ratio = (earth_omega*earth_omega * &
18 real(kind_real), parameter :: eccentricity = sqrt(semi_major_axis**2 - semi_minor_axis**2)/semi_major_axis
19 
20 contains
21 
22 ! ------------------------------
23 ! variable converting between geopotential and geometric heights using MJ Mahoney's (2001)
24 ! Parameters from WGS-84 model software inside GPS receivers.
25 ! copy from GSI
26 subroutine geometric2geop(Latitude,geometricZ, geopotentialH )
27 
28 real(kind_real), intent(in) :: Latitude, geometricZ
29 real(kind_real), intent(out) :: geopotentialH
30 real(kind_real) :: sino, termg, termr ! local variables
31 
32 sino = sin(deg2rad*latitude)
33 termg = grav_equator*( (one+somigliana*sino)/sqrt(one-eccentricity*eccentricity*sino) )
35 geopotentialh = (termg/grav) * ((termr*geometricz)/(termr+geometricz)) ! meter
36 
37 end subroutine geometric2geop
38 
39 
40 !subroutine geop2geometric(Latitude, geopotentialH, geometricZ)
41 
42 !real(kind_real),intent(in) :: Latitude, geopotentialH
43 !real(kind_real),intent(out) :: geometricZ
44 !real(kind_real) :: sino, termg, termr ! local variables
45 
46 !sino = sin(deg2rad*Latitude)
47 !termg = grav_equator*( (one+somigliana*sino)/sqrt(one-eccentricity*eccentricity*sino) )
48 !termr = semi_major_axis / (one + flattening + grav_ratio - two*flattening*sino)
49 !geometricZ = (termr*geopotentialH)/((termg/grav)*termr-geopotentialH)
50 !
51 !end subroutine geop2geometric
52 
53 
54  subroutine geop2geometric(latitude, geopotentialH, geometricZ, gp2gm)
55  ! calculate observation geometric height using MJ Mahoney's (2001), eq(23)
56  real(kind_real),intent(in) :: latitude, geopotentialH
57  real(kind_real),intent(out) :: geometricZ
58  real(kind_real),intent(out) :: gp2gm !jocabian
59  real(kind_real) :: sino
60  real(kind_real):: termg, termr, termrg
61 
62  sino = sin(deg2rad*latitude)
63  termg = grav_equator*( (one+somigliana*sino)/sqrt(one-eccentricity*eccentricity*sino) )
64  termr = semi_major_axis / (one + flattening + grav_ratio - two*flattening*sino)
65  termrg = termg/grav*termr
66 
67  gp2gm = termr/(termrg-geopotentialh) + (termr*geopotentialh)/(termrg-geopotentialh)**2
68 
69  geometricz = (termr*geopotentialh)/((termg/grav)*termr-geopotentialh)
70 
71  end subroutine geop2geometric
72 ! ------------------------------
73 
74  subroutine compute_refractivity(temperature, specH, pressure,refr, use_compress)
75 
76  real(kind_real), intent(in) :: temperature, specH, pressure
77  real(kind_real), intent(out) :: refr
78  real(kind_real) :: fact,pw,refr1,refr2,refr3, tfact
79  logical ,intent(in) :: use_compress
80 
81  ! constants needed to compute refractivity
82  call gnssro_ref_constants(use_compress)
83 
84  fact = one+fv*spech
85  tfact = (1-rd_over_rv)*spech+rd_over_rv
86  pw = rd_over_rv+spech*(one-rd_over_rv)
87  refr1 = n_a*pressure/temperature
88  refr2 = n_b*spech*pressure/(temperature**2*tfact)
89  refr3 = n_c*spech*pressure/(temperature*tfact)
90  refr = refr1 + refr2 + refr3
91 
92  end subroutine compute_refractivity
93 
94 
95  subroutine compute_refractivity_tv(virT, specH, pressure,refr, use_compress)
96 
97  real(kind_real), intent(in) :: virT, specH, pressure
98  real(kind_real), intent(out) :: refr
99  real(kind_real) :: fact,pw,refr1,refr2,refr3
100  logical ,intent(in) :: use_compress ! use computed compressibility or value as 1
101 
102  ! constants needed to compute refractivity
103  call gnssro_ref_constants(use_compress)
104 
105  fact = one+fv*spech
106  pw = rd_over_rv+spech*(one-rd_over_rv)
107  refr1 = n_a*(pressure/virt)*fact
108  refr2 = n_b*spech*pressure*fact**2/(virt**2*pw)
109  refr3 = n_c*fact*spech*pressure/(virt*pw)
110  refr = refr1 + refr2 + refr3
111 
112  end subroutine compute_refractivity_tv
113 end module gnssro_mod_transform
114 
real(kind_real), parameter semi_major_axis
real(kind_real), parameter grav_polar
real(kind_real), parameter flattening
real(kind_real), parameter somigliana
subroutine compute_refractivity_tv(virT, specH, pressure, refr, use_compress)
real(kind_real), parameter earth_omega
real(kind_real), parameter eccentricity
real(kind_real), parameter, public deg2rad
real(kind_real), parameter, public rd_over_rv
subroutine geop2geometric(latitude, geopotentialH, geometricZ, gp2gm)
real(kind_real), parameter grav_ratio
subroutine geometric2geop(Latitude, geometricZ, geopotentialH)
real(fp), parameter, public one
real(kind_real), public n_c
real(kind_real), parameter semi_minor_axis
real(kind_real), parameter grav_constant
subroutine, public gnssro_ref_constants(use_compress)
real(fp), parameter, public two
real, parameter, public grav
Acceleration due to gravity [m/s^2].
Definition: constants.F90:76
real(kind_real), public n_b
subroutine compute_refractivity(temperature, specH, pressure, refr, use_compress)
real(kind_real), parameter grav_equator
real(kind_real), public n_a