Changeset 12178 for NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/doc/latex/NEMO/subfiles/chap_OBS.tex
- Timestamp:
- 2019-12-11T12:02:38+01:00 (4 years ago)
- Location:
- NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/doc
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/doc
- Property svn:ignore deleted
-
Property
svn:externals
set to
^/utils/badges badges
^/utils/logos logos
-
NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/doc/latex
- Property svn:ignore deleted
-
NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/doc/latex/NEMO
-
Property
svn:externals
set to
^/utils/figures/NEMO figures
-
Property
svn:externals
set to
-
NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/doc/latex/NEMO/subfiles
-
Property
svn:ignore
set to
*.ind
*.ilg
-
Property
svn:ignore
set to
-
NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/doc/latex/NEMO/subfiles/chap_OBS.tex
r11123 r12178 2 2 3 3 \begin{document} 4 % ================================================================ 5 % Chapter observation operator (OBS) 6 % ================================================================ 4 7 5 \chapter{Observation and Model Comparison (OBS)} 8 6 \label{chap:OBS} 9 7 10 Authors: D. Lea, M. Martin, K. Mogensen, A. Vidard, A. Weaver, A. Ryan, ... % do we keep that ? 11 12 \minitoc 13 14 \newpage 15 16 The observation and model comparison code (OBS) reads in observation files 17 (profile temperature and salinity, sea surface temperature, sea level anomaly, sea ice concentration, and velocity) and calculates an interpolated model equivalent value at the observation location and nearest model timestep. 8 %\subsubsection*{Changes record} 9 %\begin{tabular}{l||l|m{0.65\linewidth}} 10 % Release & Author & Modifications \\ 11 % {\em 4.0} & {\em D. J. Lea} & {\em \NEMO\ 4.0 updates} \\ 12 % {\em 3.6} & {\em M. Martin, A. Ryan} & {\em Add averaging operator, standalone obs oper} \\ 13 % {\em 3.4} & {\em D. J. Lea, M. Martin, ...} & {\em Initial version} \\ 14 % {\em --\texttt{"}--} & {\em ... K. Mogensen, A. Vidard, A. Weaver} & {\em ---\texttt{"}---} \\ 15 %\end{tabular} 16 17 \thispagestyle{plain} 18 19 \chaptertoc 20 21 \paragraph{Changes record} ~\\ 22 23 {\footnotesize 24 \begin{tabularx}{\textwidth}{l||X|X} 25 Release & Author(s) & Modifications \\ 26 \hline 27 {\em 4.0} & {\em ...} & {\em ...} \\ 28 {\em 3.6} & {\em ...} & {\em ...} \\ 29 {\em 3.4} & {\em ...} & {\em ...} \\ 30 {\em <=3.4} & {\em ...} & {\em ...} 31 \end{tabularx} 32 } 33 34 \clearpage 35 36 The observation and model comparison code, the observation operator (OBS), reads in observation files 37 (profile temperature and salinity, sea surface temperature, sea level anomaly, sea ice concentration, and velocity) and calculates an interpolated model equivalent value at the observation location and nearest model time step. 18 38 The resulting data are saved in a ``feedback'' file (or files). 19 39 The code was originally developed for use with the NEMOVAR data assimilation code, 20 40 but can be used for validation or verification of the model or with any other data assimilation system. 21 41 22 The OBS code is called from \mdl{nemogcm} for model initialisation and to calculate the model equivalent values for observations on the 0th time step.23 The code is then called again after each time step from \mdl{step}.24 The code is only activated if the namelist logical \np{ln\_diaobs} is set to true.42 The OBS code is called from \mdl{nemogcm} for model initialisation and to calculate the model equivalent values for observations on the 0th time step. 43 The code is then called again after each time step from \mdl{step}. 44 The code is only activated if the \nam{obs}{obs} namelist logical \np{ln_diaobs}{ln\_diaobs} is set to true. 25 45 26 46 For all data types a 2D horizontal interpolator or averager is needed to … … 28 48 For {\em in situ} profiles, a 1D vertical interpolator is needed in addition to 29 49 provide model fields at the observation depths. 30 This now works in a generalised vertical coordinate system. 31 32 Some profile observation types (\eg tropical moored buoys) are made available as daily averaged quantities.50 This now works in a generalised vertical coordinate system. 51 52 Some profile observation types (\eg\ tropical moored buoys) are made available as daily averaged quantities. 33 53 The observation operator code can be set-up to calculate the equivalent daily average model temperature fields using 34 the \np{nn \_profdavtypes} namelist array.54 the \np{nn_profdavtypes}{nn\_profdavtypes} namelist array. 35 55 Some SST observations are equivalent to a night-time average value and 36 56 the observation operator code can calculate equivalent night-time average model SST fields by 37 setting the namelist value \np{ln \_sstnight} to true.38 Otherwise the model value from the nearest timestep to the observation time is used.39 40 The code is controlled by the namelist \ textit{namobs}.57 setting the namelist value \np{ln_sstnight}{ln\_sstnight} to true. 58 Otherwise (by default) the model value from the nearest time step to the observation time is used. 59 60 The code is controlled by the namelist \nam{obs}{obs}. 41 61 See the following sections for more details on setting up the namelist. 42 62 43 \autoref{sec:OBS_example} introduces a test example of the observation operator codeincluding63 In \autoref{sec:OBS_example} a test example of the observation operator code is introduced, including 44 64 where to obtain data and how to setup the namelist. 45 \autoref{sec:OBS_details} introduces some more technical details of the different observation types used and 46 also show sa more complete namelist.47 \autoref{sec:OBS_theory} introduces some of the theoretical aspects of the observation operatorincluding65 In \autoref{sec:OBS_details} some more technical details of the different observation types used are introduced, and we 66 also show a more complete namelist. 67 In \autoref{sec:OBS_theory} some of the theoretical aspects of the observation operator are described including 48 68 interpolation methods and running on multiple processors. 49 \autoref{sec:OBS_ooo} describes the offline observation operator code. 50 \autoref{sec:OBS_obsutils} introduces some utilities to help working with the files produced by the OBS code. 51 52 % ================================================================ 53 % Example 54 % ================================================================ 69 In \autoref{sec:OBS_sao} the standalone observation operator code is described. 70 In \autoref{sec:OBS_obsutils} we describe some utilities to help work with the files produced by the OBS code. 71 72 %% ================================================================================================= 55 73 \section{Running the observation operator code example} 56 74 \label{sec:OBS_example} 57 75 58 This section describes an example of running the observation operator codeusing59 profile data which can be freely downloaded.60 It shows how to adapt an existing run and build of NEMO to run the observation operator.76 In this section an example of running the observation operator code is described using 77 profile observation data which can be freely downloaded. 78 It shows how to adapt an existing run and build of \NEMO\ to run the observation operator. Note also the observation operator and the assimilation increments code are run in the ORCA2\_ICE\_OBS SETTE test. 61 79 62 80 \begin{enumerate} 63 \item Compile NEMO.81 \item Compile \NEMO. 64 82 65 83 \item Download some EN4 data from \href{http://www.metoffice.gov.uk/hadobs}{www.metoffice.gov.uk/hadobs}. 66 84 Choose observations which are valid for the period of your test run because 67 the observation operator compares the model and observations for a matching date and time. 68 69 \item Compile the OBSTOOLS code using:85 the observation operator compares the model and observations for a matching date and time. 86 87 \item Compile the OBSTOOLS code in the \path{tools} directory using: 70 88 \begin{cmds} 71 ./maketools -n OBSTOOLS -m [ARCH] .89 ./maketools -n OBSTOOLS -m [ARCH] 72 90 \end{cmds} 73 91 74 \item Convert the EN4 data into feedback format: 92 replacing \texttt{[ARCH]} with the build architecture file for your machine. Note the tools are checked out from a separate location of the repository (under \path{/utils/tools}). 93 94 \item Convert the EN4 data into feedback format: 75 95 \begin{cmds} 76 96 enact2fb.exe profiles_01.nc EN.4.1.1.f.profiles.g10.YYYYMM.nc 77 97 \end{cmds} 78 98 79 \item Include the following in the NEMOnamelist to run the observation operator on this data:99 \item Include the following in the \NEMO\ namelist to run the observation operator on this data: 80 100 \end{enumerate} 81 101 82 Options are defined through the \n gn{namobs} namelist variables.83 The options \np{ln \_t3d} and \np{ln\_s3d} switch on the temperature and salinity profile observation operator code.84 The filename or array of filenames are specified using the \np{cn \_profbfiles} variable.102 Options are defined through the \nam{obs}{obs} namelist variables. 103 The options \np{ln_t3d}{ln\_t3d} and \np{ln_s3d}{ln\_s3d} switch on the temperature and salinity profile observation operator code. 104 The filename or array of filenames are specified using the \np{cn_profbfiles}{cn\_profbfiles} variable. 85 105 The model grid points for a particular observation latitude and longitude are found using 86 106 the grid searching part of the code. 87 107 This can be expensive, particularly for large numbers of observations, 88 setting \np{ln \_grid\_search\_lookup} allows the use of a lookup table which89 is saved into an ``xypos``file (or files).108 setting \np{ln_grid_search_lookup}{ln\_grid\_search\_lookup} allows the use of a lookup table which 109 is saved into an \np{cn_gridsearch}{cn\_gridsearch} file (or files). 90 110 This will need to be generated the first time if it does not exist in the run directory. 91 111 However, once produced it will significantly speed up future grid searches. 92 Setting \np{ln \_grid\_global} means that the code distributes the observations evenly between processors.112 Setting \np{ln_grid_global}{ln\_grid\_global} means that the code distributes the observations evenly between processors. 93 113 Alternatively each processor will work with observations located within the model subdomain 94 (see section~\autoref{subsec:OBS_parallel}).114 (see \autoref{subsec:OBS_parallel}). 95 115 96 116 A number of utilities are now provided to plot the feedback files, convert and recombine the files. 97 These are explained in more detail in section~\autoref{sec:OBS_obsutils}. 98 Utilites to convert other input data formats into the feedback format are also described in 99 section~\autoref{sec:OBS_obsutils}. 100 117 These are explained in more detail in \autoref{sec:OBS_obsutils}. 118 Utilities to convert other input data formats into the feedback format are also described in 119 \autoref{sec:OBS_obsutils}. 120 121 %% ================================================================================================= 101 122 \section{Technical details (feedback type observation file headers)} 102 123 \label{sec:OBS_details} 103 124 104 Here we show a more complete example namelist \n gn{namobs} and also show the NetCDF headers of125 Here we show a more complete example namelist \nam{obs}{obs} and also show the NetCDF headers of 105 126 the observation files that may be used with the observation operator. 106 127 107 %------------------------------------------namobs-------------------------------------------------------- 108 109 \nlst{namobs} 110 %------------------------------------------------------------------------------------------------------------- 111 112 The observation operator code uses the "feedback" observation file format for all data types. 128 \begin{listing} 129 \nlst{namobs} 130 \caption{\forcode{&namobs}} 131 \label{lst:namobs} 132 \end{listing} 133 134 The observation operator code uses the feedback observation file format for all data types. 113 135 All the observation files must be in NetCDF format. 114 136 Some example headers (produced using \mbox{\textit{ncdump~-h}}) for profile data, sea level anomaly and 115 137 sea surface temperature are in the following subsections. 116 138 117 \subsection{Profile feedback} 139 %% ================================================================================================= 140 \subsection{Profile feedback file} 118 141 119 142 \begin{clines} … … 271 294 \end{clines} 272 295 273 \subsection{Sea level anomaly feedback} 296 %% ================================================================================================= 297 \subsection{Sea level anomaly feedback file} 274 298 275 299 \begin{clines} … … 395 419 \end{clines} 396 420 397 T he mean dynamic topography (MDT) must be provided in a separate file defined on421 To use Sea Level Anomaly (SLA) data the mean dynamic topography (MDT) must be provided in a separate file defined on 398 422 the model grid called \ifile{slaReferenceLevel}. 399 423 The MDT is required in order to produce the model equivalent sea level anomaly from the model sea surface height. … … 417 441 \end{clines} 418 442 419 \subsection{Sea surface temperature feedback} 443 %% ================================================================================================= 444 \subsection{Sea surface temperature feedback file} 420 445 421 446 \begin{clines} … … 534 559 \end{clines} 535 560 561 %% ================================================================================================= 536 562 \section{Theoretical details} 537 563 \label{sec:OBS_theory} 538 564 565 %% ================================================================================================= 539 566 \subsection{Horizontal interpolation and averaging methods} 540 567 … … 542 569 the model equivalent of the observation is calculated by interpolating from 543 570 the four surrounding grid points to the observation location. 544 Some satellite observations (\eg microwave satellite SST data, or satellite SSS data) have a footprint which571 Some satellite observations (\eg\ microwave satellite SST data, or satellite SSS data) have a footprint which 545 572 is similar in size or larger than the model grid size (particularly when the grid size is small). 546 573 In those cases the model counterpart should be calculated by averaging the model grid points over 547 574 the same size as the footprint. 548 NEMOtherefore has the capability to specify either an interpolation or an averaging549 (for surface observation types only). 550 551 The main namelist option associated with the interpolation/averaging is \np{nn \_2dint}.575 \NEMO\ therefore has the capability to specify either an interpolation or an averaging 576 (for surface observation types only). 577 578 The main namelist option associated with the interpolation/averaging is \np{nn_2dint}{nn\_2dint}. 552 579 This default option can be set to values from 0 to 6. 553 580 Values between 0 to 4 are associated with interpolation while values 5 or 6 are associated with averaging. 554 581 \begin{itemize} 555 \item \np {nn\_2dint}\forcode{ = 0}: Distance-weighted interpolation556 \item \np {nn\_2dint}\forcode{ = 1}: Distance-weighted interpolation (small angle)557 \item \np {nn\_2dint}\forcode{ = 2}: Bilinear interpolation (geographical grid)558 \item \np {nn\_2dint}\forcode{ = 3}: Bilinear remapping interpolation (general grid)559 \item \np {nn\_2dint}\forcode{ = 4}: Polynomial interpolation560 \item \np {nn\_2dint}\forcode{ = 5}: Radial footprint averaging with diameter specified in the namelist as561 \ np{rn\_???\_avglamscl} in degrees or metres (set using \np{ln\_???\_fp\_indegs})562 \item \np {nn\_2dint}\forcode{ = 6}: Rectangular footprint averaging with E/W and N/S size specified in563 the namelist as \ np{rn\_???\_avglamscl} and \np{rn\_???\_avgphiscl} in degrees or metres564 (set using \ np{ln\_???\_fp\_indegs})582 \item \np[=0]{nn_2dint}{nn\_2dint}: Distance-weighted interpolation 583 \item \np[=1]{nn_2dint}{nn\_2dint}: Distance-weighted interpolation (small angle) 584 \item \np[=2]{nn_2dint}{nn\_2dint}: Bilinear interpolation (geographical grid) 585 \item \np[=3]{nn_2dint}{nn\_2dint}: Bilinear remapping interpolation (general grid) 586 \item \np[=4]{nn_2dint}{nn\_2dint}: Polynomial interpolation 587 \item \np[=5]{nn_2dint}{nn\_2dint}: Radial footprint averaging with diameter specified in the namelist as 588 \texttt{rn\_[var]\_avglamscl} in degrees or metres (set using \texttt{ln\_[var]\_fp\_indegs}) 589 \item \np[=6]{nn_2dint}{nn\_2dint}: Rectangular footprint averaging with E/W and N/S size specified in 590 the namelist as \texttt{rn\_[var]\_avglamscl} and \texttt{rn\_[var]\_avgphiscl} in degrees or metres 591 (set using \texttt{ln\_[var]\_fp\_indegs}) 565 592 \end{itemize} 566 The ??? in the last two options indicate these options should be specified for each observation typefor593 Replace \texttt{[var]} in the last two options with the observation type (sla, sst, sss or sic) for 567 594 which the averaging is to be performed (see namelist example above). 568 The \np{nn\_2dint} default option can be overridden for surface observation types using 569 namelist values \np{nn\_2dint\_???} where ??? is one of sla,sst,sss,sic. 570 571 Below is some more detail on the various options for interpolation and averaging available in NEMO. 572 595 The \np{nn_2dint}{nn\_2dint} default option can be overridden for surface observation types using 596 namelist values \texttt{nn\_2dint\_[var]} where \texttt{[var]} is the observation type. 597 598 Below is some more detail on the various options for interpolation and averaging available in \NEMO. 599 600 %% ================================================================================================= 573 601 \subsubsection{Horizontal interpolation} 574 602 575 Consider an observation point ${\rm P}$ with with longitude and latitude $({\lambda_{}}_{\rm P}, \phi_{\rm P})$ and 576 the four nearest neighbouring model grid points ${\rm A}$, ${\rm B}$, ${\rm C}$ and ${\rm D}$ with 577 longitude and latitude ($\lambda_{\rm A}$, $\phi_{\rm A}$),($\lambda_{\rm B}$, $\phi_{\rm B}$) etc. 578 All horizontal interpolation methods implemented in NEMO estimate the value of a model variable $x$ at point $P$ as 579 a weighted linear combination of the values of the model variables at the grid points ${\rm A}$, ${\rm B}$ etc.: 603 Consider an observation point ${\mathrm P}$ with longitude and latitude (${\lambda_{}}_{\mathrm P}$, $\phi_{\mathrm P}$) and 604 the four nearest neighbouring model grid points ${\mathrm A}$, ${\mathrm B}$, ${\mathrm C}$ and ${\mathrm D}$ with 605 longitude and latitude ($\lambda_{\mathrm A}$, $\phi_{\mathrm A}$),($\lambda_{\mathrm B}$, $\phi_{\mathrm B}$) etc. 606 All horizontal interpolation methods implemented in \NEMO\ estimate the value of a model variable $x$ at point $P$ as 607 a weighted linear combination of the values of the model variables at the grid points ${\mathrm A}$, ${\mathrm B}$ etc.: 608 580 609 \begin{align*} 581 {x_{}}_{\ rm P} & \hspace{-2mm} = \hspace{-2mm} &582 \frac{1}{w} \left( {w_{}}_{\rm A} {x_{}}_{\rm A} +583 {w_{}}_{\rm B} {x_{}}_{\rm B} +584 {w_{}}_{\rm C} {x_{}}_{\rm C} +585 {w_{}}_{\rm D} {x_{}}_{\rm D} \right)610 {x_{}}_{\mathrm P} = 611 \frac{1}{w} \left( {w_{}}_{\mathrm A} {x_{}}_{\mathrm A} + 612 {w_{}}_{\mathrm B} {x_{}}_{\mathrm B} + 613 {w_{}}_{\mathrm C} {x_{}}_{\mathrm C} + 614 {w_{}}_{\mathrm D} {x_{}}_{\mathrm D} \right) 586 615 \end{align*} 587 where ${w_{}}_{\rm A}$, ${w_{}}_{\rm B}$ etc. are the respective weights for the model field at 588 points ${\rm A}$, ${\rm B}$ etc., and $w = {w_{}}_{\rm A} + {w_{}}_{\rm B} + {w_{}}_{\rm C} + {w_{}}_{\rm D}$. 616 617 where ${w_{}}_{\mathrm A}$, ${w_{}}_{\mathrm B}$ etc. are the respective weights for the model field at 618 points ${\mathrm A}$, ${\mathrm B}$ etc., and $w = {w_{}}_{\mathrm A} + {w_{}}_{\mathrm B} + {w_{}}_{\mathrm C} + {w_{}}_{\mathrm D}$. 589 619 590 620 Four different possibilities are available for computing the weights. 591 621 592 622 \begin{enumerate} 593 594 \item[1.] {\bf Great-Circle distance-weighted interpolation.} 623 \item {\bfseries Great-Circle distance-weighted interpolation.} 595 624 The weights are computed as a function of the great-circle distance $s(P, \cdot)$ between $P$ and 596 625 the model grid points $A$, $B$ etc. 597 For example, the weight given to the field ${x_{}}_{\rm A}$ is specified as the product of the distances 598 from ${\rm P}$ to the other points: 599 \begin{align*} 600 {w_{}}_{\rm A} = s({\rm P}, {\rm B}) \, s({\rm P}, {\rm C}) \, s({\rm P}, {\rm D}) 601 \end{align*} 602 where 603 \begin{align*} 604 s\left ({\rm P}, {\rm M} \right ) 605 & \hspace{-2mm} = \hspace{-2mm} & 606 \cos^{-1} \! \left\{ 607 \sin {\phi_{}}_{\rm P} \sin {\phi_{}}_{\rm M} 608 + \cos {\phi_{}}_{\rm P} \cos {\phi_{}}_{\rm M} 609 \cos ({\lambda_{}}_{\rm M} - {\lambda_{}}_{\rm P}) 626 For example, the weight given to the field ${x_{}}_{\mathrm A}$ is specified as the product of the distances 627 from ${\mathrm P}$ to the other points: 628 629 \begin{alignat*}{2} 630 {w_{}}_{\mathrm A} = s({\mathrm P}, {\mathrm B}) \, s({\mathrm P}, {\mathrm C}) \, s({\mathrm P}, {\mathrm D}) 631 \end{alignat*} 632 633 where 634 635 \begin{alignat*}{2} 636 s\left({\mathrm P}, {\mathrm M} \right) & = & \hspace{0.25em} \cos^{-1} \! \left\{ 637 \sin {\phi_{}}_{\mathrm P} \sin {\phi_{}}_{\mathrm M} 638 + \cos {\phi_{}}_{\mathrm P} \cos {\phi_{}}_{\mathrm M} 639 \cos ({\lambda_{}}_{\mathrm M} - {\lambda_{}}_{\mathrm P}) 610 640 \right\} 611 \end{align*} 641 \end{alignat*} 642 612 643 and $M$ corresponds to $B$, $C$ or $D$. 613 644 A more stable form of the great-circle distance formula for small distances ($x$ near 1) 614 involves the arcsine function (\eg see p.~101 of \citet{daley.barker_bk01}: 615 \begin{align*} 616 s\left( {\rm P}, {\rm M} \right) & \hspace{-2mm} = \hspace{-2mm} & \sin^{-1} \! \left\{ \sqrt{ 1 - x^2 } \right\} 617 \end{align*} 645 involves the arcsine function (\eg\ see p.~101 of \citet{daley.barker_bk01}: 646 647 \begin{alignat*}{2} 648 s\left( {\mathrm P}, {\mathrm M} \right) = \sin^{-1} \! \left\{ \sqrt{ 1 - x^2 } \right\} 649 \end{alignat*} 650 618 651 where 619 \begin{align*} 620 x & \hspace{-2mm} = \hspace{-2mm} & 621 {a_{}}_{\rm M} {a_{}}_{\rm P} + {b_{}}_{\rm M} {b_{}}_{\rm P} + {c_{}}_{\rm M} {c_{}}_{\rm P} 622 \end{align*} 623 and 624 \begin{align*} 625 {a_{}}_{\rm M} & \hspace{-2mm} = \hspace{-2mm} & \sin {\phi_{}}_{\rm M}, \\ 626 {a_{}}_{\rm P} & \hspace{-2mm} = \hspace{-2mm} & \sin {\phi_{}}_{\rm P}, \\ 627 {b_{}}_{\rm M} & \hspace{-2mm} = \hspace{-2mm} & \cos {\phi_{}}_{\rm M} \cos {\phi_{}}_{\rm M}, \\ 628 {b_{}}_{\rm P} & \hspace{-2mm} = \hspace{-2mm} & \cos {\phi_{}}_{\rm P} \cos {\phi_{}}_{\rm P}, \\ 629 {c_{}}_{\rm M} & \hspace{-2mm} = \hspace{-2mm} & \cos {\phi_{}}_{\rm M} \sin {\phi_{}}_{\rm M}, \\ 630 {c_{}}_{\rm P} & \hspace{-2mm} = \hspace{-2mm} & \cos {\phi_{}}_{\rm P} \sin {\phi_{}}_{\rm P}. 631 \end{align*} 632 633 \item[2.] {\bf Great-Circle distance-weighted interpolation with small angle approximation.} 652 653 \begin{alignat*}{2} 654 x = {a_{}}_{\mathrm M} {a_{}}_{\mathrm P} + {b_{}}_{\mathrm M} {b_{}}_{\mathrm P} + {c_{}}_{\mathrm M} {c_{}}_{\mathrm P} 655 \end{alignat*} 656 657 and 658 659 \begin{alignat*}{3} 660 & {a_{}}_{\mathrm M} & = && \quad \sin {\phi_{}}_{\mathrm M}, \\ 661 & {a_{}}_{\mathrm P} & = && \quad \sin {\phi_{}}_{\mathrm P}, \\ 662 & {b_{}}_{\mathrm M} & = && \quad \cos {\phi_{}}_{\mathrm M} \cos {\phi_{}}_{\mathrm M}, \\ 663 & {b_{}}_{\mathrm P} & = && \quad \cos {\phi_{}}_{\mathrm P} \cos {\phi_{}}_{\mathrm P}, \\ 664 & {c_{}}_{\mathrm M} & = && \quad \cos {\phi_{}}_{\mathrm M} \sin {\phi_{}}_{\mathrm M}, \\ 665 & {c_{}}_{\mathrm P} & = && \quad \cos {\phi_{}}_{\mathrm P} \sin {\phi_{}}_{\mathrm P}. 666 \end{alignat*} 667 668 \item {\bfseries Great-Circle distance-weighted interpolation with small angle approximation.} 634 669 Similar to the previous interpolation but with the distance $s$ computed as 635 \begin{align*} 636 s\left( {\rm P}, {\rm M} \right) 637 & \hspace{-2mm} = \hspace{-2mm} & 638 \sqrt{ \left( {\phi_{}}_{\rm M} - {\phi_{}}_{\rm P} \right)^{2} 639 + \left( {\lambda_{}}_{\rm M} - {\lambda_{}}_{\rm P} \right)^{2} 640 \cos^{2} {\phi_{}}_{\rm M} } 641 \end{align*} 670 \begin{alignat*}{2} 671 s\left( {\mathrm P}, {\mathrm M} \right) 672 & = & \sqrt{ \left( {\phi_{}}_{\mathrm M} - {\phi_{}}_{\mathrm P} \right)^{2} 673 + \left( {\lambda_{}}_{\mathrm M} - {\lambda_{}}_{\mathrm P} \right)^{2} 674 \cos^{2} {\phi_{}}_{\mathrm M} } 675 \end{alignat*} 642 676 where $M$ corresponds to $A$, $B$, $C$ or $D$. 643 677 644 \item [3.] {\bfBilinear interpolation for a regular spaced grid.}678 \item {\bfseries Bilinear interpolation for a regular spaced grid.} 645 679 The interpolation is split into two 1D interpolations in the longitude and latitude directions, respectively. 646 680 647 \item [4.] {\bfBilinear remapping interpolation for a general grid.}681 \item {\bfseries Bilinear remapping interpolation for a general grid.} 648 682 An iterative scheme that involves first mapping a quadrilateral cell into 649 683 a cell with coordinates (0,0), (1,0), (0,1) and (1,1). 650 684 This method is based on the \href{https://github.com/SCRIP-Project/SCRIP}{SCRIP interpolation package}. 651 685 652 686 \end{enumerate} 653 687 688 %% ================================================================================================= 654 689 \subsubsection{Horizontal averaging} 655 690 … … 658 693 \item The standard grid-searching code is used to find the nearest model grid point to the observation location 659 694 (see next subsection). 660 \item The maximum number of grid points is calculated in the local grid domain for which 661 the averaging is likely need to cover. 662 \item The lats/longs of the grid points surrounding the nearest model grid box are extracted using 663 existing mpi routines. 695 \item The maximum number of grid points required for that observation in each local grid domain is calculated. Some of these points may later turn out to have zero weight depending on the shape of the footprint. 696 \item The longitudes and latitudes of the grid points surrounding the nearest model grid box are extracted using 697 existing MPI routines. 664 698 \item The weights for each grid point associated with each observation are calculated, 665 699 either for radial or rectangular footprints. … … 673 707 674 708 Examples of the weights calculated for an observation with rectangular and radial footprints are shown in 675 Figs.~\autoref{fig:obsavgrec} and~\autoref{fig:obsavgrad}. 676 677 %>>>>>>>>>>>>>>>>>>>>>>>>>>>> 709 \autoref{fig:OBS_avgrec} and~\autoref{fig:OBS_avgrad}. 710 678 711 \begin{figure} 679 \begin{center} 680 \includegraphics[width=0.90\textwidth]{Fig_OBS_avg_rec} 681 \caption{ 682 \protect\label{fig:obsavgrec} 683 Weights associated with each model grid box (blue lines and numbers) 684 for an observation at -170.5\deg{E}, 56.0\deg{N} with a rectangular footprint of 1\deg x 1\deg. 685 } 686 \end{center} 712 \centering 713 \includegraphics[width=0.66\textwidth]{Fig_OBS_avg_rec} 714 \caption[Observational weights with a rectangular footprint]{ 715 Weights associated with each model grid box (blue lines and numbers) 716 for an observation at -170.5\deg{E}, 56.0\deg{N} with a rectangular footprint of 1\deg\ x 1\deg.} 717 \label{fig:OBS_avgrec} 687 718 \end{figure} 688 %>>>>>>>>>>>>>>>>>>>>>>>>>>>> 689 690 %>>>>>>>>>>>>>>>>>>>>>>>>>>>> 719 691 720 \begin{figure} 692 \begin{center} 693 \includegraphics[width=0.90\textwidth]{Fig_OBS_avg_rad} 694 \caption{ 695 \protect\label{fig:obsavgrad} 696 Weights associated with each model grid box (blue lines and numbers) 697 for an observation at -170.5\deg{E}, 56.0\deg{N} with a radial footprint with diameter 1\deg. 698 } 699 \end{center} 721 \centering 722 \includegraphics[width=0.66\textwidth]{Fig_OBS_avg_rad} 723 \caption[Observational weights with a radial footprint]{ 724 Weights associated with each model grid box (blue lines and numbers) 725 for an observation at -170.5\deg{E}, 56.0\deg{N} with a radial footprint with diameter 1\deg.} 726 \label{fig:OBS_avgrad} 700 727 \end{figure} 701 %>>>>>>>>>>>>>>>>>>>>>>>>>>>> 702 703 728 729 %% ================================================================================================= 704 730 \subsection{Grid search} 705 731 706 For many grids used by the NEMOmodel, such as the ORCA family, the horizontal grid coordinates $i$ and $j$ are not simple functions of latitude and longitude.732 For many grids used by the \NEMO\ model, such as the ORCA family, the horizontal grid coordinates $i$ and $j$ are not simple functions of latitude and longitude. 707 733 Therefore, it is not always straightforward to determine the grid points surrounding any given observational position. 708 Before the interpolation can be performed, a search algorithm is then required to determine the corner points of 734 Before the interpolation can be performed, a search algorithm is then required to determine the corner points of 709 735 the quadrilateral cell in which the observation is located. 710 This is the most difficult and time consuming part of the 2D interpolation procedure. 736 This is the most difficult and time consuming part of the 2D interpolation procedure. 711 737 A robust test for determining if an observation falls within a given quadrilateral cell is as follows. 712 Let ${\ rm P}({\lambda_{}}_{\rm P} ,{\phi_{}}_{\rm P} )$ denote the observation point,713 and let ${\ rm A}({\lambda_{}}_{\rm A} ,{\phi_{}}_{\rm A} )$, ${\rm B}({\lambda_{}}_{\rm B} ,{\phi_{}}_{\rm B} )$,714 ${\ rm C}({\lambda_{}}_{\rm C} ,{\phi_{}}_{\rm C} )$ and ${\rm D}({\lambda_{}}_{\rm D} ,{\phi_{}}_{\rm D} )$715 denote the bottom left, bottom right, top left and top right corner points of the cell, respectively. 716 To determine if P is inside the cell, we verify that the cross-products 738 Let ${\mathrm P}({\lambda_{}}_{\mathrm P} ,{\phi_{}}_{\mathrm P} )$ denote the observation point, 739 and let ${\mathrm A}({\lambda_{}}_{\mathrm A} ,{\phi_{}}_{\mathrm A} )$, ${\mathrm B}({\lambda_{}}_{\mathrm B} ,{\phi_{}}_{\mathrm B} )$, 740 ${\mathrm C}({\lambda_{}}_{\mathrm C} ,{\phi_{}}_{\mathrm C} )$ and ${\mathrm D}({\lambda_{}}_{\mathrm D} ,{\phi_{}}_{\mathrm D} )$ 741 denote the bottom left, bottom right, top left and top right corner points of the cell, respectively. 742 To determine if P is inside the cell, we verify that the cross-products 717 743 \begin{align*} 718 744 \begin{array}{lllll} 719 {{\ bf r}_{}}_{\rm PA} \times {{\bf r}_{}}_{\rm PC}720 & = & [({\lambda_{}}_{\ rm A}\; -\; {\lambda_{}}_{\rm P} )721 ({\phi_{}}_{\ rm C} \; -\; {\phi_{}}_{\rm P} )722 - ({\lambda_{}}_{\ rm C}\; -\; {\lambda_{}}_{\rm P} )723 ({\phi_{}}_{\ rm A} \; -\; {\phi_{}}_{\rm P} )] \; \widehat{\bf k} \\724 {{\ bf r}_{}}_{\rm PB} \times {{\bf r}_{}}_{\rm PA}725 & = & [({\lambda_{}}_{\ rm B}\; -\; {\lambda_{}}_{\rm P} )726 ({\phi_{}}_{\ rm A} \; -\; {\phi_{}}_{\rm P} )727 - ({\lambda_{}}_{\ rm A}\; -\; {\lambda_{}}_{\rm P} )728 ({\phi_{}}_{\ rm B} \; -\; {\phi_{}}_{\rm P} )] \; \widehat{\bf k} \\729 {{\ bf r}_{}}_{\rm PC} \times {{\bf r}_{}}_{\rm PD}730 & = & [({\lambda_{}}_{\ rm C}\; -\; {\lambda_{}}_{\rm P} )731 ({\phi_{}}_{\ rm D} \; -\; {\phi_{}}_{\rm P} )732 - ({\lambda_{}}_{\ rm D}\; -\; {\lambda_{}}_{\rm P} )733 ({\phi_{}}_{\ rm C} \; -\; {\phi_{}}_{\rm P} )] \; \widehat{\bf k} \\734 {{\ bf r}_{}}_{\rm PD} \times {{\bf r}_{}}_{\rm PB}735 & = & [({\lambda_{}}_{\ rm D}\; -\; {\lambda_{}}_{\rm P} )736 ({\phi_{}}_{\ rm B} \; -\; {\phi_{}}_{\rm P} )737 - ({\lambda_{}}_{\ rm B}\; -\; {\lambda_{}}_{\rm P} )738 ({\phi_{}}_{\ rm D} \; - \; {\phi_{}}_{\rm P} )] \; \widehat{\bf k} \\745 {{\mathbf r}_{}}_{\mathrm PA} \times {{\mathbf r}_{}}_{\mathrm PC} 746 & = & [({\lambda_{}}_{\mathrm A}\; -\; {\lambda_{}}_{\mathrm P} ) 747 ({\phi_{}}_{\mathrm C} \; -\; {\phi_{}}_{\mathrm P} ) 748 - ({\lambda_{}}_{\mathrm C}\; -\; {\lambda_{}}_{\mathrm P} ) 749 ({\phi_{}}_{\mathrm A} \; -\; {\phi_{}}_{\mathrm P} )] \; \widehat{\mathbf k} \\ 750 {{\mathbf r}_{}}_{\mathrm PB} \times {{\mathbf r}_{}}_{\mathrm PA} 751 & = & [({\lambda_{}}_{\mathrm B}\; -\; {\lambda_{}}_{\mathrm P} ) 752 ({\phi_{}}_{\mathrm A} \; -\; {\phi_{}}_{\mathrm P} ) 753 - ({\lambda_{}}_{\mathrm A}\; -\; {\lambda_{}}_{\mathrm P} ) 754 ({\phi_{}}_{\mathrm B} \; -\; {\phi_{}}_{\mathrm P} )] \; \widehat{\mathbf k} \\ 755 {{\mathbf r}_{}}_{\mathrm PC} \times {{\mathbf r}_{}}_{\mathrm PD} 756 & = & [({\lambda_{}}_{\mathrm C}\; -\; {\lambda_{}}_{\mathrm P} ) 757 ({\phi_{}}_{\mathrm D} \; -\; {\phi_{}}_{\mathrm P} ) 758 - ({\lambda_{}}_{\mathrm D}\; -\; {\lambda_{}}_{\mathrm P} ) 759 ({\phi_{}}_{\mathrm C} \; -\; {\phi_{}}_{\mathrm P} )] \; \widehat{\mathbf k} \\ 760 {{\mathbf r}_{}}_{\mathrm PD} \times {{\mathbf r}_{}}_{\mathrm PB} 761 & = & [({\lambda_{}}_{\mathrm D}\; -\; {\lambda_{}}_{\mathrm P} ) 762 ({\phi_{}}_{\mathrm B} \; -\; {\phi_{}}_{\mathrm P} ) 763 - ({\lambda_{}}_{\mathrm B}\; -\; {\lambda_{}}_{\mathrm P} ) 764 ({\phi_{}}_{\mathrm D} \; - \; {\phi_{}}_{\mathrm P} )] \; \widehat{\mathbf k} \\ 739 765 \end{array} 740 % \label{eq: cross}766 % \label{eq:OBS_cross} 741 767 \end{align*} 742 point in the opposite direction to the unit normal $\widehat{\ bf k}$743 (\ie that the coefficients of $\widehat{\bf k}$ are negative),744 where ${{\ bf r}_{}}_{\rm PA}$, ${{\bf r}_{}}_{\rm PB}$, etc. correspond to768 point in the opposite direction to the unit normal $\widehat{\mathbf k}$ 769 (\ie\ that the coefficients of $\widehat{\mathbf k}$ are negative), 770 where ${{\mathbf r}_{}}_{\mathrm PA}$, ${{\mathbf r}_{}}_{\mathrm PB}$, etc. correspond to 745 771 the vectors between points P and A, P and B, etc.. 746 772 The method used is similar to the method used in the \href{https://github.com/SCRIP-Project/SCRIP}{SCRIP interpolation package}. … … 750 776 be searched for on a regular grid. 751 777 For each observation position, the closest point on the regular grid of this position is computed and 752 the $i$ and $j$ ranges of this point searched to determine the precise four points surrounding the observation. 753 778 the $i$ and $j$ ranges of this point searched to determine the precise four points surrounding the observation. 779 780 %% ================================================================================================= 754 781 \subsection{Parallel aspects of horizontal interpolation} 755 782 \label{subsec:OBS_parallel} … … 757 784 For horizontal interpolation, there is the basic problem that 758 785 the observations are unevenly distributed on the globe. 759 In numerical models, it is common to divide the model grid into subgrids (or domains) where786 In \NEMO\ the model grid is divided into subgrids (or domains) where 760 787 each subgrid is executed on a single processing element with explicit message passing for 761 788 exchange of information along the domain boundaries when running on a massively parallel processor (MPP) system. 762 This approach is used by \NEMO. 763 764 For observations there is no natural distribution since the observations are not equally distributed on the globe. 789 790 For observations there is no natural distribution since the observations are not equally distributed on the globe. 765 791 Two options have been made available: 766 792 1) geographical distribution; 767 793 and 2) round-robin. 768 794 795 %% ================================================================================================= 769 796 \subsubsection{Geographical distribution of observations among processors} 770 797 771 %>>>>>>>>>>>>>>>>>>>>>>>>>>>>772 798 \begin{figure} 773 \begin{center} 774 \includegraphics[width=10cm,height=12cm,angle=-90.]{Fig_ASM_obsdist_local} 775 \caption{ 776 \protect\label{fig:obslocal} 777 Example of the distribution of observations with the geographical distribution of observational data. 778 } 779 \end{center} 799 \centering 800 \includegraphics[width=0.66\textwidth]{Fig_ASM_obsdist_local} 801 \caption[Observations with the geographical distribution]{ 802 Example of the distribution of observations with 803 the geographical distribution of observational data} 804 \label{fig:OBS_local} 780 805 \end{figure} 781 %>>>>>>>>>>>>>>>>>>>>>>>>>>>>782 806 783 807 This is the simplest option in which the observations are distributed according to 784 808 the domain of the grid-point parallelization. 785 \autoref{fig: obslocal} shows an example of the distribution of the {\em in situ} data on processors with786 a different colour for each observation on a given processor for a 4 $\times$ 2 decomposition with ORCA2. 809 \autoref{fig:OBS_local} shows an example of the distribution of the {\em in situ} data on processors with 810 a different colour for each observation on a given processor for a 4 $\times$ 2 decomposition with ORCA2. 787 811 The grid-point domain decomposition is clearly visible on the plot. 788 812 789 813 The advantage of this approach is that all information needed for horizontal interpolation is available without 790 814 any MPP communication. 791 Of course, this is under the assumption that we areonly using a $2 \times 2$ grid-point stencil for792 the interpolation (\eg bilinear interpolation).815 This is under the assumption that we are dealing with point observations and only using a $2 \times 2$ grid-point stencil for 816 the interpolation (\eg\ bilinear interpolation). 793 817 For higher order interpolation schemes this is no longer valid. 794 818 A disadvantage with the above scheme is that the number of observations on each processor can be very different. … … 796 820 this could lead to load imbalance. 797 821 822 %% ================================================================================================= 798 823 \subsubsection{Round-robin distribution of observations among processors} 799 824 800 %>>>>>>>>>>>>>>>>>>>>>>>>>>>>801 825 \begin{figure} 802 \begin{center} 803 \includegraphics[width=10cm,height=12cm,angle=-90.]{Fig_ASM_obsdist_global} 804 \caption{ 805 \protect\label{fig:obsglobal} 806 Example of the distribution of observations with the round-robin distribution of observational data. 807 } 808 \end{center} 826 \centering 827 \includegraphics[width=0.66\textwidth]{Fig_ASM_obsdist_global} 828 \caption[Observations with the round-robin distribution]{ 829 Example of the distribution of observations with 830 the round-robin distribution of observational data.} 831 \label{fig:OBS_global} 809 832 \end{figure} 810 %>>>>>>>>>>>>>>>>>>>>>>>>>>>>811 833 812 834 An alternative approach is to distribute the observations equally among processors and 813 835 use message passing in order to retrieve the stencil for interpolation. 814 836 The simplest distribution of the observations is to distribute them using a round-robin scheme. 815 \autoref{fig: obsglobal} shows the distribution of the {\em in situ} data on processors for837 \autoref{fig:OBS_global} shows the distribution of the {\em in situ} data on processors for 816 838 the round-robin distribution of observations with a different colour for each observation on a given processor for 817 a 4 $\times$ 2 decomposition with ORCA2 for the same input data as in \autoref{fig: obslocal}.839 a 4 $\times$ 2 decomposition with ORCA2 for the same input data as in \autoref{fig:OBS_local}. 818 840 The observations are now clearly randomly distributed on the globe. 819 841 In order to be able to perform horizontal interpolation in this case, 820 842 a subroutine has been developed that retrieves any grid points in the global space. 821 843 844 %% ================================================================================================= 822 845 \subsection{Vertical interpolation operator} 823 846 … … 827 850 At the bottom boundary, this is done using the land-ocean mask. 828 851 829 \newpage 830 831 % ================================================================ 832 % Offline observation operator documentation 833 % ================================================================ 852 For profile observation types we do both vertical and horizontal interpolation. \NEMO\ has a generalised vertical coordinate system this means the vertical level depths can vary with location. Therefore, it is necessary first to perform vertical interpolation of the model value to the observation depths for each of the four surrounding grid points. After this the model values, at these points, at the observation depth, are horizontally interpolated to the observation location. 834 853 835 854 %\usepackage{framed} 836 855 837 \section{Offline observation operator} 838 \label{sec:OBS_ooo} 839 856 %% ================================================================================================= 857 \section{Standalone observation operator} 858 \label{sec:OBS_sao} 859 860 %% ================================================================================================= 840 861 \subsection{Concept} 841 862 842 The obs oper maps model variables to observation space. 843 It is possible to apply this mapping without running the model. 844 The software which performs this functionality is known as the \textbf{offline obs oper}. 845 The obs oper is divided into three stages. 846 An initialisation phase, an interpolation phase and an output phase. 847 The implementation of which is outlined in the previous sections. 848 During the interpolation phase the offline obs oper populates the model arrays by 849 reading saved model fields from disk. 850 851 There are two ways of exploiting this offline capacity. 863 The observation operator maps model variables to observation space. This is normally done while the model is running, i.e. online, it is possible to apply this mapping offline without running the model with the \textbf{standalone observation operator} (SAO). The process is divided into an initialisation phase, an interpolation phase and an output phase. 864 During the interpolation phase the SAO populates the model arrays by 865 reading saved model fields from disk. The interpolation and the output phases use the same OBS code described in the preceding sections. 866 867 There are two ways of exploiting the standalone capacity. 852 868 The first is to mimic the behaviour of the online system by supplying model fields at 853 869 regular intervals between the start and the end of the run. 854 870 This approach results in a single model counterpart per observation. 855 This kind of usage produces feedback files the same file format as the online obs oper.856 The second is to take advantage of the offline setting in which857 multiple model counterparts can be calculated perobservation.871 This kind of usage produces feedback files the same file format as the online observation operator. 872 The second is to take advantage of the ability to run offline by calculating 873 multiple model counterparts for each observation. 858 874 In this case it is possible to consider all forecasts verifying at the same time. 859 By forecast, I mean any method which produces an estimate of physical reality which is not an observed value. 860 In the case of class 4 files this means forecasts, analyses, persisted analyses and 861 climatological values verifying at the same time. 862 Although the class 4 file format doesn't account for multiple ensemble members or 863 multiple experiments per observation, it is possible to include these components in the same or multiple files. 864 865 %-------------------------------------------------------------------------------------------------------- 866 % offline_oper.exe 867 %-------------------------------------------------------------------------------------------------------- 868 869 \subsection{Using the offline observation operator} 870 875 By forecast, we mean any method which produces an estimate of physical reality which is not an observed value. 876 877 % sao.exe 878 879 %% ================================================================================================= 880 \subsection{Using the standalone observation operator} 881 882 %% ================================================================================================= 871 883 \subsubsection{Building} 872 884 873 In addition to \emph{OPA\_SRC} the offline obs oper requires the inclusion of the \emph{OOO\_SRC} directory.874 \emph{ OOO\_SRC} contains a replacement \mdl{nemo} and \mdl{nemogcm} which885 In addition to \emph{OPA\_SRC} the SAO requires the inclusion of the \emph{SAO\_SRC} directory. 886 \emph{SAO\_SRC} contains a replacement \mdl{nemo} and \mdl{nemogcm} which 875 887 overwrites the resultant \textbf{nemo.exe}. 876 This is the approach taken by \emph{SAS\_SRC} and \emph{OFF\_SRC}. 877 878 %-------------------------------------------------------------------------------------------------------- 879 % Running 880 %-------------------------------------------------------------------------------------------------------- 888 Note this a similar approach to that taken by the standalone surface scheme \emph{SAS\_SRC} and the offline TOP model \emph{OFF\_SRC}. 889 890 % Running 891 %% ================================================================================================= 881 892 \subsubsection{Running} 882 893 883 The simplest way to use the executable is to edit and append the \textbf{ooo.nml} namelist to 884 a full NEMO namelist and then to run the executable as if it were nemo.exe. 885 886 \subsubsection{Quick script} 887 888 A useful Python utility to control the namelist options can be found in \textbf{OBSTOOLS/OOO}. 889 The functions which locate model fields and observation files can be manually specified. 890 The package can be installed by appropriate use of the included setup.py script. 891 892 Documentation can be auto-generated by Sphinx by running \emph{make html} in the \textbf{doc} directory. 893 894 %-------------------------------------------------------------------------------------------------------- 894 The simplest way to use the executable is to edit and append the \textbf{sao.nml} namelist to 895 a full \NEMO\ namelist and then to run the executable as if it were nemo.exe. 896 895 897 % Configuration section 896 %-------------------------------------------------------------------------------------------------------- 897 \subsection{Configuring the offline observation operator} 898 The observation files and settings understood by \textbf{namobs} have been outlined in the online obs oper section. 899 In addition there are two further namelists wich control the operation of the offline obs oper. 900 \textbf{namooo} which controls the input model fields and \textbf{namcl4} which 901 controls the production of class 4 files. 902 898 %% ================================================================================================= 899 \subsection{Configuring the standalone observation operator} 900 The observation files and settings understood by \nam{obs}{obs} have been outlined in the online observation operator section. 901 In addition is a further namelist \nam{sao}{sao} which used to set the input model fields for the SAO 902 903 %% ================================================================================================= 903 904 \subsubsection{Single field} 904 905 905 In offline mode model arrays are populated at appropriate time steps via input files.906 At present, \textbf{tsn} and \textbf{sshn} are populated by the default read routines. 906 In the SAO the model arrays are populated at appropriate time steps via input files. 907 At present, \textbf{tsn} and \textbf{sshn} are populated by the default read routines. 907 908 These routines will be expanded upon in future versions to allow the specification of any model variable. 908 909 As such, input files must be global versions of the model domain with 909 910 \textbf{votemper}, \textbf{vosaline} and optionally \textbf{sshn} present. 910 911 911 For each field read there must be an entry in the \ textbf{namooo} namelist specifying912 For each field read there must be an entry in the \nam{sao}{sao} namelist specifying 912 913 the name of the file to read and the index along the \emph{time\_counter}. 913 914 For example, to read the second time counter from a single file the namelist would be. … … 915 916 \begin{forlines} 916 917 !---------------------------------------------------------------------- 917 ! nam ooo Offline obs_oper namelist918 ! namsao Standalone obs_oper namelist 918 919 !---------------------------------------------------------------------- 919 ! ooo_files specifies the files containing the model counterpart920 ! nn_ ooo_idx specifies the time_counter index within the model file921 &nam ooo922 ooo_files = "foo.nc"923 nn_ ooo_idx = 2920 ! sao_files specifies the files containing the model counterpart 921 ! nn_sao_idx specifies the time_counter index within the model file 922 &namsao 923 sao_files = "foo.nc" 924 nn_sao_idx = 2 924 925 / 925 926 \end{forlines} 926 927 928 %% ================================================================================================= 927 929 \subsubsection{Multiple fields per run} 928 930 929 Model field iteration is controlled via \textbf{nn\_ ooo\_freq} which931 Model field iteration is controlled via \textbf{nn\_sao\_freq} which 930 932 specifies the number of model steps at which the next field gets read. 931 933 For example, if 12 hourly fields are to be interpolated in a setup where 288 steps equals 24 hours. … … 933 935 \begin{forlines} 934 936 !---------------------------------------------------------------------- 935 ! nam ooo Offline obs_oper namelist937 ! namsao Standalone obs_oper namelist 936 938 !---------------------------------------------------------------------- 937 ! ooo_files specifies the files containing the model counterpart938 ! nn_ ooo_idx specifies the time_counter index within the model file939 ! nn_ ooo_freq specifies number of time steps between read operations940 &nam ooo941 ooo_files = "foo.nc" "foo.nc"942 nn_ ooo_idx = 1 2943 nn_ ooo_freq = 144939 ! sao_files specifies the files containing the model counterpart 940 ! nn_sao_idx specifies the time_counter index within the model file 941 ! nn_sao_freq specifies number of time steps between read operations 942 &namsao 943 sao_files = "foo.nc" "foo.nc" 944 nn_sao_idx = 1 2 945 nn_sao_freq = 144 944 946 / 945 947 \end{forlines} … … 952 954 %\end{framed} 953 955 954 It is easy to see how a collection of fields taken frona number of files at different indices can be combined at956 A collection of fields taken from a number of files at different indices can be combined at 955 957 a particular frequency in time to generate a pseudo model evolution. 956 As long as all that is needed is a single model counterpart at a regular interval then 957 namooo is all that needs to be edited. 958 However, a far more interesting approach can be taken in which multiple forecasts, analyses, persisted analyses and 959 climatologies are considered against the same set of observations. 960 For this a slightly more complicated approach is needed. 961 It is referred to as \emph{Class 4} since it is the fourth metric defined by the GODAE intercomparison project. 962 963 %-------------------------------------------------------------------------------------------------------- 964 % Class 4 file section 965 %-------------------------------------------------------------------------------------------------------- 966 \subsubsection{Multiple model counterparts per observation a.k.a Class 4} 967 968 A generalisation of feedback files to allow multiple model components per observation. 969 For a single observation, as well as previous forecasts verifying at the same time 970 there are also analyses, persisted analyses and climatologies. 971 972 973 The above namelist performs two basic functions. 974 It organises the fields given in \textbf{namooo} into groups so that observations can be matched up multiple times. 975 It also controls the metadata and the output variable of the class 4 file when a write routine is called. 976 977 %\begin{framed} 978 \textbf{Note: ln\_cl4} must be set to \forcode{.true.} in \textbf{namobs} to use class 4 outputs. 979 %\end{framed} 980 981 \subsubsection{Class 4 naming convention} 982 983 The standard class 4 file naming convention is as follows. 984 985 \noindent 986 \linebreak 987 \textbf{\$\{prefix\}\_\$\{yyyymmdd\}\_\$\{sys\}\_\$\{cfg\}\_\$\{vn\}\_\$\{kind\}\_\$\{nproc\}}.nc 988 989 \noindent 990 \linebreak 991 Much of the namelist is devoted to specifying this convention. 992 The following namelist settings control the elements of the output file names. 993 Each should be specified as a single string of character data. 994 995 \begin{description} 996 \item[cl4\_prefix] 997 Prefix for class 4 files \eg class4 998 \item[cl4\_date] 999 YYYYMMDD validity date 1000 \item[cl4\_sys] 1001 The name of the class 4 model system \eg FOAM 1002 \item[cl4\_cfg] 1003 The name of the class 4 model configuration \eg orca025 1004 \item[cl4\_vn] 1005 The name of the class 4 model version \eg 12.0 1006 \end{description} 1007 1008 \noindent 1009 The kind is specified by the observation type internally to the obs oper. 1010 The processor number is specified internally in NEMO. 1011 1012 \subsubsection{Class 4 file global attributes} 1013 1014 Global attributes necessary to fulfill the class 4 file definition. 1015 These are also useful pieces of information when collaborating with external partners. 1016 1017 \begin{description} 1018 \item[cl4\_contact] 1019 Contact email for class 4 files. 1020 \item[cl4\_inst] 1021 The name of the producers institution. 1022 \item[cl4\_cfg] 1023 The name of the class 4 model configuration \eg orca025 1024 \item[cl4\_vn] 1025 The name of the class 4 model version \eg 12.0 1026 \end{description} 1027 1028 \noindent 1029 The obs\_type, creation date and validity time are specified internally to the obs oper. 1030 1031 \subsubsection{Class 4 model counterpart configuration} 1032 1033 As seen previously it is possible to perform a single sweep of the obs oper and 1034 specify a collection of model fields equally spaced along that sweep. 1035 In the class 4 case the single sweep is replaced with multiple sweeps and 1036 a certain ammount of book keeping is needed to ensure each model counterpart makes its way to 1037 the correct piece of memory in the output files. 1038 1039 \noindent 1040 \linebreak 1041 In terms of book keeping, the offline obs oper needs to know how many full sweeps need to be performed. 1042 This is specified via the \textbf{cl4\_match\_len} variable and 1043 is the total number of model counterparts per observation. 1044 For example, a 3 forecasts plus 3 persistence fields plus an analysis field would be 7 counterparts per observation. 1045 1046 \begin{forlines} 1047 cl4_match_len = 7 1048 \end{forlines} 1049 1050 Then to correctly allocate a class 4 file the forecast axis must be defined. 1051 This is controlled via \textbf{cl4\_fcst\_len}, which in out above example would be 3. 1052 1053 \begin{forlines} 1054 cl4_fcst_len = 3 1055 \end{forlines} 1056 1057 Then for each model field it is necessary to designate what class 4 variable and index along 1058 the forecast dimension the model counterpart should be stored in the output file. 1059 As well as a value for that lead time in hours, this will be useful when interpreting the data afterwards. 1060 1061 \begin{forlines} 1062 cl4_vars = "forecast" "forecast" "forecast" "persistence" "persistence" 1063 "persistence" "best_estimate" 1064 cl4_fcst_idx = 1 2 3 1 2 3 1 1065 cl4_leadtime = 12 36 60 1066 \end{forlines} 1067 1068 In terms of files and indices of fields inside each file the class 4 approach makes use of 1069 the \textbf{namooo} namelist. 1070 If our fields are in separate files with a single field per file our example inputs will be specified. 1071 1072 \begin{forlines} 1073 ooo_files = "F.1.nc" "F.2.nc" "F.3.nc" "P.1.nc" "P.2.nc" "P.3.nc" "A.1.nc" 1074 nn_ooo_idx = 1 1 1 1 1 1 1 1075 \end{forlines} 1076 1077 When we combine all of the naming conventions, global attributes and i/o instructions the class 4 namelist becomes. 1078 1079 \begin{forlines} 1080 !---------------------------------------------------------------------- 1081 ! namooo Offline obs_oper namelist 1082 !---------------------------------------------------------------------- 1083 ! ooo_files specifies the files containing the model counterpart 1084 ! nn_ooo_idx specifies the time_counter index within the model file 1085 ! nn_ooo_freq specifies number of time steps between read operations 1086 &namooo 1087 ooo_files = "F.1.nc" "F.2.nc" "F.3.nc" "P.1.nc" "P.2.nc" "P.3.nc" "A.1.nc" 1088 nn_ooo_idx = 1 1 1 1 1 1 1 1089 / 1090 !---------------------------------------------------------------------- 1091 ! namcl4 Offline obs_oper class 4 namelist 1092 !---------------------------------------------------------------------- 1093 ! 1094 ! Naming convention 1095 ! ----------------- 1096 ! cl4_prefix specifies the output file prefix 1097 ! cl4_date specifies the output file validity date 1098 ! cl4_sys specifies the model counterpart system 1099 ! cl4_cfg specifies the model counterpart configuration 1100 ! cl4_vn specifies the model counterpart version 1101 ! cl4_inst specifies the model counterpart institute 1102 ! cl4_contact specifies the file producers contact details 1103 ! 1104 ! I/O specification 1105 ! ----------------- 1106 ! cl4_vars specifies the names of the output file netcdf variable 1107 ! cl4_fcst_idx specifies output file forecast index 1108 ! cl4_fcst_len specifies forecast axis length 1109 ! cl4_match_len specifies number of unique matches per observation 1110 ! cl4_leadtime specifies the forecast axis lead time 1111 ! 1112 &namcl4 1113 cl4_match_len = 7 1114 cl4_fcst_len = 3 1115 cl4_fcst_idx = 1 2 3 1 2 3 1 1116 cl4_vars = "forecast" "forecast" "forecast" "persistence" "persistence" 1117 "persistence" "best_estimate" 1118 cl4_leadtime = 12 36 60 1119 cl4_prefix = "class4" 1120 cl4_date = "20130101" 1121 cl4_vn = "12.0" 1122 cl4_sys = "FOAM" 1123 cl4_cfg = "AMM7" 1124 cl4_contact = "example@example.com" 1125 cl4_inst = "UK Met Office" 1126 / 1127 \end{forlines} 1128 1129 \subsubsection{Climatology interpolation} 1130 1131 The climatological counterpart is generated at the start of the run by 1132 restarting the model from climatology through appropriate use of \textbf{namtsd}. 1133 To override the offline observation operator read routine and to take advantage of the restart settings, 1134 specify the first entry in \textbf{cl4\_vars} as "climatology". 1135 This will then pipe the restart from climatology into the output class 4 file. 1136 As in every other class 4 matchup the input file, input index and output index must be specified. 1137 These can be replaced with dummy data since they are not used but 1138 they must be present to cycle through the matchups correctly. 1139 1140 \subsection{Advanced usage} 1141 1142 In certain cases it may be desirable to include both multiple model fields per observation window with 1143 multiple match ups per observation. 1144 This can be achieved by specifying \textbf{nn\_ooo\_freq} as well as the class 4 settings. 1145 Care must be taken in generating the ooo\_files list such that the files are arranged into 1146 consecutive blocks of single match ups. 1147 For example, 2 forecast fields of 12 hourly data would result in 4 separate read operations but 1148 only 2 write operations, 1 per forecast. 1149 1150 \begin{forlines} 1151 ooo_files = "F1.nc" "F1.nc" "F2.nc" "F2.nc" 1152 ... 1153 cl4_fcst_idx = 1 2 1154 \end{forlines} 1155 1156 The above notation reveals the internal split between match up iterators and file iterators. 1157 This technique has not been used before so experimentation is needed before results can be trusted. 1158 1159 \newpage 1160 958 If all that is needed is a single model counterpart at a regular interval then 959 the standard SAO is all that is required. 960 However, just to note, it is possible to extend this approach by comparing multiple forecasts, analyses, persisted analyses and 961 climatologies with the same set of observations. 962 This approach is referred to as \emph{Class 4} since it is the fourth metric defined by the GODAE intercomparison project. This requires multiple runs of the SAO and running an additional utility (not currently in the \NEMO\ repository) to combine the feedback files into one class 4 file. 963 964 %% ================================================================================================= 1161 965 \section{Observation utilities} 1162 966 \label{sec:OBS_obsutils} 1163 967 1164 Some tools for viewing and processing of observation and feedback files are provided in1165 the NEMO repository for convenience.1166 These include OBSTOOLS which are a collection of \fortranprograms which are helpful to deal with feedback files.968 For convenience some tools for viewing and processing of observation and feedback files are provided in 969 the \NEMO\ repository. 970 These tools include OBSTOOLS which are a collection of \fortran\ programs which are helpful to deal with feedback files. 1167 971 They do such tasks as observation file conversion, printing of file contents, 1168 972 some basic statistical analysis of feedback files. 1169 The other tool is an IDL program called dataplot which uses a graphical interface to973 The other main tool is an IDL program called dataplot which uses a graphical interface to 1170 974 visualise observations and feedback files. 1171 975 OBSTOOLS and dataplot are described in more detail below. 1172 976 977 %% ================================================================================================= 1173 978 \subsection{Obstools} 1174 979 1175 A series of \fortran utilities is provided with NEMO called OBSTOOLS. 1176 This are helpful in handling observation files and the feedback file output from the NEMO observation operator. 1177 The utilities are as follows 1178 1179 \subsubsection{c4comb} 1180 1181 The program c4comb combines multiple class 4 files produced by individual processors in 1182 an MPI run of NEMO offline obs\_oper into a single class 4 file. 1183 The program is called in the following way: 1184 1185 1186 \footnotesize 1187 \begin{cmds} 1188 c4comb.exe outputfile inputfile1 inputfile2 ... 1189 \end{cmds} 1190 980 A series of \fortran\ utilities is provided with \NEMO\ called OBSTOOLS. 981 This are helpful in handling observation files and the feedback file output from the observation operator. A brief description of some of the utilities follows 982 983 %% ================================================================================================= 1191 984 \subsubsection{corio2fb} 1192 985 1193 986 The program corio2fb converts profile observation files from the Coriolis format to the standard feedback format. 1194 The program is called in the following way: 1195 1196 \footnotesize 987 It is called in the following way: 988 1197 989 \begin{cmds} 1198 990 corio2fb.exe outputfile inputfile1 inputfile2 ... 1199 991 \end{cmds} 1200 992 993 %% ================================================================================================= 1201 994 \subsubsection{enact2fb} 1202 995 1203 996 The program enact2fb converts profile observation files from the ENACT format to the standard feedback format. 1204 The program is called in the following way: 1205 1206 \footnotesize 997 It is called in the following way: 998 1207 999 \begin{cmds} 1208 1000 enact2fb.exe outputfile inputfile1 inputfile2 ... 1209 1001 \end{cmds} 1210 1002 1003 %% ================================================================================================= 1211 1004 \subsubsection{fbcomb} 1212 1005 1213 1006 The program fbcomb combines multiple feedback files produced by individual processors in 1214 an MPI run of NEMO into a single feedback file. 1215 The program is called in the following way: 1216 1217 \footnotesize 1007 an MPI run of \NEMO\ into a single feedback file. 1008 It is called in the following way: 1009 1218 1010 \begin{cmds} 1219 1011 fbcomb.exe outputfile inputfile1 inputfile2 ... 1220 1012 \end{cmds} 1221 1013 1014 %% ================================================================================================= 1222 1015 \subsubsection{fbmatchup} 1223 1016 1224 1017 The program fbmatchup will match observations from two feedback files. 1225 The program is called in the following way: 1226 1227 \footnotesize 1018 It is called in the following way: 1019 1228 1020 \begin{cmds} 1229 1021 fbmatchup.exe outputfile inputfile1 varname1 inputfile2 varname2 ... 1230 1022 \end{cmds} 1231 1023 1024 %% ================================================================================================= 1232 1025 \subsubsection{fbprint} 1233 1026 1234 1027 The program fbprint will print the contents of a feedback file or files to standard output. 1235 1028 Selected information can be output using optional arguments. 1236 The program is called in the following way: 1237 1238 \footnotesize 1029 It is called in the following way: 1030 1239 1031 \begin{cmds} 1240 1032 fbprint.exe [options] inputfile … … 1246 1038 -B Select observations based on QC flags 1247 1039 -u unsorted 1248 -s ID select station ID 1040 -s ID select station ID 1249 1041 -t TYPE select observation type 1250 -v NUM1-NUM2 select variable range to print by number 1042 -v NUM1-NUM2 select variable range to print by number 1251 1043 (default all) 1252 -a NUM1-NUM2 select additional variable range to print by number 1044 -a NUM1-NUM2 select additional variable range to print by number 1253 1045 (default all) 1254 -e NUM1-NUM2 select extra variable range to print by number 1046 -e NUM1-NUM2 select extra variable range to print by number 1255 1047 (default all) 1256 1048 -d output date range … … 1259 1051 \end{cmds} 1260 1052 1053 %% ================================================================================================= 1261 1054 \subsubsection{fbsel} 1262 1055 1263 1056 The program fbsel will select or subsample observations. 1264 The program is called in the following way: 1265 1266 \footnotesize 1057 It is called in the following way: 1058 1267 1059 \begin{cmds} 1268 1060 fbsel.exe <input filename> <output filename> 1269 1061 \end{cmds} 1270 1062 1063 %% ================================================================================================= 1271 1064 \subsubsection{fbstat} 1272 1065 1273 1066 The program fbstat will output summary statistics in different global areas into a number of files. 1274 The program is called in the following way: 1275 1276 \footnotesize 1067 It is called in the following way: 1068 1277 1069 \begin{cmds} 1278 1070 fbstat.exe [-nmlev] <filenames> 1279 1071 \end{cmds} 1280 1072 1073 %% ================================================================================================= 1281 1074 \subsubsection{fbthin} 1282 1075 1283 1076 The program fbthin will thin the data to 1 degree resolution. 1284 1077 The code could easily be modified to thin to a different resolution. 1285 The program is called in the following way: 1286 1287 \footnotesize 1078 It is called in the following way: 1079 1288 1080 \begin{cmds} 1289 1081 fbthin.exe inputfile outputfile 1290 1082 \end{cmds} 1291 1083 1084 %% ================================================================================================= 1292 1085 \subsubsection{sla2fb} 1293 1086 1294 1087 The program sla2fb will convert an AVISO SLA format file to feedback format. 1295 The program is called in the following way: 1296 1297 \footnotesize 1088 It is called in the following way: 1089 1298 1090 \begin{cmds} 1299 1091 sla2fb.exe [-s type] outputfile inputfile1 inputfile2 ... … … 1303 1095 \end{cmds} 1304 1096 1097 %% ================================================================================================= 1305 1098 \subsubsection{vel2fb} 1306 1099 1307 1100 The program vel2fb will convert TAO/PIRATA/RAMA currents files to feedback format. 1308 The program is called in the following way: 1309 1310 \footnotesize 1101 It is called in the following way: 1102 1311 1103 \begin{cmds} 1312 1104 vel2fb.exe outputfile inputfile1 inputfile2 ... 1313 1105 \end{cmds} 1314 1106 1107 %% ================================================================================================= 1315 1108 \subsection{Building the obstools} 1316 1109 1317 1110 To build the obstools use in the tools directory use ./maketools -n OBSTOOLS -m [ARCH]. 1318 1111 1112 %% ================================================================================================= 1319 1113 \subsection{Dataplot} 1320 1114 1321 1115 An IDL program called dataplot is included which uses a graphical interface to 1322 visualise observations and feedback files. 1116 visualise observations and feedback files. Note a similar package has recently developed in python (also called dataplot) which does some of the same things that the IDL dataplot does. Please contact the authors of the this chapter if you are interested in this. 1117 1323 1118 It is possible to zoom in, plot individual profiles and calculate some basic statistics. 1324 1119 To plot some data run IDL and then: 1325 \footnotesize 1120 1326 1121 \begin{minted}{idl} 1327 1122 IDL> dataplot, "filename" … … 1331 1126 for example multiple feedback files from different processors or from different days, 1332 1127 the easiest method is to use the spawn command to generate a list of files which can then be passed to dataplot. 1333 \footnotesize 1128 1334 1129 \begin{minted}{idl} 1335 1130 IDL> spawn, 'ls profb*.nc', files … … 1337 1132 \end{minted} 1338 1133 1339 \autoref{fig: obsdataplotmain} shows the main window which is launched when dataplot starts.1134 \autoref{fig:OBS_dataplotmain} shows the main window which is launched when dataplot starts. 1340 1135 This is split into three parts. 1341 1136 At the top there is a menu bar which contains a variety of drop down menus. … … 1350 1145 The plotting colour range can be changed by clicking on the colour bar. 1351 1146 The title of the plot gives some basic information about the date range and depth range shown, 1352 the extreme values, and the mean and rmsvalues.1147 the extreme values, and the mean and RMS values. 1353 1148 It is possible to zoom in using a drag-box. 1354 1149 You may also zoom in or out using the mouse wheel. … … 1362 1157 observation minus background value. 1363 1158 The next group of radio buttons selects the map projection. 1364 This can either be regular l atitude longitude grid, or north or south polar stereographic.1159 This can either be regular longitude latitude grid, or north or south polar stereographic. 1365 1160 The next group of radio buttons will plot bad observations, switch to salinity and 1366 1161 plot density for profile observations. 1367 1162 The rightmost group of buttons will print the plot window as a postscript, save it as png, or exit from dataplot. 1368 1163 1369 %>>>>>>>>>>>>>>>>>>>>>>>>>>>>1370 1164 \begin{figure} 1371 \begin{center} 1372 % \includegraphics[width=10cm,height=12cm,angle=-90.]{Fig_OBS_dataplot_main} 1373 \includegraphics[width=9cm,angle=-90.]{Fig_OBS_dataplot_main} 1374 \caption{ 1375 \protect\label{fig:obsdataplotmain} 1376 Main window of dataplot. 1377 } 1378 \end{center} 1165 \centering 1166 \includegraphics[width=0.66\textwidth]{Fig_OBS_dataplot_main} 1167 \caption{Main window of dataplot} 1168 \label{fig:OBS_dataplotmain} 1379 1169 \end{figure} 1380 %>>>>>>>>>>>>>>>>>>>>>>>>>>>>1381 1170 1382 1171 If a profile point is clicked with the mouse button a plot of the observation and background values as 1383 a function of depth (\autoref{fig:obsdataplotprofile}). 1384 1385 %>>>>>>>>>>>>>>>>>>>>>>>>>>>> 1172 a function of depth (\autoref{fig:OBS_dataplotprofile}). 1173 1386 1174 \begin{figure} 1387 \begin{center} 1388 % \includegraphics[width=10cm,height=12cm,angle=-90.]{Fig_OBS_dataplot_prof} 1389 \includegraphics[width=7cm,angle=-90.]{Fig_OBS_dataplot_prof} 1390 \caption{ 1391 \protect\label{fig:obsdataplotprofile} 1392 Profile plot from dataplot produced by right clicking on a point in the main window. 1393 } 1394 \end{center} 1175 \centering 1176 \includegraphics[width=0.66\textwidth]{Fig_OBS_dataplot_prof} 1177 \caption[Profile plot from dataplot]{ 1178 Profile plot from dataplot produced by right clicking on a point in the main window} 1179 \label{fig:OBS_dataplotprofile} 1395 1180 \end{figure} 1396 %>>>>>>>>>>>>>>>>>>>>>>>>>>>> 1397 1398 \biblio 1399 1400 \pindex 1181 1182 \onlyinsubfile{\input{../../global/epilogue}} 1401 1183 1402 1184 \end{document}
Note: See TracChangeset
for help on using the changeset viewer.