Routines I have developed to aid HET observing utilize programming in
The source code is contained in a directory tree whose top level is specified in my .cshrc file with an environment variable named "codes". The bin directory assigning the location for installed executables is set with the environment variable named "scobin". Here are the pertinent parts of my .cshrc file and the top level of the source code tree:
# For install from source code (.cshrc) setenv insdir install_sco2019_20190918 setenv scobin /home/sco/Installs/$insdir/bin setenv codes /home/sco/Installs/$insdir/codes % ls $codes bash/ bourne/ c/ fortran/ Last.Backup python/ README scosys/ shell_scripts/The bourne, c, scosys, and shell_scripts subdirectories use other shells and/or programming languages beyond what is genearlly required in this document. Return to top.
My HET fortran codes utilize a library known as OTWLIB.a. This resource has been stable for a long time and as of Oct2019 is comprised of 65 fortran subroutines. The library is named OTWlIB.a and is copiled and installed with the script OTWLIB.make. Below I show the use of this simple script as well as it's source.
# I use these environemnt variables (set in .cshrc): % echo $codes /home/sco/Installs/install_sco2019_20190918/codes % echo $OTWLIB_DIR /home/sco/Installs/install_sco2019_20190918/codes/fortran/gfortran_compiler/libs/LIN # To compile and install the library: % cd $codes/fortran/gfortran_compiler/libs/otwlib % OTWLIB.make Number of lines in Errors file = 0 Errors % ls $OTWLIB_DIR OTWLIB.aReturn to top.
My fortran codes are compiled and installed with a script named "botw" which, in turn, depends on a fixed source code directory structure. As an example, I show below how I would compile, install, and run the code known as "mcdsky". With this code the RA can specify the time and sky position of a target, and recieve as output a number of useful quantities used in HET target selection.
% cd $codes//fortran/gfortran_compiler/otw/src/mcdsky % ls makefile makes/ mcdsky.f mcdsky.sh* s/ % ls makes makefile # Here is the makefile: % cat makefile # FC = gfortran FFLAGS= -O -ffixed-line-length-none -fno-automatic LIBO = $(OTWLIB_DIR)/OTWLIB.a LIBS = $(LIBO) ## OBJS = \ mcdsky.o mcdsky: $(OBJS) $(FC) -o mcdsky $(FFLAGS) $(OBJS) $(LIBS) -L$(X11_DIR) -lX11 # For the install script to work, we define OTWSRC: setenv OTWSRC $codes/fortran/gfortran_compiler/otw/src # Compile and install the mcdsky program: % botw mcdsky # here is the botw script source code #!/bin/bash # Build OTW code and install executable # Check that an argument is present if [ -z "$1" ] then echo "FATAL ERROR for botw \n" echo "Usage: botw name " echo "\nname = name of the code " echo "Example: for edger_sqt.f name = edger_sqt" exit 1 fi cd $OTWSRC/$1 cp makes/makefile . make ls mv $1 $EXOTW chmod 777 $1.sh cp $1.sh $EXOTW echo "I have built and installed $1" # An example of running mcdsky: % mcdsky.sh --help Usage: mcdsky.sh 01:32:58.198 +30:31:35.60 20180206 02:02:22 arg1 - RA in sexigecimal format arg2 - DEC in sexigecimal format arg3 - UT date (YYYYMMDD) arg4 - UT Time (HH:MM:SS) % mcdsky.sh 01:32:58.198 +30:31:35.60 20180206 02:02:22 Summary of SKYCAL data: Target RA,DEC : 01:32:58.20 +30:31:35.6 UT date : 20180206 UT : 02:02:22 LST : 04:10:57.31 Days since J2000.0 : 6610.584961 Julian Date : 2458155.584977 Hour Angle : 02:37:59.11 (WEST) Target Altitude,Azimuth (degrees) : 56.183 280.129 Target airmass : 1.204 RA,DEC of Moon : 13:50:50.70 -05:58:57.0 Percentage moon illumination : Moon down Angle between target and moon (degrees): Moon down Zenith distance of target (degrees) : 33.8110 Zenith distance of moon (degrees) : Moon down (V sky SB = 21.9 if dark)Return to top.