;*********************************************** ; This Code wil separate out the Upper air data of a thunderstom day and a non thunderstorm day dependig on the file fililist.ts.txt ;*********************************************** ; ; These files are loaded by default in NCL V6.2.0 and newer ; load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" ; load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" ; load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl" ;*********************************************** begin TSD = asciiread("filelist.ts.txt",(/-1/), "string") ; prinout(TSD) nTSD = dimsizes(TSD) print(nTSD) flnm = systemfunc("ls ~/geeta/ncl/thunderstorm/DATA_KKA/WYOM_DATA/UA_monthly/?????_*.out") ; print(flnm) Nflnm = dimsizes(flnm) print(Nflnm) header = (/"------------------------------------------------------------------------------------------------------------------------------"/) header1 = (/" PRES HGHT TEMP DWPT RELH MIXR DRCT SKNT THTA THTE THTV"/) hlist = [/header/] hlist1 = [/header1/] do I = 0,nTSD-1 NME = str_split(TSD(I)," ") if (NME(1).eq."01") then NME(1)="Jan" else if (NME(1).eq."02") then NME(1)="Feb" else if (NME(1).eq."03") then NME(1)="Mar" else if (NME(1).eq."04") then NME(1)="Apr" else if (NME(1).eq."05") then NME(1)="May" else if (NME(1).eq."06") then NME(1)="Jun" else if (NME(1).eq."07") then NME(1)="Jul" else if (NME(1).eq."08") then NME(1)="Aug" else if (NME(1).eq."09") then NME(1)="Sep" else if (NME(1).eq."10") then NME(1)="Oct" else if (NME(1).eq."11") then NME(1)="Nov" else if (NME(1).eq."12") then NME(1)="Dec" end if end if end if end if end if end if end if end if end if end if end if end if ; print(NME) ; print("NME(0) is year", NME(1) month , NME(2) day) do II = 0,Nflnm-1 FILS = asciiread(flnm(II),(/-1/), "string") ; print(FILS) SPLT = str_split(FILS(0)," ") ; print(II+" "+SPLT) ; print("SPLT(0) is Time 00 or 12Z", SPLT(1) is Day ; SPLT(2) is month , SPLT(3) Year) if (NME(0).eq.SPLT(3)).and.(NME(1).eq.SPLT(2)).and.(NME(2).eq.SPLT(1)) then dt_tm = [/SPLT(0)+" "+SPLT(2)+" "+SPLT(1)+" "+SPLT(3)/] ; date and time ;printVarSummary(dt_tm) ; write_table(dt_tm+".ts", "w", dt_tm, "%40s") write_table(test+".ts", "w", dt_tm, "%40s") print("Yahoo got it") end if delete(FILS) end do end do ; 1st do loop end