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

Create_region error about 3km

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.

Yue_Ma

New member
Hi,
Is anyone try to use MPAS-Limited_Area make region mesh? While I produce a 3km region mesh with 60-3km mesh( after grid-rotate ) , it shows
Code:
...
Copying variable meshDensity... 
Copying global attributes...
Traceback (most recent call last):
  File "../create_region", line 65, in <module>
    regional_area.gen_region(**kwargs)
  File "path/to/MPAS-Limited-Area/limited_area/limited_area.py", line 164, in gen_region
    mesh.copy_global_attributes(regionalMesh)
  File "path/to/MPAS-Limited-Area/limited_area/mesh.py", line 309, in copy_global_attributes
    region.mesh.n_scvt_iterations = self.mesh.n_scvt_iterations
  File "netCDF4/_netCDF4.pyx", line 2725, in netCDF4._netCDF4.Dataset.__getattr__
  File "netCDF4/_netCDF4.pyx", line 2671, in netCDF4._netCDF4.Dataset.getncattr
  File "netCDF4/_netCDF4.pyx", line 1289, in netCDF4._netCDF4._get_att
  File "netCDF4/_netCDF4.pyx", line 1754, in netCDF4._netCDF4._ensure_nc_success
AttributeError: NetCDF: Attribute not found
 
In the current HEAD of the MPAS-Limited-Area repository, it looks like we're trying to copy global attributes that may not exist in all meshes: these attributes may not be available in all meshes, depending on which tool was used to create the mesh.

Could you try deleting the indicated lines in the link, above, and running again? We should be able to get a pull request to fix this issue soon.

Also, at present, some parts of the MPAS-Limited-Area tool will run very slowly until PR #14 is merged.
 
Sorry for the late reply.
I get the same error log after deleting 156-158 lines in /limited_area/mesh.py. Using 'ncdump -h' checking 'global attributes' in generated file, it shows
Code:
{
// global attributes:
		:np = 501060LL ;
		:on_a_sphere = "YES             " ;
		:sphere_radius = 1. ;
}
 
Hi Yue_Ma,

That is because there was (accidentally) two duplicate `copy_global_attributes` functions in mesh.py. I apologize about not having the last fix work. We have just merged a fix that removes the duplicate function and only copies `on_a_sphere`, and `sphere_radius`.

The new HEAD of the MPAS-Limited-Area repository contains that merge. Can you give it a run and let us know how it goes? It also contains PR #14, so things should be a lot faster for you as well.

Thanks for your patience! We're still working out the kinks!
 
Top