Re: Importing multiple files

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Tue Mar 11 2014 - 13:04:48 MDT

Hi Lauren,

My apologies if this has been answered already. I don't recall seeing a response.

You're right, the 0:359 subscript range should be okay. But, it's not clear to me that this is line where the error message is coming from.

This message seems garbled:

> The error message is “fatal: subscript out of range, error in subscript #0 fatal: An error occurred reading unknown Segmentation fault: 11”

Was there more text that didn't get cut-and-pasted here, like a line number?

--Mary

On Mar 6, 2014, at 9:30 PM, Lauren Jean Vargo <lvargo@unm.edu> wrote:

> Hello,
>
> I am running ncl version 6.1.2 on system Darwin Lauren-Vargos-MacBook.local 13.1.0 Darwin Kernel Version 13.1.0: Thu Jan 16 19:40:37 PST 2014; root:xnu-2422.90.20~2/RELEASE_X86_64.
>
> I am trying to import the variables ua and va across 6 different files (3 files for each variable). Each file is monthly data over 10 years (120 time steps). The files are in the directory "/Users/laurenvargo/Desktop/MPI_LGM.nc”.
>
> The original script I use does work:
>
> 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"
>
> begin
>
> fils = systemfunc("ls /Users/laurenvargo/Desktop/MPI_LGM*.nc")
> f = addfiles (fils,"r")
> ListSetType(f,"cat")
> ua = f[:]->ua
> va = f[:]->va
>
> printVarSummary (ua)
> printVarSummary (va)
>
> end
>
> Attached (output1) is the printVarSummary of ua and va with all of the time steps successfully combined (120 time steps from each file X 3 files = 360)
>
> <Output1.png>
>
>
> However, as soon as I try and edit the variables (I would like to calculate DJF values using the month_to_seasonN command and then calculate the average of all of the DJF values, and select a certain level) the script fails.
>
> Here is the script I am trying to run now:
>
> 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"
>
> begin
>
> fils = systemfunc("ls /Users/laurenvargo/Desktop/MPI_LGM*.nc")
> f = addfiles (fils,"r")
> ListSetType(f,"cat")
> ua = f[:]->ua
> va = f[:]->va
>
> u = ua(0:359,9,:,:)
> v = va(0:359,9,:,:)
>
> printVarSummary (u)
> printVarSummary (v)
>
> uMon = u
> uDJF = month_to_seasonN (uMon, (/"DJF"/))
> printVarSummary(uDJF)
>
> vMon = v
> vDJF = month_to_seasonN (vMon, (/"DJF"/))
> printVarSummary(vDJF)
>
> u_avg = dim_avg_n_Wrap(uDJF(0,:,:,:), 0)
> printVarSummary (u_avg)
>
> v_avg = dim_avg_n_Wrap(vDJF(0,:,:,:), 0)
> printVarSummary (v_avg)
>
> wks = gsn_open_wks("pdf","MRI_LGM_AVG")
>
> res = True ; plot mods desired
>
> plot = gsn_csm_streamline_map_ce(wks,u_avg(:,:),v_avg(:,:),res)
> end
>
>
> The error message is “fatal: subscript out of range, error in subscript #0 fatal: An error occurred reading unknown Segmentation fault: 11”
>
> I know that subscript #0 is time, but I don’t get why 0:359 is out of range, when the initial script successfully appears to read in all 360 time steps.
>
> Note that this exact same script does work when I am only importing one file for each variable instead of three for each.
>
> Thanks you for any help,
> Lauren
> _______________________________________________
> 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 11 13:04:59 2014

This archive was generated by hypermail 2.1.8 : Fri Mar 14 2014 - 15:08:52 MDT