Changeset 1436 for trunk/MESOSCALE


Ignore:
Timestamp:
May 28, 2015, 9:53:18 PM (10 years ago)
Author:
aslmd
Message:

MESOSCALE. a more versatile launch script

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MESOSCALE/LMD_MM_MARS/SIMU/DEF/MESORUN_newphys_THARSISREF/launch

    r1434 r1436  
     1#! /bin/bash
     2
    13#PBS -S  /bin/bash
    24#PBS -j  oe
     
    68#PBS -l  mem=64gb
    79#PBS -l  vmem=64gb
     10#PBS -v  step=1
     11
     12#### NB: "qsub -v step=XX launch" overrides value above
    813
    914#### PREAMBLE
     
    1116
    1217#### STEP 1
    13 cd $PBS_O_WORKDIR/gcm
    14 #
    15 year=$(more namelist.input | grep start_year | awk '{print $3}' | sed s+','+''+g)
    16 month=$(more namelist.input | grep start_month | awk '{print $3}' | sed s+','+''+g)
    17 day=$(more namelist.input | grep start_day | awk '{print $3}' | sed s+','+''+g)
    18 hour=$(more namelist.input | grep start_hour | awk '{print $3}' | sed s+','+''+g)
    19 wrf_date=${year}'-'${month}'-'${day}'_00:00:00'
    20 daygcm=$(more calendar | grep ${wrf_date} | awk '{print $2}')
    21 echo ${daygcm} | ./launch_gcm
    22 #
    23 mpirun gcm.e > log_gcm
    24 #
    25 cd $PBS_O_WORKDIR/prep
    26 echo 1 | create_readmeteo.exe
    27 readmeteo.exe < readmeteo.def
     18if [[ ${step} -le 1 ]] ; then
     19  cd $PBS_O_WORKDIR/gcm
     20  #
     21  year=$(more namelist.input | grep start_year | awk '{print $3}' | sed s+','+''+g)
     22  month=$(more namelist.input | grep start_month | awk '{print $3}' | sed s+','+''+g)
     23  day=$(more namelist.input | grep start_day | awk '{print $3}' | sed s+','+''+g)
     24  hour=$(more namelist.input | grep start_hour | awk '{print $3}' | sed s+','+''+g)
     25  wrf_date=${year}'-'${month}'-'${day}'_00:00:00'
     26  daygcm=$(more calendar | grep ${wrf_date} | awk '{print $2}')
     27  echo ${daygcm} | ./launch_gcm
     28  #
     29  mpirun gcm.e > log_gcm
     30  #
     31  cd $PBS_O_WORKDIR/prep
     32  echo 1 | create_readmeteo.exe
     33  readmeteo.exe < readmeteo.def
     34fi
    2835
    29 #### STEP 2
    30 cd $PBS_O_WORKDIR/geogrid
    31 geogrid.exe
    32 #
    33 cd $PBS_O_WORKDIR/metgrid
    34 metgrid.exe
     36##### STEP 2
     37if [[ ${step} -le 2 ]] ; then
     38  cd $PBS_O_WORKDIR/geogrid
     39  geogrid.exe
     40  #
     41  cd $PBS_O_WORKDIR/metgrid
     42  metgrid.exe
     43fi
    3544
    36 #### STEP 3
    37 cd $PBS_O_WORKDIR/
    38 real.exe
     45##### STEP 3
     46if [[ ${step} -le 3 ]] ; then
     47  cd $PBS_O_WORKDIR/
     48  real.exe
     49fi
    3950
    40 #### STEP 4
    41 rm -rf $PBS_O_WORKDIR/$PBS_JOBNAME
    42 mkdir $PBS_O_WORKDIR/$PBS_JOBNAME
    43 mv rsl.error.0000 $PBS_O_WORKDIR/$PBS_JOBNAME/real_rsl.error.0000
    44 mv rsl.out.0000 $PBS_O_WORKDIR/$PBS_JOBNAME/real_rsl.out.0000
    45 cp -rfL  $PBS_O_WORKDIR/callphys.def    $PBS_O_WORKDIR/$PBS_JOBNAME/
    46 cp -rfL  $PBS_O_WORKDIR/run.def         $PBS_O_WORKDIR/$PBS_JOBNAME/
    47 cp -rfL  $PBS_O_WORKDIR/wrf.exe         $PBS_O_WORKDIR/$PBS_JOBNAME/
    48 cp -rfL  $PBS_O_WORKDIR/namelist.input  $PBS_O_WORKDIR/$PBS_JOBNAME/
    49 cp -rfL  $PBS_O_WORKDIR/namelist.wps    $PBS_O_WORKDIR/$PBS_JOBNAME/
    50 cp -rfL  $PBS_O_WORKDIR/wrfi*           $PBS_O_WORKDIR/$PBS_JOBNAME/
    51 cp -rfL  $PBS_O_WORKDIR/wrfb*           $PBS_O_WORKDIR/$PBS_JOBNAME/
    52 cd $PBS_O_WORKDIR/$PBS_JOBNAME/
    53 ln -sf $PBS_O_WORKDIR/data_physics ./
    54 mpirun wrf.exe
    55 
    56 
     51##### STEP 4
     52if [[ ${step} -le 4 ]] ; then
     53  rm -rf $PBS_O_WORKDIR/$PBS_JOBNAME
     54  mkdir $PBS_O_WORKDIR/$PBS_JOBNAME
     55  mv rsl.error.0000 $PBS_O_WORKDIR/$PBS_JOBNAME/real_rsl.error.0000
     56  mv rsl.out.0000 $PBS_O_WORKDIR/$PBS_JOBNAME/real_rsl.out.0000
     57  cp -rfL  $PBS_O_WORKDIR/callphys.def    $PBS_O_WORKDIR/$PBS_JOBNAME/
     58  cp -rfL  $PBS_O_WORKDIR/run.def         $PBS_O_WORKDIR/$PBS_JOBNAME/
     59  cp -rfL  $PBS_O_WORKDIR/wrf.exe         $PBS_O_WORKDIR/$PBS_JOBNAME/
     60  cp -rfL  $PBS_O_WORKDIR/namelist.input  $PBS_O_WORKDIR/$PBS_JOBNAME/
     61  cp -rfL  $PBS_O_WORKDIR/namelist.wps    $PBS_O_WORKDIR/$PBS_JOBNAME/
     62  cp -rfL  $PBS_O_WORKDIR/wrfi*           $PBS_O_WORKDIR/$PBS_JOBNAME/
     63  cp -rfL  $PBS_O_WORKDIR/wrfb*          $PBS_O_WORKDIR/$PBS_JOBNAME/
     64  cd $PBS_O_WORKDIR/$PBS_JOBNAME/
     65  ln -sf $PBS_O_WORKDIR/data_physics ./
     66  mpirun wrf.exe
     67fi
Note: See TracChangeset for help on using the changeset viewer.