[ncl-talk] adding multiple files once to extract data at desired time period

Wickramage Chathurika wickramagechathurika at rocketmail.com
Mon Mar 19 21:15:50 MDT 2018


Thank you so much Rick
Kind regards,Chathu

........................................






    On Tuesday, 13 March 2018, 00:27:52 GMT+8, Rick Brownrigg <brownrig at ucar.edu> wrote:  
 
 Are you saying you are having trouble coming up with the right filename expression?

What about something like:

ls MXLDEPTH.1440x720.[0-9][0-9][0-9][0-9]12*.nc  MXLDEPTH.1440x720.[0-9][0-9][0-9][0-9]0[1-2]*.nc    # DJF, all years
MXLDEPTH.1440x720.[0-9][0-9][0-9][0-9]0[3-5]*.nc    # MAM
MXLDEPTH.1440x720.[0-9][0-9][0-9][0-9]0[6-8]*.nc    # JJA
MXLDEPTH.1440x720.[0-9][0-9][0-9][0-9]09*.nc  MXLDEPTH.1440x720.[0-9][0-9][0-9][0-9]1[0-1]*.nc    # SON

Its kind of crude and there are likely better ways, but I think that works.

Rick

On Sun, Mar 11, 2018 at 11:54 PM, Wickramage Chathurika <wickramagechathurika at rocketmail.com> wrote:

Hello,

I have 7671 (21 years) Mixlayer depth files with dimensions, time, lat and lon. I want to extract mix layer depth data for "JJA". but I cannot read such amount of files at once and give errors;
for that I have used;
diri="/mnt/g/Ocean/ECCO2/ MXLDEPTH/"fili=systemfunc("cd "+diri+" ;ls MXLDEPTH.1440x720.*.nc")
"warning:_NclOpenFile: Can not open file <*.nc>; file format not supported or file is corrupted"

if I add only one-month data, it runs properly and gives the output. for that I have used;
diri="/mnt/g/Ocean/ECCO2/ MXLDEPTH/"fili=systemfunc("cd "+diri+" ;ls MXLDEPTH.1440x720.201106*.nc")
And one more thing, when I try to use only the 21 years June data, It gives not only June data but other months data also (the part of the printed output has been displayed below). for that I have used;
diri="/mnt/g/Ocean/ECCO2/ MXLDEPTH/"fili=systemfunc("cd "+diri+" ;ls MXLDEPTH.1440x720.*06*.nc")
 (1141)  MXLDEPTH.1440x720.20111006.nc(1142)  MXLDEPTH.1440x720.20111106.nc(1143)  MXLDEPTH.1440x720.20111206.nc(1144)  MXLDEPTH.1440x720.20120106.nc(1145)  MXLDEPTH.1440x720.20120206.nc(1146)  MXLDEPTH.1440x720.20120306.nc(1147)  MXLDEPTH.1440x720.20120406.nc(1148)  MXLDEPTH.1440x720.20120506.nc(1149)  MXLDEPTH.1440x720.20120601.nc(1150)  MXLDEPTH.1440x720.20120602.nc(1151)  MXLDEPTH.1440x720.20120603.nc(1152)  MXLDEPTH.1440x720.20120604.nc(1153)  MXLDEPTH.1440x720.20120605.nc(1154)  MXLDEPTH.1440x720.20120606.nc(1155)  MXLDEPTH.1440x720.20120607.nc(1156)  MXLDEPTH.1440x720.20120608.nc(1157)  MXLDEPTH.1440x720.20120609.nc(1158)  MXLDEPTH.1440x720.20120610.nc(1159)  MXLDEPTH.1440x720.20120611.nc(1160)  MXLDEPTH.1440x720.20120612.nc(1161)  MXLDEPTH.1440x720.20120613.nc(1162)  MXLDEPTH.1440x720.20120614.nc(1163)  MXLDEPTH.1440x720.20120615.nc(1164)  MXLDEPTH.1440x720.20120616.nc(1165)  MXLDEPTH.1440x720.20120617.nc(1166)  MXLDEPTH.1440x720.20120618.nc(1167)  MXLDEPTH.1440x720.20120619.nc(1168)  MXLDEPTH.1440x720.20120620.nc(1169)  MXLDEPTH.1440x720.20120621.nc(1170)  MXLDEPTH.1440x720.20120622.nc(1171)  MXLDEPTH.1440x720.20120623.nc(1172)  MXLDEPTH.1440x720.20120624.nc(1173)  MXLDEPTH.1440x720.20120625.nc(1174)  MXLDEPTH.1440x720.20120626.nc(1175)  MXLDEPTH.1440x720.20120627.nc(1176)  MXLDEPTH.1440x720.20120628.nc(1177)  MXLDEPTH.1440x720.20120629.nc(1178)  MXLDEPTH.1440x720.20120630.nc(1179)  MXLDEPTH.1440x720.20120706.nc(1180)  MXLDEPTH.1440x720.20120806.nc(1181)  MXLDEPTH.1440x720.20120906.nc(1182)  MXLDEPTH.1440x720.20121006.nc(1183)  MXLDEPTH.1440x720.20121106.nc(1184)  MXLDEPTH.1440x720.20121206.nc
The variable summary for one file is,
Variable: mixType: floatTotal Size: 560 bytes            140 valuesNumber of Dimensions: 2Dimensions and sizes:   [TIME | 1] x [LONGITUDE_T | 140]Coordinates:            TIME: [2507.5..2507.5]            LONGITUDE_T: [45.125..79.875]Number Of Attributes: 6  missing_value :       -9.9999998e+22  FillValue :   -9.9999998e+22  long_name :   Mixed layer depth, dT=.8degC density criterion  units :       m  LATITUDE_T :  -0.125  _FillValue :  1e+20

I want to plot the mix layer depth climatology for seasons wise ( DJF,MAM,JJA,SON). Please help me to solve this problem and I stuck here so long time. Any help appriciate in advance. I have tried so may methods up to now, but nothing work properly.
Thank you so much
Kind regards,Chathu
.............................. ..........







______________________________ _________________
ncl-talk mailing list
ncl-talk at ucar.edu
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/ mailman/listinfo/ncl-talk



  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180320/e17e0d8b/attachment.html>


More information about the ncl-talk mailing list