Reading from netcdf files within NCL again - with more information

From: Helen Parish <hparish_at_nyahnyahspammersnyahnyah>
Date: Fri Aug 23 2013 - 14:35:21 MDT

I am resending this message with more information as I am told it may
be difficult to know what the variables look like. I include a
printVarSummary(U), printVarSummary(PS), and printVarSummary(lat) at
the end if my question below. I am also told that Andy Mai may have
responded to my post, but I did not receive that reply for some
reason. Perhaps Andy could reply again if possible ?. Also, anyone
else who has any ideas about how to do this.

Thanks,
Helen.

I am trying to read data from 50 netcdf files. Within each of these
netcdf files there are 10 model outputs (from the CAM model). I would
like to read in the variables from only the first of the 10 outputs in
each netcdf file. I am wondering if there is a way to do this kind of
read within NCL ?. I have been using lines like these within my script
to read variables from all the files :

    do nf = 0, nfili-1

  fi = addfile (diri+fili(nf), "r")

     PS = fi->PS
     U = fi->U
     lat = fi->lat

    end do

However, this reads in all of the 10 outputs within the file.

Does anyone know how to read in just one of the 10 outputs from each
of the 50 files ?.

Thanks,
Helen.

Variable: U
Type: float
Total Size: 110592000 bytes
             27648000 values
Number of Dimensions: 4
Dimensions and sizes: [time | 10] x [lev | 50] x [lat | 192] x [lon |
288]
Coordinates:
             time: [37333.33333333334..37438.33333333334]
             lev: [0.03554912016..91942.93428213599]
             lat: [ -90.. 90]
             lon: [ 0..358.75]
Number Of Attributes: 3
   cell_methods : time: mean
   long_name : Zonal wind
   units : m/s

Variable: PS
Type: float
Total Size: 2211840 bytes
             552960 values
Number of Dimensions: 3
Dimensions and sizes: [time | 10] x [lat | 192] x [lon | 288]
Coordinates:
             time: [37333.33333333334..37438.33333333334]
             lat: [ -90.. 90]
             lon: [ 0..358.75]
Number Of Attributes: 3
   cell_methods : time: mean
   long_name : Surface pressure
   units : Pa

Variable: lat
Type: double
Total Size: 1536 bytes
             192 values
Number of Dimensions: 1
Dimensions and sizes: [lat | 192]
Coordinates:
             lat: [ -90.. 90]
Number Of Attributes: 2
   units : degrees_north
   long_name : latitude

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Aug 23 14:36:23 2013

This archive was generated by hypermail 2.1.8 : Fri Aug 30 2013 - 14:04:57 MDT