Hi Everyone,
I have some problems trying to plot the one hour maximum value that seems to be in one dimension. I also tried to change the 2D array.
Here is my code and I really need some help.
;########################################
load"/home/edith/NCARG/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load"/home/edith/NCARG/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
load"/home/edith/NCARG/lib/ncarg/nclscripts/wrf/WRF_contributed.ncl"
load"/home/edith/NCARG/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"
load"/home/edith/NCARG/lib/ncarg/nclscripts/csm/shea_util.ncl"
begin
USE_WRF_MAP_PROJECTION = False
filename = "1-h Maximum rainfall "
DATADir = "/home/edith/Documents/NCL_usb/"
Files = systemfunc (" ls -1 " + DATADir + "wrfhrly_d02_2000-1* ")
ntimes = dimsizes(Files) ; number of times in the file
print(ntimes)
print(Files)
do i=1,ntimes-1,1
a = addfile(Files(i) +".nc","r")
nc1 = wrf_user_getvar(a,"RAINNC",i)
nc2 = wrf_user_getvar(a,"RAINNC",i+1)
RNC = nc2 - nc1
cv1 = wrf_user_getvar(a,"RAINC",i)
cv2 = wrf_user_getvar(a,"RAINC",i+1)
RC = nc2 - nc1
RAIN = RNC + RC
RAINF= dim_max(RAIN) ; Help in this line
print(RAINF)
wks = gsn_open_wks("pdf","rosa") ; "ps", "pdf", "png"
gsn_define_colormap(wks,"WhBlGrYeRe")
;---Set some resources
res = True
res@gsnMaximize = True ; maximize plot in frame
res@cnFillOn = True ; turn on contour fill
res@cnLinesOn = False ; turn off contour lines
res@cnLineLabelsOn = False ; turn off line labels
res@gsnAddCyclic = False ; set to False if plotting regional data
res@tiMainString = filename
res@lbOrientation = "Horizontal" ;bar
res@cnLevelSelectionMode = "ManualLevels"
res@cnMinLevelValF = 0
res@cnMaxLevelValF = 80
res@cnLevelSpacingF = 5
res@gsnPaperOrientation = "auto"
res@gsnMaximize = True ; must include w/ Paper Orientation
if(USE_WRF_MAP_PROJECTION) then
; This function looks at the global attributes on the WRF output
; file and sets some map resources based on their values.
;
res = wrf_map_resources(a,res)
res@tfDoNDCOverlay = True ; No lat/lon coordinates required
else
RAINF@lat2d = a->XLAT(0,:,:) ; Lat/lon coordinates required
RAINF@lon2d = a->XLONG(0,:,:)
res@mpProjection = "CylindricalEquidistant"
res@mpMinLatF = min(RAINF@lat2d)
res@mpMaxLatF = max(RAINF@lat2d)
res@mpMinLonF = min(RAINF@lon2d)
res@mpMaxLonF = max(RAINF@lon2d)
res@mpCenterLonF = (res@mpMinLonF + res@mpMaxLonF) / 2.
res@mpDataBaseVersion = "MediumRes" ; better map outlines
res@gsnAddCyclic= False
res@sfXArray= lon2d
res@sfYArray= lat2d
end if
end do
plot = gsn_csm_contour_map(wks,RAINF,res)
end
Virginia Edith Cortes Hernandez
School of Civil, Environmental & Mining Engineering
The University of Adelaide
Adelaide, South Australia, 5005
Australia
Tel +618-8313-NNNN
Fax +618-8313-4359
Email virginia.corteshernandez@adelaide.edu.au
CRICOS Provider Number 00123M
-----------------------------------------------------------
This email message is intended only for the addressee(s) and
contains information that may be confidential and/or copyright.
If you are not the intended recipient please notify the sender
by reply email and immediately delete this email. Use, disclosure
or reproduction of this email by anyone other than the intended
recipient(s) is strictly prohibited. No representation is made
that this email or any attachments are free of viruses. Virus
scanning is recommended and is the responsibility of the recipient.
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Mar 28 01:46:40 2014
This archive was generated by hypermail 2.1.8 : Mon Mar 31 2014 - 11:47:09 MDT