ERA5 in urtapt extended analysis

cd ~hgs/Ttide/SCG
1. Make the de-tided/de-seasoned Hydrology from ERA5:
setenv DSRC era5
setenv DT 1h
  Global:
setenv DNR global
urtapt @ urtap-era5-lpt.ins :U
  Local:
setenv DNR OS
urtapt @ urtap-era5-lpt.ins :U
  Keep in mind the residuals: o/${DNR}-era5-1h-lpt.ra.ts

2. Make a solution without any hydrology in regression: 
setenv GRWA "; "
setenv RIOL "; "
setenv RIOW
setenv ERAL "; "
setenv ERAN "; "
setenv ERAW "; "
setenv ERANFILE tmp/OS-ERAinN+V-${URTAPDT}-lpt-rawf.mc
source urtap-openend-esplc-cmhy.ins gnws
setenv MRK -esplN-gnws
urtapt @ urtap-openend-esplc-cmhy.ins :U | tee logs/urtap-openend${MRK}-cmhy.log
  Residual: o/g090615-OPNEND-1h-esplN-gnws064-cmhy.rw.ts => RMS-dev=   5.5589
  Correlation pre Wiener filter:
tslist o/global-era5-1h-lpt.ra.ts -BHc2014,4,1,1 -I -o tmp/global-era5-1h-lpt.ra.ts
tslist o/OS-era5-1h-lpt.ra.ts     -BHc2014,4,1,1 -I -o tmp/OS-era5-1h-lpt.ra.ts

setenv FILE2CORR o/g090615-OPNEND-1h-esplN-gnws064-cmhy.rw.ts

   Global:
tslist tmp/global-era5-1h-lpt.ra.ts -I -E corr.tse,CORR | fgrep CORR: => 0.17248
   Local:
tslist tmp/OS-era5-1h-lpt.ra.ts -I -E corr.tse,CORR | fgrep CORR:     => 0.13463
3. Make Wiener filters
  alternately   setenv DNR global    or   OS
sasm06 @ sasm06-ra-era5.ins :U > ! logs/sasm06-ra-era5.log
  A list of the Wiener filter bank can be made with
fslist -s'*'  o/ra-global-era5-1h.wf
make-wfmcs -wfl 064,056,048,040,032,024,016 -w o/ra-global-era5-1h.wf -l GLOB ++ -BHc2014,4,1,1 + o/global-era5-1h-lpt.ra.ts
make-wfmcs -wfl 064,056,048,040,032,024,016 -w o/ra-OS-era5-1h.wf     -l LOCA ++ -BHc2014,4,1,1 + o/OS-era5-1h-lpt.ra.ts
  creates tmp/OS-era5-1h-lpt.ra-wf.mc  and  tmp/global-era5-1h-lpt.ra-wf.mc

  Check correlations:
set labs = ( `tslql tmp/${DNR}-era5-1h-lpt.ra-wf.mc` )
foreach l ( $labs )
   tslist tmp/${DNR}-era5-1h-lpt.ra-wf.mc -L$l -I -E corr.tse,CORR |\
    awk -v l=$l '/CORR: /{sub(/._/,",",l);gsub(/_/,"",l); print l,$0}'

end
 Results, global:
GLO,064  <TsfEdi>>> CORR:    0.25102, CXY CXX CYY=  2.2254E+00  1.5948E+00  5.5588E+00, ndata=    36162
GLO,056  <TsfEdi>>> CORR:    0.24889, CXY CXX CYY=  2.2048E+00  1.5936E+00  5.5588E+00, ndata=    36162
GLO,048  <TsfEdi>>> CORR:    0.24638, CXY CXX CYY=  2.1803E+00  1.5920E+00  5.5588E+00, ndata=    36162
GLO,040  <TsfEdi>>> CORR:    0.24510, CXY CXX CYY=  2.1677E+00  1.5910E+00  5.5588E+00, ndata=    36162
GLO,032  <TsfEdi>>> CORR:    0.24722, CXY CXX CYY=  2.1881E+00  1.5922E+00  5.5588E+00, ndata=    36162
GLO,024  <TsfEdi>>> CORR:    0.25912, CXY CXX CYY=  2.3169E+00  1.6085E+00  5.5588E+00, ndata=    36162
GLO,016  <TsfEdi>>> CORR:    0.20387, CXY CXX CYY=  1.8393E+00  1.6230E+00  5.5588E+00, ndata=    36162

   Local:
LOC,064  <TsfEdi>>> CORR:    0.18671, CXY CXX CYY=  1.0231E+01  9.8577E+00  5.5588E+00, ndata=    36162
LOC,056  <TsfEdi>>> CORR:    0.18337, CXY CXX CYY=  1.0028E+01  9.8378E+00  5.5588E+00, ndata=    36162
LOC,048  <TsfEdi>>> CORR:    0.18062, CXY CXX CYY=  9.8641E+00  9.8245E+00  5.5588E+00, ndata=    36162
LOC,040  <TsfEdi>>> CORR:    0.17912, CXY CXX CYY=  9.7757E+00  9.8182E+00  5.5588E+00, ndata=    36162
LOC,032  <TsfEdi>>> CORR:    0.17959, CXY CXX CYY=  9.8048E+00  9.8216E+00  5.5588E+00, ndata=    36162
LOC,024  <TsfEdi>>> CORR:    0.18227, CXY CXX CYY=  9.9712E+00  9.8411E+00  5.5588E+00, ndata=    36162
LOC,016  <TsfEdi>>> CORR:    0.19044, CXY CXX CYY=  1.0591E+01  1.0005E+01  5.5588E+00, ndata=    36162

... shows improvement!
Combine the two best solutions to an MC-file:
rm -f tmp/era5-1h-lpt.ra-wf.mc 
tslist tmp/global-era5-1h-lpt.ra-wf.mc -LG+024 -I -O:`label G,024` tmp/era5-1h-lpt.ra-wf.mc 
tslist tmp/OS-era5-1h-lpt.ra-wf.mc -LL+016     -I -O:`label L,016` tmp/era5-1h-lpt.ra-wf.mc
4. Make a new Extended Analysis:
. extan.setenv era5-wiener
  Re-iterate until no outliers are detected.
tslq o/g090615-OPNEND-1h-espW-gnws064-cmhy.rw.ts  => RMS-dev=   4.6847

Result sheet shows:
---------------------------------------------------------------------------------------------------------------------------
                                                          Admittance
+-   68.3% conf   
--------------------------------------------------------------------------------------------------------------------------
 ERLW  99 <tmp/era5-1h-lpt.ra-wf.mc -LL+0>                   -0.0138 +-   0.0138   ERA5 local   ????
 ERGW 100 <tmp/era5-1h-lpt.ra-wf.mc -LG+0>                    1.3739 +-   0.0982   ERA5 global
 ECCO 101 <o/gnws-1h.ra.ts>                                   0.2166 +-   0.0101   CMEMS NWShelf
 RIOW 102 <tmp/BPRIOS-wf-1h.mc -LBPWF+080>                    0.3676 +-   0.0043   OSO tide gauge
 ATGL 103 <Atmacs/os_atmacs-1h.mc -LA+GML>                    0.3108 +-   0.0286   Atmacs loading
 AEW2 104 <tmp/aevs-wf-1h.mc -LEV02+080>                     -3.2020 +-   0.0506   Atmacs&Baro Eigenvector 1 Wiener
 AEW1 105 <tmp/aevs-wf-1h.mc -LEV01+128>                     26.9221 +-   0.1311  
Atmacs&Baro Eigenvector 2 Wiener
 AEV2 106 <tt/urtap-090615-OPNEND-aspl.eu -LD+U002>          -0.0537 +-   0.0037  
Atmacs&Baro Eigenvector 1
 AEV1 107 <tt/urtap-090615-OPNEND-aspl.eu -LD+U001>          -7.0609 +-   0.0461  
Atmacs&Baro Eigenvector 2 
 POLX 108 <o/g-PM-1h-lpt.rt.mc -LP+X>                         0.3562 +-   0.0445   Polar motion cross-phase
 POLI 109 <o/g-PM-1h-lpt.rt.mc -LP+I>                         1.3356 +-   0.0432  
Polar motion in-phase 

and colluded (!) long-period tides:
---------------------------------------------------------------------------------------------------------------------------
       #b  Dominating tide   Frequ.    Amplit.   Phase     Co..admittance parameter..Quad +- 68.3% conf     Gain   Cophase
           argum.numbers     [cyc/d]    [nm/s^2] [deg]                                                     "delta" "kappa" 
---------------------------------------------------------------------------------------------------------------------------
 Sa     1  2 0 0 1 0 0-1 0 0.0027378      5.330    2.00       2.3542 +- 0.05734      2.7410 +- 0.05622      3.6132   49.34
 Ssa    3  2 0 0 2 0 0 0 0 0.0054758     33.572   30.19       1.0439 +- 0.00560     -0.0315 +- 0.00548      1.0444   -1.73
 Sta    5  2 0 0 3 0 0-1 0 0.0082136      1.960  212.19       0.1191 +- 0.09443     -0.2825 +- 0.09381      0.3066  -67.14
 Sqa    7  2 0 0 4 0 0-2 0 0.0109514      0.080   34.19      -3.6870 +- 2.29650      0.8471 +- 2.30506      3.7831  167.06

5. Re-iterate whitening filter
setenv sasm03_input   o/g090615-OPNEND-1h-espW-gnws064-cmhy.rw.ts
setenv sasm03_pef     tmp/grav-cmhy-${URTAPDT}.pef
setenv sasm03_output  tmp/grav-cmhy-${URTAPDT}.sp
setenv sasm03_memsp   tmp/grav-cmhy-${URTAPDT}.memsp

sasm03 @ sasm03-1h.ins :U
cp tmp/grav-cmhy-1h.pef d/grav-cmhy-1h.pef
   Re-run the urtapt analysis:
source extan.setenv no-era5
source extan.setenv era5-wiener 
source extan.setenv era5-wiener-global  
source extan.setenv era5-wiener-nonlocal 
(the instruction file urtap-openend-esplc-cmhy.ins looks awful!)

/HGS