Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem in regular_grid and DOMAIN logic #26

Open
orianac opened this issue Jan 19, 2016 · 0 comments
Open

Problem in regular_grid and DOMAIN logic #26

orianac opened this issue Jan 19, 2016 · 0 comments

Comments

@orianac
Copy link
Member

orianac commented Jan 19, 2016

The VIC2nc converter doesn't behave in a very friendly way if we don't have the regular_grid and DOMAIN sections of the config file set up properly.

The two pertinent sections of the config file are below:

# input grid type (if False, Read from domain section below)
# valid values: True, False
regular_grid: True

and

# Grid File (domain file): uncomment if grid is irregular or you want to use a domain file
[DOMAIN]
filename: /Users/jhamman/Dropbox/RASM_Joe/routing_inputs/pour_points/domain.lnd.wr50a_ar9v4.100920.nc
longitude_var: xc
latitude_var: yc
y_x_dims: nj, ni
# Non-coordinate variables to include in each netcdf
copy_vars: frac, mask, area, xv, yv

If you set regular_grid: True and comment out the DOMAIN section the script runs fine. If you set regular_grid: False and leave in the DOMAIN section the script also runs fine. But if you set regular_grid: True and leave in the DOMAIN section the script spits out this error:

Traceback (most recent call last):
 File "/home/mbapt/anaconda/envs/tonic/bin/vic_utils", line 4, in <module>
   __import__('pkg_resources').run_script('tonic===0.0.0.dev-c3c957e', 'vic_utils')
 File "/home/mbapt/anaconda/envs/tonic/lib/python2.7/site-packages/setuptools-19.1.1-py2.7.egg/pkg_resources/__init__.py", line 745, in run_script
 File "/home/mbapt/anaconda/envs/tonic/lib/python2.7/site-packages/setuptools-19.1.1-py2.7.egg/pkg_resources/__init__.py", line 1677, in run_script
 File "/home/mbapt/anaconda/envs/tonic/lib/python2.7/site-packages/tonic-0.0.0.dev_c3c957e-py2.7.egg/EGG-INFO/scripts/vic_utils", line 221, in <module>

 File "/home/mbapt/anaconda/envs/tonic/lib/python2.7/site-packages/tonic-0.0.0.dev_c3c957e-py2.7.egg/EGG-INFO/scripts/vic_utils", line 197, in main

 File "build/bdist.linux-x86_64/egg/tonic/models/vic/vic2netcdf.py", line 505, in _run
 File "build/bdist.linux-x86_64/egg/tonic/models/vic/vic2netcdf.py", line 722, in vic2nc
 File "build/bdist.linux-x86_64/egg/tonic/models/vic/vic2netcdf.py", line 428, in nc_fields
ValueError: Field DOMAIN missing units                                      attribute

Can we include logic in the code to accommodate the instance in which regular_grid: True and the DOMAIN section is present? Or at least have a more informative error message?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant