From 9bc9899b18e35f0dfcfab5aad6cff46142ab868c Mon Sep 17 00:00:00 2001
From: Joe Taylor <joe@princeton.edu>
Date: Tue, 20 Apr 2021 12:45:41 -0400
Subject: [PATCH] Revert "A few steps further toward use of datadir, tempdir."

This reverts commit 189a0a35abeada68485d98b214f3f87c7301ab9e.
---
 map65/libm65/decode0.f90 |  6 ------
 map65/libm65/ftninit.f90 | 31 +++++++++++--------------------
 map65/libm65/m65.f90     |  2 +-
 map65/libm65/m65a.f90    |  5 +++--
 4 files changed, 15 insertions(+), 29 deletions(-)

diff --git a/map65/libm65/decode0.f90 b/map65/libm65/decode0.f90
index 5b74a186b..23bd44501 100644
--- a/map65/libm65/decode0.f90
+++ b/map65/libm65/decode0.f90
@@ -8,7 +8,6 @@ subroutine decode0(dd,ss,savg,nstandalone)
   integer hist(0:32768)
   character mycall*12,hiscall*12,mygrid*6,hisgrid*6,datetime*20
   character mycall0*12,hiscall0*12,hisgrid0*6
-  character*80 cwd
   character*200 datadir0,tempdir0,datadir,tempdir
   common/osdir/datadir,tempdir
   common/npar/fcenter,nutc,idphi,mousedf,mousefqso,nagain,                &
@@ -23,11 +22,6 @@ subroutine decode0(dd,ss,savg,nstandalone)
   datadir="'"//trim(datadir0)//"'"
   tempdir="'"//trim(tempdir0)//"'"
 
-!###
-  call getcwd(cwd)
-  call ftninit(trim(cwd))
-!###
-
   call timer('decode0 ',0)
   if(newdat.ne.0) then
      nz=52*96000
diff --git a/map65/libm65/ftninit.f90 b/map65/libm65/ftninit.f90
index 3b2e6da51..11c30052c 100644
--- a/map65/libm65/ftninit.f90
+++ b/map65/libm65/ftninit.f90
@@ -1,42 +1,33 @@
 ! Fortran logical units used in WSJT6
 !
-!    9  
-!   10        binary input data, *.tf2 files
-!   11  temp  prefixes.txt
-!   12  data  timer.out
-!   13  data  map65.log
+!   10  binary input data, *.tf2 files
+!   11  prefixes.txt
+!   12  timer.out
+!   13  map65.log
 !   14  
 !   15  
 !   16
-!   17  data/save  saved *.tf2 files
-!   18  data  test file to be transmitted (wsjtgen.f90)
-!   19  data  livecq.txt
+!   17  saved *.tf2 files
+!   18  test file to be transmitted (wsjtgen.f90)
+!   19  livecq.txt
 !   20  
-!   21  data  map65_rx.log
+!   21  map65_rx.log
 !   22  
-!   23  data  CALL3.TXT
+!   23  CALL3.TXT
 !   24  
 !   25  
-!   26  temp  tmp26.txt
+!   26  tmp26.txt
 !   27  
-!   28  data  fftw_wisdom.dat
-!   77  temp  deep65
+!   28  fftw_wisdom.dat
 !------------------------------------------------ ftn_init
-!subroutine ftninit(datadir,tempdir)
 subroutine ftninit(appd)
 
   character*(*) appd
   character firstline*30
   character addpfx*8
   integer junk(256)
-  character*200 datadir,tempdir
-  common/osdir/datadir,tempdir
   common/pfxcom/addpfx
 
-  write(62,*) 'datadir: ',trim(datadir)
-  write(62,*) 'tempdir: ',trim(tempdir)
-  write(62,*) 'appd:    ',appd
-
   addpfx='    '
   call pfxdump(appd//'/prefixes.txt')
   open(12,file=appd//'/timer_map65.out',status='unknown',err=920)
diff --git a/map65/libm65/m65.f90 b/map65/libm65/m65.f90
index 765bcddd6..1aef328bd 100644
--- a/map65/libm65/m65.f90
+++ b/map65/libm65/m65.f90
@@ -83,7 +83,7 @@ program m65
      mousefqso=70
   endif
 
-!  call ftninit('.')
+  call ftninit('.')
 
   do ifile=ifile1,nargs
      call getarg(ifile,infile)
diff --git a/map65/libm65/m65a.f90 b/map65/libm65/m65a.f90
index fc26c7730..7a07c6f12 100644
--- a/map65/libm65/m65a.f90
+++ b/map65/libm65/m65a.f90
@@ -9,14 +9,15 @@ subroutine m65a
   integer*1 attach_m65,lock_m65,unlock_m65
   integer size_m65
   integer*1, pointer :: p_m65
-  logical fileExists
   character*80 cwd
+  logical fileExists
   common/tracer/limtrace,lu
 
+  call getcwd(cwd)
+  call ftninit(trim(cwd))
   limtrace=0
   lu=12
   i1=attach_m65()
-  call getcwd(cwd)
 
 10 inquire(file=trim(cwd)//'/.lock',exist=fileExists)
   if(fileExists) then