<div dir="ltr"><div>Dear Uma S. Bhatt,</div><div><br></div><div>Why don't you create your <a href="http://wind.gs">wind.gs</a> file automatically in the Shell script and then run grads subsequently in the same script? <br></div><div>See the following script of mine. I hope it helps you to write your own.</div><div><br></div><div>#!/bin/bash<br><br>MODEL=/home/kishore/Desktop/WRFV3.8.1<br><br>dm=02<br>yr=2018<br>mn=01<br>sdy=01<br>edy=02<br>sh=00<br>eh=18<br><br><br>STATION=( GNDKT HRTHI ROYAL )<br>for stn in "${STATION[@]}"<br>do<br><br>if [ "$stn" = "GNDKT" ]<br>then<br>hgt=0.540,0.560,0.580</div><div><br>elif [ "$stn" = "HRTHI" ]<br>then<br>hgt=0.783,0.803,0.823<br><br>else<br>hgt=0.560,0.580,0.600<br><br>fi<br><br>cat << Eof > ${yr}-${mn}-${sdy}   #You can change your <a href="http://wind.gs">wind.gs</a> file name according to your inputs inside.<br>\$RP_INPUT<br><br>&datetime<br> start_date = '${yr}-${mn}-${sdy}_${sh}:00:00',<br> end_date   = '${yr}-${mn}-${edy}_${eh}:00:00',<br> interval_seconds = 3600,<br> tacc = 0,<br> debug_level = 1,<br>/<br><br>&io<br> input_root_name = '${MODEL}/WRFV3/test/em_real/wrfout_d${dm}_${yr}-${mn}-${sdy}*'   #you can bring in automatically to your <a href="http://wind.gs">wind.gs</a> grads code.<br> output_root_name = '${MODEL}/SITES/${stn}_${mn}-${sdy}'                                               #you can bring in automatically to your <a href="http://wind.gs">wind.gs</a> grads code.<br>plot = 'list'<br>fields = 'wdir,wspd'<br>mercator_defs = .true.<br>/<br>split_output = .true.<br>frames_per_outfile = 2<br><br><br>&interp<br>!interp_method = -1, ! 0 is model levels, -1 is nice height levels, 1 is user specified pressure/height<br><br>interp_method = 1,<br>interp_levels = ${hgt},    #This one you can bring in automatically to your <a href="http://wind.gs">wind.gs</a> grads code.<br><br>/<br><br>\$END<br>Eof<br><br>done</div><div><br></div><div>Then you can run the following<br></div><div><span style="font-variant-ligatures:no-common-ligatures"><span style="font-variant-ligatures:no-common-ligatures"><span style="font-variant-ligatures:no-common-ligatures">grads -bpcx "run new_created_name<a href="http://wind.gs" target="_blank">.gs</a>"</span></span></span></div><div><br></div><div>Hope this helps!</div><div><br></div><div>Regards,</div><div>Kishore<br></div><div><div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div><font size="4"><span style="color:rgb(0,0,0)"><b><span style="background-color:rgb(255,255,255)"></span></b></span></font></div><div><font size="2"><span style="color:rgb(0,0,0)"><b><span style="background-color:rgb(255,255,255)">Department of Chemistry,<br></span></b></span></font></div><div><font size="2"><span style="color:rgb(0,0,0)"><b><span style="background-color:rgb(255,255,255)">National Institute of Technology, Rourkela,<br></span></b></span></font></div><div><font size="2"><span style="color:rgb(0,0,0)"><b><span style="background-color:rgb(255,255,255)">India- 769008<br></span></b></span></font></div><div dir="ltr"><font size="2"><span style="color:rgb(0,0,0)"><b><span style="background-color:rgb(255,255,255)">Phone: +91-8908671881<br><br><a href="http://www.researchgate.net/profile/Kishore_Ragi" target="_blank">http://www.researchgate.net/profile/Kishore_Ragi</a><br><br><a href="https://in.linkedin.com/in/kishoreragi" target="_blank">https://in.linkedin.com/in/kishoreragi</a><br></span></b></span></font><br></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div><br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Mar 9, 2020 at 8:33 AM Uma Bhatt <<a href="mailto:usbhatt@alaska.edu">usbhatt@alaska.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="overflow-wrap: break-word;">Hi Grads Users,<div> </div><div> I am trying to automate the processing, calculations, and plotting of CFSv2 seasonal forecast products. </div><div><br></div><div> I have to loop through different time values and file names of CFSv2 files and it would be easier to loop through these in a bash shell. I am sure you can do it all in grads but I am less clear on how to do that. </div><div><br></div><div> I am using this version of grads:</div><div><div style="margin:0px;font-stretch:normal;font-size:13px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">Config: v2.1.0 little-endian readline grib2 netcdf hdf4-sds hdf5 opendap-grids,stn geotiff shapefile cairo</span></div><div style="margin:0px;font-stretch:normal;font-size:13px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">Issue 'q config' command for more detailed configuration information</span></div><div style="margin:0px;font-stretch:normal;font-size:13px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures"><br></span></div><div style="margin:0px;font-stretch:normal;font-size:13px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures"><br></span></div><div style="margin:0px;font-stretch:normal;font-size:13px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">In my script I loop through 8 ensemble members. The parameter name provides the name of when the particular ensemble starts. The tstart is the first time that I want to average over and tend is the last time I want to average over. I want to use these three variables in my grads script <a href="http://wind.gs" target="_blank">wind.gs</a> (not included here for simplicity. </span></div><div style="margin:0px;font-stretch:normal;font-size:13px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">I am stuck on the syntax of this line where I run the grads script. I want to provide these three variables to <a href="http://wind.gs" target="_blank">wind.gs</a>. I also call these variables in this script using $pref, $tw, and $te (something that works in fortran, but not here). </span></div><div style="margin:0px;font-stretch:normal;font-size:13px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures"><br></span></div><div style="margin:0px;font-stretch:normal;font-size:13px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">  grads -bpcx "run <a href="http://wind.gs" target="_blank">wind.gs</a> $pref $tw $te”</span></div><div style="margin:0px;font-stretch:normal;font-size:13px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures"><br></span></div><div style="margin:0px;font-stretch:normal;font-size:13px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">I added an export statement in the upper part of the bash shell but that did not work. I am sure I am doing something stupid. </span></div><div style="margin:0px;font-stretch:normal;font-size:13px;line-height:normal;font-family:Menlo">Thanks,</div><div style="margin:0px;font-stretch:normal;font-size:13px;line-height:normal;font-family:Menlo">Regards,</div><div style="margin:0px;font-stretch:normal;font-size:13px;line-height:normal;font-family:Menlo">Uma Bhatt</div><div style="margin:0px;font-stretch:normal;font-size:13px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures"><br></span></div><div style="margin:0px;font-stretch:normal;font-size:13px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures"><br></span></div><div style="margin:0px;font-stretch:normal;font-size:13px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures"> My script looks like this:</span></div><div style="margin:0px;font-stretch:normal;font-size:13px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures"><br></span></div><div style="margin:0px;font-stretch:normal;font-size:13px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures"><div style="margin:0px;font-stretch:normal;line-height:normal"><span style="font-variant-ligatures:no-common-ligatures">#!/bin/bash</span></div><div style="margin:0px;font-stretch:normal;line-height:normal"><span style="font-variant-ligatures:no-common-ligatures">#name=("0100" "0106" "0112" "0118" "0200" "0206" "0212" "0218")</span></div><div style="margin:0px;font-stretch:normal;line-height:normal"><span style="font-variant-ligatures:no-common-ligatures">#tstart=(28 27 26 25 24 23 22 21 )</span></div><div style="margin:0px;font-stretch:normal;line-height:normal"><span style="font-variant-ligatures:no-common-ligatures">#tend=(55 54 53 52 51 50 49 48)</span></div><div style="margin:0px;font-stretch:normal;line-height:normal;min-height:15px"><span style="font-variant-ligatures:no-common-ligatures"></span><br></div><div style="margin:0px;font-stretch:normal;line-height:normal"><span style="font-variant-ligatures:no-common-ligatures">limit=1</span></div><div style="margin:0px;font-stretch:normal;line-height:normal"><span style="font-variant-ligatures:no-common-ligatures">for ((nvar=0;nvar <= limit; nvar++))</span></div><div style="margin:0px;font-stretch:normal;line-height:normal"><span style="font-variant-ligatures:no-common-ligatures">do</span></div><div style="margin:0px;font-stretch:normal;line-height:normal"><span style="font-variant-ligatures:no-common-ligatures">echo  "$nvar"</span></div><div style="margin:0px;font-stretch:normal;line-height:normal;min-height:15px"><span style="font-variant-ligatures:no-common-ligatures"></span><br></div><div style="margin:0px;font-stretch:normal;line-height:normal"><span style="font-variant-ligatures:no-common-ligatures">pref=${name["$nvar"]}</span></div><div style="margin:0px;font-stretch:normal;line-height:normal"><span style="font-variant-ligatures:no-common-ligatures">echo  "$pref"</span></div><div style="margin:0px;font-stretch:normal;line-height:normal"><span style="font-variant-ligatures:no-common-ligatures">tw=${tstart["$nvar"]}</span></div><div style="margin:0px;font-stretch:normal;line-height:normal"><span style="font-variant-ligatures:no-common-ligatures">echo  "$tw"</span></div><div style="margin:0px;font-stretch:normal;line-height:normal"><span style="font-variant-ligatures:no-common-ligatures">te=${tend["$nvar"]}</span></div><div style="margin:0px;font-stretch:normal;line-height:normal"><span style="font-variant-ligatures:no-common-ligatures">echo  "$te"</span></div><div style="margin:0px;font-stretch:normal;line-height:normal;min-height:15px"><span style="font-variant-ligatures:no-common-ligatures"></span><br></div><div style="margin:0px;font-stretch:normal;line-height:normal"><span style="font-variant-ligatures:no-common-ligatures">#export $pref</span></div><div style="margin:0px;font-stretch:normal;line-height:normal"><span style="font-variant-ligatures:no-common-ligatures">#export $tw</span></div><div style="margin:0px;font-stretch:normal;line-height:normal"><span style="font-variant-ligatures:no-common-ligatures">#export $te</span></div><div style="margin:0px;font-stretch:normal;line-height:normal;min-height:15px"><span style="font-variant-ligatures:no-common-ligatures"></span><br></div><div style="margin:0px;font-stretch:normal;line-height:normal"><span style="font-variant-ligatures:no-common-ligatures">cat << EOR > <a href="http://wind.gs" target="_blank">wind.gs</a></span></div><div><span style="font-variant-ligatures:no-common-ligatures"><br></span></div><div><span style="font-variant-ligatures:no-common-ligatures">…….text snipped…...</span></div><div><span style="font-variant-ligatures:no-common-ligatures"><br></span></div><div><span style="font-variant-ligatures:no-common-ligatures">EOR</span></div><div><span style="font-variant-ligatures:no-common-ligatures"><br></span></div><div><span style="font-variant-ligatures:no-common-ligatures"><div style="margin:0px;font-stretch:normal;line-height:normal"><span style="font-variant-ligatures:no-common-ligatures">  echo "$pref"</span></div><div style="margin:0px;font-stretch:normal;line-height:normal"><span style="font-variant-ligatures:no-common-ligatures">  grads -bpcx "run <a href="http://wind.gs" target="_blank">wind.gs</a> $pref $tw $te"</span></div><div style="margin:0px;font-stretch:normal;line-height:normal;min-height:15px"><span style="font-variant-ligatures:no-common-ligatures"></span><br></div><div style="margin:0px;font-stretch:normal;line-height:normal"><span style="font-variant-ligatures:no-common-ligatures"># nvar=$(($nvar+1))</span></div><div style="margin:0px;font-stretch:normal;line-height:normal;min-height:15px"><span style="font-variant-ligatures:no-common-ligatures"></span><br></div><div style="margin:0px;font-stretch:normal;line-height:normal"><span style="font-variant-ligatures:no-common-ligatures">done</span></div><div style="margin:0px;font-stretch:normal;line-height:normal;min-height:15px"><span style="font-variant-ligatures:no-common-ligatures"></span><br></div><div style="margin:0px;font-stretch:normal;line-height:normal;min-height:15px"><span style="font-variant-ligatures:no-common-ligatures"></span><br></div><div style="margin:0px;font-stretch:normal;line-height:normal"><span style="font-variant-ligatures:no-common-ligatures">echo "Fin del script"</span></div><div><span style="font-variant-ligatures:no-common-ligatures"><br></span></div></span></div></span></div><div><div>
<div dir="auto" style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><div dir="auto" style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><div dir="auto" style="text-align:start;text-indent:0px"><div dir="auto" style="text-align:start;text-indent:0px"><div dir="auto" style="text-align:start;text-indent:0px"><div dir="auto" style="text-align:start;text-indent:0px"><div dir="auto" style="text-align:start;text-indent:0px"><div dir="auto" style="text-align:start;text-indent:0px"><div dir="auto" style="text-align:start;text-indent:0px"><div dir="auto" style="text-align:start;text-indent:0px"><div dir="auto" style="text-align:start;text-indent:0px"><div dir="auto" style="text-align:start;text-indent:0px"><div dir="auto" style="text-align:start;text-indent:0px"><div dir="auto" style="text-align:start;text-indent:0px"><div dir="auto" style="text-align:start;text-indent:0px"><div dir="auto" style="text-align:start;text-indent:0px"><div dir="auto" style="text-align:start;text-indent:0px"><div dir="auto" style="text-align:start;text-indent:0px"><div dir="auto" style="text-align:start;text-indent:0px"><div dir="auto" style="text-align:start;text-indent:0px"><div dir="auto" style="text-align:start;text-indent:0px"><div dir="auto" style="text-align:start;text-indent:0px"><div dir="auto" style="text-align:start;text-indent:0px"><div dir="auto" style="text-align:start;text-indent:0px"><div style="text-align:start;text-indent:0px"><div style="text-align:start;text-indent:0px"><div style="text-align:start;text-indent:0px"><div style="text-align:start;text-indent:0px"><div style="text-align:start;text-indent:0px"><div style="text-align:start;text-indent:0px"><div style="text-align:start;text-indent:0px"><div style="text-align:start;text-indent:0px"><div style="text-align:start;text-indent:0px"><div style="text-align:start;text-indent:0px"><div style="text-align:start;text-indent:0px"><div style="text-align:start;text-indent:0px"><div style="text-align:start;text-indent:0px"><div style="text-align:start;text-indent:0px"><div style="text-align:start;text-indent:0px"><div style="text-align:start;text-indent:0px"><div style="text-align:start;text-indent:0px"><div style="text-align:start;text-indent:0px"><div style="text-align:start;text-indent:0px"><div style="text-align:start;text-indent:0px"><div style="text-align:start;text-indent:0px"><div style="text-align:start;text-indent:0px"><div style="overflow-wrap: break-word;"><div style="color:rgb(0,0,0);letter-spacing:normal;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;text-align:start;text-indent:0px">——————</div><div style="text-align:start;text-indent:0px">A brand is what a business does, reputation is what people remember.<br>- Ted Rubin</div><div style="color:rgb(0,0,0);letter-spacing:normal;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;text-align:start;text-indent:0px"><br></div><div style="color:rgb(0,0,0);letter-spacing:normal;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;text-align:start;text-indent:0px">Uma S. Bhatt<br>Professor of Atmospheric Sciences & Geophysical Institute, <br>Director Cooperative Institute for Alaska Research<br>physical location: Akasofu (IARC) Building (2158 Koyukuk Drive), office location: Room 315 Akasofu</div><div style="color:rgb(0,0,0);letter-spacing:normal;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;text-align:start;text-indent:0px"><i><br></i></div><div style="color:rgb(0,0,0);letter-spacing:normal;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;text-align:start;text-indent:0px"><i>mailing address:</i><br>University of Alaska Fairbanks</div><div style="color:rgb(0,0,0);letter-spacing:normal;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;text-align:start;text-indent:0px">Geophysical Institute<br>2156 Koyukuk Drive                          <br>Fairbanks, Alaska  99775-7320<br><br>tel: (907) 474-2662  fax: (907) 474-2643<br><br><a href="mailto:usbhatt@alaska.edu" target="_blank">email: usbhatt@alaska.edu</a><br>web: <a href="http://ffden-2.phys.uaf.edu/usbhatt/" target="_blank">http://ffden-2.phys.uaf.edu/usbhatt/</a></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>
</div>
<br></div></div></div>_______________________________________________<br>
gradsusr mailing list<br>
<a href="mailto:gradsusr@gradsusr.org" target="_blank">gradsusr@gradsusr.org</a><br>
<a href="http://gradsusr.org/mailman/listinfo/gradsusr" rel="noreferrer" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
</blockquote></div>