Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real, | intent(in) | :: | x | |||
real, | intent(in) | :: | y | |||
real, | intent(out) | :: | gl | |||
real, | intent(out) | :: | gb | |||
double precision, | intent(in) | :: | projection_attr(10) |
subroutine lambert2lb2_uEMEP(x, y, gl, gb, projection_attr) double precision, intent(in) :: projection_attr(10) real, intent(in) :: x, y real, intent(out):: gl, gb real :: r, t real :: earth_radius, k, F, y0 real :: deg2rad, rad2deg, k_lambert, lat0_lambert real :: lat0 real :: lat_stand1_lambert, lat_stand2_lambert, lon0, lat0_in lat_stand1_lambert = projection_attr(1) lat_stand2_lambert = projection_attr(2) lon0 = projection_attr(3) lat0_in = projection_attr(4) earth_radius = projection_attr(5) deg2rad = PI/180.0 rad2deg = 180.0/PI if (lat_stand1_lambert .eq. lat_stand2_lambert) then k_lambert = sin(PI/180.0*lat0_in) else k_lambert = log(cos(deg2rad*lat_stand1_lambert)/cos(deg2rad*lat_stand2_lambert))/ & (log(tan(0.25*PI + 0.5*deg2rad*lat_stand2_lambert)/tan(0.25*PI + 0.5*deg2rad*lat_stand1_lambert))) end if lat0_lambert = rad2deg*asin(k_lambert) lat0 = lat0_in k = k_lambert F = earth_radius*cos(PI/180.0*lat_stand1_lambert)*(tan(PI/4.0+PI/360.0*lat_stand1_lambert)**k)/k y0 = F*tan(PI/4.0 - PI/360.0*lat0)**k r = sqrt(x*x + (y0 - y)*(y0 - y)) t = atan(x/(y0 - y)) gb = 2*180.0/PI*atan((F/r)**(1.0/k)) - 90.0 gl = lon0 + 180.0/PI*t/k end subroutine lambert2lb2_uEMEP