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

chg cesm to model for variables in energy plot files

parent 85650b70
...@@ -25,7 +25,7 @@ def make_plot(config, out_path='.'): ...@@ -25,7 +25,7 @@ def make_plot(config, out_path='.'):
# ---------------- Data source in TITAN ------------------------ # ---------------- Data source in TITAN ------------------------
f_cism = os.path.join(config['cism_data'], 'Greenland_5km_v1.1_SacksRev_c110629.nc') f_cism = os.path.join(config['cism_data'], 'Greenland_5km_v1.1_SacksRev_c110629.nc')
f_cesm_lnd_climo_jja = os.path.join(config['model_lnd_climos'], f_cesm_lnd_climo_jja = os.path.join(config['model_lnd_climos'],
'b.e10.BG20TRCN.f09_g16.002_JJA_196006_200508_climo.nc') 'b.e10.BG20TRCN.f09_g16.002_JJA_climo.nc')
f_racmo_alb_jja = os.path.join(config['racmo_data'], 'racmo23_GRN_monthly.alb.1980-1999.JJA.nc') f_racmo_alb_jja = os.path.join(config['racmo_data'], 'racmo23_GRN_monthly.alb.1980-1999.JJA.nc')
f_racmo_alb_jja_remapped = os.path.join(config['racmo_data'], f_racmo_alb_jja_remapped = os.path.join(config['racmo_data'],
'racmo23_GRN_monthly.alb.1980-1999.remap2cesm.JJA.nc') 'racmo23_GRN_monthly.alb.1980-1999.remap2cesm.JJA.nc')
......
...@@ -25,8 +25,8 @@ title = "Summer latent heat flux" ...@@ -25,8 +25,8 @@ title = "Summer latent heat flux"
def make_plot(config, out_path='.'): def make_plot(config, out_path='.'):
# ---------------- Data source in TITAN ------------------------ # ---------------- Data source in TITAN ------------------------
f_cism = os.path.join(config['cism_data'], 'Greenland_5km_v1.1_SacksRev_c110629.nc') f_cism = os.path.join(config['cism_data'], 'Greenland_5km_v1.1_SacksRev_c110629.nc')
f_cesm_lnd_climo_jja = os.path.join(config['model_lnd_climos'], f_model_lnd_climo_jja = os.path.join(config['model_lnd_climos'],
'b.e10.BG20TRCN.f09_g16.002_JJA_196006_200508_climo.nc') 'b.e10.BG20TRCN.f09_g16.002_JJA_climo.nc')
f_racmo_latf_jja = os.path.join(config['racmo_data'], 'racmo23_GRN_monthly.latf.1980-1999.JJA.nc') f_racmo_latf_jja = os.path.join(config['racmo_data'], 'racmo23_GRN_monthly.latf.1980-1999.JJA.nc')
f_racmo_latf_jja_remapped = os.path.join(config['racmo_data'], f_racmo_latf_jja_remapped = os.path.join(config['racmo_data'],
'racmo23_GRN_monthly.latf.1980-1999.remap2cesm.JJA.nc') 'racmo23_GRN_monthly.latf.1980-1999.remap2cesm.JJA.nc')
...@@ -46,8 +46,8 @@ def make_plot(config, out_path='.'): ...@@ -46,8 +46,8 @@ def make_plot(config, out_path='.'):
lat = ncid0.variables['lat'][0, :, :] lat = ncid0.variables['lat'][0, :, :]
lon = ncid0.variables['lon'][0, :, :] lon = ncid0.variables['lon'][0, :, :]
# read f_cesm_lnd_climo_jja, CESM variables # read f_model_lnd_climo_jja, CESM variables
ncid1 = Dataset(f_cesm_lnd_climo_jja) ncid1 = Dataset(f_model_lnd_climo_jja)
qsoil = ncid1.variables['QSOIL'][0, :, :] qsoil = ncid1.variables['QSOIL'][0, :, :]
lat1 = ncid1.variables['lat'][:] lat1 = ncid1.variables['lat'][:]
lon1 = ncid1.variables['lon'][:] lon1 = ncid1.variables['lon'][:]
......
...@@ -25,8 +25,8 @@ title = "Summer downward longwave radiation" ...@@ -25,8 +25,8 @@ title = "Summer downward longwave radiation"
def make_plot(config, out_path='.'): def make_plot(config, out_path='.'):
# ---------------- Data source in TITAN ------------------------ # ---------------- Data source in TITAN ------------------------
f_cism = os.path.join(config['cism_data'], 'Greenland_5km_v1.1_SacksRev_c110629.nc') f_cism = os.path.join(config['cism_data'], 'Greenland_5km_v1.1_SacksRev_c110629.nc')
f_cesm_lnd_climo_jja = os.path.join(config['model_lnd_climos'], f_model_lnd_climo_jja = os.path.join(config['model_lnd_climos'],
'b.e10.BG20TRCN.f09_g16.002_JJA_196006_200508_climo.nc') 'b.e10.BG20TRCN.f09_g16.002_JJA_climo.nc')
f_racmo_lwsd_jja = os.path.join(config['racmo_data'], 'racmo23_GRN_monthly.lwsd.1980-1999.JJA.nc') f_racmo_lwsd_jja = os.path.join(config['racmo_data'], 'racmo23_GRN_monthly.lwsd.1980-1999.JJA.nc')
f_racmo_lwsd_jja_remapped = os.path.join(config['racmo_data'], f_racmo_lwsd_jja_remapped = os.path.join(config['racmo_data'],
'racmo23_GRN_monthly.lwsd.1980-1999.remap2cesm.JJA.nc') 'racmo23_GRN_monthly.lwsd.1980-1999.remap2cesm.JJA.nc')
...@@ -46,8 +46,8 @@ def make_plot(config, out_path='.'): ...@@ -46,8 +46,8 @@ def make_plot(config, out_path='.'):
lat = ncid0.variables['lat'][0, :, :] lat = ncid0.variables['lat'][0, :, :]
lon = ncid0.variables['lon'][0, :, :] lon = ncid0.variables['lon'][0, :, :]
# read f_cesm_lnd_climo_jja, variable of CESM # read f_model_lnd_climo_jja, variable of CESM
ncid1 = Dataset(f_cesm_lnd_climo_jja) ncid1 = Dataset(f_model_lnd_climo_jja)
flds = ncid1.variables['FLDS'][0, :, :] flds = ncid1.variables['FLDS'][0, :, :]
lat1 = ncid1.variables['lat'][:] lat1 = ncid1.variables['lat'][:]
lon1 = ncid1.variables['lon'][:] lon1 = ncid1.variables['lon'][:]
......
...@@ -25,8 +25,8 @@ title = "Net summer longwave radiation" ...@@ -25,8 +25,8 @@ title = "Net summer longwave radiation"
def make_plot(config, out_path='.'): def make_plot(config, out_path='.'):
# ---------------- Data source in TITAN ------------------------ # ---------------- Data source in TITAN ------------------------
f_cism = os.path.join(config['cism_data'], 'Greenland_5km_v1.1_SacksRev_c110629.nc') f_cism = os.path.join(config['cism_data'], 'Greenland_5km_v1.1_SacksRev_c110629.nc')
f_cesm_lnd_climo_jja = os.path.join(config['model_lnd_climos'], f_model_lnd_climo_jja = os.path.join(config['model_lnd_climos'],
'b.e10.BG20TRCN.f09_g16.002_JJA_196006_200508_climo.nc') 'b.e10.BG20TRCN.f09_g16.002_JJA_climo.nc')
f_racmo_lwsn_jja = os.path.join(config['racmo_data'], 'racmo23_GRN_monthly.lwsn.1980-1999.JJA.nc') f_racmo_lwsn_jja = os.path.join(config['racmo_data'], 'racmo23_GRN_monthly.lwsn.1980-1999.JJA.nc')
f_racmo_lwsn_jja_remapped = os.path.join(config['racmo_data'], f_racmo_lwsn_jja_remapped = os.path.join(config['racmo_data'],
'racmo23_GRN_monthly.lwsn.1980-1999.remap2cesm.JJA.nc') 'racmo23_GRN_monthly.lwsn.1980-1999.remap2cesm.JJA.nc')
...@@ -38,7 +38,7 @@ def make_plot(config, out_path='.'): ...@@ -38,7 +38,7 @@ def make_plot(config, out_path='.'):
# f_cism get the following, matrixsize[301,561] # f_cism get the following, matrixsize[301,561]
# usrf(0,:,:), lat(0,:,:), lon(0,:,:) # usrf(0,:,:), lat(0,:,:), lon(0,:,:)
# #
# f_cesm_lnd_climo_jja get FSDS (mean downwelling solar flux),FSA (mean net solar flux, absorbed) # f_model_lnd_climo_jja get FSDS (mean downwelling solar flux),FSA (mean net solar flux, absorbed)
# FSR (the mean net solar flux, reflected) # FSR (the mean net solar flux, reflected)
# FSDS(0,:,:), FSA(0,:,:), FSR(0,:,:) # FSDS(0,:,:), FSA(0,:,:), FSR(0,:,:)
...@@ -51,8 +51,8 @@ def make_plot(config, out_path='.'): ...@@ -51,8 +51,8 @@ def make_plot(config, out_path='.'):
lat = ncid0.variables['lat'][0, :, :] lat = ncid0.variables['lat'][0, :, :]
lon = ncid0.variables['lon'][0, :, :] lon = ncid0.variables['lon'][0, :, :]
# read f_cesm_lnd_climo_jja, CESM variables # read f_model_lnd_climo_jja, CESM variables
ncid1 = Dataset(f_cesm_lnd_climo_jja) ncid1 = Dataset(f_model_lnd_climo_jja)
fira = ncid1.variables['FIRA'][0, :, :] fira = ncid1.variables['FIRA'][0, :, :]
lat1 = ncid1.variables['lat'][:] lat1 = ncid1.variables['lat'][:]
lon1 = ncid1.variables['lon'][:] lon1 = ncid1.variables['lon'][:]
......
...@@ -25,8 +25,8 @@ title = "Net summer radiation" ...@@ -25,8 +25,8 @@ title = "Net summer radiation"
def make_plot(config, out_path='.'): def make_plot(config, out_path='.'):
# ---------------- Data source in TITAN ------------------------ # ---------------- Data source in TITAN ------------------------
f_cism = os.path.join(config['cism_data'], 'Greenland_5km_v1.1_SacksRev_c110629.nc') f_cism = os.path.join(config['cism_data'], 'Greenland_5km_v1.1_SacksRev_c110629.nc')
f_cesm_lnd_climo_jja = os.path.join(config['model_lnd_climos'], f_model_lnd_climo_jja = os.path.join(config['model_lnd_climos'],
'b.e10.BG20TRCN.f09_g16.002_JJA_196006_200508_climo.nc') 'b.e10.BG20TRCN.f09_g16.002_JJA_climo.nc')
f_racmo_swsn_jja = os.path.join(config['racmo_data'], f_racmo_swsn_jja = os.path.join(config['racmo_data'],
'racmo23_GRN_monthly.swsn.1980-1999.JJA.nc') 'racmo23_GRN_monthly.swsn.1980-1999.JJA.nc')
f_racmo_swsn_jja_remapped = os.path.join(config['racmo_data'], f_racmo_swsn_jja_remapped = os.path.join(config['racmo_data'],
...@@ -51,21 +51,21 @@ def make_plot(config, out_path='.'): ...@@ -51,21 +51,21 @@ def make_plot(config, out_path='.'):
lat = ncid0.variables['lat'][0, :, :] lat = ncid0.variables['lat'][0, :, :]
lon = ncid0.variables['lon'][0, :, :] lon = ncid0.variables['lon'][0, :, :]
# read f_cesm_lnd_climo_jja, CESM varialbes # read f_model_lnd_climo_jja, CESM varialbes
ncid1 = Dataset(f_cesm_lnd_climo_jja) ncid1 = Dataset(f_model_lnd_climo_jja)
fsa = ncid1.variables['FSA'][0, :, :] fsa = ncid1.variables['FSA'][0, :, :]
lat1 = ncid1.variables['lat'][:] lat1 = ncid1.variables['lat'][:]
lon1 = ncid1.variables['lon'][:] lon1 = ncid1.variables['lon'][:]
fira = ncid1.variables['FIRA'][0, :, :] fira = ncid1.variables['FIRA'][0, :, :]
rnet_cesm = fsa - fira rnet_model = fsa - fira
# use gris as a mask to mask fsa array # use gris as a mask to mask fsa array
gris_mask = ncid1.variables['gris_mask'][0, :, :] gris_mask = ncid1.variables['gris_mask'][0, :, :]
gris_mask = ma.masked_equal(gris_mask, 0) gris_mask = ma.masked_equal(gris_mask, 0)
rnet_cesm_mask = ma.masked_array(rnet_cesm, mask=gris_mask.mask) rnet_model_mask = ma.masked_array(rnet_model, mask=gris_mask.mask)
rnet_cesm = rnet_cesm_mask rnet_model = rnet_model_mask
# read input_file2, RACMO variables # read input_file2, RACMO variables
ncid21 = Dataset(f_racmo_swsn_jja) ncid21 = Dataset(f_racmo_swsn_jja)
...@@ -98,7 +98,7 @@ def make_plot(config, out_path='.'): ...@@ -98,7 +98,7 @@ def make_plot(config, out_path='.'):
remap_rnet = remap_swsn + remap_lwsn remap_rnet = remap_swsn + remap_lwsn
diff = rnet_cesm - remap_rnet diff = rnet_model - remap_rnet
# print(np.max(diff)) # print(np.max(diff))
# print(np.min(diff)) # print(np.min(diff))
...@@ -225,7 +225,7 @@ def make_plot(config, out_path='.'): ...@@ -225,7 +225,7 @@ def make_plot(config, out_path='.'):
usrf_plot2 = Ngl.contour(wks, racmo_elev, sres1) usrf_plot2 = Ngl.contour(wks, racmo_elev, sres1)
usrf_plot3 = Ngl.contour(wks, usrf, sres) usrf_plot3 = Ngl.contour(wks, usrf, sres)
rnet_cesm_plot = Ngl.contour(wks, rnet_cesm, res1) rnet_model_plot = Ngl.contour(wks, rnet_model, res1)
rnet_plot = Ngl.contour(wks, rnet, res2) rnet_plot = Ngl.contour(wks, rnet, res2)
diff_plot = Ngl.contour(wks, diff, res3) diff_plot = Ngl.contour(wks, diff, res3)
...@@ -240,7 +240,7 @@ def make_plot(config, out_path='.'): ...@@ -240,7 +240,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], rnet_cesm_plot) Ngl.overlay(plot[0], rnet_model_plot)
Ngl.overlay(plot[0], usrf_plot1) Ngl.overlay(plot[0], usrf_plot1)
Ngl.overlay(plot[1], rnet_plot) Ngl.overlay(plot[1], rnet_plot)
......
...@@ -25,8 +25,8 @@ title = "Net shortwave radiation" ...@@ -25,8 +25,8 @@ title = "Net shortwave radiation"
def make_plot(config, out_path='.'): def make_plot(config, out_path='.'):
# ---------------- Data source in TITAN ------------------------ # ---------------- Data source in TITAN ------------------------
f_cism = os.path.join(config['cism_data'], 'Greenland_5km_v1.1_SacksRev_c110629.nc') f_cism = os.path.join(config['cism_data'], 'Greenland_5km_v1.1_SacksRev_c110629.nc')
f_cesm_lnd_climo_jja = os.path.join(config['model_lnd_climos'], f_model_lnd_climo_jja = os.path.join(config['model_lnd_climos'],
'b.e10.BG20TRCN.f09_g16.002_JJA_196006_200508_climo.nc') 'b.e10.BG20TRCN.f09_g16.002_JJA_climo.nc')
f_racmo_senf_jja = os.path.join(config['racmo_data'], f_racmo_senf_jja = os.path.join(config['racmo_data'],
'racmo23_GRN_monthly.senf.1980-1999.JJA.nc') 'racmo23_GRN_monthly.senf.1980-1999.JJA.nc')
f_racmo_senf_jja_remapped = os.path.join(config['racmo_data'], f_racmo_senf_jja_remapped = os.path.join(config['racmo_data'],
...@@ -47,8 +47,8 @@ def make_plot(config, out_path='.'): ...@@ -47,8 +47,8 @@ def make_plot(config, out_path='.'):
lat = ncid0.variables['lat'][0, :, :] lat = ncid0.variables['lat'][0, :, :]
lon = ncid0.variables['lon'][0, :, :] lon = ncid0.variables['lon'][0, :, :]
# read f_cesm_lnd_climo_jja, CESM varialbes # read f_model_lnd_climo_jja, CESM varialbes
ncid1 = Dataset(f_cesm_lnd_climo_jja) ncid1 = Dataset(f_model_lnd_climo_jja)
fsh = ncid1.variables['FSH'][0, :, :] fsh = ncid1.variables['FSH'][0, :, :]
lat1 = ncid1.variables['lat'][:] lat1 = ncid1.variables['lat'][:]
lon1 = ncid1.variables['lon'][:] lon1 = ncid1.variables['lon'][:]
......
...@@ -25,8 +25,8 @@ title = "Summer surface mass balance" ...@@ -25,8 +25,8 @@ title = "Summer surface mass balance"
def make_plot(config, out_path='.'): def make_plot(config, out_path='.'):
# ---------------- Data source in TITAN ------------------------ # ---------------- Data source in TITAN ------------------------
f_cism = os.path.join(config['cism_data'], 'Greenland_5km_v1.1_SacksRev_c110629.nc') f_cism = os.path.join(config['cism_data'], 'Greenland_5km_v1.1_SacksRev_c110629.nc')
f_cesm_lnd_climo_jja = os.path.join(config['model_lnd_climos'], f_model_lnd_climo_jja = os.path.join(config['model_lnd_climos'],
'b.e10.BG20TRCN.f09_g16.002_JJA_196006_200508_climo.nc') 'b.e10.BG20TRCN.f09_g16.002_JJA_climo.nc')
f_racmo_smb_jja = os.path.join(config['racmo_data'], 'racmo23_GRN_monthly.smb.1980-1999.JJA.nc') f_racmo_smb_jja = os.path.join(config['racmo_data'], 'racmo23_GRN_monthly.smb.1980-1999.JJA.nc')
f_racmo_smb_jja_remapped = os.path.join(config['racmo_data'], f_racmo_smb_jja_remapped = os.path.join(config['racmo_data'],
'racmo23_GRN_monthly.smb.1980-1999.remap2cesm.JJA.nc') 'racmo23_GRN_monthly.smb.1980-1999.remap2cesm.JJA.nc')
...@@ -46,10 +46,10 @@ def make_plot(config, out_path='.'): ...@@ -46,10 +46,10 @@ def make_plot(config, out_path='.'):
lat = ncid0.variables['lat'][0, :, :] lat = ncid0.variables['lat'][0, :, :]
lon = ncid0.variables['lon'][0, :, :] lon = ncid0.variables['lon'][0, :, :]
# read f_cesm_lnd_climo_jja, CESM variable # read f_model_lnd_climo_jja, CESM variable
ncid1 = Dataset(f_cesm_lnd_climo_jja) ncid1 = Dataset(f_model_lnd_climo_jja)
smb_cesm = ncid1.variables['QICE'][0, :, :] smb_model = ncid1.variables['QICE'][0, :, :]
smb_cesm = smb_cesm * 3.156e7 # convert from mm/s to kg/m^2/yr smb_model = smb_model * 3.156e7 # convert from mm/s to kg/m^2/yr
lat1 = ncid1.variables['lat'][:] lat1 = ncid1.variables['lat'][:]
lon1 = ncid1.variables['lon'][:] lon1 = ncid1.variables['lon'][:]
...@@ -57,8 +57,8 @@ def make_plot(config, out_path='.'): ...@@ -57,8 +57,8 @@ def make_plot(config, out_path='.'):
gris_mask = ncid1.variables['gris_mask'][0, :, :] gris_mask = ncid1.variables['gris_mask'][0, :, :]
gris_mask = ma.masked_equal(gris_mask, 0) gris_mask = ma.masked_equal(gris_mask, 0)
smb_cesm_mask = ma.masked_array(smb_cesm, mask=gris_mask.mask) smb_model_mask = ma.masked_array(smb_model, mask=gris_mask.mask)
smb_cesm = smb_cesm_mask smb_model = smb_model_mask
# read f_racmo_smb_jja_remapped, the remapped RACMO file to calculate difference # read f_racmo_smb_jja_remapped, the remapped RACMO file to calculate difference
ncid3 = Dataset(f_racmo_smb_jja_remapped) ncid3 = Dataset(f_racmo_smb_jja_remapped)
...@@ -88,7 +88,7 @@ def make_plot(config, out_path='.'): ...@@ -88,7 +88,7 @@ def make_plot(config, out_path='.'):
smb_mask = ma.masked_array(smb, mask=gris_mask.mask) smb_mask = ma.masked_array(smb, mask=gris_mask.mask)
smb = smb_mask smb = smb_mask
diff = smb_cesm - smb_remap diff = smb_model - smb_remap
# diffmin = (np.min(diff)) # diffmin = (np.min(diff))
# diffmax = (np.max(diff)) # diffmax = (np.max(diff))
...@@ -219,7 +219,7 @@ def make_plot(config, out_path='.'): ...@@ -219,7 +219,7 @@ def make_plot(config, out_path='.'):
usrf_plot2 = Ngl.contour(wks, racmo_elev, sres1) usrf_plot2 = Ngl.contour(wks, racmo_elev, sres1)
usrf_plot3 = Ngl.contour(wks, usrf, sres) usrf_plot3 = Ngl.contour(wks, usrf, sres)
smb_cesm_plot = Ngl.contour(wks, smb_cesm, res1) smb_model_plot = Ngl.contour(wks, smb_model, res1)
smb_plot = Ngl.contour(wks, smb, res2) smb_plot = Ngl.contour(wks, smb, res2)
diff_plot = Ngl.contour(wks, diff, res3) diff_plot = Ngl.contour(wks, diff, res3)
# diff_plot = Ngl.contour(wks,Remap_smb,res1) # diff_plot = Ngl.contour(wks,Remap_smb,res1)
...@@ -235,7 +235,7 @@ def make_plot(config, out_path='.'): ...@@ -235,7 +235,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], smb_cesm_plot) Ngl.overlay(plot[0], smb_model_plot)
Ngl.overlay(plot[0], usrf_plot1) Ngl.overlay(plot[0], usrf_plot1)
Ngl.overlay(plot[1], smb_plot) Ngl.overlay(plot[1], smb_plot)
......
...@@ -24,8 +24,8 @@ title = "Summer downward shortwave radiation" ...@@ -24,8 +24,8 @@ title = "Summer downward shortwave radiation"
def make_plot(config, out_path='.'): def make_plot(config, out_path='.'):
# ---------------- Data source in TITAN ------------------------ # ---------------- Data source in TITAN ------------------------
f_cism = os.path.join(config['cism_data'], 'Greenland_5km_v1.1_SacksRev_c110629.nc') f_cism = os.path.join(config['cism_data'], 'Greenland_5km_v1.1_SacksRev_c110629.nc')
f_cesm_lnd_climo_jja = os.path.join(config['model_lnd_climos'], f_model_lnd_climo_jja = os.path.join(config['model_lnd_climos'],
'b.e10.BG20TRCN.f09_g16.002_JJA_196006_200508_climo.nc') 'b.e10.BG20TRCN.f09_g16.002_JJA_climo.nc')
f_racmo_swsd_jja = os.path.join(config['racmo_data'], 'racmo23_GRN_monthly.swsd.1980-1999.JJA.nc') f_racmo_swsd_jja = os.path.join(config['racmo_data'], 'racmo23_GRN_monthly.swsd.1980-1999.JJA.nc')
f_racmo_swsd_jja_remapped = os.path.join(config['racmo_data'], f_racmo_swsd_jja_remapped = os.path.join(config['racmo_data'],
'racmo23_GRN_monthly.swsd.1980-1999.remap2cesm.JJA.nc') 'racmo23_GRN_monthly.swsd.1980-1999.remap2cesm.JJA.nc')
...@@ -45,8 +45,8 @@ def make_plot(config, out_path='.'): ...@@ -45,8 +45,8 @@ def make_plot(config, out_path='.'):
lat = ncid0.variables['lat'][0, :, :] lat = ncid0.variables['lat'][0, :, :]
lon = ncid0.variables['lon'][0, :, :] lon = ncid0.variables['lon'][0, :, :]
# read f_cesm_lnd_climo_jja, CESM variables # read f_model_lnd_climo_jja, CESM variables
ncid1 = Dataset(f_cesm_lnd_climo_jja) ncid1 = Dataset(f_model_lnd_climo_jja)
fsds = ncid1.variables['FSDS'][0, :, :] fsds = ncid1.variables['FSDS'][0, :, :]
lat1 = ncid1.variables['lat'][:] lat1 = ncid1.variables['lat'][:]
lon1 = ncid1.variables['lon'][:] lon1 = ncid1.variables['lon'][:]
......
...@@ -24,8 +24,8 @@ title = "Net Summer shortwave radiation" ...@@ -24,8 +24,8 @@ title = "Net Summer shortwave radiation"
def make_plot(config, out_path='.'): def make_plot(config, out_path='.'):
# ---------------- Data source in TITAN ------------------------ # ---------------- Data source in TITAN ------------------------
f_cism = os.path.join(config['cism_data'], 'Greenland_5km_v1.1_SacksRev_c110629.nc') f_cism = os.path.join(config['cism_data'], 'Greenland_5km_v1.1_SacksRev_c110629.nc')
f_cesm_lnd_climo_jja = os.path.join(config['model_lnd_climos'], f_model_lnd_climo_jja = os.path.join(config['model_lnd_climos'],
'b.e10.BG20TRCN.f09_g16.002_JJA_196006_200508_climo.nc') 'b.e10.BG20TRCN.f09_g16.002_JJA_climo.nc')
f_racmo_swsn_jja = os.path.join(config['racmo_data'], 'racmo23_GRN_monthly.swsn.1980-1999.JJA.nc') f_racmo_swsn_jja = os.path.join(config['racmo_data'], 'racmo23_GRN_monthly.swsn.1980-1999.JJA.nc')
f_racmo_swsn_jja_remapped = os.path.join(config['racmo_data'], f_racmo_swsn_jja_remapped = os.path.join(config['racmo_data'],
'racmo23_GRN_monthly.swsn.1980-1999.remap2cesm.JJA.nc') 'racmo23_GRN_monthly.swsn.1980-1999.remap2cesm.JJA.nc')
...@@ -45,8 +45,8 @@ def make_plot(config, out_path='.'): ...@@ -45,8 +45,8 @@ def make_plot(config, out_path='.'):
lat = ncid0.variables['lat'][0, :, :] lat = ncid0.variables['lat'][0, :, :]
lon = ncid0.variables['lon'][0, :, :] lon = ncid0.variables['lon'][0, :, :]
# read f_cesm_lnd_climo_jja, CESM varialbes # read f_model_lnd_climo_jja, CESM varialbes
ncid1 = Dataset(f_cesm_lnd_climo_jja) ncid1 = Dataset(f_model_lnd_climo_jja)
fsa = ncid1.variables['FSA'][0, :, :] fsa = ncid1.variables['FSA'][0, :, :]
lat1 = ncid1.variables['lat'][:] lat1 = ncid1.variables['lat'][:]
lon1 = ncid1.variables['lon'][:] lon1 = ncid1.variables['lon'][:]
......
...@@ -24,8 +24,8 @@ title = "Annual 2-meter air temperature" ...@@ -24,8 +24,8 @@ title = "Annual 2-meter air temperature"
def make_plot(config, out_path='.'): def make_plot(config, out_path='.'):
# ---------------- Data source in TITAN ------------------------ # ---------------- Data source in TITAN ------------------------
f_cism = os.path.join(config['cism_data'], 'Greenland_5km_v1.1_SacksRev_c110629.nc') f_cism = os.path.join(config['cism_data'], 'Greenland_5km_v1.1_SacksRev_c110629.nc')
f_cesm_lnd_climo_ann = os.path.join(config['model_lnd_climos'], 'b.e10.BG20TRCN.f09_g16.002_ANN_climo.nc') f_model_lnd_climo_ann = os.path.join(config['model_lnd_climos'], 'b.e10.BG20TRCN.f09_g16.002_ANN_climo.nc')
f_cesm_atm_climo_ann = os.path.join(config['model_atm_climos'], 'b.e10.BG20TRCN.f09_g16.002_ANN_climo.nc') f_model_atm_climo_ann = os.path.join(config['model_atm_climos'], 'b.e10.BG20TRCN.f09_g16.002_ANN_climo.nc')
f_racmo_t2m_ann = os.path.join(config['racmo_data'], 'racmo23_GRN_monthly.t2m.1980-1999.ANN.nc') f_racmo_t2m_ann = os.path.join(config['racmo_data'], 'racmo23_GRN_monthly.t2m.1980-1999.ANN.nc')
f_racmo_t2m_ann_remapped = os.path.join(config['racmo_data'], f_racmo_t2m_ann_remapped = os.path.join(config['racmo_data'],
'racmo23_GRN_monthly.t2m.1980-1999.remap2cesm.ANN.nc') 'racmo23_GRN_monthly.t2m.1980-1999.remap2cesm.ANN.nc')
...@@ -40,9 +40,9 @@ def make_plot(config, out_path='.'): ...@@ -40,9 +40,9 @@ def make_plot(config, out_path='.'):
lat = ncid0.variables['lat'][0, :, :] lat = ncid0.variables['lat'][0, :, :]
lon = ncid0.variables['lon'][0, :, :] lon = ncid0.variables['lon'][0, :, :]
# read f_cesm_atm_climo_ann and file2, CESM variable # read f_model_atm_climo_ann and file2, CESM variable
ncid1 = Dataset(f_cesm_atm_climo_ann) ncid1 = Dataset(f_model_atm_climo_ann)
w_cesm = ncid1.variables['TREFHT'][0, :, :] w_model = ncid1.variables['TREFHT'][0, :, :]
lat1 = ncid1.variables['lat'][:] lat1 = ncid1.variables['lat'][:]
lon1 = ncid1.variables['lon'][:] lon1 = ncid1.variables['lon'][:]
...@@ -64,17 +64,17 @@ def make_plot(config, out_path='.'): ...@@ -64,17 +64,17 @@ def make_plot(config, out_path='.'):
lat22 = ncid22.variables['lat'][:] lat22 = ncid22.variables['lat'][:]
lon22 = ncid22.variables['lon'][:] lon22 = ncid22.variables['lon'][:]
w_cesm = w_cesm - 273.15 # convert to celcius w_model = w_model - 273.15 # convert to celcius
w_racmo = w_racmo - 273.15 w_racmo = w_racmo - 273.15
w_racmo_l = w_racmo_l - 273.15 w_racmo_l = w_racmo_l - 273.15
diff = w_cesm - w_racmo diff = w_model - w_racmo
# locate the greenland area using the GreenLand mask # locate the greenland area using the GreenLand mask
ncid8 = Dataset(f_cesm_lnd_climo_ann) ncid8 = Dataset(f_model_lnd_climo_ann)
gris_mask = ncid8.variables['gris_mask'][0, :, :] gris_mask = ncid8.variables['gris_mask'][0, :, :]
gris_mask = ma.masked_equal(gris_mask, 0) gris_mask = ma.masked_equal(gris_mask, 0)
# mask out non RACMO regions, icemask var in f_cesm_lnd_climo_ann # mask out non RACMO regions, icemask var in f_model_lnd_climo_ann
diff_mask = ma.masked_array(diff, mask=gris_mask.mask) diff_mask = ma.masked_array(diff, mask=gris_mask.mask)
# print np.max(diff_mask) # print np.max(diff_mask)
...@@ -197,7 +197,7 @@ def make_plot(config, out_path='.'): ...@@ -197,7 +197,7 @@ def make_plot(config, out_path='.'):
usrf_plot2 = Ngl.contour(wks, racmo_elev, sres1) usrf_plot2 = Ngl.contour(wks, racmo_elev, sres1)
usrf_plot3 = Ngl.contour(wks, usrf, sres) usrf_plot3 = Ngl.contour(wks, usrf, sres)
t2mw_plot = Ngl.contour(wks, w_cesm, res1) t2mw_plot = Ngl.contour(wks, w_model, res1)
t2ms_l_plot = Ngl.contour(wks, w_racmo_l, res2) t2ms_l_plot = Ngl.contour(wks, w_racmo_l, res2)
diff_plot = Ngl.contour(wks, diff_mask, res22) diff_plot = Ngl.contour(wks, diff_mask, res22)
# diff_plot = Ngl.contour(wks,w_racmo,res2) #Remapped RACMO # diff_plot = Ngl.contour(wks,w_racmo,res2) #Remapped RACMO
......
...@@ -24,8 +24,8 @@ title = "Winter 2-meter air temperature" ...@@ -24,8 +24,8 @@ title = "Winter 2-meter air temperature"
def make_plot(config, out_path='.'): def make_plot(config, out_path='.'):
# ---------------- Data source in TITAN ------------------------ # ---------------- Data source in TITAN ------------------------
f_cism = os.path.join(config['cism_data'], 'Greenland_5km_v1.1_SacksRev_c110629.nc') f_cism = os.path.join(config['cism_data'], 'Greenland_5km_v1.1_SacksRev_c110629.nc')
f_cesm_lnd_climo_djf = os.path.join(config['model_lnd_climos'], 'b.e10.BG20TRCN.f09_g16.002_DJF_climo.nc') f_model_lnd_climo_djf = os.path.join(config['model_lnd_climos'], 'b.e10.BG20TRCN.f09_g16.002_DJF_climo.nc')
f_cesm_atm_climo_djf = os.path.join(config['model_atm_climos'], 'b.e10.BG20TRCN.f09_g16.002_DJF_climo.nc') f_model_atm_climo_djf = os.path.join(config['model_atm_climos'], 'b.e10.BG20TRCN.f09_g16.002_DJF_climo.nc')
f_racmo_t2m_djf = os.path.join(config['racmo_data'], 'racmo23_GRN_monthly.t2m.1980-1999.DJF.nc') f_racmo_t2m_djf = os.path.join(config['racmo_data'], 'racmo23_GRN_monthly.t2m.1980-1999.DJF.nc')
f_racmo_t2m_djf_remapped = os.path.join(config['racmo_data'], f_racmo_t2m_djf_remapped = os.path.join(config['racmo_data'],
'racmo23_GRN_monthly.t2m.1980-1999.remap2cesm.DJF.nc') 'racmo23_GRN_monthly.t2m.1980-1999.remap2cesm.DJF.nc')
...@@ -40,9 +40,9 @@ def make_plot(config, out_path='.'): ...@@ -40,9 +40,9 @@ def make_plot(config, out_path='.'):
lat = ncid0.variables['lat'][0, :, :] lat = ncid0.variables['lat'][0, :, :]
lon = ncid0.variables['lon'][0, :, :] lon = ncid0.variables['lon'][0, :, :]
# read f_cesm_atm_climo_djf and file2, CESM variable # read f_model_atm_climo_djf and file2, CESM variable
ncid1 = Dataset(f_cesm_atm_climo_djf) ncid1 = Dataset(f_model_atm_climo_djf)
w_cesm = ncid1.variables['TREFHT'][0, :, :] w_model = ncid1.variables['TREFHT'][0, :, :]
lat1 = ncid1.variables['lat'][:] lat1 = ncid1.variables['lat'][:]
lon1 = ncid1.variables['lon'][:] lon1 = ncid1.variables['lon'][:]
...@@ -64,17 +64,17 @@ def make_plot(config, out_path='.'): ...@@ -64,17 +64,17 @@ def make_plot(config, out_path='.'):
lat22 = ncid22.variables['lat'][:] lat22 = ncid22.variables['lat'][:]
lon22 = ncid22.variables['lon'][:] lon22 = ncid22.variables['lon'][:]
w_cesm = w_cesm - 273.15 # convert to celcius w_model = w_model - 273.15 # convert to celcius
w_racmo = w_racmo - 273.15 w_racmo = w_racmo - 273.15
w_racmo_l = w_racmo_l - 273.15 w_racmo_l = w_racmo_l - 273.15
diff = w_cesm - w_racmo diff = w_model - w_racmo
# locate the greenland area using the GreenLand mask # locate the greenland area using the GreenLand mask
ncid8 = Dataset(f_cesm_lnd_climo_djf) ncid8 = Dataset(f_model_lnd_climo_djf)
gris_mask = ncid8.variables['gris_mask'][0, :, :] gris_mask = ncid8.variables['gris_mask'][0, :, :]
gris_mask = ma.masked_equal(gris_mask, 0) gris_mask = ma.masked_equal(gris_mask, 0)
# mask out non RACMO regions, icemask var in f_cesm_lnd_climo_djf # mask out non RACMO regions, icemask var in f_model_lnd_climo_djf
diff_mask = ma.masked_array(diff, mask=gris_mask.mask) diff_mask = ma.masked_array(diff, mask=gris_mask.mask)
# print np.max(diff_mask) # print np.max(diff_mask)
...@@ -197,7 +197,7 @@ def make_plot(config, out_path='.'): ...@@ -197,7 +197,7 @@ def make_plot(config, out_path='.'):
usrf_plot2 = Ngl.contour(wks, racmo_elev, sres1) usrf_plot2 = Ngl.contour(wks, racmo_elev, sres1)
usrf_plot3 = Ngl.contour(wks, usrf, sres) usrf_plot3 = Ngl.contour(wks, usrf, sres)
t2mw_plot = Ngl.contour(wks, w_cesm, res1) t2mw_plot = Ngl.contour(wks, w_model, res1)
t2ms_l_plot = Ngl.contour(wks, w_racmo_l, res2) t2ms_l_plot = Ngl.contour(wks, w_racmo_l, res2)
diff_plot = Ngl.contour(wks, diff_mask, res22) diff_plot = Ngl.contour(wks, diff_mask, res22)
# diff_plot = Ngl.contour(wks,w_racmo,res2) #Remapped RACMO # diff_plot = Ngl.contour(wks,w_racmo,res2) #Remapped RACMO
......
...@@ -24,8 +24,8 @@ title = "Summer 2-meter air temperature" ...@@ -24,8 +24,8 @@ title = "Summer 2-meter air temperature"
def make_plot(config, out_path='.'): def make_plot(config, out_path='.'):
# ---------------- Data source in TITAN ------------------------ # ---------------- Data source in TITAN ------------------------
f_cism = os.path.join(config['cism_data'], 'Greenland_5km_v1.1_SacksRev_c110629.nc') f_cism = os.path.join(config['cism_data'], 'Greenland_5km_v1.1_SacksRev_c110629.nc')
f_cesm_lnd_climo_jja = os.path.join(config['model_lnd_climos'], 'b.e10.BG20TRCN.f09_g16.002_JJA_climo.nc') f_model_lnd_climo_jja = os.path.join(config['model_lnd_climos'], 'b.e10.BG20TRCN.f09_g16.002_JJA_climo.nc')
f_cesm_atm_climo_jja = os.path.join(config['model_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_racmo_t2m_jja = os.path.join(config['racmo_data'], 'racmo23_GRN_monthly.t2m.1980-1999.JJA.nc') f_racmo_t2m_jja = os.path.join(config['racmo_data'], 'racmo23_GRN_monthly.t2m.1980-1999.JJA.nc')
f_racmo_t2m_jja_remapped = os.path.join(config['racmo_data'], f_racmo_t2m_jja_remapped = os.path.join(config['racmo_data'],
'racmo23_GRN_monthly.t2m.1980-1999.remap2cesm.JJA.nc') 'racmo23_GRN_monthly.t2m.1980-1999.remap2cesm.JJA.nc')
...@@ -40,9 +40,9 @@ def make_plot(config, out_path='.'): ...@@ -40,9 +40,9 @@ def make_plot(config, out_path='.'):
lat = ncid0.variables['lat'][0, :, :] lat = ncid0.variables['lat'][0, :, :]
lon = ncid0.variables['lon'][0, :, :]