14 USE mo_kind,
ONLY : i4, dp
15 use mo_message,
only: error_message
16 use mo_string_utils,
only : num2str
61 subroutine read_latlon(ii, lon_var_name, lat_var_name, level_name, level)
65 use mo_netcdf,
only : ncdataset, ncvariable
71 integer(i4),
intent(in) :: ii
73 character(*),
intent(in) :: lon_var_name
75 character(*),
intent(in) :: lat_var_name
77 character(*),
intent(in) :: level_name
79 type(
grid),
intent(inout) :: level
82 character(256) :: fname
85 real(dp),
dimension(:, :),
allocatable :: dummy
89 type(ncvariable) :: var
95 nc = ncdataset(fname,
"r")
100 var = nc%getVariable(trim(lat_var_name))
101 call var%getData(dummy)
103 if ((
size(dummy, dim = 1) .NE. level%nrows) .or. &
104 (
size(dummy, dim = 2) .NE. level%ncols))
then
105 call error_message(
' ***ERROR: subroutine mo_read_latlon: size mismatch in latlon file for ', trim(level_name), &
106 ' in domain ', trim(adjustl(num2str(ii))),
'!', raise=.false.)
107 call error_message(
' Latitude expected to have following dimensions ... rows:', &
108 trim(adjustl(num2str(level%nrows))),
', cols:', trim(adjustl(num2str(level%ncols))), raise=.false.)
109 call error_message(
' Latitude provided ... rows:', &
110 trim(adjustl(num2str(
size(dummy, dim = 1)))),
', cols:', trim(adjustl(num2str(
size(dummy, dim = 2)))))
114 var = nc%getVariable(trim(lon_var_name))
115 call var%getData(dummy)
117 if ((
size(dummy, dim = 1) .NE. level%nrows) .or. &
118 (
size(dummy, dim = 2) .NE. level%ncols))
then
119 call error_message(
' ***ERROR: subroutine mo_read_latlon: size mismatch in latlon file for ', trim(level_name), &
120 ' in domain ', trim(adjustl(num2str(ii))),
'!', raise=.false.)
121 call error_message(
' Longitude expected to have following dimensions ... rows:', &
122 trim(adjustl(num2str(level%nrows))),
', cols:', trim(adjustl(num2str(level%ncols))), raise=.false.)
123 call error_message(
' Longitude provided ... rows:', &
124 trim(adjustl(num2str(
size(dummy, dim = 1)))),
', cols:', trim(adjustl(num2str(
size(dummy, dim = 2)))))
Provides common types needed by mHM, mRM and/or mpr.
Provides structures needed by mHM, mRM and/or mpr.
character(256), dimension(:), allocatable, public filelatlon
reading latitude and longitude coordinates for each domain
subroutine, public read_latlon(ii, lon_var_name, lat_var_name, level_name, level)
reads latitude and longitude coordinates