Re: Regrid error : area_conserve_remap

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Sun Sep 25 2011 - 07:40:56 MDT

I would suggest using

   Uo = area_hi2lores_Wrap (loni,lati,U,False, 1, newlon,newlat, False)

Good Luck

On 9/24/11 6:27 PM, Erik Noble wrote:
> Hi. Ok. I missed the part on the example page that says this function
> assumes the input is global. It is not.
> To make this work, the page says I need to declare the "dimension of the
> *global* latitude set of which the grid is a subset."
> My model data is on a 20km by 20km regional grid. Do I need to make this
> declaration in "degrees" only.
>
> opt = True
> opt@NLATi = ???
>
>
>
> On Sat, Sep 24, 2011 at 7:20 PM, Dennis Shea <shea@ucar.edu
> <mailto:shea@ucar.edu>> wrote:
>
> area_conserve_remap requires that *both* the input and output grid
> be global. The input grid
>
> Variable: U
> [snip]
>
> lat: [-18.40244..35.33525]
> lon: [-35.74922..35.74922]
>
> is not global
>
>
> On 9/24/11 2:30 PM, Erik Noble wrote:
>
> Hi. I am trying to remap a hi resolution file to a 2.5 degree global
> grid, similar to NCEP Reanalysis II, so that I can compare data. I'm
> following the examples using the area_conserve_remap function.
> http://www.ncl.ucar.edu/__Document/Functions/__Contributed/area_conserve___remap_Wrap.shtml
> <http://www.ncl.ucar.edu/Document/Functions/Contributed/area_conserve_remap_Wrap.shtml>
> I keep getting this error:
>
> Error in "cremapbin":
> Could not map global lat array into grid array
> Segmentation fault
>
> I am not sure where I am creating this error. Could I please
> have some
> help with this?
> Sincerely,
> Erik
>
>
> [eunoble@borg01t008] Experiment_01 $ ncl test_regrid.ncl
> Copyright (C) 1995-2011 - All Rights Reserved
> University Corporation for Atmospheric Research
> NCAR Command Language Version 6.0.0
> The use of this software is governed by a License Agreement.
> See http://www.ncl.ucar.edu/ for more details.
> (0)
> ******************************__******************************__***
> (0) These are the WRF Model output files you are extracting from.
> (0) number of FILES = 97
> (0)
> ******************************__******************************__***
> (0) Extracting WRF Model Output Variables
>
> Variable: U
> Type: float
> Total Size: 6844488 bytes
> 1711122 values
> Number of Dimensions: 4
> Dimensions and sizes: [time | 1] x [lev | 14] x [lat | 311] x
> [lon | 393]
> Coordinates:
> time: [0..0]
> lev: [1000..50]
> lat: [-18.40244..35.33525]
> lon: [-35.74922..35.74922]
> Number Of Attributes: 6
> _FillValue : 9.96921e+36
> description : y-wind component
> units : m s-1
> coordinates : lat lon
> stagger :
> FieldType : 104
> Error in "cremapbin":
> Could not map global lat array into grid array
> Segmentation fault
>
>
> ;;;;;;;;;;;;;;;; NCL SCRIPT
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;__;;;;;;;;;;;;;;;;;;;
>
> ;*****************************__******************************__****
> ; Load Libaries
> ;*****************************__******************************__****
> 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"
>
> begin
>
> ;*****************************__******************************__****
> ; Change these parts
>
> ;*****************************__******************************__****
> DATADir = "./" ;input directory
> Files = "wrfout_d01*_wind_diagnostics.__nc
> <http://wind_diagnostics.nc>
> <http://wind_diagnostics.nc>" ;input files
>
> ncdiro = "./" ;output directory
> NCFILE1 = "wind_diagnostics" ;output file
>
> ;*****************************__******************************__****
> ; Read in WRF Files
>
> ;*****************************__******************************__****
> ;FILES = systemfunc (" ls -1 " + DATADir + Files) ; file paths
> FILES = systemfunc (" ls -1 " + Files) ; file paths
> numFILES = dimsizes(FILES)
>
> print("***********************__******************************__**********")
> print("These are the WRF Model output files you are
> extracting from.")
> print("number of FILES = " + numFILES)
> ;print(FILES)
>
> print("***********************__******************************__**********")
> print ("Extracting WRF Model Output Variables")
> ;*****************************__*********
> ; DO LOOP: Extraction
> ;*****************************__*********
> ; Use wrf_user_getvar function to extract each variable.
> ; "-1" means all times, which doesn't matter here
> ; b/c there is only 1 time in each file
> ;*****************************__*******
> deltaTime = ispan(0,numFILES-1,1)
> do ifil = 0,0,1 ;0,numFILES-1
> a = addfile(FILES(ifil)+".nc","r") ;read individual
> wrfout file
> U = a->U
> V = a->V
> printVarSummary(U)
>
> ;*****************************__*******************
> ; interpolate to new grid (NCEP R2 2.5 GRID --> 73,144)
> ;*****************************__******************
> loni = U&lon
> lati = U&lat
> newlat = fspan(-90.,90,73)
> newlon = fspan(0.,359.,144)
> newlat@units = "degrees_north"
> newlon@units = "degrees_east"
>
>
> Uo = area_conserve_remap_Wrap (loni,lati,U,
> newlon,newlat, False)
> printVarSummary(Uo)
>
> end do
> end
>
>
>
>
>
> _________________________________________________________
> Erik Noble
> Center for Climate Systems Research, Columbia University
> NASA Goddard Institute for Space Studies
> 2880 Broadway, New York, NY-10025, USA
>
> Tel: +1 (212) 678-5512 <tel:%2B1%20%28212%29%20678-5512>; Fax:
> +1 (212) 678-5552 <tel:%2B1%20%28212%29%20678-5552>
> E-mail: enoble@giss.nasa.gov <mailto:enoble@giss.nasa.gov>
> <mailto:enoble@giss.nasa.gov <mailto:enoble@giss.nasa.gov>>,
> en2192@columbia.edu <mailto:en2192@columbia.edu>
> <mailto:en2192@columbia.edu <mailto:en2192@columbia.edu>>
>
> WEB: http://www.giss.nasa.gov/__staff/enoble.html
> <http://www.giss.nasa.gov/staff/enoble.html>
> GISS: http://www.giss.nasa.gov
> CCSR: http://www.ccsr.columbia.edu
> _________________________________________________________
>
>
>
> _________________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/__mailman/listinfo/ncl-talk
> <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 Sun Sep 25 07:41:02 2011

This archive was generated by hypermail 2.1.8 : Mon Sep 26 2011 - 14:45:50 MDT