hello
I'm Fatima and I am new to NCL. I'm using NCL for my thesis in
Meteorology.
how can I add the date and time in my script.
this is my script:
; Example script to produce plots for a WRF real-data run,
; with the ARW coordinate dynamics option.
; Interpolating to specified pressure levels
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"
;load "./WRFUserARW.ncl"
begin
;
; The WRF ARW input file.
; This needs to have a ".nc" appended, so just do it.
a = addfile("./wrfout_d02_2007-02-22_00:00:00.nc","r")
; We generate plots, but what kind do we prefer?
; type = "x11"
type = "pdf"
; type = "ps"
; type = "ncgm"
wks = gsn_open_wks(type,"plt_PressureLevel2cu1")
; Set some basic resources
res = True
res@MainTitle = "REAL-TIME WRF cu1"
res@Footer = False
pltres = True
mpres = True
mpres@mpGeophysicalLineColor = "Black"
mpres@mpNationalLineColor = "Black"
mpres@mpUSStateLineColor = "Black"
mpres@mpGridLineColor = "Black"
mpres@mpLimbLineColor = "Black"
mpres@mpPerimLineColor = "Black"
mpres@mpGeophysicalLineThicknessF = 2.0
mpres@mpGridLineThicknessF = 2.0
mpres@mpLimbLineThicknessF = 2.0
mpres@mpNationalLineThicknessF = 2.0
mpres@mpUSStateLineThicknessF = 2.0
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; What times and how many time steps are in the data set?
times = wrf_user_getvar(a,"times",-1) ; get all times in the file
ntimes = dimsizes(times) ; number of times in the file
; The specific pressure levels that we want the data interpolated to.
pressure_levels = (/ 850/) ; pressure levels to plot
nlevels = dimsizes(pressure_levels) ; number of pressure levels
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; This is the big loop over all of the time periods to process.
do it = 1,ntimes-1
print("Working on time " + it )
time = it
res@TimeLabel = times(it) ; Set Valid time to use on plots
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; First get the variables we will need
tc = wrf_user_getvar(a,"tc",it) ; T in C
u = wrf_user_getvar(a,"ua",it) ; u averaged to mass points
v = wrf_user_getvar(a,"va",it) ; v averaged to mass points
p = wrf_user_getvar(a, "pressure",it) ; pressure is our vertical coordinate
z = wrf_user_getvar(a, "z",it) ; grid point height
rh = wrf_user_getvar(a,"rh",it) ; relative humidity
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
do level = 0,nlevels-1 ; LOOP OVER LEVELS
pressure = pressure_levels(level)
tc_plane = wrf_user_intrp3d(tc,p,"h",pressure,0.,False)
z_plane = wrf_user_intrp3d( z,p,"h",pressure,0.,False)
rh_plane = wrf_user_intrp3d(rh,p,"h",pressure,0.,False)
u_plane = wrf_user_intrp3d( u,p,"h",pressure,0.,False)
v_plane = wrf_user_intrp3d( v,p,"h",pressure,0.,False)
u_plane = u_plane*1.94386 ; kts
v_plane = v_plane*1.94386 ; kts
u_plane@units = "kts"
v_plane@units = "kts"
; Plotting options for T
opts = res
opts@cnLineColor = "Red"
opts@ContourParameters = (/ 5.0 /)
opts@cnInfoLabelOrthogonalPosF = 0.07 ; offset second label information
opts@gsnContourLineThicknessesScale = 2.0
contour_tc = wrf_contour(a,wks,tc_plane,opts)
delete(opts)
; Plotting options for RH
opts = res
opts@cnFillOn = True
opts@ContourParameters = (/ 10., 90., 10./)
opts@cnFillColors = (/"White","White","White", \
"White","Chartreuse","Green",\
"Green3","Green4", \
"ForestGreen","PaleGreen4"/)
contour_rh = wrf_contour(a,wks,rh_plane,opts)
delete(opts)
; Plotting options for Wind Vectors
opts = res
opts@FieldTitle = "Wind" ; overwite Field Title
opts@NumVectors = 12 ; density for wind barbs
vector = wrf_vector(a,wks,u_plane,v_plane,opts)
delete(opts)
; Plotting options for Geopotential Heigh
opts_z = res
opts_z@cnLineColor = "Blue"
opts_z@gsnContourLineThicknessesScale = 3.0
; MAKE PLOTS
if ( pressure .eq. 850 ) then ; plot temp, rh, height, wind barbs
opts_z@ContourParameters = (/ 1400.,1600.,20.0 /)
contour_height = wrf_contour(a,wks, z_plane,opts_z)
plot =
wrf_map_overlays(a,wks,(/contour_rh,contour_tc,contour_height, \
vector/),pltres,mpres)
end if
delete(opts_z)
end do ; END OF LEVEL LOOP
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
end do ; END OF TIME LOOP
end
how can i make script for accumulated precipitation
thank you
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Sun Dec 1 05:56:10 2013
This archive was generated by hypermail 2.1.8 : Wed Dec 04 2013 - 20:42:38 MST