Scheduled Downtime
On Friday 21 April 2023 @ 5pm MT, this website will be down for maintenance and expected to return online the morning of 24 April 2023 at the latest

MPAS Post-processing

Monica

New member
Hi all,

I am currently using ncl to post-process the output file history*.nc of mpas. I want to draw some wind field diagrams, but I found that in the history*nc file, only u(time,nEdges,nVertLevels), there is no v. How should I draw the wind field diagram with ncl? Can you give me some simple example?

char xtime(Time, StrLen) ;
xtime:units = "YYYY-MM-DD_hh:mm:ss" ;
xtime:long_name = "Model valid time" ;
float u(Time, nEdges, nVertLevels) ;
u:units = "m s^{-1}" ;
u:long_name = "Horizontal normal velocity at edges" ;
float w(Time, nCells, nVertLevelsP1) ;
w:units = "m s^{-1}" ;
w:long_name = "Vertical velocity at vertical cell faces" ;
float pressure(Time, nCells, nVertLevels) ;
pressure:units = "Pa" ;
pressure:long_name = "Pressure" ;

Thanks
 
Although it's quite old and I haven't used it for a while, I've attached an example NCL script that overlays wind barbs on a plot of a scalar field. If you look in the script beginning with the comment
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; BEGIN WIND BARB PLOTTING
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
you'll find the code to interpolate the winds to a regular lat-lon grid and to plot them.
 

Attachments

  • atm_barbs.ncl.txt
    4.3 KB · Views: 36
Hi, mandachasteen, mgduda,
Thank you both for your advice and code, which got me now that the problem is fully resolved.
Thanks
 
Although it's quite old and I haven't used it for a while, I've attached an example NCL script that overlays wind barbs on a plot of a scalar field. If you look in the script beginning with the comment

you'll find the code to interpolate the winds to a regular lat-lon grid and to plot them.
Hi, mgduda
I now know how to use the uReconstructZonal(Time, nVertLevels, latitude, longitude) and uReconstructMeridional(Time, nVertLevels, latitude, longitude) in the history*.nc to plot a horizontal wind field figure. But another problem is, I need to plot the wind field on a specific 500hPa. But the 'nVertLevels' dimension does not seem to be isobaric surfaces. So what do I need to do? Do I need to do vertical interpolation and How?

Best
 
For the specific case of 500 hPa zonal and meridional winds, these are already available in the default diagnostics stream as 'uzonal_500hPa' and 'umeridional_500hPa'. More generally, though, this forum post illustrates how SciPy's interp1d can be used to vertically interpolate fields to an isobaric surface: Plot moist potential temperature at 500 hPa .
 
Although it's quite old and I haven't used it for a while, I've attached an example NCL script that overlays wind barbs on a plot of a scalar field. If you look in the script beginning with the comment

you'll find the code to interpolate the winds to a regular lat-lon grid and to plot them.
Hello,sorry to bother you,even though I'm using MPAS-Ocean, I have a similar problem.The initial field requires me to provide normalvelocity and how can i interpolate the u and v form regular lat-lon grid to MPAS-O grid .it looks like that i can ues the equation below to get normalvelocity and tangentialvelocity. I can use ESMF_regrid to get velocityZonal(Time, nCells, nVertLevels) and velocityMeridional(Time, nCells, nVertLevels) from u and v in the regular lat-lon grid. But according to the equation, it seems like I should get velocityZonal and velocityMeridional in such form(Time, nEdges, nVertLevels).

What I'm puzzled about is that the initial field provided by the running case only have normalvelocity without tangentialvelocity. The normalvelocity in user guide is state data and the tangentialvelocity is diagnostic data. Could i only put velocityZonal(Time, nCells, nVertLevels) and velocityMeridional(Time, nCells, nVertLevels) in the initial field and ignore the normalvelocity?

1722172478967.png
 
Hi,

If I understand your question correctly, I don't think that it works for MPAS-A if you only have zonal and meridional winds in the initial data. Note that normal velocity is a required variable for MPAS-A. I am not sure whether this is true for MPAS-O.

The equation you cited is for calculating zonal and meridional winds based on normal and tangential velocity on MPAS mesh.

Hello,sorry to bother you,even though I'm using MPAS-Ocean, I have a similar problem.The initial field requires me to provide normalvelocity and how can i interpolate the u and v form regular lat-lon grid to MPAS-O grid .it looks like that i can ues the equation below to get normalvelocity and tangentialvelocity. I can use ESMF_regrid to get velocityZonal(Time, nCells, nVertLevels) and velocityMeridional(Time, nCells, nVertLevels) from u and v in the regular lat-lon grid. But according to the equation, it seems like I should get velocityZonal and velocityMeridional in such form(Time, nEdges, nVertLevels).

What I'm puzzled about is that the initial field provided by the running case only have normalvelocity without tangentialvelocity. The normalvelocity in user guide is state data and the tangentialvelocity is diagnostic data. Could i only put velocityZonal(Time, nCells, nVertLevels) and velocityMeridional(Time, nCells, nVertLevels) in the initial field and ignore the normalvelocity?

View attachment 15002
 
Hi,

If I understand your question correctly, I don't think that it works for MPAS-A if you only have zonal and meridional winds in the initial data. Note that normal velocity is a required variable for MPAS-A. I am not sure whether this is true for MPAS-O.

The equation you cited is for calculating zonal and meridional winds based on normal and tangential velocity on MPAS mesh.
Thank you. The normal velocity is also required for MPAS-O,so i plan to regrid zonal and meridional velocity from regular lat-lon grid to MPAS-O grid( the value is located in edge) for calculation. The u and v represent normalvelocity and tangentialvelocity .

I am curious about how to get normalvelocity in the initial field . All the initial fields provided by cases have normalvelocity,but although some initial fields have this variable,the value is 0.

As to MPAS-A,how do you get the normalvelocity?
1724004475630.png
 
The algorithm you posted above is the correct method to calculate normal velocity, i.e.,

normal velocity = u*cos(alpha) + v*sin(alpha), here u and v are earth-relative zonal and meridional winds.
 
Top