Expedition Expedition Navigation Software

You are not logged in. Would you like to login or register?



7/02/2025 8:13 am  #1


Current data for historic routing analysis

Trying to use Copernicus to extract historical current data specifically for the north west self. This is flagged as NetCDF-4 and I noted in the help file that some NetCDF files is limited. For now would I need to convert this to grib2?

Weather and tides
NetCDF files
Expedition supports some NetCDF data. This can be expanded as support for new datasets is requested.


Atlantic- European North West Shelf- Ocean Physics Reanalysis
https://data.marine.copernicus.eu/product/NWSHELF_MULTIYEAR_PHY_004_009/description


 

 

Yesterday 12:50 am  #2


Re: Current data for historic routing analysis

Ended up using CDO utility to convert the netCDF files to grib1. I did this on the Mac as the CDO install is straight forward and this is a shell script to process a series of separate netCDF files for the years/dates of interest. As these are grib files you can then merge when into a single file for easier handling in Expedition

#
for f in cmems_2*.nc
do
  fname=`basename -s .nc $f`
  echo $f $fname
  # set missing paramaters to 0
  cdo setmisstoc,0 $f mcds-input_ex.nc

  # Convert each variable with proper parameter ID
  cdo -f grb1 -setparam,49 -selvar,uo mcds-input_ex.nc u10.grb1
  cdo -f grb1 -setparam,50 -selvar,vo mcds-input_ex.nc v10.grb1  
  
  # Merge into one file
  if [ -f ${fname}.grb1 ]; then
     mv ${fname}.grb1 ,${fname}.grb1
  fi
  cdo merge u10.grb1 v10.grb1 ${fname}.grb1
done

cat cmems_2*.grb1 > cmems_fastnet.grb1

btw I've used cdo merge as this ensures that showvar lists both var49 and var50. If you cat the files this will only list the first variable. You can also use -O on the merge to force existing files to be over written

cdo showvar cmems_2023.grb1
var49 var50
cdo  showname: Processed 2 variables [0.00s 12MB]

Last edited by greg.brougham (Yesterday 7:35 am)

     Thread Starter
 

Yesterday 2:32 am  #3


Re: Current data for historic routing analysis

You don't need cdo merge - you can just cat the files.

 

Yesterday 7:37 am  #4


Re: Current data for historic routing analysis

Nick, agree but then cdo showvars will only lists the first variable in the record set. I've updated the text to make this clear

     Thread Starter
 

Board footera

 

Powered by Boardhost. Create a Free Forum


Interested in advertising here? Over a thousand active navigators and Expedition users visit this forum. Click here to contact the administrator.