ascii writewrite

From: cnl88 <cnl88_at_nyahnyahspammersnyahnyah>
Date: Fri Oct 21 2011 - 20:30:52 MDT

the script run one time it turns out 4 varibles that are constants
I run 12 times and i want to write the 12 lines in one file
each by each
but it only write the last line the ncl runs and all previous results are missing!
 
need for your help
thank you
 
 
;************************************************
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
load "/usr/local/ncl/lib/ncarg/nclscripts/wrf/WRF_contributed.ncl"
load "/usr/local/ncl/lib/ncarg/nclscripts/csm/contributed.ncl"
;************************************************
begin
big = asciiread("./nlcheng3-4chuance2.txt",(/6336,4/),"integer")
line = 6336
 yy = new((/line/),integer)
 hh = new((/line/),integer)
 nn = new((/line/),integer)
mm = new((/line/),integer)
do x =0,11
yy(x) = big(x,0)
hh(x) = big(x,1)
nn(x)= big(x,2)
mm(x) = big(x,3)

fn = "/home/nlcheng/huatu111111111/cmaq/chou/ln/METCRO2D_"+yy(x)+".nc"
              a = addfile(fn,"r")
fon = "nlcheng-result.txt"
t=hh(x)
m=mm(x)
n=nn(x)
     PBL = a->PBL(t,0,m,n)
   TEMP2= a->TEMP2(t,0,m,n)
 
  WSPD10 = a->WSPD10(t,0,m,n)
 WDIR10=a->WDIR10(t,0,m,n)
print(PBL)
 

 nvals = 12
fmtx = "%14.6f"
title = " PBL(m) TEMP2(K) WSPD10(m/s) WDIR10(DEGREES)"
vals = sprintf(fmtx,PBL) + " " + sprintf(fmtx,TEMP2) + " " + \
        sprintf(fmtx,WSPD10) + " " + sprintf(fmtx,WDIR10)
strs = new(nvals+1,string)
strs(0) = title
strs(x+1:x+1) = vals
asciiwrite("test.txt",strs)
end do
end

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk

____1.png
Received on Fri Oct 21 20:46:13 2011

This archive was generated by hypermail 2.1.8 : Mon Oct 24 2011 - 09:29:35 MDT