[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

20040818: 20040806: Gempak - GNU/Linux Redhad Fedora Core 2 - loading multiple files in gdplot2



Ron,

After looking at the code for gdplot2, it appears that
the code in gdptms.f will work only if templates are used
and not actual file names, eg GDFILE=tmpl|cycle+tmpl2|cycle
but not your example of GDFILE=file1.gem+gdfile2.gem

I'll sending this back to NCEP for their developers to 
look at. 

Thanks,

Steve Chiswell
Unidata User Support



>From: Ron McTaggart-Cowan <address@hidden>
>Organization: SUNY Albany
>Keywords: 200408181739.i7IHdxaW023018

>
>--=-BiMY/ZUHpgUoeOZGO98Q
>Content-Type: text/plain
>Content-Transfer-Encoding: 7bit
>
>Hi Steve,
>
>Here are the attachments from the original email.
>ron
>
>
>On Wed, 2004-08-18 at 17:45, Unidata Support wrote:
>> Ron,
>> 
>> I'll see if the 5.7.3 release I'm working on exhibits the
>> same problem you are seeing. Your message had blank attatchments,
>> so if you want to send them through I'll see if its possible 
>> to integrate your changes.
>> 
>> Steve CHiswell
>> Unidata User SUpport
>> 
>> >From: "Ron McTaggart-Cowan" <address@hidden>
>> >Organization: UCAR/Unidata
>> >Keywords: 200408061203.i76C3xT5020983
>> 
>> >--=_b58f2cb4059f11c21edc02f4a2583593
>> >Content-Type: text/plain; charset="ISO-8859-1"
>> >Content-Transfer-Encoding: 7bit
>> >
>> >Institution: SUNY Albany
>> >Package Version: 5.7.2p2
>> >Operating System: GNU/Linux Redhad Fedora Core 2
>> >Hardware Information: i686
>> >Inquiry: Hi -
>> >
>> >We're in the process of updating scripts from gdplot from gdplot2 and have 
> run
>> >  into problems when trying to load multiple input files using the standard
>> >
>> >GDFILE=file1.gem + file2.gem
>> >
>> >syntax.  Specifically, it seems like the '+' separation is not handled in g
> dpt
>> > ms.f .  We get errors that look like:
>> >
>> >[FL -1]  Cannot open file file1.gem+file2.gem.
>> >[DM -2]  File file1.gem+file2.gem cannot be opened.
>> >[GD -2]  File file1.gem+file2.gem cannot be opened.
>> >[FL -1]  Cannot open file file1.gem+file2.gem.
>> >[DM -2]  File file1.gem+file2.gem cannot be opened.
>> >[GD -2]  File file1.gem+file2.gem cannot be opened.
>> >[TG -4]  No times in input file.
>> >[TG -4]  No times in input file.
>> >[GR -20]  No times selected.
>> >Unable to process GDATTIM = 030928/0000F000
>> >
>> >when we run the minimalist mfile.scr (attachment 1).  Is it possible that t
> her
>> > e's one layer of parsing that's missing in gdptms.f?  I've attached a (ver
> y s
>> > lightly) modified version of gdptms.f (attachment 3) that seems to do the 
> job
>> >  of handling the '+' separator.  I've also attached a diff file (attachmen
> t 2
>> > ) in case that's useful for a quick check of the changes.
>> >
>> >Thanks,
>> >ron
>> >
>> >
>> >--=_b58f2cb4059f11c21edc02f4a2583593
>> >Content-Type: application/octet-stream
>> >Content-Transfer-Encoding: base64
>> >Content-Disposition: attachment; filename="mfile.scr"
>> >
>> >
>> >--=_b58f2cb4059f11c21edc02f4a2583593
>> >Content-Type: text/plain
>> >Content-Transfer-Encoding: base64
>> >Content-Disposition: attachment; filename="diff.txt"
>> >
>> >
>> >--=_b58f2cb4059f11c21edc02f4a2583593
>> >Content-Type: application/octet-stream
>> >Content-Transfer-Encoding: base64
>> >Content-Disposition: attachment; filename="gdptms-mod.f"
>> >
>> >
>> >--=_b58f2cb4059f11c21edc02f4a2583593--
>> >
>> --
>> ****************************************************************************
>> Unidata User Support                                    UCAR Unidata Program
>> (303)497-8643                                                  P.O. Box 3000
>> address@hidden                                   Boulder, CO 80307
>> ----------------------------------------------------------------------------
>> Unidata WWW Service              http://my.unidata.ucar.edu/content/support 
>> ----------------------------------------------------------------------------
>> NOTE: All email exchanges with Unidata User Support are recorded in the
>> Unidata inquiry tracking system and then made publically available
>> through the web.  If you do not want to have your interactions made
>> available in this way, you must let us know in each email you send to us.
>
>--=-BiMY/ZUHpgUoeOZGO98Q
>Content-Disposition: attachment; filename=mfile.scr
>Content-Type: text/x-ksh; name=mfile.scr; charset=
>Content-Transfer-Encoding: 7bit
>
>#!/bin/ksh
># This script was created for PLOTTING specification by plotGEM version 3.0.1
>/free1/rmctc/software/gempak/GEMPAK5.7.2p2/bin/linux.pgi/gdplot2 << EOF
>GDFILE=file1.gem + file2.gem 
>GDPFUN=TMPK+2!TMPK+1
>GLEVEL=2:
>GVCORD=HGHT
>TYPE=F/!C/
>GDATTIM=030928/0000F000
>DEVICE=XW|GEMPAK|;|C
>PROJ=STR/90.0;297.0;0.0;/|
>GAREA=33.19;-72.92;52.90;-44.28
>CLEAR=YES
>PANEL=0//1/1/PLOT
>run
>
>
>exit
>EOF
>echo SIGNAL end
>
>--=-BiMY/ZUHpgUoeOZGO98Q
>Content-Disposition: attachment; filename=diff.txt
>Content-Type: text/plain; name=diff.txt; charset=
>Content-Transfer-Encoding: 7bit
>
>--- gdptms.f.orig-multiFile    2004-08-09 20:51:07.000000000 +0100
>+++ gdptms.f   2004-08-09 21:00:08.000000000 +0100
>@@ -46,7 +46,7 @@
> C*
>       PARAMETER       ( MAXGDT = 256 )
>       PARAMETER       ( MAXTMS = LLMXGT )
>-      CHARACTER       gdt*256
>+      CHARACTER       gdt*256,file(2)*(LLMXLN),gfile*(LLMXLN)
> C*
>       CHARACTER*(*)   gdatim, gdfile, timfnd(*), cycle
> C
>@@ -139,7 +139,14 @@
> C
> C*          Get times.
> C*
>-              CALL ST_CLST ( gd(nb), '|', ' ', 2, farr, nfarr, iret )
>+              CALL ST_CLST ( gd(nb), '+', ' ', 2, file, nfarr, iret )
>+              IF ( nfarr .ge. 2 ) THEN
>+                 gfile = file(1)
>+              ELSE
>+                 gfile = gd(nb)
>+              ENDIF
>+C       
>+              CALL ST_CLST ( gfile, '|', ' ', 2, farr, nfarr, iret )
>                 gdfl = farr (1)
>                 IF  ( nfarr .eq. 2 )  THEN
>                     cyc  = farr (2)
>
>--=-BiMY/ZUHpgUoeOZGO98Q
>Content-Disposition: attachment; filename=gdptms-mod.f
>Content-Type: text/x-fortran; name=gdptms-mod.f; charset=
>Content-Transfer-Encoding: 7bit
>
>       SUBROUTINE GDPTMS ( gdatim, gdfile, cycle, maxt,
>     +                     ntimes, timfnd, iret )
>C************************************************************************
>C* GDPTMS                                                              *
>C*                                                                     *
>C* This subroutine creates an array of times for use by the subroutine *
>C* GDPLTB.  GDATIM and GDFILE may each be !-parseable input strings.   *
>C* The number of times returned, NTIMES, is determined (and limited )  *
>C* by the number of times found from the first !-entry of GDFILE.      *
>C* If other !-entries from GDFILE have fewer times, those extra time   *
>C* slots will be null.                                                 *
>C*                                                                     *
>C* GDPTMS ( GDATIM, GDFILE, CYCLE, MAXT, NTIMES, TIMFND, IRET )        
>       *
>C*                                                                     *
>C* Input parameters:                                                   *
>C*     GDATIM          CHAR*           GEMPAK date/time string         *
>C*     GDFILE          CHAR*           GEMPAK grid file name           *
>C*     CYCLE           CHAR*           Cycle reference time            *
>C*     MAXT            INTEGER         Maximum number of times allowed *
>C*                                                                     *
>C* Output parameters:                                                  *
>C*     NTIMES          INTEGER         Number of times in animation    *
>C*                                         sequence                    *
>C*     TIMFND(MAXTMS)  CHAR*           Array of times                  *
>C*     IRET            INTEGER         Return code                     *
>C*                                       0 = normal return             *
>C*                                       -1 = error in processing GDATIM*
>C*                                      -20 = no times selected         *
>C*                                      -29 = file open failure         *
>C*                                      -30 = error opening file        *
>C*                                      -31 = navigation not the same   *
>C*                                      -33 = too many files to open    *
>C*                                      -34 = more than one output file *
>C**                                                                    *
>C* Log:                                                                
>       *
>C* D.W.Plummer/NCEP    10/96   New for gdplot.                         *
>C* D.W.Plummer/NCEP     2/97   Parse gdfile; length check for GDATIM   *
>C* D.W.Plummer/NCEP     7/97   Increased MAXTMS from 50 to 500         *
>C* D.W.Plummer/NCEP     8/98   Changed calling sequence                *
>C* D.W.Plummer/NCEP     5/00   Changes for cycle processing            *
>C* T. Lee/GSC           7/00   Increased MAXTMS & array size for cycles*
>C* S. Jacobs/NCEP       5/01   Increased time string lengths           *
>C************************************************************************
>       INCLUDE         'GEMPRM.PRM'
>        INCLUDE         'gdplot.cmn'
>C*
>       PARAMETER       ( MAXGDT = 256 )
>       PARAMETER       ( MAXTMS = LLMXGT )
>       CHARACTER       gdt*256,file(2)*(LLMXLN),gfile*(LLMXLN)
>C*
>       CHARACTER*(*)   gdatim, gdfile, timfnd(*), cycle
>C
>       CHARACTER       gdatmb*128, cyc*40, gdfl*128, farr(2)*128
>       CHARACTER       timtmp(MAXTMS)*40
>       CHARACTER       substr*40
>       LOGICAL         proces, done
>       CHARACTER       gd(MAXB)*128
>        CHARACTER       sep*1, gdclst*(LLMXGT*41), cycles(LLMXGT)*40
>C*
>C-----------------------------------------------------------------------
>C
        iret = 0
>C
>       CALL ST_LSTR ( gdatim, lgda, iret )
>       IF ( lgda .gt. MAXGDT )  THEN
>           iret = -1
>           RETURN
>       END IF
>C
>       CALL ST_LCUC ( gdatim, gdt, iret )
>       CALL ST_RMBL ( gdt, gdt, lgda, iret )
>       CALL GDINST ( gdfile, '<', MAXB, .true., gd, ngd, iret )
>C
>       proces = .true.
>       ntimes = 0
>C
>       substr = ' '
>       lss = 0
>C
>C*     First fill in any '()' strings with a substring value.
>C
>       iptr = 1
>       ifound = INDEX ( gdt(iptr:), '(' )
>       ilp = ifound + iptr - 1
>       DO WHILE ( proces .and. ifound .ne. 0 )
>           irp = INDEX ( gdt(ilp:), ')' ) + ilp - 1
>           IF ( irp .le. ilp )  proces = .false.
>           IF ( irp .eq. ilp+1 )  THEN
>               IF ( lss .le. 0 )  proces = .false.
>               CALL ST_LSTR ( gdt, lgda, iret )
>               itot = lgda - ( irp - ilp - 1 ) + lss
>               IF ( itot .gt. MAXGDT )  THEN
>                   iret = -1
>                   RETURN
>               END IF
>               IF ( proces )  THEN
>                  gdt = gdt(:ilp) // substr(:lss) // gdt(irp:)
>                  iptr = ilp + lss + 1
>               END IF
>             ELSE
>               substr = gdt(ilp+1:irp-1)
>               CALL ST_LSTR ( substr, lss, iret )
>               iptr = irp + 1
>           END IF
>           ifound = INDEX ( gdt(iptr:), '(' )
>           ilp = ifound + iptr - 1
>       END DO
>C
>       DO  n = 1, maxt
>           timfnd ( n ) = ' '
>       END DO
>C
>C*     Add parentheses if user has omitted them when using a bang.
>C
>       ifndlp = INDEX ( gdt, '(' )
>       ifndbn = INDEX ( gdt, '!' )
>       IF ( ifndlp .eq. 0  .and.  ifndbn .ne. 0 )  THEN
>               CALL ST_LSTR ( gdt, lgda, iret )
>               itot = lgda + 2
>               IF ( itot .gt. MAXGDT )  THEN
>                   iret = -1
>                   RETURN
>               END IF
>               gdt = "(" // gdt(:lgda) // ")"
>       END IF
>C
>C*     For each bang, build string and send to GR_TMFL
>C
>       done = .false.
>       DO  nb = 1, MAXB
>C
>           IF ( .not. done )  THEN
>               CALL GDPBAN ( gdt, nb, MAXB, gdatmb, nbs, iret)
>               done = iret .ne. 0 .or. 
>     +                 ( nb .gt. nbs .and. nb .gt. ngd )
>           END IF
>C
>           IF ( .not. done )  THEN
>C
>C*          Get times.
>C*
>               CALL ST_CLST ( gd(nb), '+', ' ', 2, file, nfarr, iret )
>               IF ( nfarr .ge. 2 ) THEN
>                  gfile = file(1)
>               ELSE
>                  gfile = gd(nb)
>               ENDIF
>C       
>               CALL ST_CLST ( gfile, '|', ' ', 2, farr, nfarr, iret )
>                gdfl = farr (1)
>                IF  ( nfarr .eq. 2 )  THEN
>                    cyc  = farr (2)
>               ELSE
>                   IF ( cycle .eq. ' ' )  THEN
>                        sep = ';'
>                        CALL GD_GCYC ( gdfl, sep, ncyc, gdclst, iret )
>                        CALL ST_CLSL ( gdclst, sep, ' ', ncyc,
>     +                      cycles, ncyco, iret )
>                        cyc = cycles(ncyco)
>                   ELSE
>                        cyc = cycle
>                   END IF
>                END IF
>C
>                CALL GR_TMFL ( gdatmb, gdfl, cyc, MAXTMS,
>     +                        nt, timtmp, iret )
>                proces = .not. ( iret .ne. 0 .or. nt .le. 0 )
>C
>               IF ( proces )  THEN
>                   IF ( nb .eq. 1 )  ntimes = nt
>                   DO  k = 1, ntimes
>                       IF ( k .le. maxt )  THEN
>                         CALL ST_LSTR ( timfnd(k), ltf, iret )
>                         IF ( k .gt. nt )  THEN
>                           IF ( ltf .ne. 0 )  THEN
>                             timfnd(k) = timfnd(k)(:ltf) // '!'
>                             ltf = ltf + 1
>                           END IF
>                         ELSE
>                           CALL ST_LSTR ( timtmp(k), ltt, iret )
>                           IF ( ltf .ne. 0 )  THEN
>                             timfnd(k) = timfnd(k)(:ltf) // '!'
>                             ltf = ltf + 1
>                           END IF
>                           timfnd(k) = timfnd(k)(:ltf)//timtmp(k)(:ltt)
>                         END IF
>                       END IF
>                   END DO
>               ELSE
>                   done = .true.
>               END IF
>C
>           END IF
>C
>        END DO
>C
>       IF ( .not. proces .and. iret .eq. 0 )  iret = -1
>C
>       RETURN
>C
>       END
>
>--=-BiMY/ZUHpgUoeOZGO98Q--
>
--
NOTE: All email exchanges with Unidata User Support are recorded in the
Unidata inquiry tracking system and then made publicly available
through the web.  If you do not want to have your interactions made
available in this way, you must let us know in each email you send to us.