inputs['title'] = 'QTCM spinup part 1 test (aquaplanet)' inputs['bnddir'] = os.path.join(os.getcwd(), 'bnddir', 'r64x42') inputs['SSTdir'] = os.path.join( os.getcwd(), 'bnddir', 'r64x42' \ , 'SST_Reynolds' ) inputs['outdir'] = dirbasepath inputs['runname'] = rundirname inputs['landon'] = 0 inputs['year0'] = 1 inputs['month0'] = 11 inputs['day0'] = 1 inputs['lastday'] = 15 inputs['ntout'] = 1 inputs['ntouti'] = 1 inputs['noout'] = 0 inputs['mrestart'] = 0 inputs['compiled_form'] = 'full' model = Qtcm(**inputs) model.run_session() #model.plotm('Qc',lat=[-40,40], time=4, lon=[0.,]) #model.plotm('Qc',lat=[-40,40], time=4) model.plotm('Qc', lon=[20, 300], time=4, approx_nlev=4, tmppreview=True) #model.plotm('Qc',time=4, tmppreview=True) #model.plotm('Qc',lon=[20,100], time=[0,4]) #@@@should give error #model.plotm('Qc',lat=5.625, lon=[20,100], time=[0,4]) #model.plotm('Qc',lat=[-5.625, 50], lon=247.5, time=[0,4]) if os.path.exists('qtcm_00011115.restart'): os.remove('qtcm_00011115.restart') # ====== end file ======
inputs['year0'] = 1 inputs['month0'] = 11 inputs['day0'] = 1 inputs['lastday'] = 60 inputs['ntout'] = 1 inputs['ntouti'] = 1 inputs['noout'] = 0 inputs['mrestart'] = 0 inputs['compiled_form'] = 'full' model = Qtcm(**inputs) model.run_session() # model.plotm('Qc',lat=[-40,40], time=58, lon=[0.,], # fn=os.path.join(dirbasepath, 'plotm1.png')) model.plotm('FLWut',lat=[-40,40], time=52, fn=os.path.join(dirbasepath, 'plotm2.png')) # model.plotm('Ts',lon=[20,300], time=50, approx_nlev=5, # fn=os.path.join(dirbasepath, 'plotm3.png')) # model.plotm('Qc',time=4, tmppreview=True) # model.plotm('Qc',lon=[20,100], time=[0,4]) #@@@should give error # model.plotm('Qc',lat=5.625, lon=[20,100], time=[0,4]) # model.plotm('Qc',lat=[-20, 50], lon=247.5, time=[30,50], # fn=os.path.join(dirbasepath, 'plotm4.png')) # model.plotm('us', time=52, # fn=os.path.join(dirbasepath, 'plotm5.png')) if os.path.exists('qtcm_00011115.restart'): os.remove('qtcm_00011115.restart') #- Run unittest tests:
inputs['SSTdir'] = os.path.join( os.getcwd(), 'bnddir', 'r64x42' \ , 'SST_Reynolds' ) inputs['outdir'] = dirbasepath inputs['runname'] = rundirname inputs['landon'] = 0 inputs['year0'] = 1 inputs['month0'] = 11 inputs['day0'] = 1 inputs['lastday'] = 15 inputs['ntout'] = 1 inputs['ntouti'] = 1 inputs['noout'] = 0 inputs['mrestart'] = 0 inputs['compiled_form'] = 'full' model = Qtcm(**inputs) model.run_session() #model.plotm('Qc',lat=[-40,40], time=4, lon=[0.,]) #model.plotm('Qc',lat=[-40,40], time=4) model.plotm('Qc',lon=[20,300], time=4, approx_nlev=4, tmppreview=True) #model.plotm('Qc',time=4, tmppreview=True) #model.plotm('Qc',lon=[20,100], time=[0,4]) #@@@should give error #model.plotm('Qc',lat=5.625, lon=[20,100], time=[0,4]) #model.plotm('Qc',lat=[-5.625, 50], lon=247.5, time=[0,4]) if os.path.exists('qtcm_00011115.restart'): os.remove('qtcm_00011115.restart') # ====== end file ======
inputs['day0'] = 1 inputs['lastday'] = 15 inputs['ntout'] = 1 inputs['ntouti'] = 1 inputs['noout'] = 0 inputs['mrestart'] = 0 inputs['compiled_form'] = 'full' model = Qtcm(**inputs) model.run_session() # model.plotm('Qc',lat=[-40,40], time=58, lon=[0.,], # fn=os.path.join(dirbasepath, 'plotm1.png')) model.plotm('FLWut', lat=[-40, 40], time=12, filled=0, fn=os.path.join(dirbasepath, 'plotm2.png')) # model.plotm('Ts',lon=[20,300], time=50, approx_nlev=5, # fn=os.path.join(dirbasepath, 'plotm3.png')) # model.plotm('Qc',time=4, tmppreview=True) # model.plotm('Qc',lon=[20,100], time=[0,4]) #@@@should give error # model.plotm('Qc',lat=5.625, lon=[20,100], time=[0,4]) # model.plotm('Qc',lat=[-20, 50], lon=247.5, time=[30,50], # fn=os.path.join(dirbasepath, 'plotm4.png')) # model.plotm('us', time=52, # fn=os.path.join(dirbasepath, 'plotm5.png')) if os.path.exists('qtcm_00011230.restart'): os.remove('qtcm_00011230.restart')
def _gen_plots(): """Generate plots for manual comparison. This method only works with numpy. """ import numpy as N rundirname = 'plotm_test' dirbasepath = utilities.prepare_outdir(rundirname) inputs = {} inputs['dt'] = 1200. inputs['title'] = 'QTCM spinup part 1 test (aquaplanet)' inputs['bnddir'] = os.path.join(os.getcwd(), 'bnddir', 'r64x42') inputs['SSTdir'] = os.path.join(os.getcwd(), 'bnddir', 'r64x42', 'SST_Reynolds') inputs['outdir'] = dirbasepath inputs['runname'] = rundirname inputs['landon'] = 0 inputs['year0'] = 1 inputs['month0'] = 11 inputs['day0'] = 1 inputs['lastday'] = 60 inputs['ntout'] = 1 inputs['ntouti'] = 1 inputs['noout'] = 0 inputs['mrestart'] = 0 inputs['compiled_form'] = 'full' model = Qtcm(**inputs) model.run_session() model.plotm('Qc', lat=[-40, 40], time=58, lon=[ 0., ], fn=os.path.join(dirbasepath, 'plotm1.png')) model.plotm('FLWut', lat=[-40, 40], time=52, fn=os.path.join(dirbasepath, 'plotm2.png')) model.plotm('Ts', lon=[20, 300], time=50, approx_nlev=15, fn=os.path.join(dirbasepath, 'plotm3.png')) model.plotm('Qc', lat=[-20, 50], lon=247.5, time=[30, 50], fn=os.path.join(dirbasepath, 'plotm4.png')) model.plotm('us', time=52, fn=os.path.join(dirbasepath, 'plotm5.png')) model.plotm('Qc', lat=5.625, lon=[50, 200], time=[20, 50], fn=os.path.join(dirbasepath, 'plotm6.png')) model.plotm('q1', lat=5.625, lon=112.5, time=[20, 50], fn=os.path.join(dirbasepath, 'plotm7.png')) model.plotm('vs', time=50, levels=N.arange(-10, 12, 2), fn=os.path.join(dirbasepath, 'plotm8.png')) model.plotm('Qc', lat=5.625, lon=[50, 200], time=[20, 50], levels=N.arange(-20, 320, 20), fn=os.path.join(dirbasepath, 'plotm9.png')) model.plotm('Qc', lat=[-40, 40], time=58, lon=[ 0., ], filled=1, fn=os.path.join(dirbasepath, 'plotm1a.png')) model.plotm('FLWut', lat=[-40, 40], time=52, filled=1, fn=os.path.join(dirbasepath, 'plotm2a.png')) model.plotm('Ts', lon=[20, 300], time=50, approx_nlev=15, filled=1, fn=os.path.join(dirbasepath, 'plotm3a.png')) model.plotm('Qc', lat=[-20, 50], lon=247.5, time=[30, 50], filled=1, fn=os.path.join(dirbasepath, 'plotm4a.png')) model.plotm('us', time=52, filled=1, fn=os.path.join(dirbasepath, 'plotm5a.png')) model.plotm('Qc', lat=5.625, lon=[50, 200], time=[20, 50], filled=True, fn=os.path.join(dirbasepath, 'plotm6a.png')) model.plotm('vs', time=50, levels=N.arange(-10, 12, 2), filled=True, fn=os.path.join(dirbasepath, 'plotm8a.png')) model.plotm('Qc', lat=5.625, lon=[50, 200], time=[20, 50], levels=N.arange(-20, 320, 20), filled=True, fn=os.path.join(dirbasepath, 'plotm9a.png')) if os.path.exists('qtcm_00011115.restart'): os.remove('qtcm_00011115.restart')