modify netCDF data and save (updated + code)

From: Guan Song <songguan1981_at_nyahnyahspammersnyahnyah>
Date: Sun, 2 Dec 2007 05:43:54 -0500

Hi

Sorry to send again but I update with my code, it seems work but still have problems. As code shows, I would like to change initial soil moisture fields but I can only change to uniform values (o) since the dimension is not balanced.

I highlighted the code that I have some problems

I want to use NCL to modify wrfinput_d01.nc file

In
my project, I want to do the sensitivity test of initial soil moisture.
So I decided to modify the initial soil moisture value in
wrfinput_d01.nc file.

I can use NCL to read SMOIS from wrfinput_d01 file and plot it.

However, I am not sure how to modify SMOIS values and still save in the wrfinput_d01.nc file.

Can you give me some suggestions?

Thank you so much,
Guan

----------------------------------------------------------------------------

load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"

begin

a=addfile("/home/blw3g/wrf/WRFV2/run/guan.nc","w")
type="x11"
wks=gsn_open_wks(type,"plt_Surface")

ARWres=True
ARWres_at_MainTitle="REAL-TIME WRF"

times=wrf_user_list_times(a) ; GET TIMES IN THE FILE
ntimes=dimsizes (times) ;NUMBER OF TIMES IN THE FILE

do it=0,2 ;WE ARE ONLY INTERESTED IN THE LAST TIME
ARWres_at_TimeLabel = times (it);keep some time information
mpres=True
map=wrf_map(wks,a,mpres)

soil=wrf_user_getvar(a,"SMOIS",it)

;sltyp=wrf_user_getvar(a,"IVGTYP",it)
;ivgtyp=wrf_user_getvar(a,"ISLTYP",it)

a ->SMOIS=(/0/) ; this statement currently work but total grids are uniform as 0***********;soil=soil*0.2 ;; this is my idea so I can make initial soil moisture still heterogeneity;a ->SMOIS=(/soil/) ;;but it did not work since the right hand and left hand dimension did not balance**********
opts=ARWres

;contour_veg=wrf_contour(a,wks,ivgtyp(:,:),opts)
contour_soil=wrf_contour(a,wks,soil(:,:,1),opts)
opts= ARWres

wrf_map_overlay(wks,map,(/contour_soil/),True)
;wrf_map_overlay(wks,map,(/contour_sty/),True)
;wrf_map_overlay(wks,map,(/contour_veg/),True)
end do

end

--------------------------------------------------------------------------------------------

________________________________

_________________________________________________________________
Put your friends on the big screen with Windows Vista® + Windows Live™.
http://www.microsoft.com/windows/shop/specialoffers.mspx?ocid=TXT_TAGLM_CPC_MediaCtr_bigscreen_102007

_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Sun Dec 02 2007 - 03:43:54 MST

This archive was generated by hypermail 2.2.0 : Mon Dec 03 2007 - 10:54:09 MST