Efficient way to read ascii blocks

From: Gina Henderson <ginah_at_nyahnyahspammersnyahnyah>
Date: Wed Oct 06 2010 - 09:06:20 MDT

Hi there,

I am trying to figure out an efficient way to read in an ascii file into a
4D array without looping (as I would have done in fortran).

The ascii file contains blocks or grids of the format (/nrow, ncol/),
(/89,89/) with a header line. Each block relates to a monthly grid, where
there are 456 blocks relating to 38 years of data.

What I am trying to do is read in all blocks and assign to an array of the
shape, (/nyear, nmonth, nrow, ncol/), where (/38, 12, 89, 89/).

Is there a way to do this without looping in ncl as I realize that is not
very efficient? Before I have used onedtond for these types of problems but
am not sure if I can use this as am starting with a 2d array and also have a
header line to deal with at the top of each block.

Any suggestions would be greatly appreciated.
Thanks, Gina.

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Oct 6 09:06:25 2010

This archive was generated by hypermail 2.1.8 : Wed Oct 06 2010 - 09:53:35 MDT