segmentation fault

From: Susan Marshall (susan.marshall AT XXXXXX)
Date: Mon Oct 27 2003 - 14:03:03 MST


I am getting a 'segmentation fault' error when running an ncl script on
Mac OS X. The script worked correctly when run on dataproc. The script
reads in an array SST(0,:,:) which is a 180x360 array, regrids this to a
T42 array 'newgrid' using the example on the web pages.

Looking through the ncl-talk previously posted questions and answers, I
guess this error results from a memory allocation problem. What can I do
to get past this error?

An example of the script is attached.

Thank you for your help.

Susan Marshall


;=========================================;
; copied from example 'regrid_5.ncl'
;=========================================;
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/shea_util.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
begin
;=========================================;
; open original grid
;=========================================;
  in = addfile("oisst.1983.nc","r")
  orig = in->SST(0,:,:)
  printVarSummary (orig)
;=========================================;
; interpolate to new grid
;=========================================;
  newgrid = f2gsh_Wrap(orig(:,:),(/64,128/),42)
  printVarSummary (newgrid)
;=========================================;
; create plots of original and regridded data
;=========================================;
  wks = gsn_open_wks("ncgm" ,"regrid") ; open ps file
  gsn_define_colormap(wks,"gui_default") ; choose colormap
  plot = new(2, graphic)

  res = True ; plot mods desired
  res@cnFillOn = True ; turn on color
  res@gsnSpreadColors = True ; use full color map
  res@cnLinesOn = False ; no contour lines
  res@cnLineLabelsOn = False ; no line labels
  res@lbLabelAutoStride = True ; nice label bar labels

  res@gsnAddCyclic = False ; don't add cyclic point

  res@mpMinLonF = -180 ; sets min lon
  res@mpMaxLonF = 180. ; set max lon

  res@gsnDraw = False ; don't draw yet
  res@gsnFrame = False ; don't advance frame yet

  res@tiMainString = " 1 deg grid "
  plot(0) = gsn_csm_contour_map_ce(wks,orig,res)

  res@gsnAddCyclic = True ; don't add cyclic point
  res@tiMainString = "T42 Grid"
  plot(1) = gsn_csm_contour_map_ce(wks,newgrid,res)
;=========================================;
; create panel plot
;=========================================;
  gsn_panel(wks, plot,(/2,1/),False)
; system ("convert -crop 0x0 regrid.ps regrid.gif")
end

_______________________________________________
ncl-talk mailing list
ncl-talk AT ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk



This archive was generated by hypermail 2b29 : Mon Oct 27 2003 - 16:16:07 MST