Clip multiple NetCDF files using bat file

Added by Ameer Muhammad about 1 month ago

Hi,
I have multiple NetCDF file and i would like to clip these file using lat/long of my area. The files name are like Pr.nc, MinT.nc, MaxT.nc etc. I am doing this using a batch (.bat) file. here is what i have

files=`ls *.nc` # pick up all the netcdf files in a directory
for file in $files ; do
cdo sellonlatbox -108.4363 -104.7039 49.16911 50.66338 files out.nc
#selecting the lat/long box of my region using files (all nc files) and save it as out.nc (I am however, confuse how to save the file as pr.nc,
#MinT.nc and MaxT.nc for my clipped region)
done