|
1 | 1 | # flake8: noqa |
2 | | -#!/usr/bin/env cdat |
| 2 | +#!/usr/bin/env cda |
3 | 3 | """ |
4 | 4 | This script takes an observational dataset that contains monthly data |
5 | 5 | and creates the appropriate climo files. Aspects of this code have been taken |
|
24 | 24 | Modified by Jill Zhang ([email protected]) 08-15-2018 |
25 | 25 | """ |
26 | 26 |
|
27 | | -# Upload the following libraries to call in this script |
| 27 | +# Upload the following libraries to call in this scrip |
28 | 28 | import argparse |
29 | 29 | import code |
30 | 30 | import datetime |
31 | 31 | import gc |
32 | 32 | import glob |
33 | | -import inspect |
| 33 | +import inspec |
34 | 34 | import os |
35 | 35 | import re |
36 | 36 | import string |
|
67 | 67 | output_hostpath="/p/user_pub/e3sm/zhang40/analysis_data_e3sm_diags/"+data_name+"/climatology/" #location to save climatology files |
68 | 68 | if data_name =='GPCP': |
69 | 69 | rootname='GPCP_v2.3' #name of the climo files |
70 | | - startyear='1979' #start year of the dataset |
| 70 | + startyear='1979' #start year of the datase |
71 | 71 | startmonth='01' #start month of the dataset, typically 01 |
72 | | - endyear='2017' #end year of the dataset |
| 72 | + endyear='2017' #end year of the datase |
73 | 73 | endmonth='12' #end month of the dataset, typically 12 |
74 | 74 |
|
75 | 75 | if data_name =='GPCP_v2.2': |
76 | 76 | rootname='GPCP_v2.2' #name of the climo files |
77 | | - startyear='1979' #start year of the dataset |
| 77 | + startyear='1979' #start year of the datase |
78 | 78 | startmonth='01' #start month of the dataset, typically 01 |
79 | | - endyear='2014' #end year of the dataset |
| 79 | + endyear='2014' #end year of the datase |
80 | 80 | endmonth='12' #end month of the dataset, typically 12 |
81 | 81 |
|
82 | 82 | #^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ |
|
150 | 150 | f_in=cdm.open(input_hostANDfilename) |
151 | 151 | varlist=f_in.listvariables() |
152 | 152 |
|
153 | | -print varlist |
| 153 | +print varlis |
154 | 154 | print f_in.listdimension() |
155 | 155 |
|
156 | 156 | ignore_variables=['bounds_lat','bounds_time','bounds_lon','bnds_lat','bnds_time','bnds_lon','date','lon_bnds','lat_bnds','time_bnds'] #variables to ignore when making climatology means |
|
176 | 176 | outputdattable=eval(".".join(['cdu',fi,'climatology(dattable, criteriaarg = [0.99,None])'])) #only full DJF ranges are included in the calculation |
177 | 177 | outputdattable.cell_methods="time: mean over years" |
178 | 178 |
|
179 | | - #specify the time axis long_name and the units - uses the startyear-1-1 as the starting point |
| 179 | + #specify the time axis long_name and the units - uses the startyear-1-1 as the starting poin |
180 | 180 | time_axis=outputdattable.getAxis(0) |
181 | 181 | time_axis.climatology="climatology_bnds" |
182 | 182 | time_axis.long_name="time" |
|
0 commit comments