       Guide to installing the KRC distribution  2013oct01

This file is a mix of text and some commands that may need editing
  Linux commands: lines containing the  #  comment character
  IDL   commands: lines containing the  ;  comment character

 
Create a directory where you wish the KRC system to reside.
cd to this directory, which I will here call /K/
untar the krcdist.tar file. This should create and populate several subdirectories
cd /K/	  	      	    	 # cd to the build area
rm -Rf *		    	 # empty it entirely
tar -xvf /work2/krcdist.tar.gz   # untar the distro
tar -xvf /work2/krcbig.tar 	 # untar the big files

cd /K/aaa     			 # Contains distro scripts
  FIRST INSTALLATION ONLY: Hopefully can skip these for updates
    Create a directory outside the build are to hold unique versions of files
      related to this institution, which I will here call /U/
    Copy /k/aaa/step61  to /U/
    Edit two lines for paths in /U/step61
    Run /U/step61  This will copy files to be edited locally to the safe area 
      Check/edit all the files that were copied into /U/

Source /U/step6	This will copy edited files back into the build area

cd /K/src/cfiles      #  low-level I/O routines, required before a Fortran build
make all		       # build the C library

cd /K/src		       # cd to the Dir with all the FORTRAN source code
make krc		       # Make KRC  
make porbmn		       # Make PORB

cd /K/idl/extern    		# Move to area for Shared Object Library (SOL) 
  All the --w.c routines are "wrappers" to connect IDL to Fortran.
  Remove or rename any prior SOL:  *.so
make ftnwrap64.so			# build the SOL 
  Must restart IDL to access any new shared object library

cd /K/run			# move to directory in which normally run KRC
ln -s ../src/krc .		# soft link to KRC executable
ln -s ../src/porbmn . 		# " " to PORB program 

  Now can run KRC using the input files in this directory
krc   	     	 		# Start krc
  enter:  VerTest.inp
  enter:  /  or the name of a print output file


cd /K/idl   # top of IDL execution area
source idlPath        # set the path for IDL 

idl  # Start IDL. If not found, then give the full path:
   e.g.:  /usr/local/exelis/idl82/bin/idl    		     

IDL> kirin [ src=??, dat=??,ver=??,prn=??,diss=??]  ; initialize IDL for KRC
   see comments at the top of /K/idl/kirin.pro  for what the ?? are.

IDL> .rnew krcvtest	      ; follow the description in /k/doc/Vtest.pdf

----------------------------------------------------------------
----------------------------------------------------------------
----------------------------------------------------------------

  ./aaa/AAREADME will describe how the distribution package was made.

Files in ~/doc/ that may be helpful

  helplist.tex
        General help in setting up input files. ASCII text 
	Much of this is MANDATORY READING

  Kieffer13krc.pdf
     Journal article describing some of the algorithms, with some 
     post-pub corrections. Some of the auxiliary
     on-line material is included here, the rest are largely redundant to
     this distribution.
   ds01.txt   Architecture of the KRC code set
     02  Index of FORTRAN and C routines 
     08  Sample input files with some explanation text
     09  Sample layer table
     10  Sample One point input and output files

  HeatOfT.pdf 
    Information on T-dependent materials, and how to create KRC parameters

  cement.pdf 
    Thermal conductivity of cemented particulates

krc and mkrc (not included in most distributions) require different versions
 of the common krccom. For krc, need krccom2.inp, copied to krccom.inp


In ./src/ there is the Makefile  which will probably need 
editing for your site. You should remove reference to any libraries 
(unless you make some) except the cfiles one.

I have had problems with FORTRAN unformatted files in IDL, probably related to
different interpretations of what is the lenghts of the extra word FORTRAN adds
at each end of a file. At ASU, the problem was resolved by using the
 -fdefault-integer-8  flag.

See your local Guru. Then do:  make krc
which should complile, although there may be some of warnings about 
different variable types for R2R

Copy master.inp to krc.inp  and edit to fit your needs; the default
name that krc looks for is krc.inp. If you want 5 degree latitude spacing,
'mast37' contains just the latitudes and mean elevations for every 5 degrees.

Run krc.  It will ask for an input file name. If you wish krc.inp,
    respond simply:  / <CR 
  At the request for a print file name, you can respond simply:  / <CR 


The original print log output for master.inp is run/output/master.prtOrig
    The output binary file is run/output/masterA.t52 
The input file  run/master5x.inp tests all the type 5x output modes, 
the corresponding binary output files are run/output/master5B.t5x  x=1,2,4,5,6 

Input file krcOneA.inp will run KRC in the one-point mode, using the specific 
points listed on oneA.inp. The expected output is in oneA.prtOrig

krc          # this will start the execution. 
Respond to first request with:  krc.inp   or   simply  /
Respond to second request with:  / 
Should run, creating  krc.prt and a binary file defined by the 8 0 0 ---
 line in the input file

--------------  Use of the IDL programs ---------------------

Before starting IDL, edit and source idlPath.

With each new installation, should rebuild the Shared Object Library;

Look at kirin.pro (probably requires an IDL guru), edit it as appropriate for
your installation, and run it as the first thing after starting IDL.  It uses
setcolor.pro to setup 256 colors.


