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

mpas2wrf question.

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.

zemega

New member
I thought of using RIP4.7 to make plots for the output of regional MPAS-A 7.0. Which calls for the usage of https://github.com/NCAR/mpas2wrf to convert MPAS-A output to WRF grids. But I couldn't get it to work. I tried using netcdf-fortran package inside conda-forge ( to streamline the libraries used for ncl and RIP4.7). I can compile it, but running it would create output similar to below. Considering the code is old, I also tried with netcdf-4.1.3 and hdf5-1.8.22. Which gives the output below.
Code:
 Reading MPAS mesh information from file 'Antarctic.init.nc'

Program received signal SIGSEGV: Segmentation fault - invalid memory reference.

Backtrace for this error:
#0  0x7f0949d592ed in ???
#1  0x7f0949d58503 in ???
#2  0x7f09491cd03f in ???
#3  0x7f094922326d in ???
#4  0x7f09492251cb in ???
#5  0x563a14b3b9c8 in __netcdf_MOD_nf90_get_var_2d_fourbyteint
        at /home/yunus/mpas2wrf-master/netcdf-4.1.3/f90/netcdf_expanded.f90:1942
#6  0x563a14b01b04 in __scan_input_MOD_scan_input_read_field
        at /home/yunus/mpas2wrf-master/src/scan_input.F:512
#7  0x563a14b041be in __mpas_mesh_MOD_mpas_mesh_setup
        at /home/yunus/mpas2wrf-master/src/mpas_mesh.F:112
#8  0x563a14b1bd16 in convert_mpas
        at /home/yunus/mpas2wrf-master/src/mpas2wrf_grid.F:248
#9  0x563a14aff63e in main
        at /home/yunus/mpas2wrf-master/src/mpas2wrf_grid.F:3
Segmentation fault
The discussion about it is in https://github.com/conda-forge/netcdf-fortran-feedstock/issues/59. What I think is that the mpas2wrf code was written for older version of MPAS-A and things have changed since then? Would it be possible to request an update to this program?

What I really want to do is to create vertical cross-section of winds, temperature and potential vorticity from any latlon point to another latlon point. Is there any suggestion on post-processing MPAS-A output and be able to create vertical cross section from point A to point B? Terrain included if possible.
 
Although I've not actually tried the mpas2wrf program, it looks like the code is based heavily on the convert_mpas tool. Since we did need to modify the convert_mpas code to handle regional MPAS domains, it might be a reasonable assumption that, without modification, the mpas2wrf program wouldn't work for regional MPAS domains. Out of curiosity, does mpas2wrf run successfully if you provide global MPAS files?

We do have an example NCL script for plotting vertical cross sections, with terrain. You can find this script from the main MPAS web page (http://mpas-dev.github.io/) > "MPAS-Atmosphere download" > "Visualization and analysis tools"; then, look for the cross-section script all the way at the bottom of the page. You can also access the script directly as: https://www2.mmm.ucar.edu/projects/mpas/visualization/ncl/mpas-a_xsec.ncl .
The script hasn't been updated in quite a while so if you do encounter any issues in its use, please don't hesitate to follow-up here.
 
Top