**To**:**ferret_users@xxxxxxxxxxxxxxxxxxx****Subject**:**Re: subtract 2D data at specific depth****From**:**Dongxiao Zhang <dzhang@xxxxxxxxxxxxxxxxxxxx>**- Date: Mon, 21 Apr 1997 11:50:59 -0400 (EDT)
- Sender: owner-ferret_users

Hi all, I received the answer for my question from Mark. It works. Hope it helpful for all. On Apr 18, 12:17pm, Dongxiao Zhang wrote: > Ferret will subtract a 2D field from a 3D field as in > > LET temp_anomaly = temp - sst ! temp is 3D, sst is 2D > or > LET temp_anomaly = temp - temp[z=0] ! temp[Z=0] is a 2D field > > > My question is: > > Is there any way to subtract a 2D field from a 3D data only at a specific > depth level and leave the other levels not being changed? This is useful, > for example, to get rid of the Ekman component in the upper layer of > velocity field. >-- End of excerpt from Dongxiao Zhang Sure, this is very simple and there are a number of ways I can think of to do this. One way is to define a new variable with the if-then-else structure. Here is an example: LET noekmanvel = IF z EQ 0 THEN vel-ekmanvel ELSE vel where vel is the 3D (or even 4D field) and ekmanvel is the ekman velocity. There could possibly be some small problem with different grids if ekmanvel is defined on a 2D i-j grid, but this could be gotten around (I don't have an example to try this directly - I will think about it over the weekend - or Steve Hankin will come up with an answer). If ekmanvel is 3D then you could have ekmanvel be 0 everywhere but the surface and then just do a subtraction. Mark -- ------------------------------------------------------------------------------- Mark Verschell (verschell@coaps.fsu.edu) Center for Ocean and Atmospheric Prediction Studies Florida State University 2035 E. Paul Dirac Drive R.M. Johnson Bldg. - Suite 200 Tallahassee, FL 32306-3041 (904) 644-6532 (904) 644-4841 (fax) -------------------------------------------------------------------- Dongxiao Zhang Division of Meteorology and Physical Oceanography Rosenstiel School of Marine and Atmospheric Science 4600 Rickenbacker Causeway Miami, FL 33149 Phone : (305)361-4806 Fax : (305)361-4696 Office : MSC Room 309 --------------------------------------------------------------------

- Previous by thread:
**Extracting data along transects** - Next by thread:
**Net CDF to ASCII or binary**

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement