source: src/compute_metrics_csv.sh @ 108

Last change on this file since 108 was 108, checked in by htune, 7 years ago

Automation of bench.sh
You can now pass the model and list of metrics as argument
to bench.sh
./bench.sh -model AROME -metrics ARMCU_REF_nebzave_9_9,SANDU_REF_nebzave_60_60,ARMCU_REF_zav-400-600-theta_9_9
bench.sh will automatically run the required SCM (here ARMCU/REF and SANDU/REF).
Old emulators removed from the bench.
The new setup.sh takes the les.tar file from CNRM directly.
Fredho

  • Property svn:executable set to *
File size: 2.2 KB
Line 
1#!/bin/bash
2
3##############################################################################
4# Computing metrics from LES and SCM
5# Result in csv format
6# Auteur: F Couvreux, R Honnert, F Hourdin, N Villefranque, C Rio, n'co
7##############################################################################
8#
9# metrics are specified in list_case
10# metrics names follow the syntax
11#
12# CASE_SUBCASE_METRICS_T1_T2
13# T1 and T2 are initial and final time step for time averages
14#
15# available METRICS :
16# ===================
17#
18# 1/ zav-400-600-var  -> variable "var" averaged between 400 and 600 m
19#
20# 2/ Ay-var -> integral ( min ( var -var(t=0) ) dz ) / integral ( dz )
21#           integral taken from 0 to  zmax
22#
23# 3/ nebzave, neb2zave, neb4zave : Effective cloud height
24#           = int ( neb^p z dz ) / int ( neb^p dz ) with  p=1, 2 or 4
25#
26# 4/ nebmax : maximum cloud fraction on the column
27#
28# 5/ nebzmin, nebzmax : minimum/maximum cloud height
29#
30# 6/ lwp : liquid water path
31#
32# TBD :
33# =====
34# 1/ integrals are computed assuming rho=1 because rho is not systematically avalble
35# 2/ the time average is coded for zav metrics only
36#
37##############################################################################
38
39nWAVE=1
40
41
42list_case=""
43while (($# > 0)) ; do
44   case $1 in
45      -wave) nWAVE=$2 ; echo WAVE $nWAVE ;  shift ; shift ; echo OPTION $* ;;
46      -help|-h) echo Usage "$0 [-wave N] [metrics1] [metrics2] ..." ; exit ;;
47      *) list_case=( ${list_case[*]} $1 ) ; shift ;;
48   esac
49done
50
51# Default metrics
52if [ $list_case = "" ] ; then list_case=( ARMCU_REF_zav-400-600-theta_9_9 ) ; fi
53       
54wavedir=WAVE$nWAVE
55NAME_OUT=$nWAVE
56starting=1
57rm -f metrics_$NAME_OUT.csv metrics_LES_$NAME_OUT.csv
58
59for name in ${list_case[@]};do
60    for dir in LES ${wavedir} ; do
61         echo ./extract_onemetric_csv.sh $name $dir
62         ./extract_onemetric_csv.sh $name $dir
63         #========================
64         # Concatenation
65         #========================
66         if [ $starting == 1 ];then
67            cp -f ${dir}_$name.csv metrics_${dir}_$NAME_OUT.csv
68         else
69            cut -d, -f2 ${dir}_$name.csv | paste -d, metrics_${dir}_$NAME_OUT.csv - > temp
70            mv temp metrics_${dir}_$NAME_OUT.csv
71         fi
72    done
73    starting=0
74done # end loop $name
75
76Rscript htune_csv2Rdata.R
Note: See TracBrowser for help on using the repository browser.