Changeset 1371 in lmdz_wrf
- Timestamp:
- Dec 6, 2016, 11:28:51 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/model_graphics.py
r1363 r1371 119 119 fname = 'scratches' 120 120 121 if config['scratch'] == 'true':121 if gen.Str_Bool(config['scratch']): 122 122 scr = True 123 123 print warnmsg … … 134 134 else: 135 135 scr = False 136 if config['filescratch'] == 'true':136 if gen.Str_Bool(config['filescratch']): 137 137 filescr = True 138 138 print warnmsg … … 143 143 filescr = False 144 144 145 if config['figscratch'] == 'true':145 if gen.Str_Bool(config['figscratch']): 146 146 figscr = True 147 147 print warnmsg … … 152 152 figscr = False 153 153 154 if config['diffscratch'] == 'true':154 if gen.Str_Bool(config['diffscratch']): 155 155 difscr = True 156 156 print warnmsg … … 161 161 difscr = False 162 162 163 if config['figdiffscratch'] == 'true':163 if gen.Str_Bool(config['figdiffscratch']): 164 164 figdifscr = True 165 165 print warnmsg … … 170 170 figdifscr = False 171 171 172 if config['moddiffscratch'] == 'true':172 if gen.Str_Bool(config['moddiffscratch']): 173 173 moddifscr = True 174 174 print warnmsg … … 179 179 moddifscr = False 180 180 181 if config['figmoddiffscratch'] == 'true':181 if gen.Str_Bool(config['figmoddiffscratch']): 182 182 figmoddifscr = True 183 183 print warnmsg … … 188 188 figmoddifscr = False 189 189 190 if config['figallmodexpscratch'] == 'true':190 if gen.Str_Bool(config['figallmodexpscratch']): 191 191 figallmodexpscr = True 192 192 print warnmsg … … 197 197 figallmodexpscr = False 198 198 199 if config['addall'] == 'true':199 if gen.Str_Bool(config['addall']): 200 200 print warnmsg 201 201 print " " + fname + ": adding new values everywhere !!" … … 208 208 addallmodexpfigs = True 209 209 else: 210 if config['addfiles'] == 'true': 211 addfils = True 212 else: 213 addfils = False 214 215 if config['addfigures'] == 'true': 216 addfigs = True 217 else: 218 addfigs = False 219 220 if config['adddiffs'] == 'true': 221 adddiffs = True 222 else: 223 adddiffs = False 224 225 if config['adddifffigures'] == 'true': 226 adddifffigs = True 227 else: 228 adddifffigs = False 229 230 if config['addmoddiffs'] == 'true': 231 addmoddiffs = True 232 else: 233 addmoddiffs = False 234 235 if config['addmoddifffigures'] == 'true': 236 addmoddifffigs = True 237 else: 238 addmoddifffigs = False 239 240 if config['addallmodexpfigures'] == 'true': 241 addallmodexpfigs = True 242 else: 243 addallmodexpfigs = False 244 245 if config['debug'] == 'true': 246 debug = True 247 else: 248 debug = False 210 addfils = gen.Str_Bool(config['addfiles']) 211 addfigs = gen.Str_Bool(config['addfigures']) 212 adddiffs = gen.Str_Bool(config['adddiffs']) 213 adddifffigs = gen.Str_Bool(config['adddifffigures']) 214 addmoddiffs = gen.Str_Bool(config['addmoddiffs']) 215 addmoddifffigs = gen.Str_Bool(config['addmoddifffigures']) 216 addallmodexpfigs = gen.Str_Bool(config['addallmodexpfigures']) 217 218 debug = gen.Str_Bool(config['debug']) 249 219 250 220 return scr, filescr, figscr, difscr, figdifscr, moddifscr, figmoddifscr, \ … … 1013 983 lsec: longitudinal section (longitudinal value must be given, [var]@[lat]) 1014 984 pinterp: pressure interpolation (to the given $plevels) 985 smean: spatial-weighted mean values 1015 986 tmean: temporal mean values 1016 987 tstd: temporal standard deviation values … … 1270 1241 CFvarnp = vninF 1271 1242 gP = 'none' 1243 1244 elif op == 'smean': 1245 # spatial-weighted mean values 1246 noLlvdims = list(varnCFs) 1247 noLlvdims.remove('lon') 1248 noLlvdims.remove('lat') 1249 Saddvars = ':'.join(noLlvdims) 1250 if len(Saddvars) > 1: 1251 vals = 'reglonlat,lon,lat,lon,lat,' + Saddvars 1252 else: 1253 vals = 'reglonlat,lon,lat,lon,lat,None' 1254 1255 if dofile: 1256 try: 1257 with gen.Capturing() as output: 1258 ncvar.SpatialWeightedMean(vals,prevfile,vninF) 1259 except: 1260 print errmsg 1261 print 'SpatialWeightedMean('+vals+',', prevfile, ','+vninF+')' 1262 for s1out in output: print s1out 1263 quit(-1) 1264 1265 if db: 1266 for s1out in output: print s1out 1267 1268 # renaming variable 1269 ncvar.chvarname(vninF+'mean', 'SpatialWeightedMean_reglonlat.nc', \ 1270 vninF+'spaceweightmean') 1271 sout = sub.call('mv SpatialWeightedMean_reglonlat.nc '+fileon, \ 1272 shell=True) 1273 1274 # Keeping the operations 1275 pyins=pyH + "/nc_var.py -o SpatialWeightedMean -S '" + vals + \ 1276 "' -f " + prevfile + " -v " + vninF 1277 otrackf.write("\n") 1278 otrackf.write("# " + vninF + " " + Fopers + "\n") 1279 otrackf.write(pyins + "\n") 1280 1281 # removing dimension variable-dimension 'lon', 'lat' 1282 varnCFs.remove('lon') 1283 varnCFs.remove('lat') 1284 1285 varkeep.append(vninF + 'mean') 1272 1286 1273 1287 elif op == 'tmean':
Note: See TracChangeset
for help on using the changeset viewer.