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='.'):
# ---------------- Data source in TITAN ------------------------
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_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_remapped = os.path.join(config['racmo_data'],
'racmo23_GRN_monthly.alb.1980-1999.remap2cesm.JJA.nc')
......
......@@ -25,8 +25,8 @@ title = "Summer latent heat flux"
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_lnd_climo_jja = os.path.join(config['model_lnd_climos'],
'b.e10.BG20TRCN.f09_g16.002_JJA_196006_200508_climo.nc')
f_model_lnd_climo_jja = os.path.join(config['model_lnd_climos'],
'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_remapped = os.path.join(config['racmo_data'],
'racmo23_GRN_monthly.latf.1980-1999.remap2cesm.JJA.nc')
......@@ -46,8 +46,8 @@ def make_plot(config, out_path='.'):
lat = ncid0.variables['lat'][0, :, :]
lon = ncid0.variables['lon'][0, :, :]
# read f_cesm_lnd_climo_jja, CESM variables
ncid1 = Dataset(f_cesm_lnd_climo_jja)
# read f_model_lnd_climo_jja, CESM variables
ncid1 = Dataset(f_model_lnd_climo_jja)
qsoil = ncid1.variables['QSOIL'][0, :, :]
lat1 = ncid1.variables['lat'][:]
lon1 = ncid1.variables['lon'][:]
......
......@@ -25,8 +25,8 @@ title = "Summer downward longwave radiation"
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_lnd_climo_jja = os.path.join(config['model_lnd_climos'],
'b.e10.BG20TRCN.f09_g16.002_JJA_196006_200508_climo.nc')
f_model_lnd_climo_jja = os.path.join(config['model_lnd_climos'],
'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_remapped = os.path.join(config['racmo_data'],
'racmo23_GRN_monthly.lwsd.1980-1999.remap2cesm.JJA.nc')
......@@ -46,8 +46,8 @@ def make_plot(config, out_path='.'):
lat = ncid0.variables['lat'][0, :, :]
lon = ncid0.variables['lon'][0, :, :]
# read f_cesm_lnd_climo_jja, variable of CESM
ncid1 = Dataset(f_cesm_lnd_climo_jja)
# read f_model_lnd_climo_jja, variable of CESM
ncid1 = Dataset(f_model_lnd_climo_jja)
flds = ncid1.variables['FLDS'][0, :, :]
lat1 = ncid1.variables['lat'][:]
lon1 = ncid1.variables['lon'][:]
......
......@@ -25,8 +25,8 @@ title = "Net summer longwave radiation"
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_lnd_climo_jja = os.path.join(config['model_lnd_climos'],
'b.e10.BG20TRCN.f09_g16.002_JJA_196006_200508_climo.nc')
f_model_lnd_climo_jja = os.path.join(config['model_lnd_climos'],
'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_remapped = os.path.join(config['racmo_data'],
'racmo23_GRN_monthly.lwsn.1980-1999.remap2cesm.JJA.nc')
......@@ -38,7 +38,7 @@ def make_plot(config, out_path='.'):
# f_cism get the following, matrixsize[301,561]
# 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)
# FSDS(0,:,:), FSA(0,:,:), FSR(0,:,:)
......@@ -51,8 +51,8 @@ def make_plot(config, out_path='.'):
lat = ncid0.variables['lat'][0, :, :]
lon = ncid0.variables['lon'][0, :, :]
# read f_cesm_lnd_climo_jja, CESM variables
ncid1 = Dataset(f_cesm_lnd_climo_jja)
# read f_model_lnd_climo_jja, CESM variables
ncid1 = Dataset(f_model_lnd_climo_jja)
fira = ncid1.variables['FIRA'][0, :, :]
lat1 = ncid1.variables['lat'][:]
lon1 = ncid1.variables['lon'][:]
......
......@@ -25,8 +25,8 @@ title = "Net summer radiation"
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_lnd_climo_jja = os.path.join(config['model_lnd_climos'],
'b.e10.BG20TRCN.f09_g16.002_JJA_196006_200508_climo.nc')
f_model_lnd_climo_jja = os.path.join(config['model_lnd_climos'],
'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_remapped = os.path.join(config['racmo_data'],
......@@ -51,21 +51,21 @@ def make_plot(config, out_path='.'):
lat = ncid0.variables['lat'][0, :, :]
lon = ncid0.variables['lon'][0, :, :]
# read f_cesm_lnd_climo_jja, CESM varialbes
ncid1 = Dataset(f_cesm_lnd_climo_jja)
# read f_model_lnd_climo_jja, CESM varialbes
ncid1 = Dataset(f_model_lnd_climo_jja)
fsa = ncid1.variables['FSA'][0, :, :]
lat1 = ncid1.variables['lat'][:]
lon1 = ncid1.variables['lon'][:]
fira = ncid1.variables['FIRA'][0, :, :]
rnet_cesm = fsa - fira
rnet_model = fsa - fira
# use gris as a mask to mask fsa array
gris_mask = ncid1.variables['gris_mask'][0, :, :]
gris_mask = ma.masked_equal(gris_mask, 0)
rnet_cesm_mask = ma.masked_array(rnet_cesm, mask=gris_mask.mask)
rnet_cesm = rnet_cesm_mask
rnet_model_mask = ma.masked_array(rnet_model, mask=gris_mask.mask)
rnet_model = rnet_model_mask
# read input_file2, RACMO variables
ncid21 = Dataset(f_racmo_swsn_jja)
......@@ -98,7 +98,7 @@ def make_plot(config, out_path='.'):
remap_rnet = remap_swsn + remap_lwsn
diff = rnet_cesm - remap_rnet
diff = rnet_model - remap_rnet
# print(np.max(diff))
# print(np.min(diff))
......@@ -225,7 +225,7 @@ def make_plot(config, out_path='.'):
usrf_plot2 = Ngl.contour(wks, racmo_elev, sres1)
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)
diff_plot = Ngl.contour(wks, diff, res3)
......@@ -240,7 +240,7 @@ def make_plot(config, out_path='.'):
plot.append(Ngl.map(wks, mres))
# 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[1], rnet_plot)
......
......@@ -25,8 +25,8 @@ title = "Net shortwave radiation"
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_lnd_climo_jja = os.path.join(config['model_lnd_climos'],
'b.e10.BG20TRCN.f09_g16.002_JJA_196006_200508_climo.nc')
f_model_lnd_climo_jja = os.path.join(config['model_lnd_climos'],
'b.e10.BG20TRCN.f09_g16.002_JJA_climo.nc')
f_racmo_senf_jja = os.path.join(config['racmo_data'],
'racmo23_GRN_monthly.senf.1980-1999.JJA.nc')
f_racmo_senf_jja_remapped = os.path.join(config['racmo_data'],
......@@ -47,8 +47,8 @@ def make_plot(config, out_path='.'):
lat = ncid0.variables['lat'][0, :, :]
lon = ncid0.variables['lon'][0, :, :]
# read f_cesm_lnd_climo_jja, CESM varialbes
ncid1 = Dataset(f_cesm_lnd_climo_jja)
# read f_model_lnd_climo_jja, CESM varialbes
ncid1 = Dataset(f_model_lnd_climo_jja)
fsh = ncid1.variables['FSH'][0, :, :]
lat1 = ncid1.variables['lat'][:]
lon1 = ncid1.variables['lon'][:]
......
......@@ -25,8 +25,8 @@ title = "Summer surface mass balance"
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_lnd_climo_jja = os.path.join(config['model_lnd_climos'],
'b.e10.BG20TRCN.f09_g16.002_JJA_196006_200508_climo.nc')
f_model_lnd_climo_jja = os.path.join(config['model_lnd_climos'],
'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_remapped = os.path.join(config['racmo_data'],
'racmo23_GRN_monthly.smb.1980-1999.remap2cesm.JJA.nc')
......@@ -46,10 +46,10 @@ def make_plot(config, out_path='.'):
lat = ncid0.variables['lat'][0, :, :]
lon = ncid0.variables['lon'][0, :, :]
# read f_cesm_lnd_climo_jja, CESM variable
ncid1 = Dataset(f_cesm_lnd_climo_jja)
smb_cesm = ncid1.variables['QICE'][0, :, :]
smb_cesm = smb_cesm * 3.156e7 # convert from mm/s to kg/m^2/yr
# read f_model_lnd_climo_jja, CESM variable
ncid1 = Dataset(f_model_lnd_climo_jja)
smb_model = ncid1.variables['QICE'][0, :, :]
smb_model = smb_model * 3.156e7 # convert from mm/s to kg/m^2/yr
lat1 = ncid1.variables['lat'][:]
lon1 = ncid1.variables['lon'][:]
......@@ -57,8 +57,8 @@ def make_plot(config, out_path='.'):
gris_mask = ncid1.variables['gris_mask'][0, :, :]
gris_mask = ma.masked_equal(gris_mask, 0)
smb_cesm_mask = ma.masked_array(smb_cesm, mask=gris_mask.mask)
smb_cesm = smb_cesm_mask
smb_model_mask = ma.masked_array(smb_model, mask=gris_mask.mask)
smb_model = smb_model_mask
# read f_racmo_smb_jja_remapped, the remapped RACMO file to calculate difference
ncid3 = Dataset(f_racmo_smb_jja_remapped)
......@@ -88,7 +88,7 @@ def make_plot(config, out_path='.'):
smb_mask = ma.masked_array(smb, mask=gris_mask.mask)
smb = smb_mask
diff = smb_cesm - smb_remap
diff = smb_model - smb_remap
# diffmin = (np.min(diff))
# diffmax = (np.max(diff))
......@@ -219,7 +219,7 @@ def make_plot(config, out_path='.'):
usrf_plot2 = Ngl.contour(wks, racmo_elev, sres1)
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)
diff_plot = Ngl.contour(wks, diff, res3)
# diff_plot = Ngl.contour(wks,Remap_smb,res1)
......@@ -235,7 +235,7 @@ def make_plot(config, out_path='.'):
plot.append(Ngl.map(wks, mres))
# 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[1], smb_plot)
......
......@@ -24,8 +24,8 @@ title = "Summer downward shortwave radiation"
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_lnd_climo_jja = os.path.join(config['model_lnd_climos'],
'b.e10.BG20TRCN.f09_g16.002_JJA_196006_200508_climo.nc')
f_model_lnd_climo_jja = os.path.join(config['model_lnd_climos'],
'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_remapped = os.path.join(config['racmo_data'],
'racmo23_GRN_monthly.swsd.1980-1999.remap2cesm.JJA.nc')
......@@ -45,8 +45,8 @@ def make_plot(config, out_path='.'):
lat = ncid0.variables['lat'][0, :, :]
lon = ncid0.variables['lon'][0, :, :]
# read f_cesm_lnd_climo_jja, CESM variables
ncid1 = Dataset(f_cesm_lnd_climo_jja)
# read f_model_lnd_climo_jja, CESM variables
ncid1 = Dataset(f_model_lnd_climo_jja)
fsds = ncid1.variables['FSDS'][0, :, :]
lat1 = ncid1.variables['lat'][:]
lon1 = ncid1.variables['lon'][:]
......
......@@ -24,8 +24,8 @@ title = "Net Summer shortwave radiation"
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_lnd_climo_jja = os.path.join(config['model_lnd_climos'],
'b.e10.BG20TRCN.f09_g16.002_JJA_196006_200508_climo.nc')
f_model_lnd_climo_jja = os.path.join(config['model_lnd_climos'],
'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_remapped = os.path.join(config['racmo_data'],
'racmo23_GRN_monthly.swsn.1980-1999.remap2cesm.JJA.nc')
......@@ -45,8 +45,8 @@ def make_plot(config, out_path='.'):
lat = ncid0.variables['lat'][0, :, :]
lon = ncid0.variables['lon'][0, :, :]
# read f_cesm_lnd_climo_jja, CESM varialbes
ncid1 = Dataset(f_cesm_lnd_climo_jja)
# read f_model_lnd_climo_jja, CESM varialbes
ncid1 = Dataset(f_model_lnd_climo_jja)
fsa = ncid1.variables['FSA'][0, :, :]
lat1 = ncid1.variables['lat'][:]
lon1 = ncid1.variables['lon'][:]
......
......@@ -24,8 +24,8 @@ title = "Annual 2-meter air temperature"
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_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_lnd_climo_ann = os.path.join(config['model_lnd_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_remapped = os.path.join(config['racmo_data'],
'racmo23_GRN_monthly.t2m.1980-1999.remap2cesm.ANN.nc')
......@@ -40,9 +40,9 @@ def make_plot(config, out_path='.'):
lat = ncid0.variables['lat'][0, :, :]
lon = ncid0.variables['lon'][0, :, :]
# read f_cesm_atm_climo_ann and file2, CESM variable
ncid1 = Dataset(f_cesm_atm_climo_ann)
w_cesm = ncid1.variables['TREFHT'][0, :, :]
# read f_model_atm_climo_ann and file2, CESM variable
ncid1 = Dataset(f_model_atm_climo_ann)
w_model = ncid1.variables['TREFHT'][0, :, :]
lat1 = ncid1.variables['lat'][:]
lon1 = ncid1.variables['lon'][:]
......@@ -64,17 +64,17 @@ def make_plot(config, out_path='.'):
lat22 = ncid22.variables['lat'][:]
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_l = w_racmo_l - 273.15
diff = w_cesm - w_racmo
diff = w_model - w_racmo
# 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 = 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)
# print np.max(diff_mask)
......@@ -197,7 +197,7 @@ def make_plot(config, out_path='.'):
usrf_plot2 = Ngl.contour(wks, racmo_elev, sres1)
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)
diff_plot = Ngl.contour(wks, diff_mask, res22)
# diff_plot = Ngl.contour(wks,w_racmo,res2) #Remapped RACMO
......
......@@ -24,8 +24,8 @@ title = "Winter 2-meter air temperature"
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_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_lnd_climo_djf = os.path.join(config['model_lnd_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_remapped = os.path.join(config['racmo_data'],
'racmo23_GRN_monthly.t2m.1980-1999.remap2cesm.DJF.nc')
......@@ -40,9 +40,9 @@ def make_plot(config, out_path='.'):
lat = ncid0.variables['lat'][0, :, :]
lon = ncid0.variables['lon'][0, :, :]
# read f_cesm_atm_climo_djf and file2, CESM variable
ncid1 = Dataset(f_cesm_atm_climo_djf)
w_cesm = ncid1.variables['TREFHT'][0, :, :]
# read f_model_atm_climo_djf and file2, CESM variable
ncid1 = Dataset(f_model_atm_climo_djf)
w_model = ncid1.variables['TREFHT'][0, :, :]
lat1 = ncid1.variables['lat'][:]
lon1 = ncid1.variables['lon'][:]
......@@ -64,17 +64,17 @@ def make_plot(config, out_path='.'):
lat22 = ncid22.variables['lat'][:]
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_l = w_racmo_l - 273.15
diff = w_cesm - w_racmo
diff = w_model - w_racmo
# 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 = 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)
# print np.max(diff_mask)
......@@ -197,7 +197,7 @@ def make_plot(config, out_path='.'):
usrf_plot2 = Ngl.contour(wks, racmo_elev, sres1)
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)
diff_plot = Ngl.contour(wks, diff_mask, res22)
# diff_plot = Ngl.contour(wks,w_racmo,res2) #Remapped RACMO
......
......@@ -24,8 +24,8 @@ title = "Summer 2-meter air temperature"
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_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_lnd_climo_jja = os.path.join(config['model_lnd_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_remapped = os.path.join(config['racmo_data'],
'racmo23_GRN_monthly.t2m.1980-1999.remap2cesm.JJA.nc')
......@@ -40,9 +40,9 @@ def make_plot(config, out_path='.'):
lat = ncid0.variables['lat'][0, :, :]
lon = ncid0.variables['lon'][0, :, :]
# read f_cesm_atm_climo_jja and file2, CESM variable
ncid1 = Dataset(f_cesm_atm_climo_jja)
w_cesm = ncid1.variables['TREFHT'][0, :, :]
# read f_model_atm_climo_jja and file2, CESM variable
ncid1 = Dataset(f_model_atm_climo_jja)
w_model = ncid1.variables['TREFHT'][0, :, :]
lat1 = ncid1.variables['lat'][:]
lon1 = ncid1.variables['lon'][:]
......@@ -64,17 +64,17 @@ def make_plot(config, out_path='.'):
lat22 = ncid22.variables['lat'][:]
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_l = w_racmo_l - 273.15
diff = w_cesm - w_racmo
diff = w_model - w_racmo
# locate the greenland area using the GreenLand mask
ncid8 = Dataset(f_cesm_lnd_climo_jja)
ncid8 = Dataset(f_model_lnd_climo_jja)
gris_mask = ncid8.variables['gris_mask'][0, :, :]
gris_mask = ma.masked_equal(gris_mask, 0)
# mask out non RACMO regions, icemask var in f_cesm_lnd_climo_jja
# mask out non RACMO regions, icemask var in f_model_lnd_climo_jja
diff_mask = ma.masked_array(diff, mask=gris_mask.mask)
# print np.max(diff_mask)
......@@ -198,7 +198,7 @@ def make_plot(config, out_path='.'):
usrf_plot2 = Ngl.contour(wks, racmo_elev, sres1)
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)
diff_plot = Ngl.contour(wks, diff_mask, res22)
......
......@@ -30,16 +30,16 @@ title_bx = "Surface mass balance box plot"
def make_plot(config, out_path='.'):
# ---------------- Data source in rhea, the two files save the same data ------------------------
f_cesm_lnd_ts_qice = os.path.join(config['model_lnd_climos'],
f_model_lnd_ts_qice = os.path.join(config['model_lnd_climos'],
'b.e10.BG20TRCN.f09_g16.002.clm2.aavg.h0.yrly_ai.QICE.nc')
f_racmo_ts_smb_aavg = os.path.join(config['racmo_data'], 'racmo23_GRN_monthly.smb.ann_tseries_aavg.nc')
# --------------------------------------------------------------
img_list = []
# read f_cesm_lnd_ts_qice
# read f_model_lnd_ts_qice
# time from 100-255, both time and acab have 156 data
ncid1 = Dataset(f_cesm_lnd_ts_qice, mode='r')
ncid1 = Dataset(f_model_lnd_ts_qice, mode='r')
time = ncid1.variables['time'][:]
acab = ncid1.variables['QICE'][:] # m/yr
......
......@@ -31,16 +31,16 @@ title_bx = "2-meter air temperature box plot"
def make_plot(config, out_path='.'):
# ---------------- Data source in rhea, the two files save the same data ------------------------
f_cesm_atm_ts_trefht = os.path.join(config['model_atm_climos'],
f_model_atm_ts_trefht = os.path.join(config['model_atm_climos'],
'b.e10.BG20TRCN.f09_g16.002.cam2.aavg.h0.yrly.TREFHT.nc')
f_racmo_ts_t2m_aavg = os.path.join(config['racmo_data'], 'racmo23_GRN_monthly.t2m.ann_tseries_aavg.nc')
# --------------------------------------------------------------
img_list = []
# read f_cesm_atm_ts_trefht
# read f_model_atm_ts_trefht
# time from 100-255, both time and tre have 156 data
ncid1 = Dataset(f_cesm_atm_ts_trefht, mode='r')
ncid1 = Dataset(f_model_atm_ts_trefht, mode='r')
time = ncid1.variables['time'][:]
tre = ncid1.variables['TREFHT'][:] # K
ncid1.set_auto_scale(True) # put the scale-factor in the time-series plot
......@@ -65,8 +65,8 @@ def make_plot(config, out_path='.'):
# max_t2m = (np.max(t2m))
# min_t2m = (np.min(t2m))
#
# print("Min TREFHT: {}".format(min_temp))
# print("Max TREFHT: {}".format(max_temp))
# print("Min TSA: {}".format(min_temp))
# print("Max TSA: {}".format(max_temp))
# print("Min t2m: {}".format(min_t2m))
# print("Max t2m: {}".format(max_t2m))
......
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