Along with this update, I also modified the output coordinates so that lon() and lat() are 1-D vectors instead of 2-D matrices. This allows a workaround to the fact that the ERA5 data break at the prime meridian (0 longitude) and requesting a longitude range that spans the 0 longitude is not accommodated. The workaround is to do two downloads for east and west files, and then use the NCO UNIX tool ncrcat to join them. For example, to get 2 files in the Gulf of Guinea west and east of 0 ...
Code: Select all
ROMS_APP = 'w_GulfOfGuinea';
bbox = [-16.0 -0.25/2 -11.0000 8.0000]; % west
E = roms_get_era5_NCARds633_bulkflux(yyyy,mm,bbox);
roms_write_era5_NCARds633_frcfile
ROMS_APP = 'e_GulfOfGuinea';
bbox = [ 0.0 14.5000 -11.0000 8.0000]; % east
E = roms_get_era5_NCARds633_bulkflux(yyyy,mm,bbox);
roms_write_era5_NCARds633_frcfile
Code: Select all
#!/bin/bash
# This assumes the two files have prefix w_ and e_
file=GulfOfGuinea_frc_ERA5_bulkflux_202412.nc
westfile=w_$file
eastfile=e_$file
# permute lon to the first dimension
# which also makes it the record dimension
ncpdq -O -a lon,lat,time $westfile tmp$westfile
ncpdq -O -a lon,lat,time $eastfile tmp$eastfile
# concatenate along lon
ncrcat -O tmp$westfile tmp$eastfile mergedfile
# restore the order of dimensions
# which also returns time to being the record dimension
ncpdq -O -a time,lat,lon mergedfile $file
# clean up
rm tmp$westfile
rm tmp$eastfile
rm mergedfile