[ncl-talk] Problems with averaging over a do loop

BLIUJUS, STEVEN D CTR USAF AFMC AFLCMC/HBAW-OL steven.bliujus.3.ctr at us.af.mil
Fri Jun 5 10:15:39 MDT 2015


I am trying to take an average of a value in several files. The values are
an array. In this case the Variable is AOD which is based on Lat/Lon. I can
manually sum them and create and average, but I am trying to create a do
loop such that if I have several files (40) I can average that value. All
files have the exact same lat/lon, just the AOD value is different. I have
attached two scripts. The first one is gribtest.ncl. This script is where I
manually add the two files. The other attached is AOD.ncl. This is where I
am trying to create a do loop. I am trying to create an empty array before
the do loop called AODSum. However, when the loop executes I dies when
trying to add with the message:

fatal:Plus: Number of dimensions do not match, can't continue
fatal:["Execute.c":8128]:Execute: Error occurred at or near line 37 in file
AOD.ncl

(0)     Error: scalar_field: If the input data is 1-dimensional, you must
set sfXArray and sfYArray to 1-dimensional arrays of the same length.
warning:create: Bad HLU id passed to create, ignoring it

I created the array with two dimensions so I am not sure why it is failing.
The two files are much too large to send via email, so if those need to be
viewed I'd have to send them another way. Here is all the variable summaries
though:

Variable: LAT
Type: float
Total Size: 2888 bytes
            722 values
Number of Dimensions: 1
Dimensions and sizes:   [g0_lat_1 | 722]
Coordinates:
            g0_lat_1: [-90..90]
Number Of Attributes: 9
  long_name :   latitude
  GridType :    Cylindrical Equidistant Projection Grid
  units :       degrees_north
  Dj :  0.5
  Di :  0.5006954
  Lo2 : 360
  La2 : 90
  Lo1 :  0
  La1 : -90

Variable: LON
Type: float
Total Size: 5760 bytes
            1440 values
Number of Dimensions: 1
Dimensions and sizes:   [g0_lon_2 | 1440]
Coordinates:
            g0_lon_2: [ 0..360]
Number Of Attributes: 9
  long_name :   longitude
  GridType :    Cylindrical Equidistant Projection Grid
  units :       degrees_east
  Dj :  0.5
  Di :  0.5006954
  Lo2 : 360
  La2 : 90
  Lo1 :  0
  La1 : -90

Variable: AODSum
Type: float
Total Size: 8 bytes
            2 values
Number of Dimensions: 1
Dimensions and sizes:   [2]
Coordinates:
Number Of Attributes: 1
  _FillValue :  9.96921e+36

Variable: AODVIS
Type: float
Total Size: 1039680 bytes
            259920 values
Number of Dimensions: 2
Dimensions and sizes:   [g0_lat_1 | 361] x [g0_lon_2 | 720]
Coordinates:
            g0_lat_1: [-90..90]
            g0_lon_2: [ 0..360]
Number Of Attributes: 15
  LON : <ARRAY of 1440 elements>
  LAT : <ARRAY of 722 elements>
  sub_center :  Ocean Prediction Center
  center :      U.S. Air Force - Global Weather Center
  long_name :   Unknown Variable Name
  units :       unknown
  _FillValue :  1e+20
  level_indicator :     200
  gds_grid_type :       0
  parameter_table_version :     129
  parameter_number :    147
  level :       0
  forecast_time :       0
  forecast_time_units : hours
  initial_time :        07/20/2010 (00:00)

Steven Bliujus, Contractor
SEMS/16WS WXE
557th Weather Wing
DNS: 232-7151

-------------- next part --------------
A non-text attachment was scrubbed...
Name: AOD.ncl
Type: application/octet-stream
Size: 1862 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150605/f3df3418/attachment.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gribtest.ncl
Type: application/octet-stream
Size: 1673 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150605/f3df3418/attachment-0001.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5647 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150605/f3df3418/attachment.bin 


More information about the ncl-talk mailing list