Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IMERG monthly unit conversion #3

Open
xeimyname1 opened this issue Apr 26, 2023 · 0 comments
Open

IMERG monthly unit conversion #3

xeimyname1 opened this issue Apr 26, 2023 · 0 comments

Comments

@xeimyname1
Copy link

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant