Ignore:
Timestamp:
11/06/18 17:14:39 (3 years ago)
Author:
cugnet
Message:

Available datasets list on ciclad extended.
Scripts slightly modified to accomodate more ways of cutting a time serie into several time slices.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TOOLS/CMIP6_FORCING/OZONE/clims_CMIP6.bash

    r3870 r4109  
    44#=== Indices of chosen datasets among available collection (see DATANAMES after) 
    55DOPROCESS=('n' 'y')          #--- PROCESSED DATA TYPES (SSTandSeaIce, ozone) 
    6 IXPROCESS=("0" "5 6 7")      #--- PROCESSED DATASETS INDICES 
     6IXPROCESS=("0" "1 2 3 4")    #--- PROCESSED DATASETS INDICES 
    77recomp='n'                   #--- RECOMPUTE FILES THAT ARE ALREADY PRESENT (y/n) 
    88 
     
    3131esac 
    3232if [ "$DATAIN" = "" ]; then echo "Raw data folder for $machine has to be specified."; exit; fi 
    33 # DATAOU=/data/dcugnet$DATAOU  # No write acces to $DATAOU => temporary storage space. 
     33 DATAOU=/data/dcugnet$DATAOU  # No write acces to $DATAOU => temporary storage space. 
    3434 
    3535#--- DATA TO TREAT (INTERANNUAL AND CLIMATOLOGIES): "SSTsAndSeaIce" "ozone": 
     
    4242           input4MIPs/CMIP6/CMIP/PCMDI/PCMDI-AMIP-1-1-4/ocean/mon/\${var}/gn/v20180427/$f" \ 
    4343          "input4MIPs/CMIP6/CMIP/UReading/UReading-CCMI-1-0/atmos/mon/\${var}/gn/v20160711/$f   \ 
     44           input4MIPs/CMIP6/ScenarioMIP/UReading/UReading-CCMI-ssp126-1-0/atmos/mon/\${var}/gn/v20181101/$f \ 
     45           input4MIPs/CMIP6/ScenarioMIP/UReading/UReading-CCMI-ssp245-1-0/atmos/mon/\${var}/gn/v20181101/$f \ 
     46           input4MIPs/CMIP6/ScenarioMIP/UReading/UReading-CCMI-ssp370-1-0/atmos/mon/\${var}/gn/v20181101/$f \ 
     47           input4MIPs/CMIP6/ScenarioMIP/UReading/UReading-CCMI-ssp585-1-0/atmos/mon/\${var}/gn/v20181101/$f \ 
    4448           input4MIPs/CMIP6/DAMIP/CCCma/CCMI-hist-stratO3-1-0/atmos/mon/\${var}/gn/v20170814/$f \ 
    4549           input4MIPs/CMIP6/DAMIP/CCCma/CCMI-hist-nat-1-0/atmos/mon/\${var}/gn/v20180503/$f     \ 
     
    4852           input4MIPs/CMIP6/DAMIP/CCCma/CCMI-hist-sol-1-1/atmos/mon/\${var}/gn/v20180525/$f     \ 
    4953           input4MIPs/CMIP6/DAMIP/CCCma/CCMI-hist-nat-1-1/atmos/mon/\${var}/gn/v20180525/$f     \ 
    50            input4MIPs/CMIP6/DAMIP/CCCma/CCMI-hist-volc-1-1/atmos/mon/\${var}/gn/v20180525/$f") 
     54           input4MIPs/CMIP6/DAMIP/CCCma/CCMI-hist-volc-1-1/atmos/mon/\${var}/gn/v20180525/$f    \ 
     55           input4MIPs/CMIP6/DAMIP/CCCma/CCMI-ssp245-nat-1-0/atmos/mon/\${var}/gn/v20180820/$f") 
    5156CLIMS_IN=("/ / / / /" \ 
    52           "input4MIPs/CMIP6/CMIP/UReading/UReading-CCMI-1-0/atmos/monC/\${var}/gn/v20160830/$f  /  /  /  /") 
     57          "input4MIPs/CMIP6/CMIP/UReading/UReading-CCMI-1-0/atmos/monC/\${var}/gn/v20160830/$f  /  /  /  / /") 
    5358VARNAM_IN=('tosbcs siconcbcs' 'vmro3') 
    5459DIRSTRUCT='datasets/exercise/project/origin/dataset/domain/frequency/var/grid/version/' 
     
    7984  date=(${DATADATES[$i]}); fin=($fin); if [ ${DOPROCESS[$i]} != 'y' ]; then continue; fi 
    8085  echo ">> Chosen $dt:" 
    81   for ka in ${IXPROCESS[$i]}; do echo "  * ${fin[$ka]%/*} (${date[$ka]%-*})"; done 
     86  for ka in ${IXPROCESS[$i]}; do d=${date[$ka]}; dy=${d%%-*}; d=${d#*-} 
     87    echo "  * ${fin[$ka]%/*} (${dy}-${d%%-*})" 
     88  done 
    8289done 
    8390 
     
    8794  if [ ${DOPROCESS[$i]} != 'y' ]; then continue; fi 
    8895     dt=${DATATYPES[$i]}                                   #=== SSTAndSeaIce, ozone... 
    89     fin=(${FILES_IN[$i]}); vin=(${VARNAM_IN[$i]})          #=== INPUT FILE/VAR NAMES (each version) 
     96    fin=(${FILES_IN[$i]}); vin=(${VARNAM_IN[$i]})          #===  INPUT FILE/VAR NAMES (each version) 
    9097     fou=${FILES_OU[$i]} ; vou=(${VARNAM_OU[$i]})          #=== OUTPUT FILE/VAR NAMES (single pair) 
    9198  date=(${DATADATES[$i]})                                  #=== ${Yb}-${Ye}-${dY} 
     
    96103  #================================================================================ 
    97104    parse_dir ${fin[$is]} $DIRSTRUCT $ex                   #--- Parse input directory 
    98     dso=$dataset                                           #--- For naming purpose 
    99     case $dt in                                            #--- NAMING EXCEPTIONS 
    100       ozone) dso=${dso#*hist-}; dso=hist-${dso%%-*} 
    101                     if [ "$dataset" = "UReading-CCMI-1-0" ]; then dso="historical"; fi ;; 
    102       SSTAndSeaIce) if [ "$dataset" =  "PCMDI-AMIP-1-1-0" ]; then dso='AMIP'; fi ;; 
    103     esac 
     105    dso=$(remove_version $dataset); dso=${dso#*-}          #--- For naming purpose 
     106    if [ $dso = "CCMI" ]; then dso="historical"; fi        #--- NAMING EXCEPTION: UReading-CCMI-1-0 
    104107    #============================================================================== 
    105108    for iv in $(eval echo {0..$((${#vin[@]}-1))}); do      #--- Loop on variables 
    106109    #============================================================================== 
    107       da=${date[$is]}; Yb=${da%%-*}; Ye=${da#*-}; dY=${Ye##*-}; Ye=${Ye%-*} 
     110      da=${date[$is]}; Yi=${da%%-*}; Yf=${da#*-}; dYt=${Yf#*-}; Yf=${Yf%%-*} 
    108111      v_in=${vin[$iv]}; v_ou=${vou[$iv]}                   #--- Variables names 
    109112      f_in=$(var=$v_in; Yb=\${Yb}; Ye=\${Ye}; datatype=$dt; eval echo $DATAIN/${fin[$is]}) 
    110       axis=$(get_grid $(Yb=$Yb; Ye=????; eval echo $f_in) $v_in) 
     113      axis=$(get_grid $(Yb=$Yi; Ye=????; eval echo $f_in) $v_in) 
    111114      res=${axis#*=}; axis=${axis%=*} 
    112115      Zonal='n'; if [ $axis = 'XYZT' ]; then Zonal='y'; fi #--- Zonal mean ?  For 3D files 
     
    115118        res3D=${res%x*}; res2D=${res3D#*x}_zonal; f_ou=${f_ou%/*}/\${res}/${f_ou##*/} 
    116119      fi 
    117       echo ">> BUILDING 12 MONTHS ${v_in} FILES FOR THE $Yb-$Ye PERIOD USING $dataset DATASET ($version)..." 
     120      echo ">> BUILDING 12 MONTHS ${v_in} FILES FOR THE $Yi-$Yf PERIOD USING $dataset DATASET ($version)..." 
     121      Ye=$((Yi-1)) 
    118122      #============================================================================ 
    119       for Y in $(eval echo {$Yb..$Ye}); do                 #--- Loop on years 
     123      for Y in $(eval echo {$Yi..$Yf}); do                 #--- Loop on years 
    120124      #============================================================================ 
    121125        fO=$(Y=$Y; res=${res3D}; eval echo ${f_ou})        #--- Original resolution 
     126        if [ $Y -eq $((Ye+1)) ]; then Yb=$Y; dY=${dYt%%-*}; Ye=$((Yb+dY-1)); dYt=${dYt#*-}; fi 
    122127        if [[ ! -f $fO || $recomp = 'y' ]]; then 
    123128          extract $v_in,$v_ou $f_in,$fO $Yb,$Ye,$dY $Y 0   #--- Field extraction 
     
    128133          if [[ ! -f $fZ || $recomp = 'y' ]]; then zonal_mean $fO $fZ; fi 
    129134        fi 
    130         progress_bar $((Y-Yb+1)) $((Ye-Yb+1)) 50           #--- Check progress 
     135        progress_bar $((Y-Yi+1)) $((Yf-Yi+1)) 50           #--- Check progress 
    131136      #============================================================================ 
    132137      done 
     
    135140      #============================================================================ 
    136141        Yb=${per%%-*}; Ye=${per##*-}; Yc=${Yb}_${Ye}_clim; c='n'; cli0=${cli[$is]} 
     142 
     143        #=== Skip periods outside available years interval 
     144        if [[ $Yb -lt ${da%%-*} || ${Yb} -gt ${da#*-} || $Yb -lt ${da%%-*} || ${Yb} -gt ${da#*-} ]]; then 
     145          continue 
     146        fi 
    137147 
    138148        #=== Is there a single file climatology available ? 
Note: See TracChangeset for help on using the changeset viewer.