CDAT / uvcmetrics

metrics aka diagnostics for comparing models with observations or each other
BSD 3-Clause "New" or "Revised" License
3 stars 8 forks source link

Plotset 3 TypeError: Error Converting. #167

Open chaosphere2112 opened 8 years ago

chaosphere2112 commented 8 years ago
diags.py --model path=/space1/test_data/climate_output2,climos=yes,type=model  --obs path=/space1/test_data/obs/,climos=yes,filter="f_startswith('ERA40')" --logo no   --package AMWG  --set 3 --seasons DJF JJA ANN --vars PREH2O LHFLX  --outputdir /tmp/$(whoami)   --prefix set3 --postfix ERA40 

Note: command generated by metadiags.

Log:

(Probably what is wrong with regional. carbon needs some more conversions too though)
UV-CDAT Diagnostics, command-line version
/usr/local/uvcdat/2.4.1/bin/diags.py --model path=/space1/test_data/climate_output2,climos=yes,type=model --obs path=/space1/test_data/obs/,climos=yes,filter=f_startswith('ERA40') --logo no --package AMWG --set 3 --seasons DJF JJA ANN --vars PREH2O LHFLX --outputdir /tmp/fries2 --prefix set3 --postfix ERA40
/usr/local/uvcdat/2.4.1/bin/diags.py
BEGIN PROVENANCE INFORMATION
version - uvcdat-2.4.1
UVCDAT - UV-CDAT: 2.4.1 Metrics: 1.0.0 (uvcdat-2.4.1) script_sha1: 28f67e83cde0e8b8cef7de51aeb836e631001ae2
history - 2016-04-26 21:28:19.376095: created by fries2 from path: /export/fries2 with input command line: /usr/local/uvcdat/2.4.1/bin/diags.py --model path=/space1/test_data/climate_output2,climos=yes,type=model --obs path=/space1/test_data/obs/,climos=yes,filter=f_startswith('ERA40') --logo no --package AMWG --set 3 --seasons DJF JJA ANN --vars PREH2O LHFLX --outputdir /tmp/fries2 --prefix set3 --postfix ERA40
END PROVENANCE INFORMATION
Added set:  {'climos': 'yes', 'end': None, 'name': None, 'filter': None, 'start': None, 'path': '/space1/test_data/climate_output2', 'type': 'model'}
Added set:  {'climos': 'yes', 'end': None, 'name': None, 'filter': "f_startswith('ERA40')", 'start': None, 'path': '/space1/test_data/obs/', 'type': 'obs'}
Enabling NetCDF compression on output files
seasons:  ['DJF', 'JJA', 'ANN']
INFO:  file /space1/test_data/climate_output2/climo2_old.nc has an axis lon with no bounds.
An attempt will be made to compute bounds, but that is unreliable compared to bounds provided by the data file.
INFO:  file /space1/test_data/climate_output2/climo2_old.nc has an axis ilev with no bounds.
An attempt will be made to compute bounds, but that is unreliable compared to bounds provided by the data file.
There will be no more bad data warnings from constructing this filetable.
cache_path= /tmp
INFO:  file /space1/test_data/climate_output2/climo2_old.nc has an axis lon with no bounds.
An attempt will be made to compute bounds, but that is unreliable compared to bounds provided by the data file.
INFO:  file /space1/test_data/climate_output2/climo2_old.nc has an axis ilev with no bounds.
An attempt will be made to compute bounds, but that is unreliable compared to bounds provided by the data file.
There will be no more bad data warnings from constructing this filetable.
cache_path= /tmp
INFO:  file /space1/test_data/obs/ERA40_01_climo.nc has an axis lat with no bounds.
An attempt will be made to compute bounds, but that is unreliable compared to bounds provided by the data file.
INFO:  file /space1/test_data/obs/ERA40_01_climo.nc has an axis lon with no bounds.
An attempt will be made to compute bounds, but that is unreliable compared to bounds provided by the data file.
There will be no more bad data warnings from constructing this filetable.
model 0 id: ft1_climate_output2
obs 0 id: ft2_obs_ERA40
Using times= ['DJF', 'JJA', 'ANN']
Using regions [rg_Global]
Working on  3 - Line Plots of  Zonal Means  plots
opts vars: ['PREH2O', 'LHFLX']
var list from pclass:  ['AODVIS', 'CLDHGH_ISCCP', 'CLDHGH_TAU1.3-9.4_MODIS', 'CLDHGH_TAU1.3_MODIS', 'CLDHGH_TAU9.4_MODIS', 'CLDHGH_VISIR', 'CLDLOW_ISCCP', 'CLDLOW_TAU1.3-9.4_MISR', 'CLDLOW_TAU1.3_MISR', 'CLDLOW_TAU9.4_MISR', 'CLDLOW_VISIR', 'CLDMED_ISCCP', 'CLDMED_VISIR', 'CLDTOT_ISCCP', 'CLDTOT_TAU1.3-9.4_ISCCP', 'CLDTOT_TAU1.3-9.4_MISR', 'CLDTOT_TAU1.3-9.4_MODIS', 'CLDTOT_TAU1.3_ISCCP', 'CLDTOT_TAU1.3_MISR', 'CLDTOT_TAU1.3_MODIS', 'CLDTOT_TAU9.4_ISCCP', 'CLDTOT_TAU9.4_MISR', 'CLDTOT_TAU9.4_MODIS', 'CLDTOT_VISIR', 'CLISCCP', 'CLMISR', 'EminusP', 'LHFLX', 'OMEGA', 'PRECT', 'PS', 'PSL', 'QFLX', 'QFLX_LND', 'QFLX_OCN', 'RELHUM', 'RESTOM', 'T', 'TGCLDLWP', 'TMQ', 'TREFHT', 'U', 'V', 'WV_LIFETIME', 'Z3', 'gw', 'lat', 'lev', 'lon']
Region:  Global
Region filename:  Global
Processing variable LHFLX  in season ANN  in plotset  3 - Line Plots of  Zonal Means  - variable  0 of  1
now composite plot
Setting preferred_units='W/m^2'
ERROR could not convert from W/m~S~2~N to W/m^2
Traceback (most recent call last):
  File "/usr/local/uvcdat/2.4.1/bin/diags.py", line 694, in <module>
    run_diags(o)
  File "/usr/local/uvcdat/2.4.1/bin/diags.py", line 250, in run_diags
    res = plot.compute(newgrid=-1) # newgrid=0 for original grid, -1 for coarse
  File "/usr/local/uvcdat/2.4.1/lib/python2.7/site-packages/metrics/frontend/uvcdat.py", line 950, in compute
    return self.results(newgrid)
  File "/usr/local/uvcdat/2.4.1/lib/python2.7/site-packages/metrics/frontend/uvcdat.py", line 1017, in results
    return self._results(newgrid)
  File "/usr/local/uvcdat/2.4.1/lib/python2.7/site-packages/metrics/packages/amwg/amwg.py", line 720, in _results
    zdiffval = apply( self.plot_b.zfunc, [zval,z2val] )
  File "/usr/local/uvcdat/2.4.1/lib/python2.7/site-packages/metrics/computation/reductions.py", line 2441, in aminusb_1ax
    mv1, mv2 = reconcile_units( mv1, mv2 )
  File "/usr/local/uvcdat/2.4.1/lib/python2.7/site-packages/metrics/computation/reductions.py", line 2151, in reconcile_units
    mv1,mv2 = flxconv.reconcile_energyflux_precip(mv1, mv2, preferred_units)
  File "/usr/local/uvcdat/2.4.1/lib/python2.7/site-packages/metrics/packages/amwg/derivations/qflx_lhflx_conversions.py", line 52, in reconcile_energyflux_precip
    mv2 = convert_energyflux_precip(mv2, preferred_units)
  File "/usr/local/uvcdat/2.4.1/lib/python2.7/site-packages/metrics/packages/amwg/derivations/qflx_lhflx_conversions.py", line 111, in convert_energyflux_precip
    raise e
TypeError: Error Converting.
painter1 commented 8 years ago

In the file /space1/test_data/obs/ERA40_01_climo.nc, it really is true that the variable LHFLX has units attribute W/m~S~2~N. I can make no sense of this. Probably our software shouldn't make sense of this. It's almost surely wrong.

chaosphere2112 commented 8 years ago

@painter1 I'm working on getting another copy of the ERA40 data and seeing what's up with that.

chaosphere2112 commented 8 years ago

@painter1 Looks like the raw data from ERA40 has the variable labeled as slhf, and the units are J m**-2, which sounds like a much more reasonable unit. I'm guessing something went wrong in the obs rewriting/climatology-ing.