--- tests/pwscf.tcl.orig	2020-06-06 15:50:46.000000000 -0700
+++ tests/pwscf.tcl	2020-06-07 16:04:58.000000000 -0700
@@ -37,36 +37,37 @@
 
     set scripting(verbosity) 0
 
-    chdir [file join $env(XCRYSDEN_TOPDIR) examples PWSCF_files]
+    #chdir $env(XCRYSDEN_SCRATCH)
+    set inppath [file join $env(XCRYSDEN_TOPDIR) examples PWSCF_files]
 
     # PWscf input version < 1.2
     putsFlush stderr "\n\n\nChecking the pwscfInput<1.2 filter\n\n\n"
 
-    scripting::exec scripting::filter::pwscfInput EthAl001-2x2.inp 2 {
+    scripting::exec scripting::filter::pwscfInput [file join $inppath EthAl001-2x2.inp] 2 {
 	1 13   2 6   3 1 
     }
     # PWscf input version >= 1.2
-    scripting::exec scripting::filter::pwscfInput CH3Rh111.inp 2
+    scripting::exec scripting::filter::pwscfInput [file join $inppath CH3Rh111.inp] 2
     putsFlush stderr "\n\n\nChecking the pwscfInput>=1.2 filter\n\n\n"
     
     
     # PWscf output version < 1.2
     foreach option {-ic -oc -lc -a} {
 	putsFlush stderr "\n\n\nChecking the pwscfOutput<1.2 filter option=$option\n\n\n"
-	scripting::exec scripting::filter::pwscfOutput $option EthAl001-2x2.out 2 {
+	scripting::exec scripting::filter::pwscfOutput $option [file join $inppath EthAl001-2x2.out] 2 {
 	    1 13   2 6   3 1 
 	}
     }
     # PWscf output version == 1.2
     foreach option {-ic -oc -lc -a} {
 	putsFlush stderr "\n\n\nChecking the pwscfOutput==1.2 filter option=$option\n\n\n"
-	scripting::exec scripting::filter::pwscfOutput $option CH3Rh111.out 2
+	scripting::exec scripting::filter::pwscfOutput $option [file join $inppath CH3Rh111.out] 2
     }
     # PWscf output version > 1.2
-    chdir [file join $env(XCRYSDEN_TOPDIR) tests data]
+    set inppath [file join $env(XCRYSDEN_TOPDIR) tests data]
     foreach option {-ic -oc -lc -a} {
 	putsFlush stderr "\n\n\nChecking the pwscfOutput>1.2 filter option=$option\n\n\n"
-	scripting::exec scripting::filter::pwscfOutput $option PWscf_output_v1.3.1.out 2
+	scripting::exec scripting::filter::pwscfOutput $option [file join $inppath PWscf_output_v1.3.1.out] 2
     }
 
 } {
