source: trunk/src/test/read.jnl @ 33

Last change on this file since 33 was 33, checked in by pinsard, 13 years ago

revisiting compute_erai_daily_region_2d.sh : allow cdo instead of ncflint (to be cont.)

File size: 3.1 KB
Line 
1!+
2!
3! .. _read.jnl:
4!
5!
6! ========
7! read.jnl
8! ========
9!
10!
11! DESCRIPTION
12! ===========
13!
14! read TROPFLUX file ${TROPFLUX_D}/TropFlux_19890101_20091231.nc
15!
16! plot the first time step of swr
17!
18! EXAMPLES
19! ========
20!
21! ::
22!
23!  ferret> GO read
24!
25! or::
26!
27!  $ ferret -nojnl -script read.jnl
28!
29! SEE ALSO
30! ========
31!
32! matlab/octave similar program : :ref:`read.m`
33!
34! IDL+SAXO similar program : :ref:`read.pro`
35!
36! TODO
37! ====
38!
39! usage of $TROFLUX_D
40!
41! make it usable for real end-user
42!
43! learn ferret
44!
45! clean metafiles
46!
47! pb with Fprint on zeus probably because of an mtt problem
48!
49! pb with ferret on adonis
50!
51! pb with underscore in dataset label on zeus
52!
53! pas de floatstr function sur zeus ?!
54! cf http://ferret.pmel.noaa.gov/Ferret/documentation/users-guide/handing-string-data-symbols/STRING-FUNCTIONS?searchterm=floatstr
55!
56! EVOLUTIONS
57! ==========
58!
59! - fplod 20110106T164602Z aedon.locean-ipsl.upmc.fr (Darwin)
60!
61!   * add plot
62!
63! - fplod 20110106T090443Z aedon.locean-ipsl.upmc.fr (Darwin)
64!
65!   * creation thanks to ACP
66!
67!-
68!
69CANCEL DATA/ALL
70CANCEL SYMBOL/ALL
71!
72! pour creer des metafile convertible en ps
73set mode metafile
74! pour avoir des traits plus gros
75go bold
76
77!++ http://www.pmel.noaa.gov/maillists/tmap/ferret_users/fu_2010/msg00690.html
78!let mm = 1
79!say `mm,zw=2`
80! ++ http://www.pmel.noaa.gov/maillists/tmap/ferret_users/fu_2009/msg00771.html
81!repeat/range=1:2/name=m (use "http://dodsserver/sst_`m`.nc"; show dat)
82!repeat/range=1:12/name=mm ( show sym mm; say `mm,zw=2`)
83!repeat/range=1:12/name=mm ( show sym mm; LET CMM B`mm,zw=2`A; LIST CMM)
84
85! pour les log
86! http://www.pmel.noaa.gov/maillists/tmap/ferret_users/fu_2009/msg00036.html
87show symbol session*
88let date = "($session_date)"
89let datetime =  "($session_date) ($session_time)"
90
91! DEFINE VARIABLE yyyymmdd_b = "19890101"
92! DEFINE VARIABLE yyyymmdd_e = "20091231"
93!++ DEFINE VARIABLE cb = {spawn:printf '%8.8d' `b` "}
94
95DEFINE SYMBOL yyyymmdd_b = 19890101
96DEFINE SYMBOL yyyymmdd_e = 20091231
97
98! ++ pb floatstr si yyyymmdd_b est un entier DEFINE VARIABLE fullfilename = "/usr/zeus/incas/fplod/tropflux_d"+"TropFlux_" + floatstr(yyyymmdd_b,"(I8.8)") + "_" + floatstr(yyyymmdd_e,"(I8.8)") + ".nc"
99!DEFINE VARIABLE filename = "TropFlux_" + yyyymmdd_b + "_" + yyyymmdd_e + ".nc"
100DEFINE SYMBOL filename = TropFlux_($yyyymmdd_b)_($yyyymmdd_e).nc
101! ++ $TROPFLUX_D defini ?
102!DEFINE SYMBOL tropflux_d = /usr/zeus/incas/fplod/tropflux_d/
103!DEFINE SYMBOL fullfilename = ($tropflux_d)($filename)
104DEFINE VARIABLE tropflux_d = {spawn:"echo $TROPFLUX_ID"}
105DEFINE SYMBOL fullfilename = "$tropflux_d($filename)"
106CANCEL SYMBOL filename
107! open
108! test if the file exists
109!++DEFINE VARIABLE a = {"dummy", SPAWN:"ls `fullfilename`"}
110!++DEFINE VARIABLE nfiles = `a,RETURN=IEND`
111!++CANCEL a
112!++LIST nfiles
113!++IF `nfiles EQ 2` THEN EXIT
114!++CANCEL nfiles
115
116! ++ use fullfilename
117!use "/usr/zeus/incas/fplod/tropflux_d/TropFlux_19890101_20091231.nc"
118use "`fullfilename`"
119!
120! plot the first timestep of swr
121shade/l=1 swr
122!
123! plot world map
124go land
125!
126! create a Postscript file
127sp Fprint -l cps -p portrait -o TropFlux_19890101_20091231.ferret.ps metafile.plt
128!
129! create a GIF file
130frame/file=TropFlux_19890101_20091231.ferret.gif
131!
132!++exit
Note: See TracBrowser for help on using the repository browser.