1 | def sym thetitle=($01) |
---|
2 | let thetitle="($01)" |
---|
3 | def sym file1=($02) |
---|
4 | def sym file2=($03) |
---|
5 | def sym file3=($04) |
---|
6 | |
---|
7 | let var_obs_init=($05) |
---|
8 | let var_obs=var_obs_init[g=my_time_counter@asn] |
---|
9 | |
---|
10 | let var_model_init=($06) |
---|
11 | |
---|
12 | |
---|
13 | let var_model_Year=var_model[gt=yearly@ave] |
---|
14 | let var_model_Month=var_model[gt=monthly@ave] |
---|
15 | let var_model_Day=var_model[gt=daily@ave] |
---|
16 | let var_model_Hour=var_model[gt=hourly@ave] |
---|
17 | |
---|
18 | |
---|
19 | let var_obs_year=var_obs[gt=yearly@ave] |
---|
20 | let var_obs_month=var_obs[gt=monthly@ave] |
---|
21 | let var_obs_day=var_obs[gt=daily@ave] |
---|
22 | let var_obs_hour=var_obs[gt=hourly@ave] |
---|
23 | |
---|
24 | |
---|
25 | |
---|
26 | use "($file1)" |
---|
27 | go symbol_basename_and_define basefile1 "($file1)" |
---|
28 | !----------- |
---|
29 | |
---|
30 | use "($file2)" |
---|
31 | go symbol_basename_and_define basefile2 "($file2)" |
---|
32 | !----------- |
---|
33 | |
---|
34 | use "($file3)" |
---|
35 | go symbol_basename_and_define basefile3 "($file3)" |
---|
36 | |
---|
37 | |
---|
38 | |
---|
39 | define grid/like=var_model_init[d=($basefile2),k=1] my_time_counter |
---|
40 | let var_model=if var_obs[d=($basefile1)] NE -9999. then var_model_init[g=my_time_counter@asn] else (-1e34) |
---|
41 | let mytime=t[gt=my_time_counter] |
---|
42 | let first_year= `tax_datestring(mytime[l=@min],mytime,"years")` |
---|
43 | let last_year= `tax_datestring(mytime[l=@max],mytime,"years")` |
---|
44 | define axis/t="1-JAN-`first_year` 00:00":"1-JAN-`last_year+1` 00:00":1/units=hour/cal=gregorian/edges hourly |
---|
45 | define axis/t="1-JAN-`first_year` 00:00":"1-JAN-`last_year+1` 00:00":1/units=day/cal=gregorian/edges daily |
---|
46 | go def_monthaxis_days.jnl gregorian first_year last_year monthly |
---|
47 | let nbyears=last_year-first_year+1 |
---|
48 | let indices_year = L[L=1:`1+nbyears`] |
---|
49 | let year = first_year + INT((indices_year-1)) |
---|
50 | define axis/units="days"/T0="01-JAN-`first_year`"/edges/cal="GREGORIAN" yearly = DAYS1900(year,1,1)-DAYS1900(`first_year`,1,1) |
---|
51 | |
---|
52 | |
---|
53 | |
---|
54 | |
---|
55 | |
---|
56 | !************************************************************ |
---|
57 | |
---|
58 | go page_new -i 1 2 0 100 0 90 |
---|
59 | |
---|
60 | set v 1 |
---|
61 | go margins_set 20 20 15 15 |
---|
62 | |
---|
63 | DEFINE VIEWPORT/XLIM=0,1/YLIM= .3,1 V1 |
---|
64 | set VIEWPORT V1 |
---|
65 | ************************************************************ |
---|
66 | def sym ssbx=($09%1%) |
---|
67 | |
---|
68 | !-------------------- |
---|
69 | let obs=var_obs_($07)[d=($basefile1),l=@sbx:($ssbx)] |
---|
70 | let myunit="($08)" |
---|
71 | set variable/units="`myunit`"/title="`thetitle`" obs |
---|
72 | !----------- |
---|
73 | let tag=(var_model_($07)[k=@sum,d=($basefile2),l=@sbx:($ssbx)]) |
---|
74 | !----------- |
---|
75 | let new=(var_model_($07)[k=@sum,d=($basefile3),l=@sbx:($ssbx)]) |
---|
76 | |
---|
77 | !--------------------- |
---|
78 | go 3winsize.jnl obs tag new |
---|
79 | |
---|
80 | plot/grat=(dash,color=black)/line=1/title=""/set_up/vlimit=`min`:`max` obs |
---|
81 | go unlabels 1 8 |
---|
82 | ppl TXTYPE,YR,MON |
---|
83 | ppl TXLINT,1,1 |
---|
84 | ppl plot |
---|
85 | plot/line=2/nolab/over tag |
---|
86 | plot/line=3/nolab/over new |
---|
87 | |
---|
88 | !--------------------- |
---|
89 | let diff1=tag-obs |
---|
90 | set variable/units="`myunit`"/title="`thetitle`" diff1 |
---|
91 | let diff2=new-obs |
---|
92 | go 3winsize.jnl diff1 diff2 diff2 |
---|
93 | |
---|
94 | DEFINE VIEWPORT/XLIM=0,1/YLIM=0,.35 V2 |
---|
95 | set VIEWPORT V2 |
---|
96 | plot/grat=(dash,color=black)/line=2/title=""/set_up/vlimit=`min`:`max` diff1 |
---|
97 | go unlabels 1 8 |
---|
98 | ppl TXTYPE,YR,MON |
---|
99 | ppl TXLINT,1,1 |
---|
100 | ppl plot |
---|
101 | plot/line=3/nolab/over diff2 |
---|
102 | |
---|
103 | !-------------------- |
---|
104 | go textlayer_new |
---|
105 | go text_legend_put 10 25 34 " @AS($basefile1)" 1 |
---|
106 | go text_legend_put 10 25 32 " @AS($basefile2)" 2 |
---|
107 | go text_legend_put 10 25 30 " @AS($basefile3)" 3 |
---|
108 | go textlayer_text_put 50 95 "@AS($thetitle)" 0 0.5 |
---|
109 | go logo_put ipsl |
---|
110 | |
---|
111 | |
---|
112 | |
---|