25 real(kind_real),
intent(in) :: x
26 real(kind_real),
intent(in) :: y
27 real(kind_real),
intent(out) :: lon
28 real(kind_real),
intent(out) :: lat
29 real(kind_real),
intent(out),
optional :: mapfac
32 real(kind_real) :: rlon,rlat,rlon_c,rlat_c,x_c,y_c
35 if ((x<0.0).or.(x>
domain_zonal))
call abor1_ftn(
'xy_to_lonlat: x point out of the domain')
36 if ((y<0.0).or.(y>
domain_meridional))
call abor1_ftn(
'xy_to_lonlat: y point out of the domain')
45 rlon = (x-x_c)/
req+rlon_c
46 rlat = 2.0*atan2(exp(y/
req),exp(y_c/
req))-0.5*
pi+rlat_c
47 if (
present(mapfac)) mapfac = 1.0/cos(rlat)
59 real(kind_real),
intent(in) :: lon
60 real(kind_real),
intent(in) :: lat
61 real(kind_real),
intent(out) :: x
62 real(kind_real),
intent(out) :: y
65 real(kind_real) :: rlon,rlat,rlon_c,rlat_c,x_c,y_c
78 x = x_c+(rlon-rlon_c)*
req
79 y = y_c+log(tan(0.25*
pi+0.5*(rlat-rlat_c)))*
req
82 if ((x<0.0).or.(x>
domain_zonal))
call abor1_ftn(
'lonlat_to_xy: x point out of the domain')
83 if ((y<0.0).or.(y>
domain_meridional))
call abor1_ftn(
'lonlat_to_xy: y point out of the domain')
real(kind_real), parameter, public omega
Rotation rate of the Earth (rad/s)
real(kind_real), parameter, public rad_to_deg
Radians to degrees.
real(kind_real), parameter, public pi
Pi.
real(kind_real), parameter, public req
Earth radius at equator (m)
real(kind_real), parameter, public f0
Coriolis parameter at the center of the domain.
real(kind_real), parameter, public domain_meridional
Model domain in meridional direction (m)
real(kind_real), parameter, public domain_zonal
Model domain in zonal direction (m)
real(kind_real), parameter, public deg_to_rad
Degrees to radians.
subroutine, public xy_to_lonlat(x, y, lon, lat, mapfac)
Convert x/y to lon/lat.
subroutine, public lonlat_to_xy(lon, lat, x, y)
Convert lon/lat to x/y.