#!/bin/sh

#    Jan 14/2009 - F.Majaess (Revised for sa/saiph, ib/dorval-ib)
#    Jan 05/2007 - F.Majaess (Added "noxlfqinitauto" option support)
#    Oct 16/2006 - F.Majaess (Revised for ma/maia, ns/naos)
#    Mar 01/2006 - F.Majaess (Revised for rg/rigel)
#    Jun 20/2003 - F.Majaess (Revised for az/azur)
#    Oct 24/2002 - F.Majaess (Revised for switching executable library 
#                             location on SX6)
#    Feb 25/2002 - F.Majaess (Revised for SX6)
#    Oct 23/2001 - F.Majaess (Revised to support "comm/diag/plots/noplots" routines)
#    Sep 10/2001 - F.Majaess (Revised to generate "f90" separate set for the SX4)
#    Mar 14/2000 - F.Majaess 

#id  arcmsub - Handles installation of model version dependent,"comm","diag","plots" 
#id            and "noplots" subroutines into the appropriate archive libraries on 
#id            all local site platforms.

#    AUTHOR  - F.Majaess

#hd  PURPOSE - "arcmsub" handles the installation, via calls to "archsub",
#hd            of model specific version,"comm", "diag", "plots" and "noplots" 
#hd            subroutines/functions into the appropriate archive libraries on 
#hd            all local site platforms.

#pr  PARAMETERS:
#pr 
#pr    POSITIONAL
#pr
#pr      fil    = name of subroutine or function with which to update the
#pr               archive file (with .f extension).
#pr               If "*.f" is supplied, it will process all such files in
#pr               the current working directory.
#pr               "*.f" is the default if "all" switch is activated.
#pr
#pr    PRIMARY
#pr 
#pr      modver = This parameter can be set to "comm","diag","plots" or "noplots" 
#pr               to target installation in "comm", "diag", "plots" or "noplots" 
#pr               libraries, respectively. Any other setting is 
#pr               interpreted to refer to the model libary version to 
#pr               target for installation.
#pr               It is the responsibility of the invoker to ensure 
#pr               a valid value is provided (via "modver=..."). 
#pr               The script will abort if no "modver" is specified.
#pr               (=fake). 
#pr
#pr  fil_grpname= User has the option of specifying one of
#pr               'ccrn_shr/ccrn_stf/ccrn_net/ccrn_rcm/ccrn_mam/ccrn_gst'
#pr               group ownership on the archive library.
#pr               (=$DEFFGRP).
#pr
#pr      time   = time limit to use for submitting NQS job in seconds 
#pr               (=600) (Ignored; default "archsub" setting is used)
#pr  
#pr      mem    = memory limit to use for submitting NQS job in megabytes 
#pr               (=250) (Ignored; default "archsub" setting is used))
#pr 
#pr 
#pr    SECONDARY
#pr 
#pr        all  = switch to process all '.f' files in all the 
#pr               subdirectories underneath the current subdirectory 
#pr               as well as those in the current subdirectory.
#pr               Mainly used to rearchive all '*.f' codes for a given
#pr               library.
#pr               (='no'/'yes')
#pr
#pr     f90mod  = switch to be used with Fortran 90(+) modules where
#pr               the source code is expected to be supplied so that
#pr               the internal caching file is properly ordered with
#pr               modules defined before being referenced. Also, the
#pr               submitted job make use of and relies upon "f90split"
#pr               utility functionalities to properly accomplish the
#pr               expected task. 
#pr               (='no'/'yes')
#pr

#ex  EXAMPLE:
#ex 

#ex    arcmsub *.f modver=gcm6u fil_grpname='ccrn_shr' 
#ex 
#ex      The above example gets the source code from all "*.f" files in the
#ex      current working directory on the server and submits NQS jobs, one
#ex      per supported archive library, to compile and archive the routines
#ex      source code. The targeted archive libraries are assigned "ccrn_shr" 
#ex      group ownership.
#ex
#ex    arcmsub ptsi.f modver=comm time=100
#ex 
#ex      The above example leads to installing "ptsi.f" routine in each of
#ex      the supported "LOSUB_comm" archive libraries on the local site.

# Capture the arguments in "dirctv":

dirctv=${dirctv:=$*}

# Process if the local site is supported...

if [ "$SITE_ID" = 'Dorval' -o "$SITE_ID" = 'Victoria' ] ; then

  #  * Reset field separators 
  
  IFS=' '
  export IFS
  
  #  * Ensure "modver" has a value...

  unset modver
  
  arg_list=$@
  for arg in $arg_list
  do
    case $arg in
              -*) set $arg                     ;;
        modver=*) eval "$arg"                  ;;
       archsub=*) eval "$arg"                  ;;
           all=*) eval "$arg"                  ;;
             all)  all='yes'                   ;;
        f90mod=*) eval "$arg"                  ;;
          f90mod)  f90mod='yes'                ;;
#         time=*) eval "$arg"                  ;;
#          mem=*) eval "$arg"                  ;;
             *.f) fil_list="$fil_list $arg"    ;;
               *) : 
    esac
  done 
  archsub=${archsub:='archsub'}
  all=${all:='no'}
 #if [ "$all" = 'yes' ] ; then
 #  if [ "$f90mod" = 'yes' ] ; then
 #   echo "Arcmsub: Sorry, all=yes is not valid with f90mod=yes !"
 #   exit 1
 #  fi
 #fi

# time=${time:=600}
# mem=${mem:=50}

  #  * Exit if no value set for modver.
  
  if [ -z "$modver" ] ; then
    echo "No value specified for modver!"
    exit 1
  fi

  #  * Proceed with the appropriate calls for the local site...

  if [ "$SITE_ID" = 'Dorval' ] ; then

   DEF_XLFVER='xlfver=xlf12104'
   DEF_XLFVER7='xlfver=xlf13108'

   set -x

   if [ "$modver" = 'comm' ] ; then
  
#    # * POLLUX
#  
     ${archsub} ${dirctv} afname=LOSUB_${modver} po
     ${archsub} ${dirctv} afname=LOSUB_${modver}_float1 float1 po
     ${archsub} ${dirctv} afname=LOSUB_${modver}_float1_openmp float1 openmp po
     ${archsub} ${dirctv} afname=LOSUB_${modver}_float2 float2 po
     ${archsub} ${dirctv} afname=LOSUB_${modver}_openmp openmp po

### #    # * ALEF
### # 
###      ${archsub} ${dirctv} afname=LOSUB_${modver} af
###      ${archsub} ${dirctv} afname=LOSUB_${modver}_float1 float1 af
###      ${archsub} ${dirctv} afname=LOSUB_${modver}_float1_openmp float1 openmp af
###      ${archsub} ${dirctv} afname=LOSUB_${modver}_float2 float2 af
###      ${archsub} ${dirctv} afname=LOSUB_${modver}_openmp openmp af

### #    # * MAIA
### # 
###      ${archsub} ${dirctv} $DEF_XLFVER afname=LOSUB_${modver} ma
###      ${archsub} ${dirctv} $DEF_XLFVER afname=LOSUB_${modver}_float1 float1 ma
###      ${archsub} ${dirctv} $DEF_XLFVER afname=LOSUB_${modver}_float1_openmp float1 openmp ma
###      ${archsub} ${dirctv} $DEF_XLFVER afname=LOSUB_${modver}_float1_openmp_noxlfqinitauto float1 openmp noxlfqinitauto ma
###      ${archsub} ${dirctv} $DEF_XLFVER afname=LOSUB_${modver}_float2 float2 ma
###      ${archsub} ${dirctv} $DEF_XLFVER afname=LOSUB_${modver}_openmp openmp ma
###      ${archsub} ${dirctv} $DEF_XLFVER afname=LOSUB_${modver}_openmp_noxlfqinitauto openmp noxlfqinitauto ma
###   
###      ${archsub} ${dirctv} xlfver=xlf10103 afname=LOSUB_${modver}_xlf10103 ma
###      ${archsub} ${dirctv} xlfver=xlf10103 afname=LOSUB_${modver}_float1_xlf10103 float1 ma
###      ${archsub} ${dirctv} xlfver=xlf10103 afname=LOSUB_${modver}_float1_openmp_xlf10103 float1 openmp ma
###      ${archsub} ${dirctv} xlfver=xlf10103 afname=LOSUB_${modver}_float1_openmp_noxlfqinitauto_xlf10103 float1 openmp noxlfqinitauto ma
###      ${archsub} ${dirctv} xlfver=xlf10103 afname=LOSUB_${modver}_float2_xlf10103 float2 ma
###      ${archsub} ${dirctv} xlfver=xlf10103 afname=LOSUB_${modver}_openmp_xlf10103 openmp ma
###      ${archsub} ${dirctv} xlfver=xlf10103 afname=LOSUB_${modver}_openmp_noxlfqinitauto_xlf10103 openmp noxlfqinitauto ma
###   
###      ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_${modver}_xlf12104 ma
###      ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_${modver}_float1_xlf12104 float1 ma
###      ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_${modver}_float1_openmp_xlf12104 float1 openmp ma
###      ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_${modver}_float1_openmp_noxlfqinitauto_xlf12104 float1 openmp noxlfqinitauto ma
###      ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_${modver}_float2_xlf12104 float2 ma
###      ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_${modver}_openmp_xlf12104 openmp ma
###      ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_${modver}_openmp_noxlfqinitauto_xlf12104 openmp noxlfqinitauto ma
  

## #    # * SAIPH
## # 
##      ${archsub} ${dirctv} $DEF_XLFVER afname=LOSUB_${modver} sa
##      ${archsub} ${dirctv} $DEF_XLFVER afname=LOSUB_${modver}_float1 float1 sa
##      ${archsub} ${dirctv} $DEF_XLFVER afname=LOSUB_${modver}_float1_openmp float1 openmp sa
##      ${archsub} ${dirctv} $DEF_XLFVER afname=LOSUB_${modver}_float1_openmp_noxlfqinitauto float1 openmp noxlfqinitauto sa
##      ${archsub} ${dirctv} $DEF_XLFVER afname=LOSUB_${modver}_float2 float2 sa
##      ${archsub} ${dirctv} $DEF_XLFVER afname=LOSUB_${modver}_openmp openmp sa
##      ${archsub} ${dirctv} $DEF_XLFVER afname=LOSUB_${modver}_openmp_noxlfqinitauto openmp noxlfqinitauto sa
## 
##      ${archsub} ${dirctv} xlfver=xlf10103 afname=LOSUB_${modver}_xlf10103 sa
##      ${archsub} ${dirctv} xlfver=xlf10103 afname=LOSUB_${modver}_float1_xlf10103 float1 sa
##      ${archsub} ${dirctv} xlfver=xlf10103 afname=LOSUB_${modver}_float1_openmp_xlf10103 float1 openmp sa
##      ${archsub} ${dirctv} xlfver=xlf10103 afname=LOSUB_${modver}_float1_openmp_noxlfqinitauto_xlf10103 float1 openmp noxlfqinitauto sa
##      ${archsub} ${dirctv} xlfver=xlf10103 afname=LOSUB_${modver}_float2_xlf10103 float2 sa
##      ${archsub} ${dirctv} xlfver=xlf10103 afname=LOSUB_${modver}_openmp_xlf10103 openmp sa
##      ${archsub} ${dirctv} xlfver=xlf10103 afname=LOSUB_${modver}_openmp_noxlfqinitauto_xlf10103 openmp noxlfqinitauto sa
## 
##      ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_${modver}_xlf12104 sa
##      ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_${modver}_float1_xlf12104 float1 sa
##      ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_${modver}_float1_openmp_xlf12104 float1 openmp sa
##      ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_${modver}_float1_openmp_noxlfqinitauto_xlf12104 float1 openmp noxlfqinitauto sa
##      ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_${modver}_float2_xlf12104 float2 sa
##      ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_${modver}_openmp_xlf12104 openmp sa
##      ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_${modver}_openmp_noxlfqinitauto_xlf12104 openmp noxlfqinitauto sa

## #    # * ZETA
## # 
##      ${archsub} ${dirctv} $DEF_XLFVER afname=LOSUB_${modver} za
##      ${archsub} ${dirctv} $DEF_XLFVER afname=LOSUB_${modver}_float1 float1 za
##      ${archsub} ${dirctv} $DEF_XLFVER afname=LOSUB_${modver}_float1_openmp float1 openmp za
##      ${archsub} ${dirctv} $DEF_XLFVER afname=LOSUB_${modver}_float1_openmp_noxlfqinitauto float1 openmp noxlfqinitauto za
##      ${archsub} ${dirctv} $DEF_XLFVER afname=LOSUB_${modver}_float2 float2 za
##      ${archsub} ${dirctv} $DEF_XLFVER afname=LOSUB_${modver}_openmp openmp za
##      ${archsub} ${dirctv} $DEF_XLFVER afname=LOSUB_${modver}_openmp_noxlfqinitauto openmp noxlfqinitauto za
## 
##      ${archsub} ${dirctv} xlfver=xlf10103 afname=LOSUB_${modver}_xlf10103 za
##      ${archsub} ${dirctv} xlfver=xlf10103 afname=LOSUB_${modver}_float1_xlf10103 float1 za
##      ${archsub} ${dirctv} xlfver=xlf10103 afname=LOSUB_${modver}_float1_openmp_xlf10103 float1 openmp za
##      ${archsub} ${dirctv} xlfver=xlf10103 afname=LOSUB_${modver}_float1_openmp_noxlfqinitauto_xlf10103 float1 openmp noxlfqinitauto za
##      ${archsub} ${dirctv} xlfver=xlf10103 afname=LOSUB_${modver}_float2_xlf10103 float2 za
##      ${archsub} ${dirctv} xlfver=xlf10103 afname=LOSUB_${modver}_openmp_xlf10103 openmp za
##      ${archsub} ${dirctv} xlfver=xlf10103 afname=LOSUB_${modver}_openmp_noxlfqinitauto_xlf10103 openmp noxlfqinitauto za
## 
##      ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_${modver}_xlf12104 za
##      ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_${modver}_float1_xlf12104 float1 za
##      ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_${modver}_float1_openmp_xlf12104 float1 openmp za
##      ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_${modver}_float1_openmp_noxlfqinitauto_xlf12104 float1 openmp noxlfqinitauto za
##      ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_${modver}_float2_xlf12104 float2 za
##      ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_${modver}_openmp_xlf12104 openmp za
##      ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_${modver}_openmp_noxlfqinitauto_xlf12104 openmp noxlfqinitauto za

#    # * SPICA
# 
     ${archsub} ${dirctv} $DEF_XLFVER7 afname=LOSUB_${modver} sp
     ${archsub} ${dirctv} $DEF_XLFVER7 afname=LOSUB_${modver}_float1 float1 sp
     ${archsub} ${dirctv} $DEF_XLFVER7 afname=LOSUB_${modver}_float1_openmp float1 openmp sp
     ${archsub} ${dirctv} $DEF_XLFVER7 afname=LOSUB_${modver}_float1_openmp_noxlfqinitauto float1 openmp noxlfqinitauto sp
     ${archsub} ${dirctv} $DEF_XLFVER7 afname=LOSUB_${modver}_float2 float2 sp
     ${archsub} ${dirctv} $DEF_XLFVER7 afname=LOSUB_${modver}_openmp openmp sp
     ${archsub} ${dirctv} $DEF_XLFVER7 afname=LOSUB_${modver}_openmp_noxlfqinitauto openmp noxlfqinitauto sp

     ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_${modver}_xlf12104 sp
     ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_${modver}_float1_xlf12104 float1 sp
     ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_${modver}_float1_openmp_xlf12104 float1 openmp sp
     ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_${modver}_float1_openmp_noxlfqinitauto_xlf12104 float1 openmp noxlfqinitauto sp
     ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_${modver}_float2_xlf12104 float2 sp
     ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_${modver}_openmp_xlf12104 openmp sp
     ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_${modver}_openmp_noxlfqinitauto_xlf12104 openmp noxlfqinitauto sp

     ${archsub} ${dirctv} xlfver=xlf13108 afname=LOSUB_${modver}_xlf13108 sp
     ${archsub} ${dirctv} xlfver=xlf13108 afname=LOSUB_${modver}_float1_xlf13108 float1 sp
     ${archsub} ${dirctv} xlfver=xlf13108 afname=LOSUB_${modver}_float1_openmp_xlf13108 float1 openmp sp
     ${archsub} ${dirctv} xlfver=xlf13108 afname=LOSUB_${modver}_float1_openmp_noxlfqinitauto_xlf13108 float1 openmp noxlfqinitauto sp
     ${archsub} ${dirctv} xlfver=xlf13108 afname=LOSUB_${modver}_float2_xlf13108 float2 sp
     ${archsub} ${dirctv} xlfver=xlf13108 afname=LOSUB_${modver}_openmp_xlf13108 openmp sp
     ${archsub} ${dirctv} xlfver=xlf13108 afname=LOSUB_${modver}_openmp_noxlfqinitauto_xlf13108 openmp noxlfqinitauto sp

#    # * HADAR
# 
     ${archsub} ${dirctv} $DEF_XLFVER7 afname=LOSUB_${modver} ha
     ${archsub} ${dirctv} $DEF_XLFVER7 afname=LOSUB_${modver}_float1 float1 ha
     ${archsub} ${dirctv} $DEF_XLFVER7 afname=LOSUB_${modver}_float1_openmp float1 openmp ha
     ${archsub} ${dirctv} $DEF_XLFVER7 afname=LOSUB_${modver}_float1_openmp_noxlfqinitauto float1 openmp noxlfqinitauto ha
     ${archsub} ${dirctv} $DEF_XLFVER7 afname=LOSUB_${modver}_float2 float2 ha
     ${archsub} ${dirctv} $DEF_XLFVER7 afname=LOSUB_${modver}_openmp openmp ha
     ${archsub} ${dirctv} $DEF_XLFVER7 afname=LOSUB_${modver}_openmp_noxlfqinitauto openmp noxlfqinitauto ha

     ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_${modver}_xlf12104 ha
     ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_${modver}_float1_xlf12104 float1 ha
     ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_${modver}_float1_openmp_xlf12104 float1 openmp ha
     ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_${modver}_float1_openmp_noxlfqinitauto_xlf12104 float1 openmp noxlfqinitauto ha
     ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_${modver}_float2_xlf12104 float2 ha
     ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_${modver}_openmp_xlf12104 openmp ha
     ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_${modver}_openmp_noxlfqinitauto_xlf12104 openmp noxlfqinitauto ha

     ${archsub} ${dirctv} xlfver=xlf13108 afname=LOSUB_${modver}_xlf13108 ha
     ${archsub} ${dirctv} xlfver=xlf13108 afname=LOSUB_${modver}_float1_xlf13108 float1 ha
     ${archsub} ${dirctv} xlfver=xlf13108 afname=LOSUB_${modver}_float1_openmp_xlf13108 float1 openmp ha
     ${archsub} ${dirctv} xlfver=xlf13108 afname=LOSUB_${modver}_float1_openmp_noxlfqinitauto_xlf13108 float1 openmp noxlfqinitauto ha
     ${archsub} ${dirctv} xlfver=xlf13108 afname=LOSUB_${modver}_float2_xlf13108 float2 ha
     ${archsub} ${dirctv} xlfver=xlf13108 afname=LOSUB_${modver}_openmp_xlf13108 openmp ha
     ${archsub} ${dirctv} xlfver=xlf13108 afname=LOSUB_${modver}_openmp_noxlfqinitauto_xlf13108 openmp noxlfqinitauto ha

##    # * ALGOL
## 
#     ${archsub} ${dirctv} $DEF_XLFVER7 afname=LOSUB_${modver} al
#     ${archsub} ${dirctv} $DEF_XLFVER7 afname=LOSUB_${modver}_float1 float1 al
#     ${archsub} ${dirctv} $DEF_XLFVER7 afname=LOSUB_${modver}_float1_openmp float1 openmp al
#     ${archsub} ${dirctv} $DEF_XLFVER7 afname=LOSUB_${modver}_float1_openmp_noxlfqinitauto float1 openmp noxlfqinitauto al
#     ${archsub} ${dirctv} $DEF_XLFVER7 afname=LOSUB_${modver}_float2 float2 al
#     ${archsub} ${dirctv} $DEF_XLFVER7 afname=LOSUB_${modver}_openmp openmp al
#     ${archsub} ${dirctv} $DEF_XLFVER7 afname=LOSUB_${modver}_openmp_noxlfqinitauto openmp noxlfqinitauto al
#
#     ${archsub} ${dirctv} xlfver=xlf13108 afname=LOSUB_${modver}_xlf13108 al
#     ${archsub} ${dirctv} xlfver=xlf13108 afname=LOSUB_${modver}_float1_xlf13108 float1 al
#     ${archsub} ${dirctv} xlfver=xlf13108 afname=LOSUB_${modver}_float1_openmp_xlf13108 float1 openmp al
#     ${archsub} ${dirctv} xlfver=xlf13108 afname=LOSUB_${modver}_float1_openmp_noxlfqinitauto_xlf13108 float1 openmp noxlfqinitauto al
#     ${archsub} ${dirctv} xlfver=xlf13108 afname=LOSUB_${modver}_float2_xlf13108 float2 al
#     ${archsub} ${dirctv} xlfver=xlf13108 afname=LOSUB_${modver}_openmp_xlf13108 openmp al
#     ${archsub} ${dirctv} xlfver=xlf13108 afname=LOSUB_${modver}_openmp_noxlfqinitauto_xlf13108 openmp noxlfqinitauto al
#
#     ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_${modver}_xlf12104 al
#     ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_${modver}_float1_xlf12104 float1 al
#     ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_${modver}_float1_openmp_xlf12104 float1 openmp al
#     ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_${modver}_float1_openmp_noxlfqinitauto_xlf12104 float1 openmp noxlfqinitauto al
#     ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_${modver}_float2_xlf12104 float2 al
#     ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_${modver}_openmp_xlf12104 openmp al
#     ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_${modver}_openmp_noxlfqinitauto_xlf12104 openmp noxlfqinitauto al

# 
#    # * YATA
# 
#    ${archsub} ${dirctv} afname=LOSUB_${modver} ya
#    ${archsub} ${dirctv} afname=LOSUB_${modver}_multi multi ya
#    ${archsub} ${dirctv} afname=LOSUB_${modver}_openmp openmp ya
  

##   #  + "12.1" set (if need be)...
##
##   if [ "$SXCROSS_KIT" != '12.1' ] ; then
##    ${archsub} ${dirctv} \
##               sxcross_kit='12.1' \
##               SX5RTEXTBLS=/sx/crb/nfc_src/sx6_executables_12.1     \
##               XF90RTEXTBLS=/users/tor/acrn/src/sx6_executables_12.1 \
##               afname=LOSUB_${modver} xf90 yata
##    ${archsub} ${dirctv} \
##               sxcross_kit='12.1' \
##               SX5RTEXTBLS=/sx/crb/nfc_src/sx6_executables_12.1     \
##               XF90RTEXTBLS=/users/tor/acrn/src/sx6_executables_12.1 \
##               afname=LOSUB_${modver}_multi multi xf90 yata
##   fi


##   if [ -n "$fil_list" -a "$all" != 'yes' ] ; then

##     Cwd=`pwd`
##     # cp -p $fil_list $BEHOMEX/source_sx6/lssub/comm
##     # cd $BEHOMEX/source_sx6/lssub/comm
##     # chmod u+w $fil_list
##     # cd $Cwd
##     # cp -p $fil_list $BEHOMEX/source_sx6/lssub_comm_fullfan
##     # cd $BEHOMEX/source_sx6/lssub_comm_fullfan
##     # chmod u+w $fil_list
##     # cd $Cwd
##     
##   else

##     set +x
##     echo "Note: Not able to handle copying the source files to"
##     echo "      $BEHOMEX/source_sx6/lssub/comm "
##     echo "      and"
##     echo "      $BEHOMEX/source_sx6/lssub_comm_fullfan"
##     echo "      This task is left to be performed by the user"
##    
##   fi

   elif [ "$modver" = 'diag' -o "$modver" = 'plots' -o "$modver" = 'noplots' ] ; then

  
#    # * POLLUX
  
     ${archsub} ${dirctv} afname=LOSUB_${modver} po
     ${archsub} ${dirctv} afname=LOSUB_${modver}_float1 float1 po
     ${archsub} ${dirctv} afname=LOSUB_${modver}_float1_openmp float1 openmp po

#    if [ "$modver" != 'plots' -a "$modver" != 'noplots' ] ; then
      ${archsub} ${dirctv} afname=LOSUB_${modver}_float2 float2 po
      ${archsub} ${dirctv} afname=LOSUB_${modver}_openmp openmp po
#    fi
  
### #    # * ALEF
### # 
###      ${archsub} ${dirctv} afname=LOSUB_${modver} af
###      ${archsub} ${dirctv} afname=LOSUB_${modver}_float1 float1 af
###      ${archsub} ${dirctv} afname=LOSUB_${modver}_float1_openmp float1 openmp af
### 
### #    if [ "$modver" != 'plots' -a "$modver" != 'noplots' ] ; then
###       ${archsub} ${dirctv} afname=LOSUB_${modver}_float2 float2 af
###       ${archsub} ${dirctv} afname=LOSUB_${modver}_openmp openmp af
### #    fi

  
### #    # * MAIA
### # 
###      ${archsub} ${dirctv} $DEF_XLFVER afname=LOSUB_${modver} ma
###      ${archsub} ${dirctv} $DEF_XLFVER afname=LOSUB_${modver}_float1 float1 ma
###      ${archsub} ${dirctv} $DEF_XLFVER afname=LOSUB_${modver}_float1_openmp float1 openmp ma
### 
###      ${archsub} ${dirctv} xlfver=xlf10103 afname=LOSUB_${modver}_xlf10103 ma
###      ${archsub} ${dirctv} xlfver=xlf10103 afname=LOSUB_${modver}_float1_xlf10103 float1 ma
###      ${archsub} ${dirctv} xlfver=xlf10103 afname=LOSUB_${modver}_float1_openmp_xlf10103 float1 openmp ma
### 
###      ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_${modver}_xlf12104 ma
###      ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_${modver}_float1_xlf12104 float1 ma
###      ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_${modver}_float1_openmp_xlf12104 float1 openmp ma
### 
###      if [ "$modver" != 'plots' -a "$modver" != 'noplots' ] ; then
###       ${archsub} ${dirctv} $DEF_XLFVER afname=LOSUB_${modver}_float2 float2 ma
###       ${archsub} ${dirctv} $DEF_XLFVER afname=LOSUB_${modver}_openmp openmp ma
### 
###       ${archsub} ${dirctv} xlfver=xlf10103 afname=LOSUB_${modver}_float2_xlf10103 float2 ma
###       ${archsub} ${dirctv} xlfver=xlf10103 afname=LOSUB_${modver}_openmp_xlf10103 openmp ma
### 
###       ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_${modver}_float2_xlf12104 float2 ma
###       ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_${modver}_openmp_xlf12104 openmp ma
### 
###      fi
  
## #    # * SAIPH
## # 
##      ${archsub} ${dirctv} $DEF_XLFVER afname=LOSUB_${modver} sa
##      ${archsub} ${dirctv} $DEF_XLFVER afname=LOSUB_${modver}_float1 float1 sa
##      ${archsub} ${dirctv} $DEF_XLFVER afname=LOSUB_${modver}_float1_openmp float1 openmp sa
## 
##      ${archsub} ${dirctv} xlfver=xlf10103 afname=LOSUB_${modver}_xlf10103 sa
##      ${archsub} ${dirctv} xlfver=xlf10103 afname=LOSUB_${modver}_float1_xlf10103 float1 sa
##      ${archsub} ${dirctv} xlfver=xlf10103 afname=LOSUB_${modver}_float1_openmp_xlf10103 float1 openmp sa
## 
##      ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_${modver}_xlf12104 sa
##      ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_${modver}_float1_xlf12104 float1 sa
##      ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_${modver}_float1_openmp_xlf12104 float1 openmp sa
## 
##      if [ "$modver" != 'plots' -a "$modver" != 'noplots' ] ; then
##       ${archsub} ${dirctv} $DEF_XLFVER afname=LOSUB_${modver}_float2 float2 sa
##       ${archsub} ${dirctv} $DEF_XLFVER afname=LOSUB_${modver}_openmp openmp sa
## 
##       ${archsub} ${dirctv} xlfver=xlf10103 afname=LOSUB_${modver}_float2_xlf10103 float2 sa
##       ${archsub} ${dirctv} xlfver=xlf10103 afname=LOSUB_${modver}_openmp_xlf10103 openmp sa
## 
##       ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_${modver}_float2_xlf12104 float2 sa
##       ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_${modver}_openmp_xlf12104 openmp sa
##      fi

## #    # * ZETA
## # 
##      ${archsub} ${dirctv} $DEF_XLFVER afname=LOSUB_${modver} za
##      ${archsub} ${dirctv} $DEF_XLFVER afname=LOSUB_${modver}_float1 float1 za
##      ${archsub} ${dirctv} $DEF_XLFVER afname=LOSUB_${modver}_float1_openmp float1 openmp za
## 
##      ${archsub} ${dirctv} xlfver=xlf10103 afname=LOSUB_${modver}_xlf10103 za
##      ${archsub} ${dirctv} xlfver=xlf10103 afname=LOSUB_${modver}_float1_xlf10103 float1 za
##      ${archsub} ${dirctv} xlfver=xlf10103 afname=LOSUB_${modver}_float1_openmp_xlf10103 float1 openmp za
## 
##      ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_${modver}_xlf12104 za
##      ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_${modver}_float1_xlf12104 float1 za
##      ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_${modver}_float1_openmp_xlf12104 float1 openmp za
## 
##      if [ "$modver" != 'plots' -a "$modver" != 'noplots' ] ; then
##       ${archsub} ${dirctv} $DEF_XLFVER afname=LOSUB_${modver}_float2 float2 za
##       ${archsub} ${dirctv} $DEF_XLFVER afname=LOSUB_${modver}_openmp openmp za
## 
##       ${archsub} ${dirctv} xlfver=xlf10103 afname=LOSUB_${modver}_float2_xlf10103 float2 za
##       ${archsub} ${dirctv} xlfver=xlf10103 afname=LOSUB_${modver}_openmp_xlf10103 openmp za
## 
##       ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_${modver}_float2_xlf12104 float2 za
##       ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_${modver}_openmp_xlf12104 openmp za
##      fi


#    # * SPICA
# 
     ${archsub} ${dirctv} $DEF_XLFVER7 afname=LOSUB_${modver} sp
     ${archsub} ${dirctv} $DEF_XLFVER7 afname=LOSUB_${modver}_float1 float1 sp
     ${archsub} ${dirctv} $DEF_XLFVER7 afname=LOSUB_${modver}_float1_openmp float1 openmp sp

     ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_${modver}_xlf12104 sp
     ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_${modver}_float1_xlf12104 float1 sp
     ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_${modver}_float1_openmp_xlf12104 float1 openmp sp

     ${archsub} ${dirctv} xlfver=xlf13108 afname=LOSUB_${modver}_xlf13108 sp
     ${archsub} ${dirctv} xlfver=xlf13108 afname=LOSUB_${modver}_float1_xlf13108 float1 sp
     ${archsub} ${dirctv} xlfver=xlf13108 afname=LOSUB_${modver}_float1_openmp_xlf13108 float1 openmp sp

     if [ "$modver" != 'plots' -a "$modver" != 'noplots' ] ; then
      ${archsub} ${dirctv} $DEF_XLFVER7 afname=LOSUB_${modver}_float2 float2 sp
      ${archsub} ${dirctv} $DEF_XLFVER7 afname=LOSUB_${modver}_openmp openmp sp

      ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_${modver}_float2_xlf12104 float2 sp
      ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_${modver}_openmp_xlf12104 openmp sp

      ${archsub} ${dirctv} xlfver=xlf13108 afname=LOSUB_${modver}_float2_xlf13108 float2 sp
      ${archsub} ${dirctv} xlfver=xlf13108 afname=LOSUB_${modver}_openmp_xlf13108 openmp sp
     fi

#    # * HADAR
# 
     ${archsub} ${dirctv} $DEF_XLFVER7 afname=LOSUB_${modver} ha
     ${archsub} ${dirctv} $DEF_XLFVER7 afname=LOSUB_${modver}_float1 float1 ha
     ${archsub} ${dirctv} $DEF_XLFVER7 afname=LOSUB_${modver}_float1_openmp float1 openmp ha

     ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_${modver}_xlf12104 ha
     ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_${modver}_float1_xlf12104 float1 ha
     ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_${modver}_float1_openmp_xlf12104 float1 openmp ha

     ${archsub} ${dirctv} xlfver=xlf13108 afname=LOSUB_${modver}_xlf13108 ha
     ${archsub} ${dirctv} xlfver=xlf13108 afname=LOSUB_${modver}_float1_xlf13108 float1 ha
     ${archsub} ${dirctv} xlfver=xlf13108 afname=LOSUB_${modver}_float1_openmp_xlf13108 float1 openmp ha

     if [ "$modver" != 'plots' -a "$modver" != 'noplots' ] ; then
      ${archsub} ${dirctv} $DEF_XLFVER7 afname=LOSUB_${modver}_float2 float2 ha
      ${archsub} ${dirctv} $DEF_XLFVER7 afname=LOSUB_${modver}_openmp openmp ha

      ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_${modver}_float2_xlf12104 float2 ha
      ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_${modver}_openmp_xlf12104 openmp ha

      ${archsub} ${dirctv} xlfver=xlf13108 afname=LOSUB_${modver}_float2_xlf13108 float2 ha
      ${archsub} ${dirctv} xlfver=xlf13108 afname=LOSUB_${modver}_openmp_xlf13108 openmp ha
     fi

##    # * ALGOL
## 
#     ${archsub} ${dirctv} $DEF_XLFVER7 afname=LOSUB_${modver} al
#     ${archsub} ${dirctv} $DEF_XLFVER7 afname=LOSUB_${modver}_float1 float1 al
#     ${archsub} ${dirctv} $DEF_XLFVER7 afname=LOSUB_${modver}_float1_openmp float1 openmp al
#
#     ${archsub} ${dirctv} xlfver=xlf13108 afname=LOSUB_${modver}_xlf13108 al
#     ${archsub} ${dirctv} xlfver=xlf13108 afname=LOSUB_${modver}_float1_xlf13108 float1 al
#     ${archsub} ${dirctv} xlfver=xlf13108 afname=LOSUB_${modver}_float1_openmp_xlf13108 float1 openmp al
#
#     ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_${modver}_xlf12104 al
#     ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_${modver}_float1_xlf12104 float1 al
#     ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_${modver}_float1_openmp_xlf12104 float1 openmp al
#
#     if [ "$modver" != 'plots' -a "$modver" != 'noplots' ] ; then
#      ${archsub} ${dirctv} $DEF_XLFVER7 afname=LOSUB_${modver}_float2 float2 al
#      ${archsub} ${dirctv} $DEF_XLFVER7 afname=LOSUB_${modver}_openmp openmp al
#
#      ${archsub} ${dirctv} xlfver=xlf13108 afname=LOSUB_${modver}_float2_xlf13108 float2 al
#      ${archsub} ${dirctv} xlfver=xlf13108 afname=LOSUB_${modver}_openmp_xlf13108 openmp al
#
#      ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_${modver}_float2_xlf12104 float2 al
#      ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_${modver}_openmp_xlf12104 openmp al
#     fi

   else

     # * Model...

#    # * POLLUX
# 
     ${archsub} ${dirctv} afname=LOSUB_model_${modver} po
     ${archsub} ${dirctv} afname=LOSUB_model_${modver}_float1 float1 po
     ${archsub} ${dirctv} afname=LOSUB_model_${modver}_float1_openmp float1 openmp po
     ${archsub} ${dirctv} afname=LOSUB_model_${modver}_float2 float2 po
     ${archsub} ${dirctv} afname=LOSUB_model_${modver}_openmp openmp po

### #    # * ALEF
### # 
###      ${archsub} ${dirctv} afname=LOSUB_model_${modver} af
###      ${archsub} ${dirctv} afname=LOSUB_model_${modver}_float1 float1 af
###      ${archsub} ${dirctv} afname=LOSUB_model_${modver}_float1_openmp float1 openmp af
###      ${archsub} ${dirctv} afname=LOSUB_model_${modver}_float2 float2 af
###      ${archsub} ${dirctv} afname=LOSUB_model_${modver}_openmp openmp af

### #    # * MAIA
### # 
###      ${archsub} ${dirctv} $DEF_XLFVER afname=LOSUB_model_${modver} ma
###      ${archsub} ${dirctv} $DEF_XLFVER afname=LOSUB_model_${modver}_float1 float1 ma
###      ${archsub} ${dirctv} $DEF_XLFVER afname=LOSUB_model_${modver}_float1_openmp float1 openmp ma
###      ${archsub} ${dirctv} $DEF_XLFVER afname=LOSUB_model_${modver}_float1_openmp_noxlfqinitauto float1 openmp noxlfqinitauto ma
###      ${archsub} ${dirctv} $DEF_XLFVER afname=LOSUB_model_${modver}_float2 float2 ma
###      ${archsub} ${dirctv} $DEF_XLFVER afname=LOSUB_model_${modver}_openmp openmp ma
###      ${archsub} ${dirctv} $DEF_XLFVER afname=LOSUB_model_${modver}_openmp_noxlfqinitauto openmp noxlfqinitauto ma
###   
###      ${archsub} ${dirctv} xlfver=xlf10103 afname=LOSUB_model_${modver}_xlf10103 ma
###      ${archsub} ${dirctv} xlfver=xlf10103 afname=LOSUB_model_${modver}_float1_xlf10103 float1 ma
###      ${archsub} ${dirctv} xlfver=xlf10103 afname=LOSUB_model_${modver}_float1_openmp_xlf10103 float1 openmp ma
###      ${archsub} ${dirctv} xlfver=xlf10103 afname=LOSUB_model_${modver}_float1_openmp_noxlfqinitauto_xlf10103 float1 openmp noxlfqinitauto ma
###      ${archsub} ${dirctv} xlfver=xlf10103 afname=LOSUB_model_${modver}_float2_xlf10103 float2 ma
###      ${archsub} ${dirctv} xlfver=xlf10103 afname=LOSUB_model_${modver}_openmp_xlf10103 openmp ma
###      ${archsub} ${dirctv} xlfver=xlf10103 afname=LOSUB_model_${modver}_openmp_noxlfqinitauto_xlf10103 openmp noxlfqinitauto ma
###   
###      ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_model_${modver}_xlf12104 ma
###      ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_model_${modver}_float1_xlf12104 float1 ma
###      ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_model_${modver}_float1_openmp_xlf12104 float1 openmp ma
###      ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_model_${modver}_float1_openmp_noxlfqinitauto_xlf12104 float1 openmp noxlfqinitauto ma
###      ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_model_${modver}_float2_xlf12104 float2 ma
###      ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_model_${modver}_openmp_xlf12104 openmp ma
###      ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_model_${modver}_openmp_noxlfqinitauto_xlf12104 openmp noxlfqinitauto ma
  
## #    # * SAIPH
## # 
##      ${archsub} ${dirctv} $DEF_XLFVER afname=LOSUB_model_${modver} sa
##      ${archsub} ${dirctv} $DEF_XLFVER afname=LOSUB_model_${modver}_float1 float1 sa
##      ${archsub} ${dirctv} $DEF_XLFVER afname=LOSUB_model_${modver}_float1_openmp float1 openmp sa
##      ${archsub} ${dirctv} $DEF_XLFVER afname=LOSUB_model_${modver}_float1_openmp_noxlfqinitauto float1 openmp noxlfqinitauto sa
##      ${archsub} ${dirctv} $DEF_XLFVER afname=LOSUB_model_${modver}_float2 float2 sa
##      ${archsub} ${dirctv} $DEF_XLFVER afname=LOSUB_model_${modver}_openmp openmp sa
##      ${archsub} ${dirctv} $DEF_XLFVER afname=LOSUB_model_${modver}_openmp_noxlfqinitauto openmp noxlfqinitauto sa
##   
##      ${archsub} ${dirctv} xlfver=xlf10103 afname=LOSUB_model_${modver}_xlf10103 sa
##      ${archsub} ${dirctv} xlfver=xlf10103 afname=LOSUB_model_${modver}_float1_xlf10103 float1 sa
##      ${archsub} ${dirctv} xlfver=xlf10103 afname=LOSUB_model_${modver}_float1_openmp_xlf10103 float1 openmp sa
##      ${archsub} ${dirctv} xlfver=xlf10103 afname=LOSUB_model_${modver}_float1_openmp_noxlfqinitauto_xlf10103 float1 openmp noxlfqinitauto sa
##      ${archsub} ${dirctv} xlfver=xlf10103 afname=LOSUB_model_${modver}_float2_xlf10103 float2 sa
##      ${archsub} ${dirctv} xlfver=xlf10103 afname=LOSUB_model_${modver}_openmp_xlf10103 openmp sa
##      ${archsub} ${dirctv} xlfver=xlf10103 afname=LOSUB_model_${modver}_openmp_noxlfqinitauto_xlf10103 openmp noxlfqinitauto sa
##   
##      ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_model_${modver}_xlf12104 sa
##      ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_model_${modver}_float1_xlf12104 float1 sa
##      ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_model_${modver}_float1_openmp_xlf12104 float1 openmp sa
##      ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_model_${modver}_float1_openmp_noxlfqinitauto_xlf12104 float1 openmp noxlfqinitauto sa
##      ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_model_${modver}_float2_xlf12104 float2 sa
##      ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_model_${modver}_openmp_xlf12104 openmp sa
##      ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_model_${modver}_openmp_noxlfqinitauto_xlf12104 openmp noxlfqinitauto sa
  
## #    # * ZETA
## # 
##      ${archsub} ${dirctv} $DEF_XLFVER afname=LOSUB_model_${modver} za
##      ${archsub} ${dirctv} $DEF_XLFVER afname=LOSUB_model_${modver}_float1 float1 za
##      ${archsub} ${dirctv} $DEF_XLFVER afname=LOSUB_model_${modver}_float1_openmp float1 openmp za
##      ${archsub} ${dirctv} $DEF_XLFVER afname=LOSUB_model_${modver}_float1_openmp_noxlfqinitauto float1 openmp noxlfqinitauto za
##      ${archsub} ${dirctv} $DEF_XLFVER afname=LOSUB_model_${modver}_float2 float2 za
##      ${archsub} ${dirctv} $DEF_XLFVER afname=LOSUB_model_${modver}_openmp openmp za
##      ${archsub} ${dirctv} $DEF_XLFVER afname=LOSUB_model_${modver}_openmp_noxlfqinitauto openmp noxlfqinitauto za
##   
##      ${archsub} ${dirctv} xlfver=xlf10103 afname=LOSUB_model_${modver}_xlf10103 za
##      ${archsub} ${dirctv} xlfver=xlf10103 afname=LOSUB_model_${modver}_float1_xlf10103 float1 za
##      ${archsub} ${dirctv} xlfver=xlf10103 afname=LOSUB_model_${modver}_float1_openmp_xlf10103 float1 openmp za
##      ${archsub} ${dirctv} xlfver=xlf10103 afname=LOSUB_model_${modver}_float1_openmp_noxlfqinitauto_xlf10103 float1 openmp noxlfqinitauto za
##      ${archsub} ${dirctv} xlfver=xlf10103 afname=LOSUB_model_${modver}_float2_xlf10103 float2 za
##      ${archsub} ${dirctv} xlfver=xlf10103 afname=LOSUB_model_${modver}_openmp_xlf10103 openmp za
##      ${archsub} ${dirctv} xlfver=xlf10103 afname=LOSUB_model_${modver}_openmp_noxlfqinitauto_xlf10103 openmp noxlfqinitauto za
##   
##      ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_model_${modver}_xlf12104 za
##      ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_model_${modver}_float1_xlf12104 float1 za
##      ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_model_${modver}_float1_openmp_xlf12104 float1 openmp za
##      ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_model_${modver}_float1_openmp_noxlfqinitauto_xlf12104 float1 openmp noxlfqinitauto za
##      ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_model_${modver}_float2_xlf12104 float2 za
##      ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_model_${modver}_openmp_xlf12104 openmp za
##      ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_model_${modver}_openmp_noxlfqinitauto_xlf12104 openmp noxlfqinitauto za

#    # * SPICA
# 
     ${archsub} ${dirctv} $DEF_XLFVER7 afname=LOSUB_model_${modver} sp
     ${archsub} ${dirctv} $DEF_XLFVER7 afname=LOSUB_model_${modver}_float1 float1 sp
     ${archsub} ${dirctv} $DEF_XLFVER7 afname=LOSUB_model_${modver}_float1_openmp float1 openmp sp
     ${archsub} ${dirctv} $DEF_XLFVER7 afname=LOSUB_model_${modver}_float1_openmp_noxlfqinitauto float1 openmp noxlfqinitauto sp
     ${archsub} ${dirctv} $DEF_XLFVER7 afname=LOSUB_model_${modver}_float2 float2 sp
     ${archsub} ${dirctv} $DEF_XLFVER7 afname=LOSUB_model_${modver}_openmp openmp sp
     ${archsub} ${dirctv} $DEF_XLFVER7 afname=LOSUB_model_${modver}_openmp_noxlfqinitauto openmp noxlfqinitauto sp
  
     ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_model_${modver}_xlf12104 sp
     ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_model_${modver}_float1_xlf12104 float1 sp
     ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_model_${modver}_float1_openmp_xlf12104 float1 openmp sp
     ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_model_${modver}_float1_openmp_noxlfqinitauto_xlf12104 float1 openmp noxlfqinitauto sp
     ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_model_${modver}_float2_xlf12104 float2 sp
     ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_model_${modver}_openmp_xlf12104 openmp sp
     ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_model_${modver}_openmp_noxlfqinitauto_xlf12104 openmp noxlfqinitauto sp
  
     ${archsub} ${dirctv} xlfver=xlf13108 afname=LOSUB_model_${modver}_xlf13108 sp
     ${archsub} ${dirctv} xlfver=xlf13108 afname=LOSUB_model_${modver}_float1_xlf13108 float1 sp
     ${archsub} ${dirctv} xlfver=xlf13108 afname=LOSUB_model_${modver}_float1_openmp_xlf13108 float1 openmp sp
     ${archsub} ${dirctv} xlfver=xlf13108 afname=LOSUB_model_${modver}_float1_openmp_noxlfqinitauto_xlf13108 float1 openmp noxlfqinitauto sp
     ${archsub} ${dirctv} xlfver=xlf13108 afname=LOSUB_model_${modver}_float2_xlf13108 float2 sp
     ${archsub} ${dirctv} xlfver=xlf13108 afname=LOSUB_model_${modver}_openmp_xlf13108 openmp sp
     ${archsub} ${dirctv} xlfver=xlf13108 afname=LOSUB_model_${modver}_openmp_noxlfqinitauto_xlf13108 openmp noxlfqinitauto sp

#    # * HADAR
# 
     ${archsub} ${dirctv} $DEF_XLFVER7 afname=LOSUB_model_${modver} ha
     ${archsub} ${dirctv} $DEF_XLFVER7 afname=LOSUB_model_${modver}_float1 float1 ha
     ${archsub} ${dirctv} $DEF_XLFVER7 afname=LOSUB_model_${modver}_float1_openmp float1 openmp ha
     ${archsub} ${dirctv} $DEF_XLFVER7 afname=LOSUB_model_${modver}_float1_openmp_noxlfqinitauto float1 openmp noxlfqinitauto ha
     ${archsub} ${dirctv} $DEF_XLFVER7 afname=LOSUB_model_${modver}_float2 float2 ha
     ${archsub} ${dirctv} $DEF_XLFVER7 afname=LOSUB_model_${modver}_openmp openmp ha
     ${archsub} ${dirctv} $DEF_XLFVER7 afname=LOSUB_model_${modver}_openmp_noxlfqinitauto openmp noxlfqinitauto updtmk=$CCRNSRC/source/lsmod/agcm/${modver}/MODULES/DEPENDENCIES ha
  
     ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_model_${modver}_xlf12104 ha
     ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_model_${modver}_float1_xlf12104 float1 ha
     ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_model_${modver}_float1_openmp_xlf12104 float1 openmp ha
     ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_model_${modver}_float1_openmp_noxlfqinitauto_xlf12104 float1 openmp noxlfqinitauto ha
     ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_model_${modver}_float2_xlf12104 float2 ha
     ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_model_${modver}_openmp_xlf12104 openmp ha
     ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_model_${modver}_openmp_noxlfqinitauto_xlf12104 openmp noxlfqinitauto ha
  
     ${archsub} ${dirctv} xlfver=xlf13108 afname=LOSUB_model_${modver}_xlf13108 ha
     ${archsub} ${dirctv} xlfver=xlf13108 afname=LOSUB_model_${modver}_float1_xlf13108 float1 ha
     ${archsub} ${dirctv} xlfver=xlf13108 afname=LOSUB_model_${modver}_float1_openmp_xlf13108 float1 openmp ha
     ${archsub} ${dirctv} xlfver=xlf13108 afname=LOSUB_model_${modver}_float1_openmp_noxlfqinitauto_xlf13108 float1 openmp noxlfqinitauto ha
     ${archsub} ${dirctv} xlfver=xlf13108 afname=LOSUB_model_${modver}_float2_xlf13108 float2 ha
     ${archsub} ${dirctv} xlfver=xlf13108 afname=LOSUB_model_${modver}_openmp_xlf13108 openmp ha
     ${archsub} ${dirctv} xlfver=xlf13108 afname=LOSUB_model_${modver}_openmp_noxlfqinitauto_xlf13108 openmp noxlfqinitauto ha

  
##    # * ALGOL
## 
#     ${archsub} ${dirctv} $DEF_XLFVER7 afname=LOSUB_model_${modver} al
#     ${archsub} ${dirctv} $DEF_XLFVER7 afname=LOSUB_model_${modver}_float1 float1 al
#     ${archsub} ${dirctv} $DEF_XLFVER7 afname=LOSUB_model_${modver}_float1_openmp float1 openmp al
#     ${archsub} ${dirctv} $DEF_XLFVER7 afname=LOSUB_model_${modver}_float1_openmp_noxlfqinitauto float1 openmp noxlfqinitauto al
#     ${archsub} ${dirctv} $DEF_XLFVER7 afname=LOSUB_model_${modver}_float2 float2 al
#     ${archsub} ${dirctv} $DEF_XLFVER7 afname=LOSUB_model_${modver}_openmp openmp al
#     ${archsub} ${dirctv} $DEF_XLFVER7 afname=LOSUB_model_${modver}_openmp_noxlfqinitauto openmp noxlfqinitauto al
#  
#     ${archsub} ${dirctv} xlfver=xlf13108 afname=LOSUB_model_${modver}_xlf13108 al
#     ${archsub} ${dirctv} xlfver=xlf13108 afname=LOSUB_model_${modver}_float1_xlf13108 float1 al
#     ${archsub} ${dirctv} xlfver=xlf13108 afname=LOSUB_model_${modver}_float1_openmp_xlf13108 float1 openmp al
#     ${archsub} ${dirctv} xlfver=xlf13108 afname=LOSUB_model_${modver}_float1_openmp_noxlfqinitauto_xlf13108 float1 openmp noxlfqinitauto al
#     ${archsub} ${dirctv} xlfver=xlf13108 afname=LOSUB_model_${modver}_float2_xlf13108 float2 al
#     ${archsub} ${dirctv} xlfver=xlf13108 afname=LOSUB_model_${modver}_openmp_xlf13108 openmp al
#     ${archsub} ${dirctv} xlfver=xlf13108 afname=LOSUB_model_${modver}_openmp_noxlfqinitauto_xlf13108 openmp noxlfqinitauto al
#  
#     ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_model_${modver}_xlf12104 al
#     ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_model_${modver}_float1_xlf12104 float1 al
#     ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_model_${modver}_float1_openmp_xlf12104 float1 openmp al
#     ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_model_${modver}_float1_openmp_noxlfqinitauto_xlf12104 float1 openmp noxlfqinitauto al
#     ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_model_${modver}_float2_xlf12104 float2 al
#     ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_model_${modver}_openmp_xlf12104 openmp al
#     ${archsub} ${dirctv} xlfver=xlf12104 afname=LOSUB_model_${modver}_openmp_noxlfqinitauto_xlf12104 openmp noxlfqinitauto al

   fi

  fi
 
  if [ "$SITE_ID" = 'Victoria' ] ; then

   set -x
   mdest=${mdest='dsxx'}

   # * VICTORIA

   if [ "$modver" = 'diag' -o "$modver" = 'plots' -o "$modver" = 'noplots' ] ; then

     ${archsub} ${dirctv} afname=LOSUB_${modver} mdest=${mdest}
     ${archsub} ${dirctv} afname=LOSUB8_${modver} float2 mdest=${mdest}
     ${archsub} ${dirctv} afname=LOSUB_${modver}_float1 float1 mdest=${mdest}
     ${archsub} ${dirctv} afname=LOSUB_${modver}_openmp openmp mdest=${mdest}
     ${archsub} ${dirctv} afname=LOSUB_${modver}_float1_openmp float1 openmp mdest=${mdest}
     ${archsub} ${dirctv} afname=LOSUB_${modver}_noext noext mdest=${mdest}
     ${archsub} ${dirctv} afname=LOSUB_${modver}_noext_float1 noext float1 mdest=${mdest}

   elif [ "$modver" = 'comm' ] ; then

     ${archsub} ${dirctv} afname=LOSUB_${modver} mdest=${mdest}
     ${archsub} ${dirctv} afname=LOSUB8_${modver} float2 mdest=${mdest}
     ${archsub} ${dirctv} afname=LOSUB_${modver}_float1 float1 mdest=${mdest}
     ${archsub} ${dirctv} afname=LOSUB_${modver}_openmp openmp mdest=${mdest}
     ${archsub} ${dirctv} afname=LOSUB_${modver}_float1_openmp float1 openmp mdest=${mdest}
     ${archsub} ${dirctv} afname=LOSUB_${modver}_noext noext mdest=${mdest}
     ${archsub} ${dirctv} afname=LOSUB_${modver}_noext_float1 noext float1 mdest=${mdest}
     ${archsub} ${dirctv} afname=LOSUB_${modver}_openmp_noxlfqinitauto openmp noxlfqinitauto mdest=${mdest}
     ${archsub} ${dirctv} afname=LOSUB_${modver}_float1_openmp_noxlfqinitauto float1 openmp noxlfqinitauto mdest=${mdest}

   else

     # Model
  
     ${archsub} ${dirctv} afname=LOSUB_model_${modver} mdest=${mdest}
     ${archsub} ${dirctv} afname=LOSUB8_model_${modver} float2 mdest=${mdest}
     ${archsub} ${dirctv} afname=LOSUB_model_${modver}_float1 float1 mdest=${mdest}
     ${archsub} ${dirctv} afname=LOSUB_model_${modver}_openmp openmp mdest=${mdest}
     ${archsub} ${dirctv} afname=LOSUB_model_${modver}_float1_openmp float1 openmp mdest=${mdest}
     ${archsub} ${dirctv} afname=LOSUB_model_${modver}_noext noext mdest=${mdest}
     ${archsub} ${dirctv} afname=LOSUB_model_${modver}_noext_float1 noext float1 mdest=${mdest}
     ${archsub} ${dirctv} afname=LOSUB_model_${modver}_openmp_noxlfqinitauto openmp noxlfqinitauto mdest=${mdest}
     ${archsub} ${dirctv} afname=LOSUB_model_${modver}_float1_openmp_noxlfqinitauto float1 openmp noxlfqinitauto mdest=${mdest}

   fi

  fi

else
 echo " $0: Sorry, local site is not supported!"
 exit 2
fi
