[Thread Prev][Thread Next][Index]

Re: [ferret_users] how to change the value of the variable in Ferret?



Hi Xia Changshui,

You can do that easily by using ferrets if-then logic. Try

let h_new=if (i ge 50 and i le 60 and j ge 50 and j le 60) then h + 0.5 else h

Just remember that you always need to define new variables because of ferrets "delayed" evaluation.

More details are found in the ferret documentation

http://ferret.pmel.noaa.gov/Ferret/Documentation/Users_Guide/current/Chapter3_Variables_and_Expressions.htm#_VPINDEXENTRY_519

Cheers, Ingo


Xia Changshui wrote:

Dear all,
I have a simple qusetion, I have a netcdf format file, the variable in it is H(100,100) , I want change the value H from i=50 to 60, j=50 to 60, how to achieve this?
in fortran it is very easy
for j=50,60
for i=50,60
h(i,j)=h(i,j)+5.0
enddo
enddo
but how in Ferret?
Thanks






[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement