Re: Regridding Daymet Joined Tiles with ESMF_Regridding on NCL 6.1.0

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Tue Oct 30 2012 - 14:27:58 MDT

What version of gcc do you have?

   gcc --version

We build NCL and the ESMF regridding tool with version 4.5.0 of gcc. If I type:

% locate libgomp.1.dylib

It echoes:

/opt/local/lib/gcc43/libgomp.1.dylib
/opt/local/lib/gcc44/libgomp.1.dylib
/usr/local/gfortran-4.5/lib/i386/libgomp.1.dylib
/usr/local/gfortran-4.5/lib/libgomp..dylib
/usr/local/lib/libgomp.1.dylib

If you have an older gcc, then libgomp.1.dylib may not be available. You can install a newer version of gcc (and hence get libgomp.1.dylib) using:

http://hpc.sourceforge.net
http://www.macports.org

I *believe* that if the 4.5.0 compiler is not availble, you can download 4.6 or 4.7 and it should work.

--Mary

On Oct 29, 2012, at 9:44 PM, Ping Yang wrote:

> Hi NCL,
>
> I am new to the ESMF_Regridding in NCL6.1.0.
>
> I followed the script template(Templates/ESMF_curv_to_1deg.ncl)and also combined it with the example 8, my Script:
>
> 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"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/esmf/ESMF_regridding.ncl"
> begin
>
> ;---Data file containing source grid
> src_file = "~/Data/Daymet_NE_20100418_prcp.nc"
> sfile = addfile(src_file,"r")
> dst_file = "~/Data/Daymet_NE_20100418_Regridded_prcp.nc"
> dfile = addfile(dst_file,"c")
> ;---Get variable to regrid
> varname = "prcp"
> var = sfile->$varname$
> src_lat = sfile->lat ;;---Change (maybe)
> src_lon = sfile->lon ;;---Change (maybe)
> ;---Set up regridding options
> Opt = True
> Opt@SrcFileName = src_file ; Name of source and
> Opt@DstFileName = dst_file ; destination files
> ;---"bilinear" is the default. "patch" and "conserve" are other options.
> Opt@InterpMethod = "bilinear"
> Opt@WgtFileName = "curv_to_3minute.nc"
>
> Opt@SrcGridLat = src_lat ; source grid
> Opt@SrcGridLon = src_lon
> Opt@SrcRegional = True ;;--Change (maybe)
> Opt@DstRegional = True
> ; Opt@SrcInputFileName = src_file ; optional, but good idea
> ; Opt@DstGridType = "3min" ; Destination grid
> ; Opt@DstLLCorner = (/-84.025d,50.125d /) ;;--Change (likely)
> ; Opt@DstURCorner = (/-64.875d,34.875d /) ;;--Change (likely)
> ; Opt@DstRegional = True ;;--Change (maybe)
>
> newlon = fspan(-84.025,-64.875,384)
> newlat = fspan(34.875,50.125,306)
>
> ;---Create the destination lat/lon grid
> ; lat = fspan( 53.2420, 85.4022,nlat)
> ; lon = fspan(135.7750,258.1880,nlon)
>
> Opt@DstGridType = "rectilinear"
> Opt@DstGridLat = newlat
> Opt@DstGridLon = newlon
>
> Opt@SrcRegional = True
> Opt@DstRegional = True
>
> Opt@ForceOverwrite = True
> Opt@PrintTimings = True
> Opt@Debug = True
>
> var_regrid = ESMF_regrid(var,Opt) ; Do the regridding
> printVarSummary(var_regrid)
>
> ;----------------------------------------------------------------------
> ; Plotting section
> ;
> ; This section creates filled contour plots of both the original
> ; data and the regridded data, and panels them.
> ;----------------------------------------------------------------------
> var@lat2d = src_lat ; Needed for plotting.
> var@lon2d = src_lon
>
> wks = gsn_open_wks("pdf","curv_to_3min")
> xwks = gsn_open_wks("x11","curv_to_3min")
>
> res = True
>
> res@gsnMaximize = True
>
> res@gsnDraw = False
> res@gsnFrame = False
>
> res@cnFillOn = True
> res@cnLinesOn = False
> res@cnLineLabelsOn = False
> res@cnFillMode = "RasterFill"
>
> res@lbLabelBarOn = False ; Turn on later in panel
>
> res@mpMinLatF = min(src_lat)
> res@mpMaxLatF = max(src_lat)
> res@mpMinLonF = min(src_lon)
> res@mpMaxLonF = max(src_lon)
>
> ;;--Change (likely)
> ; res@cnLevelSelectionMode = "ManualLevels"
> ; res@cnMinLevelValF = 0
> ; res@cnMaxLevelValF = 200
> ; res@cnLevelSpacingF = 10
>
> ;---Resources for plotting regridded data
> res@gsnAddCyclic = False ;;---Change (maybe)
> res@tiMainString = "3 min grid (" + Opt@InterpMethod + ")"
>
> plot_regrid_p = gsn_csm_contour_map(wks,var_regrid,res)
> plot_regrid_x = gsn_csm_contour_map(xwks,var_regrid,res)
>
> ;---Resources for plotting original data
> dims = tostring(dimsizes(var))
> res@gsnAddCyclic = False ;;---Change (maybe)
> res@tiMainString = "Original curvilinear grid (" + \
> str_join(dims," x ") + ")"
>
> plot_orig_p = gsn_csm_contour_map(wks,var,res)
> plot_orig_x = gsn_csm_contour_map(xwks,var,res)
> ;---Compare the plots in a panel
> pres = True
> pres@gsnMaximize = True
> pres@gsnPanelLabelBar = True
>
> gsn_panel(wks,(/plot_orig_p,plot_regrid_p/),(/2,1/),pres)
> gsn_panel(xwks,(/plot_orig_x,plot_regrid_x/),(/2,1/),pres)
> end
>
> However, I got the following error:
>
> (0) 'ESMF_RegridWeightGen --source source_grid_file.nc --destination destination_grid_file.nc --weight curv_to_3minute.nc --method bilinear --src_regional --dst_regional -i --64bit_offset'
> (0) --------------------------------------------------
> dyld: Library not loaded: /usr/local/lib/libgomp.1.dylib
> Referenced from: /usr/local/bin/ESMF_RegridWeightGen
> Reason: image not found
> (0) ESMF_regrid_gen_weights: output from 'ESMF_RegridWeightGen':
> (0) missing
> (0) --------------------------------------------------
> fatal:The result of the conditional expression yields a missing value. NCL can not determine branch, see ismissing function
> fatal:["Execute.c":7743]:Execute: Error occurred at or near line 2290 in file $NCARG_ROOT/lib/ncarg/nclscripts/esmf/ESMF_regridding.ncl
>
> fatal:["Execute.c":7743]:Execute: Error occurred at or near line 3133 in file $NCARG_ROOT/lib/ncarg/nclscripts/esmf/ESMF_regridding.ncl
>
> fatal:["Execute.c":7743]:Execute: Error occurred at or near line 63 in file ESMF_Regridding.ncl
>
> Any hint on this? I am running the NCL6.1.0 on the Mac OX 10.7.
>
> Looking forward to hearing from.
>
> Regards,
>
> Ping
>
>
> _______________________________________________
> 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 Tue Oct 30 14:28:07 2012

This archive was generated by hypermail 2.1.8 : Wed Oct 31 2012 - 09:14:12 MDT