[ncl-talk] wrf domain plots

Mary Haley haley at ucar.edu
Tue May 3 09:36:51 MDT 2016


Regarding your second WRF question, I'm not sure what you mean that you
have to keep hitting "q".

If you run the script with simply:

  ncl myscript.ncl

where "myscript.ncl" is whatever name you gave the script, then it should
run to completion without waiting for any keystrokes.

--Mary



>>
>>
>> ------------------------------
>> From: rammetro at hotmail.com
>> To: ncl-talk at ucar.edu
>> Subject: help ncl script for extraction of station data
>> Date: Tue, 19 Apr 2016 16:59:55 +0200
>>
>> Dear NCL group,
>> I tried to extract hourly air temperature data from wrf out and used the
>> following scripts. would you figure out if there is any errors in it
>> because when i run it it stops with showing time information and then
>> pressing q several times it can execute the script but it is too time
>> consuming and difficult to work because i have to press q for the size of
>> times in file. I look foward for kind response
>>
>>
>>     ; --------------  LOAD FUNCTIONS AND PROCEDURES ----------------
>>
>>     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/wrf/WRFUserARW.ncl"
>>
>>     ; --------------  BEGINING OF NCL SCRIPT ----------------
>> begin
>> DATADir = "/mnt/gpfs1/data/private/fgvy024/Build_WRF/WRFV3/run/"
>> FILES = systemfunc (" ls -1 " + DATADir + "wrfout_d03* ")
>> numFILES = dimsizes(FILES)
>> a = addfiles(FILES+".nc","r")
>> ;times = wrf_user_list_times(a)     ; get times in the file
>> ntimes = 4320            ; number of times in the file
>> temp = new(ntimes,float)
>> do it = 0, ntimes-1                 ;Loop for the time:
>> time = it
>> ;************************************************
>>  ;  - Select lon & lat of the point of interest -
>>  ;************************************************
>>   ; - The function wrf_user_ll_to_ij find the nearest grid point for a
>> specific lat and lon
>>
>> Latitude = 27.959167  ;phakding
>> Longitude = 86.81278
>> res = True
>> res at returnInt = True
>> point = wrf_user_ll_to_ij(a,Longitude,Latitude,res)
>> x = point(0)-1
>> y = point(1)-1
>> ;tc2 = wrf_user_getvar(a,"HGT",it)     ; heigth extraction
>> tc2 = wrf_user_getvar(a,"T2",it)       ; temp extraction
>> tc2 = tc2 -273.16
>>
>> temp(it) = tc2(y,x)
>> end do
>>
>>     npts=ntimes
>>     fName = "pyramid_1km.txt"
>>     data  = new( npts, "string")
>>
>>
>>     print("  Time      temp       ")
>>
>>     do it = 0, ntimes-1 ;ntimes-1
>>
>>         print (sprintf("%5.0f",it)    +" " \
>>           +sprintf("%21.2f", temp(it)) +"  " )
>>
>>     end do                     ; end of time loop
>>
>>     do it = 0,ntimes-1 ;ntimes-1
>>
>>        data (it)= (sprintf("%5.0f",it)    +" " \
>>           +sprintf("%21.2f", temp(it)) +"  "  )
>>
>>  end do                     ; end of time loop
>>  asciiwrite (fName , data)
>> end
>>
>>
>> *RegardsRamchandra Karki*
>> *PhD Student,  *
>> *Institute of Geography, **University of Hamburg*
>> *Bundesstrase 55, Hamburg Germany*
>>
>>
>> _______________________________________________
>> ncl-talk mailing list
>> ncl-talk at ucar.edu
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160503/dcb7d59e/attachment.html 


More information about the ncl-talk mailing list