Re: [gembud] Fortran and gempak

Hi Jamie,

 

Another option, possibly easier, would be to create a .csh or .sh from
within FORTRAN and then do a single system command to run the .csh script.
This may reduce the I/O associated with several system commands.  Below is
an example .csh script that would run nex2img (Note: the directory locations
may not be the same for your csh and Gemenviron).

 

scriptname: /data/nex2img.csh

 

------------

#!/bin/csh

 

source /data/gempak/Gemenviron

  nex2img << NEX2IMG_EOF

  GRDAREA=28.5;-105.28;49;-88.78

  PROJ=MER

  RADDUR=20

  GFUNC=ncr

  KXKY=1612;2280

  CPYFIL=

  RADTIM=20011121/2346

  RADFRQ=

  STNFIL=nexrad.tbl

  RADMODE=PC

  LUTFIL=upc_rad24.tbl

run

 

exit

 

NEX2IMG_EOF

gpend

-------------

 

 

Regards,

Evan Lowery

 

elowery@xxxxxxxxxxxx

 

From: gembud-bounces@xxxxxxxxxxxxxxxx
[mailto:gembud-bounces@xxxxxxxxxxxxxxxx] On Behalf Of Jamie Lahowetz
Sent: Thursday, September 03, 2009 9:53 PM
To: Stonie R. Cooper
Cc: gembud@xxxxxxxxxxxxxxxx
Subject: Re: [gembud] Fortran and gempak

 

Here is my test program:
PROGRAM gempak_test
    IMPLICIT NONE
    
    !##################################################
    CHARACTER(200)      :: command
    !##################################################
    command = "nex2img"
    CALL system(command)

It seems that it gets stuck here. 

    command = "GRDAREA = 28.5;-105.28;49;-88.78"
    CALL system(command)
    
    command = "PROJ = MER"
    CALL system(command)
    
    command = "RADDUR = 20"
    CALL system(command)
    
    command = "GFUNC = ncr"
    CALL system(command)
    
    command = "KXKY = 1612;2280"
    CALL system(command)
    
    command = "CPYFIL ="
    CALL system(command)
    
    command = "RADTIM = 20011121/2346"
    CALL system(command)
    
    command = "RADFRQ ="
    CALL system(command)
    
    command = "STNFIL = nexrad.tbl"
    CALL system(command)
    
    command = "RADMODE = PC"
    CALL system(command)
    
    command = "RADFIL = /home/thor/20011121/2346.gif"
    CALL system(command)
    
    command = "LUTFIL = upc_rad24.tbl"
    CALL system(command)

    command = "list"
    CALL system(command)

    command = "run"
    CALL system(command)
    
    command = "exit"
    CALL system(command)
    
END PROGRAM gempak_test

I'm sorry to say that I cant divulge about what the main program does to
much but it requires gif images created from raw radar data received from
NCDC. Hope this helps.

On Thu, Sep 3, 2009 at 8:32 PM, Stonie R. Cooper <stonewall@xxxxxxxxxxxxx>
wrote:

Jamie - you may have to be more specific.  What does this "fortran"
program do to the gif images created from nex2img?  What is your desired
result?

Your CALL statement is probably getting stuck because the neximg has
been set for continuous loop.  If RADFRQ is set to anything other than 0
or nothing, it will attempt to repeat after the numerical value of the
assignment.

Stonie Cooper,
Planetary Data, Inc.
Prague, NE
402-663-6599


Jamie Lahowetz wrote:
> I am curious. I run nex2img to create gif images of radar scans. These
> are then ingested into a Fortran program. Does anyone know a way to do
> this directly from fortran? If I use CALL system statements the script
> gets stuck as soon as you start nex2img.
>
> --
> Jamie Ryan Lahowetz
> University of Nebraska - Lincoln
> Graduate Student - Geosciences
> 402.304.0766

> jlahowetz@xxxxxxxxx <mailto:jlahowetz@xxxxxxxxx>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> gembud mailing list
> gembud@xxxxxxxxxxxxxxxx
> For list information or to unsubscribe,  visit:
http://www.unidata.ucar.edu/mailing_lists/




-- 
Jamie Ryan Lahowetz
University of Nebraska - Lincoln
Graduate Student - Geosciences
402.304.0766
jlahowetz@xxxxxxxxx

  • 2009 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the gembud archives: