updated top-level README and version_decl for V4.5 (#1847)
[WRF.git] / var / da / da_tools / da_llxy_wrf_new.inc
blobddc83cbec9f7c295d3ca5897e665867b019cfbeb
1 subroutine da_llxy_wrf_new(proj, info)
3    !-----------------------------------------------------------------------
4    ! Purpose: Converts input lat/lon values to the cartesian (x,y) value
5    ! for the given projection. 
6    !-----------------------------------------------------------------------
8    implicit none
10    type(proj_info), intent(in)    :: proj
11    type(infa_type), intent(inout) :: info
13    if (trace_use) call da_trace_entry("da_llxy_wrf_new")
15    if (.NOT.proj%init) then
16       call da_error(__FILE__,__LINE__, &
17         (/"You have not called map_set for this projection!"/))
18    end if
20    select case(proj%code)
22       case(PROJ_LATLON)
23          call da_llxy_latlon_new(proj,info)
25       case(PROJ_MERC)
26          call da_llxy_merc_new(proj,info)
27          info%x(:,:) = info%x(:,:) + proj%knowni - 1.0
28          info%y(:,:) = info%y(:,:) + proj%knownj - 1.0
30       case(PROJ_PS)
31          call da_llxy_ps_new(proj,info)
32       
33       case(PROJ_LC)
34          call da_llxy_lc_new(proj,info)
35          info%x(:,:) = info%x(:,:) + proj%knowni - 1.0
36          info%y(:,:) = info%y(:,:) + proj%knownj - 1.0
38       case default
39          write(unit=message(1),fmt='(A,I2)') &
40             'Unrecognized map projection code: ', proj%code
41          call da_error(__FILE__,__LINE__,message(1:1))
42    end select
44    if (trace_use) call da_trace_exit("da_llxy_wrf_new")
46 end subroutine da_llxy_wrf_new