[ncl-talk] fileattdef seg fault on CESM LE files

David B. Reusch dreusch at ees.nmt.edu
Tue May 26 11:37:30 MDT 2015


I seem to have found an NCL seg fault when copying global attributes 
with fileattdef from CESM Large Ensemble (LE) files.  This was part of a 
larger script I've been using to regrid for multiple years. The attached 
script just does the fileattdef step and it works on at least one of my 
other, non-CESM LE files.  I've tried it on multiple CESM LE files with 
the same results.  Copying the attributes individually works so I'm 
assuming it's related to doing all the attributes together.

This is on yellowstone with NCL 6.3.

My temporary workaround is to just comment out this step so that I can 
continue my file processing.  Since that means losing global metadata, a 
better solution/fix would be preferred.

Thanks,
Dave

-- 
Associate Research Professor of Climatology
Dept of Earth and Environmental Science
MSEC 304; 801 Leroy Place
New Mexico Tech
Socorro, NM 87801

-------------- next part --------------
begin
; --- select an input file
; try one of my files (created from original CESMLE files) (seg faults)
;  srcdir = "/glade/u/home/dbr/scratch/data/cesmle/historical/hist_adj"
;  srcfn = "tas_day_CESMLE_003_historical_1981-2000_01.nc"

; try one of the original CESMLE files (seg faults)
  srcdir = "/glade/p/cesm0005/CESM-CAM5-BGC-LE/atm/proc/tseries/daily/TREFHT"
  srcfn = "b.e11.B20TRC5CNBDRD.f09_g16.001.cam.h1.TREFHT.18500101-20051231.nc"

; try one of my old, non-CESMLE files (should and does work)
;  srcdir = "/glade/u/home/dbr/esg/cmip5_clm/clm_ant/hist_adj_diff"
;  srcfn = "tas_diff_CESM1-0_rcp85-historical_r1i1p1_xx81-xx00_01.nc"

  srcFile = srcdir+"/"+srcfn

  print("file: "+srcfn)
  src_nc = addfile(srcFile,"r")

; --- select the output file location
  ; output directory, file for new nc-file
  tgtdir = "/glade/u/home/dbr/scratch/data/cesmle/historical/hist_rg"
  tgtFile = tgtdir+"/"+srcfn
  
; uncomment selectively to print out individual attributes
;  h = src_nc at CDI
;  h = src_nc at history
;  h = src_nc at source
;  h = src_nc at Conventions
;  h = src_nc at case
;  h = src_nc at title
;  h = src_nc at logname
;  h = src_nc at host
;  h = src_nc at Version
;  h = src_nc at revision_Id
;  h = src_nc at initial_file
;  h = src_nc at topography_file
;  h = src_nc at NCO
;  h = src_nc at nco_openmp_thread_number
;  h = src_nc at CDO
;  print( h )
;  print(dimsizes( h ) )

; --- create the output file
  system("rm -f "+tgtFile)
  new_nc = addfile( tgtFile, "c" )
  setfileoption(new_nc, "DefineMode", True)

; --- try to copy attributes
  print("Copying global attributes")
  fileattdef( new_nc,src_nc )
end


More information about the ncl-talk mailing list