Importing multiple files

From: Lauren Jean Vargo <lvargo_at_nyahnyahspammersnyahnyah>
Date: Thu Mar 06 2014 - 21:30:23 MST

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)

[cid:EBC28233-37EE-4327-88C0-47F92E0EF467@Belkin]

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

Output1.png
Received on Thu Mar 6 21:30:50 2014

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