Scheduled Downtime
On Tuesday 24 October 2023 @ 5pm MT the forums will be in read only mode in preparation for the downtime. On Wednesday 25 October 2023 @ 5am MT, this website will be down for maintenance and expected to return online later in the morning.
Normal Operations
The forums are back online with normal operations. If you notice any issues or errors related to the forums, please reach out to help@ucar.edu

Tools to interpolate spectral element grid to lat/lon grid

strandwg

Moderator
Staff member
Are there standard tools/scripts/codes used in AMP to interpolate the spectral element grid to a regular lat/lon grid that can be shared?

Thanks!
 

aherring

Adam
Member
Hi Gary,

We don't have any shared scripts that remap entire cam-se history files to latitude longitude grids. We either just set the namelist variable that interpolates history fields in-line in cesm, or we use the available tools and build our own scripts for regridding individually. In response to this thread, I decided to make a simple bash script that can regrid an entire directory of history files in as few steps as possible. Unfortunately, the necessary nco command "ncremap" seems to have broken on cheyenne very recently. I just put in a CISL ticket, and when this is resolved I can update this thread.

There are two steps involved with regridding: (1) generate the weights file for mapping between two grids, and (2) use that weights file to regrid history files to the desired destination grid. I have (1) completed in the bash script, so we just need to wait on CISL so I can do (2).

Here's the caveat. To do (1), the user needs to specify the path to the grid descriptor file for the particular spectral-element grid the data are on. Right now the grid descriptor file is not part of the cesm output. We do have a git issue open to include this in cesm i/o in the future, but for now, the user needs to sift through the cesmdata repo to find the correct grid file. Similarly the user needs to point to the grid descriptor file for the desired destination lat-lon grid. The latter could conceivably be generated on the fly with the user only specifying the destination grid resolution nlat and nlon.

Feedback welcome.
 

strandwg

Moderator
Staff member
Thanks for your quick response.

All of the cam-se data available to users is in timeseries format, not history format, so that makes things a little simpler.
 

aherring

Adam
Member
OK we fixed the problem w/ ncremap and verified it works for cam history files. However I've never worked with timeseries format. Can you point me to an example timeseries file on glade so I can make sure it works?

FYI, I tried to find one in /glade/campaign/collections/cmip/CMIP6/timeseries-cmip6/ but I don't have permissions. I do have permissions one directory up /glade/campaign/collections/cmip/CMIP6/ oddly enough.
 

aherring

Adam
Member
Hi Gary,

Bash script for regridding history/timeseries files is here:
/glade/scratch/aherring/for_gary/regridfiles.sh

John Truesdale just tested it and he had no issues. Let me know if you encounter any problems (my email is in the script).
 

strandwg

Moderator
Staff member
Hi Gary,

Bash script for regridding history/timeseries files is here:
/glade/scratch/aherring/for_gary/regridfiles.sh

John Truesdale just tested it and he had no issues. Let me know if you encounter any problems (my email is in the script).

Thanks - I'll play around with it a bit.
 

maruf2812

Montasir Maruf
Member
Hi @aherring, I am also trying to convert cam files to regular lat lon. Here is my file directory (/glade/work/maruf/cam/evspsbl_Amon_CESM1-CAM5-SE-HR_hist-1950_r1i1p1f1_gn_195001-201412.nc). I have a few confusions:

1. My cam file is source grid or a destination grid?
2. Do I need to change the path of CIME?
3. What is the best way to run bash script. I tried with qsub in casper but is shows the following error: qsub: request rejected as filter hook 'ompthreads' encountered an exception. Please inform Admin

Thanks!!
 
Top