[Thread Prev][Thread Next][Index]

Re: [ferret_users] Changing SST regionally and combining the regions

Hi Pearse,

You need to do this in three steps

! first apply the southern change

let sst_sth = if y lt -40 then max(sst-2.0, -1.65) else sst

! then update this for the north

let sst_sth_nth = if y gt 40 then max(sst_sth-1.6, -1.65) else sst_sth

!finally modify the equatorial region

let sst_new = if abs(y) le 40 then max(sst_sth_nth-0.7, -1.65) else sst_sth_nth

! If you have a recent version of ferret try

show var/tree ! see the variable definition tree

save/file=sst_modified.nc sst_new

! check

shade/k=1 sst_new
shade/k=1  sst_new-sst ! look at the difference


Actually, it can be done in 2 steps but no point in trying to be too cute and this is clearer.



On 03/03/15 16:21, Pearse Buchanan wrote:

Hi all,


Very new to Ferret and I need some help.


Here is my data:

yes? show data sstaC.nc

     currently SET data sets:

    2> ./sstaC.nc  (default)

name     title                             I            J          K         L

SST                                       1:64      1:56      1:12      ...


I = Longitude

J = Latitude (~3.21° grids)

K = Time (months)


I have a sea surface temperature (SST) grid that I want to alter. I want to do three things:

1.       Reduce SST north of 40N by 1.6 °C

2.       Reduce SST between 40S-40N by 0.7 °C

3.       Reduce SST south of 40S by 2.0 °C


For each of these operations I don’t want my temperature to go below -1.65C, and so I have been using the MAX function…


let sstSOUTH=max(sst[J=1:15S]-2, -1.65)

let sstMID=max(sst[J=16:41]-0.7, -1.65)

let sstNORTH=max(sst[J=42:56]-1.6, -1.65) )


This works fine. I am able to produce three separate variables: sstSOUTH, sstMID, sstNORTH. Each are modified as I like.


However, I do not know how to combine these together into the one .nc file and therefore recreate the world grid of sea surface temperatures.


I have been using:

save/file=ZC_sstemp5d.nc sstSOUTH, sstMID, sstNORTH


And the datafile looks like this:
yes? show data

     currently SET data sets:

    1> ./ZC_sstemp5d.nc  (default)

name     title                                                     I            J          K         L

SSTS     MAX(SST[J=1:15]-2,-1.65)            1:64      1:15      1:12      ...

SSTM     MAX(SST[J=16:41]-0.7,-1.65)      1:64      1:26      1:12      ...

SSTN     MAX(SST[J=42:56]-1.6,-1.65)       1:64      1:15      1:12      ...



Any advice would really really be appreciated. I’m sure it’s only a simple few commands that I’m missing.


Thanks to all,

Pearse J. Buchanan

PhD Candidate / CSIRO-UTAS Quantitative Marine Science

Institute for Marine and Antarctic Studies (IMAS)

University of Tasmania

M +61 458701672






University of Tasmania Electronic Communications Policy (December, 2014).
This email is confidential, and is for the intended recipient only. Access, disclosure, copying, distribution, or reliance on any of it by anyone outside the intended recipient organisation is prohibited and may be a criminal offence. Please delete if obtained in error and email confirmation to the sender. The views expressed in this email are not necessarily the views of the University of Tasmania, unless clearly intended otherwise.

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

Privacy Policy | Disclaimer | Accessibility Statement