Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real, | intent(out) | :: | x | |||
real, | intent(out) | :: | y | |||
real, | intent(in) | :: | lon_in | |||
real, | intent(in) | :: | lat_in | |||
double precision, | intent(in) | :: | projection_attr(10) |
subroutine LL2LAEA(x, y, lon_in, lat_in, projection_attr) ! https://epsg.io/3035 ! grid_mapping_name = lambert_azimuthal_equal_area ! Map parameters: ! longitude_of_projection_origin ! latitude_of_projection_origin ! false_easting - This parameter is optional (default is 0) ! false_northing - This parameter is optional (default is 0)lat_stand1_lambert=projection_attributes(1) double precision, intent(in) :: projection_attr(10) real, intent(in) :: lon_in, lat_in real, intent(out) :: x, y ! Local variables real :: semi_major_axis real :: deg2rad,rad2deg real :: lat0, lat0_in, lon0, lon0_in real :: false_easting, false_northing real :: lon, lat real :: inv_f, f, a, e, q_p, q_0, q, beta, beta_0, R_q, D, B lon0_in = projection_attr(1) lat0_in = projection_attr(2) false_easting = projection_attr(3) false_northing = projection_attr(4) semi_major_axis = projection_attr(5) inv_f = projection_attr(6) !flattening deg2rad = PI/180.0 rad2deg = 180.0/PI a = semi_major_axis f = 1.0/inv_f e = sqrt(2.0*f - f*f) lat0 = lat0_in*deg2rad lon0 = lon0_in*deg2rad lon = lon_in*deg2rad lat = lat_in*deg2rad q_p = (1.0 - e*e)*(1.0/(1.0-e*e) - 1.0/(2.0*e)*log((1.0 - e)/(1.0 + e))) q_0 = (1.0 - e*e)*(sin(lat0)/(1.0 - e*e*sin(lat0)**2) - 1.0/(2.0*e)*log((1.0 - e*sin(lat0))/(1.0 + e*sin(lat0)))) q = (1.0 - e*e)*(sin(lat)/(1.0 - e*e*sin(lat)**2) - 1.0/(2.0*e)*log((1.0 - e*sin(lat))/(1.0 + e*sin(lat)))) beta_0 = asin(q_0/q_p) beta = asin(q/q_p) R_q = a*sqrt(q_p/2.0) D = a*(cos(lat0)/sqrt(1.0 - e*e*sin(lat0)**2)/(R_q*cos(beta_0))) B = R_q*sqrt(2.0/(1.0 + sin(beta_0)*sin(beta) + cos(beta_0)*cos(beta)*cos(lon - lon0))) x = false_easting + B*D*cos(beta)*sin(lon - lon0) y = false_northing + B/D*(cos(beta_0)*sin(beta) - sin(beta_0)*cos(beta)*cos(lon - lon0)) end subroutine LL2LAEA