Re: ESMF regridding - MPAS

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Fri Sep 21 2012 - 16:21:32 MDT

On Sep 21, 2012, at 3:57 PM, Sara Rauscher wrote:

> Hello,
>
> I am trying the new esmf regridding tools (from
> ncl_ncarg-6.1.0-beta.Linux_RedHat_x86_64_nodap_gcc444.tar.gz) to put
> CAM-MPAS unstructured output (approx 240km res) on to a CAM-FV grid. I
> can run it, but a few puzzling things happen:
>
> 1) I get an error message
>
> (0) Error: copy_VarCoords_n: arrays must be same rank, or second
> array must be subset in size of first array.

Hi Sara,

This may have been an issue that we fixed in a later version of NCL.
Are you using the latest ESMF_regridding file at:

http://www.ncl.ucar.edu/Applications/Files/ESMF_regridding.ncl
?

>
> My output variable has lat and lon coordinate variables, but the time
> variable is not copied. I have to do this myself in the script as shown
> below.

>
> 2) Whether I use bilinear or conservative remapping, the output field is
> the same - I've used both methods and ncdiffed the files. I had to take
> a stab at the corners for the FV grid.

If I understand the way you are using the code, then once you generate the weights
file, you can't change the interpolation method used. The weights file is generated
based on the interpolation method. If you want to switch between using
bilinear or conserve methods, then you will need to generate a separate
weights file for each.

--Mary

>
> I created a remapping file myself using ESMF. Here is 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 "esmf.ncl"
>
> test =
> addfile("/global/scratch/sd/rauscher/wrf/mpas_240km/test1.cam2.h2.0005-12-30-00000.nc","r")
> system("rm out2.nc")
> out = addfile("out2.nc","c")
> T850 = test->T850
>
> Opt = True
> Opt@Debug = True
> Opt@DstGridType = "rectilinear"
> ; Opt@InterpMethod = "conserve"
> Opt@InterpMethod = "bilinear"
> t850 = ESMF_regrid_with_weights(T850,"mpas10242tofv1.9x2.5.nc",Opt)
> Opt@DstLLCorner = (/-89.5263157894736d, 0.00d /)
> Opt@DstURCorner = (/ 89.5263157894736d, 357.5d /)
>
> copy_VarAtts(T850,t850)
> ;have to put in time coordinate variable
> t850!0 = "time"
> t850&time = test->time
> out->t850 = t850
>
> The output itself looks reasonable but shouldn't the bilinear and
> conserve methods yield different results? I can send along my mapping
> and data files but I didn't want to clog the list.
> I also used the modified esmf_regridding script provided at
> <http://www.ncl.ucar.edu/Applications/Files/ESMF_regridding.ncl>
>
> And here is the output from the debug:
>
> (0) ESMF_regrid_with_weights: regridding using interpolation weights ...
> (0) ESMF_regrid_with_weights: warning: destination grid is not completely
> (0) covered by the source grid.
> (0) ESMF_regrid_with_weights: Source Grid:
> (0) rank: 1
> (0) dimensions: 10242
> (0) original source rank: 2
> (0) latitude min/max: -90/90
> (0) longitude min/max:0.0589837/359.985
> (0) ESMF_regrid_with_weights: Destination Grid:
> (0) dimensions: 96 144
> (0) latitude min/max: -89.5263/89.5263
> (0) longitude min/max:0/357.5
> (0) ESMF_regrid_with_weights: retrieving interpolation weights ...
> (0) ESMF_regrid_with_weights: calling sparse_matrix_mult to apply
> weights...
> (0) ESMF_regrid_with_weights: dividing results by frac_b...
> (0) (for conserve interpolation only)
> (0) ESMF_regrid_with_weights: dstData
> (0) Dimensions: 4 96 144
> (0) minSrcData: 255.802
> (0) maxSrcData: 291.415
> (0) minDstData: 255.811
> (0) maxDstData: 290.915
> (0) Error: copy_VarCoords_n: arrays must be same rank, or second
> array must be subset in size of first array.
>
>
> Thanks, these tools are going to be so useful!
> sara
>
> --
> Sara A. Rauscher
> (505) 606-0512
> T-3 Fluid Dynamics
> MS B216
> Los Alamos National Lab
> Los Alamos, NM 87545 USA
>
> _______________________________________________
> 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 Fri Sep 21 16:21:40 2012

This archive was generated by hypermail 2.1.8 : Fri Sep 21 2012 - 16:22:29 MDT