[Thread Prev][Thread Next][Index]

Re: [ferret_users] Extracting currents along the coast



> On Aug 7, 2017, at 4:01 AM, James wang <jameswangosf@xxxxxxxxx> wrote:
> 
> Hi All,
> 
> I want to extract the alongshore and offshore velocity components along the tilted coast of my study region as shown in figure. I have the U and V velocity data with me. I would be grateful if anybody can suggest me the procedure or how this can be done.
> <Alongshore.gif>

This is a hard thing to do for two reasons:

- The coast is steppy (it has both north and east-facing points). You can follow distance along the coastline, but that will not be on either a latitude or longitude axis.
- Since the coast angle changes on each step, "alongshore flow" following the coastal steps is probably not what you want. For example, if the flow were purely northward, the steps would give alternating positive and zero values.

If you consider only the eastward-pointing cell faces, alongshore flow will still show the steps because the field you extract will not be continuous when the coast longitude changes.

Also be careful that the fields make sense near the coast. Is this ocean currents in a model? In that case the model boundary conditions will prevent flow into the coast, but this means carefully taking account of the model grid structure (C-grid? B-grid?). If this is data interpolated onto a grid in some way (e.g. u_g from Argo geostrophy), there may be apparent flow into the coast. 

Another issue is whether you want the true coastal flow (small in your figure), or some kind of average over a range "near" the coast.

One way I've done this is to find the angle of the coast (effectively smoothing the steps) and the angle of the wind.

Schematically, if your field of flow is variables U,V (an example to be modified):

1) Extrapolate U,V to the west: uext=u[i=1:ii@fnr];vext=v[i=1:ii@fnr]   ! first CAN AXIS/MOD on your x-axis!!! Else it will wrap!!!
(ii is the number of gridpoints in x)

2) Sample the above at the westmost gridpoint: ucoast=uext[i=1]
The result of this is (u,v) from the east-facing gridpoints at their westernmost points
(If you want a near-coastal range, say an average over 200km offshore, first use @SBX in defining uext,vext above)

3) Find the angle of these "coastal" winds. Due E = 0 degrees. N=+90. S = -90. W=+/-180
let phi1=atan(vext/uext)
let phi2 = if uext lt 0 then phi1+pi else phi1
let phi=if phi2 gt pi then phi2-2*pi else phi2

4) Find the slope of the coast
! First find the westernmost grid cell as done for the wind above
let xx=x[gx=u]
let xxx=if u ne `u,return=bad` then xx
let xcoast1=xxx[i=1:ii@fnr]
let xcoast=xcoast1[i=1]

let deg=111198.6
let slopeca=1/(deg*xcoast[y=@ddc])    ! will be infinite when coast is N-S
let slopec=if abs(slopeca) le 2 then slopeca else 1e10   ! blank for N-S coast

let thet1=atan(slopec)
let thet2=if slopec lt 0 then thet1+pi else thet1
let thet=if thet2 gt pi then thet2-2*pi else thet2

5) find the angle of the wind relative to the coast
let angdf=phi-thet
let cosdf=cos(angdf)
let sindf=sin(angdf)
let costhet=cos(thet)
let sinthet=sin(thet)

6) Find the alongshore and offshore components
let speed = (u^2 + v^2)^.5

! make longshore and offshore vector components
let talong=speed*cosdf
let toff=speed*sindf

! make the x and y components of the alongshore and offshore winds (for plotting vectors)
let talongx=speed*cosdf*costhet
let talongy=speed*cosdf*sinthet
let toffx=(-1)*speed*sindf*sinthet
let toffy=speed*sindf*costhet

The code snippets above are pasted from old scripts. No guarantee!

BK


[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement