Skip to content

Commit

Permalink
Start year fix for CO plots
Browse files Browse the repository at this point in the history
CO comparison plots are only available for the simulation years around 1980~2020.
  • Loading branch information
hsiangheleellnl authored Jul 14, 2023
1 parent dc6983e commit 724334f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion chemdyg/templates/chemdyg_noaa_co_comparison.bash
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,11 @@ e3smdataname = 'CO_SRF_'+startyear+'01_'+endyear+'12.nc'
file_in = xr.open_dataset(path+e3smdataname)
timeperiod = len(file_in['time'])
startdate = str(np.array(file_in['time'].dt.year[0]))+'-'+str(np.array(file_in['time'].dt.month[0]))+'-01'
if np.array(file_in['time'].dt.year[0]) < 1980:
startdate = str(2030)+'-'+str(np.array(file_in['time'].dt.month[0])-1)+'-01'
else:
startdate = str(np.array(file_in['time'].dt.year[0]))+'-'+str(np.array(file_in['time'].dt.month[0])-1)+'-01'
time_range_month = pd.date_range(startdate, periods=timeperiod, freq='M')
file_in['time'] = time_range_month
Expand Down

0 comments on commit 724334f

Please sign in to comment.