[ncl-talk] Fw: read and plot multiple files with different sizes

Ehsan Taghizadeh ehsantaghizadeh at yahoo.com
Wed Dec 13 09:46:13 MST 2017


 Dear DennisI really appreciate for your comments. You are right and after doing your suggestion (use the := syntax), script works correctly.
SincerelyEhsan
    On Wednesday, December 13, 2017, 3:51:46 AM GMT+3:30, Dennis Shea <shea at ucar.edu> wrote:  
 
 NCL is a strongly typed language. There are certain operations that are not allowed. 
---------------------
By default, NCL is a strongly typed language. It will not allow certain operations.

 You can use the NCL reassignment operator    :=

Consider:

float  a(10)
double b(10)
float c(30)

By default:
    a  = b     ; NCL will issue a FATAL error; it will not allow a double=> float because information may be lost
    a := b     ; NCL will truncate

    a  = c     ; FATAL ... it will not allow an array of size 30 to be reassigned to an array that is size 10
    a := c     ; NCL will overwrite

So I suggest going over your script and anyplace you this a size and or type might change ... use the := syntax.I
On Tue, Dec 12, 2017 at 3:41 PM, Ehsan Taghizadeh <ehsantaghizadeh at yahoo.com> wrote:


Hi,First I want to say thank you for your help about my previous problem. I think this committee is really fast in helping and answering.However I have another problem and I'll be thankful if I could have your help again.I want to draw SMAP (Soil Moisture Active Passive) data and I use a provided script at following link:https://www.ncl.ucar.edu/ Applications/Scripts/smap_l3_ 2.ncl
which the parent directory is:NCL Applications: HDF, HDF-EOS


| 
| 
|  | 
NCL Applications: HDF, HDF-EOS

Use of NCL to visualize datasets in HDF format.
 |

 |

 |



This script helps to draw multiple files, but after one file I got following error:      fatal:Dimension sizes on right hand side of assignment do not match dimension sizes of left hand side      fatal:["Execute.c":8640]: Execute: Error occurred at or near line 80 in file smap_l3_2.ncl
which mentioned different sizes of my files. For example for one file I have:      float latitude(281024);
and for another file I have:
      float latitude(281711);
and the error arises when the script wants to do following command:     lat2d     = f[nf]->$lat_path$also for     lon2d     = f[nf]->$lat_path$
Attachment is the script and following lines are output of printVarSummary(var):

Variable: varType: floatTotal Size: 1124096 bytes            281024 valuesNumber of Dimensions: 1Dimensions and sizes:   [DIM_000 | 281024]Coordinates:Number Of Attributes: 6  _FillValue :  -9999  coordinates : /Soil_Moisture_Retrieval_Data/ latitude /Soil_Moisture_Retrieval_Data/ longitude  long_name :   Representative soil moisture measurement for the Earth based grid cell.  units :       cm**3/cm**3  valid_max :   0.5  valid_min :   0.02(0)     Representative soil moisture measurement for the Earth based grid cell. (cm**3/cm**3) : min=0.02   max=0.85494(0)     nf=1; SMAP_L2_SM_P_E_11167_D_ 20170305T030914_R14010_001.h5fatal:Dimension sizes of left hand side and right hand side of assignment do not matchfatal:["Execute.c":8640]: Execute: Error occurred at or near line 80 in file smap_l3_2.ncl

So how could I read and plot multiple files with different sizes?
SincerelyEhsan




  
______________________________ _________________
ncl-talk mailing list
ncl-talk at ucar.edu
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/ mailman/listinfo/ncl-talk



  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20171213/fa71907d/attachment.html>


More information about the ncl-talk mailing list