[Wrf-users] Wrf-users Digest, Vol 166, Issue 6

Thorsten Beisiegel tbeisiegel at unal.edu.co
Tue Jun 12 13:32:13 MDT 2018


Dear Mari,

a quiet easy and rapid way to produce a smaller netcdf would be using NCO,
as Tanya just adviced. Once you install NCO, the command line to get
smaller netcdf's would be:

ncrcat -O -d Time,<ini_time>,end_time> -d south_north,<nymin>,<nymax> -d
west_east,<nxmin>,<nxmax> -d bottom_top,0,<maxlevels> -v
Times,XLAT,XLONG,<var4>,var5>,... wrfout_in wrfout_out

Be aware not to include spaces where they should not be. With the option -d
you cut the archive by dimension and -v selects the variables. <ini_time>
and <end_time> are time steps. I recommend to include the variables
Times,XLAT and XLONG in your output.

regards,

Thorsten B.

2018-06-12 14:17 GMT-05:00 <wrf-users-request at ucar.edu>:

> Send Wrf-users mailing list submissions to
>         wrf-users at ucar.edu
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         http://mailman.ucar.edu/mailman/listinfo/wrf-users
> or, via email, send a message with subject or body 'help' to
>         wrf-users-request at ucar.edu
>
> You can reach the person managing the list at
>         wrf-users-owner at ucar.edu
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Wrf-users digest..."
>
>
> Today's Topics:
>
>    1. Re: How to crop a wrfout file (Barry Lynn)
>    2. Re: How to crop a wrfout file (Alex Fierro)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Tue, 12 Jun 2018 20:56:02 +0300
> From: Barry Lynn <barry.h.lynn at gmail.com>
> To: mortezapour88 at gmail.com
> Cc: "WRF, users" <wrf-users at ucar.edu>
> Subject: Re: [Wrf-users] How to crop a wrfout file
> Message-ID:
>         <CAN7Bv24tCMuWpAjUyn2k-PThZ6YWQNbVBe8e5tifZ4bj8EJQ+w@
> mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> Hi:
>
> Are you aware that you can write some of the wrf output variables to an
> external file?
>
> ;---Write variables to file
>
>
> Note, the names on the right are obtained with wrf_user..., for example:
>
>
> slp = wrf_user_getvar(a,"slp",it)
>
>
> (remove the ;)
>
> ;     system("rm -f file_for_you.nc")
>
> ;     fout = addfile("file_for_you.nc","c")
>
> ;     fout->pett_fgen = pett_fgen
>
> ;     fout->z_plane   = z_plane
>
> ;     fout->xlat      = xlat
>
> ;     fout->xlong     = xlong
>
>
> On Tue, Jun 12, 2018 at 5:37 PM M Mortezapour <mortezapour88 at gmail.com>
> wrote:
>
> > Hello,
> >
> > I have some wrfout files that I should use them in another program, but
> > they are too large. I need to crop a small part of them. I've searched a
> > lot, but I couldn't find an efficient way. Any help would be appreciated.
> >
> > Thanks,
> > Mari
> > _______________________________________________
> > Wrf-users mailing list
> > Wrf-users at ucar.edu
> > http://mailman.ucar.edu/mailman/listinfo/wrf-users
> >
>
>
> --
> Barry H. Lynn, Ph.D
> Senior Lecturer,
> The Institute of the Earth Science,
> The Hebrew University of Jerusalem,
> Givat Ram, Jerusalem 91904, Israel
> Tel: 972 547 231 170
> Fax: (972)-25662581
>
> C.E.O, Weather It Is, LTD
> Weather and Climate Focus
> http://weather-it-is.com
> Jerusalem, Israel
> Local: 02 930 9525
> Cell: 054 7 231 170
> Int-IS: x972 2 930 9525
> US 914 432 3108
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://mailman.ucar.edu/pipermail/wrf-users/
> attachments/20180612/89e20a79/attachment-0001.html>
>
> ------------------------------
>
> Message: 2
> Date: Tue, 12 Jun 2018 13:41:50 -0500
> From: Alex Fierro <alexandre.o.fierro at gmail.com>
> To: Barry Lynn <barry.h.lynn at gmail.com>
> Cc: "WRF, users" <wrf-users at ucar.edu>, mortezapour88 at gmail.com
> Subject: Re: [Wrf-users] How to crop a wrfout file
> Message-ID:
>         <CA+GhK9tzVuKpdF+NUBVK7UG_P61WJSJSqNwfc0MKcctoCQfnsA@
> mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> Hello:
>
> Given that NCL is notoriously slow at handling large IO files, you can also
> pre-process the wrfout files with a Fortran program using the NETCDF
> built-in functions ("use netcdf" and compile with appropriate netcdf
> libs/include files) such as:
>
> ! get v ID
>       status = NF90_INQ_VARID(ncid,'V',variddat)
>       if (status /= nf90_noerr) call handle_err(status)
> ! get v array
>       status =
> NF90_GET_VAR(ncid,variddat,vv,start=(/nxstart,nystart,1/),
> stride=(/xstride,ystride,zstride/))
>       if (status /= nf90_noerr) call handle_err(status)
>
> In NF90_GET_VAR() you can either specify a start-end point for each
> dimension and/or use striding. Another way of reducing the IO size at
> runtime is to remove unwanted variables in the namelist (function of
> maxdom) via the flag:
>
> &time_control
> ...
> iofields_filename                   = "my_iofields_list.txt",
> "my_iofields_list.txt"
>
>
> where:
>
> > cat my_iofields_list.txt
>
> -:h:0:glw,pot,vt_dbz_wt,rainsh,tlwdn,tlwup,slwdn,
> slwup,tswdn,tswup,sswdn,sswup,p_hyd,sciona,sh2o,smcrel,tke_
> pbl,tslb,cldfra,el_pbl,qnccn,qncloud,qnrain,qnhail,
> qngraupel,qnice,qvgraupel,qnsnow,smois,acgrdflx,achfx,
> aclhf,albbck,albedo,avg_fuel_frac,canwat
> -:h:0:cosalpha,e,emiss,f,graupelnc,grdflx,hailnc,hml,
> huml,hvml,isltyp,ivgtyp,lai,lu_index,mapfac_m,mapfac_mx,
> mapfac_my,mapfac_u,mapfac_ux,mapfac_uy,mapfac_v,mapfac_vx,
> mapfac_vy,mf_vx_inv,nest_pos,noahres,mu,mub,olr,pblh,q2,
> seaice,sfroff,sinalpha,snopcx
> -:h:0:snow,snowc,snowh,snownc,soiltb,sr,sstsk,swdown,swnorm,
> t0ml,t2,th2,tml,tmn,tmoml,tsk,uah,udroff,up_heli_max,ust,
> vah,vegfra,xicem,xland,xlat_u,xlat_v,xlong_u,xlong_v,h0ml,clnox
>
> Cheers and hope this helps,
>
> Alex-
>
>
> -------------------------------------------------------------
> Alexandre Fierro, PhD
> Research Scientist-
> National Severe Storms Laboratory (NSSL/NOAA)
> *The Cooperative Institute for Mesoscale Meteorological Studies* (OU/NOAA)
>
> "Yesterday is History, Tomorrow is a Mystery and Today is a Gift; That is
> why it is called the Present"
>
> "There are only 10 types of people in the world:
> Those who understand binary, and those who don't"
>
> "My opinions are my own and not representative of OU, NSSL,
> AOML, HRD, LANL or any affiliates."
>          ^.^
>        (o  o)
>      /(   V   )\
>    ---m---m----
>
> On 12 June 2018 at 12:56, Barry Lynn <barry.h.lynn at gmail.com> wrote:
>
> > Hi:
> >
> > Are you aware that you can write some of the wrf output variables to an
> > external file?
> >
> > ;---Write variables to file
> >
> >
> > Note, the names on the right are obtained with wrf_user..., for example:
> >
> >
> > slp = wrf_user_getvar(a,"slp",it)
> >
> >
> > (remove the ;)
> >
> > ;     system("rm -f file_for_you.nc")
> >
> > ;     fout = addfile("file_for_you.nc","c")
> >
> > ;     fout->pett_fgen = pett_fgen
> >
> > ;     fout->z_plane   = z_plane
> >
> > ;     fout->xlat      = xlat
> >
> > ;     fout->xlong     = xlong
> >
> >
> > On Tue, Jun 12, 2018 at 5:37 PM M Mortezapour <mortezapour88 at gmail.com>
> > wrote:
> >
> >> Hello,
> >>
> >> I have some wrfout files that I should use them in another program, but
> >> they are too large. I need to crop a small part of them. I've searched a
> >> lot, but I couldn't find an efficient way. Any help would be
> appreciated.
> >>
> >> Thanks,
> >> Mari
> >> _______________________________________________
> >> Wrf-users mailing list
> >> Wrf-users at ucar.edu
> >> http://mailman.ucar.edu/mailman/listinfo/wrf-users
> >>
> >
> >
> > --
> > Barry H. Lynn, Ph.D
> > Senior Lecturer,
> > The Institute of the Earth Science,
> > The Hebrew University of Jerusalem,
> > Givat Ram, Jerusalem 91904, Israel
> > Tel: 972 547 231 170
> > Fax: (972)-25662581
> >
> > C.E.O, Weather It Is, LTD
> > Weather and Climate Focus
> > http://weather-it-is.com
> > Jerusalem, Israel
> > Local: 02 930 9525
> > Cell: 054 7 231 170
> > Int-IS: x972 2 930 9525
> > US 914 432 3108
> >
> > _______________________________________________
> > Wrf-users mailing list
> > Wrf-users at ucar.edu
> > http://mailman.ucar.edu/mailman/listinfo/wrf-users
> >
> >
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://mailman.ucar.edu/pipermail/wrf-users/
> attachments/20180612/f2dae8af/attachment.html>
>
> ------------------------------
>
> Subject: Digest Footer
>
> _______________________________________________
> Wrf-users mailing list
> Wrf-users at ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/wrf-users
>
>
> ------------------------------
>
> End of Wrf-users Digest, Vol 166, Issue 6
> *****************************************
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/wrf-users/attachments/20180612/a5d38f36/attachment.html>


More information about the Wrf-users mailing list