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 regional forecast - do not have height_200hPa in latlon.nc

This post was from a previous version of the WRF&MPAS-A Support Forum. New replies have been disabled and if you have follow up questions related to this post, then please start a new thread from the forum home page.

wrfpup

Member
Hi -
I am able to do T, RH plots for a global MPAS forecast after generating latlon.nc with x1.10242.init.nc using convert_mpas and one of my diag* files. The template I used to generate my scripts for relative humidity at a given pressure level is found at:
https://unidata.github.io/python-training/gallery/700hpa_relh_winds/

What I am wondering is why, for the global forecast, I see the height_200hPa parameter in latlon.nc, but for a regional (a portion of Europe) forecast , there is no height_200hPa parameter in latlon.nc. This is blocking my ability to plot graphics at the 200hPa level for a MPAS regional forecast.

The only file where I see height parameters designated (like height_200hPa) is in stream_list.atmosphere.diagnostics and I see height_200hPa listed both for my global case and for my regional case.

Could someone please advise me on what I might be missing here.

Thanks much,
Steve
 
I realized I may have left off a few salient points in my earlier email so I am adding them here:

(1) I used the same x1.10242.init.nc file to generate latlon.nc both for the global MPAS case and the regional MPAS case.
(2) height_200hPa is definitely found in the diag*.nc files for both the global case and the regional case.
 
I don't think I'm completely following your workflow: you mention using the same x1.10242.init.nc file for both the global MPAS case and the regional MPAS case. What does your command look like when converting your regional MPAS diagnostic output files?
 
Here is the command to generate latlon.nc (from one of my python scripts, where mpas_diag_file is a script argument, and is one of the MPAS regional output files (diag.*):

command="convert_mpas " + "x1.10242.init.nc " + mpas_diag_file
 
wrfpup said:
Here is the command to generate latlon.nc (from one of my python scripts, where mpas_diag_file is a script argument, and is one of the MPAS regional output files (diag.*):

command="convert_mpas " + "x1.10242.init.nc " + mpas_diag_file
Assuming x1.10242.init.nc contains global initial conditions on the 240-km quasi-uniform mesh, I don't think your command will work when 'mpas_diag_file' is the name of a regional output file. The first argument to the convert_mpas program needs to contain mesh information that is consistent with subsequent file arguments.
 
I see what you're saying. I do have 'Italy.init.nc' for my regional case and an ncdump of it shows these constraints:

dimensions:
nCells = 334 ;
nEdges = 1066 ;
nVertices = 733 ;
maxEdges = 10 ;
maxEdges2 = 20 ;
TWO = 2 ;
vertexDegree = 3 ;
nVertLevels = 1 ;
Time = UNLIMITED ; // (0 currently)

// global attributes:
:eek:n_a_sphere = "YES " ;
:sphere_radius = 1. ;
================================================================================

and looking at an ncdump of an MPAS diag* output file for this regional case shows:

Diag.2021-11-08_12:00:00 --
dimensions:
StrLen = 64 ;
Time = UNLIMITED ; // (1 currently)
nCells = 334 ;
nVertices = 733 ;
nIsoLevelsT = 5 ;
nIsoLevelsZ = 13 ;

so the values for nCells and nVertices match up. I hope this is sufficient.

I went ahead and ran this command: "convert_mpas Italy.init.nc diag.2021-11-08_12.00.00.nc". The resultant latlon.nc file contains the variable height_200hPa, but the values, unfortunately, are all _'s, i.e., no value. When I look at other variables, there are very small pockets of real values, interspersed, which I assume pertain to my area of interest. Not sure what is going on. One other thing that perplexes me is that the 'latitude' variable in this latlon.nc from the regional case ranges from -90 to +90 and the longitude ranges from -180. to +180., i.e., the globe is encompassed. I was expecting lat/lon's ranging over my regional area of interest. Pls let me know what you think. Thanks much.
 
Can you try removing any existing 'latlon.nc' file before re-running the command
Code:
convert_mpas Italy.init.nc diag.2021-11-08_12.00.00.nc
?

The convert_mpas program attempts to append to the 'latlon.nc' file if one is present in your working directory, and this doesn't usually work well in practice, so as a general recommendation, it's usually best to remove or rename any existing 'latlon.nc' file before re-running convert_mpas.
 
Yes - I had noticed that 'convert_mpas' does append to any existing latlon.nc because I was running out of space really fast and it took me a second to realize what was causing it.

Anyway, after deleting the existing latlon.nc, I re-ran the command:

convert_mpas Italy.init.nc diag.2021-11-08_12.00.00.nc

and did an ncdump of the file. I still see almost all missing values for the variables, and the lat range is -90:90 and the lon range is: -180:180, i.e., global so it is as I described earlier.
 
The default target grid is a global 0.5x0.5-degree grid, so my guess would be that the missing values appear in regions of the globe outside of your regional domain. The README.md file describes how you can adjust the size and resolution of the target lat-lon grid.
 
Thanks for that info. I'll test out adjusting the convert_mpas args as described in the README.md so I can create a latlon.nc grid matching the area of my regional domain. This will more than likely happen next week as I am out of pocket for the holiday this week. Greatly appreciate you pointing out this capability!
 
Glad to help! At present, there are some issues with limited-area domains in the convert_mpas tool; the "Visualizing regional output" section of the online tutorial shows an example of the sorts of artifacts that can appear in the interpolated output. We do have some ideas on how to fix this, but I don't have an estimate for when those fixes might make their way into the main branch of the convert_mpas repository, unfortunately.
 
I did try a quick test today --

From the diag* file I'm using, it has this:

nCells = 334 ;

so for my target_domain file, I have:
nlat=18
nlon=18
startlat=36.0
endlat=48.0
startlon=6.0
endlon=21.0
to capture a subset of my regional area.

I deleted my latlon.nc. Re-ran 'convert_mpas Italy.init.nc diag.2021-11-08_12.00.00.nc' and interestingly, the only values which exist in latlon.nc are:
latitude, longitude, and vorticity. All the other variables have missing values. I re-checked the values in diag.2021-11-08_12.00.00.nc and every variable has good values. So I guess I'm still a bit puzzled...
 
Could you attach a listing of the printout that is written to stdout as the convert_mpas program runs? As a side note, I suppose I could add "create a log file" to the to-do list for the convert_mpas program!
 
Sorry it has taken me a good while to get back on this --

I am able to get some regional plots after successfully getting good values in the latlon.nc file for a regional forecast. I did 2 things:

(1) employed a 'target_domain' file to pinpoint the area I want to plot for (thanks for that earlier pointer!)
(2) in the convert_mpas source code, specifically, in remapper.F, I defined NEAREST_NEIGHBOR as .true. - this turned on the section of code I needed to get (good) interpolated values in latlon.nc

Thanks for the earlier guidance. It always helps tremendously.
 
Top