Changeset 1193 in lmdz_wrf
- Timestamp:
- Oct 17, 2016, 6:08:12 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/model_graphics.py
r1188 r1193 1058 1058 Fopers = '' 1059 1059 if db: print " computing statistics of variable:'", CFvarn, "' operation '" + \ 1060 Opers + "' ...'"1060 Opers + "' using file '" + ifilen + "...'" 1061 1061 for op in opers: 1062 1062 … … 3808 3808 op = vnop.split('_')[1] 3809 3809 values = allcompvar[vnop] 3810 VnOpS = varnoper(vn, op, op surnames)3810 VnOpS = varnoper(vn, op, opersurnames) 3811 3811 3812 3812 # Only are reprojected that files which do contain 'lon' and 'lat', … … 3839 3839 sout = sub.call('rm ' + odir+'/'+ofileop + ' >& /dev/null', shell=True) 3840 3840 3841 # List of files to re-project (first without operation) 3841 3842 ifiles = [odir+'/'+ifileorig, odir+'/'+ifileop] 3843 # List of output files after re-projection (first without operation) 3842 3844 ofiles = [odir+'/'+ofileorig, odir+'/'+ofileop] 3845 3846 print fname + '; Lluis vn:', vn,'op:',op,'VnOpS:',VnOpS 3847 print fname + '; Lluis ifiles:', ifiles 3848 print fname + '; Lluis ofiles:', ofiles 3849 3843 3850 3844 3851 for iif in range(2): … … 3853 3860 print ' ' + fname + ": operation '" + op + "' can not be " + \ 3854 3861 "reprojected due to the lack of 'lon' or 'lat' skipping it !!" 3855 print " NOTE: difference can only be computed as 'variable' " + \ 3856 "difference" 3857 print " As operating along the differences from the original" + \ 3858 " values from each model" 3862 print " NOTE: difference can only be computed as:" 3863 print " - 1st: compute variable's differences between models" 3864 print " - 2nd: Perform the operations" 3859 3865 3860 3866 # Building up resources to compute re-projected statistics … … 3892 3898 quit(-1) 3893 3899 else: 3894 values = 'lon,lat,' + config['RefProjfile'] + ':'.join(CFvardims) 3900 # Name of the variable to reproject 3901 if iif == 0: 3902 reprjvn = vn 3903 else: 3904 reprjvn = VnOpS 3905 3906 values = 'lon,lat,' + config['RefProjfile'] + ',lon,lat,' + \ 3907 reprjop + ',' + ':'.join(CFvardims) 3908 ins= 'ncvar.reproject('+values + ', ' + ifile + ', '+ reprjvn + ')' 3895 3909 try: 3896 3910 with gen.Capturing() as output: 3897 sout=ncvar.reproject(values, ifile, VnOpS) 3898 ins = 'ncvar.reproject(' + values + ', ' + ifile + ', '+ \ 3899 VnOpS + ')' 3911 sout=ncvar.reproject(values, ifile, reprjvn) 3900 3912 except: 3901 3913 print errmsg … … 3903 3915 for s1out in output: print s1out 3904 3916 quit(-1) 3917 3918 sub.call('mv reproject.nc ' + ofile, shell=True) 3905 3919 3906 3920 if debug:
Note: See TracChangeset
for help on using the changeset viewer.