1 subroutine da_llxy_ps_new(proj,info)
3 !-----------------------------------------------------------------------
4 ! Purpose: Given latitude (-90 to 90), longitude (-180 to 180), and the
5 ! standard polar-stereographic projection information via the
6 ! public proj structure, this routine returns the x/y indices which
7 ! if within the domain range from 1->nx and 1->ny, respectively.
8 !-----------------------------------------------------------------------
12 type(proj_info), intent(in) :: proj
13 type(infa_type), intent(inout) :: info
17 real :: scale_top, ala, rm, alo
19 if (trace_use) call da_trace_entry("da_llxy_ps_new")
21 reflon = proj%stdlon + 90.0
25 ! x(:,:) = proj%polei + proj%rebydx * COS(lat(:,:) * rad_per_deg) &
26 ! * (1.0 + proj%hemi * SIN(proj%truelat1 * rad_per_deg) &
27 ! / (1.0 + proj%hemi *SIN(lat(:,:) * rad_per_deg)) &
28 ! * COS((lon(:,:) - reflon) * rad_per_deg)
30 ! y(:,:) = proj%polej + proj%hemi * proj%rebydx * COS(lat(:,:) * rad_per_deg) &
31 ! * (1.0 + proj%hemi * SIN(proj%truelat1 * rad_per_deg) &
32 ! / (1.0 + proj%hemi *SIN(lat(:,:) * rad_per_deg)) &
33 ! * SIN((lon(:,:) - reflon) * rad_per_deg)
37 do n=lbound(info%lat,2),ubound(info%lat,2)
38 ! compute numerator term of map scale factor
40 scale_top = 1.0 + proj%hemi * sin(proj%truelat1 * rad_per_deg)
42 ! find radius to desired point
43 ala = info%lat(1,n) * rad_per_deg
44 rm = proj%rebydx * cos(ala) * scale_top/(1.0 + proj%hemi *sin(ala))
45 alo = (info%lon(1,n) - reflon) * rad_per_deg
46 info%x(:,n) = proj%polei + rm * cos(alo)
47 info%y(:,n) = proj%polej + proj%hemi * rm * sin(alo)
50 if (trace_use) call da_trace_exit("da_llxy_ps_new")
52 end subroutine da_llxy_ps_new