[Thread Prev][Thread Next][Index]
[ferret_users] loop/i=1:n ( compute(i) & save netCDF(i) )
Hello all,
I don't understand Ferret variables/arrays well enough.
Basically, I'd like to compute the horizontal distributions
of potential vorticity (PV) on a series of isotherms and save
the result as a 3D array in the form of pv_iso(x,y,theta),
where theta = 4, 5, 6, . . . (degC) are temperature values.
(Suppose that I already have 3D distributions of temperature
and PV in an netCDF file.)
I know how to compute the isothermal distribution of PV
for a single isotherm:
let iso = temp[z=@weq:4] !! 4 degC isotherm
let int = iso * pv
let pv_iso = int[z=@sum]
What I'm trying to achieve is 1) to loop over
different temperature values and 2) to gather the results
in a single array and save it in another netCDF file.
In a pseudo-Ferret-Fortran script, what I want to do is
n = 15 !! # of isotherms
theta = [(4 + i, i = 1, n)] !! theta = {4, 5, 6, . . .}
set data mydata.nc
do i = 1, n
go one_isotherm(i)
end do
subroutine one_isotherm(i)
iso = temp[z=@weq:theta(i)] !! the i-th isotherm
int = iso * pv
pv_iso = int[z=@sum]
save/file=result.nc/append/klimits=1:n/k=i pv_iso
end subroutine
I read the "Example 4: multiple slabs" part of
"Ch10 Sec2. SIMPLE CONVERSIONS USING FERRET" in the Ferret manual,
but I couldn't figure out how to loop over isotherms.
Thank you,
Ryo
[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce /
NOAA /
OAR /
PMEL /
TMAP
Privacy Policy | Disclaimer | Accessibility Statement