#!/usr/bin/perl -w use Class::Date qw(date now); use File::Path; use File::Copy; use List::Util qw(min max); use DateTime; $start_time = DateTime->now(); $region = 'greece-9km'; $lrun = '32'; chomp( $flag = $ARGV[0] ); if ( $flag =~ m/^(00|06|12|18)$/ ) { $hh = $flag; chomp( $yyyymmdd = `date +%Y%m%d` ); $yymmdd = substr( $yyyymmdd, 2, 6 ); $real_time = 1; } elsif ( $flag =~ m!^(19|20)\d\d(0[1-9]|1[012])(0[1-9]|[12][0-9]|3[01])(00|06|12|18) +$! ) { $yyyymmdd = substr( $flag, 0, 8 ); $yymmdd = substr( $yyyymmdd, 2, 6 ); $hh = substr( $flag, 8, 2 ); $real_time = 1; } $yyyymmddhh = $yyyymmdd . $hh; $Class::Date::DATE_FORMAT = "%Y%m%d%H"; $data_inici = date $yyyymmddhh. "0000"; $data_gfs = $data_inici - '6 h'; $rm_wrf_maps = $data_inici - '192 h'; $root = '/home/meteo/Build_WRF'; $gfsdir = "$root/SCRIPTS"; $wrfdir = "$root/SCRIPTS"; $gfsdat = "$root/DATA/GFS"; $wrfdat = "$root/DATA/WRF/$region"; @args = ("rm -rf $gfsdat/*"); system(@args) == 0 or warn; @args = ("rm -rf $wrfdat/*"); system(@args) == 0 or warn; @doms = ( 'europe-27km', 'greece-9km' ); foreach (@doms) { $domain = $_; $wrfmap = "$root/DATA/MAPS/$domain"; @args = ("rm -r $wrfmap/$rm_wrf_maps"); system(@args) == 0 or warn; } @args = ("$gfsdir/get_gfs_30min.pl $data_gfs"); system(@args) == 0 or warn; @args = ("$wrfdir/autorun.WRF.v3.pl $region $lrun $data_inici"); system(@args) == 0 or warn; @args = ("$wrfdir/plot.maps.v2.pl $region $lrun $data_inici"); system(@args) == 0 or warn; @args = ("touch $wrfmap/$data_inici/ready"); system(@args) == 0 or warn; #@args = ("rm -r $gfsdat/*"); #system(@args) == 0 or warn; #@args = ("rm -r $wrfdat/*"); #system(@args) == 0 or warn; print("STOP"); $end_time = DateTime->now; $elapse = $end_time - $start_time; print "Elapsed time : ".$elapse->in_units('minutes')."m\n"; exit;

In reply to Re^6: Perl script error by sellinios
in thread Perl script error by sellinios

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.