Help with Namelist error in CDO When Using lonlat.txt for Bilinear Interpolation
Added by xuewei fan over 1 year ago
I'm currently facing a challenge with using the remapbil command in CDO for bilinear interpolation from grid data to specific stations. Despite following the standard format for the lonlat.txt file, I keep encountering a Namelist error.
Here’s the CDO command I’m using:
cdo remapbil,/path/to/lonlat.txt /path/to/input_data.nc /path/to/output_data.nc
My goal is to interpolate grid data onto specific station points defined in the lonlat.txt file. The file contains pairs of longitude and latitude coordinates, formatted as follows:
-54.6216666 -25.9183
-58.43777777 -27.6666666666667
-60.6948 -32.8269
...
Each line in the file represents a station with a pair of longitude and latitude values, separated by a space. The file is an ASCII text file and uses Unix-style line endings (\n).
I have checked for any hidden or unusual characters using the cat -A command, and it appears that the file is free from such anomalies. Here is an example output from cat -A:
-54.6216666 -25.9183$
-58.43777777 -27.6666666666667$
-60.6948 -32.8269$
...
I'm running this on an Ubuntu system. Could you provide any insight into what might be causing the Namelist error? Any advice or suggestions on how to successfully perform this grid-to-station bilinear interpolation would be greatly appreciated.
Thank you in advance for your help!
lonlat.txt (16.1 KB) lonlat.txt |
Replies (2)
RE: Help with Namelist error in CDO When Using lonlat.txt for Bilinear Interpolation - Added by Estanislao Gavilan over 1 year ago
Hi Xuewei,
I am not sure that you can do that with remapbil. I think remapbil can only be used with structured grids (i.e. regular and curvilinear). You need to remap your data into a unstructured grid which are your stations points. To do this you need to write your grid.txt like this
gridtype = unstructured
gridsize = 710
xname = lon
xlongname = "longitude"
xunits = "degrees east"
yname = lat
ylongname = "latitude"
yunits = "degrees north"
xvals = -54.6216666 -58.43777777 -60.6948 ...
yvals = -25.9183 -27.6666666666667 -32.8269 ...
Then, you can remap using this line
cdo -remapnn,grid.txt infile outfile
RE: Help with Namelist error in CDO When Using lonlat.txt for Bilinear Interpolation - Added by xuewei fan over 1 year ago
Hi,Estanislao
Thanks for your valuable assistance!
Best regards,
Xuewei