module Convert 2D data
More...
|
subroutine, public | cnv2d_setup |
| Setup. More...
|
|
subroutine, public | cnv2d_tile_init (dtype, dlat, dlon, dir, catalogue, interp_type, interp_level, nmax) |
|
subroutine, public | cnv2d_grads_init (FILE_NAME, VAR_NAME, LAT_NAME, LON_NAME, interp_type, interp_level, search_limit, POSTFIX) |
|
subroutine, public | cnv2d_exec (var, step, min_value, yrevers) |
|
module Convert 2D data
- Description
- subroutines for preparing 2D data (convert from external file)
- Author
- Team SCALE
◆ cnv2d_setup()
subroutine, public mod_cnv2d::cnv2d_setup |
◆ cnv2d_tile_init()
subroutine, public mod_cnv2d::cnv2d_tile_init |
( |
character(len=*), intent(in) |
dtype, |
|
|
real(rp), intent(in) |
dlat, |
|
|
real(rp), intent(in) |
dlon, |
|
|
character(len=*), intent(in) |
dir, |
|
|
character(len=*), intent(in) |
catalogue, |
|
|
character(len=*), intent(in) |
interp_type, |
|
|
integer, intent(in), optional |
interp_level, |
|
|
integer, intent(in), optional |
nmax |
|
) |
| |
Definition at line 126 of file mod_cnv2d.F90.
134 file_tiledata_get_data
139 character(len=*),
intent(in) :: dtype
140 real(RP),
intent(in) :: dlat, dlon
141 character(len=*),
intent(in) :: dir
142 character(len=*),
intent(in) :: catalogue
143 character(len=*),
intent(in) :: interp_type
145 integer,
intent(in),
optional :: interp_level
146 integer,
intent(in),
optional :: nmax
148 real(RP) :: DOMAIN_LATS, DOMAIN_LATE
149 real(RP) :: DOMAIN_LONS, DOMAIN_LONE
151 character(len=H_LONG) :: fname
157 if (
present(nmax) )
then
163 domain_lats = minval( latxv(:,:) )
164 domain_late = maxval( latxv(:,:) )
165 domain_lons = minval( lonuy(:,:) )
166 domain_lone = maxval( lonuy(:,:) )
168 log_info(
"CNV2D_setup",*)
'Domain Information'
169 log_info_cont(*)
'Domain (LAT) :', domain_lats/d2r, domain_late/d2r
170 log_info_cont(*)
' (LON) :', domain_lons/d2r, domain_lone/d2r
172 tile_dlat = dlat * d2r
173 tile_dlon = dlon * d2r
175 if ( .not. first )
then
176 deallocate( tile_fname, tile_hit )
177 deallocate( tile_js, tile_je, tile_is, tile_ie )
178 deallocate( lat_1d, lon_1d )
181 allocate( tile_fname(tile_nlim), tile_hit(tile_nlim) )
182 allocate( tile_js(tile_nlim), tile_je(tile_nlim), tile_is(tile_nlim), tile_ie(tile_nlim) )
185 fname = trim(dir)//
'/'//trim(catalogue)
188 tile_dlat, tile_dlon, &
189 domain_lats, domain_late, domain_lons, domain_lone, &
193 tile_fname(:), tile_hit(:), &
194 tile_js(:), tile_je(:), tile_is(:), tile_ie(:), &
195 nlat, nlon, dom_js, dom_je, dom_is, dom_ie, &
198 allocate( lat_1d(nlat) )
199 allocate( lon_1d(nlon) )
203 tile_dlat, tile_dlon, &
204 lat_1d(:), lon_1d(:) )
207 cnv2d_tile_dtype = dtype
210 call cnv2d_init( interp_type, &
211 interp_level = interp_level, &
References scale_atmos_grid_cartesc_real::atmos_grid_cartesc_real_latxv, scale_atmos_grid_cartesc_real::atmos_grid_cartesc_real_lonuy, scale_const::const_d2r, scale_const::const_undef, scale_file_tiledata::file_tiledata_get_info(), scale_file_tiledata::file_tiledata_get_latlon(), and scale_prc::prc_abort().
Referenced by mod_cnvtopo::cnvtopo(), and mod_cnvuser::cnvuser_setup().
◆ cnv2d_grads_init()
subroutine, public mod_cnv2d::cnv2d_grads_init |
( |
character(len=*), intent(in) |
FILE_NAME, |
|
|
character(len=*), intent(in) |
VAR_NAME, |
|
|
character(len=*), intent(in) |
LAT_NAME, |
|
|
character(len=*), intent(in) |
LON_NAME, |
|
|
character(len=*), intent(in) |
interp_type, |
|
|
integer, intent(in), optional |
interp_level, |
|
|
real(rp), intent(in), optional |
search_limit, |
|
|
character(len=*), intent(in), optional |
POSTFIX |
|
) |
| |
Definition at line 227 of file mod_cnv2d.F90.
229 file_grads_get_shape, &
236 character(len=*),
intent(in) :: FILE_NAME
237 character(len=*),
intent(in) :: VAR_NAME
238 character(len=*),
intent(in) :: LAT_NAME
239 character(len=*),
intent(in) :: LON_NAME
240 character(len=*),
intent(in) :: INTERP_TYPE
241 integer,
intent(in),
optional :: interp_level
242 real(RP),
intent(in),
optional :: search_limit
243 character(len=*),
intent(in),
optional :: POSTFIX
245 integer :: file_id, var_id
253 call file_grads_get_shape( file_id, var_name, &
258 if ( .not. first )
deallocate( lat_org, lon_org, lat_1d, lon_1d )
259 allocate( lat_org(nlon,nlat), lon_org(nlon,nlat) )
260 allocate( lat_1d(nlat), lon_1d(nlon) )
266 call file_grads_read( file_id, var_id, &
271 lat_org(i,j) = lat_1d(j) * d2r
275 call file_grads_read( file_id, var_id, &
281 lat_org(i,j) = lat_org(i,j) * d2r
290 call file_grads_read( file_id, var_id, &
295 lon_org(i,j) = lon_1d(i) * d2r
299 call file_grads_read( file_id, var_id, &
305 lon_org(i,j) = lon_org(i,j) * d2r
313 cnv2d_ftype = i_grads
314 cnv2d_grads_fid = file_id
315 cnv2d_grads_vid = var_id
317 call cnv2d_init( interp_type, &
318 interp_level = interp_level, &
319 search_limit = search_limit, &
320 ll_struct = .false. )
References scale_const::const_d2r, scale_file_grads::file_grads_isoned(), scale_file_grads::file_grads_open(), and scale_file_grads::file_grads_varid().
Referenced by mod_cnvtopo::cnvtopo(), and mod_cnvuser::cnvuser_setup().
◆ cnv2d_exec()
subroutine, public mod_cnv2d::cnv2d_exec |
( |
real(rp), dimension(ia,ja), intent(out) |
var, |
|
|
integer, intent(in), optional |
step, |
|
|
real(rp), intent(in), optional |
min_value, |
|
|
logical, intent(in), optional |
yrevers |
|
) |
| |
Definition at line 330 of file mod_cnv2d.F90.
331 file_tiledata_get_data
337 real(RP),
intent(out) :: var(IA,JA)
338 integer,
intent(in),
optional :: step
339 real(RP),
intent(in),
optional :: min_value
340 logical,
intent(in),
optional :: yrevers
342 select case ( cnv2d_ftype )
344 call file_tiledata_get_data( nlat, nlon, &
348 tile_dlat, tile_dlon, &
349 tile_fname(:), tile_hit(:), &
350 tile_js(:), tile_je(:), tile_is(:), tile_ie(:), &
351 dom_js, dom_je, dom_is, dom_ie, &
355 min_value = min_value, yrevers = yrevers )
357 call file_grads_read( cnv2d_grads_fid, cnv2d_grads_vid, &
366 idx_i(:,:,:), idx_j(:,:,:), &
References scale_atmos_grid_cartesc::atmos_grid_cartesc_cx, scale_atmos_grid_cartesc::atmos_grid_cartesc_cy, scale_atmos_grid_cartesc_real::atmos_grid_cartesc_real_lat, scale_atmos_grid_cartesc_real::atmos_grid_cartesc_real_lon, scale_const::const_pi, scale_atmos_grid_cartesc_index::ia, scale_interp::interp_factor2d_linear_latlon(), scale_interp::interp_factor2d_linear_xy(), scale_interp::interp_factor2d_weight(), scale_interp::interp_interp2d(), scale_atmos_grid_cartesc_index::ja, and scale_prc::prc_abort().
Referenced by mod_cnvtopo::cnvtopo(), and mod_cnvuser::cnvuser().
subroutine, public interp_interp2d(npoints, IA_ref, JA_ref, IA, JA, idx_i, idx_j, hfact, val_ref, val, threshold_undef, wsum, val2)
subroutine, public prc_abort
Abort Process.
logical function, public file_grads_isoned(file_id, var_id)
subroutine, public file_grads_open(file_name, file_id)
Open.
subroutine, public file_tiledata_get_info(TILE_nlim, TILE_DLAT, TILE_DLON, DOMAIN_LATS, DOMAIN_LATE, DOMAIN_LONS, DOMAIN_LONE, catalog_fname, GLOBAL_IA, TILE_nmax, TILE_fname, TILE_hit, TILE_JS, TILE_JE, TILE_IS, TILE_IE, nLATH, nLONH, jsh, jeh, ish, ieh, zonal, pole, single_fname, LATS, LATE, LONS, LONE)
get tile information
subroutine, public file_grads_varid(file_id, var_name, var_id)
module Atmosphere GRID CartesC Real(real space)
subroutine, public file_tiledata_get_latlon(nLAT, nLON, jsh, ish, TILE_DLAT, TILE_DLON, LAT, LON)
get tile data
real(rp), dimension(:,:), allocatable, public atmos_grid_cartesc_real_latxv
latitude at staggered point (xv) [rad,-pi,pi]
real(rp), public const_d2r
degree to radian
real(rp), public const_undef
real(rp), dimension(:,:), allocatable, public atmos_grid_cartesc_real_lonuy
longitude at staggered point (uy) [rad,0-2pi]