1 | #!/bin/ksh |
---|
2 | #set -vx |
---|
3 | |
---|
4 | #************************************************************** |
---|
5 | # Author: Martial Mancip, Nicolas Vuichard |
---|
6 | # Contact: Nioclas.Vuichard@lsce.jussieu.fr |
---|
7 | # $Date: |
---|
8 | # $Name: OOL_1_9_5 $ |
---|
9 | # $Revision: 1.6 $ |
---|
10 | # History: |
---|
11 | # Modification: Martial Mancip |
---|
12 | # |
---|
13 | #************************************************************** |
---|
14 | |
---|
15 | input=$@ |
---|
16 | paper=-p |
---|
17 | quality=cx1800 |
---|
18 | #cx800 cx1200 |
---|
19 | #frequency=1:12:6 |
---|
20 | echo $input |
---|
21 | #reference_file=RRRRRRR |
---|
22 | #validation directory=VVVVVVV |
---|
23 | debug= |
---|
24 | #-d |
---|
25 | |
---|
26 | # Ratio one day over time step |
---|
27 | one_day=86400 |
---|
28 | ratio=$(( one_day/1800 )) |
---|
29 | |
---|
30 | ssbx=481 |
---|
31 | |
---|
32 | #---------------------- |
---|
33 | |
---|
34 | echo $input | ferretloop - ${debug} --ps2gif_option "-g $quality" -p -i "PFT distribution" -o pft ORCHIDEE_pft.jnl \ |
---|
35 | "\"PFT distribution\" RRRRRRR inputfile MAXVEGETFRAC" |
---|
36 | |
---|
37 | |
---|
38 | # Smooth over sbx values |
---|
39 | |
---|
40 | echo $input | ferretloop - ${debug} --ps2gif_option "-g $quality" -p -i "Sensible heat flux : diff with obs" -o fluxsens_sbx ORCHIDEE_3sbxdif.jnl \ |
---|
41 | "\"Sensible heat flux : diff with obs\" VVVVVVV RRRRRRR inputfile Qh Qh $FYEAR \"W/m2\" $ssbx" |
---|
42 | |
---|
43 | echo $input | ferretloop - ${debug} --ps2gif_option "-g $quality" -p -i "Latent heat flux : diff with obs" -o fluxlat_sbx ORCHIDEE_3sbxdif.jnl \ |
---|
44 | "\"Latent heat flux : diff with obs\" VVVVVVV RRRRRRR inputfile Qle Qle $FYEAR \"W/m2\" $ssbx" |
---|
45 | |
---|
46 | echo $input | ferretloop - ${debug} --ps2gif_option "-g $quality" -p -i "Surface Temperature : diff with obs" -o tsoil_sbx ORCHIDEE_3sbxdif.jnl \ |
---|
47 | "\"Surface Temperature : diff with obs\" VVVVVVV RRRRRRR inputfile TSOIL (AvgSurfT-273.15) $FYEAR \"degC\" $ssbx " |
---|
48 | |
---|
49 | # slowproc : veget(ji,jv) = veget_max(ji,jv) * ( 1. - exp( - lai(ji,jv) * ext_coef(jv) ) ) |
---|
50 | # => lai = - ln( 1. - veget/veget_max) / ext_coef |
---|
51 | ext_coef=0.5 |
---|
52 | echo $input | ferretloop - ${debug} --ps2gif_option "-g $quality" -p -i "LAI : lai mean with tsoil/4 obs" -o lai_sbx ORCHIDEE_3sbxdif.jnl \ |
---|
53 | "\"lai : lai mean with tsoil/4\" VVVVVVV RRRRRRR inputfile (tsoil/4) (0.-maxvegetfrac*ln(1.-vegetfrac/maxvegetfrac)/$ext_coef) $FYEAR \"1\" $ssbx " |
---|
54 | |
---|
55 | echo $input | ferretloop - ${debug} --ps2gif_option "-g $quality" -p -i "Potential evapotranspiration : diff with obs" -o epot_sbx ORCHIDEE_3sbxdif.jnl \ |
---|
56 | "\"Potential evapotranspiration : diff with obs\" VVVVVVV RRRRRRR inputfile (ET*${ratio}) (PotEvap*${one_day}) $FYEAR \"mm/d\" $ssbx " |
---|
57 | |
---|
58 | echo $input | ferretloop - ${debug} --ps2gif_option "-g $quality" -p -i "Soil moisture stress : diff with obs" -o humr_sbx ORCHIDEE_3sbxdif.jnl \ |
---|
59 | "\"Soil moisture stress : diff with obs\" VVVVVVV RRRRRRR inputfile RH humrel $FYEAR \"%\" $ssbx " |
---|
60 | |
---|
61 | echo $input | ferretloop - ${debug} --ps2gif_option "-g $quality" -p -i "Soil moisture content 1 : diff with obs" -o humr1_sbx ORCHIDEE_3sbxdif.jnl \ |
---|
62 | "\"Soil moisture content 1 : diff with obs\" VVVVVVV RRRRRRR inputfile SWC humrel $FYEAR \"%\" $ssbx " |
---|
63 | |
---|
64 | echo $input | ferretloop - ${debug} --ps2gif_option "-g $quality" -p -i "lwnet : diff with obs" -o lwnet_sbx ORCHIDEE_3sbxdif.jnl \ |
---|
65 | "\"lwnet : diff with obs\" VVVVVVV RRRRRRR inputfile LWnet LWnet $FYEAR \"%\" $ssbx " |
---|
66 | |
---|
67 | echo $input | ferretloop - ${debug} --ps2gif_option "-g $quality" -p -i "swnet : diff with obs" -o swnet_sbx ORCHIDEE_3sbxdif.jnl \ |
---|
68 | "\"swnet : diff with obs\" VVVVVVV RRRRRRR inputfile SWnet SWnet $FYEAR \"%\" $ssbx " |
---|
69 | |
---|
70 | |
---|
71 | |
---|
72 | echo $input | ferretloop - ${debug} --ps2gif_option "-g $quality" -p -i "netrad : diff with obs" -o netrad_sbx ORCHIDEE_3sbxdif.jnl \ |
---|
73 | "\"netrad : diff with obs\" VVVVVVV RRRRRRR inputfile netrad (LWnet+SWnet) $FYEAR \"%\" $ssbx " |
---|
74 | |
---|
75 | echo $input | ferretloop - ${debug} --ps2gif_option "-g $quality" -p -i "gpp : diff with obs" -o gpp_sbx ORCHIDEE_3sbxdif.jnl \ |
---|
76 | "\"gpp : diff with obs\" VVVVVVV RRRRRRR inputfile GPP GPP*maxvegetfrac*1800) $FYEAR \"gC/m2/day\" $ssbx" |
---|
77 | # "\"gpp : diff with obs\" VVVVVVV RRRRRRR inputfile (GPP*${ratio}) (GPP*${one_day}) $FYEAR \"gC/m2/day\" $ssbx" |
---|
78 | |
---|
79 | echo $input | ferretloop - ${debug} --ps2gif_option "-g $quality" -p -i "nee : diff with obs" -o nee_sbx ORCHIDEE_3sbxdif.jnl \ |
---|
80 | "\"nee : diff with obs\" VVVVVVV RRRRRRR inputfile (NEE*${ratio}) (NEE*${one_day}) $FYEAR \"gC/m2/day\" $ssbx" |
---|
81 | |
---|
82 | echo $input | ferretloop - ${debug} --ps2gif_option "-g $quality" -p -i "Ecosystem respiration : diff with obs" -o reco_sbx ORCHIDEE_3sbxdif.jnl \ |
---|
83 | "\"Ecosystem respiration\" VVVVVVV RRRRRRR inputfile (Reco*${ratio}) ((maint_resp+hetero_resp+growth_resp)*${one_day}) $FYEAR \"gC/m2/day\" $ssbx " |
---|
84 | |
---|
85 | echo $input | ferretloop - ${debug} --ps2gif_option "-g $quality" -p -i "nee : diff with obs" -o nee_sbx ORCHIDEE_3sbxdif.jnl \ |
---|
86 | "\"nee : diff with obs\" VVVVVVV RRRRRRR inputfile NEE (NEE*maxvegetfrac*1800) $FYEAR \"gC/m2/day\" $ssbx " |
---|
87 | |
---|
88 | # Annual cumulative values |
---|
89 | |
---|
90 | echo $input | ferretloop - ${debug} --ps2gif_option "-g $quality" -p -i "Sensible heat flux : Annual diff with obs" -o fluxsens_year ORCHIDEE_3yeardif.jnl \ |
---|
91 | "\"Sensible heat flux : Annual diff with obs\" VVVVVVV RRRRRRR inputfile Qh Qh $FYEAR $DUREE \"W/m2\" ave" |
---|
92 | |
---|
93 | echo $input | ferretloop - ${debug} --ps2gif_option "-g $quality" -p -i "Latent heat flux : Annual diff with obs" -o fluxlat_year ORCHIDEE_3yeardif.jnl \ |
---|
94 | "\"Latent heat flux : Annual diff with obs\" VVVVVVV RRRRRRR inputfile Qle Qle $FYEAR $DUREE \"W/m2\" ave" |
---|
95 | |
---|
96 | echo $input | ferretloop - ${debug} --ps2gif_option "-g $quality" -p -i "Surface Temperature : Annual diff with obs" -o tsoil_year ORCHIDEE_3yeardif.jnl \ |
---|
97 | "\"Surface Temperature : Annual diff with obs\" VVVVVVV RRRRRRR inputfile TSOIL (AvgSurfT-273.15) $FYEAR $DUREE \"degC\" ave" |
---|
98 | |
---|
99 | if [ "${F_FILE}" != "Cabauw" ] && [ "${FLAG}" != "SECHIBA" ]; then |
---|
100 | |
---|
101 | echo $input | ferretloop - ${debug} --ps2gif_option "-g $quality" -p -i "gpp : Annual diff with obs" -o gpp_year ORCHIDEE_3yeardif.jnl \ |
---|
102 | "\"gpp : Annual diff with obs\" VVVVVVV RRRRRRR inputfile (GPP) (GPP*1800) $FYEAR $DUREE \"gC/m2/an\" sum" |
---|
103 | |
---|
104 | fi |
---|
105 | |
---|
106 | if [ "${F_FILE}" != "Cabauw" ] && [ "${FLAG}" = "OK_STOMATE" ]; then |
---|
107 | |
---|
108 | echo $input | ferretloop - ${debug} --ps2gif_option "-g $quality" -p -i "nee : Annual diff with obs" -o nee_year ORCHIDEE_3yeardif.jnl \ |
---|
109 | "\"nee : Annual diff with obs\" VVVVVVV RRRRRRR inputfile (NEE) (NEE*1800) $FYEAR $DUREE \"gC/m2/an\" sum" |
---|
110 | |
---|
111 | echo $input | ferretloop - ${debug} --ps2gif_option "-g $quality" -p -i "Ecosystem respiration : Annual diff with obs" -o reco_year ORCHIDEE_3yeardif.jnl \ |
---|
112 | "\"Ecosystem respiration : Annual diff with obs\" VVVVVVV RRRRRRR inputfile (Reco) ((maint_resp+hetero_resp+growth_resp)*1800) $FYEAR $DUREE \"gC/m2/an\" sum" |
---|
113 | fi |
---|
114 | |
---|
115 | |
---|
116 | #Â Diurnal cycle |
---|
117 | |
---|
118 | let ANNEE=0 |
---|
119 | while [ $ANNEE -lt $DUREE ]; do |
---|
120 | let ANNEE2=$ANNEE+1 |
---|
121 | echo $input | ferretloop - ${debug} --ps2gif_option "-g $quality" -s ${ANNEE}:${ANNEE}:1 -p -i "Sensible heat flux : climatologie_${ANNEE2}" -o fluxsens_day ORCHIDEE_12day.jnl \ |
---|
122 | "\"Sensible heat flux\" VVVVVVV RRRRRRR inputfile Qh Qh sloop" |
---|
123 | |
---|
124 | echo $input | ferretloop - ${debug} --ps2gif_option "-g $quality" -s ${ANNEE}:${ANNEE}:1 -p -i "Latent heat flux : climatologie_${ANNEE2}" -o fluxlat_day ORCHIDEE_12day.jnl \ |
---|
125 | "\"Latent heat flux\" VVVVVVV RRRRRRR inputfile Qle Qle sloop" |
---|
126 | |
---|
127 | echo $input | ferretloop - ${debug} --ps2gif_option "-g $quality" -s ${ANNEE}:${ANNEE}:1 -p -i "Surface Temperature : climatologie_${ANNEE2}" -o tsoil_day ORCHIDEE_12day.jnl \ |
---|
128 | "\"Surface Temperature\" VVVVVVV RRRRRRR inputfile TSOIL (AvgSurfT-273.15) sloop" |
---|
129 | |
---|
130 | |
---|
131 | echo $input | ferretloop - ${debug} --ps2gif_option "-g $quality" -s ${ANNEE}:${ANNEE}:1 -p -i "LAI : climatologie_${ANNEE2}" -o lai_day ORCHIDEE_12day.jnl \ |
---|
132 | "\"LAI\" VVVVVVV RRRRRRR inputfile (tsoil/4) (0.-maxvegetfrac*ln(1.-vegetfrac/maxvegetfrac)/$ext_coef) sloop" |
---|
133 | if [ "${F_FILE}" = "Cabauw" ]; then |
---|
134 | |
---|
135 | echo $input | ferretloop - ${debug} --ps2gif_option "-g $quality" -s ${ANNEE}:${ANNEE}:1 -p -i "lwnet : climatologie_${ANNEE2}" -o lwnet_day ORCHIDEE_12day.jnl "\"lwnet\" VVVVVVV RRRRRRR inputfile LWnet lwnet sloop" |
---|
136 | |
---|
137 | echo $input | ferretloop - ${debug} --ps2gif_option "-g $quality" -s ${ANNEE}:${ANNEE}:1 -p -i "swnet : climatologie_${ANNEE2}" -o swnet_day ORCHIDEE_12day.jnl "\"swnet\" VVVVVVV RRRRRRR inputfile SWnet swnet sloop" |
---|
138 | |
---|
139 | else |
---|
140 | |
---|
141 | echo $input | ferretloop - ${debug} --ps2gif_option "-g $quality" -s ${ANNEE}:${ANNEE}:1 -p -i "netrad : climatologie_${ANNEE2}" -o netrad_day ORCHIDEE_12day.jnl "\"netrad\" VVVVVVV RRRRRRR inputfile netrad SWnet+lwnet sloop" |
---|
142 | |
---|
143 | fi |
---|
144 | |
---|
145 | if [ "${F_FILE}" != "Cabauw" ] && [ "${FLAG}" != "SECHIBA" ]; then |
---|
146 | |
---|
147 | echo $input | ferretloop - ${debug} --ps2gif_option "-g $quality" -s ${ANNEE}:${ANNEE}:1 -p -i "gpp : climatologie_${ANNEE2}" -o gpp_day ORCHIDEE_12day.jnl \ |
---|
148 | "\"GPP\" VVVVVVV RRRRRRR inputfile GPP (GPP*maxvegetfrac*1800) sloop" |
---|
149 | # "\"GPP\" VVVVVVV RRRRRRR inputfile (GPP*${ratio}) (GPP*${one_day}) sloop" |
---|
150 | |
---|
151 | fi |
---|
152 | if [ "${F_FILE}" != "Cabauw" ] && [ "${FLAG}" = "OK_STOMATE" ]; then |
---|
153 | |
---|
154 | echo $input | ferretloop - ${debug} --ps2gif_option "-g $quality" -s ${ANNEE}:${ANNEE}:1 -p -i "nee : climatologie_${ANNEE2}" -o nee_day ORCHIDEE_12day.jnl \ |
---|
155 | "\"nee\" VVVVVVV RRRRRRR inputfile NEE NEE*maxvegetfrac*1800 sloop" |
---|
156 | |
---|
157 | fi |
---|
158 | echo $input | ferretloop - ${debug} --ps2gif_option "-g $quality" -s ${ANNEE}:${ANNEE}:1 -p -i "Ecosystem respiration : climatologie_${ANNEE2}" -o reco_day ORCHIDEE_12day.jnl \ |
---|
159 | "\"Ecosystem respiration\" VVVVVVV RRRRRRR inputfile (Reco*${ratio}) ((maint_resp+hetero_resp+growth_resp)*${one_day}) sloop" |
---|
160 | |
---|
161 | let ANNEE=$ANNEE+1 |
---|
162 | done |
---|