RE: [ncl-talk] pop_remap.ncl

From: Ching-Yee <cychang1_at_nyahnyahspammersnyahnyah>
Date: Tue, 14 Feb 2006 13:24:48 -0500

Hi Dennis,
I was trying to use the code you gave me, but when I run it I encountered
the followinf message:
fatal:Could not open ($NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl)
fatal flex scanner internal error--end of buffer missed

Can you tell me what else I need to do to make it work? (I am running ncl on
bluesky in UCAR)
Thank you.

Ching-Yee
-----Original Message-----
From: Dennis Shea [mailto:shea_at_ucar.edu]
Sent: Monday, February 13, 2006 11:19 PM
To: Ching-Yee Chang
Cc: ncl-talk_at_ucar.edu
Subject: Re: pop_remap.ncl

The following should be adequate:

load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/popRemap.ncl"

begin
   in = addfile("pop_ocean.nc","r")
   x = in->varible_name
;************************************************
; convert pop to a 1x1 degree grid
; map_gx1v3_to_T42_aave_da_020607
;************************************************
   xT42 = PopLatLon( x ,"gx1v3","T42","aave","da","020607")

   printVarSummary(xT42)
;************************************************
; write output
;************************************************
   diro = "./" ; output dir
   filo = "pop_T42.nc" ; output file name
   system ("/bin/rm -f "+diro+filo)
   fout = addfile (diro+filo , "c")

   fout->X = xT42

end

good luck
D

On Mon, 13 Feb 2006, Ching-Yee Chang wrote:

> Hello,
>
> I am trying to use pop_remap.ncl to regrid the output data of CCSM3
> ocean model (POP). The attached file is the script doing that (I am just
> practicing remapping one variable for now). I've download the weight
> file from ESG website. Take gx1v3 to T42 remapping (conservative) for
> example. This is part of the ncdump -h output of this weight file:
>
> netcdf map_gx1v3_to_T42_aave_da_020607 {
>
> dimensions:
>
> n_a = 122880 ; n_b = 8192 ;
>
> nv_a = 4 ; nv_b = 4 ;
>
> src_grid_rank = 2 ; dst_grid_rank = 2 ;
>
> ni_a = 320 ; nj_a = 384 ;
>
> ni_b = 128 ; nj_b = 64 ;
>
> n_s = 145548 ;
>
> num_wgts = 3 ; num_wgts1 = 2 ;
>
> variables: ; I delete some lines
> indicating the units of the variables
>
> int src_grid_dims(src_grid_rank) ;
>
> int dst_grid_dims(dst_grid_rank) ;
>
> double yc_a(n_a) ;
>
> double yc_b(n_b) ;
>
> double xc_a(n_a) ;
>
> double xc_b(n_b) ;
>
> double yv_a(n_a, nv_a) ;
>
> double xv_a(n_a, nv_a) ;
>
> double yv_b(n_b, nv_b) ;
>
> double xv_b(n_b, nv_b) ;
>
> int mask_a(n_a) ;
>
> int mask_b(n_b) ;
>
> double area_a(n_a) ;
>
> double area_b(n_b) ;
>
> double frac_a(n_a) ;
>
> double frac_b(n_b) ;
>
> int col(n_s) ;
>
> int row(n_s) ;
>
> double S(n_s) ;
>
> double S2(n_s, num_wgts1) ;
>
>
>
> In the pop_remap script I need five four input variables:
>
> 1. map_wts, 2. dst_add, 3. src_add, 4.x_src
>
>
>
> I chose S2 in the weight file as the map_wts
>
> row as dis_add
>
> col as src_ass
>
> dis_grid_dims as dim_dis
>
> Are these the correct input settings? Because there are no word-to-word
> corresponding variables in the ncdump -h output and the intro of
> pop_remap, I can only use the dimensions of the variables to guess what
> these variables correspond to.
>
> However, the output from the pop_remap doesn't seem right. Can somebody
> please give me some suggestions why it's not working correctly?
>
>
>
> Also, the ncl seems to have problem when executing the line:
>
> SHF_Att@_FillValue = 9.96921e+36
>
> , which I don't know the reason.
>
>
>
> Thank you very much for your help in advance.
>
>
>
> Ching-Yee
>
>
>
>

_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Feb 14 2006 - 11:24:48 MST

This archive was generated by hypermail 2.2.0 : Wed Feb 15 2006 - 21:20:14 MST