Re: Regridding Daymet Joined Tiles with ESMF_Regridding on NCL 6.1.0

From: Ping Yang <pyang_at_nyahnyahspammersnyahnyah>
Date: Mon Nov 19 2012 - 10:33:55 MST

Dear NCL,

Here is an update on the Daymet data issues.

Big thanks to Dave who provided a data file that contained full coordinates
for the study area generated by Geotrans software.

Now I used a script to replace the missing (zero) value in the merged file,
however, there are some problems with it:

begin

Variable = "prcp"
nx = 1551
ny = 1872
N = nx * ny
;full_coordinate.dat
file1="full_coordinate.dat" ;the coordinate file

z3 = asciiread(file1,(/N,4/),"double")

lat1d=z3(:,2)
lon1d=z3(:,3)
dim2=(/ny,nx/)
lat2d=onedtond(lat1d,dim2)
lon2d=onedtond(lon1d,dim2)
printVarSummary(lat2d)
printVarSummary(lon2d)
;--find the zero value in the 2d lat and lon from the merged grid file
;NE_all_1980_prcp.nc
file2= "NE_all_1980_" + Variable + ".nc"
f = addfile(file2,"r")
lat = f->lat
lon = f->lon
printVarSummary(lat)
printVarSummary(lon)
;--fill the zero with the generated coordinates
do i = 0, N
if(lat(i) .eq. 0) then lat(i)=lat2d(i) end if
if(lon(i) .eq. 0) then lon(i)=lon2d(i) end if
end do
printVarSummary(lat)
printVarSummary(lon)
end

I got error:
fatal:Number of subscripts do not match number of dimensions of
variable,(1) Subscripts used, (2) Subscripts expected
fatal:["Execute.c":7743]:Execute: Error occurred at or near line 42 in file
assign_coordinate.ncl

However, I tried to using the following code to replace the zero value:
if(lat(i,:) .eq. 0) then lat(i,:)=lat2d(i,:) end if
if(lon(i,:) .eq. 0) then lon(i,:)=lon2d(i,:) end if
but another error occurred:
fatal:Conditional statements (if and do while) require SCALAR logical
values, see all and any functions
fatal:["Execute.c":7743]:Execute: Error occurred at or near line 42 in file
assign_coordinate.ncl

How to operate on this 2D array for replacing the zero values? Am I missing
some information?

Looking forward to hearing from you.

Big thanks,

Ping

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Nov 19 10:34:09 2012

This archive was generated by hypermail 2.1.8 : Wed Nov 21 2012 - 11:16:05 MST