#!/usr/bin/perl

$CP = '/bin/cp'; 

opendir(DIR, ".");
@FILES_TMP = grep(/^obratmos_/, readdir(DIR));
@FILES = sort(@FILES_TMP);
$i = 1; 

foreach $FILE (@FILES){

    $IMGFILE1 = $FILE;
    $IMGFILE2 = $FILE;
    
    $FILE1    = $FILE . '@stab';
    $FILE2    = $FILE . '@temp';
    $IMGFILE1 =~ s/\.nc/_stab.png/g ; 
    $IMGFILE2 =~ s/\.nc/_temp.png/g ;

    print "gpview --exch --itr 4 --wsn 2 $FILE1 \n" ;
    system ("gpview --exch --itr 4 --wsn 2 $FILE1") ;

    print "dcmodel-dclps2png.rb dcl.ps $IMGFILE1 \n" ;
    system ("./dcmodel-dclps2png.rb dcl.ps $IMGFILE1") ;

    print "gpview --exch --itr 2 --wsn 2 $FILE2 \n" ;
    system ("gpview --exch --itr 2 --wsn 2 $FILE2") ;

    print "dcmodel-dclps2png.rb dcl.ps $IMGFILE2 \n" ;
    system ("./dcmodel-dclps2png.rb dcl.ps $IMGFILE2") ;

}


