Re: WRITE_TABLE

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Wed Jul 10 2013 - 21:01:46 MDT

Hi Michael,

I was getting segmentation faults the other day with write_table because I was using the wrong format statement for the data I had. I was forgetting a "%s" for some header information.

Check your format statement closely to make sure it matches the data associated with it.

--Mary

On Jul 10, 2013, at 10:28 AM, Michael Notaro <mnotaro@wisc.edu> wrote:

> I am getting a Segmentation Error when I run a script, using write_table.
> When the output file approaches 2 MB in size, it crashes. Is there any way to
> avoid this issue?
>
> Michael
>
>
>
>
>
>
>
> models=(/"cccma_cgcm3_1","cnrm_cm3","csiro_mk3_0","csiro_mk3_5","gfdl_cm2_0","giss_model_e_r","miub_echo_g","mpi_echam5","mri_cgcm2_3_2a"/)
>
> a=addfile("cumulative_wsi_late20.nc","r")
> b=addfile("cumulative_wsi_mid21_b1.nc","r")
> c=addfile("cumulative_wsi_mid21_a1b.nc","r")
> d=addfile("cumulative_wsi_mid21_a2.nc","r")
> e=addfile("cumulative_wsi_late21_b1.nc","r")
> f=addfile("cumulative_wsi_late21_a1b.nc","r")
> g=addfile("cumulative_wsi_late21_a2.nc","r")
> lat=a->lat
> lon=a->lon
>
> wsi_late20=a->avwsi ; time 7, model 9, lat 302, lon 484
> wsi_mid21_b1=b->avwsi
> wsi_mid21_a1b=c->avwsi
> wsi_mid21_a2=d->avwsi
> wsi_late21_b1=e->avwsi
> wsi_late21_a1b=f->avwsi
> wsi_late21_a2=g->avwsi
>
> do imod=0,8
> fname="cumulative_wsi_late20_"+models(imod)+".txt"
> write_table(fname,"w",[/models(imod)/],"%s")
> do i=0,301
> do j=0,483
> values=wsi_late20(:,imod,i,j)
> if (ismissing(values(0))) then
> values=-999.
> end if
> write_table(fname,"a",[/lat(i),lon(j),values(0),values(1),values(2),values(3),values(4),values(5),values(6)/],"%4.1f %6.1f %6.1f %6.1f %6.1f %6.1f %6.1f %6.1f %6.1f")
> end do
> end do
> delete(fname)
> end do
>
> _______________________________________________
> 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 Wed Jul 10 21:01:47 2013

This archive was generated by hypermail 2.1.8 : Fri Jul 12 2013 - 16:37:39 MDT