Commit d4a2c26e authored by Evans, Katherine's avatar Evans, Katherine
Browse files

more changes to generaized that I though I already committted

parent 61c94175
......@@ -20,7 +20,7 @@ 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_cesm_atm_climo_jja = os.path.join(config['cesm_atm_climos'], 'b.e10.BG20TRCN.f09_g16.002_JJA_climo.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')
# --------------------------------------------------------------
......@@ -33,13 +33,13 @@ def make_plot(config, out_path='.'):
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_cldhgh = cesm.variables['CLDHGH'][0, :, :]
cesm_lat = cesm.variables['lat'][:]
cesm_lon = cesm.variables['lon'][:]
# read f_model_atm_climo_jja and file2, CESM variable
model = Dataset(f_model_atm_climo_jja)
model_cldhgh = model.variables['CLDHGH'][0, :, :]
model_lat = model.variables['lat'][:]
model_lon = model.variables['lon'][:]
cesm_cldhgh = cesm_cldhgh * 100 # to get percent
model_cldhgh = model_cldhgh * 100 # to get percent
# --- ISCCP data without remapping [64,128]
isccp = Dataset(f_isccp)
......@@ -54,7 +54,7 @@ def make_plot(config, out_path='.'):
cloudsat_lon = cloudsat.variables['lon'][:]
# print("contour plot of CLDHGH vs obs")
# maxmodel = np.max(cesm_cldhgh)
# maxmodel = np.max(model_cldhgh)
# maxisccp = np.max(isccp_hgh)
# maxcldsat = np.max(cloudsat_hgh)
# print("Max CLDHGH model: {}".format(maxmodel))
......@@ -107,8 +107,8 @@ 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()
......@@ -168,7 +168,7 @@ 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_cldhgh, res1)
model_plot = Ngl.contour(wks, model_cldhgh, res1)
isccp_plot = Ngl.contour(wks, isccp_hgh, res2)
cldsat_plot = Ngl.contour(wks, cloudsat_hgh, res3)
......@@ -183,7 +183,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)
......
......@@ -11,15 +11,15 @@ from netCDF4 import Dataset
def calculate_area_weighted_averages(config):
# ---------------- Data sources ------------------------
# CESM1
f_cesm_atm_climo_ann = os.path.join(config['cesm_atm_climos'], 'b.e10.BG20TRCN.f09_g16.002_ANN_climo.nc')
f_cesm_lnd_climo_jja = os.path.join(config['cesm_lnd_climos'], 'b.e10.BG20TRCN.f09_g16.002_JJA_climo.nc')
f_cesm_lnd_climo_ann = os.path.join(config['cesm_lnd_climos'], 'b.e10.BG20TRCN.f09_g16.002_ANN_climo.nc')
f_surf = os.path.join(config['cesm_lnd_climos'], 'surfdata_0.9x1.25_simyr1850_c110725.nc')
f_model_atm_climo_ann = os.path.join(config['model_atm_climos'], 'b.e10.BG20TRCN.f09_g16.002_ANN_climo.nc')
f_model_lnd_climo_jja = os.path.join(config['model_lnd_climos'], 'b.e10.BG20TRCN.f09_g16.002_JJA_climo.nc')
f_model_lnd_climo_ann = os.path.join(config['model_lnd_climos'], 'b.e10.BG20TRCN.f09_g16.002_ANN_climo.nc')
f_surf = os.path.join(config['model_lnd_climos'], 'surfdata_0.9x1.25_simyr1850_c110725.nc')
# --------------------------------------------------------------
# --------------------------------------------------------------
# f_cesm_lnd_climo_jja get FLDS (mean downwelling longwave rad),FIRA (mean net IR longwave rad, absorbed)
# f_model_lnd_climo_jja get FLDS (mean downwelling longwave rad),FIRA (mean net IR longwave rad, absorbed)
# FLDS(0,:,:), FIRA(0,:,:)
# Matrix gris_area(Greenland ice area) has values 0 and none
......@@ -46,9 +46,9 @@ def calculate_area_weighted_averages(config):
ncid2.close()
# ---read input_files
ncid1 = Dataset(f_cesm_lnd_climo_jja, mode='r')
ncid11 = Dataset(f_cesm_atm_climo_ann, mode='r')
ncid3 = Dataset(f_cesm_lnd_climo_ann, mode='r')
ncid1 = Dataset(f_model_lnd_climo_jja, mode='r')
ncid11 = Dataset(f_model_atm_climo_ann, mode='r')
ncid3 = Dataset(f_model_lnd_climo_ann, mode='r')
fsds = ncid1.variables['FSDS'][0, :, :]
fsa = ncid1.variables['FSA'][0, :, :]
......
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