<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">Hi Alan and Dennis,<br>
      <br>
      This works. Thanks<br>
      Agnes<br>
      <br>
      On 3/18/15 10:44 AM, Dennis Shea wrote:<br>
    </div>
    <blockquote
cite="mid:CAOF1d_6L6ARd2Pbx+Mt1RDkNcuFjkb9ZVbop2equezDXuZ=97Q@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div>
          <div>
            <div>
              <div>
                <div>
                  <div>
                    <div>variable: nr2pgbq_T<br>
                      Type: float<br>
                      Total Size: 107976960 bytes<br>
                                   26994240 values<br>
                      Number of Dimensions: 3<br>
                      Dimensions and sizes:    [lv_ISBL3 | 26] x [lat |
                      721] x [lon | 1440]<br>
                      Coordinates:<br>
                                   lat: [-90..90]<br>
                                   lon: [-179.75..180]   &lt;=====<br>
                      +++++<br>
                      Variable: anal_pgbq_T<br>
                      Type: float<br>
                      Total Size: 107976960 bytes<br>
                                   26994240 values<br>
                      Number of Dimensions: 3<br>
                      Dimensions and sizes:    [lv_ISBL3 | 26] x
                      [g0_lat_0 | 721] x [g0_lon_1<br>
                      | 1440]<br>
                      Coordinates:<br>
                                   lv_ISBL3: [10..1000]<br>
                                   g0_lat_0: [-90..90]<br>
                                   g0_lon_1: [ 0..359.75] &lt;=========<br>
                      +++++<br>
                    </div>
                    <div>Assuming the levels are the same ... (no level
                      coord variable for anal_pgbq_T)</div>
                    <div><br>
                    </div>
                    anal_pgbq_T = lonFlip(anal_pgbq_T)<br>
                  </div>
                  printVarSummary(anal_pgbq_T)    ; look at lon coord
                  variable<br>
                  <br>
                </div>
                diff = nr2pgbq_T - anal_pgbq_T<br>
              </div>
              diff@long_name = "Difference T"<br>
            </div>
            dif@units = anal_pgbq_T@units<br>
          </div>
          copy_VarCoords(anal_pgbq_T, diff)<br>
        </div>
        printVarSummary(diff)<br>
        <br>
        <br>
        <div>
          <div>
            <div>
              <div>
                <div>
                  <div>
                    <br>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">On Wed, Mar 18, 2015 at 9:29 AM, Agnes
          Lim Huei Ni <span dir="ltr">&lt;<a moz-do-not-send="true"
              href="mailto:alim@ssec.wisc.edu" target="_blank">alim@ssec.wisc.edu</a>&gt;</span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
            <br>
            <br>
            I have two arrays which I would like to take the difference.
            But looks<br>
            like i need to do some reordering before i can subtract
            them.<br>
            <br>
            Variable: nr2pgbq_T<br>
            Type: float<br>
            Total Size: 107976960 bytes<br>
                         26994240 values<br>
            Number of Dimensions: 3<br>
            Dimensions and sizes:    [lv_ISBL3 | 26] x [lat | 721] x
            [lon | 1440]<br>
            Coordinates:<br>
                         lat: [-90..90]<br>
                         lon: [-179.75..180]<br>
            Number Of Attributes: 1<br>
               _FillValue :    1e+15<br>
            <br>
            Variable: anal_pgbq_T<br>
            Type: float<br>
            Total Size: 107976960 bytes<br>
                         26994240 values<br>
            Number of Dimensions: 3<br>
            Dimensions and sizes:    [lv_ISBL3 | 26] x [g0_lat_0 | 721]
            x [g0_lon_1<br>
            | 1440]<br>
            Coordinates:<br>
                         lv_ISBL3: [10..1000]<br>
                         g0_lat_0: [-90..90]<br>
                         g0_lon_1: [ 0..359.75]<br>
            Number Of Attributes: 12<br>
               center :    US National Weather Service - NCEP (WMC)<br>
               long_name :    Temperature<br>
               units :    K<br>
               _FillValue :    1e+20<br>
               level_indicator :    100<br>
               gds_grid_type :    0<br>
               parameter_table_version :    2<br>
               parameter_number :    11<br>
               model :    Spectral Statistical Interpolation (SSI)
            analysis from<br>
            "Final" run.<br>
               forecast_time :    0<br>
               forecast_time_units :    hours<br>
               initial_time :    04/12/2006 (18:00)<br>
            <br>
            The following is a code segment that I have used.<br>
            <br>
              anal_pgbq_T=anal_pgbq-&gt;TMP_GDS0_ISBL_10<br>
                     lat=guess_pgbq-&gt;g0_lat_0<br>
                     lon=guess_pgbq-&gt;g0_lon_1<br>
            <br>
                     nr2pgbq_T=nr2pgbq-&gt;regrid_int_nr_T<br>
                     anal_pgbq_T=anal_pgbq_T(:,::-1,::-1)<br>
                     anal_pgbq_T!1="lat"<br>
                     anal_pgbq_T!2="lon"<br>
            <br>
                     dim=dimsizes(lon)<br>
                     do i=1, dim(0)-1<br>
                        if(lon(i) .gt. 180.0) then<br>
                          lon(i)=lon(i)-360<br>
                        end if<br>
                     end do<br>
                     lon_1=new((/dim(0)/), "float")<br>
                     lon_1(0:718)=lon(721:1439)<br>
                     lon_1(719:1439)=lon(0:720)<br>
                     delete(dim)<br>
            <br>
                     anal_pgbq_T&amp;lon=lon_1<br>
            <br>
                     printVarSummary(nr2pgbq_T)<br>
                     printVarSummary(anal_pgbq_T)<br>
            <br>
            I am seeing regions of much larger difference than I
            expected, does<br>
            checking if I reorder my data incorrectly before
            subtracting.<br>
            <br>
            Thanks<br>
            Agnes<br>
            <br>
            <br>
            _______________________________________________<br>
            ncl-talk mailing list<br>
            List instructions, subscriber options, unsubscribe:<br>
            <a moz-do-not-send="true"
              href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk"
              target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
          </blockquote>
        </div>
        <br>
      </div>
    </blockquote>
    <br>
  </body>
</html>