#!/bin/bash -e # --------------------------------------------------------------------------- # # w3_new : Touch and/or remove files to assure that make updates the # # correct subroutines after the switches in switch have been # # changed. # # # # use : w3_new keyword # # # # used by : w3_make # # # # keyword : all : redo entire compilation. # # ... : see make_makefile.prog # # # # error codes : 1 : no environment file $ww3_env found. # # # # programs used : # # # # Hendrik L. Tolman # # November 2013 # # # # Copyright 2009-2013 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. # # # # --------------------------------------------------------------------------- # # 0. Process command line arguments # # --------------------------------------------------------------------------- # if test "$#" -lt '1' then keys='all' else keys="$*" fi # --------------------------------------------------------------------------- # # 1. Preparations # # --------------------------------------------------------------------------- # # 1.a ID header - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # echo ' ' # echo ' *****************************' # echo ' *** WAVEWATCH III new ***' # echo ' *****************************' # echo ' ' # 1.b Read data from the environment file - - - - - - - - - - - - - - - - - - source $(dirname $0)/w3_setenv main_dir=$WWATCH3_DIR temp_dir=$WWATCH3_TMP source=$WWATCH3_SOURCE list=$WWATCH3_LIST # --------------------------------------------------------------------------- # # 2. Process keywords. # # --------------------------------------------------------------------------- # for key in $keys do case $key in 'all' ) cd $main_dir ; rm -f obj_*/*.o rm -f mod_*/*.mod rm -f exe/ww3_* rm -f exe/gx_* rm -f exe/exec_type ;; 'mach' ) cd $main_dir/ftn ; touch w3servmd.ftn touch wmmdatmd.ftn touch wminitmd.ftn touch wmfinlmd.ftn touch ww3_systrk.ftn touch ww3_shel.ftn touch ww3_sbs1.ftn ;; 'nco' ) cd $main_dir/ftn ; touch w3bullmd.ftn touch ww3_prep.ftn touch ww3_shel.ftn touch ww3_ounp.ftn touch ww3_prnc.ftn touch ww3_outp.ftn touch ww3_prtide.ftn touch ww3_grib.ftn ;; 'grib' ) cd $main_dir/ftn ; touch ww3_grib.ftn ;; 'mcp' ) cd $main_dir/ftn ; touch w3wavemd.ftn touch ww3_shel.ftn touch ww3_grid.ftn ;; 'c90' ) cd $main_dir/ftn ; touch w3iogomd.ftn touch w3pro1md.ftn touch w3pro2md.ftn touch w3pro3md.ftn touch w3profsmd.ftn touch w3profsmd_pdlib.ftn touch w3uno2md.ftn touch w3uqckmd.ftn ;; 'nec' ) cd $main_dir/ftn ; touch w3initmd.ftn touch w3iogomd.ftn touch w3pro1md.ftn touch w3pro2md.ftn touch w3pro3md.ftn touch w3uno2md.ftn touch w3uqckmd.ftn ;; 'netcdf' ) cd $main_dir/ftn ; touch ww3_ounf.ftn touch ww3_ounp.ftn touch ww3_bounc.ftn touch ww3_systrk.ftn touch ww3_prnc.ftn touch ww3_trnc.ftn ;; 'scrip' ) cd $main_dir/ftn ; touch wmgridmd.ftn touch wmscrpmd.ftn touch ww3_grid.ftn cd $main_dir/ftn/SCRIP ; touch scrip_interface.ftn ;; 'scripnc') cd $main_dir/ftn ; touch wmgridmd.ftn cd $main_dir/ftn/SCRIP ; touch scrip_interface.ftn ;; 'trknc' ) cd $main_dir/ftn ; touch ww3_systrk.ftn ;; 'shared' ) ;; 'mpp' );; 'mpiexp' ) cd $main_dir/ftn ; touch wmgridmd.ftn ;; 'thread' ) cd $main_dir/ftn ; touch w3wavemd.ftn touch w3iogomd.ftn touch w3pro1md.ftn touch w3pro2md.ftn touch w3pro3md.ftn touch w3uno2md.ftn touch w3updtmd.ftn touch w3uqckmd.ftn touch w3iogomd.ftn ;; 'GSE' ) cd $main_dir/ftn ; touch w3gdatmd.ftn touch w3adatmd.ftn touch w3idatmd.ftn touch w3iogrmd.ftn touch w3updtmd.ftn touch w3wavemd.ftn touch w3triamd.ftn touch wmgridmd.ftn touch ww3_gspl.ftn touch ww3_shel.ftn touch ww3_grid.ftn ;; 'prop' ) cd $main_dir/ftn ; touch w3gdatmd.ftn touch w3adatmd.ftn touch w3idatmd.ftn touch w3iogrmd.ftn touch w3wavemd.ftn touch w3pro2md.ftn touch w3pro3md.ftn touch wmgridmd.ftn touch w3updtmd.ftn touch ww3_shel.ftn touch ww3_grid.ftn touch ww3_gspl.ftn ;; 'stress' ) cd $main_dir/ftn ; touch w3srcemd.ftn touch w3gdatmd.ftn touch w3iogrmd.ftn touch ww3_outp.ftn touch ww3_ounp.ftn touch ww3_grid.ftn touch gx_outp.ftn ;; 'dstress') cd $main_dir/ftn ; touch w3srcemd.ftn touch w3gdatmd.ftn touch w3iogrmd.ftn touch w3fld1md.ftn touch w3fld2md.ftn touch ww3_grid.ftn ;; 's_ln' ) cd $main_dir/ftn ; touch w3gdatmd.ftn touch w3srcemd.ftn touch w3iogrmd.ftn touch w3iorsmd.ftn touch w3adatmd.ftn touch w3iogrmd.ftn touch wminitmd.ftn touch ww3_grid.ftn touch ww3_outp.ftn touch ww3_ounp.ftn touch ww3_prep.ftn touch ww3_prnc.ftn touch ww3_prtide.ftn touch ww3_strt.ftn touch gx_outp.ftn ;; 'source' ) cd $main_dir/ftn ; touch w3gdatmd.ftn touch w3srcemd.ftn touch w3flx1md.ftn touch w3flx2md.ftn touch w3flx3md.ftn touch w3updtmd.ftn touch w3iogrmd.ftn touch w3iogomd.ftn touch w3updtmd.ftn touch wmesmfmd.ftn touch ww3_grid.ftn touch ww3_outp.ftn touch ww3_ounp.ftn touch ww3_ounf.ftn touch gx_outp.ftn ;; 'stab' ) cd $main_dir/ftn ; touch w3updtmd.ftn touch w3src3md.ftn touch w3src4md.ftn touch ww3_grid.ftn touch ww3_outp.ftn touch ww3_ounp.ftn touch gx_outp.ftn ;; 's_nl' ) cd $main_dir/ftn ; touch w3gdatmd.ftn touch w3adatmd.ftn touch w3srcemd.ftn touch w3iogrmd.ftn touch wminitmd.ftn touch ww3_grid.ftn touch ww3_prep.ftn touch ww3_outp.ftn touch ww3_ounp.ftn touch ww3_prnc.ftn touch ww3_strt.ftn touch ww3_prtide.ftn touch gx_outp.ftn ;; 'snls' ) cd $main_dir/ftn ; touch w3gdatmd.ftn touch w3srcemd.ftn touch w3iogrmd.ftn touch ww3_grid.ftn touch ww3_outp.ftn touch gx_outp.ftn ;; 's_bot' ) cd $main_dir/ftn ; touch w3gdatmd.ftn touch w3odatmd.ftn touch w3srcemd.ftn touch w3iogrmd.ftn touch w3iogomd.ftn touch w3profsmd_pdlib.ftn touch w3sic4md.ftn touch w3wavemd.ftn touch ww3_grid.ftn touch ww3_gint.ftn touch ww3_outp.ftn touch ww3_outf.ftn touch ww3_ounp.ftn touch ww3_ounf.ftn touch ww3_shel.ftn touch gx_outp.ftn ;; 's_db' ) cd $main_dir/ftn ; touch w3gdatmd.ftn touch w3srcemd.ftn touch w3iogrmd.ftn touch w3profsmd_pdlib.ftn touch ww3_grid.ftn touch ww3_outp.ftn touch ww3_ounp.ftn touch gx_outp.ftn ;; 'miche' ) cd $main_dir/ftn ; touch w3gdatmd.ftn touch w3srcemd.ftn touch ww3_grid.ftn ;; 's_tr' ) cd $main_dir/ftn ; touch w3gdatmd.ftn touch w3srcemd.ftn touch w3iogrmd.ftn touch w3profsmd_pdlib.ftn touch ww3_grid.ftn touch ww3_outp.ftn touch ww3_ounp.ftn touch gx_outp.ftn ;; 's_bs' ) cd $main_dir/ftn ; touch w3gdatmd.ftn touch w3srcemd.ftn touch w3iogrmd.ftn touch w3profsmd_pdlib.ftn touch ww3_grid.ftn touch ww3_outp.ftn touch ww3_ounp.ftn touch gx_outp.ftn ;; 's_ice' ) cd $main_dir/ftn ; touch w3iogrmd.ftn touch w3gdatmd.ftn touch w3adatmd.ftn touch w3profsmd_pdlib.ftn touch w3updtmd.ftn touch w3wavemd.ftn touch w3srcemd.ftn touch ww3_grid.ftn touch ww3_outp.ftn touch ww3_ounp.ftn touch ww3_shel.ftn touch gx_outp.ftn ;; 's_is' ) cd $main_dir/ftn ; touch w3srcemd.ftn touch w3iogrmd.ftn touch w3gdatmd.ftn touch w3iogomd.ftn touch w3odatmd.ftn touch w3sic2md.ftn touch w3wavemd.ftn touch ww3_gint.ftn touch ww3_grid.ftn touch ww3_ounf.ftn touch ww3_outf.ftn touch ww3_shel.ftn touch ww3_outp.ftn touch ww3_ounp.ftn touch gx_outf.ftn touch gx_outp.ftn ;; 'reflection' )cd $main_dir/ftn ; touch w3gdatmd.ftn touch w3iogrmd.ftn touch w3iorsmd.ftn touch w3profsmd.ftn touch w3profsmd_pdlib.ftn touch w3srcemd.ftn touch w3triamd.ftn touch w3updtmd.ftn touch w3wavemd.ftn touch ww3_grid.ftn ;; 's_xx' ) cd $main_dir/ftn ; touch w3gdatmd.ftn touch w3srcemd.ftn touch w3iogrmd.ftn touch ww3_grid.ftn touch ww3_outp.ftn touch ww3_ounp.ftn touch gx_outp.ftn ;; 'wind' ) cd $main_dir/ftn ; touch w3updtmd.ftn touch ww3_prnc.ftn touch ww3_prep.ftn ;; 'windx' ) cd $main_dir/ftn ; touch wmupdtmd.ftn ;; 'rwind' ) cd $main_dir/ftn ; touch w3updtmd.ftn touch w3gdatmd.ftn touch w3iogrmd.ftn touch ww3_grid.ftn ;; 'wcor' ) cd $main_dir/ftn ; touch w3updtmd.ftn touch w3gdatmd.ftn touch w3iogrmd.ftn touch ww3_grid.ftn ;; 'curr' ) cd $main_dir/ftn ; touch w3updtmd.ftn touch ww3_prnc.ftn touch ww3_prep.ftn ;; 'currx' ) cd $main_dir/ftn ; touch wmupdtmd.ftn ;; 'mgwind' ) cd $main_dir/ftn ; touch w3updtmd.ftn touch wminitmd.ftn touch ww3_shel.ftn ;; 'mgprop' ) cd $main_dir/ftn ; touch w3pro1md.ftn touch w3pro2md.ftn touch w3pro3md.ftn touch w3profsmd.ftn touch w3profsmd_pdlib.ftn touch w3psmcmd.ftn touch wminitmd.ftn touch ww3_shel.ftn ;; 'mggse' ) cd $main_dir/ftn ; touch w3pro3md.ftn touch ww3_grid.ftn touch ww3_shel.ftn ;; 'subsec' ) cd $main_dir/ftn ; touch w3gdatmd.ftn touch w3iogrmd.ftn touch w3wavemd.ftn touch ww3_grid.ftn ;; 'tdyn' ) cd $main_dir/ftn ; touch w3pro2md.ftn touch w3psmcmd.ftn ;; 'dss0' ) cd $main_dir/ftn ; touch w3pro2md.ftn touch w3psmcmd.ftn ;; 'pdif' ) cd $main_dir/ftn ; touch w3pro2md.ftn touch w3psmcmd.ftn ;; 'tide' ) cd $main_dir/ftn ; touch w3updtmd.ftn touch w3idatmd.ftn touch w3fldsmd.ftn touch ww3_prnc.ftn touch ww3_shel.ftn ;; 'refrx' ) cd $main_dir/ftn ; touch w3wavemd.ftn touch w3parall.ftn touch w3pro1md.ftn touch w3pro2md.ftn touch w3pro3md.ftn ;; 'ig' ) cd $main_dir/ftn ; touch w3gdatmd.ftn touch w3iogomd.ftn touch w3iogrmd.ftn touch w3ref1md.ftn touch w3src4md.ftn touch w3srcemd.ftn touch ww3_grid.ftn touch ww3_ounp.ftn touch ww3_outp.ftn ;; 'rotag' ) cd $main_dir/ftn ; touch w3gdatmd.ftn touch w3iobcmd.ftn touch w3iogomd.ftn touch w3iogrmd.ftn touch w3iopomd.ftn touch w3updtmd.ftn touch ww3_grib.ftn touch ww3_ounf.ftn touch ww3_ounp.ftn touch ww3_outf.ftn touch ww3_grid.ftn ;; 'arctic' ) cd $main_dir/ftn ; touch w3gdatmd.ftn touch w3iogrmd.ftn touch w3psmcmd.ftn touch w3updtmd.ftn touch w3wavemd.ftn touch ww3_grid.ftn ;; 'nnt' ) cd $main_dir/ftn ; touch w3srcemd.ftn ;; 'mprf' ) cd $main_dir/ftn ; touch wmmdatmd.ftn touch wminitmd.ftn touch wmwavemd.ftn touch wmfinlmd.ftn ;; 'cou' ) cd $main_dir/ftn ; touch w3iogomd.ftn touch w3nmlmultimd.ftn touch w3nmlshelmd.ftn touch w3wavemd.ftn touch wminitmd.ftn touch ww3_shel.ftn ;; 'oasis' ) cd $main_dir/ftn ; touch w3oacpmd.ftn touch w3fldsmd.ftn touch w3wavemd.ftn touch w3wdatmd.ftn touch ww3_shel.ftn ;; 'agcm' ) cd $main_dir/ftn ; touch w3agcmmd.ftn touch w3fldsmd.ftn touch w3iogomd.ftn touch w3oacpmd.ftn touch w3wavemd.ftn touch ww3_shel.ftn ;; 'ogcm' ) cd $main_dir/ftn ; touch w3ogcmmd.ftn touch w3fldsmd.ftn touch w3iogomd.ftn touch w3oacpmd.ftn touch w3updtmd.ftn touch w3wavemd.ftn touch ww3_shel.ftn ;; 'igcm' ) cd $main_dir/ftn ; touch w3igcmmd.ftn touch w3fldsmd.ftn touch w3oacpmd.ftn touch w3wavemd.ftn touch ww3_shel.ftn ;; 'setup' ) cd $main_dir/ftn ; touch w3initmd.ftn touch w3iogomd.ftn touch w3iopomd.ftn touch w3netcdf.ftn touch w3odatmd.ftn touch w3updtmd.ftn touch w3wavemd.ftn touch w3wdatmd.ftn touch ww3_ounf.ftn touch ww3_ounp.ftn;; 'pdlib' ) cd $main_dir/ftn ; touch w3adatmd.ftn touch w3gdatmd.ftn touch w3initmd.ftn touch w3iorsmd.ftn touch w3netcdf.ftn touch w3parall.ftn touch w3srcemd.ftn touch w3triamd.ftn touch w3wavemd.ftn touch w3wdatmd.ftn touch wminiomd.ftn touch wmmdatmd.ftn touch ww3_shel.ftn ;; 'memck' ) cd $main_dir/ftn ; touch w3adatmd.ftn touch w3gdatmd.ftn touch w3initmd.ftn touch w3iogrmd.ftn touch w3profsmd_pdlib.ftn touch w3wavemd.ftn touch ww3_shel.ftn ;; 'uost' ) cd $main_dir/ftn ; touch w3gdatmd.ftn touch w3initmd.ftn touch w3iogrmd.ftn touch w3srcemd.ftn touch w3wavemd.ftn touch ww3_grid.ftn ;; * ) echo "w3_new: keyword [$key] not recognized" ;; esac done # End of w3_new ------------------------------------------------------------- #