How to remap variables with "nvertices"dimension ? #7153
Replies: 3 comments 6 replies
-
|
@zzzeamon, my hope is that @czender has an NCO solution for this. If not, an alternative is the (poorly documented) #!/usr/bin/env python
import xarray
from pyremap import (
LatLonGridDescriptor,
MpasVertexMeshDescriptor,
Remapper,
)
method = 'bilinear'
date = '20250319'
in_descriptor = MpasVertexMeshDescriptor(fileName='dat_src.nc', meshName='EC30to60E2r2')
out_descriptor = LatLonGridDescriptor.read(fileName='dat_rgr.nc', meshName='cmip6_180x360')
map_filename = f'map_{in_descriptor.meshName}_to_{out_descriptor.meshName}_{method}.{date}.nc'
remapper = Remapper(in_descriptor, out_descriptor, map_filename)
remapper.esmf_build_map(method=method, mpi_tasks=1) |
Beta Was this translation helpful? Give feedback.
-
|
NCO does not have a solution for this. Please try the solution above provided by @xylar. One difficulty for NCO is that the user is attempting to regrid a field stored on cell vertices, not cell centers. Note that the cell vertices are present only in default MPAS restart files, not monthly history files. The vertice locations could be obtained from a restart file and then converted to their own grid for application of the usual algorithms. It looks like the |
Beta Was this translation helpful? Give feedback.
-
|
If you're adventurous, you can create a mesh file for a vertex-centered mesh with the neighboring cells as cell corners. Then you can generate a map for that mesh to whatever destination you want. Since velocities are actually better interpolated without a conservative (area-based) remap, you could also use a vertex-centered mesh to do a nearest-neighbor distance weighted interpolation or other point-wise solution (see, for example the constrained optimization remaps by Bochev et al. https://doi.org/10.1016/j.jcp.2013.03.057 ) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi developers,
I am a beginner with E3SM. I encountered an issue while remapping data. I followed the command below to remap sea ice output, but found that this command only works for variables with the 'ncell' dimension.
ncremap -m map_EC30to60E2r2_to_cmip6_180x360_nco.20221012.nc dat_src.nc dat_rgr.nc
Some variables ( uVelocityGeo,vVelocityGeo...) in the sea ice output have the 'nvertices' dimension and cannot be remapped using this command. Could you please advise on how to solve this?
can be remapped:
timeMonthly_avg_iceAreaCell
Size: 236853x1
Dimensions: nCells,Time
Datatype: single
cannot be remapped:
timeMonthly_avg_uVelocityGeo
Size: 482371x1
Dimensions: nVertices,Time
Datatype: single
Attributes:
units = 'm/s'
long_name = 'True eastwards ice velocity'
Beta Was this translation helpful? Give feedback.
All reactions