Re: line integration

From: Bithi De <bde_at_nyahnyahspammersnyahnyah>
Date: Tue Aug 13 2013 - 14:07:28 MDT

Hi,
Thanks Dennis for the reply.
Let me explain my question clearly.

* I have rectilinear grid.
* I have U-component and V-component at each grid point , with print
variable summary like this: (where 12= no. of months and 32= no. of
years)

Variable: Qvv
Type: float
Total Size: 16146432 bytes
            4036608 values
Number of Dimensions: 4
Dimensions and sizes: [12] x [32] x [lon | 144] x [lat | 73]
Coordinates:
            lon: [ 0..357.5]
            lat: [90..-90]
Number Of Attributes: 1
  _FillValue : 9.96921e+36
        

Variable: Quu
Type: float
Total Size: 16146432 bytes
            4036608 values
Number of Dimensions: 4
Dimensions and sizes: [12] x [32] x [lon | 144] x [lat | 73]
Coordinates:
            lon: [ 0..357.5]
            lat: [90..-90]
Number Of Attributes: 1
  _FillValue : 9.96921e+36
        

* I want to calculate line integration along the east, west boundary
of an area for u component and line integration along the south and
north boundary of an area for v component.
I tried like the following:

  re = 6.37122e06
   rad = 4.0* atan(1.0) / 180.0
   con = re * rad
   clat = cos(lat * rad) ; cosine of latitude

   dlon = (lon(2) - lon(1))
    dlat = (lat(2) - lat(1))
   dx = con * dlon * clat ; dx at each latitude
   dy = con * dlat ; dy is constant

   dx1 = conform(Quu,dx,3)
   dx1!3 = "lat"
   dx1!2 = "lon"
   dx1&lat = lat
   dx1&lon = lon
   printVarSummary(dx1)
   printVarSummary(dy)

  ;***********************************************************************************
  ; transport across the boundary of the region
  ;***********************************************************************************

  Qu1 = Quu(:,:,{270},{60:80}) ;quu component value across east
boundary at longitude 270
  printVarSummary (Qu1)

  Qu2 = Quu(:,:,{357},{60:80}) ;quu component value across west
boundary at longitude 357.5
  printVarSummary (Qu2)

   Qv1 = Qvv(:,:,{270:357},{60}) ;Qvv component across
south boundary at latitude 60
  Qv2 = Qvv(:,:,{270:357},{80}) ;Qvv component across
north boundary at latitude 80
  printVarSummary (Qv1)

  printVarSummary (Qv2)

  dx_1=dx1(:,:,{270:357},{60})
  dx_2=dx1(:,:,{270:357},{80})
  printVarSummary (dx_1)
  printVarSummary (dx_2)
           
   L = sum((Qv1*dx_1)+Qu2*dy+(Qv2*dx_2)+Qu1*dy)

For calculating L, I am getting an error like this:
fatal:Plus: Dimension size, for dimension number 2, of operands does
not match, can't continue

Did I calculate dx and dy in wrong way? What should be the right approach?
Thanks for your time.
Bithi

On 8/12/13, Dennis Shea <shea@ucar.edu> wrote:
> Hi Bithi,
>
> This is offline. Respond to ncl-talk@ucar.edu only
>
> I hesitate to answer because I am very busy and I do
> not have a lot of time to answer ncl-talk questions.
>
> What type of grid do you have? rectilinear or curvilinear?
>
> What have *you* tried? We at ncl-talk sometimes feel people
> want us to write the code for them. We do not have the time.
>
>
>
> <= left
>
> + + + + 60
>
> + + 50
> |
> down + + lat up 40
>
> + + 30
>
> + + + + 20
>
> lon =>
>
> 130 140 150 160
>
> You have U and V at each grid point. Usually, you must go
> counter clockwise around for the circulation theorm.
>
> U(time,lat,lon), V(time,lat,lon)
>
> Here is a crude approach for a rectilinear grid.
>
>
> C = sum( U(:,{20},{130:160})*dx({20}) \
> +V(:,{20:60},{160}) *dy) \
> +U(:,{60},{130:160})*dx(60) \
> +V(:,{20:60},{130}) +dy )
>
> C(ntim)
>
>
> Please ask your advisor or a colleague.
>
>
> On 8/9/13 6:02 PM, Bithi De wrote:
>> Hi All,
>> Is it possible to calculate line integration using NCL? I need to
>> calculate line integration along each boundary of an area.
>>
>> Thanks .
>> Bithi
>>
>

-- 
Bithi De
Graduate Student , Research Assistant
International Arctic Research Center , University of Alaska Fairbanks
Fairbanks , Alaska -99775
USA
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Aug 13 14:07:37 2013

This archive was generated by hypermail 2.1.8 : Wed Aug 14 2013 - 18:35:09 MDT