Project

General

Profile

cdo remapbil and copy in a bash script

Added by Giacomo Lucidi about 4 years ago

Hello,

I have some problems with a bash script for process multiples files in a folder.

I would like to run the following commands

cdo -copy file.nc tmp.nc
cdo -remapbil,weight.nc tmp.nc outfile.nc

Could give me any suggestion?

-With a for loop I have problems but I run the commands manually they works
-Should I keep my weight file in the same folder of the files that I won't to process?

Thank you


Replies (2)

RE: cdo remapbil and copy in a bash script - Added by Giacomo Lucidi about 4 years ago

EDIT:

Could you give me any suggestion?

-With a for loop I have problems but if I run the commands manually they works
-Should I keep my weight file in the same folder of the files that I want to process?

RE: cdo remapbil and copy in a bash script - Added by Ralf Mueller about 4 years ago

hi Giacomo!
Please upload the code, that causes the problem. An example loop could look like this:

for file in boo*.nc; do 
  cdo -remapbil,weights.nc $file remapbil_$file
done

the copy statement is not needed for remapping, that's why I skipped it. But you can add anything you like here of course.

hth
ralf

    (1-2/2)