Index: palm/trunk/SCRIPTS/mbuild
===================================================================
--- palm/trunk/SCRIPTS/mbuild	(revision 67)
+++ palm/trunk/SCRIPTS/mbuild	(revision 69)
@@ -84,4 +84,7 @@
      # 14/03/07 - Siggi - fimm admitted, revision number added to terminal
      #                    output
+     # 16/03/07 - Siggi - adjustments (netcdf) for lctit
+     #                    adjustments for running under pdksh, local ip-addres
+     #                    is not determined any more
 
 
@@ -113,5 +116,6 @@
     # FEHLERBEHANDLUNG
     # BEI EXIT:
- trap 'if [[ $locat != normal ]]
+ trap 'rm -rf  tmp_mbuild
+       if [[ $locat != normal ]]
        then
           printf "\n\n +++ mbuild killed \n\n"
@@ -122,5 +126,6 @@
 
     # BEI TERMINAL-BREAK:
- trap 'printf "\n\n +++ mbuild killed by \"^C\" \n\n"
+ trap 'rm -rf  tmp_mbuild
+       printf "\n\n +++ mbuild killed by \"^C\" \n\n"
        exit
       ' 2
@@ -156,5 +161,6 @@
     # LOKALEN RECHNER ERMITTELN
  local_host_real_name=$(hostname)
- local_addres=$(nslookup `hostname` 2>&1 | grep "Address:" | tail -1 | awk '{print $2}')
+# local_addres=$(nslookup `hostname` 2>&1 | grep "Address:" | tail -1 | awk '{print $2}')
+
  case  $local_host_real_name  in
      (atmos)                    local_host=lcide;;
@@ -163,6 +169,6 @@
      (fimm.bccs.uib.no)         local_host=lcmuk;;
      (gate)                     local_host=neck;;
-     (gfdl3.yonsei.ac.kr)       local_host=decalpha; local_addres=165.132.26.56;;
-     (gfdl5)                    local_host=ibmy; local_addres=165.132.26.58;;
+     (gfdl3.yonsei.ac.kr)       local_host=decalpha;;
+     (gfdl5)                    local_host=ibmy;;
      (gwdk081.gwdg.de)          local_host=ibm;;
      (hreg01a-en0|hreg02a-en0)  local_host=ibmh;;
@@ -200,5 +206,6 @@
     # BENUTZERNAMEN AUF LOKALEM RECHNER AUS KONFIGURATIONSDATEI ERMITTELN
  line=""
- grep  " $local_host" $config_file | grep "%remote_username"  |  while read line
+ grep  " $local_host" $config_file | grep "%remote_username"  >  tmp_mbuild
+ while read line
  do
     if [[ "$line" != ""  ||  $(echo $line | cut -c1) != "#" ]]
@@ -206,5 +213,5 @@
        local_username=`echo $line | cut -d" " -s -f2`
     fi
- done
+ done < tmp_mbuild
 
  if [[ "$local_username" = "" ]]
@@ -222,5 +229,6 @@
     # VARIABLEN SETZEN, WEIL DIESE EVTL. IN PFADNAMEN VERWENDET WERDEN
  line=""
- grep "%" $config_file  |  while read line
+ grep "%" $config_file  >  tmp_mbuild
+ while read line
  do
     if [[ "$line" != ""  &&  "$(echo $line | cut -d" " -s -f3)" = "" ]]
@@ -231,9 +239,10 @@
 #       eval echo \"   $var=\$$var \"   # AUSGABE ZU TESTZWECKEN
     fi
- done
+ done < tmp_mbuild
 
     # NUN PRUEFEN, OB EIN GLOBALER QUELLTEXTPFAD VEREINBART WURDE
  line=""
- grep "%source_path" $config_file  |  while read line
+ grep "%source_path" $config_file  >  tmp_mbuild
+ while read line
  do
     if [[ "$line" != ""  &&  $(echo $line | cut -c1) != "#" ]]
@@ -244,8 +253,9 @@
        fi
     fi
- done
+ done < tmp_mbuild
 
  line=""
- grep  " $local_host" $config_file | grep "%source_path"  |  while read line
+ grep  " $local_host" $config_file | grep "%source_path"  >  tmp_mbuild
+ while read line
  do
     if [[ "$line" != ""  &&  $(echo $line | cut -c1) != "#" ]]
@@ -253,5 +263,5 @@
        local_source_path=`echo $line | cut -d" " -s -f2`
     fi
- done
+ done < tmp_mbuild
 
  if [[ "$local_source_path" = "" ]]
@@ -273,5 +283,6 @@
      # EBENSO PFAD FUER DAS MAKE-DEPOSITORY ERMITTELN
  line=""
- grep "%depository_path" $config_file  |  while read line
+ grep "%depository_path" $config_file  >  tmp_mbuild
+ while read line
  do
     if [[ "$line" != ""  &&  $(echo $line | cut -c1) != "#" ]]
@@ -282,8 +293,9 @@
        fi
     fi
- done
+ done < tmp_mbuild
 
  line=""
- grep  " $local_host" $config_file | grep "%depository_path"  |  while read line
+ grep  " $local_host" $config_file | grep "%depository_path"  >  tmp_mbuild
+ while read line
  do
     if [[ "$line" != ""  &&  $(echo $line | cut -c1) != "#" ]]
@@ -291,5 +303,5 @@
        local_depository_path=`echo $line | cut -d" " -s -f2`
     fi
- done
+ done < tmp_mbuild
 
  if [[ "$local_depository_path" = "" ]]
@@ -628,5 +640,6 @@
  printf "\n  *** scanning configuration file for host(s) ..."
 
- grep  %fopts  $config_file  |  while read line
+ grep  %fopts  $config_file  >  tmp_mbuild
+ while read line
  do
        # KOMMENTARZEILEN UEBERSPRINGEN
@@ -634,5 +647,5 @@
     (( ihost = ihost + 1 ))
     hostline[$ihost]="$line"
- done
+ done < tmp_mbuild
 
  
@@ -699,5 +712,5 @@
                          fi;;
         (lctit)          remote_addres=172.17.75.161; netcdf_support=true
-                         netcdf_path=/home/usr5/mkanda/netcdf-3.6.1/src; cpp_options="-Mpreprocess";;
+                         netcdf_path=/home/usr5/mkanda/netcdf-3.6.2; cpp_options="-Mpreprocess";;
         (decalpha)       remote_addres=165.132.26.56; cpp_options="-cpp"; netcdf_support=true
                          netcdf_path=/usr/local/netcdf-3.5.1;;
@@ -728,5 +741,6 @@
        # REMOTE-USERNAMEN ERMITTELN
     line=""
-    grep  "$remote_host_string" $config_file | grep "%remote_username"  |  while read line1
+    grep  "$remote_host_string" $config_file | grep "%remote_username"  >  tmp_mbuild
+    while read line1
     do
        if [[ $(echo $line1 | cut -d" " -s -f3-) = "$remote_host_string" ]]
@@ -734,5 +748,5 @@
           line="$line1"
        fi
-    done
+    done < tmp_mbuild
 
     if [[ "$line" = ""  ||  $(echo $line | cut -c1) = "#" ]]
@@ -749,5 +763,6 @@
     line=""
     remote_source_path=""
-    grep  "$remote_host_string" $config_file | grep "%source_path"  |  while read line1
+    grep  "$remote_host_string" $config_file | grep "%source_path"  >  tmp_mbuild
+    while read line1
     do
        if [[ $(echo $line1 | cut -d" " -s -f3-) = "$remote_host_string" ]]
@@ -755,5 +770,5 @@
           line="$line1"
        fi
-    done
+    done < tmp_mbuild
 
     if [[ "$line" != ""  &&  $(echo $line | cut -c1) != "#" ]]
@@ -780,5 +795,6 @@
     remote_md=""
     line=""
-    grep  "$remote_host_string" $config_file | grep "%depository_path"  |  while read line1
+    grep  "$remote_host_string" $config_file | grep "%depository_path"  >  tmp_mbuild
+    while read line1
     do
        if [[ $(echo $line1 | cut -d" " -s -f3-) = "$remote_host_string" ]]
@@ -786,5 +802,5 @@
           line="$line1"
        fi
-    done
+    done < tmp_mbuild
 
     if [[ "$line" != ""  &&  $(echo $line | cut -c1) != "#" ]]
@@ -810,5 +826,6 @@
        # COMPILERNAMEN ERMITTELN
     line=""
-    grep  "$remote_host_string" $config_file | grep "%compiler_name "  |  while read line1
+    grep  "$remote_host_string" $config_file | grep "%compiler_name "  >  tmp_mbuild
+    while read line1
     do
        if [[ $(echo $line1 | cut -d" " -s -f3-) = "$remote_host_string" ]]
@@ -816,5 +833,5 @@
           line="$line1"
        fi
-    done
+    done < tmp_mbuild
 
     if [[ "$line" = ""  ||  $(echo $line | cut -c1) = "#" ]]
@@ -833,5 +850,6 @@
     then
        line=""
-       grep  "$remote_host_string" $config_file | grep "%compiler_name_ser"  |  while read line1
+       grep  "$remote_host_string" $config_file | grep "%compiler_name_ser"  >  tmp_mbuild
+       while read line1
        do
           if [[ $(echo $line1 | cut -d" " -s -f3-) = "$remote_host_string" ]]
@@ -839,5 +857,5 @@
              line="$line1"
           fi
-       done
+       done < tmp_mbuild
 
        if [[ "$line" = ""  ||  $(echo $line | cut -c1) = "#" ]]
@@ -923,5 +941,6 @@
        # COMPILEROPTIONEN ERMITTELN
     line=""
-    grep  "$remote_host_string" $config_file | grep "%fopts"  |  while read line1
+    grep  "$remote_host_string" $config_file | grep "%fopts"  >  tmp_mbuild
+    while read line1
     do
        if [[ $(echo $line1 | cut -d" " -s -f3-) = "$remote_host_string" ]]
@@ -929,5 +948,5 @@
           line="$line1"
        fi
-    done
+    done < tmp_mbuild
     if [[ "$line" = ""  ||  $(echo $line | cut -c1) = "#" ]]
     then
@@ -947,5 +966,5 @@
           (ibmy)      compiler_options="-I ${netcdf_path}/include  $compiler_options";;
           (lcmuk)     compiler_options="-I ${netcdf_path}/include  $compiler_options";;
-          (lctit)     compiler_options="-I ${netcdf_path}/f90      $compiler_options";;
+          (lctit)     compiler_options="-I ${netcdf_path}/include  $compiler_options";;
           (nech|neck) compiler_options="-I ${netcdf_path}/include  $compiler_options";;
        esac
@@ -956,5 +975,6 @@
        # LADER-OPTIONEN ERMITTELN
     line=""
-    grep  "$remote_host_string" $config_file | grep "%lopts"  |  while read line1
+    grep  "$remote_host_string" $config_file | grep "%lopts"  >  tmp_mbuild
+    while read line1
     do
        if [[ $(echo $line1 | cut -d" " -s -f3-) = "$remote_host_string" ]]
@@ -962,5 +982,5 @@
           line="$line1"
        fi
-    done
+    done < tmp_mbuild
 
     if [[ "$line" = ""  ||  $(echo $line | cut -c1) = "#" ]]
@@ -980,5 +1000,5 @@
           (ibms)                       loader_options="$loader_options -L${netcdf_path} -lnetcdf";;
           (ibmy)                       loader_options="$loader_options -L${netcdf_path}/lib -lnetcdf";;
-          (lctit)                      loader_options="$loader_options -L${netcdf_path}/libsrc -lnetcdf";;
+          (lctit)                      loader_options="$loader_options -L${netcdf_path}/lib -lnetcdf";;
        esac
     fi
