Re: Memory Issue with WRF Functions

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Fri May 18 2012 - 13:49:51 MDT

Hi Gus,

What version of NCL are you running? We fixed a number of memory leaks and hogs before the release of version 6.0.0.

Can you provide us with the dataset and the full script so we can run your script through a profiler?

--Mary

On May 18, 2012, at 11:46 AM, Ghassan J. Alaka, Jr. wrote:

> Dear WRF Users,
>
> I have stumbled upon an apparent memory issue and am having difficulty resolving it. What I want to do is produce a .PNG for each variable and output time, but memory allocation goes up after each loop even though I delete all variables. In fact, I delete every variable that the list_vars() function returns and NCL still has memory allocated! It seems at least one of the WRF functions (wrf_contour or wrf_map_overlays) is allocating memory in a non-obvious way. Can someone provide some help or insight on how to solve this issue?
>
> Thanks,
> Gus
>
> Here is a snippet of code to give you a better idea of what I am doing:
>
> ;================================================================
> ; Load scripts
> ;================================================================
>
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"
>
> ;================================================================
> ; Begin the code.
> ;================================================================
>
> begin
>
> print("Time Started: "+systemfunc("date"))
> print("")
>
>
> ;================================================================
> ; User-defined.
> ;================================================================
>
> mov_dir = "/Users/galaka/Documents/Research/mov/"
>
> plot_type = "png"
> plot_type@wkWidth = 1500
> plot_type@wkHeight = 1500
>
> system("rm "+mov_dir+"*"+plot_type+"*")
>
> today = systemfunc("date +%Y%m%d")
> today2 = systemfunc("date +%Y-%m-%d")
>
>
> ;================================================================
> ; Variable Plotting.
> ;================================================================
>
> res = True
> res@MainTitle = "Metgrid Files"
> res@Footer = False
> res@cnFillOn = True
>
> pltres = True
> mpres = True
>
> opts = res
>
> print("")
> print("Domain #1")
> f = addfile("/maloney-scratch/datasets/WRF_output/"+today+"/wrfout_d01_"+today2+"_00:00:00.nc","r")
>
> ;D01 Variables
> lon = f->XLONG(0,0,:)
> lat = f->XLAT(0,0,:)
> times = chartostring(f->Times)
> nt = dimsizes(times)
>
> ;Base Reflectivity
> print("")
> print(" Base Reflectivity")
> do a = 1,nt-1
> dbz = wrf_user_getvar(f,"dbz",a)
>
> wks = gsn_open_wks(plot_type,mov_dir+"WRFout."+systemfunc("date +%Y%m%d")+"00.d01.basedbz"+sprinti("%0.3i",a))
> ;wks = gsn_open_wks(plot_type,"testing")
>
> res@TimeLabel = times(a)
>
>
> contour = wrf_contour(f,wks,dbz(1,:,:),res)
> plot = wrf_map_overlays(f,wks,(/contour/),pltres,mpres)
>
> delete(wks)
> delete(contour)
> delete(plot)
> delete(dbz)
> end do
> ;delete(lat)
> ;delete(lon)
> ;delete(times)
> ;delete(opts)
> ;delete(pltres)
> ;delete(today2)
> ;delete(mov_dir)
> ;delete(nt)
> ;delete(mpres)
> ;delete(plot_type)
> ;delete(res)
> ;delete(a)
> ;delete(today)
> ;list_vars()
> print("Sleeping")
> sleep(30)
> exit
>
> --
> Ghassan J. Alaka, Jr., Ph.D. Candidate
> Department of Atmospheric Science
> Colorado State University
> 1371 Campus Delivery
> Fort Collins, CO 80523-1371
>
> E:
> gusalaka@atmos.colostate.edu
>
> P: (970) 491-1487
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri May 18 13:50:00 2012

This archive was generated by hypermail 2.1.8 : Fri May 25 2012 - 08:35:50 MDT