; -------------- BEGINING OF NCL SCRIPT ---------------- begin ;******************************************************** ; read in netCDF file and make a loop for all time steps ;******************************************************** in = addfile("wrfout.nc","r") times = wrf_user_list_times(in) ntimes = dimsizes(times) RH = new(ntimes,float) ; creation of a RH vector at each time step do it = 0,ntimes-1 time = it qv = in->QVAPOR P = in->P ; perturbation Pb = in->PB ; base state pressure P = P + Pb ; total pressure theta = in->T ; perturbation potential temperature (theta+t0) theta = theta + 300. TK := wrf_tk (P, theta) RH := wrf_rh (qv, P, TK) printVarSummary(RH) ;************************************************************ ; - Print the variables at the screen - * ;************************************************************ npts=ntimes fName = "ncl.txt" data = new( npts, "string") do it = 0,ntimes-1 print (sprintf("%5.2f",it)+""\ +sprintf("%19.2f",RH(it(0,:,:,:)))+"") end do asciiwrite (fName , data) end do end