[Thread Prev][Thread Next][Index]
Re: [ferret_users] Regridding the point locations data into spatial manner
Op wo 17 feb 2016 09:58:24 CET schreef Ansley:
> Of course. I typed that without testing. For a small number of
> variables such as this we can do it in two stages. Instead of the
> definition I used for temp_3y,
>
> let temp_32 = YCAT(temp[d=3], temp[d=2])
> let temp_3y = YCAT(temp_32, temp[d=1])
>
> With more than just 3 or 4 variables, this kind of logic quickly gets
> unwieldy and we would need another solution.
Even though it is basically more from the above, the following lines I
recently wrote may be of use. With it one can easily do as many
concatenation iterations as Ferret can handle.
query/ignore $1%<Usage: go concat ARRAYS FLAT_ARRAY%
! Concatenate arrays of array names to a single array.
! This is done recursively, since XCat_str() only accepts two arguments.
!
let tmp_1 = `$1[i=1]`
let num_arrays = `$1,return=isize`
repeat/range=2:`num_arrays`/name=ind ( \
def symb ind = `ind` ;\
def symb prev= `ind-1` ;\
let tmp_($ind) = XCat_str( tmp_($prev), `$1[i=($ind)]` ) ;\
)
let $2 = tmp_($ind)
Marco
--
Laboratoire des Sciences du Climat et l'Environnement (LSCE)
Tel: +33 1 6908 3876
http://www.lsce.ipsl.fr/Pisp/marco.van-hulten/
[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce /
NOAA /
OAR /
PMEL /
Ferret
Privacy Policy | Disclaimer | Accessibility Statement