LL2PS_spherical Subroutine

public subroutine LL2PS_spherical(x, y, lon_in, lat_in, projection_attr)

Arguments

Type IntentOptional 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)

Called by

proc~~ll2ps_spherical~~CalledByGraph proc~ll2ps_spherical LL2PS_spherical proc~ll2proj LL2PROJ proc~ll2proj->proc~ll2ps_spherical proc~uemep_crossreference_grids uEMEP_crossreference_grids proc~uemep_crossreference_grids->proc~ll2ps_spherical proc~uemep_define_subgrid uEMEP_define_subgrid proc~uemep_define_subgrid->proc~ll2ps_spherical proc~uemep_grid_roads uEMEP_grid_roads proc~uemep_grid_roads->proc~ll2ps_spherical proc~uemep_read_agriculture_rivm_data uEMEP_read_agriculture_rivm_data proc~uemep_read_agriculture_rivm_data->proc~ll2ps_spherical proc~uemep_read_emep uEMEP_read_EMEP proc~uemep_read_emep->proc~ll2ps_spherical proc~uemep_read_industry_data uEMEP_read_industry_data proc~uemep_read_industry_data->proc~ll2ps_spherical proc~uemep_read_landuse_rivm_data uEMEP_read_landuse_rivm_data proc~uemep_read_landuse_rivm_data->proc~ll2ps_spherical proc~uemep_read_landuse_rivm_data->proc~uemep_crossreference_grids proc~uemep_read_meteo_nc uEMEP_read_meteo_nc proc~uemep_read_meteo_nc->proc~ll2ps_spherical proc~uemep_read_monthly_and_daily_shipping_asi_data uEMEP_read_monthly_and_daily_shipping_asi_data proc~uemep_read_monthly_and_daily_shipping_asi_data->proc~ll2ps_spherical proc~uemep_read_roadlink_data_ascii uEMEP_read_roadlink_data_ascii proc~uemep_read_roadlink_data_ascii->proc~ll2ps_spherical proc~uemep_read_rwc_heating_data uEMEP_read_RWC_heating_data proc~uemep_read_rwc_heating_data->proc~ll2ps_spherical proc~uemep_read_shipping_asi_data uEMEP_read_shipping_asi_data proc~uemep_read_shipping_asi_data->proc~ll2ps_spherical proc~uemep_read_weekly_shipping_asi_data uEMEP_read_weekly_shipping_asi_data proc~uemep_read_weekly_shipping_asi_data->proc~ll2ps_spherical proc~uemep_subgrid_emission_emep uEMEP_subgrid_emission_EMEP proc~uemep_subgrid_emission_emep->proc~ll2ps_spherical proc~uemep_calculate_emissions_for_emep uEMEP_calculate_emissions_for_EMEP proc~uemep_calculate_emissions_for_emep->proc~uemep_grid_roads proc~uemep_calculate_emissions_for_emep->proc~uemep_read_agriculture_rivm_data proc~uemep_calculate_emissions_for_emep->proc~uemep_read_industry_data proc~uemep_calculate_emissions_for_emep->proc~uemep_read_meteo_nc proc~uemep_calculate_emissions_for_emep->proc~uemep_read_monthly_and_daily_shipping_asi_data proc~uemep_calculate_emissions_for_emep->proc~uemep_read_roadlink_data_ascii proc~uemep_calculate_emissions_for_emep->proc~uemep_read_rwc_heating_data proc~uemep_calculate_emissions_for_emep->proc~uemep_read_shipping_asi_data proc~uemep_calculate_emissions_for_emep->proc~uemep_read_weekly_shipping_asi_data proc~uemep_region_mask_new uEMEP_region_mask_new proc~uemep_region_mask_new->proc~ll2proj proc~uemep_subgrid_emep_from_in_region uEMEP_subgrid_EMEP_from_in_region proc~uemep_subgrid_emep_from_in_region->proc~ll2proj program~uemep uEMEP program~uemep->proc~uemep_crossreference_grids program~uemep->proc~uemep_define_subgrid program~uemep->proc~uemep_grid_roads program~uemep->proc~uemep_read_agriculture_rivm_data program~uemep->proc~uemep_read_emep program~uemep->proc~uemep_read_industry_data program~uemep->proc~uemep_read_landuse_rivm_data program~uemep->proc~uemep_read_meteo_nc program~uemep->proc~uemep_read_monthly_and_daily_shipping_asi_data program~uemep->proc~uemep_read_roadlink_data_ascii program~uemep->proc~uemep_read_rwc_heating_data program~uemep->proc~uemep_read_shipping_asi_data program~uemep->proc~uemep_read_weekly_shipping_asi_data program~uemep->proc~uemep_subgrid_emission_emep program~uemep->proc~uemep_calculate_emissions_for_emep program~uemep->proc~uemep_region_mask_new program~uemep->proc~uemep_subgrid_emep_from_in_region

Source Code

    subroutine LL2PS_spherical(x, y, lon_in, lat_in, projection_attr)
        ! https://mathworld.wolfram.com/StereographicProjection.html
        ! grid_mapping_name = Polar_Stereographic
        ! 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
        real ::r
        real :: earth_radius
        real deg2rad,rad2deg,k_ps
        real lat0,lat0_in,lon0,lon0_in
        real false_easting,false_northing
        real scaling
        real lon,lat

        lon0_in = projection_attr(1)
        lat0_in = projection_attr(2)
        false_easting = projection_attr(3)
        false_northing = projection_attr(4)
        earth_radius = projection_attr(5)
        scaling = projection_attr(6)

        deg2rad = PI/180.0
        rad2deg = 180.0/PI
        r = earth_radius

        lat0 = lat0_in*deg2rad
        lon0 = lon0_in*deg2rad
        lon = lon_in*deg2rad
        lat = lat_in*deg2rad

        k_ps = 2.0*r*scaling/(1.0 + sin(lat0)*sin(lat) + cos(lat0)*cos(lat)*cos(lon - lon0))
        x = false_easting + k_ps*cos(lat)*sin(lon - lon0)
        y = false_northing + k_ps*(cos(lat0)*sin(lat) - sin(lat0)*cos(lat)*cos(lon - lon0))
    end subroutine LL2PS_spherical