Thursday, August 25, 2011

CDMS inconsistency

Not sure this counts as a bug, but it is a weird inconsistency.


>>> import cdms
>>> s1 = cdms.open("ch.17_Lister_0001_all_02.nc")
>>> s2 = cdms.open("ch.18_Lister_0001_all_02.nc")
>>> s3 = cdms.open("ch.12_Lister_0001_all_02.nc")
>>> s4 = cdms.open("ch.13_Lister_0001_all_02.nc")

>>> d1 = s1['FLNSOI']
>>> d2 = s2['FLNSOI']
>>> d3 = s3['FLNSOI']
>>> d4 = s4['FLNSOI']

>>> dd1 = d1 - d3
>>> dd2 = d2 - d4

>>> d1.getAxis(0).id
'time'
>>> d2.getAxis(0).id
'time'
>>> d3.getAxis(0).id
'time'
>>> d4.getAxis(0).id
'time'


>>> dd1.getAxis(0).id
'time'
>>> dd2.getAxis(0).id
'axis_10'


The second behavior occurs repeatably on three out of 180 file pairs, was hard to track down, and prevented the NCO ncrcat command from working. Fortunately the workaround is easy.


>>> dd2.setAxisList(d2.getAxisList())


But it's baffling how this even happens. All of the _all_NN.nc files were created by the NCO ncra command. Probably it is correct to do this and there is no guarantee that an axis list will be inherited after a calculation. But why does it USUALLY happen? These files are all produced by the same processes!

I'd prefer to have my mind read every time or never, not 59 times out of 60.

This wasted three hours of my life.

Tuesday, January 4, 2011

New Slab Run How-To

Take an extant slab run namelist

edit:
ensure input files from $WORK/caminput
change nsrest
change case_id
set rest_pfile

create the file pointed to by rest_pfile, based on the lnd version; or edit as needed

in qsubscript:
change job name
ensure correct executable

ensure you have the right executable!

If everything is under control the executables should be properly named in CAM31Executables

Ah, python, python, when will I see you again? http://www.pauahtun.org/Misc/4nobletruthsofpython.html

Restart howto

> nrevsn = '/work/00671/tobis/camrun/restart/camrun.bsi.cam2.r.0021-01-01-00000'
> rest_pfile = './cam2.camrun.bsi.rpointer'
12,13c14,15
< nelapse = -14966
< nsrest = 0
---
> nestep = -14966
> nsrest = 1
16a19
> rpntpath = './lnd.camrun.bsi.rpointer'

what's with nrevsn vs rest_pfile? nrevsn seems to be for branch runs.

So what I think should be the case is just the nsrest should change; rest_pfile and rpntpath should botrh be set. As always, the cam2.*.rpointer file must be manually edited to remove the hard-wired NCAR path. The land model does not have this bug.