pro nee_save_lc,yrls,ff,sa_yr,sa_day,sa_time,nee_ustar,nee_cflx,nee_st,nee ;write readme.txt ; Sep 12 change directory to run in PSU ;openw,f,'/data/davis2/wwg/wcreek/output/nee/readme.txt',/get_lun openw,f,'/eddy/s2/wang/d2wwg/lcreek/output/nee/readme.txt',/get_lun printf,f,'year,julian day,time,ftime,ustar(m/s),co2 eddy flux (u mole/m2/s),storage,nee' close,f free_lun,f fname='/eddy/s2/wang/d2wwg/lcreek/output/nee/lc'+yrls+ff+'.nee' ;back up files ;Load the existing nee file ;fname='/data/davis2/wwg/wcreek/output/nee/wc'+yrls+ff+'.nee' ;fname='/davis/s1/wang/d2wwg/wcreek/output/nee/wc'+yrls+ff+'.nee' ;;cmd="load,fname,storage" ;r=execute(cmd) a1="spawn,'cp "+fname+" "+fname+".bak" a2=execute(a1) print,'Backing up old file' print,'Saving '+fname openw,f,fname,/get_lun for i=0L,len(sa_yr)-1 do BEGIN ftime=sa_day(i)+sa_time(i)/24.0 printf,f,format='(I9,i6,F6.1, 1x,e15.7,1x, 4E15.7)',sa_yr(i),sa_day(i),sa_time(i),ftime,$ nee_ustar(i), nee_cflx(i), nee_st(i),nee(i) endfor close,f free_lun,f return end