Re: Plotting Taylor Diagram

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Mon May 12 2014 - 10:33:54 MDT

As have several of your previous posts to ncl-talk,
the error message is telling you what is wrong.

===
> fatal:Assignment type mismatch, right hand side
         can't be coerced to type of left hand side

> data = new((/6,70,5/),float,-9999)
> data(0,:,:) = systemfunc("ls
-lhome/ahaque/Projects/CMIP5A/Daily/historical/CNRM-CM5/r1i1p1/pr_day_CNRM-CM5_historical_r1i1p1_18500101-200512")
+ ".nc"

[1] the "right hand side" ==> systemfunc("ls ....") is returning a variable
     of type "string"
[2] the "left hand side" ==> data is of type "float"

So "Assignment type mismatch" means that NCL can not convert
a variable of type "string" (right hand side) to
a variable of type "float" (left hand side).

===
Whenever you encounter this error message ... PLEASE ....
place a printVarSummary(...) *before* the offending line

    foo = systemfunc("ls
-lhome/ahaque/Projects/CMIP5A/Daily/historical/CNRM-CM5/r1i1p1/pr_day_CNRM-CM5_historical_r1i1p1_18500101-200512")
+ ".nc"

    printVarSummary(foo) ; examine the Type
or, since this is a scalar
    print(foo)

====

Likely what you really want is (generically) something like

    f0 =
addfile("/home/ahaque/Projects/CMIP5A/Daily/historical/CNRM-CM5/r1i1p1/pr_day_CNRM-CM5_historical_r1i1p1_18500101-200512.nc",
"r")
    data(....) = f0->X0

    f1 = addfile("....", "r")
    data(....) = f1->X1

Actually, it might be better for you to do the following.
The purpose is to make sure that X0, X1, ...
are consistent with your a priori definition of the 'data' array

    X0 = f->X0
    printVarSummary(X0) ; Examine the structure and type
    data(....) = X0

    X1 = f->X1
    printVarSummary(X1)
    data(....) = X1

etc

On 5/9/14, 4:36 PM, azizul haque wrote:
> Hi Rick,
> Thanks.
> Actualy it is not working.
> Please note I want to do plotting for gpcp daily data with sixe model data similar to attached plots(https://www.ncl.ucar.edu/Applications/Scripts/Erik_taylor_panel_Example_1.ncl). For this I started my like this mail below. And it shows following error message
> ****s: invalid option -- 'e'
> Try 'ls --help' for more information.
> fatal:Assignment type mismatch, right hand side can't be coerced to type of left hand side
> fatal:["Execute.c":8567]:Execute: Error occurred at or near line 44 in file td2.ncl****
>
> ****Script for taylor diagram***
> ;**********************************
> 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/shea_util.ncl"
> ;load "/taylor_diagram_enoble.ncl"
> ;**********************************
> begin
> ;**********************************
> type = "x11"
> plot_name = "Erik_taylor_panel_Example"
> plot_title = (/"Total Precipitation: gpcp vs. CNRM-CM5 ~C~ (21N-25N, 85W-90E)", \
> "Total Precipitation: gpcp vs. CESM1-BGC ~C~ (21N-25N, 85W-90E)", \
> "Total Precipitation: gpcp vs. HadGEM2-CC ~C~ (21N-25N, 85W-90E)", \
> "Total Precipitation: gpcp vs. MIROC-ESM ~C~ (21N-25N, 85W-90E)", \
> "Total Precipitation: gpcp vs. GFDL-ESM2M ~C~ (21N-25N, 85W-90E)", \
> "Total Precipitation: gpcp vs. NorESM1-MR ~C~ (21N-25N, 85W-90E)"/)
>
> ;**********************************
> ; Read ASCII data from several files
> ; into one big data array
> ;**********************************
> data = new((/6,70,5/),float,-9999)
> data(0,:,:) = systemfunc("ls -lhome/ahaque/Projects/CMIP5A/Daily/historical/CNRM-CM5/r1i1p1/pr_day_CNRM-CM5_historical_r1i1p1_18500101-200512") + ".nc"
> data(1,:,:) = systemfunc("ls -lhome/ahaque/Projects/CMIP5A/Daily/historical/CESM1-BGC/r1i1p1/pr_day_CESM1-BGC_historical_r1i1p1_18500101-20051231") + ".nc"
> data(2,:,:) = systemfunc("ls -lhome/ahaque/Projects/CMIP5A/Daily/historical/HadGEM2-CC/r1i1p1/pr_day_HadGEM2-CC_historical_r1i1p1_18591201-200511") + ".nc"
> data(3,:,:) = systemfunc("ls -lhome/ahaque/Projects/CMIP5A/Daily/historical/MIROC-ESM/r1i1p1/pr_day_MIROC-ESM_historical_r1i1p1_18500101-20051231") + ".nc"
> data(4,:,:) = systemfunc("ls -lhome/ahaque/Projects/CMIP5A/Daily/historical/GFDL-ESM2M/r1i1p1/pr_day_GFDL-ESM2M_historical_r1i1p1_18610101-200512") + ".nc"
> data(5,:,:) = systemfunc ("ls -lhome/ahaque/Projects/CMIP5A/Daily/historical/NorESM1-M/r1i1p1/pr_day_NorESM1-M_historical_r1i1p1_18500101-200512") + ".nc"
>
>
>
> _______________________________________________
> 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 Mon May 12 10:34:03 2014

This archive was generated by hypermail 2.1.8 : Tue May 20 2014 - 10:18:04 MDT