Re: ask a question when using "reshape"

From: David Brown <dbrown_at_nyahnyahspammersnyahnyah>
Date: Tue Mar 25 2014 - 16:05:11 MDT

Your version of NCL is from before the addition of the "reshape" function. Note the documentation for reshape says "available in version 6.1.0 or later". You will need to upgrade or else do the reshaping in 2 steps
using ndtooned and onedtond.
 -dave

On Mar 25, 2014, at 3:23 PM, "yjin7@masonlive.gmu.edu" <yjin7@masonlive.gmu.edu> wrote:

> Hi Everyone,
>
> When I try to transform a 3D matrix to 4D matrix, I plan to use "reshape". But even for a very short test script it always give me the wrong message.
>
> The test script is from the website https://www.ncl.ucar.edu/Document/Functions/Built-in/reshape.shtml
> ;************
> ;test for reshape
> ;*****
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/diagnostics_cam.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"
> ;******
> begin
> x= random_uniform(-100,100,(/10,20,30/))
> x2d = reshape(x,(/200,30/))
> print(x2d)
>
> end
> ;****************
>
> the error message is :
> ********************
> Copyright (C) 1995-2011 - All Rights Reserved
> University Corporation for Atmospheric Research
> NCAR Command Language Version 6.0.0-beta
> The use of this software is governed by a License Agreement.
> See http://www.ncl.ucar.edu/ for more details.
> fatal:Undefined identifier: (reshape) is undefined, can't continue
> fatal:Execute: Error occurred at or near line 10
> ***********************************
>
> ​
>
>
>
>
> ---
> Yan Jin
> Climate Dynamics Ph.D Program
> Department of Atmospheric,Oceanic and Earth Sciences
> George Mason University
> Fairfax, Virginia 22030
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Mar 25 16:05:25 2014

This archive was generated by hypermail 2.1.8 : Mon Mar 31 2014 - 11:47:09 MDT