#!/bin/sh # --------------------------------------------------------------------------- # # make_MPI : Script to manage consecutive compiling of MPI and non-MPI # # elements of WAVEWATCH III, using standard compile scripts. # # Only ww3_shel, ww3_multi, and ww3_sbs1 are compiled for MPI. # # # # Hendrik L. Tolman # # April 2010 # # March 2014 # # # # Copyright 2010-2014 National Weather Service (NWS), # # National Oceanic and Atmospheric Administration. All rights # # reserved. WAVEWATCH III is a trademark of the NWS. # # No unauthorized use without permission. # # # # --------------------------------------------------------------------------- # # 1. Preparations # # --------------------------------------------------------------------------- # # 1.a Internal variables tmp='ww3_temp' # temporary working directory # The following line must not be removed: it is a switch for local install # so that all bin scripts point to the local wwatch3.env export ww3_env=$COAWST_WW3_DIR/wwatch3.env # For manual install (without install_ww3_tar or install_ww3_svn) make sure to # either use the generic ww3_env or to add your own ww3_env="${my_directory}" if [ ${WWATCH3_ENV} ]; then ww3_env="${WWATCH3_ENV}"; fi # alternate file # 1.b ID header - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # clear echo ' ' echo ' ************************************' echo ' *** WAVEWATCH III compile for MPI ***' echo ' ************************************' echo ' ' # 1.c Read data from the environment file - - - - - - - - - - - - - - - - - - if test -f $ww3_env then set `grep WWATCH3_DIR $ww3_env` ; shift main_dir="$*" else echo "*** Set-up file $ww3_env not found ***" exit fi # 1.d Check / make directories - - - - - - - - - - - - - - - - - - - - - - - if test -d $main_dir then cd $main_dir else echo "*** Directory $main_dir not found ***" exit fi if test -d bin then cd bin else echo "*** Directory $main_dir/bin not found ***" exit fi # 1.e Check NetCDF setup - - - - - - - - - - - - - - - - - - - - - - - - - - - if [ -z "$WWATCH3_NETCDF" ] then ww3_NetCDF= else ww3_NetCDF="ww3_prnc ww3_ounf ww3_ounp ww3_bounc ww3_trnc" fi # --------------------------------------------------------------------------- # # 2. Process switch files # # --------------------------------------------------------------------------- # ./sort_switch -s -r switch cp switch switch.hold sed -e 's/DIST/SHRD/g' \ -e 's/OMPG //g'\ -e 's/OMPH //g'\ -e 's/OMPX //g'\ -e 's/MPI //g' switch.hold > switch.shrd sed 's/SHRD/DIST MPI/g' switch.shrd > switch.MPI # --------------------------------------------------------------------------- # # 3. Compile non-MPI codes # # --------------------------------------------------------------------------- # cp switch.shrd switch ./w3_make ww3_grid ww3_strt ww3_prep ww3_outf ww3_outp ww3_trck ww3_grib \ ww3_gspl ww3_gint gx_outf gx_outp ww3_systrk ww3_bound \ $ww3_NetCDF # --------------------------------------------------------------------------- # # 3. Compile MPI codes # # --------------------------------------------------------------------------- # echo ' ' echo ' ************************************' echo ' *** WAVEWATCH III compile ww3_shel ***' echo ' ************************************' echo ' ' cp switch.MPI switch ./w3_make ww3_shel ww3_multi ww3_sbs1 # --------------------------------------------------------------------------- # # 4. Reset switch file # # --------------------------------------------------------------------------- # cp switch.hold switch # --------------------------------------------------------------------------- # # 5. Clean up # # --------------------------------------------------------------------------- # rm -f switch.hold switch.shrd switch.MPI #jcw ./w3_clean echo ' ' echo ' ' echo ' *******************************' echo ' *** End of program ***' echo ' *******************************' echo ' ' # end of script ------------------------------------------------------------- #