66 character(SCRIP_charLength),
private ::
77 integer (SCRIP_i4),
private ::
90 &, nc_srcgrdcntrlat_id
91 &, nc_dstgrdcntrlat_id
92 &, nc_srcgrdcntrlon_id
93 &, nc_dstgrdcntrlon_id
96 &, nc_srcgrdcrnrlat_id
97 &, nc_srcgrdcrnrlon_id
98 &, nc_dstgrdcrnrlat_id
99 &, nc_dstgrdcrnrlon_id
129 character(SCRIP_CharLength),
intent(in) ::
138 character(SCRIP_CharLength),
intent(out) ::
147 integer (SCRIP_i4) ::
150 character (14),
parameter ::
151 & rtnName =
'read_remap_ww3'
159 ncstat = nf90_open(interp_file, nf90_noclobber, nc_file_id)
161 & opening interpolation file'))
return
167 ncstat = nf90_get_att(nc_file_id, nf90_global,
'title',
170 & reading map name'))
return
177 ncstat = nf90_get_att(nc_file_id, nf90_global,
'normalization',
180 & reading interpolation option'))
return
182 select case(normalize_opt)
190 print *,
'normalize_opt = ',normalize_opt
191 stop
'Invalid normalization option'
198 ncstat = nf90_get_att(nc_file_id, nf90_global,
'map_method',
201 & reading map method'))
return
203 select case(map_method)
204 case(
'Conservative remapping')
206 case(
'Bilinear remapping')
208 case(
'Distance weighted avg of nearest neighbors')
210 case(
'Bicubic remapping')
213 print *,
'map_type = ',map_method
214 stop
'Invalid Map Type'
221 ncstat = nf90_get_att(nc_file_id, nf90_global,
'conventions',
224 & reading file convention'))
return
232 select case(convention)
236 print *,
'convention = NCAR-CSM not supported for WW3'
237 stop
'unsupported file convention'
240 print *,
'convention = ',convention
241 stop
'unknown output file convention'
266 character (SCRIP_charLength) ::
270 integer (SCRIP_i4) ::
274 integer (SCRIP_i4),
dimension(:),
allocatable ::
278 character (20),
parameter ::
279 & rtnName =
'read_remap_scrip_ww3'
294 ncstat = nf90_get_att(nc_file_id, nf90_global,
'source_grid',
297 & reading source grid name'))
return
299 ncstat = nf90_get_att(nc_file_id, nf90_global,
'dest_grid',
302 & reading destination grid name'))
return
316 ncstat = nf90_inq_dimid(nc_file_id,
'dst_grid_size',
319 & reading destination grid id'))
return
321 ncstat = nf90_inquire_dimension(nc_file_id, nc_dstgrdsize_id,
324 & reading destination grid size'))
return
326 ncstat = nf90_inq_dimid(nc_file_id,
'num_links',
329 & reading number of links id'))
return
332 ncstat = nf90_inquire_dimension(nc_file_id, nc_numlinks_id,
335 & reading number of links'))
return
338 ncstat = nf90_inq_dimid(nc_file_id,
'num_wgts',
341 & reading number of weights id'))
return
343 ncstat = nf90_inquire_dimension(nc_file_id, nc_numwgts_id,
346 & reading number of weights'))
return
372 ncstat = nf90_inq_varid(nc_file_id,
'dst_grid_frac',
375 & reading destination grid fraction id'))
return
377 ncstat = nf90_inq_varid(nc_file_id,
'src_address',
380 & reading source grid address id'))
return
382 ncstat = nf90_inq_varid(nc_file_id,
'dst_address',
385 & reading destination grid address id'))
return
387 ncstat = nf90_inq_varid(nc_file_id,
'remap_matrix',
390 & reading remap matrix id'))
return
398 ncstat = nf90_get_var(nc_file_id, nc_dstgrdfrac_id,
401 & reading destination grid fraction'))
return
403 ncstat = nf90_get_var(nc_file_id, nc_srcgrdadd_id,
406 & reading source grid address'))
return
408 ncstat = nf90_get_var(nc_file_id, nc_dstgrdadd_id,
411 & reading destination grid address'))
return
413 ncstat = nf90_get_var(nc_file_id, nc_rmpmatrix_id,
416 & reading remap weights'))
return
419 ncstat = nf90_close(nc_file_id)
421 & closing netCDF file'))
return