[ncl-talk] Help with copying array into a larger array

Laura Fowler laura at ucar.edu
Fri Jun 8 10:43:31 MDT 2018


Good morning:

I would like to copy TRMM data into a global array:

printVarSummary of my TRMM data shows:

Variable: precip
Type: float
Total Size: 2304000 bytes
            576000 values
Number of Dimensions: 2
Dimensions and sizes: [lon | 1440] x [lat | 400]
Coordinates:
            lon: [-179.875..179.875]
            lat: [-49.875..49.875]
Number Of Attributes: 5
  _FillValue : -9999.9
  units : mm
  long_name : Daily accumulated precipitation (combined microwave-IR)
estimate with gauge calibration over land
  coordinates : lat lon
  average_op_ncl : dim_avg_n over dimension(s): ncl_join


I would like to put the TRMM data (limited between the latitudes
-49.875 to 49.875 into an array between the latitudes  -89.875 to
89.875. printVarSummary of my output TRMM data shows:

Variable: data
Type: float
Total Size: 4147200 bytes
            1036800 values
Number of Dimensions: 2
Dimensions and sizes: [lon | 1440] x [lat2 | 720]
Coordinates:
            lon: [-179.875..179.875]
            lat2: [-89.875..89.875]
Number Of Attributes: 1
  _FillValue : 9.96921e+36


I tried the following. To put precip into data, I tried:
data(:,{-49.875:49.875}) = precip(:,{-49.875:49.875})
or
data(:,{lat2|-49.875:49.875}) = precip(:,{lat|-49.875:49.875})

but it is not working. The last error I get is:

fatal:syntax error: line 59 in file
global_mean.precipitation_minus_TRMM-3B42.ncl before or near lat2
data(:,{lat2


After looking at the documentation, I am not sure what I am doing wrong.

Thanks,
Laura


-- 
!-------------------------------------------------------------------------------------------------------------
Laura D. Fowler
Mesoscale and Microscale Meteorology Division (MMM)
National Center for Atmospheric Research
P.O. Box 3000, Boulder CO 80307-3000

e-mail: laura at ucar.edu
phone: 303-497-1628

!-------------------------------------------------------------------------------------------------------------


More information about the ncl-talk mailing list