- snprintf(filename,127,"%s/plot.scr",moldyn->vlsdir);
- moldyn->pfd=open(filename,
- O_WRONLY|O_CREAT|O_EXCL,
- S_IRUSR|S_IWUSR);
- if(moldyn->pfd<0) {
- perror("[moldyn] plot fd open");
- return moldyn->pfd;
+ if(moldyn->efd) {
+ snprintf(filename,127,"%s/e_plot.scr",
+ moldyn->vlsdir);
+ moldyn->epfd=open(filename,
+ O_WRONLY|O_CREAT|O_EXCL,
+ S_IRUSR|S_IWUSR);
+ if(moldyn->epfd<0) {
+ perror("[moldyn] energy plot fd open");
+ return moldyn->epfd;
+ }
+ dprintf(moldyn->epfd,e_plot_script);
+ close(moldyn->epfd);
+ }
+ if(moldyn->pfd) {
+ snprintf(filename,127,"%s/pressure_plot.scr",
+ moldyn->vlsdir);
+ moldyn->ppfd=open(filename,
+ O_WRONLY|O_CREAT|O_EXCL,
+ S_IRUSR|S_IWUSR);
+ if(moldyn->ppfd<0) {
+ perror("[moldyn] p plot fd open");
+ return moldyn->ppfd;
+ }
+ dprintf(moldyn->ppfd,pressure_plot_script);
+ close(moldyn->ppfd);
+ }
+ if(moldyn->tfd) {
+ snprintf(filename,127,"%s/temperature_plot.scr",
+ moldyn->vlsdir);
+ moldyn->tpfd=open(filename,
+ O_WRONLY|O_CREAT|O_EXCL,
+ S_IRUSR|S_IWUSR);
+ if(moldyn->tpfd<0) {
+ perror("[moldyn] t plot fd open");
+ return moldyn->tpfd;
+ }
+ dprintf(moldyn->tpfd,temperature_plot_script);
+ close(moldyn->tpfd);