Dear LAS Users and Experts, I am trying to reconfigure the LAS to use GrADS as the "back end" visualization program instead of Ferret. We are running LAS on an intel machine running Redhat Linux 7.0. We have successfully installed the whole business using the RPMs provided by Zhangfan Xing. I can get it to work perfectly with a Ferret data set (the COADS Climatology) but I have been unsuccessful in getting it to display a GrADS image. Based on numerous trials and tribulations and extra statements printed to the GenericLASdebug.txt file, I have narrowed the problem down a bit. The CLC module spawns the child process that runs GrADS, but I never get to the point where it sees the command line prompt and the 2-way communication pipe is established. There's a 'select' command in the 'synch' subroutine in CLC.pm that hangs and I get 'timeout' error messages. I devised a test to see if the problem was with my GrADS executable. I wrote a small C progam called fauxgrads.c which reads in some args from the command line, writes them back out and then issues a command line prompt just like the GrADS prompt. If the user enters 'quit' at the prompt the program quits, otherwise it returns a new prompt. If I substitute my little program instead of grads, I get the same results. Plan B is to fire up GrADS with the option of executing a script immediately. I dump all the necessary commands to a script file, and then feed that file name to GrADS as I start the execution. Included in the GrADS script are the commands to set the lat/lon/lev/time constraints, display the variable, dump the image from the graphics buffer into the uniquely-named gif file in the output directory, and quit. With this technique, there is no need to establish the 2-way communication between the LAS and GrADS, because GrADS does everything it needs to do and quits all in one easy step. The problem is, the CLC module assumes this is an error and I get the "program quit unexpectedly" message and the image is not displayed. Plan C is the same as Plan B except I remove the call to the wait_for_prompt subroutine. My intent is to keep it from ever trying to 'synch' with the child process and thereby skipping over the 'program quit unexpectedly' errors and just continue with the business of displaying the image. But for some reason, this doesn't work and I get a "Not Found" error message in the display window. The error message contains the uniquely-named gif file it's trying to display, which is consistent with the filename written to the GrADS script file. If I execute GrADS with this script file outside of the LAS, the image is created without a problem and if I then hit the 'reload' button in the display window the image comes up. I suspect that the problem with Plan C is that merely omitting the call to 'synch' (actually, it's 'wait_for_prompt' which calls 'synch') is not the proper way to tell the the LAS that we don't need the 2-way command-line interface with GrADS. I have attached the chunk of perl code that I'm using -- it's basically a modification of the Grads.pl file that comes with the LAS distribution. If any of the LAS developers could take a look at the file and help me simplify it properly, I'd be most grateful. And if any of the other LAS users out there have tried this before and been able to successfully change the back-end visualization program, I'd be delighted to hear how you did it. Respectfully submitted, Jennifer P.S. My LAS URL is http://192.239.84.113:8001/las/ -- ---------------------------------------- Jennifer Miletta Adams Center for Ocean-Land-Atmosphere Studies 4041 Powder Mill Road, Suite 302 Calverton, MD 20705-3106 Phone: (301)902-1278 or (301)595-7000 Fax: (301)595-9793 Email: jma@cola.iges.org
Attachment:
custom.pl
Description: Perl program