#!/bin/csh -bf # # gp.qregres # ----------- # Script runs QREGRES and CHECKQREGFLINN. # N.E. King # August 1994 # March 1995 Modified to run qr_nml (GIPSY R3) # add ExtEOPrtls = .false. in order to # NOT solve for enhanced polar motion # take error exit if any site vector is not found # 1995/08/07 whp Now used by runall as well as bard processing # (No changes required for this) # 1995/08/08 whp Added capability to use TDPTABLE if it exists. # This version now requires a $TDP argument # (TDP=ignore or TDP=use). # Converted to use TPNML file. # Necessary dates are now read from SaveObsDate # 1995/08/15 whp Modified qregres.nml construction. Eliminated # redundant enhanced-polar-motion section. Fixed # bug that was stripping off last two e-p-m # coefficients. # 1995/10/11 whp Converted for use with gp scripts (merged bard/runall). # Required only a name change. # 1998/02/10 jls Added call to gp.fix_qregres # 1998/02/12 whp Added compatibility with UseTropGrad switch # # CHECK NUMBER OF ARGUMENTS # ------------------------- echo " " if ($#argv != 1) then echo Usage: gp.qregres PointPositionflag exit 1 endif # Check for existence of date file # -------------------------------- if (! -e SaveObsDate) then echo " " echo "gp.qregres: Could not find SaveObsDate" echo "Execute following command before calling this" echo "CreateObsDateFile yyyymmdd" exit 1 endif # Read variables from SaveObsDate # ------------------------------- set dmym2 = `grep dmym2 SaveObsDate | awk '{print $2}'` set dmyp1 = `grep dmyp1 SaveObsDate | awk '{print $2}'` set date = `grep ymdobs SaveObsDate | awk '{print $2}'` set point = $1 # Construct and tailor namelist # ----------------------------- rm qregres.nml >& /dev/null if ($point != "yes") then qr_nml qmfile > qregres.nml tp_nml $dmym2 $dmyp1 >> qregres.nml else qr_nml qmfile -tp tpeo.nml -ppp -no_ocean > qregres.nml endif # Check qregres namelist # Exit if any site vector not found # --------------------------------- set svecflag = `grep WARNING qregres.nml | wc -l` if ($svecflag != 0) then echo gp.qregres: problems in qregres.nml exit 2 endif # If doing a network solution Fix qregres.nml so that it contains # correct parameters for estimating a tropospheric gradient # --------------------------------------------------------------- if ($point != "yes") then set UseTropGrad = `grep UseTropGrad ProcessFlags | awk '{print $2}'` if ($UseTropGrad == "yes") then gp.fix_qregres endif endif # Add elevation dependent phase-center information # ------------------------------------------------ gp.qr_pmap qregres.nml qmfile # Run qregres (w or w/o JPL orbits and clocks) # -------------------------------------------- rm -f rgfile qregres.log prefit_residual_file >& /dev/null # Remove satellites from qm file that are not found in # peci file # ---------------------------------------------------- weed_qm qmfile peci weed_qm.qmfile mv -f weed_qm.qmfile qmfile if ($point == "yes") then nice qregres -i qmfile \ -o rgfile \ -n qregres.nml \ -e /eph/Linux86/de405s.nio \ -sc peci \ -shad Shadow \ -res prefit_residual_file \ -pr qregres.log \ -time_dep TDPfile \ >& /dev/null else nice qregres -i qmfile \ -o rgfile \ -n qregres.nml \ -e /eph/Linux86/de405s.nio \ -sc $date.eci \ -pr qregres.log \ >& /dev/null endif # CHECK FOR ERRORS # ------------------ if (-e core) then rm core endif set errflag = `grep TROUBLE qregres.log | wc -l` if ($errflag != 0) then echo "gp.qregres: TROUBLE in qregres." exit 3 endif if (! -e rgfile) then echo "gp.qregres: qregres output file rgfile not found." exit 4 endif