1 |
;; bsub -Is -q geyser -W 4:00 -n 1 -P P35171148 ncl< JRA25.ncl |
2 |
|
3 |
;; On yellowstone: |
4 |
; OLD method from DSS |
5 |
;; copy from glade ... |
6 |
;; /glade/p/rda/data/ds625.0.fcst_phy2m/1979/197901.fcst_phy2m.subc60.tar |
7 |
;; note that JPL's tars are named 197901.fcst_phy2m.tar, and that |
8 |
;; their lat,lon values are slightly off from NCAR's version |
9 |
|
10 |
;; hsi get /DSS/DS625.0/fcst_phy2m/1979/'*subc60.tar' . |
11 |
|
12 |
;;tar -xvf 197901.fcst_phy2m.subc60.tar |
13 |
;;tar -xvf 197902.fcst_phy2m.subc60.tar |
14 |
;;tar -xvf 197903.fcst_phy2m.subc60.tar |
15 |
;;tar -xvf 197904.fcst_phy2m.subc60.tar |
16 |
;;tar -xvf 197905.fcst_phy2m.subc60.tar |
17 |
;;tar -xvf 197906.fcst_phy2m.subc60.tar |
18 |
;;tar -xvf 197907.fcst_phy2m.subc60.tar |
19 |
;;tar -xvf 197908.fcst_phy2m.subc60.tar |
20 |
;;tar -xvf 197909.fcst_phy2m.subc60.tar |
21 |
;;tar -xvf 197910.fcst_phy2m.subc60.tar |
22 |
;;tar -xvf 197911.fcst_phy2m.subc60.tar |
23 |
;;tar -xvf 197912.fcst_phy2m.subc60.tar |
24 |
;;mv 1979*/* . |
25 |
;;rm *tar |
26 |
;;rmdir 1979* |
27 |
|
28 |
;; ncl<JRA25.ncl |
29 |
;; bsub -Is -q geyser -W 4:00 -n 1 -P P35171148 ncl< JRA25.ncl |
30 |
|
31 |
;;; ncl_convert2nc ncdump -h |
32 |
;;;............................................ |
33 |
yr=2014 |
34 |
|
35 |
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl" |
36 |
setfileoption("bin","WriteByteOrder","BigEndian") |
37 |
|
38 |
; Uroot1="mss:/DSS/DS627.0/ei.oper.an.sfc/" |
39 |
; Uroot2="/ei.oper.an.sfc.regn128sc." |
40 |
Oroot="fcst_phy2m." |
41 |
OOroot="JRA25g_" |
42 |
|
43 |
fils=systemfunc("ls " + Oroot + yr + "*") |
44 |
print (fils) |
45 |
nfils=dimsizes(fils) |
46 |
print (nfils) |
47 |
|
48 |
vars3d = (/ "LHTFL_GDS4_SFC_ave6h" , \ |
49 |
"SHTFL_GDS4_SFC_ave6h" , "U_FLX_GDS4_SFC_ave6h" , \ |
50 |
"V_FLX_GDS4_SFC_ave6h" , "USWRF_GDS4_SFC_ave6h" , \ |
51 |
"DSWRF_GDS4_SFC_ave6h" , "ULWRF_GDS4_SFC_ave6h" , \ |
52 |
"DLWRF_GDS4_SFC_ave6h" , "WTMP_GDS4_SFC_ave6h" , \ |
53 |
"ACPCP_GDS4_SFC_ave6h" , "NCPCP_GDS4_SFC_ave6h" , \ |
54 |
"T_CDC_GDS4_SFC_ave6h" , \ |
55 |
"U_GRD_GDS4_SFC" , "V_GRD_GDS4_SFC" , \ |
56 |
"TMP_GDS4_SFC" , "SPF_H_GDS4_SFC" , "PRES_GDS4_SFC", \ |
57 |
"T_CDC_GDS4_SFC_ave6h" /) |
58 |
|
59 |
names3d = (/ "xlhf_" , "xshf_" , "xustr_" , \ |
60 |
"xvstr_" , "xusw_" , "xdsw_" , \ |
61 |
"xulw_" , "xdlw_" , "xtmp_degC_" , \ |
62 |
"xacpcp_" , "xncpcp_" , "xcldcv_" , "u10m_" , "v10m_" , \ |
63 |
"tmp2m_degC_" , "spfh2m_" , \ |
64 |
"pres_", \ |
65 |
"xcldcv_" /) |
66 |
offset = (/0, 0, 0, 0, 0, 0, 0, 0, -273.15, 0, 0, 0, 0, 0, -273.15, 0, 0, 0 /) |
67 |
scalef = (/1, 1, 1, 1, -1, -1, -1, -1, 1, 1, 1, .01, 1, 1, 1, 1, 1, .01 /) |
68 |
nvars=dimsizes (vars3d) |
69 |
do nv=0,nvars-1 |
70 |
filbin= OOroot + names3d(nv) + yr ; name of binary output file |
71 |
system("/bin/rm -f "+filbin) ; remove if it already exist |
72 |
end do |
73 |
|
74 |
|
75 |
|
76 |
do nf=0,nfils-1 |
77 |
f = addfile (fils(nf)+".grb", "r") ; open |
78 |
print(""+fils(nf)) |
79 |
|
80 |
do nv=0,nvars-1 ; loop over selected variables |
81 |
;print("variable: "+vars3d(nv)) |
82 |
filbin= OOroot + names3d(nv) + yr ; name of binary output file |
83 |
; print(filbin) |
84 |
x = f->$vars3d(nv)$ |
85 |
;printVarSummary( x ) |
86 |
x = x*scalef(nv) + offset(nv) |
87 |
X = x(::-1,:) ; leftmost dimension is slowest varying |
88 |
dimx = dimsizes( X ) |
89 |
fbindirwrite(filbin, X ) ; write to binary file |
90 |
|
91 |
end do |
92 |
|
93 |
delete( x ) ; may change size on the next |
94 |
delete( X ) ; iterations due to different |
95 |
end do |
96 |
|
97 |
;----------------------------------------------------------------- |
98 |
; Remove the current year of files ... then return and read next 12 files |
99 |
;----------------------------------------------------------------- |
100 |
; SYS_RM = "/bin/rm Uroot+"*" |
101 |
; print ( SYS_RM ) |
102 |
;; system( SYS_RM ) ; not until debugged |