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
describe = """
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
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"
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_cloudsat = os.path.join(config['cloud_data'], 'CLOUDSAT_ANN_climo.nc')
# --------------------------------------------------------------
img_list = []
# read f_cism, the elevation data
cism = Dataset(f_cism)
cism = Dataset(config['glc_surf'])
cism_usrf = cism.variables['usrf'][0, :, :]
cism_lat = cism.variables['lat'][0, :, :]
cism_lon = cism.variables['lon'][0, :, :]
# read f_model_atm_climo_jja and file2, CESM variable
model = Dataset(f_model_atm_climo_jja)
model = Dataset(config['atm_climo'])
model_cldhgh = model.variables['CLDHGH'][0, :, :]
model_lat = model.variables['lat'][:]
model_lon = model.variables['lon'][:]
......@@ -67,7 +61,7 @@ def make_plot(config, out_path='.'):
wkres = Ngl.Resources()
# wkres.wkOrientation = "portrait"
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)
......@@ -91,12 +85,11 @@ def make_plot(config, out_path='.'):
mres.mpFillOn = False
mres.mpPerimOn = True # add box around map
# --- for the CESM contour -------
# --- for the Model contour -------
res1 = Ngl.Resources()
res1.cnFillPalette = "percent_11lev"
res1.nglDraw = False # Don't draw individual plots
res1.nglFrame = False # Don't advance frame.
res1.cnLineLabelsOn = False
res1.cnFillOn = True
res1.cnLinesOn = False
res1.cnLineLabelsOn = False
......@@ -115,7 +108,6 @@ def make_plot(config, out_path='.'):
res2.cnFillPalette = "percent_11lev"
res2.nglDraw = False # Don't draw individual plots
res2.nglFrame = False # Don't advance frame.
res2.cnLineLabelsOn = False
res2.cnFillOn = True
res2.cnLinesOn = False
res2.cnLineLabelsOn = False
......@@ -135,7 +127,6 @@ def make_plot(config, out_path='.'):
res3.cnFillPalette = "percent_11lev"
res3.nglDraw = False # Don't draw individual plots
res3.nglFrame = False # Don't advance frame.
res3.cnLineLabelsOn = False
res3.cnFillOn = True
res3.cnLinesOn = False
res3.cnLineLabelsOn = False
......@@ -157,6 +148,7 @@ def make_plot(config, out_path='.'):
sres.cnFillOn = False
sres.cnLinesOn = True
sres.cnLineLabelsOn = False
sres.trGridType = "TriangularMesh"
sres.cnLevelSelectionMode = "ExplicitLevels"
sres.cnLevels = [0, 1000, 2000, 3000]
sres.sfXArray = cism_lon
......@@ -174,7 +166,7 @@ def make_plot(config, out_path='.'):
# Create multiple figures and draw, which now contains the elevation and temperature
# "[1,3]" indicates 1 row, 3 columns.
map_title = ["CESM", "ISCCP", "CLOUDSAT"]
map_title = ["Model", "ISCCP", "CLOUDSAT"]
nmap = 3
plot = []
......
......@@ -9,37 +9,32 @@ from livvkit.util import elements as el
describe = """
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
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"
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_cloudsat = os.path.join(config['cloud_data'], 'CLOUDSAT_ANN_climo.nc')
# --------------------------------------------------------------
img_list = []
# read f_cism, the elevation data
cism = Dataset(f_cism)
cism = Dataset(config['glc_surf'])
cism_usrf = cism.variables['usrf'][0, :, :]
cism_lat = cism.variables['lat'][0, :, :]
cism_lon = cism.variables['lon'][0, :, :]
# read f_cesm_atm_climo_jja, CESM variable
cesm = Dataset(f_cesm_atm_climo_jja)
cesm_low = cesm.variables['CLDLOW'][0, :, :]
cesm_lat = cesm.variables['lat'][:]
cesm_lon = cesm.variables['lon'][:]
model = Dataset(config['atm_climo'])
model_low = model.variables['CLDLOW'][0, :, :]
model_lat = model.variables['lat'][:]
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 = Dataset(f_isccp)
......@@ -54,7 +49,7 @@ def make_plot(config, out_path='.'):
cloudsat_lon = cloudsat.variables['lon'][:]
# print("contour plot of CLDLOW vs obs")
# maxmodel = np.max(cesm_low)
# maxmodel = np.max(model_low)
# maxisccp = np.max(isccp_low)
# maxcldsat = np.max(cloudsat_low)
# print("Max CLDLOW model: {}".format(maxmodel))
......@@ -67,7 +62,7 @@ def make_plot(config, out_path='.'):
wkres = Ngl.Resources()
# wkres.wkOrientation = "portrait" # "portrait" or "landscape"
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)
# --- for the map -------
......@@ -90,12 +85,11 @@ def make_plot(config, out_path='.'):
mres.mpFillOn = False
mres.mpPerimOn = True # add box around map
# --- for the CESM contour -------
# --- for the Model contour -------
res1 = Ngl.Resources()
res1.cnFillPalette = "percent_11lev"
res1.nglDraw = False # Don't draw individual plots
res1.nglFrame = False # Don't advance frame.
res1.cnLineLabelsOn = False
res1.cnFillOn = True
res1.cnLinesOn = False
res1.cnLineLabelsOn = False
......@@ -106,15 +100,14 @@ def make_plot(config, out_path='.'):
res1.lbLabelBarOn = True # Turn on labelbar.
res1.lbLabelFontHeightF = 0.04
res1.sfXArray = cesm_lon
res1.sfYArray = cesm_lat
res1.sfXArray = model_lon
res1.sfYArray = model_lat
# --- for the data contour -------
res2 = Ngl.Resources()
res2.cnFillPalette = "percent_11lev"
res2.nglDraw = False # Don't draw individual plots
res2.nglFrame = False # Don't advance frame.
res2.cnLineLabelsOn = False
res2.cnFillOn = True
res2.cnLinesOn = False
res2.cnLineLabelsOn = False
......@@ -134,7 +127,6 @@ def make_plot(config, out_path='.'):
res3.cnFillPalette = "percent_11lev"
res3.nglDraw = False # Don't draw individual plots
res3.nglFrame = False # Don't advance frame.
res3.cnLineLabelsOn = False
res3.cnFillOn = True
res3.cnLinesOn = False
res3.cnLineLabelsOn = False
......@@ -156,6 +148,7 @@ def make_plot(config, out_path='.'):
sres.cnFillOn = False
sres.cnLinesOn = True
sres.cnLineLabelsOn = False
sres.trGridType = "TriangularMesh"
sres.cnLevelSelectionMode = "ExplicitLevels"
sres.cnLevels = [0, 1000, 2000, 3000]
sres.sfXArray = cism_lon
......@@ -167,13 +160,13 @@ def make_plot(config, out_path='.'):
usrf_plot2 = 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)
cldsat_plot = Ngl.contour(wks, cloudsat_low, res3)
# Creat multiple figures and draw, which now contains the elevation and temperature
# "[1,3]" indicates 1 row, 3 columns.
map_title = ["CESM", "ISCCP", "CLOUDSAT"]
map_title = ["Model", "ISCCP", "CLOUDSAT"]
nmap = 3
plot = []
......@@ -182,7 +175,7 @@ def make_plot(config, out_path='.'):
plot.append(Ngl.map(wks, mres))
# 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[1], isccp_plot)
Ngl.overlay(plot[1], usrf_plot2)
......
......@@ -9,37 +9,32 @@ from livvkit.util import elements as el
describe = """
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
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"
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_cloudsat = os.path.join(config['cloud_data'], 'CLOUDSAT_ANN_climo.nc')
# --------------------------------------------------------------
img_list = []
# read f_cism, the elevation data
cism = Dataset(f_cism)
cism = Dataset(config['glc_surf'])
cism_usrf = cism.variables['usrf'][0, :, :]
cism_lat = cism.variables['lat'][0, :, :]
cism_lon = cism.variables['lon'][0, :, :]
# read f_cesm_atm_climo_jja and file2, CESM variable
cesm = Dataset(f_cesm_atm_climo_jja)
cesm_tot = cesm.variables['CLDTOT'][0, :, :]
cesm_lat = cesm.variables['lat'][:]
cesm_lon = cesm.variables['lon'][:]
model = Dataset(config['atm_climo'])
model_tot = model.variables['CLDTOT'][0, :, :]
model_lat = model.variables['lat'][:]
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 = Dataset(f_isccp)
......@@ -54,7 +49,7 @@ def make_plot(config, out_path='.'):
cloudsat_lon = cloudsat.variables['lon'][:]
# print("contour plot of CLDTOT vs obs")
# maxmodel = np.max(cesm_tot)
# maxmodel = np.max(model_tot)
# maxisccp = np.max(isccp_tot)
# maxcldsat = np.max(cloudsat_tot)
# print("Max CLDTOT model: {}".format(maxmodel))
......@@ -67,7 +62,7 @@ def make_plot(config, out_path='.'):
wkres = Ngl.Resources()
# wkres.wkOrientation = "portrait" # "portrait" or "landscape"
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)
# --- for the map -------
......@@ -90,12 +85,11 @@ def make_plot(config, out_path='.'):
mres.mpFillOn = False
mres.mpPerimOn = True # add box around map
# --- for the CESM contour -------
# --- for the Model contour -------
res1 = Ngl.Resources()
res1.cnFillPalette = "percent_11lev"
res1.nglDraw = False # Don't draw individual plots
res1.nglFrame = False # Don't advance frame.
res1.cnLineLabelsOn = False
res1.cnFillOn = True
res1.cnLinesOn = False
res1.cnLineLabelsOn = False
......@@ -106,15 +100,14 @@ def make_plot(config, out_path='.'):
res1.lbLabelBarOn = True # Turn on labelbar.
res1.lbLabelFontHeightF = 0.04
res1.sfXArray = cesm_lon
res1.sfYArray = cesm_lat
res1.sfXArray = model_lon
res1.sfYArray = model_lat
# --- for the data contour -------
res2 = Ngl.Resources()
res2.cnFillPalette = "percent_11lev"
res2.nglDraw = False # Don't draw individual plots
res2.nglFrame = False # Don't advance frame.
res2.cnLineLabelsOn = False
res2.cnFillOn = True
res2.cnLinesOn = False
res2.cnLineLabelsOn = False
......@@ -134,7 +127,6 @@ def make_plot(config, out_path='.'):
res3.cnFillPalette = "percent_11lev"
res3.nglDraw = False # Don't draw individual plots
res3.nglFrame = False # Don't advance frame.
res3.cnLineLabelsOn = False
res3.cnFillOn = True
res3.cnLinesOn = False
res3.cnLineLabelsOn = False
......@@ -156,6 +148,7 @@ def make_plot(config, out_path='.'):
sres.cnFillOn = False
sres.cnLinesOn = True
sres.cnLineLabelsOn = False
sres.trGridType = "TriangularMesh"
sres.cnLevelSelectionMode = "ExplicitLevels"
sres.cnLevels = [0, 1000, 2000, 3000]
sres.sfXArray = cism_lon
......@@ -167,13 +160,13 @@ def make_plot(config, out_path='.'):
usrf_plot2 = 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)
cldsat_plot = Ngl.contour(wks, cloudsat_tot, res3)
# Creat multiple figures and draw, which now contains the elevation and temperature
# "[1,3]" indicates 1 row, 3 columns.
map_title = ["CESM", "ISCCP", "CLOUDSAT"]
map_title = ["Model", "ISCCP", "CLOUDSAT"]
nmap = 3
plot = []
......@@ -182,7 +175,7 @@ def make_plot(config, out_path='.'):
plot.append(Ngl.map(wks, mres))
# 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[1], isccp_plot)
Ngl.overlay(plot[1], usrf_plot2)
......
......@@ -9,7 +9,7 @@ from livvkit.util import elements as el
describe = """
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).
"""
......@@ -27,10 +27,7 @@ def make_plot(config, out_path='.'):
isccp_vals = []
for month in months:
# CESM1
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')
ncid1 = Dataset(config['atm_glob'].replace('??', '{:02d}'.format(month)), mode='r')
model_cld = ncid1.variables['CLDHGH'][0]
# CLDSAT
......@@ -55,7 +52,7 @@ def make_plot(config, out_path='.'):
percent = percent * 100
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, cldsat_vals, 'g--')
......@@ -64,7 +61,7 @@ def make_plot(config, out_path='.'):
plt.ylabel('Percent total cloud')
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.close()
......
......@@ -9,7 +9,7 @@ from livvkit.util import elements as el
describe = """
Climatological monthly average of total low 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).
"""
......@@ -27,11 +27,7 @@ def make_plot(config, out_path='.'):
isccp_vals = []
for month in months:
# ---------------- Data source at OLCF ------------------------
# CESM1
input_file1 = os.path.join(config['model_atm_climos'],
"b.e10.BG20TRCN.f09_g16.002_{:02d}_aavg_climo.nc".format(month))
ncid1 = Dataset(input_file1, mode='r')
ncid1 = Dataset(config['atm_glob'].replace('??', '{:02d}'.format(month)), mode='r')
model_cld = ncid1.variables['CLDLOW'][0]
# CLDSAT
......@@ -56,7 +52,7 @@ def make_plot(config, out_path='.'):
percent = percent * 100
percent_vals.append(percent)
# plot months of the year versus CLDLOW for CESM and CLOUDSAT
# plot months of the year versus CLDLOW for Model and CLOUDSAT
plt.plot(months, percent_vals, 'r')
plt.plot(months, cldsat_vals, 'g--')
......@@ -65,7 +61,7 @@ def make_plot(config, out_path='.'):
plt.ylabel('Percent total cloud')
plt.tight_layout()
img_path = os.path.join(out_path, 'CESM_yearly_cycle_CLDLOW.png')
img_path = os.path.join(out_path, 'Model_yearly_cycle_CLDLOW.png')
plt.savefig(img_path)
plt.close()
......
......@@ -9,7 +9,7 @@ from livvkit.util import elements as el
describe = """
Climatological monthly average of total 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).
"""
......@@ -27,11 +27,7 @@ def make_plot(config, out_path='.'):
isccp_vals = []
for month in months:
# ---------------- Data source at OLCF ------------------------
# CESM1
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')
ncid1 = Dataset(config['atm_glob'].replace('??', '{:02d}'.format(month)), mode='r')
model_cld = ncid1.variables['CLDTOT'][0]
# CLDSAT
......@@ -56,7 +52,7 @@ def make_plot(config, out_path='.'):
percent = percent * 100
percent_vals.append(percent)
# plot months of the year versus CLDTOT for CESM and CLOUDSAT
# plot months of the year versus CLDTOT for Model and CLOUDSAT
plt.plot(months, percent_vals, 'r')
plt.plot(months, cldsat_vals, 'g--')
......@@ -65,7 +61,7 @@ def make_plot(config, out_path='.'):
plt.ylabel('Percent total cloud')
plt.tight_layout()
img_path = os.path.join(out_path, 'CESM_yearly_cycle_CLDTOT.png')
img_path = os.path.join(out_path, 'Model_yearly_cycle_CLDTOT.png')
plt.savefig(img_path)
plt.close()
......
......@@ -2,8 +2,9 @@
"clouds_cesm" : {
"module" : "clouds/clouds_cesm.py",
"references" : "clouds/clouds_model.bib",
"model_atm_climos": "data/cesm/atm",
"cism_data": "data/cism/glissade",
"atm_glob": "data/cesm/atm/b.e10.BG20TRCN.f09_g16.002_??_aavg_climo.nc",
"atm_climo": "data/cesm/atm/b.e10.BG20TRCN.f09_g16.002_JJA_climo.nc",
"glc_surf": "data/cism/glissade/Greenland_5km_v1.1_SacksRev_c110629.nc",
"cloud_data": "data/clouds",
"image_height" : 300
}
......
......@@ -2,8 +2,9 @@
"clouds_e3sm" : {
"module" : "clouds/clouds_e3sm.py",
"references" : "clouds/clouds_model.bib",
"model_atm_climos": "data/e3sm/atm",
"cism_data": "data/cism/glissade",
"atm_glob": "data/e3sm/atm/20180612.B_case.T62_oEC60to30v3wLI.modified_runoff_mapping.edison_??_aavg_climo.nc",
"atm_climo": "data/e3sm/atm/20180612.B_case.T62_oEC60to30v3wLI.modified_runoff_mapping.edison_JJA_climo.nc",
"glc_surf": "data/cism/glissade/Greenland_5km_v1.1_SacksRev_c110629.nc",
"cloud_data": "data/clouds",
"image_height" : 300
}
......
This source diff could not be displayed because it is stored in LFS. You can view the blob instead.
This source diff could not be displayed because it is stored in LFS. You can view the blob instead.
This source diff could not be displayed because it is stored in LFS. You can view the blob instead.
This source diff could not be displayed because it is stored in LFS. You can view the blob instead.
This source diff could not be displayed because it is stored in LFS. You can view the blob instead.
This source diff could not be displayed because it is stored in LFS. You can view the blob instead.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment