Commit 4927b213 authored by Kennedy, Joseph H's avatar Kennedy, Joseph H
Browse files

Energy and clouds now work with both CESM and E3SM, smb still CESM only

parent 5837470d
...@@ -9,32 +9,26 @@ from livvkit.util import elements as el ...@@ -9,32 +9,26 @@ from livvkit.util import elements as el
describe = """ describe = """
Climatological annual average of high cloud cover over Greenland Climatological annual average of high cloud cover over Greenland
for CESM (left), ISCCP (middle; Rossow and Schiffer, 1999), and CLOUDSAT (right; for Model (left), ISCCP (middle; Rossow and Schiffer, 1999), and CLOUDSAT (right;
Kay and Gettelman, 2009). The black solid lines denote the 0, 1000, 2000, and Kay and Gettelman, 2009). The black solid lines denote the 0, 1000, 2000, and
3000 meter Greenland ice sheet elevation contours as seen by CESM. 3000 meter Greenland ice sheet elevation contours as seen by the Model.
""" """
title = "High cloud cover over Greenland" title = "High cloud cover over Greenland"
def make_plot(config, out_path='.'): def make_plot(config, out_path='.'):
# ---------------- Data source in TITAN ------------------------
f_cism = os.path.join(config['cism_data'], 'Greenland_5km_v1.1_SacksRev_c110629.nc')
f_model_atm_climo_jja = os.path.join(config['model_atm_climos'], 'b.e10.BG20TRCN.f09_g16.002_JJA_climo.nc')
f_isccp = os.path.join(config['cloud_data'], 'ISCCP_ANN_climo.nc') f_isccp = os.path.join(config['cloud_data'], 'ISCCP_ANN_climo.nc')
f_cloudsat = os.path.join(config['cloud_data'], 'CLOUDSAT_ANN_climo.nc') f_cloudsat = os.path.join(config['cloud_data'], 'CLOUDSAT_ANN_climo.nc')
# --------------------------------------------------------------
img_list = [] img_list = []
# read f_cism, the elevation data cism = Dataset(config['glc_surf'])
cism = Dataset(f_cism)
cism_usrf = cism.variables['usrf'][0, :, :] cism_usrf = cism.variables['usrf'][0, :, :]
cism_lat = cism.variables['lat'][0, :, :] cism_lat = cism.variables['lat'][0, :, :]
cism_lon = cism.variables['lon'][0, :, :] cism_lon = cism.variables['lon'][0, :, :]
# read f_model_atm_climo_jja and file2, CESM variable model = Dataset(config['atm_climo'])
model = Dataset(f_model_atm_climo_jja)
model_cldhgh = model.variables['CLDHGH'][0, :, :] model_cldhgh = model.variables['CLDHGH'][0, :, :]
model_lat = model.variables['lat'][:] model_lat = model.variables['lat'][:]
model_lon = model.variables['lon'][:] model_lon = model.variables['lon'][:]
...@@ -67,7 +61,7 @@ def make_plot(config, out_path='.'): ...@@ -67,7 +61,7 @@ def make_plot(config, out_path='.'):
wkres = Ngl.Resources() wkres = Ngl.Resources()
# wkres.wkOrientation = "portrait" # wkres.wkOrientation = "portrait"
wks_type = "png" wks_type = "png"
wks_img = str(os.path.join(out_path, 'CESM_cldhgh_ANN')) wks_img = str(os.path.join(out_path, 'Model_cldhgh_ANN'))
wks = Ngl.open_wks(wks_type, wks_img, wkres) wks = Ngl.open_wks(wks_type, wks_img, wkres)
...@@ -91,12 +85,11 @@ def make_plot(config, out_path='.'): ...@@ -91,12 +85,11 @@ def make_plot(config, out_path='.'):
mres.mpFillOn = False mres.mpFillOn = False
mres.mpPerimOn = True # add box around map mres.mpPerimOn = True # add box around map
# --- for the CESM contour ------- # --- for the Model contour -------
res1 = Ngl.Resources() res1 = Ngl.Resources()
res1.cnFillPalette = "percent_11lev" res1.cnFillPalette = "percent_11lev"
res1.nglDraw = False # Don't draw individual plots res1.nglDraw = False # Don't draw individual plots
res1.nglFrame = False # Don't advance frame. res1.nglFrame = False # Don't advance frame.
res1.cnLineLabelsOn = False
res1.cnFillOn = True res1.cnFillOn = True
res1.cnLinesOn = False res1.cnLinesOn = False
res1.cnLineLabelsOn = False res1.cnLineLabelsOn = False
...@@ -115,7 +108,6 @@ def make_plot(config, out_path='.'): ...@@ -115,7 +108,6 @@ def make_plot(config, out_path='.'):
res2.cnFillPalette = "percent_11lev" res2.cnFillPalette = "percent_11lev"
res2.nglDraw = False # Don't draw individual plots res2.nglDraw = False # Don't draw individual plots
res2.nglFrame = False # Don't advance frame. res2.nglFrame = False # Don't advance frame.
res2.cnLineLabelsOn = False
res2.cnFillOn = True res2.cnFillOn = True
res2.cnLinesOn = False res2.cnLinesOn = False
res2.cnLineLabelsOn = False res2.cnLineLabelsOn = False
...@@ -135,7 +127,6 @@ def make_plot(config, out_path='.'): ...@@ -135,7 +127,6 @@ def make_plot(config, out_path='.'):
res3.cnFillPalette = "percent_11lev" res3.cnFillPalette = "percent_11lev"
res3.nglDraw = False # Don't draw individual plots res3.nglDraw = False # Don't draw individual plots
res3.nglFrame = False # Don't advance frame. res3.nglFrame = False # Don't advance frame.
res3.cnLineLabelsOn = False
res3.cnFillOn = True res3.cnFillOn = True
res3.cnLinesOn = False res3.cnLinesOn = False
res3.cnLineLabelsOn = False res3.cnLineLabelsOn = False
...@@ -157,6 +148,7 @@ def make_plot(config, out_path='.'): ...@@ -157,6 +148,7 @@ def make_plot(config, out_path='.'):
sres.cnFillOn = False sres.cnFillOn = False
sres.cnLinesOn = True sres.cnLinesOn = True
sres.cnLineLabelsOn = False sres.cnLineLabelsOn = False
sres.trGridType = "TriangularMesh"
sres.cnLevelSelectionMode = "ExplicitLevels" sres.cnLevelSelectionMode = "ExplicitLevels"
sres.cnLevels = [0, 1000, 2000, 3000] sres.cnLevels = [0, 1000, 2000, 3000]
sres.sfXArray = cism_lon sres.sfXArray = cism_lon
...@@ -174,7 +166,7 @@ def make_plot(config, out_path='.'): ...@@ -174,7 +166,7 @@ def make_plot(config, out_path='.'):
# Create multiple figures and draw, which now contains the elevation and temperature # Create multiple figures and draw, which now contains the elevation and temperature
# "[1,3]" indicates 1 row, 3 columns. # "[1,3]" indicates 1 row, 3 columns.
map_title = ["CESM", "ISCCP", "CLOUDSAT"] map_title = ["Model", "ISCCP", "CLOUDSAT"]
nmap = 3 nmap = 3
plot = [] plot = []
......
...@@ -9,37 +9,32 @@ from livvkit.util import elements as el ...@@ -9,37 +9,32 @@ from livvkit.util import elements as el
describe = """ describe = """
Climatological annual average of low cloud cover over Greenland Climatological annual average of low cloud cover over Greenland
for CESM (left), ISCCP (middle; Rossow and Schiffer, 1999), and CLOUDSAT (right; for Model (left), ISCCP (middle; Rossow and Schiffer, 1999), and CLOUDSAT (right;
Kay and Gettelman, 2009). The black solid lines denote the 0, 1000, 2000, and Kay and Gettelman, 2009). The black solid lines denote the 0, 1000, 2000, and
3000 meter Greenland ice sheet elevation contours as seen by CESM. 3000 meter Greenland ice sheet elevation contours as seen by the Model.
""" """
title = "Low cloud cover over Greenland" title = "Low cloud cover over Greenland"
def make_plot(config, out_path='.'): def make_plot(config, out_path='.'):
# ---------------- Data source in TITAN ------------------------
f_cism = os.path.join(config['cism_data'], 'Greenland_5km_v1.1_SacksRev_c110629.nc')
f_cesm_atm_climo_jja = os.path.join(config['model_atm_climos'], 'b.e10.BG20TRCN.f09_g16.002_JJA_climo.nc')
f_isccp = os.path.join(config['cloud_data'], 'ISCCP_ANN_climo.nc') f_isccp = os.path.join(config['cloud_data'], 'ISCCP_ANN_climo.nc')
f_cloudsat = os.path.join(config['cloud_data'], 'CLOUDSAT_ANN_climo.nc') f_cloudsat = os.path.join(config['cloud_data'], 'CLOUDSAT_ANN_climo.nc')
# --------------------------------------------------------------
img_list = [] img_list = []
# read f_cism, the elevation data cism = Dataset(config['glc_surf'])
cism = Dataset(f_cism)
cism_usrf = cism.variables['usrf'][0, :, :] cism_usrf = cism.variables['usrf'][0, :, :]
cism_lat = cism.variables['lat'][0, :, :] cism_lat = cism.variables['lat'][0, :, :]
cism_lon = cism.variables['lon'][0, :, :] cism_lon = cism.variables['lon'][0, :, :]
# read f_cesm_atm_climo_jja, CESM variable # read f_cesm_atm_climo_jja, CESM variable
cesm = Dataset(f_cesm_atm_climo_jja) model = Dataset(config['atm_climo'])
cesm_low = cesm.variables['CLDLOW'][0, :, :] model_low = model.variables['CLDLOW'][0, :, :]
cesm_lat = cesm.variables['lat'][:] model_lat = model.variables['lat'][:]
cesm_lon = cesm.variables['lon'][:] model_lon = model.variables['lon'][:]
cesm_low = cesm_low * 100 # to get percent model_low = model_low * 100 # to get percent
# --- ISCCP data without remapping [64,128] # --- ISCCP data without remapping [64,128]
isccp = Dataset(f_isccp) isccp = Dataset(f_isccp)
...@@ -54,7 +49,7 @@ def make_plot(config, out_path='.'): ...@@ -54,7 +49,7 @@ def make_plot(config, out_path='.'):
cloudsat_lon = cloudsat.variables['lon'][:] cloudsat_lon = cloudsat.variables['lon'][:]
# print("contour plot of CLDLOW vs obs") # print("contour plot of CLDLOW vs obs")
# maxmodel = np.max(cesm_low) # maxmodel = np.max(model_low)
# maxisccp = np.max(isccp_low) # maxisccp = np.max(isccp_low)
# maxcldsat = np.max(cloudsat_low) # maxcldsat = np.max(cloudsat_low)
# print("Max CLDLOW model: {}".format(maxmodel)) # print("Max CLDLOW model: {}".format(maxmodel))
...@@ -67,7 +62,7 @@ def make_plot(config, out_path='.'): ...@@ -67,7 +62,7 @@ def make_plot(config, out_path='.'):
wkres = Ngl.Resources() wkres = Ngl.Resources()
# wkres.wkOrientation = "portrait" # "portrait" or "landscape" # wkres.wkOrientation = "portrait" # "portrait" or "landscape"
wks_type = "png" wks_type = "png"
wks_img = str(os.path.join(out_path, "CESM_cldlow_ANN")) wks_img = str(os.path.join(out_path, "Model_cldlow_ANN"))
wks = Ngl.open_wks(wks_type, wks_img, wkres) wks = Ngl.open_wks(wks_type, wks_img, wkres)
# --- for the map ------- # --- for the map -------
...@@ -90,12 +85,11 @@ def make_plot(config, out_path='.'): ...@@ -90,12 +85,11 @@ def make_plot(config, out_path='.'):
mres.mpFillOn = False mres.mpFillOn = False
mres.mpPerimOn = True # add box around map mres.mpPerimOn = True # add box around map
# --- for the CESM contour ------- # --- for the Model contour -------
res1 = Ngl.Resources() res1 = Ngl.Resources()
res1.cnFillPalette = "percent_11lev" res1.cnFillPalette = "percent_11lev"
res1.nglDraw = False # Don't draw individual plots res1.nglDraw = False # Don't draw individual plots
res1.nglFrame = False # Don't advance frame. res1.nglFrame = False # Don't advance frame.
res1.cnLineLabelsOn = False
res1.cnFillOn = True res1.cnFillOn = True
res1.cnLinesOn = False res1.cnLinesOn = False
res1.cnLineLabelsOn = False res1.cnLineLabelsOn = False
...@@ -106,15 +100,14 @@ def make_plot(config, out_path='.'): ...@@ -106,15 +100,14 @@ def make_plot(config, out_path='.'):
res1.lbLabelBarOn = True # Turn on labelbar. res1.lbLabelBarOn = True # Turn on labelbar.
res1.lbLabelFontHeightF = 0.04 res1.lbLabelFontHeightF = 0.04
res1.sfXArray = cesm_lon res1.sfXArray = model_lon
res1.sfYArray = cesm_lat res1.sfYArray = model_lat
# --- for the data contour ------- # --- for the data contour -------
res2 = Ngl.Resources() res2 = Ngl.Resources()
res2.cnFillPalette = "percent_11lev" res2.cnFillPalette = "percent_11lev"
res2.nglDraw = False # Don't draw individual plots res2.nglDraw = False # Don't draw individual plots
res2.nglFrame = False # Don't advance frame. res2.nglFrame = False # Don't advance frame.
res2.cnLineLabelsOn = False
res2.cnFillOn = True res2.cnFillOn = True
res2.cnLinesOn = False res2.cnLinesOn = False
res2.cnLineLabelsOn = False res2.cnLineLabelsOn = False
...@@ -134,7 +127,6 @@ def make_plot(config, out_path='.'): ...@@ -134,7 +127,6 @@ def make_plot(config, out_path='.'):
res3.cnFillPalette = "percent_11lev" res3.cnFillPalette = "percent_11lev"
res3.nglDraw = False # Don't draw individual plots res3.nglDraw = False # Don't draw individual plots
res3.nglFrame = False # Don't advance frame. res3.nglFrame = False # Don't advance frame.
res3.cnLineLabelsOn = False
res3.cnFillOn = True res3.cnFillOn = True
res3.cnLinesOn = False res3.cnLinesOn = False
res3.cnLineLabelsOn = False res3.cnLineLabelsOn = False
...@@ -156,6 +148,7 @@ def make_plot(config, out_path='.'): ...@@ -156,6 +148,7 @@ def make_plot(config, out_path='.'):
sres.cnFillOn = False sres.cnFillOn = False
sres.cnLinesOn = True sres.cnLinesOn = True
sres.cnLineLabelsOn = False sres.cnLineLabelsOn = False
sres.trGridType = "TriangularMesh"
sres.cnLevelSelectionMode = "ExplicitLevels" sres.cnLevelSelectionMode = "ExplicitLevels"
sres.cnLevels = [0, 1000, 2000, 3000] sres.cnLevels = [0, 1000, 2000, 3000]
sres.sfXArray = cism_lon sres.sfXArray = cism_lon
...@@ -167,13 +160,13 @@ def make_plot(config, out_path='.'): ...@@ -167,13 +160,13 @@ def make_plot(config, out_path='.'):
usrf_plot2 = Ngl.contour(wks, cism_usrf, sres) usrf_plot2 = Ngl.contour(wks, cism_usrf, sres)
usrf_plot3 = Ngl.contour(wks, cism_usrf, sres) usrf_plot3 = Ngl.contour(wks, cism_usrf, sres)
cesm_plot = Ngl.contour(wks, cesm_low, res1) model_plot = Ngl.contour(wks, model_low, res1)
isccp_plot = Ngl.contour(wks, isccp_low, res2) isccp_plot = Ngl.contour(wks, isccp_low, res2)
cldsat_plot = Ngl.contour(wks, cloudsat_low, res3) cldsat_plot = Ngl.contour(wks, cloudsat_low, res3)
# Creat multiple figures and draw, which now contains the elevation and temperature # Creat multiple figures and draw, which now contains the elevation and temperature
# "[1,3]" indicates 1 row, 3 columns. # "[1,3]" indicates 1 row, 3 columns.
map_title = ["CESM", "ISCCP", "CLOUDSAT"] map_title = ["Model", "ISCCP", "CLOUDSAT"]
nmap = 3 nmap = 3
plot = [] plot = []
...@@ -182,7 +175,7 @@ def make_plot(config, out_path='.'): ...@@ -182,7 +175,7 @@ def make_plot(config, out_path='.'):
plot.append(Ngl.map(wks, mres)) plot.append(Ngl.map(wks, mres))
# Overlay everything on the map plot. # Overlay everything on the map plot.
Ngl.overlay(plot[0], cesm_plot) Ngl.overlay(plot[0], model_plot)
Ngl.overlay(plot[0], usrf_plot1) Ngl.overlay(plot[0], usrf_plot1)
Ngl.overlay(plot[1], isccp_plot) Ngl.overlay(plot[1], isccp_plot)
Ngl.overlay(plot[1], usrf_plot2) Ngl.overlay(plot[1], usrf_plot2)
......
...@@ -9,37 +9,32 @@ from livvkit.util import elements as el ...@@ -9,37 +9,32 @@ from livvkit.util import elements as el
describe = """ describe = """
Climatological annual average of cloud cover over Greenland Climatological annual average of cloud cover over Greenland
for CESM (left), ISCCP (middle; Rossow and Schiffer, 1999), and CLOUDSAT (right; for Model (left), ISCCP (middle; Rossow and Schiffer, 1999), and CLOUDSAT (right;
Kay and Gettelman, 2009). The black solid lines denote the 0, 1000, 2000, and Kay and Gettelman, 2009). The black solid lines denote the 0, 1000, 2000, and
3000 meter Greenland ice sheet elevation contours as seen by CESM. 3000 meter Greenland ice sheet elevation contours as seen by the Model.
""" """
title = "Cloud cover over Greenland" title = "Cloud cover over Greenland"
def make_plot(config, out_path='.'): def make_plot(config, out_path='.'):
# ---------------- Data source in TITAN ------------------------
f_cism = os.path.join(config['cism_data'], 'Greenland_5km_v1.1_SacksRev_c110629.nc')
f_cesm_atm_climo_jja = os.path.join(config['model_atm_climos'], 'b.e10.BG20TRCN.f09_g16.002_JJA_climo.nc')
f_isccp = os.path.join(config['cloud_data'], 'ISCCP_ANN_climo.nc') f_isccp = os.path.join(config['cloud_data'], 'ISCCP_ANN_climo.nc')
f_cloudsat = os.path.join(config['cloud_data'], 'CLOUDSAT_ANN_climo.nc') f_cloudsat = os.path.join(config['cloud_data'], 'CLOUDSAT_ANN_climo.nc')
# --------------------------------------------------------------
img_list = [] img_list = []
# read f_cism, the elevation data cism = Dataset(config['glc_surf'])
cism = Dataset(f_cism)
cism_usrf = cism.variables['usrf'][0, :, :] cism_usrf = cism.variables['usrf'][0, :, :]
cism_lat = cism.variables['lat'][0, :, :] cism_lat = cism.variables['lat'][0, :, :]
cism_lon = cism.variables['lon'][0, :, :] cism_lon = cism.variables['lon'][0, :, :]
# read f_cesm_atm_climo_jja and file2, CESM variable # read f_cesm_atm_climo_jja and file2, CESM variable
cesm = Dataset(f_cesm_atm_climo_jja) model = Dataset(config['atm_climo'])
cesm_tot = cesm.variables['CLDTOT'][0, :, :] model_tot = model.variables['CLDTOT'][0, :, :]
cesm_lat = cesm.variables['lat'][:] model_lat = model.variables['lat'][:]
cesm_lon = cesm.variables['lon'][:] model_lon = model.variables['lon'][:]
cesm_tot = cesm_tot * 100 # to get percent model_tot = model_tot * 100 # to get percent
# --- ISCCP data without remapping [64,128] # --- ISCCP data without remapping [64,128]
isccp = Dataset(f_isccp) isccp = Dataset(f_isccp)
...@@ -54,7 +49,7 @@ def make_plot(config, out_path='.'): ...@@ -54,7 +49,7 @@ def make_plot(config, out_path='.'):
cloudsat_lon = cloudsat.variables['lon'][:] cloudsat_lon = cloudsat.variables['lon'][:]
# print("contour plot of CLDTOT vs obs") # print("contour plot of CLDTOT vs obs")
# maxmodel = np.max(cesm_tot) # maxmodel = np.max(model_tot)
# maxisccp = np.max(isccp_tot) # maxisccp = np.max(isccp_tot)
# maxcldsat = np.max(cloudsat_tot) # maxcldsat = np.max(cloudsat_tot)
# print("Max CLDTOT model: {}".format(maxmodel)) # print("Max CLDTOT model: {}".format(maxmodel))
...@@ -67,7 +62,7 @@ def make_plot(config, out_path='.'): ...@@ -67,7 +62,7 @@ def make_plot(config, out_path='.'):
wkres = Ngl.Resources() wkres = Ngl.Resources()
# wkres.wkOrientation = "portrait" # "portrait" or "landscape" # wkres.wkOrientation = "portrait" # "portrait" or "landscape"
wks_type = "png" wks_type = "png"
wks_img = str(os.path.join(out_path, "CESM_cldtot_ANN")) wks_img = str(os.path.join(out_path, "Model_cldtot_ANN"))
wks = Ngl.open_wks(wks_type, wks_img, wkres) wks = Ngl.open_wks(wks_type, wks_img, wkres)
# --- for the map ------- # --- for the map -------
...@@ -90,12 +85,11 @@ def make_plot(config, out_path='.'): ...@@ -90,12 +85,11 @@ def make_plot(config, out_path='.'):
mres.mpFillOn = False mres.mpFillOn = False
mres.mpPerimOn = True # add box around map mres.mpPerimOn = True # add box around map
# --- for the CESM contour ------- # --- for the Model contour -------
res1 = Ngl.Resources() res1 = Ngl.Resources()
res1.cnFillPalette = "percent_11lev" res1.cnFillPalette = "percent_11lev"
res1.nglDraw = False # Don't draw individual plots res1.nglDraw = False # Don't draw individual plots
res1.nglFrame = False # Don't advance frame. res1.nglFrame = False # Don't advance frame.
res1.cnLineLabelsOn = False
res1.cnFillOn = True res1.cnFillOn = True
res1.cnLinesOn = False res1.cnLinesOn = False
res1.cnLineLabelsOn = False res1.cnLineLabelsOn = False
...@@ -106,15 +100,14 @@ def make_plot(config, out_path='.'): ...@@ -106,15 +100,14 @@ def make_plot(config, out_path='.'):
res1.lbLabelBarOn = True # Turn on labelbar. res1.lbLabelBarOn = True # Turn on labelbar.
res1.lbLabelFontHeightF = 0.04 res1.lbLabelFontHeightF = 0.04
res1.sfXArray = cesm_lon res1.sfXArray = model_lon
res1.sfYArray = cesm_lat res1.sfYArray = model_lat
# --- for the data contour ------- # --- for the data contour -------
res2 = Ngl.Resources() res2 = Ngl.Resources()
res2.cnFillPalette = "percent_11lev" res2.cnFillPalette = "percent_11lev"
res2.nglDraw = False # Don't draw individual plots res2.nglDraw = False # Don't draw individual plots
res2.nglFrame = False # Don't advance frame. res2.nglFrame = False # Don't advance frame.
res2.cnLineLabelsOn = False
res2.cnFillOn = True res2.cnFillOn = True
res2.cnLinesOn = False res2.cnLinesOn = False
res2.cnLineLabelsOn = False res2.cnLineLabelsOn = False
...@@ -134,7 +127,6 @@ def make_plot(config, out_path='.'): ...@@ -134,7 +127,6 @@ def make_plot(config, out_path='.'):
res3.cnFillPalette = "percent_11lev" res3.cnFillPalette = "percent_11lev"
res3.nglDraw = False # Don't draw individual plots res3.nglDraw = False # Don't draw individual plots
res3.nglFrame = False # Don't advance frame. res3.nglFrame = False # Don't advance frame.
res3.cnLineLabelsOn = False
res3.cnFillOn = True res3.cnFillOn = True
res3.cnLinesOn = False res3.cnLinesOn = False
res3.cnLineLabelsOn = False res3.cnLineLabelsOn = False
...@@ -156,6 +148,7 @@ def make_plot(config, out_path='.'): ...@@ -156,6 +148,7 @@ def make_plot(config, out_path='.'):
sres.cnFillOn = False sres.cnFillOn = False
sres.cnLinesOn = True sres.cnLinesOn = True
sres.cnLineLabelsOn = False sres.cnLineLabelsOn = False
sres.trGridType = "TriangularMesh"
sres.cnLevelSelectionMode = "ExplicitLevels" sres.cnLevelSelectionMode = "ExplicitLevels"
sres.cnLevels = [0, 1000, 2000, 3000] sres.cnLevels = [0, 1000, 2000, 3000]
sres.sfXArray = cism_lon sres.sfXArray = cism_lon
...@@ -167,13 +160,13 @@ def make_plot(config, out_path='.'): ...@@ -167,13 +160,13 @@ def make_plot(config, out_path='.'):
usrf_plot2 = Ngl.contour(wks, cism_usrf, sres) usrf_plot2 = Ngl.contour(wks, cism_usrf, sres)
usrf_plot3 = Ngl.contour(wks, cism_usrf, sres) usrf_plot3 = Ngl.contour(wks, cism_usrf, sres)
cesm_plot = Ngl.contour(wks, cesm_tot, res1) model_plot = Ngl.contour(wks, model_tot, res1)
isccp_plot = Ngl.contour(wks, isccp_tot, res2) isccp_plot = Ngl.contour(wks, isccp_tot, res2)
cldsat_plot = Ngl.contour(wks, cloudsat_tot, res3) cldsat_plot = Ngl.contour(wks, cloudsat_tot, res3)
# Creat multiple figures and draw, which now contains the elevation and temperature # Creat multiple figures and draw, which now contains the elevation and temperature
# "[1,3]" indicates 1 row, 3 columns. # "[1,3]" indicates 1 row, 3 columns.
map_title = ["CESM", "ISCCP", "CLOUDSAT"] map_title = ["Model", "ISCCP", "CLOUDSAT"]
nmap = 3 nmap = 3
plot = [] plot = []
...@@ -182,7 +175,7 @@ def make_plot(config, out_path='.'): ...@@ -182,7 +175,7 @@ def make_plot(config, out_path='.'):
plot.append(Ngl.map(wks, mres)) plot.append(Ngl.map(wks, mres))
# Overlay everything on the map plot. # Overlay everything on the map plot.
Ngl.overlay(plot[0], cesm_plot) Ngl.overlay(plot[0], model_plot)
Ngl.overlay(plot[0], usrf_plot1) Ngl.overlay(plot[0], usrf_plot1)
Ngl.overlay(plot[1], isccp_plot) Ngl.overlay(plot[1], isccp_plot)
Ngl.overlay(plot[1], usrf_plot2) Ngl.overlay(plot[1], usrf_plot2)
......
...@@ -9,7 +9,7 @@ from livvkit.util import elements as el ...@@ -9,7 +9,7 @@ from livvkit.util import elements as el
describe = """ describe = """
Climatological monthly average of total high cloud cover over Greenland Climatological monthly average of total high cloud cover over Greenland
for CESM (red), ISCCP (green; Rossow and Schiffer, 1999), and CLOUDSAT (cyan; for Model (red), ISCCP (green; Rossow and Schiffer, 1999), and CLOUDSAT (cyan;
Kay and Gettelman, 2009). Kay and Gettelman, 2009).
""" """
...@@ -27,10 +27,7 @@ def make_plot(config, out_path='.'): ...@@ -27,10 +27,7 @@ def make_plot(config, out_path='.'):
isccp_vals = [] isccp_vals = []
for month in months: for month in months:
# CESM1 ncid1 = Dataset(config['atm_glob'].replace('??', '{:02d}'.format(month)), mode='r')
f_cesm = os.path.join(config['model_atm_climos'],
"b.e10.BG20TRCN.f09_g16.002_{:02d}_aavg_climo.nc".format(month))
ncid1 = Dataset(f_cesm, mode='r')
model_cld = ncid1.variables['CLDHGH'][0] model_cld = ncid1.variables['CLDHGH'][0]
# CLDSAT # CLDSAT
...@@ -55,7 +52,7 @@ def make_plot(config, out_path='.'): ...@@ -55,7 +52,7 @@ def make_plot(config, out_path='.'):
percent = percent * 100 percent = percent * 100
percent_vals.append(percent) percent_vals.append(percent)
# plot months of the year versus CLDHGH for CESM and CLOUDSAT # plot months of the year versus CLDHGH for Model and CLOUDSAT
plt.plot(months, percent_vals, 'r') plt.plot(months, percent_vals, 'r')
plt.plot(months, cldsat_vals, 'g--') plt.plot(months, cldsat_vals, 'g--')
...@@ -64,7 +61,7 @@ def make_plot(config, out_path='.'): ...@@ -64,7 +61,7 @@ def make_plot(config, out_path='.'):
plt.ylabel('Percent total cloud') plt.ylabel('Percent total cloud')
plt.tight_layout() plt.tight_layout()
img_path = os.path.join(out_path, 'CESM_yearly_cycle_CLDHGH.png') img_path = os.path.join(out_path, 'Model_yearly_cycle_CLDHGH.png')
plt.savefig(img_path) plt.savefig(img_path)
plt.close() plt.close()
......
...@@ -9,7 +9,7 @@ from livvkit.util import elements as el ...@@ -9,7 +9,7 @@ from livvkit.util import elements as el