1 subroutine da_llxy_new (info, outside, outside_all)
3 !-----------------------------------------------------------------------
5 !-----------------------------------------------------------------------
7 ! This routine converts (lat, lon) into (x,y) coordinates
11 type(infa_type), intent(inout) :: info
12 logical, intent(inout) :: outside(:,:) ! wrt local domain
13 logical, optional, intent(out) :: outside_all(:,:) ! wrt all domains
15 if (trace_use) call da_trace_entry("da_llxy_new")
17 outside(:,:) = .false.
21 ! get the (x, y) coordinates
23 if (fg_format == fg_format_wrf_arw_regional) then
24 call da_llxy_wrf_new(map_info, info)
25 else if (fg_format == fg_format_wrf_nmm_regional) then
26 write(unit=message(1),fmt='(A,I5)') &
27 "Needs to be developed for fg_format_nmm_regional = ",fg_format
28 call da_error(__FILE__,__LINE__,message(1:1))
30 call da_llxy_global_new (info)
32 call da_llxy_default_new (info)
35 call da_togrid_new (info%x, its-2, ite+2, info%i, info%dx, info%dxm)
36 call da_togrid_new (info%y, jts-2, jte+2, info%j, info%dy, info%dym)
38 ! refactor to remove this ugly duplication later
39 if (present(outside_all)) then
40 outside_all(:,:) = .false.
41 ! Do not check for global options
42 if (.not. global) then
43 where ((int(info%x(:,:)) < ids) .or. (int(info%x(:,:)) >= ide) .or. &
44 (int(info%y(:,:)) < jds) .or. (int(info%y(:,:)) >= jde))
45 outside_all(:,:) = .true.
48 if (def_sub_domain) then
49 where (x_start_sub_domain > info%x(:,:) .or. y_start_sub_domain > info%y(:,:) .or. &
50 x_end_sub_domain < info%x(:,:) .or. y_end_sub_domain < info%y(:,:))
51 outside_all(:,:) = .true.
58 if (fg_format == fg_format_kma_global) then
59 where ((info%j(:,:) < jts-1) .or. (info%j(:,:) > jte))
63 where (info%j(:,:) == jde)
64 info%j(:,:) = info%j(:,:) - 1
72 ! Check for edge of domain:
74 where ((info%i(:,:) < ids) .or. (info%i(:,:) >= ide) .or. &
75 (info%j(:,:) < jds) .or. (info%j(:,:) >= jde))
80 where ((info%i(:,:) < its-1) .or. (info%i(:,:) > ite) .or. &
81 (info%j(:,:) < jts-1) .or. (info%j(:,:) > jte))
85 if (def_sub_domain) then
86 where (x_start_sub_domain > info%x(:,:) .or. y_start_sub_domain > info%y(:,:) .or. &
87 x_end_sub_domain < info%x(:,:) .or. y_end_sub_domain < info%y(:,:))
92 if (trace_use) call da_trace_exit("da_llxy_new")
94 end subroutine da_llxy_new