55 REAL(8),
PARAMETER :: &
60 pi = 4.d0*atan(1.d0), &
68 REAL(8),
PARAMETER :: &
75 REAL(8),
PARAMETER :: &
98 SUBROUTINE test4_baroclinic_wave (moist,X,lon,lat,p,z,zcoords,u,v,w,t,phis,ps,rho,q,q1,q2)
105 INTEGER,
INTENT(IN) :: moist
107 REAL(8),
INTENT(IN) :: &
113 REAL(8),
INTENT(INOUT) :: p
115 INTEGER,
INTENT(IN) :: zcoords
117 REAL(8),
INTENT(OUT) :: &
139 if (zcoords .eq. 0)
then 149 u =
u_wind(lon,lat,eta,.true.)
150 v =
v_wind(lon,lat,eta,.true.)
173 t = t/(1.d0+0.608d0*q)
181 q1 =
theta(lon,lat,eta)
186 q2 = abs(
epv(lon,lat,eta)) * x
201 REAL(8),
INTENT(IN) :: lon, lat, eta
212 REAL(8) FUNCTION t_mean(eta)
214 REAL(8),
INTENT(IN) :: eta
230 REAL(8),
INTENT(IN) :: eta, lon, lat
231 REAL(8) :: factor, phi_vertical
234 phi_vertical = (eta -
eta0) * 0.5d0*
pi 236 t_deviation = factor * 1.5d0 * sin(phi_vertical) * (cos(phi_vertical))**0.5d0 * &
237 ((-2.d0*(sin(lat))**6 * ((cos(lat))**2 + 1.d0/3.d0) + 10.d0/63.d0)* &
238 u0 * (cos(phi_vertical))**1.5d0 + &
239 (8.d0/5.d0*(cos(lat))**3 * ((sin(lat))**2 + 2.d0/3.d0) -
pi/4.d0)*
a_omega*0.5d0 )
249 REAL(8),
INTENT(IN) :: lon, lat
254 surface_geopotential = ((-2.d0*(sin(lat))**6 * ((cos(lat))**2 + 1.d0/3.d0) + 10.d0/63.d0)*cos_tmp &
255 + (8.d0/5.d0*(cos(lat))**3 * ((sin(lat))**2 + 2.d0/3.d0) -
pi/4.d0)*
a_omega)*cos_tmp
264 REAL(8),
INTENT(IN) :: lon, lat, eta
267 cos_tmp =
u0 * (cos((eta-
eta0)*
pi*0.5d0))**1.5d0
269 geopotential = ((-2.d0*(sin(lat))**6 * ((cos(lat))**2 + 1.d0/3.d0) + 10.d0/63.d0)*cos_tmp &
270 + (8.d0/5.d0*(cos(lat))**3 * ((sin(lat))**2 + 2.d0/3.d0) -
pi/4.d0)*
a_omega)*cos_tmp
281 REAL(8),
INTENT(IN) :: eta
293 - 1.d0/5.d0 * eta**5)
303 REAL(8) FUNCTION u_wind(lon,lat,eta,lperturb)
305 REAL(8),
INTENT(IN) :: lon,lat,eta
306 LOGICAL,
INTENT(IN) :: lperturb
307 REAL(8) :: phi_vertical, sin_tmp, cos_tmp, r, u_perturb
308 REAL(8) :: perturb_lon, perturb_lat
314 phi_vertical = (eta -
eta0) *0.5d0*
pi 315 u_wind = (cos(phi_vertical))**1.5d0 * 4.d0 *
u0 * (sin(lat))**2 * (cos(lat))**2
326 sin_tmp = sin(perturb_lat)*sin(lat)
327 cos_tmp = cos(perturb_lat)*cos(lat)
329 r = acos( sin_tmp + cos_tmp*cos(lon-perturb_lon) )
342 REAL(8) FUNCTION v_wind(lon,lat,eta,lperturb)
344 REAL(8),
INTENT(IN) :: lon,lat,eta
345 LOGICAL,
INTENT(IN) :: lperturb
356 REAL(8),
INTENT(IN) :: lon, lat, z
357 REAL(8) :: eta_new, f, df
360 REAL(8),
PARAMETER :: &
361 initial_eta = 1.0d-7, &
362 convergence = 1.0d-13
372 if (abs(
eta_from_z - eta_new) < convergence)
then 387 REAL(8) FUNCTION theta(lon,lat,eta)
389 REAL(8),
INTENT(IN) :: eta, lon, lat
390 REAL(8) :: eta_nu, cos_tmp, y
392 eta_nu = (eta-
eta0)*
pi*0.5d0
393 cos_tmp =
u0 * (cos(eta_nu))**1.5d0
395 y = (-2.d0*(sin(lat))**6 * ((cos(lat))**2 + 1.d0/3.d0) + 10.d0/63.d0)*2.d0*cos_tmp &
396 + (8.d0/5.d0*(cos(lat))**3 * ((sin(lat))**2 + 2.d0/3.d0) -
pi/4.d0)*
a_omega 399 * sin(eta_nu) * sqrt(cos(eta_nu)) * y
406 REAL(8) FUNCTION epv(lon,lat,eta)
408 REAL(8),
INTENT(IN) :: eta, lon, lat
409 REAL(8) :: perturb_lon, perturb_lat
410 REAL(8) :: eta_nu, cos_tmp, y, r, zeta, k, dk, f
411 REAL(8) :: dudeta, dmeanthetadeta, dthetadeta
412 REAL(8) :: dthetadphi1, dthetadphi2, dthetadphi
422 eta_nu = (eta-
eta0)*
pi*0.5d0
423 cos_tmp =
u0 * (cos(eta_nu))**1.5d0
425 y = (-2.d0*(sin(lat))**6 * ((cos(lat))**2 + 1.d0/3.d0) + 10.d0/63.d0)*2.d0*cos_tmp &
426 + (8.d0/5.d0*(cos(lat))**3 * ((sin(lat))**2 + 2.d0/3.d0) -
pi/4.d0)*
a_omega 429 k = sin(perturb_lat)*sin(lat) + cos(perturb_lat)*cos(lat)*cos(lon-perturb_lon)
430 dk = sin(perturb_lat)*cos(lat) - cos(perturb_lat)*sin(lat)*cos(lon-perturb_lon)
438 if (abs(lat-perturb_lat).le.epsilon .and. abs(lon-perturb_lon).le.epsilon)
then 441 else if ( (abs(lat+perturb_lat).le.epsilon .and. abs(lon-(perturb_lon+
pi)).le.epsilon) &
442 .or. abs(lat-
pi*0.5d0).le.epsilon &
443 .or. abs(lat+
pi*0.5d0).le.epsilon)
then 444 zeta = -4.d0/a*cos_tmp*sin(lat)*cos(lat)*(2.d0-5.d0*(sin(lat))**2)
447 zeta = -4.d0/a*cos_tmp*sin(lat)*cos(lat)*(2.d0-5.d0*(sin(lat))**2) &
449 * (tan(lat) - 2.d0*
radius**2*acos(k)*dk/sqrt(1.d0-k**2))
453 dudeta = -
u0*(sin(2.d0*lat))**2*3.d0*
pi/4.d0*sqrt(cos(eta_nu))*sin(eta_nu)
459 dmeanthetadeta = dmeanthetadeta &
466 dthetadeta = dmeanthetadeta &
467 + 3.d0/4.d0*
pi*
u0/
rd*(1.d0-
kappa)*eta**(-
kappa)*sin(eta_nu)*sqrt(cos(eta_nu))*y &
469 - 3.d0/16.d0*
pi*
pi*
u0/
rd*eta**(1.d0-
kappa)*(sin(eta_nu))**2*(cos(eta_nu))**(-0.5d0)*y &
470 - 9.d0/8.d0*
pi*
pi*
u0*
u0/
rd*eta**(1.d0-
kappa)*(sin(eta_nu))**2*cos(eta_nu) &
471 * (-2.d0*(sin(lat))**6*((cos(lat))**2+1.d0/3.d0) + 10.d0/63.d0)
474 dthetadphi1 = 2.d0*cos_tmp &
475 * (- 12.d0*cos(lat)*(sin(lat))**5*((cos(lat))**2+1.d0/3.d0) &
476 + 4.d0*cos(lat)*(sin(lat))**7)
479 * (-24.d0/5.d0*sin(lat)*(cos(lat))**2*((sin(lat))**2+2.d0/3.d0) &
480 + 16.d0/5.d0*(cos(lat))**4*sin(lat))
483 dthetadphi = 3.d0/4.d0*
pi*
u0/
rd*eta**(1.d0-
kappa)*sin(eta_nu)*sqrt(cos(eta_nu)) &
484 * (dthetadphi1 + dthetadphi2)
487 f = 2.d0 *
omega * sin(lat)
490 epv =
g/
p0*(-dudeta*dthetadphi/a - (zeta+f) * dthetadeta)
real(8), parameter perturbation_amplitude
real(8), parameter radius
real(8) function eta_from_z(lon, lat, z)
real(8) function theta(lon, lat, eta)
real(8) function u_wind(lon, lat, eta, lperturb)
real(8) function t_deviation(lon, lat, eta)
real(8) function horiz_mean_geopotential(eta)
real(8), parameter deg2rad
subroutine test4_baroclinic_wave(moist, X, lon, lat, p, z, zcoords, u, v, w, t, phis, ps, rho, q, q1, q2)
real(8), parameter exponent
real(8), parameter perturbation_latitude_tracer
real(8) function epv(lon, lat, eta)
real(8), parameter perturbation_latitude
real(8) function v_wind(lon, lat, eta, lperturb)
real, parameter, public pi
Ratio of circle circumference to diameter [N/A].
real(8) function surface_geopotential(lon, lat)
real(8), parameter a_omega
real(8) function geopotential(lon, lat, eta)
real(8) function temperature(lon, lat, eta)
real(8), parameter eta_tropo
real(8) function t_mean(eta)
real(8), parameter lat_hw
real(8), parameter eta_sfc
real(8), parameter delta_t
real(8), parameter perturbation_longitude