Index: palm/trunk/SCRIPTS/mrun
===================================================================
--- palm/trunk/SCRIPTS/mrun	(revision 162)
+++ palm/trunk/SCRIPTS/mrun	(revision 164)
@@ -140,4 +140,11 @@
      #                     true, mrun tries "ln -f" on local output and resorts 
      #                     to "cp" or "cp -r" on error
+     # 15/04/08 - Siggi  - argument -c introduced to most of the subjob calls,
+     #                     which allows the user to choose his own job catalog
+     #                     by setting job_catalog in the configuration file
+     #                     (default is ~/job_queue),
+     #                     workaround for mpixec with -env option,
+     #                     adjustments for lcxt4 (Bergen Center for Computational
+     #                     Science)
  
     # VARIABLENVEREINBARUNGEN + DEFAULTWERTE
@@ -183,4 +190,5 @@
  input_list=""
  interpreted_config_file=""
+ job_catalog="~/job_queue"
  job_on_file=""
  keep_data_from_previous_run=false
@@ -1817,5 +1825,5 @@
  lopts="$lopts $netcdf_lib $dvrp_lib"
  ROPTS="$ropts"
- if [[ ( $(echo $host | cut -c1-3) = nec  ||  $(echo $host | cut -c1-3) = ibm  ||  $host = lctit  ||  $host = lcfimm )  &&  -n $numprocs ]]
+ if [[ ( $(echo $host | cut -c1-3) = nec  ||  $(echo $host | cut -c1-3) = ibm  ||  $host = lctit  ||  $host = lcfimm  ||  $host = lcxt4 )  &&  -n $numprocs ]]
  then
     XOPT="-X $numprocs"
@@ -2768,11 +2776,30 @@
              then
                 printf "\n\n"
-		mpiexec  -machinefile hostfile  -n $ii  a.out  $ROPTS
+                if [[ $host = lcxt4 ]]
+                then
+                   aprun  -n $ii  -N $tasks_per_node  a.out  $ROPTS
+                else
+                   mpiexec  -machinefile hostfile  -n $ii  a.out  $ROPTS
+                fi
              else
                 ((  iii = ii / 2 ))
+                echo "atmosphere_to_ocean"  >  runfile_atmos
+                echo "ocean_to_atmosphere"  >  runfile_ocean
+
                 printf "\n      coupled run ($iii atmosphere, $iii ocean)"
                 printf "\n\n"
-                mpiexec  -machinefile hostfile  -n $iii  -env coupling_mode atmosphere_to_ocean  a.out  $ROPTS  &
-                mpiexec  -machinefile hostfile  -n $iii  -env coupling_mode ocean_to_atmosphere  a.out  $ROPTS  &
+
+                if [[ $host == lcxt4 ]]
+                then
+                   aprun  -n $iii  -N $tasks_per_node  a.out < runfile_atmos  $ROPTS  &
+                   aprun  -n $iii  -N $tasks_per_node  a.out < runfile_ocean  $ROPTS  &
+                else
+
+                      # WORKAROUND BECAUSE mpiexec WITH -env option IS NOT AVAILABLE ON SOME SYSTEMS
+                   mpiexec  -machinefile hostfile  -n $iii  a.out  $ROPTS  <  runfile_atmos &
+                   mpiexec  -machinefile hostfile  -n $iii  a.out  $ROPTS  <  runfile_ocean &
+#                   mpiexec  -machinefile hostfile  -n $iii  -env coupling_mode atmosphere_to_ocean  a.out  $ROPTS  &
+#                   mpiexec  -machinefile hostfile  -n $iii  -env coupling_mode ocean_to_atmosphere  a.out  $ROPTS  &
+                fi
                 wait
              fi
@@ -2970,7 +2997,7 @@
                       if [[ "$LOGNAME" = b323013 ]]
                       then
-                         subjob  -v  -q c1  -X 0  -m 1000  -t 900  transfer_${localout[$i]}
+                         subjob  -v  -q c1  -X 0  -m 1000  -t 900  -c $job_catalog  transfer_${localout[$i]}
                       else
-                         subjob  -d  -v  -q c1  -X 0  -m 1000  -t 900  transfer_${localout[$i]}
+                         subjob  -d  -v  -q c1  -X 0  -m 1000  -t 900  -c $job_catalog  transfer_${localout[$i]}
                       fi
                    fi
@@ -3045,7 +3072,7 @@
                       if [[ $LOGNAME = b323013 ]]
                       then
-                         subjob  -v  -q c1  -X 0  -m 1000  -t 900  transfer_${localout[$i]}
+                         subjob  -v  -q c1  -X 0  -m 1000  -t 900  -c $job_catalog  transfer_${localout[$i]}
                       else
-                         subjob  -d  -v  -q c1  -X 0  -m 1000  -t 900  transfer_${localout[$i]}
+                         subjob  -d  -v  -q c1  -X 0  -m 1000  -t 900  -c $job_catalog  transfer_${localout[$i]}
                       fi
                    fi
@@ -3232,6 +3259,6 @@
                    if [[ $localhost = ibmh  ||  $localhost = ibmb ]]
                    then
-#                      subjob  -d  -v  -q cdata  -X 0  -m 1000  -t 43200  archive_${frelout[$i]}
-                      subjob   -v  -q cdata  -X 0  -m 1000  -t 43200  archive_${frelout[$i]}
+#                      subjob  -d  -v  -q cdata  -X 0  -m 1000  -t 43200  -c $job_catalog  archive_${frelout[$i]}
+                      subjob   -v  -q cdata  -X 0  -m 1000  -t 43200  -c $job_catalog  archive_${frelout[$i]}
                    elif [[ $localhost = nech ]]
                    then
@@ -3357,5 +3384,5 @@
                 fi
 
-                subjob  -v  -d  -q cdata  -X 0  -m 1000  -t 43200  archive_${frelout[$i]}
+                subjob  -v  -d  -q cdata  -X 0  -m 1000  -t 43200  -c $job_catalog  archive_${frelout[$i]}
                 printf "              Archiving of $tmp_data_catalog/${frelout[$i]} initiated (batch job submitted)\n"
                 file_saved=true
@@ -3800,5 +3827,5 @@
     fi
 
-    subjob  $job_on_file  -h $host  -u $remote_username -g $group_number -q $queue  -m $memory  -N $node_usage -t $cpumax  $XOPT  $TOPT  $OOPT  -n $fname  -v   $jobfile
+    subjob  $job_on_file  -h $host  -u $remote_username -g $group_number -q $queue  -m $memory  -N $node_usage -t $cpumax  $XOPT  $TOPT  $OOPT  -n $fname  -v  -c $job_catalog  $jobfile
     rm -rf  $jobfile
 
Index: palm/trunk/SCRIPTS/subjob
===================================================================
--- palm/trunk/SCRIPTS/subjob	(revision 162)
+++ palm/trunk/SCRIPTS/subjob	(revision 164)
@@ -90,4 +90,6 @@
      # 19/10/07 - Siggi - a ";" was missing in the last change done by Marcus
      # 30/10/07 - Marcus- further adjustments for queues on lctit
+     # 15/05/08 - Siggi - adjustments for lcxt4 (Bergen Center for Computational
+     #                    Science)
 
 
@@ -167,8 +169,10 @@
      (gregale)               local_addres=130.75.105.109; local_host=lcmuk;;
      (hababai)               local_addres=130.75.105.108; local_host=lcmuk;;
+     (hexagon.bccs.uib.no)   local_addres=129.177.20.113; local_host=lcxt4;;
      (hreg*-en0|hanni*-en0)  local_addres=130.75.4.10;    local_host=ibmh;;
      (irifi)                 local_addres=130.75.105.104; local_host=lcmuk;;
      (levanto)               local_addres=130.75.105.45;  local_host=lcmuk;;
      (maestro)               local_addres=130.75.105.2;   local_host=lcmuk;;
+     (nid*)		     local_addres=129.177.20.113; local_host=lcxt4;;
      (nobel*)                local_addres=150.183.5.101;  local_host=ibms;;
      (orkan)                 local_addres=130.75.105.3;   local_host=lcmuk;;
@@ -303,4 +307,5 @@
 	(lcfimm) remote_addres=172.20.4.2; submcom=/opt/torque/bin/qsub;;
         (lctit)  queue=lctit; remote_addres=172.17.75.161; submcom=/n1ge/TITECH_GRID/tools/bin/n1ge;;
+        (lcxt4)	 remote_addres=129.177.20.113; submcom=/opt/torque/2.3.0/bin/qsub;;
         (nech)   qsubmem=memsz_job; qsubtime=cputim_job; remote_addres=136.172.44.147; submcom="/usr/local/bin/qsub";;
         (neck)   qsubmem=memsz_job; qsubtime=cputim_job; remote_addres=133.5.178.11; submcom="/usr/bin/nqsII/qsub";;
@@ -639,4 +644,24 @@
 %%END%%
 
+ elif [[ $remote_host = lcxt4 ]]
+ then
+
+    if [[ $numprocs != 0 ]]
+    then
+       cat > $job_to_send << %%END%%
+#!/bin/ksh 
+#PBS -S /bin/ksh
+#PBS -N $job_name
+#PBS -A nersc
+#PBS -l walltime=$timestring
+#PBS -l mppwidth=${numprocs}
+#PBS -l mppnppn=${tasks_per_node}
+#PBS -m abe
+#PBS -M igore@nersc.no
+#PBS -o $remote_dayfile
+#PBS -e $remote_dayfile
+
+%%END%%
+
     else
        cat > $job_to_send << %%END%%
@@ -1022,10 +1047,5 @@
        then
           eval  $submcom  $job_on_remhost
-       elif [[ $local_host = lcfimm ]]
-       then
-          eval  $submcom  $job_on_remhost
-          echo "$submcom  $job_on_remhost"
-          chmod  u+x  $job_on_remhost
-       elif [[ $local_host = lctit ]]
+       elif [[  $local_host = lcfimm  ||  $local_host = lctit  ||  $localhost = lcxt4 ]]
        then
           eval  $submcom  $job_on_remhost
