;************************************************ load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" load "/usr/local/ncl/lib/ncarg/nclscripts/wrf/WRF_contributed.ncl" load "/usr/local/ncl/lib/ncarg/nclscripts/csm/contributed.ncl" ;************************************************ begin fname = "nlcheng44chuance_test.txt" strs =new(6336,"string") data = asciiread(fname,(/6336,4/),"integer") mmm = data(:,1) nts = dimsizes(mmm) yy=new(nts,"integer") mm=new(nts,"integer") dd=new(nts,"integer") hh=new(nts,"integer") do nt=0,nts-1 yy(nt) = data(nt,0) mm(nt) = data(nt,1) dd(nt) = data(nt,2) hh(nt) = data(nt,3) if ((hh(nt) .gt. 8) .and. (hh(nt) .eq. 8 ) ) then hh(nt) = hh(nt) -8 if ((hh(nt) .lt. 8) .and. (hh(nt) .gt. 0 ) .and. (hh(nt) .eq. 0 ).and. (dd(nt) .ne. 1)) then hh(nt) = hh(nt) +16 dd(nt) = dd(nt) -1 if ((hh(nt) .lt. 8 ) .and. (hh(nt) .gt. 0 ) .and.( hh(nt) .eq. 0 ) .and. (dd(nt) .eq. 1)) then hh(nt) = hh(nt) +16 dd(nt) = 31 mm(nt) = mm(nt) -1 end if end if end if vals = sprintf("%4.0f",yy(nt)) + " "+ sprintf("%2.0f",mm(nt)) + " "+sprintf("%2.0f",dd(nt)) + " " + sprintf("%2.0f",hh(nt)) strs(nt) = vals asciiwrite("nlcheng55chuance_test.txt",strs) end do end