Regridding using conserve method

From: Rike Völpel <Rike_V_at_nyahnyahspammersnyahnyah>
Date: Wed Sep 25 2013 - 12:48:03 MDT
Dear NCL-Talk,
I´m running the newest version of NCL, trying to regrid river runoff from a POP gx3v5 to the cubed sphere grid of the MITgcm. I would like to use the conserve method, thus providing both lat/lon grid center and lat/lon grid corners for the source and destination grid. The description for the source lat/lon grid center and lat/lon grid corners is stored under a different file ( than the variable ( I´m going to regrid. Can this cause a problem?
When running the script I get the following error message:
(0)     write_grid_description: source lat dims = (11600)
(0)     write_grid_description: source lon dims = (11600)
(0)     write_grid_description: source grid type is 'curvilinear'
fatal:Number of dimensions in parameter (1) of (curvilinear_to_SCRIP) is (1), (2) dimensions were expected
fatal:["Execute.c":8128]:Execute: Error occurred at or near line 3011 in file $NCARG_ROOT/lib/ncarg/nclscripts/esmf/ESMF_regridding.ncl
fatal:["Execute.c":8128]:Execute: Error occurred at or near line 3122 in file $NCARG_ROOT/lib/ncarg/nclscripts/esmf/ESMF_regridding.ncl
fatal:["Execute.c":8128]:Execute: Error occurred at or near line 83 in file curv_2_unstr.ncl
The script I´m using looks like this so far:
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/esmf/ESMF_regridding.ncl"
;---Data file containing source grid
    src_file = ""                  
    sfile    = addfile(src_file,"r")
;---Get variable to regrid
    var_file = ""
    vfile    = addfile(var_file,"r")
    var      = vfile->ROFF_F  
    src_lat  = vfile->TLAT                  
    src_lon  = vfile->TLONG                  
;---Data file containing destination grid
    dst_file = ""                    
    dfile    = addfile(dst_file,"r")
    dst_lat  = dfile->grid_center_lat
    dst_lon  = dfile->grid_center_lon
;---Set up regridding options
    Opt                   = True
    Opt@InterpMethod      = "conserve"     
    Opt@WgtFileName       = ""
    Opt@SrcGridType      = "curvilinear"
    Opt@SrcGridLat       = sfile->grid_center_lat
    Opt@SrcGridLon       = sfile->grid_center_lon
    Opt@SrcGridCornerLat = sfile->grid_corner_lat
    Opt@SrcGridCornerLon = sfile->grid_corner_lon
    Opt@SrcRegional       = False             ;;--Change (maybe)
    Opt@SrcMask2D         = where(.not.ismissing(var),1,0)
    Opt@DstGridType      = "unstructured"
    Opt@DstGridLat       = dst_lat
    Opt@DstGridLon       = dst_lon
    Opt@DstGridCornerLat = dfile->grid_corner_lat
    Opt@DstGridCornerLon = dfile->grid_corner_lon
    Opt@DstRegional      = False             ;;--Change (maybe)
    Opt@DstMask2D        = where(.not.ismissing(dst_lat).and.\
    Opt@ForceOverwrite    = True
    Opt@PrintTimings      = True
    Opt@Debug             = True
    runoff_regrid = ESMF_regrid(var,Opt)    
So I think ESMF_regrid has trouble with my array sizes? Or do I get anything else wrong? I would really appreciate your help! 
Thanks in advance!

ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
Received on Wed Sep 25 12:48:18 2013

This archive was generated by hypermail 2.1.8 : Tue Oct 01 2013 - 14:41:43 MDT