Hi Dear Ferreters, Maybe you would never meet this problem, but it has occupied me for several days. I have a model output including temperature and salinity. I want to get rid of the model long-term trend. So I use regresst.jnl to do it, but the resulting data shift away from their should-be position. Please see the attached gif file. The original data: 1> time_mean.001997.01.01.dta.nc name title I J K L TEMP Potential temperature 1:182 1:86 1:32 1:52 SALT Salinity 1:182 1:86 1:32 1:52 This is the script I am using: set region/x=100:295/y=-71:71/k=1:25/l=1:52 def sym lyear=1:52@ave def sym tyear=1945:1996 def sym llyear=1:52 go regresst ! ! For temperature ! let t2=temp-temp[l=($lyear)] ! ! Get rid of trend ! let q = t2[l=($llyear)] let p = t[gt=time,l=($llyear)] let ttt = t2[l=($llyear)]-qhat[l=($llyear)] ! ! Save data to file ! let ($tname1)=ttt save/file=($filename) ($tname1) ! ! For salinity ! let t2=salt-salt[l=($lyear)] let ($tname5)=ttt save/file=($filename)/app ($tname5) Then I get the following data: 1> ./dtrend_E1_CONTROL.nc (default) name title I J K L DTEMP TTT 1:98 1:72 1:25 1:52 DSALT TTT 1:98 1:72 1:25 1:52 The figure at upper left of regt.gif is temperature anomaly for the first layer. It is correct. The upper right figure is for the second layer and showing southwestward shift of the horizontal position. So do the lower figures. I try to figure out what is the problem in my script but I can not get it. Can anyone give me a hint? By the way, I am using FERRET ver.5.22 for SGI. Thank you very much. Haijun =============================================== Haijun Yang Department of Atmospheric and Oceanic Sciences University of Wisconsin-Madison 1225 West Dayton St. Madison, WI 53706 Phone: 608-262-1956(office) ===============================================
Attachment:
regt.gif
Description: GIF image