[Thread Prev][Thread Next][Index]
Re: [ferret_users] Extracting currents along the coast
- To: James wang <jameswangosf@xxxxxxxxx>
- Subject: Re: [ferret_users] Extracting currents along the coast
- From: William Kessler <william.s.kessler@xxxxxxxx>
- Date: Mon, 7 Aug 2017 06:07:32 -0700
- Arc-authentication-results: i=2; mx.google.com; dkim=pass header.i=@noaa-gov.20150623.gappssmtp.com header.b=gQjraxWu; spf=pass (google.com: domain of william.s.kessler@xxxxxxxx designates 2607:f8b0:400e:c05::22f as permitted sender) smtp.mailfrom=william.s.kessler@xxxxxxxx
- Arc-authentication-results: i=1; mx.google.com; dkim=pass header.i=@noaa-gov.20150623.gappssmtp.com header.b=gQjraxWu; spf=pass (google.com: domain of william.s.kessler@xxxxxxxx designates 2607:f8b0:400e:c05::22f as permitted sender) smtp.mailfrom=william.s.kessler@xxxxxxxx
- Arc-message-signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-archive:list-help:list-post:list-id:mailing-list:precedence:to :references:message-id:content-transfer-encoding:cc:date:in-reply-to :subject:mime-version:from:arc-authentication-results :arc-message-signature:dkim-signature:arc-authentication-results; bh=JPwAXgPz92qK67AzfJTm4ULtQYEJjS5XZ8cq/uGg/to=; b=qSSx9H7bOsxI5Y4FFLB9fTSU9P06bYLIgCi/N/oif8XBFF5i/FzdBV1NJ5pF2kvilr oqP3C8NkNAAjHmjN/+TDbh/pWs8O8OLcF2LK6Aj4fCqG7OFbFhJuH51kJnub2Prd6z0d BaUDqG0tGsGnmyFdfym3QbpLqm+DyptHaTWakMqB2TbBzFbhl4yu7E1a3PnVpgjWk/tv xx8gzll+hIcurdW4NQyPLwtn2KgQ44/22qngazbGk+QA4nvXhNTWUcUTMl9jH8xIfDCN cLo3rtfoxvPC/tF81PQwjOxq54aoegCcGJLvc2CihzF+mWqCJa4glGTownBhdBgU3bXR JY6g==
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:subject:mime-version:from:dkim-signature :arc-authentication-results; bh=JPwAXgPz92qK67AzfJTm4ULtQYEJjS5XZ8cq/uGg/to=; b=EyY6ofVTysLmXuxGpib5gb0ZFyCpCOu1YI8jj0GO6UnGU3q427iw0RnDq/meYyVkG+ IbqgZEYxmUHyx1kw2nE9V9r+WLX93kiRi0NFBe431uajf1t6lepYp2a6wTj8KiCoymRJ HW5p4a4/b/KgDWeIjZHPTGdgUaNYsL4nFzkhD7esyAe1/k7Peam+JJGVV0WY7QuOwZGp YG2XfhJUvkuQDXnB55kpp4+N3ER82jsve9S/KCAcAHrcIhi5rrfYroII69zaQKGsS8Zz +60CbI4iNVPRl9piAWg/MGO/Bi1coNFGhvsHMgGRvMO5LlFnbwavWD88g8+gBoJERyAe qWZw==
- Arc-seal: i=2; a=rsa-sha256; t=1502111256; cv=pass; d=google.com; s=arc-20160816; b=SbK50245kfR1Mej/To4CoOY7Z4C3G9/TUEfIazRnw+tBGqT3c1Iz7RYgUU8XQo3tfe OR64FMjNYm/6BxDsX3Pqz6XXHwWKQD/mF/cxG6rIS33kC7pgg3YYXOu8UqgANQckrB49 018i/+dghAYHiAUatVc1Hxboy5eu+syCAcRdYuV0x6qQkfYwXtWwFr3XqA+BFMh5TRek mLxSTO+ft43FRYBwqRPqPTEi4GmCVitDJBF2qx3n0Q9sduObb+08vtFys8Ymj+P3w+1a Ck2Ye4UEvV12CXRFWiArAM7XpR5bHARLpVSFZki6CX6YHpfGjuDJhP7UunV9JhIiHrmw 8+ig==
- Arc-seal: i=1; a=rsa-sha256; t=1502111255; cv=none; d=google.com; s=arc-20160816; b=L9KUdDzqQA6vhbWTKi7savHb+yyymbmdeX7DYZJu6lkxJJIsB2ia7QXYoKVBwiww71 EE02AuppmUI4OJqmWGwCnN/oGE+3f6/TXPqAUVCyG+EGlKoruJO9JSECIQO/F0WeqiBV Peb92wb9B3Wmj+Kw1kCTkBzfSgXSBYIzVNiSegxOvRW0Of/EWfe3kyFrURJc2UwEnCQS zYJI6mtlB1Mj25MGCCPPKrrln+Gs54Gdel8jPLC+9iAJ5zIQ8DWZbkvfCOmGydYYCVYz lhkDBFiZvgrHCC5OlxGWJB/vNv50XBiRY4PB+RGSURDYldxMa+kVoyOy06+iAVDjN4Rc eEqA==
- Cc: "William S. Kessler" <William.S.Kessler@xxxxxxxx>, Ferret <ferret_users@xxxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=noaa-gov.20150623.gappssmtp.com; s=20150623; h=from:mime-version:subject:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:list-post:list-help:list-archive; bh=JPwAXgPz92qK67AzfJTm4ULtQYEJjS5XZ8cq/uGg/to=; b=sS6/Hx0S4oErfHD7PB1SIBFz/ofK5kgTlg1MtqCqI9eCURs+TWSFVXcMHjrV2BzHel Ozc/Uv13H2MiT0t520yQtXhXHcLHlBdVhQlG60YW/w19QEeKVNljMeOxRd1xV6z+Nb9Y 03kVHijDsVmRxGjzqjhhrA+z68E61KEeIYzbEh97JcVhf1zFMotDICdko56SZHBW3RYO 8LnGxEicROgJEP6WvWa9vqpM2QbkaSomxBsT2f3Jc8OpXmh9We/SaoeLOgSyZyi86DwU LeNj/8VNchfZxa31oZwqHKXOsQ415x4r9eLTsO5XfKqQj4CAZEVU3wshZwR4BDTqhwFa SGCQ==
- In-reply-to: <CAJMBgoNzZ3XduPCtiqKWfEk6V-arj-idzK262MMYyDMiqQirVQ@mail.gmail.com>
- List-archive: <https://groups.google.com/a/noaa.gov/group/ferret_users/>
- List-help: <https://support.google.com/a/noaa.gov/bin/topic.py?topic=25838>, <mailto:ferret_users+help@noaa.gov>
- List-id: <ferret_users.noaa.gov>
- List-post: <https://groups.google.com/a/noaa.gov/group/ferret_users/post>, <mailto:ferret_users@noaa.gov>
- Mailing-list: list ferret_users@xxxxxxxx; contact ferret_users+owners@xxxxxxxx
- References: <CAJMBgoNzZ3XduPCtiqKWfEk6V-arj-idzK262MMYyDMiqQirVQ@mail.gmail.com>
- Sender: owner-ferret_users@xxxxxxxx
> 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