Why the error with cdo mergetime: cdo (Abort): Operator name missing

61 Views Asked by At

I am trying to merge every four netcdf files in a list so that the 6 hr accumulation files for a given day are all together. As the very last step of my loop I use cdo mergetime and that is when I get the error cdo (Abort): Operator name missing!.

I am quite new to linux so I'm not sure if I am doing sometime wrong syntax wise that is causing this issue.

Can someone please help? Thanks!!

# Loop through the range
for i in "${range[@]}"; do
    # Your code here
    # Example: Print the filenames at positions determined by the range
     echo "New iteration"
     echo "${filenames[$((i - 1))]}"
     echo "${filenames[$i]}"
     echo "${filenames[$((i + 1))]}"
     echo "${filenames[$((i + 2))]}"
     filename_w_curretdate="${filenames[$i]}"
     base_name=$(basename "${filename_w_currentdate}")
     new_date="${base_name:0:8}${base_name:10}"
     echo "$new_date"
     cdo mergetime "${filenames[$((i - 1))]}" "${filenames[$i]}" "${filenames[$((i + 1))]}" "${filename>done

The output:

New iteration
/mnt/g/XXXXX/2022052906.nc
/mnt/g/XXXXX/2022052912.nc
/mnt/g/XXXXX/2022052918.nc
/mnt/g/XXXXX/2022053000.nc


cdo (Abort): Operator name missing!

To make sure that cdo was functioning properly I did try cdo mergetime with two random .nc files in the command line and it worked just fine.

0

There are 0 best solutions below