Changeset 211 for palm/trunk/SCRIPTS


Ignore:
Timestamp:
Nov 11, 2008 4:46:24 AM (15 years ago)
Author:
raasch
Message:

user interface was split into one single file per subroutine

File:
1 edited

Legend:

Unmodified
Added
Removed
  • palm/trunk/SCRIPTS/mrun

    r210 r211  
    157157     # 21/10/08 - Siggi  - bugfix for the case that -K has more than one
    158158     #                     argument
     159     # 08/11/08 - Siggi  - bugfix for depository path settings in configuration
     160     #                     file
     161     # 11/11/08 - Siggi  - rules for using user code files changed: user
     162     #                     code splitted into one file per subroutine,
     163     #                     user can provide his/her own makefile, only
     164     #                     default source-code filenames are allowed
     165
     166
    159167 
    160168    # VARIABLENVEREINBARUNGEN + DEFAULTWERTE
     
    16221630
    16231631
     1632       # MAKEFILE AUF VORHANDENSEIN PRUEFEN UND KOPIEREN
     1633       # BEI RESTART-LAEUFEN LIEGT ES SCHON IM VERZEICHNIS SOURCES_FOR_RUN...
     1634    if [[ "$restart_run" != true ]]
     1635    then
     1636       [[ "$makefile" = "" ]]  &&  makefile=$source_path/Makefile
     1637       if [[ ! -f $makefile ]]
     1638       then
     1639          printf "\n  +++ file \"$makefile\" does not exist"
     1640          locat=make; exit
     1641       else
     1642          cp  $makefile  SOURCES_FOR_RUN_$fname/Makefile
     1643       fi
     1644    fi
     1645
     1646
    16241647       # DATEIEN AUS ZUSAETZLICHEM QUELLVERZEICHNIS HINZUFUEGEN
    16251648    if [[ $restart_run != true  &&  "$add_source_path" != "" ]]
     
    16381661
    16391662          cd $add_source_path
     1663          found=false
    16401664
    16411665          Names=$(ls -1 *.f90 2>&1)
     
    16531677          cd  SOURCES_FOR_RUN_$fname
    16541678
     1679             # COPY MAKEFILE IF EXISTING
     1680          if [[ -f $add_source_path/Makefile ]]
     1681          then
     1682             printf "\n\n  *** user Makefile from directory"
     1683             printf "\n      \"$add_source_path\" is used \n"
     1684             sleep 1
     1685             cp  $add_source_path/Makefile  .
     1686          fi
     1687
    16551688          for  dateiname  in  $AddFilenames
    16561689          do
     
    16591692                printf "\n  +++ source code file \"$dateiname\" found in additional"
    16601693                printf "\n      source code directory \"$add_source_path\" "
    1661                 printf "\n      as well as in directory \"$source_path\"."
     1694                printf "\n      but was also given with option \"-s\" which means that it should be taken"
     1695                printf "\n      from directory \"$source_path\"."
    16621696                locat=source; exit
    16631697             fi
     
    16661700             source_list="$source_list $dateiname"
    16671701
     1702                # CHECK IF FILE IS CONTAINED IN MAKEFILE
     1703             if [[ $(grep -c $dateiname Makefile) = 0 ]]
     1704             then
     1705                printf "\n\n  +++ user file \"$dateiname\" "
     1706                printf "\n      is not listed in Makefile \n"
     1707                locat=source; exit
     1708             else
     1709
    16681710                # Default User-Interface von der Liste entfernen, falls Datei
    16691711                # ein User-Interface enthaelt
    1670              if [[ $( cat $dateiname | grep -c "END SUBROUTINE user_parin" ) != 0 ]]
    1671              then
    1672                 if [[ $dateiname != user_interface.f90  &&  -f user_interface.f90 ]]
     1712#             if [[ $( cat $dateiname | grep -c "END SUBROUTINE user_parin" ) != 0 ]]
     1713#             then
     1714#                if [[ $dateiname != user_interface.f90  &&  -f user_interface.f90 ]]
     1715#                then
     1716#                   rm -rf  user_interface.f90
     1717#                   source_list=`echo $source_list | sed -e 's/user_interface.f90//'`
     1718#                   printf "\n\n  *** default \"user_interface.f90\" removed from the files to be translated"
     1719#                   printf "\n      since a user-interface is found in file"
     1720#                   printf "\n      \"$add_source_path/$dateiname\" \n"
     1721#                   sleep 3
     1722#                else
     1723                if [[ $found = false ]]
    16731724                then
    1674                    rm -rf  user_interface.f90
    1675                    source_list=`echo $source_list | sed -e 's/user_interface.f90//'`
    1676                    printf "\n\n  *** default \"user_interface.f90\" removed from the files to be translated"
    1677                    printf "\n      since a user-interface is found in file"
    1678                    printf "\n      \"$add_source_path/$dateiname\" \n"
    1679                    sleep 3
    1680                 else
    1681                    printf "\n\n  *** user-interface file \"$dateiname\" "
    1682                    printf "\n      added to the files to be translated \n"
    1683                    sleep 3
     1725                   found=true
     1726                   printf "\n\n  *** following user file(s) added to the"
     1727                   printf " files to be translated:\n      "
    16841728                fi
     1729                printf "$dateiname  "
     1730                sleep 0.5
    16851731             fi
    16861732          done
    1687 
     1733          [[ $found = true ]]  &&  printf "\n"
    16881734          cd -  > /dev/null
    16891735       fi
     
    17331779       # MAKEFILE AUF VORHANDENSEIN PRUEFEN UND KOPIEREN
    17341780       # BEI RESTART-LAEUFEN LIEGT ES SCHON IM VERZEICHNIS SOURCES_FOR_RUN...
    1735     if [[ "$restart_run" != true ]]
    1736     then
    1737        [[ "$makefile" = "" ]]  &&  makefile=$source_path/Makefile
    1738        if [[ ! -f $makefile ]]
    1739        then
    1740           printf "\n  +++ file \"$makefile\" does not exist"
    1741           locat=make; exit
    1742        else
    1743           cp  $makefile  SOURCES_FOR_RUN_$fname/Makefile
    1744        fi
    1745     fi
     1781#    if [[ "$restart_run" != true ]]
     1782#    then
     1783#       [[ "$makefile" = "" ]]  &&  makefile=$source_path/Makefile
     1784#       if [[ ! -f $makefile ]]
     1785#       then
     1786#          printf "\n  +++ file \"$makefile\" does not exist"
     1787#          locat=make; exit
     1788#       else
     1789#          cp  $makefile  SOURCES_FOR_RUN_$fname/Makefile
     1790#       fi
     1791#    fi
    17461792
    17471793 fi  # do_compile=true
     
    22202266          if [[ "$line" != ""  &&  $(echo $line | cut -c1) != "#" ]]
    22212267          then
    2222              local_depository_path=`echo $line | cut -d" " -s -f2`
     2268             if [[ "$(echo $line | cut -d" " -s -f4)" = "$cond1"  &&  "$(echo $line | cut -d" " -s -f5)" = "$cond2" ]]
     2269             then
     2270                local_depository_path=`echo $line | cut -d" " -s -f2`
     2271             fi
    22232272          fi
    22242273       done < tmp_mrun
     
    22572306          # ALS user_interface.f90 LIEGT, DIESEN GEAENDERTEN NAMEN INS
    22582307          # MAKEFILE EINTRAGEN
    2259        cd  $TEMPDIR_COMPILE
    2260        interface_file=`grep -l "END SUBROUTINE user_parin" $source_list`
    2261        if [[ "$interface_file" != "" ]]
    2262        then
    2263           interface_file=`echo $interface_file | cut -d"." -f1`
    2264           mv  Makefile  Makefile_old
    2265           sed "s/user_interface/$interface_file/g"  Makefile_old  >  Makefile
    2266        fi
    2267        cd -  > /dev/null
     2308#       cd  $TEMPDIR_COMPILE
     2309#       interface_file=`grep -l "END SUBROUTINE user_parin" $source_list`
     2310#       if [[ "$interface_file" != "" ]]
     2311#       then
     2312#          interface_file=`echo $interface_file | cut -d"." -f1`
     2313#          mv  Makefile  Makefile_old
     2314#          sed "s/user_interface/$interface_file/g"  Makefile_old  >  Makefile
     2315#       fi
     2316#       cd -  > /dev/null
    22682317    else
    22692318       cp  $executable   ${TEMPDIR}/a.out
     
    23012350       printf "\n\n\n  *** compilation starts \n$striche\n"
    23022351       printf "  *** compilation with make using following options:\n"
     2352       printf "      make depository:          $make_depository"
    23032353       printf "      compilername:             $compiler_name\n"
    23042354       printf "      options:                  $fopts\n"
     
    27152765       if [[ "$ENVIRONMENT" = BATCH ]]
    27162766       then
    2717           printf "\n  +++ debug is allowed in interactive mode only"
    2718           locat=debug
    2719           exit
     2767          if [[ $(echo $localhost | cut -c1-5) != lcsgi ]]
     2768          then
     2769             printf "\n  +++ debug is allowed in interactive mode only"
     2770             locat=debug
     2771             exit
     2772          fi
    27202773       fi
    27212774       if [[ $localhost = decalpha ]]
     
    27562809             totalview   poe  -a a.out  -procs $numprocs  -rmpool 0  -nodes 1   $ROPTS
    27572810          fi
     2811       elif [[ $(echo $localhost | cut -c1-5) = lcsgi ]]
     2812       then
     2813             # CURRENTLY NO DEBUGGER ON LCSGI
     2814          if [[ $run_coupled_model = true ]]
     2815          then
     2816             printf "\n  +++ no debug in coupled mode available on \"$localhost\" "
     2817             locat=debug
     2818             exit
     2819          fi
     2820          (( ii = $numprocs / $threads_per_task ))
     2821          export OMP_NUM_THREADS=$threads_per_task
     2822          echo "OMP_NUM_THREADS=$OMP_NUM_THREADS"
     2823          if [[ $threads_per_task != 1 ]]
     2824          then
     2825             printf "\n      threads per task: $threads_per_task"
     2826          fi
     2827          printf "\n\n"
     2828#          ulimit -s 300000   # A too large stack size causes problems
     2829#          export MV2_NUM_PORTS=2
     2830#          export MV2_CPU_MAPPING=0:1:2:3
     2831#          mpiexec    ./a.out  $ROPTS
     2832#          export MPI_LAUNCH_TIMEOUT=360
     2833           echo "no_coupling"  >  runfile_atmos
     2834           mpiexec_mpt -np $ii   ./a.out  $ROPTS
    27582835       else
    27592836          printf "\n  +++ no debug available on \"$localhost\" "
Note: See TracChangeset for help on using the changeset viewer.