Hi,
I am following your tutorials on various climate processes. Thank you for the very helpful documentations and detailed steps.
I have been trying to calculate SPI for IMERG and somehow, I get errors in the ncap2 when converting the precipitation unit from mm/hr to mm/month. I have copied this in my terminal and this created a sh file.
while read -r _file; do file=$(basename -- "$_file") yearmonth=$(echo "$file" | sed -E 's/.*\.3IMERG\.([0-9]{6})[0-9]{2}-.*/\1/') mult=$(python - "$yearmonth" <<EOF import sys, calendar ym = sys.argv[1] print(calendar.monthrange(int(ym[:4]), int(ym[4:]))[1] * 24) EOF ); echo ncap2 -s 'precipitation='"$mult"'*precipitation' "$file" ../IMERG_mmmonth/"$file"; done < <(find . -maxdepth 1 -type f -name "*.nc4") > script.sh
However, when I ran the code, I got this error.
ERROR: nco__create() unable to create file "../IMERG_mmmonth/3B-MO.MS.MRG.3IMERG.20200701-S000000-E235959.07.V06B.HDF5.SUB.nc4.pid28460.ncap2.tmp" nco_err_exit(): ERROR Short NCO-generated message (usually name of function that triggered error): nco__create() nco_err_exit(): ERROR Error code is 13. Translation into English with nc_strerror(13) is "Permission denied"
What have I done wrong and any help in solving this will be very much appreciated.
Thanks!