Changeset 442 in lmdz_wrf
- Timestamp:
- May 28, 2015, 1:20:19 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/diagnostics.py
r413 r442 12 12 import re 13 13 import nc_var_tools as ncvar 14 import datetime as dt 14 15 15 16 main = 'diagnostics.py' … … 979 980 980 981 # Transforming to a flux 981 dtimeunits = var2.getncattr('units') 982 tunits = dtimeunits.split(' ')[0] 983 984 dtime = (var2[1] - var2[0])*timeunits_seconds(tunits) 982 if depvarsp[2] != 'WRFtime': 983 dtimeunits = var2.getncattr('units') 984 tunits = dtimeunits.split(' ')[0] 985 986 dtime = (var2[1] - var2[0])*timeunits_seconds(tunits) 987 else: 988 time1 = var2[0,:] 989 time2 = var2[1,:] 990 dtdate1 = dt.datetime.strptime(time1,"%Y-%m-%d_%H:%M:%S") 991 dtdate2 = dt.datetime.strptime(time2,"%Y-%m-%d_%H:%M:%S") 992 diffdate12 = ddate2 - ddate1 993 dtime = diffdate12.total_seconds() 994 985 995 ncvar.insert_variable(ncobj, 'pr', diagout/dtime, diagoutd, diagoutvd, newnc) 986 996
Note: See TracChangeset
for help on using the changeset viewer.