[ncl-install] ctrans -d xwd produces bad output

Steven G Decker decker at envsci.rutgers.edu
Tue Sep 18 13:20:59 MDT 2012


Mary,

On 09/18/2012 02:05 PM, Mary Haley wrote:
>
>
>
> On Aug 31, 2012, at 1:46 PM, Steven G Decker wrote:
>
>> Hello there,
>>
>> After a computer upgrade, I installed
>> ncl_ncarg-6.1.0-beta.Linux_RedHat_x86_64_nodap_gcc444.tar.gz which
>> seems to be the closest package to my system (My CentOS system has
>> gcc/gfortran 4.4.6)
>>
>> I immediately encountered one problem:
>>> ncargf90 -o plthovagf plthovagf.f90
>> gfortran -fPIC -fno-second-underscore -fno-range-check -O -o
>> plthovagf plthovagf.f90 -L/usr/local/ncarg/lib -L/usr/X11R6/lib64
>> -lncarg -lncarg_gks -lncarg_c -lX11 -lXext -lcairo -lXrender
>> -lfontconfig -lpixman-1 -lfreetype -lexpat -lpng -lz -lbz2
>> -lpthread /usr/bin/ld: cannot find -lexpat collect2: ld returned 1
>> exit status
>>
>> The file libexpat.so.1.5.2 exists in /lib64 on my system.  Trying
>> to set LD_LIBRARY_PATH to /lib64 had no effect, nor did manually
>> sticking -L/lib64 into the compile line.  Instead, I worked around
>> the problem with:
>>> gfortran -fPIC -fno-second-underscore -fno-range-check -O -o
>>> plthovagf plthovagf.f90 -L/usr/local/ncarg/lib -L/usr/X11R6/lib64
>>> -lncarg -lncarg_gks -lncarg_c -lX11 -lXext -lcairo -lXrender
>>> -lfontconfig -lpixman-1 -lfreetype
>
> Hi Steve,
>
> Setting LD_LIBRARY_PATH is usually for when you are running an
> executable like "ncl", and it complains that it can't find some
> libxxxx.so.1 library.
>
> When you are compiling C or Fortran code, you have to use the -L
> option on the compile line in order for it to find the appropriate
> library.
>
> That's good to know. So you just left off the -lexpat?  I'm surprised
> this worked. If I try to do this on my Mac, I get a bunch of
> undefined references.
>
>

I figured out that I had to install the devel package for expat (and 
bzip2) to eliminate the "cannot find" error.  But this did not affect my 
real problem with ctrans.


>>
>> I now have an executable that works.  (Running idt or ctrans -d X11
>> on the output gives me what I expect.)
>>
>> However, ctrans -d xwd on the output produces incorrect results.
>> I've attached a screenshot showing the difference between ctrans -d
>> X11 and ctrans -d xwd.
>
>
> Sorry nobody responded to this. Was xwd output working in V6.0.0 or
> older?
>

It did work with an older version (can't remember which).

> Admittedly, none of us are experts in "ctrans", since it is an old
> tool that we mostly keep around for viewing NCGM files. We are trying
> to get people to move away from the NCGM format, because the new
> color model won't work with NCGMS, and NCGM is an internal format to
> NCAR that is not supported by other open source tools.
>
> We recommend that people instead send their output to a PS, PDF or
> PNG file, and then use tools like "convert" from ImageMagick to
> convert to other formats. I believe "convert" supports xwd.  Can I
> ask why you need xwd files?

The xwd file was actually an intermediate step to generating a GIF 
image.  There was no particular reason for the xwd approach other than 
that's what my previous setup used.  My Fortran code was generating ncgm 
files, but I see that I can successfully generate a PDF by modifying the 
third argument to gopwk.  Generating a PNG failed:
GKS ERROR NUMBER -218 ISSUED FROM SUBROUTINE GCLRWK:
  --X driver error: invalid index into GKS workstation identifiers
(I used 9 for the third argument based on some documentation I found.)

I'll stick to the PDF output, which I can convert to PNG or GIF, but I 
am wondering if anything involving gopwk is considered archaic and that 
there is some other more modern approach to generating these files from 
Fortran.

Cheers,
Steve

>
> --Mary
>
>>
>> Can you tell me why my xwd file is not being generated correctly?
>>
>> Thanks, Steve
>>
>>
>>
>>


More information about the ncl-install mailing list