gmt
gmt copied to clipboard
Movie : -JG +w option
Hi,
I'm wrapping up the sea-ice concentration movie for @Esteban82 and I sometimes got an error. The script can't find a file (absolute path given)
projection="-JG0/0/10c+w25"
gmt grdimage ${DIR_wrk}/inset_illu.nc -Cinset_illu.cpt -t25 $projection -Rg
grdmath (gmtapi_export_grid): Could not find file [ <absolute_path> /inset_illu.nc]
[Session gmt (0)]: Error returned from GMT API: GMT_GRID_WRITE_ERROR (19)
But sometimes it works.
That is pretty hard to debug or understand. Is it possible that the file actually is not there (yet) or have been removed when this script actually is looking? Or that the directory does not exist (yet)? The system library routines do not lie and if it says it cannot create that file it is usually right.
Is it possible that the file actually is not there (yet)
In this specific case, inset_illu.cpt
is created beforehand and stored in the working directory (during pre.sh
).
It is odd that several frames can access it while some other not.
Are modules allowed to access the same file at the same time?
So .. it appears that inset_illu.nc
is created in include.sh
(-I
in movie
) using grdmath
.
I moved the line at fault in pre.sh
(-Sb
in movie
) and the problem is resolved.
Confusingly enough :
- Despite specifying the absolute path, gmt_api can't access the file (sometimes), so it just skip the plot layer.
- I create and use another file (txt) the same way (using
math
ininclude.sh
) and this one as no problem whatsoever.
Is it a bug ? A feature ? A mystery ?
The script is still running but after several frames, still no error.
The problem is this:
${DIR_wrk}/inset_illu.nc
DIR_wrk is not a unique file name. Remember you are running lots of jobs simultaneously and they all want to create that file. This means stepping on toes and sometimes there will be no file. I suggest you use one of the MOVIE_* variables when you create a file only to be used by one frame.
DIR_wrk is not a unique file name
Isn't it though ? It used to be created in -Sb
(now in -I
) ... these steps are not parallelized right ?
@PaulWessel : You can see how it makes the animation glitch (lower right corner : https://youtu.be/Uh9YyFryXD4 )