The OTL service on Holt

Holt home:        /home/loading
Home pages:     ~/www -> /data1/loading/www/

Login:  ssh -Y loading@holt.oso.chalmers.se
   (ask me to add your  .ssh/<machine>/id_ecdsa.pub   or obtain the password)

Processing programs (Fortran 77) in ~/bin/ :
   olfg    - far-field loading effect
   olcmc - Centre of Mass Correction
   olmpp - near-field loading effect
Subroutine sources and library in ~/src/*.f* (liboload.a)
Main sources in ~/src/m/*.f

Data - tide models
   ~/tide-models/netCDF/<model>/amp.<tide> and pha.<tide>
CMC data:
   ~/bin/CMC/<model>.cmc

http-service:     Apache2

Mail service:    Postfix
   A blacklist of spamming senders has been tried, but was too difficult to maintain (hands-on too much too often).
 
Mail address:  loading@holt.oso.chalmers.se
   OBS! These mails are not parsed by Chalmers' central incoming mail server.
   A security risk, our responsibility never formally acknowledged.
   (Owing to the strict format required for legal mails to enter the processing chain, illegal ones are easily (too easily?) identified.)
 
Service script:     /cgi-bin/mailto.cgi
    Processes the html form data, method submit (not post).
    Heavily edited to refuse sending illegal requests to loading@holt.oso.chalmers.se
    incl. finding sender addresses in ~/div/blacklist.addr
    Copies the internally translated text to /home/hgs/div/mailto.log
       (The mail is made into one long line and special characters are translated into a hex-format
        - important to check from time to time if discrimination good/bad mail is o.k.)

loading@holt..  receives mail in /var/mail/loading
Indefinitely running scripts:
     ~/bin/parsemail-slim.pl 
     ~/bin/POL-the-manager
     ~/bin/queue.pl
   To start them:
   cd ~/bin
   nohup parsemail-slim.pl >> /home/loading/div/parsemail.log &
   nohup nice POL-the-manager >> /home/loading/div/POL.log  &
   nohup nice queue.pl &

Manually checking the status:
   Copy ~/bin/POL to your own holt:/home/...
   Browse http://holt.oso.chalmers.se/loading/queue.html

parsemail-slim.pl:
   Moves /var/mail/loading content to ~/Mail/loading
   Scans which mails request the high-resolution models FES2012, FES2014a, TPXO8, TPXO9*, which are forwarded to SEGAL (or Google Cloud) and removed from ~/Mail/loading
   Mails that fail the parsing: Noted in ~/Mail/weedreport.txt
   2021-02-23_11:36:59 - Letter from 89231417922@yandex.ru is weed, blacklisted: 89231417922@yandex.ru
   and the sender's mail address is added to  ~/div/blacklist.addr

POL-the-manager:
   Includes the functions of parsemail-slim.pl,
   but if one of the other ocean tide models is requested, goes into the process supervision stage:
   Without going too much into detail,
      Extracts the text of the request, keeps the remaining requests in ~/Mail/loading 
      Creates the instruction files for olfg (and if requested, olcmc).
      Starts the  program ~/bin/olfg and waits for completion.
      If the request includes CMC "correction", starts ~/bin/olcmc and waits for completion.
      If sites have been found near a coast, starts olmpp using one of the olmpp*.ins
      If plots are requested, runs  ~/bin/olmpp-plot (csh-script) and wais for completion
      Collects the resulting blq-files and sends them to the user's mail address using sendmail
      Writes notes to ~/bin/logbook.txt

queue.pl:
   Every one minute, looks at  ~/Mail/loading for jobs in waiting and ~/bin/logbook.txt
   for recently completed or forwarded-to-SEGAL requests.


OTL - Implementing a new tide model with name <name>

(brackets only for emphasis in this doc.)

If the model is processed on holt:
   mkdir ~/tide-models/netCDF/<name>
     Copy the files into it,
else
   cd ~/bin/
   <editor> parsemail-slim.pl
      Search for FES2014b
      Add a clause to the lines that identify models processed at SEGAL
                elsif (  $email =~ /Model = <name>/ or $email =~ /Model = TPXO8/ or $email =~ /Model = FES2012/ or $email =~ /Model = FES2014b/
                        or ( $email =~ /Model = TPXO9/ && not ( $email =~ /Model = TPXO9..*/ ) ) )
Do the same in POL-the-manager

   cd ~/bin
   cmc4model <name>
      sh-script, uses olfg to compute the cmc-coefficicnts; saves them in  ~/bin/CMC/<name>.cmc

   cd ~/www/index,html
   cp index.html index-old-at-<date>.html
   <editor> index.html
      Add the <name> to the drop-down list of tide models, like
          <option value="TPXO.7.0">TPXO.7.0&nbsp;</option>
      The value string must be exactly the name of the sub-directory.
      What's between > and </option> is the text visible in the menu.
      Add a comment in the News section.

Stop and restart the updated managers:
    touch /home/loading/bin/STOP.POL /home/loading/bin/STOPP.POL
    ps -uloading
Issue the two start commands