Changeset 2068 in lmdz_wrf


Ignore:
Timestamp:
Aug 10, 2018, 4:13:18 PM (7 years ago)
Author:
lfita
Message:

Adding use of a congfigure file

Location:
trunk/tools
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/get_data_snd-sfc_validation.bash

    r2067 r2068  
    22### Script to get sounding and surface points for validation purposes
    33
    4 scratch='false'
    5 
    6 # Input folder
    7 infolder='/ccc/scratch/cont003/lmd/fitaborl/estudios/FPS_ALPS/additional/IOP'
    8 
    9 # Domain
    10 domn='02'
    11 
    12 # Output folder
    13 ofolder='/ccc/scratch/cont003/lmd/fitaborl/estudios/FPS_ALPS/additional/IOP/validation'
    14 
    15 # Labels of the experiments
    16 experiments='120lev:80lev:50lev:50lev_assigned:38lev:NOaerosol'
    17 
    18 # Sounding stations [sndid],[sndlon],[sndlat]:[sndid2],[sndlon2],[sndlat2]:...
    19 sndstations='10868,11.55,48.25:16080,9.28,45.43:16144,11.61,44.65:16546,8.85,39.35'
    20 
    21 # Surface stations [sfcid],[sfclon],[sfclat]:[sfcid2],[sfclon2],[sfclat2]:...
    22 sfcstations='None'
    23 
    24 # Sounding diagnostics
    25 snddiags='WRFt:WRFtda:WRFp:WRFua:WRFva:ws:WRFwd'
    26 
    27 # Surface diagnostics
    28 sfcdiags='wds:wss:WRFtdas:pr'
    29 
    30 # Surface NON-diag variables
    31 sfcnondiags='T2'
    32 
    33 # cdx Surface diagnostics
    34 cdxdiags='None'
    35 
    36 # cdx Surface NON-diag variables
    37 cdxnondiags='PR:PRW:PSL:UAS:VAS:CAPEMAX:CAPEMEAN:CINMAX:CINMEAN:LFCPMAX:LFCPMEAN:LFCZMAX:LFCZMEAN:LIMAX:LIMEAN'
     4#   soundings: different lon,lat locations of soundings stations
     5#   surface: different lon,lat locations of surface stations
     6#   simulations: multiple outputs from different models and runs
     7#   outputs: multiple different type of file outputs from model runs
     8#
     9
     10# Name of the file with the configuration
     11if test $1 = '-h'; then
     12  echo "******************************************"
     13  echo "***     Script to get WRF data at     ***"
     14  echo "*** sounding and surface observations ***"
     15  echo "***     from multiple simulations     ***"
     16  echo "*****************************************"
     17  echo "get_data_snd-sfc_validation [ConfFile](configuration file)"
     18else
     19  rootsh=`pwd`
     20
     21  configfname=$1
     22
     23####### ###### ##### #### ### ## #
     24
     25function uploadvars() {
     26# Function to upload variables to the system from an ASCII file as:
     27#   [varname] = [value]
     28  fileval=$1
     29  errormsg='ERROR -- error -- ERROR -- error'
     30
     31  if test ! -f ${fileval}; then
     32    echo ${errormsg}
     33    echo "  "${fname}": file '"${fileval}"' does not exist!!"
     34    exit
     35  fi
     36
     37  Nlin=`wc -l ${fileval} | awk '{print $1}'`
     38
     39  ilin=1
     40  while test ${ilin} -le ${Nlin}; do
     41    line=`head -n ${ilin} ${fileval} | tail -n 1`
     42    varname=`echo ${line} | tr '=' ' ' | awk '{print $1}'`
     43    value=`echo ${line} | tr '=' ' ' | awk '{print $2}'`
     44    Lvarname=`expr length ${varname}'0'`
     45
     46    if test ${Lvarname} -gt 1 && test ! ${varname:0:1} = '#'; then
     47      export ${varname}=${value}
     48    fi
     49    ilin=`expr ${ilin} + 1`
     50  done 
     51}
    3852
    3953#######    #######
    4054## MAIN
    4155    #######
     56uploadvars ${configfname}
     57echo "END upload -- end UPLOAD -- END upload -- end UPLOAD"
     58
    4259errmsg='ERROR -- error -- ERROR -- error'
    4360
     61# from scratch
     62if test ${scratch} = 'true'; then scratch=true
     63else scratch=false; fi
     64
     65# Modules
     66if test ! ${LOADmods} = 'None'; then
     67  lmods=`echo ${LOADmods} | tr ':' ' '`
     68  for lmod in ${lmods}; do
     69    module load ${lmod}
     70  done
     71fi
     72
    4473insoutf='allins_functions.inf'
    45 module load python/2.7.14
    4674
    4775exps=`echo ${experiments} | tr ':' ' '`
Note: See TracChangeset for help on using the changeset viewer.