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

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

improve rest headers thanks to sphinx update (1.0.4 to 1.0.7)

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