<div dir="ltr">Hi Dennis,<div><br></div><div>I am sorry for the confusing email. I will do the changes you suggest me.</div><div><br></div><div>Thank you very much,</div><div>Mirce.</div></div><br><div class="gmail_quote"><div dir="ltr">El jue., 6 dic. 2018 a las 8:15, Dennis Shea (<<a href="mailto:shea@ucar.edu">shea@ucar.edu</a>>) escribió:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Your email is a confusing. <br></div><div><br></div><div>Reset the following:</div><div>opt@CopyVarCoords  = True <br></div><div><br></div><div>===</div><div><div><i>   XLAT_SOURCE = sfile->XLAT</i></div><div><i>   XLONG_SOURCE  = sfile->XLONG</i></div></div><div><pre>; writing to netCDF<br></pre><pre> system(...)   ; remove any preexisting file<br> fout = addfile(... ,"c")<br><br></pre><pre> fout->T2 = ... regrid variable...<br></pre><pre><i> <span style="font-family:monospace,monospace">fout->XLAT = XLAT_SOURCE</span></i><span style="font-family:monospace,monospace"><i><br> fout->XLONG = XLONG_SOURCE</i></span></pre></div></div><br><div class="gmail_quote"><div dir="ltr">On Wed, Dec 5, 2018 at 10:08 PM Mirce Morales <<a href="mailto:mirce.morales@gmail.com" target="_blank">mirce.morales@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div><div dir="ltr">Hello all,</div><div dir="ltr"><br></div><div dir="ltr">I am trying to regrid some variables in my WRF output files (wrfout_d0*), to do it, I am taking as a guide the following script on the NCL web page:</div><div dir="ltr"><a href="https://www.ncl.ucar.edu/Applications/Scripts/ESMF_regrid_20.ncl" target="_blank">https://www.ncl.ucar.edu/Applications/Scripts/ESMF_regrid_20.ncl</a></div><div dir="ltr"><br></div><div dir="ltr">Up to now, I was able to run the script without error, but I see that if I do ncdump -h "My regridded file", there is like a matrix of numbers where the XLAT and XLONG should be, so it is not possible to see the variables and their attributes well....to avoid that, I found out I have to set opt@CopyVarCoords  = False.</div><div dir="ltr"><br></div><div dir="ltr">The problem is that when I do that, now I get the following kind of attributes in my regridded files:</div></div><div><br></div><div><div><i>netcdf wrfout_d03_2010-09-01_00\:00\:00 {</i></div><div><i>dimensions:</i></div><div><i>        ncl0 = 1 ;</i></div><div><i>        ncl1 = 156 ;</i></div><div><i>        ncl2 = 138 ;</i></div><div><i>        ncl3 = 1 ;</i></div><div><i>        ncl4 = 156 ;</i></div><div><i>        ncl5 = 138 ;</i></div><div><i>        ncl6 = 1 ;</i></div><div><i>        ncl7 = 156 ;</i></div><div><i>        ncl8 = 138 ;</i></div><div><i>        ncl9 = 1 ;</i></div><div><i>        ncl10 = 156 ;</i></div><div><i>        ncl11 = 138 ;</i></div><div><i>        ncl12 = 1 ;</i></div><div><i>        ncl13 = 156 ;</i></div><div><i>        ncl14 = 138 ;</i></div><div><i>        ncl15 = 1 ;</i></div><div><i>        ncl16 = 156 ;</i></div><div><i>        ncl17 = 138 ;</i></div><div><i>        ncl18 = 1 ;</i></div><div><i>        ncl19 = 156 ;</i></div><div><i>        ncl20 = 138 ;</i></div><div><i>        ncl21 = 1 ;</i></div><div><i>        ncl22 = 156 ;</i></div><div><i>        ncl23 = 138 ;</i></div><div><i>        ncl24 = 1 ;</i></div><div><i>        ncl25 = 156 ;</i></div><div><i>        ncl26 = 138 ;</i></div><div><i>        ncl27 = 1 ;</i></div><div><i>        ncl28 = 156 ;</i></div><div><i>        ncl29 = 138 ;</i></div><div><i>        ncl30 = 1 ;</i></div><div><i>        ncl31 = 156 ;</i></div><div><i>        ncl32 = 138 ;</i></div><div><i>variables:</i></div><div><i>        float T2(ncl0, ncl1, ncl2) ;</i></div><div><i>                T2:missing_value = 9.96921e+36f ;</i></div><div><i>                T2:remap = "remapped via ESMF_regrid_with_weights: Bilinear" ;</i></div><div><i>                T2:_FillValue = 9.96921e+36f ;</i></div><div><i>                T2:FieldType = 104 ;</i></div><div><i>                T2:MemoryOrder = "XY " ;</i></div><div><i>                T2:description = "TEMP at 2 M" ;</i></div><div><i>                T2:units = "K" ;</i></div><div><i>                T2:stagger = "" ;</i></div></div><div><i><br></i></div><div>When it should be similar to this:</div><div><i><br></i></div><div><div><i>netcdf wrfout_d03_2010-09-01_01\:00\:00 {</i></div><div><i>dimensions:</i></div><div><i><span style="white-space:pre-wrap">    </span>Time = UNLIMITED ; // (1 currently)</i></div><div><i><span style="white-space:pre-wrap">   </span>DateStrLen = 19 ;</i></div><div><i><span style="white-space:pre-wrap">     </span>west_east = 54 ;</i></div><div><i><span style="white-space:pre-wrap">      </span>south_north = 60 ;</i></div><div><i><span style="white-space:pre-wrap">    </span>bottom_top = 49 ;</i></div><div><i><span style="white-space:pre-wrap">     </span>bottom_top_stag = 50 ;</i></div><div><i><span style="white-space:pre-wrap">        </span>soil_layers_stag = 4 ;</i></div><div><i><span style="white-space:pre-wrap">        </span>west_east_stag = 55 ;</i></div><div><i><span style="white-space:pre-wrap"> </span>south_north_stag = 61 ;</i></div><div><i>variables:</i></div></div><div><div><i>float T2(Time, south_north, west_east) ;</i></div><div><i><span style="white-space:pre-wrap">          </span>T2:FieldType = 104 ;</i></div><div><i><span style="white-space:pre-wrap">          </span>T2:MemoryOrder = "XY " ;</i></div><div><i><span style="white-space:pre-wrap">            </span>T2:description = "TEMP at 2 M" ;</i></div><div><i><span style="white-space:pre-wrap">            </span>T2:units = "K" ;</i></div><div><i><span style="white-space:pre-wrap">            </span>T2:stagger = "" ;</i></div><div><i><span style="white-space:pre-wrap">           </span>T2:coordinates = "XLONG XLAT XTIME" ;</i></div></div><div><br></div><div>I don't know how to fix this....In case it helps, these are the regridding options I am using:</div><div><div><br></div><div><i>;---Open one WRF file </i></div><div><i>   sfile = addfile("../IMTAProy_BMJ/wrfout_d03_2010-10-31_16:00:00","r")    ; contains source grid</i></div><div><i> </i></div><div><i>;---Read lat/lon of source grid</i></div><div><i>    lat_src = sfile->XLAT(0,:,:)</i></div><div><i>    lon_src = sfile->XLONG(0,:,:)</i></div><div><i><br></i></div><div><i>;---Read lat/lon of destination grid</i></div><div><i>    lat_dst = dstfile->XLAT_M(0,:,:)</i></div><div><i>    lon_dst = dstfile->XLONG_M(0,:,:)</i></div><div><i>    </i></div><div><i>;---Options to pass to ESMF_regrid</i></div><div><i>    interp_method      = "bilinear"<br></i></div><div><i>    opt                        = True</i></div><div><i>    opt@SrcGridLat     = lat_src<br></i></div><div><i>    opt@SrcGridLon     = lon_src</i></div><div><i>    opt@DstGridLat     = lat_dst</i></div><div><i>    opt@DstGridLon     = lon_dst</i></div><div><i><br></i></div><div><i>    opt@SrcRegional    = True    ; Default is False</i></div><div><i>    opt@DstRegional    = True</i></div><div><i><br></i></div><div><i>    opt@CopyVarCoords  = False    ; This is the default in V6.1.0 (not 6.1.0-beta)</i></div><div><i>    opt@ForceOverwrite = True</i></div><div><i><br></i></div><div><i>;---Debug information</i></div><div><i>    opt@PrintTimings   = True</i></div><div><i>    opt@Debug          = True</i></div></div><div><div><br></div><div>In summary, I have the following doubts:</div><div><br></div><div>1) How can I keep the coordinates of each variable in a proper way?</div><div>2) How can I keep the dimensions exactly as in my source files?</div><div>3) To create the weight files in a separate script, is there any template I should base on for this case?</div><div>4) How can I add XLAT and XLONG in my regridded files like they are in the original wrfout* files?...like this:</div></div><div><br></div><div><div><i>variables:</i></div><div><i><span style="white-space:pre-wrap">       </span>char Times(Time, DateStrLen) ;</i></div><div><i><span style="white-space:pre-wrap">        </span>float XLAT(Time, south_north, west_east) ;</i></div><div><i><span style="white-space:pre-wrap">            </span>XLAT:FieldType = 104 ;</i></div><div><i><span style="white-space:pre-wrap">                </span>XLAT:MemoryOrder = "XY " ;</i></div><div><i><span style="white-space:pre-wrap">          </span>XLAT:description = "LATITUDE, SOUTH IS NEGATIVE" ;</i></div><div><i><span style="white-space:pre-wrap">          </span>XLAT:units = "degree_north" ;</i></div><div><i><span style="white-space:pre-wrap">               </span>XLAT:stagger = "" ;</i></div><div><i><span style="white-space:pre-wrap">         </span>XLAT:coordinates = "XLONG XLAT" ;</i></div><div><i><span style="white-space:pre-wrap">   </span>float XLONG(Time, south_north, west_east) ;</i></div><div><i><span style="white-space:pre-wrap">           </span>XLONG:FieldType = 104 ;</i></div><div><i><span style="white-space:pre-wrap">               </span>XLONG:MemoryOrder = "XY " ;</i></div><div><i><span style="white-space:pre-wrap">         </span>XLONG:description = "LONGITUDE, WEST IS NEGATIVE" ;</i></div><div><i><span style="white-space:pre-wrap">         </span>XLONG:units = "degree_east" ;</i></div><div><i><span style="white-space:pre-wrap">               </span>XLONG:stagger = "" ;</i></div><div><i><span style="white-space:pre-wrap">                </span>XLONG:coordinates = "XLONG XLAT" ;</i></div></div><div><br></div><div>I will really appreciate any help/clue about this.</div><div><br></div><div>In case it is helpful my script and files are in the following path in Cheyenne:</div><div><b>/glade/scratch/mirce/LaSierra/FullDomainForcing/WRF/second_option<br></b></div><div><br></div><div>If it would be better to paste here my the script I will be happy to do it!</div><div><br></div><div>Thanks a lot in advance!</div><div>Mirce.</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div></div></div></div></div></div></div></div></div></div></div></div>
_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
</blockquote></div>
</blockquote></div>