write_matrix

From: cnl88 <cnl88_at_nyahnyahspammersnyahnyah>
Date: Fri Oct 21 2011 - 02:55:51 MDT

In this script below ,it read 12 lines
and I want to write the data of 12 lines
 
 that each line include 4 vars in one txt . Each varible was extacted from the one wrfoutdata.
you can seedox =0,11
I = 12 ; number of elements per variable
  K = 4 ; number of variables (1D arrays)
    p = new ( (/I,K/), typeof(PBL) )
But it can not write 12 lines in one txt and errors are below! I do not know how to write them in one file
hope for your help
thank you very much
 
;************************************************

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)

I = 12 ; number of elements per variable
  K = 4 ; number of variables (1D arrays)
    
   p = new ( (/I,K/), typeof(PBL) )
    p(x,0) = PBL
   p(x,1) = TEMP2
   p(x,2) = WSPD10
   p(x,3) = WDIR10
  fmtx = "4f12.6"
  opt = True
 
 opt@title = "PBL(m) ,TEMP2(K), WSPD10(m/s) ,WDIR10(DEGREES)"
  
  write_matrix (p,fmtx, opt )
 
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 02:56:03 2011

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