Project

General

Profile

remapping MPAS fields that are defined on vertices

Added by Falko Judt about 3 years ago

Hi, I'm having trouble remapping certain MPAS fields. I'm working with DYAMOND data and I'd like to remap the vorticity_500hPa fields to a n80 Gaussian grid.

GW='/work/ka1081/DYAMOND/PostProc/GridsAndWeights'

cdo -P 1 -f nc4 remap,n80,/scratch/b/b380814/dyamond_tcs/mpas/weight_n80.nc  -setgrid,mpas:$GW/MPAS-3.75km_gridinfo.nc -selname,vorticity_500hPa /work/ka1081/DYAMOND/MPAS-3.75km/diag.2016-08-01_03.00.00.nc test_n80.nc
cdo(1) setgrid: Process started
cdo(2) selname: Process started
cdo(1) setgrid (Warning): No horizontal grid with 41943042 cells found!

cdo    remap (Abort): Unsupported generic coordinates (Variable: vorticity_500hPa)!
terminate called without an active exception
Aborted

The MPAS source mesh has 41943042 cells 83886080 vertices. The warning "No horizontal grid with 41943042 cells found!" tells me that CDO assumes that all variables are defined at the cells (nCells = 41943042); however, vorticity_500hPa is defined at the vertices of which there are 83886080:


netcdf diag.2016-08-01_03.00.00.nc {
dimensions:
    nCells = 41943042 ;
    nVertices = 83886080 ;
    maxEdges = 6 ;
        float vorticity_500hPa(Time, nVertices) ;

Remapping variables that are defined at the cells and have dimension 41943042 works without problems:


netcdf diag.2016-08-01_03.00.00.nc {
dimensions:
    nCells = 41943042 ;
    nVertices = 83886080 ;
    maxEdges = 6 ;
        float u10(Time, nCells) ;

cdo -P 1 -f nc4 remap,n80,/scratch/b/b380814/dyamond_tcs/mpas/weight_n80.nc  -setgrid,mpas:$GW/MPAS-3.75km_gridinfo.nc -selname,u10 /work/ka1081/DYAMOND/MPAS-3.75km/diag.2016-08-01_03.00.00.nc test_n80.nc
cdo(1) setgrid: Process started
cdo(2) selname: Process started
cdo(2) selname: Processed 83886084 values from 88 variables over 1 timestep.
cdo(1) setgrid: Processed 83886084 values from 2 variables over 1 timestep.
cdo    remap: Processed 83886084 values from 2 variables over 1 timestep [24.06s 13GB].

Is there a way to remap MPAS fields with dimensions (Time, nVertices), or is this at this point not possible with CDO?

Thanks for your help,
Falko


Replies (6)

RE: remapping MPAS fields that are defined on vertices - Added by Ralf Mueller about 3 years ago

hi!
I can only guess because I don't know, there exactly the grid file is locates (@$GV$ is no given). But the variables in the input files do not use the coordinates attribute to link the variable to a certain grid.

This can be added on the fly by cdo -setattributes,..... , but without the value $GV I cannot test.

best wished
ralf

RE: remapping MPAS fields that are defined on vertices - Added by Florian Ziemen about 3 years ago

Moin Falko,

I've created cdo-compatible grid files for the vertices.

Try

cdo -P 1 -f nc4 remapnn,n80  -setgrid,$GW/MPAS-3.75km_gridinfo_vertex.nc -selname,vorticity_500hPa -seltimestep,1 /work/ka1081/DYAMOND/MPAS-3.75km/diag.2016-08-01_03.00.00.nc test_n80.nc

(if you want to use weights (good idea), you'll have to generate new weights for the vertex grid)

Cheers

Flo

RE: remapping MPAS fields that are defined on vertices - Added by Falko Judt about 3 years ago

Thanks Flo, this worked!

But I haven't succeeded generating weights for the vertex grid.

So far, I've used the following to generate weights for the "normal" cell grid.

cdo -P 8 --cellsearchmethod spherepart -gencon,n80 -setgrid,mpas:/work/ka1081/DYAMOND/PostProc/GridsAndWeights/MPAS_x1.41943042.grid.nc -selgrid,1 /work/ka1081/DYAMOND/MPAS-3.75km/diag.2016-08-01_00.15.00.nc weights_0.5deg.nc

What do I have to change to generate weights for the vertex grid?

Thanks and Cheers!
Falko

RE: remapping MPAS fields that are defined on vertices - Added by Florian Ziemen about 3 years ago

There's some voodoo happening in determining the corners (necessary for the conservative remapping). I'll look into that tomorrow. Maybe we can trick cdo into doing that easily, maybe I can compute them in Python from the info in the grid file. I'll dig a bit. My first attempt failed, but that might simply be a 5 instead of N-1 in the cdo code, where I still have to find the N.

RE: remapping MPAS fields that are defined on vertices - Added by Florian Ziemen about 3 years ago

Try using

-setgrid,/work/ka1081/DYAMOND/PostProc/GridsAndWeights/MPAS_x1.41943042_vertex_grid.nc

(without mpas: in the argument) - I've tried to create a complete grid file with all standard bounds. I've performed a few tests on it, and it seems sane.
    (1-6/6)