Home

Diva User Guide - Mediterranean Oceanic Data Base (MODB)

image

Contents

1. aooaa 35 4 5 Integrals over sub domains nooo 2 00 eee eee eee 38 Additional constraints and detrending 43 5 1 Adding advection to the cost function o ooo 2000008 43 5 2 Adding linear sink s and local source s ooo o 0008 e 47 5 3 Detrending data by defining groups and classes 49 I 6 10 11 2 D implementation Scripts input files and directories GL LRO EDERE es ee A oe SR me St He De Bt Bt 62 Inpotfiles 22652 e bag ee pu k eee ee eRe SR EER ESE EERE 6 3 Working directories 2 D analysis o oaoa a a ee Preparation of the input files 74 Creationof topography gt oes ova creses Des Eora ee Bee Bee Bes T2 Creation OO Se eee OSS EE EER OER O SE ES 7 3 Determination of analysis parameters 000 TA NC ewes eb be bb eh SESH ESE EDGES Se 4M GSR ESH SS Running analysis 8 1 Running a simple analysis 26k hed eo ag eS a 85 2 Quality control of data gt lt sa os ses agdscdeedasaduethe ede 8 3 Running a semi normed analysis o oo 200 0000 ee O ER e e a BH ee we eh HRD aOR Sa La Be Dee Ee 8 5 Analysis with advection constraint activated 204 8 6 Summary typical execution chains 2 2 44 42442 ee bee ee es Postprocessing tools SA AR oe hoe ke Se ee ee ee ee ee oe ee eS ga BGR ey oS ahh ed SE hb gh a ee a a Y3 DUIS 6 2 4 EA ee Oe Re Be we 2 eS ee e OA NEOVIOW 222 che bbe cde bean eee edee du sda dest bbs ees Realistic examples 10 1 Compl
2. SESE ESE ES ESE SS EEEE EELEE EEEE EE CALL TO SOLVER MODULE IPR 1 CSS SSS SSS SSS SSSss into solver 1 Dynamic reallocation Might cause crash if not enough memory left Momentarely doubles memory needed ERROR ALLODY STORAGE OF tuppe REQUIRED SPACE18586724 AVAILABLE SPACE 15000000 Output of results for user fort 84 output fieldgher anl fort 82 output valatxyascii anl fort 83 Zoutput fieldascii anl fort 87 _ output errorf ie ldgher anl fort 86 gt output errorfieldascii anl icp cannot stat fort 71 No such file or directory Figure A 9 Error message due to allocation problem A 2 8 Error of allocation Why do I get this error The memory allocation is not sufficient for the Diva to be executed in the case you consider This message may appear either during the mesh generation the required mesh is too fine considering the size of the domain or during the resolution itself i e divacalc How to solve it The solution is nearly the same as the previous case you need to compile the source again this time after increasing the values of nrea and nent Additional information gt x In some uncommon cases you may not be able to find values of nrea and nent that will allow you to avoid both problems A 2 7 and A 2 8 In these cases the recommended solution consists of 1 Find the highest values of nrea and nent that a
3. observations oc anographiques par le Mod le Variationnel Inverse M thodologie et Applications Ph D thesis University of Li ge Brasseur P Beckers J M Brankart J M amp Schoenauen R 1996 Seasonal temperature and salinity fields in the Mediterranean Sea Climatological analyses of a historical data set Deep Sea Research I 43 2 159 192 doi 10 1016 0967 0637 96 00012 X URL http www sciencedirect com science article pii 096706379600012X Brasseur P amp Haus J 1991 Application of a 3 D variational inverse model to the analysis of ecohydrodynamic data in the Northern Bering and Southern Chukchi Seas Journal of Marine Systems 1 383 401 doi 10 1016 0924 7963 91 90006 G Brasseur P P 1991 A variational inverse method for the reconstruction of general circulation fields in the northern Bering Sea Journal of Geophysical Research 96 C3 4891 4907 doi 10 1029 90JC02387 URL http www agu org pubs crossref 199 1 90JC02387 shtml Bretherton F P Davis R E amp Fandry C 1976 A technique for objective analysis and design of oceanographic instruments applied to MODE 73 Deep Sea Research 23 559 582 doi 10 1016 001 1 7471 76 90001 2 Chiles J P amp Delfiner P 1999 Geostatistics Modeling spatial uncertainty Wiley Interscience Ist edn 720 pp ISBN 0 471 08315 1 Craven P amp Wahba G 1978 Smoothing noisy data with spline functions Numerische Mathematik 31 4 377
4. text xba4 gt undefined reference to nf_put_att_text_ ic DOCUME 1 Char les LOCALS 1 Temp ccK1L353 o netcdfout puterror f text xbcd gt undefined reference to nf_put_att_text_ ic DOCUME 1 Charles LOCALS 1 Temp ccK1L353 o netcdfoutputerror f text xbf8 gt undefined reference to nf_put_att_real_ ic DOCUME 1 Char les LOCALS 1 Temp ccK1L353 o netcdfout puterror f text xc23 gt undefined reference to nf_put_att_real_ ic DOCUME 1 Char les LOCALS 1 Temp ccK1L353 o netcdfout puterror f text xc3a gt undefined reference to nf_enddef_ ic DOCUME 1 Char les LOCALS 1 Temp ccK1L353 o0 netcdfout puterror f text xc56 gt Figure A 7 Error message during execution of di vacomp with gfortran 163 If this is not sufficient you will have to rebuild the NetCDF library corresponding to your operating system Installation and compilation procedures can be at http www unidata ucar edu software netcdf docs netcdf install A 2 7 Resource temporarily unavailable cygdrive d DIVA diva 4 2 1 divastripped WARBAK To calculate data weights using Length scale SNR xi 699999988 1600 1 Data 3 columns hence without relative weights divacalc line 327 bin diva a Resource temporarily unavailable Wutput of results for user cannot stat fort 84 No such file or directory cannot stat fort 83 No such file or di
5. 4 6 In an infinite domain the error calculation is then exact while for more complicated domains it is nearly exact far away from boundaries provided no anisotropic constraint advection con straint variable length scale boundaries is activated Thus for anisotropic cases the hybrid error field can provide incoherent results This is what motivated the evaluation of the real covariance function in Diva 4 2 3 The real covariance method If we look back at the OI interpretation we can place a data of value 1 at location r and compute the analysis yi r at a location r Ha B r r Ol Ban TRO 4 7 where Ber r is the non dimensional covariance function between points r and r whereas R is the normalized observational error variance Normalization was done respectively by the background variance o and noise yielding the signal to noise ratio previously defined At the data location itself we get the analysis _ B r r 4 8 AB r r Rr yi r In terms of interpretation of the covariance function as the kernel of the norm 2 11 it is the background covariance that is modified by the anisotropy and not the noise level Hence if we put the unit data value with a unit signal to noise ratio in r we directly have Blr r Bi r r ao 2 aa waa Bi r r 1 Bi r r 1 The left hand sides are provided by the Diva application to the unit data point in location r with unit si
6. 403 doi 10 1007 BF01404567 Cressman G P 1959 An operational objective analysis system Monthly Weather Review 87 10 367 374 doi 10 1175 1520 0493 1959 087 lt 0367 AOOAS gt 2 0 CO 2 Delhomme J 1978 Kriging in the hydrosciences Advances in Water Resources 1 5 251 266 doi 10 1016 0309 1708 78 90039 8 Denis Karafistan A Martin J M Minas H Brasseur P Nihoul J amp Denis C 1998 Space and seasonal distributions of nitrates in the mediterranean sea derived from a vari ational inverse model Deep Sea Research I 45 2 3 387 408 doi 10 1016 S0967 0637 97 00089 7 URL http www sciencedirect com science article pii S0967063797000897 Franke R 1985 Thin plate splines with tension Computer Aided Geometric Design 2 1 3 87 95 doi 10 1016 0167 8396 85 90011 1 Gandin L S 1965 Objective analysis of meteorological fields Tech rep Israel Program for Scientific Translations Jerusalem 191 Girard D 1989 A fast Monte Carlo cross validation procedure for large least squares prob lems with noisy data Numerische Mathematik 56 1 1 23 doi 10 1007 BF01395775 Gomis D Ruiz S amp Pedder M 2001 Diagnostic analysis of the 3D ageostrophic circulation from a multivariate spatial interpolation of CTD and ADCP data Deep Sea Research 48 1 269 295 doi 10 1016 S0967 0637 00 00060 1 Hartman L amp H ssjer O 2008 Fast kriging of large data sets with Gaussian Marko
7. A iM x x rad RE A 80 RRRS RAZ ZN Pee ABBR EEEORYOS KIA ERY LAK E A E AAIE DRC ETER EENS KERKEE ae pO S 70 lt 3 iS P YK Vas R ra A x K y F VF S 60 LE G p WAZ Lh VAN Figure 8 1 Mesh on a simple domain AA lt Z 50 S II K TAVA 5 SEES ERY LER Le Z AN X TAVA T Be eu YAVAN i VAN SAA BRR ER BERG K RORE KA d me i Ks Ny 0 3 R K X B D ES v KK wane AA DA KR AS IS evar A x DS sy eS VAVA VA ve KR S BX VAV od ws AISA cP i AKI TRA X ERE KESIN VAV SEO CORK TORRES DSSS BRAD E SOE RA 40 NZ A S S ie gt G E CK Ssh i av Wal OS VAVA ae KK SAO VY oN o VAVA VANNA ARTAN 60 80 100 Note that since version Diva 4 3 mesh generation takes into account coordinate change speci fied by icoord so that meshes are uniform in the transformed domain Mesh with different element sizes You also have the possibility to create of mesh of which the size of the elements varies over the domain To this aim you have to create a mesh density file that indicates what length scale has to be applied in a determined region This file is named coast cont dens and has to be placed in divastripped input We considered the simple island case of which the contour file given by We choose a val
8. demand 4 4 Comparison between the methods For this application we employ the same data as in Section 10 1 salinity measurements in the Mediterranean Sea at a depth of 30 m in July for the 1980 1990 period Here the error is scaled locally by the local variance of the background field B yielding relative errors The OI field Fig 4 2a shows the effect of the data coverage on the error magnitude The rela tive error lies between 40 and 60 around the regions with a sufficient amount of observations The largest values gt 80 occur along the south coasts of the Mediterranean Sea where al most no data are available for the considered period This means that the analysis obtained in these areas cannot be taken with much confidence 35 The poor man s estimate Fig 4 2b provides an error field with lower values over the whole domain Where data are available the error is below 20 whereas the 80 100 error region is limited to a small zone close to the coast of Libya The hybrid method was build by analogy with the OI error estimate Brankart amp Brasseur 1998 Thus it is expected that the two methods provide comparable results Indeed the error field of Figs 4 2 a and c exhibit a similar spatial distribution Some discrepancies appear in certain regions along the Italian coasts on both side of the Peninsula in the Alboran Sea and around Cyprus These differences are related to the presence of the coasts 1 As w
9. f Dirichlet boundary conditions to be fixed constr f input of information for constraint implementation solver f builds and solves the global linear finite element system stores f storage of the solution esterr f estimates the analysis error same grid as the analysis coord f coordinate change longitude latitude to x y and x y to longitude latitude if requested gcvfac f estimates the analysis error by generalized cross validation dataqc f data quality check estimates of expected data analysis differences covar f calculation of Diva kernel for subsequent error fields Other routines related to Diva calculation allody f dynamical allocation of storage area in S or L vector bilinin interpolates from a regular field into zt yt called in constr finca f finds in which region is one point optimi f subroutines used for the optimisation divesp f subdivides the space for optimisation sizes2 f computes the size of the space for elements of type 2 sizes3 f computes the size of the space for elements of type 3 repel2 f distributes the elements of type 2 in kntc table repe13 f distributes the elements of type 2 in kntc table locpt2opti f locates the x y point in the structure for ityp 2 locpt3opti f locates the x y point in the structure for ityp 3 175 sortdopti f sorts the data according to the sequence of elements qs2ilr f quick Sort
10. field specified through the following files e Uvel dat and Vvel dat which contain the two components of the velocity They have the same format binary as fie ldgher anl An example of generation of such files is in the test case advectiontest e UVinfo dat which specifies the grid on which the velocity field is defined It has the same format as GridInfo dat or TopoInfo dat e constraint dat which activates the advection constraint and contains parameters 0 and A Refer to Chapter 5 for theoretical details Spore 3 4 0 100000001 0 100000001 61 61 Example file 8 3 UVinfo dat 100 0 0 Example file 8 4 constraint dat 85 8 5 1 Interplay with coordinate change on In this example we work on a region 1 1 x 59 61 with L 0 2 and 1 With no coordinate change i e icoordchange 0 in param par coordinates are taken as such and a single point in the center leads to an analysis that is circular when axes on x and y are drawn with equal scales Fig 8 4 Analysis and Mesh Figure 8 4 Analysis without coordinate change On the other hand if coordinate change is on 1 e icoordchange 1 in param par the analysis is isotropic in the real space At 60 North a degree E W covers half the real distance of a degree S N On a graph scaled so that x and y are distances the analysis is again isotropic this is the desired effect If you plot the same analysis with x and y axes
11. i 4TA 3 31 To be coherent with the total noise we should in principle use relative weights the optional fourth column for data in Diva on the data that satisfy 3 22 Hence defining w as 1 1 1 3 32 gt 3 32 the weights w w w are relative weights coherent with the noise In this case we can use 3 21 for the estimator In practice in Diva the relative weights can be retrieved by w u i where the average is a harmonic mean The minimisation and the optimum for A are the same even if the weights provided by the user do not satisfy the condition 3 22 However the interpretation of and o might be different Three scripts are available for the QC divaqc the most expensive version of QC based on criterion 3 24 divaqcbis a quicker version based on criterion 3 25 divagcter based on the RMS value of the misfit and the generalized cross validator according to criterion 3 26 Diva GCV practicals In Diva the matrix A is not explicitly constructed but the product Ax consists simply in the application of the analysis in data locations 27 The value of trace A can be evaluated and stored for subsequent quality control by 3 25 and 3 26 For quality control 3 24 A must be evaluated by an analysis of the pseudo data vector e zeros everywhere except unit value at point 7 The analysis can benefit from the LU decomposition already performed for previous analy
12. ooa ca e a Sheed ed ee oe bE aA ba eae 57 6 1 5 Quality control anderrorfield 0 4 57 GLO MEG e ons ee Ee Ee BO ee ee be hee ee EO 58 G2 TDW TNES oo ke ce ee ea ee bw ewe ee we ee 58 S28 VON o boa kc keke ee eb ded bh hha ee ee ease 58 Rie Tle oe ped Bit 2 Sass ees ee es ae ale en 59 G23 Pramea 664 5 oe bk Ee ee ee es Oa Re da 60 6 2 4 Additional points of analysis 2 44 63 6 3 Working directories 2 D analysis 1 1 ee eee eee we ews 63 55 Convention Diva works with decimal numbers represented with not Tips 6 1 Use unix command sed to replace by charles gherl3 Software cat filel dat sed s g gt file2 dat where filel dat is the old file and file2 dat is the file where the replacement has been made m Tips 6 2 Use editor vito replace by Simply type charles gherl3 Software S vi filel dat S8 g 6 1 List of 2 D tools 6 1 1 Operations on data divaanom computes the difference between the data and the provided reference field divadataclean eliminates all data that fall outside the bounding box of the contours divadatacoverage 6 1 2 Parameter estimation divabestguess provides estimates for the correlation length and the signal to noise ratio with methods chosen according to the number of data divacv performs ordinary cross validation divacvclasses performs ordinary cross validation by setting aside all dat
13. total number of vertex nodes red dots 2 total number of interfaces black lines 3 total number of elements green triangles 00 Example file B 3 fort 23 B 2 2 Diva interpolation diva a Files read as input fort 10 divawork organizer defining which modules to use and how including several parameters fort 11 finite element mesh copy of the fort 22 produced by generopt a fort 12 ap and ay calculated as 1 a 77 and a 181 fort 13 characteristics of the regular output grid fort 20 data file 4 columns X Y data X Y u where ANF with the signal to noise ratio fort 79 coordinates where analysed field values are requested 2 columns separated by space X Y fort 15 parameter varbak variance of the background field set as 0 will avoid calcu lating error field coord 1 0 mathpr 1 2 gt ITYP 0 gt ISYM 2 gt IPB topolo 1 158 gt Number of Vertex Nodes 426 gt Number of Interface Nodes 268 gt Number of Elements datapr 1 1 solver 1 0 stores 1 1 gt 1 if normal or semi normed final otherwise 3 esterr 1 stopex Example file B 4 fort 10 0 0001 gt alpha0 0 02 gt alphal Example file B 5 fort 12 0 0 gt xorigin yorigin 1 1 gt dx dy 100 100 gt nx ny 99999 gt Exclusion Value Example file B 6 fort 13 182 90 90 1 12 5
14. will load the files from DIVA test input Tips 7 4 When you want to know to which correspond the data present in the input directory simply read the content of the file input casename it indicates the repertory from which you loaded input files with command divaload m 7 4 4 divacck divacck checks your initial contour file output coast cont In output output coast cont checked you will find a thinned contour based on the length scale where the possible couples of identical points are eliminated Application of divacck is normally not necessary if you created the contours with divacont 78 8 RUNNING ANALYSIS Once all the input files are prepared you are ready to create analysed gridded fields The whole procedure is described in the present chapter Contents 8 1 Running a simple analysis 2 0 e eee reer eee 79 SLI divadr sS sasaa aana ke a ne E rn ae aa 79 L2 diIvVaneSh saa et ad ea RO ees ha we A ee a d 80 Ar O see ed ee hoe eA E we he de 82 8 2 Quality control of data 2 eee eee ee ee ee ee ee 83 pal TOO 6k bee e be eee eb oe bd bbb eed eee eed 83 Se COPIES o o e a eee he eee be ee aS 83 8 3 Running a semi normed analysis 0 0 0 eee eee e neues 83 S31 GivVarefe cacak daa cane Gaeta ha eee Sed ada d 84 Gudea WGA AMON 2 oc ceo aos ns SS We nd i Wis E Ws a So eH ae 84 Sid HUIVECEIS soe oh eee ee ee ee ee aa 84 emer CUES MI te ee tes ote eee ie a pra sae Rar Mae a
15. 1 Installation under Linux Recent Linux distribution already permits the installation of Ncview through their package man ager Should it not be the case the last version of Ncview is available here ftp cirrus ucsd edu pub neview ncview 2 1 2 tar gz 9 4 2 Installation under Windows Cygwin Install and build the last NetCDF version for Unix download the latest release and build as with Unix The latest release is tested under Cygwin and passes all tests cleanly To build under Cygwin follow the Unix build instructions in a Cygwin shell The enable shared option to configure will generate the net cdf dll e Copy http www unidata ucar edu downloads netcdf netcdf 3_6_2 index jsp into directory of your choice e Unzip the folder and type charles gherl3 Software configure make check make install e download Ncview and unzip the folder e type charles gherl3 Software configure make make install e type startx check if you have installed Xf ree and in the newly opened window type ncview name_of_the file nc e if the procedure is correctly followed you should obtain windows similar to Fig 9 6 100 Neview 1 93 DAR cygdrive d DIVA ClimatoAtlantic results winter 11 output BAE Neview 1 93c David W Pierce 22 August 2006 input output results ne variable analyzed_field Charles charles cygdrive d DIVA C imatoAtlantic results winter 11 No scan axis ed output displaye
16. 17 Latitude N B a N Latitude 3 5 5 Longitude Analysis 10 15 20 25 33 35 Longitude E Velocity m s 3 2 Al 0 4 2 3 118 4 3 5 3 25 2 1 5 1 0 5 Figure 10 16 Velocity field used for the advection constraint in the Mediter ranean Sea Figure 10 17 Diva with advection on full grid no direct topography but indi rect via advection Chapter 10 REALISTIC EXAMPLES 10 4 Advection constraint Analysis Figure 10 18 Diva with topography and E advection iy 10 is 20 25 33 35 Longitude E 119 11 OTHER IMPLEMENTATIONS In addition to the usual way of working with Diva i e command line there are other possi bilities to use it without the installation of the whole code Contents 11 1 DNB web ooe 6 NRO KE SORE SS 121 ILLI Diplemenianoa s s o eoe ee ee ee ee He Da ee 121 11 1 2 Acomplet example o ea ee ee Se ee a E 121 11 3 Conditions OF 086 o o coca baw bade a kd Haw Garda OAs 123 11 2 Ocean Data View os ooo ee ee ee ww ew we ww ee we ww ens 124 11 3 Matlab toolbox 6 ee tw ww we ww ee we ww ens 124 IESi anO 6 ke ae GR ew Ee ee Ree eS 124 Iaa en a a aE a e a aeaa Se ee E 125 120 11 1 Diva on web The idea behind Diva on web is to provide the possibility for the users to perform interpolations with Diva without having to install it on their machine The web interface suits to a sing
17. 200 eee eee eee 134 12 3 1 Coast contour files generation 2 2 26 64 she ee ge tae 134 12 3 2 Data sets cleanin co se eana i aleme ee ee 135 12 3 3 Parameters optimisation lt a esoe e ee 135 12 4 Performing 3D analyses diva3Ddress eee0 136 12 4 1 A simple analysis input files o o eeraa cuero 136 12 4 2 Diva SD analysis outputs ec ee eh OE SER eee 138 12 1 Input subdirectories As described before to perform a 2D analysis one needs to provide a set of input files in the DI VA3D divastripped input subdirectory For 3D analysis the input files are provided in subdirectories of the input directory and in the input directory 12 1 1 divadata subdirectory In DI VA3D divastripped input divadata all the horizontal 2D data sets to be analysed are provided and named with regard to the variable name and the depth level num ber 127 Convention The files should be named as var l1vxxax where e var is for variable name e xxxzx is the level number and must be within the range 0001 9999 Levels must be numbered from the bottom lowest xxxx to the top level highest LLELLE In this subdirectory data density files related to data set files are stored var lrzrrr DATABINS and var lrrrr DATABINSinfo Tips 12 1 Density files are automatically generated when performing an analysis m 12 1 2 divaparam subdirectory
18. EEK na A Zz f 30 N 24 N MN 0 C oc at 10 W 0 10 E 20 E 30 E Longitude Longitude a Data b Mesh 55 48 N Latitude 8 2 w 2 2 30 N 24 N 10 E 20 E 10 W 0 10 E 20 30 E Longitude Longitude c Analysis d Outliers y Figure 9 4 Examples of figures created with Matlab 9 3 NcBrowse Diva provides analyse and error fields under the NetCDF network Common Data Form format It is an machine independent format to represent scientific data For more details please consult http www unidata ucar edu software netcdf NcBrowse Linux and Windows is available at http www epic noaa gov java ncBrowse 98 data from analysed_field nc Domain Selector float dataty x valid_min 10 0 float valid_max 0 0 float Select Variable for Display a Variable x y Reverse or E wo EJ Dependent analysed_field nc E p fs i l wo oO oO a gt 40 60 x Degrees_east 1 00 1 20 1 40 1 60 1 80 2 data y Figure 9 5 Plots of results with NcBrowse 99 9 4 Neview Neview Linux and Windows Cygwin is available at http meteora ucsd edu pierce ncview_home_page html but requires the NetCDF library to be compiled with your own system configuration 9 4
19. In DIVA3D divastripped input divaparam are placed the param par and coast cont files as well as all other input files related to Diva parametrisation The coast cont files are named following the corresponding level depth number param par files can be named following the corresponding variable name and the level depth number or only the level depth number Convention The files should be named as coast cont lxrxrrz e param par orparam par lxrre or param par var lrrrer xxx is the level number and must be within the range 0001 9999 Levels must be numbered from the bottom lowest xxx to the top level highest xxx input divaparam content description It may contain the following files coast cont l rrer param par param par var lervxr RL var lxerre RLinfo dat RL dat CLminmax SNminmax valatxy coord 3Dconstraint coast cont 1lrxrz files corresponding to the horizontal levels as described in 6 2 1 can be automatically generated by Diva see Section 12 3 128 param par var 1lxxxx files corresponding to the considered variable and horizontal levels as described in 6 2 3 with optimised correlation length L signal to noise ratio A and variance of the background V ARBAK parameters can be automatically generated by Diva from a generic param par file placed in DIVA3D divastripped input see Section 12 3 RL var lxvvxrx files and the related info file RLinfo dat can be
20. Nj fiz Nj NF N By 5 18 This regularisation between layers is not yet implemented Either done at 3 D level or simply allow iterative 3 D filtering as now but with weights 8 as described here 5 3 4 Use Simply provide input data dat with additional fifth sixth columns If you do not want to use variable data weight column 4 must contain the value of 1 Column 5 6 contain the information in which class the data point falls Classes must be numbered starting with 1 Example e Column 5 contains value 1 for a data point of the year 1975 2 for 1976 3 for 1977 and so on e Column 6 contains for a data corresponding to month 01 03 2 for the month 04 06 and so on e Column 7 contains 1 for day values 2 for night values e Column 8 contains 1 for points that have a density below 1025 kg m 2 for points that have a density above it Execute divadetrend ngroups niterations The parameter ngroups specifies that the first ngroups will be used for the detrending You might create for exemple 5 groups and try with detrending on the first one only using divadet rend 1 The optional parameter niterations tells how many iterations are to be performed for the detrending Default value is 10 iterations Outputs output rmsmisfit dat contains the evolution during the iterations of the misfit after detrending It should decrease if the detrending works well trends all 1 dat deals with group and contains
21. Quality of the fit 0 bad 1 good 0 85546345970344528 For information correlation length in km is 151 44691 Example file 10 2 paramfit dat The fit yields the value L 1 36 151 km 0 075 data covariance e data used for fitting mim fitted curve o 0 05 O 1 Cc amp o gt fo oO 0 025 0 100 200 300 Distance km Figure 10 2 Fit of the data correlation to the theoretical kernel dashed line 10 1 3 Contour checking optional If you want to check the contour file you want to use to generate the mesh type divacck The output coast cont checked is a thinned contour based on the length scale Then simply copy the new contour into the input directory bash 3 2S cp output coast cont checked input contour cont 10 1 4 Mesh creation Simply type di vamesh to perform the mesh generation All the parameters needed by Diva are contained in coast cont param par and coast cont dens if you work with a non uniform mesh The mesh corresponding to this example is shown in Fig 10 1 For the sake of visibility the mesh was generated with a rather long characteristic scale the correlation length was set to 3 meaning the typical length of triangle edge is about 1 106 10 1 5 Generalised Cross Validation GCV provides you with improved estimates of parameters see Chapter 3 for a detailed de scription of the method You need to provide an input file gvcsampli
22. additional second term in which we recognize a stationary advection diffusion equation The physical meaning of the term u Vo is simple when the velocity is nearly parallel to the gradient the product has a large value and is thus penalized Then for a strong constraint 9 gt gt 1 we enforce the analysis to align with velocity 43 In general we can assume A lt UL in other words we work at relatively high Reynolds num bers Otherwise for dominant diffusion the term just adds another isotropic filtering effect already included in the regularization term Eq 2 11 Hence the additional term is really in teresting only for situations dominated by advection with A lt UL In this case the scaling is such that for 0 1 the advection constraint has a similar importance with respect to the regularization term The velocity scale U is calculated from the provided u u v field Note that when using the advection constraint the correlation length provided by divafit should be decreased since the advection constraint implicitly increases correlation length along currents The solution is expanded in terms of so called connector values typically values at the nodes of a finite element mesh and in the present case also normal derivatives to interfaces and shape functions over each element Section 2 3 2 This allows the computation of the solution at any desired location knowing the connector values The connector values
23. algorithm for sort dopti from www netlib org calpsoopt i computes pseudo data sets for error estimates fcorropti f partof calpsoopti tabess f tabulates the Bessel function for the calculation of error repeltest f calledin datapr f shapef f evaluation of the shape functions at Gauss points utilit utility routines uur f for the advection constraint uwrit2 f writes the field C I J K varl f for variable correlation length vtools f various subroutines intsec calculate center coordinates of quadrangular element istria check if one point lies inside a triangle prskyh print a vector to check B 1 2 Mesh programs src Fortran Mesh Files related to the generation of coastlines contourcheck f check the format of an existing contour file no repeated points no crossing contour not too fine contourgen f create contours based on topography coa2cont f gofromODV coa files see documentation of ODV to Diva coast cont files using a resolution comparable to the specified gridded output of divacalc Files related to mesh generation generopt f generate a multi connex 2D mesh with the Delaunay triangulation generopt4 f same as generopt but in real 4 precision generopt8 f same as generopt but in real 8 precision 176 B 1 3 Pipetest src Fortran Pipetest File piperw f checks if pipes are supported by your Diva installation Pipes support is auto matically tested wh
24. assured by identification of adjacent connectors Pelre qe s re 2 19 with q the connectors our new unknowns Ye the position in a local coordinate system Substituting 2 19 in 2 18 and using the variational principle 2 10 we get Nae Je de qe Keqe m 2qe ge F Hidi 2 20 i 1 where K is the local stiffness matrix and g is a vector which depends on local data Matrix K is decomposed into a norm related term and a data related term On the whole domain 2 20 reads Na J q q Kq 2qe ge X midi 2 21 i 1 of which the minimum is reached when q K g 2 22 Matrix K has a size approximatively proportional to the number of degrees of freedom of the system but can be very sparse if the elements are properly sorted In that case the number of 15 operations to invert it is approximatively proportional to the power 5 2 of the number of degrees of freedom To map the data on the finite element mesh a transfer operator T2 depending on the shape functions is applied s Ta r d and to have the solution at any location inside the domain another transfer T is applied g r Ti r a Combining the two previous equations we obtain the relation between y the interpolated field at location r and the data vector d y Ti r K T2 r d 2 23 2 3 3 Kernel and correlation function Kernel functions can be examined by analysing a single point with high signal to noise ratio and no backgrou
25. be unit the surface dimension can be retrieved at the end by global multiplication Note that the weights here have nothing to do with the weight on data points for an analysis Now the analysis is not exact but has an associated random error e with respect to the true field values x coax He 4 20 On statistical average noted lt gt we suppose the analysis is unbiased and lt x gt x 4 21 In order to calculate the error variance on the sum we calculate the expected square distance with respect to the true sum A lt h x x x x h gt h P h 4 22 where P lt e e gt is the error covariance matrix of the analysis We see that the spatial covariances of the analysis error field are required to calculate the error variance on J Since this covariance matrix is not diagonal it is not sufficient to sum up the local error values of the error fields of x The latter sum would limit the double sum of 4 22 to the diagonal terms of pr 38 4 5 2 Implementation Exploiting the equivalence of Diva and OI we know that P P C B R C 4 23 where P is the covariance matrix size Ng x N of the background field between the N grid points under consideration B the covariance matrix size Ng x Na of the background field between the Ny data points C is the covariance matrix size Na x N of the background field between the data points and grid points and finally R is the error covariance
26. diagonal matrix we can define weights w such that 2 2 1 a ae 3 20 Wi A Wi Defining the diagonal matrix W diag w the generalized cross validator then reads ANT 3 a a w a a o 5 3 21 N 1 trace A where the weights should according to 3 7 satisfy 1 X N 3 22 Wi a The w are the values provided as optional fourth column in data dat divacv uses cross validation with complete calculation of A whereas divagcv uses the approximation A N trace A 3 3 Quality control of data Having defined the generalized cross validator we look for a criterion that will allow the user to reject or accept a given data Note that this QC is performed based on the analysis itself and shall be preceded by an a priori QC on the data e g range of values gradients etc 25 3 3 1 Quality criteria The first possibility is to compare the actual value of the misfit with the expected standard we deviation a di leading to the criterion ld d gt 3A 3 23 wih AM 26 1 Aj 3 24 which is the most expensive version if A is not explicitly known and must be evaluated by analysis of vectors such as e 00 010 0 If we replace A by its average atrace A we have a second criterion based on A af L traco a 3 25 This version requires only a few analysis of a random vector if trace A cannot be evaluated explicitly Finally in case the noise is not cal
27. divadoa11 run for input data preparation actions are placed in the input for data sets extraction and ina newinput subdirectory for the other actions as shown in the following table 144 Action Outputs Data extraction A subdirectory divadata is created in input directory and contains all the data sets Coastlines generation and Advection field generation A newinput subdirectory which contains a subdirectory divaparam with the coast cont 100rx and a subdirectory divaUVcons_al1 containing the velocity field files Data cleaning on mesh outliers elimination and generation of relative length fields A newinput divadata subdirectory which contains cleaned data sets and relative length files if generated Parameters optimisation L and S N A newinput divaparam subdirectory which contains param par var 100z2 files and summary files of the optimisation and filtering procedure Reference fields generation A newinput divarefe subdirectory which contains all generated reference fields The sell script file di vadocommit in order to be able to use the outputs of input data prepa ration actions they must be copied to the input directory This can be done by running the sell script file divadocommit Note divadocommit replaces input files in input directory by the ones found in newinput directory assuming that the driver varlist yearlist andmonthlist files are the
28. file The advection constraint option is activated when the corresponding flag value is equal to 1 The use of reference fields option is activated when the corresponding flag value is equal to 1 in this case a year period and month period codes must be provided in the corresponding lines advection flag 0 reference field flag variable year code 19002010 variable month code 0103 Example file 13 6 varlist 148 13 4 3 Diva 4D climatology production output The outputs are placed in output 3Danalysis and are the same as of the Diva 3D in addition to the climatologies 4D NetCDF files The 4D analysis files in NetCDF and GHER binary format var yyyyzzzz 4Danl nc or var 4Danl nc ofall year periods The 4D variable analysis NetCDF file contains the diva analysis of the variable and a set of variable related information fields relative error and error standard deviation fields variable masked using two relative error thresholds fields deepest values of the variable field and the related masked fields It contains also fields of information about data distribution and outliers as well as fields of correlation length and signal to noise ratio parameters The 3D analysis files in NetCDF and GHER binary format var yyyyzzzz mmnn lerxxr lyyyy errorfieldgher anl Var yyyyzereonmnn lexrn lyyyy anl nc var yyyyzzzz mmnn lerxex lyyyy fieldgher anl
29. fitting fitted Bessel covariance uncertainty covariance 0 0 2 0 4 0 6 0 8 distance degrees Figure 11 5 Visual results of divafit Download analysis Link or embed Report a problem elite Analysis Analysis with Diva Correlation length deg o 20086 20 7 Signal to noise ratio 0 53297 20 4 divatit 20 1 Quality of the fit 0 bad 1 good 0 97736 is Optional parameters 19 5 19 2 Maximum rel error from 0 to 1 0 3 18 9 Previous Make analysis Update 39 17480 36 70215 Figure 11 6 Analysis and mask based on relative error The outputs are available in various formats Fig 11 7 NetCDF Matlab or Octave file Keyhole Markup Language KML and other image formats Download x Available formats e NetCDF file nc e Octave or Matlab mat e Google Earth kml Image Format PNG A Figure 11 7 Exportation of the result field in different formats 11 1 3 Conditions of use e Open to all users without registration 123 e CPU time and the number of observations is limited per user in order to guarantee avail ability to all The current maximum CPU time is 10 minutes and the maximum number of observations is 100000 11 2 Ocean Data View Ocean Data View ODV Schlitzer 2002 is a tool for the analysis and visualization of oceano graphic data Among the numerous possibilities ODV we find the production of gridded fields based on the original data Thre
30. for mat Section 7 1 4 gebco2diva f converts topography extracted from GEBCO website into Diva compatible format Section 7 1 1 findmin f from a list of values SNR GCV data variance found in fort 11 tries to find by local parabolic interpolation the minimum of GCV and the place SNR where it is found Points do not need to be ordered Output fort 12 contains the expected value of in which GCV is minimal as well as the VARBAK value Used in divagev Called in divacv divacvrand anddivagcv 177 fitlsn f from the data file fort 10 and information on coordinate change and refer ence field fort 11 tries to fit the Bessel covariance function to the data covariance called in divafit Outputs fort 66 contains the correlation length and an rough estimate of the signal to noise ratio fort 99 contains the data covariance over all distances fort 98 contains the data covariance as a function of data distance as well as the cor responding fit over distances up to the correlation length forgnuplot f consists in nine files for preparing the outputs to be viewed with the help of gnuplot see Section 9 1 griddef f creates the file GridInfo dat of which the content is used for writing the NetCDF output lceleme f computes the mesh characteristic length called in divacck and divamesh lookforoutliers f checks if there is outliers in the data provided for the analysis called in divacalc divaqcbi
31. format on the regular grid specified in param par e fiel dascii anlanderrorfieldascii anl are the sameas fieldgher anl ande rrorfieldgher anl butin ascii format e valatxyascii anl and erroratxyascii anl give respectively the values of the analysis and the error fields at the points specified in file valatxy coord e fieldatdatapoint anlanderroratdatapoint an1 are respectively the anal ysis and error fields computed at the data points i e the points from data dat e results nc located in output ghertonetcdf is a NetCDF file containing the gridded analysis and error fields provided error calculation is switched on 82 8 2 Quality control of data According to theoretical developments of Chapter 3 quality control with Diva can be performed using to one of the three criteria 3 24 3 25 or 3 26 respectively implemented in Diva with divagce divagcbis and divagcter 8 2 1 Tools There are three tools to perform QC divaqc it is the most expensive version of QC since A must be evaluated by analysis of vectors with zeros everywhere except at the i position divagcbis this version of the QC is quicker as we replace A by its average x trace A divagcter the last criterion implemented is based on the RMS value of the misfit and the generalized cross validator O 8 2 2 Output files The corresponding outputs are given in out liers dat outliersbis dat and out lierster dat The module
32. in that case vertical profiles have high vertical resolution and sufficient profiles for all seasons but have an irregular horizontal coverage Brasseur et al 1996 Thus a spatial analysis on hori zontal planes is needed Relatively large number of data points in each plane penalizes Optimal Interpolation OI meth ods because these methods require the inversion of a Na x Na matrix see Tab 2 2 and eq 2 6 This is the reason why VIM resorts to the expertise in efficient finite element solvers Diva stands for Data Interpolating Variational Analysis and is the implementation of VIM It is designed to solve 2 D differential or variational problems of elliptic type with a finite element method 12 2 3 1 Formulation We are looking for the field p which minimizes the variational principle over our domain of interest D Nd J p Xoi Id plz u lell 2 10 j l with lell f aoVVy VV aVe Vo a dD 2 11 D where e po penalizes the field itself anomalies e a penalizes gradients no trends e a penalizes variability regularization e penalizes data analysis misfits objective Without loss of generality we can chose a2 1 homogeneous function 2 10 Parameters meaning Writing Eq 2 10 and 2 11 in non dimensional form with iV V L being a characteristic length of the problem we have Nd bea an ee Jie X uld plz yi f Ave VV aks Vp aoe L dD j l 2 12 a
33. in the present version Diva 4 3 tools divacv and divacvrand do not adapt the error norm to include the relative weights on data This will be introduced in the next versions 7 4 Misc 7 4 1 divaclean divaclean cleans up the working directories by removing fort files from divawork and meshgenwork as well as output files from output 7 4 2 divadataclean Script divadataclean takes the input data input data dat and eliminates all data that fall outside the bounding box of the contours i e the rectangle containing the analysis mesh This avoids loading unnecessary large input files If two additional arguments n nz are added data values falling outside the range specified by n1 na are also eliminated Example charles gherl3 divastripped divadataclean 3 35 will remove all data points of which the value is not between 3 and 35 77 The output overwrites input data dat but keeps the original one in input with the name data dat full The tool should be used just after having loaded the data set typically after divaload 7 4 3 divaload divaload loads input files from the chosen directory into divastripped input You just have to specify the directory where your input files are located relative or absolute paths It is assumed that the input files are located in a folder input within the chosen directory Example charles gherl13 divastripped divaload DIVA test
34. interpolation 10 2 1 Creation of the contour Generally the contour generation is easier in this case since the transect cannot cross islands Let us consider a transect that follows the track presented on Fig 10 5 The first step is to extract topography which acts as a boundary of our domain Methods for getting a topography are detailed in Section 7 1 For the horizontal axes we worked with the distance computed with respect to the starting position of the cruise Other choices are possible i e degrees of longitude or latitude distance from a reference point Depth m TCC i LITET TP TTT 1000 1500 Latitude 2000 2500 3000 38 24 Longitude a Localization of the data triangles and topography b Data with limits of the domain of the region Figure 10 5 Contour generation 10 2 2 Mesh generation Since in physical oceanography vertical length scales 100 1000 m are much smaller than horizontal length scales 100 1000 km an improvement is made if we take into account this anisotropy To this end we need estimates of L and L the horizontal and vertical length scales respectively 110 ds 000000 0 000000 000000 2 766513 213350 2 058027 259753 1 956031 303870 1 960115 350149 2 044557 O OOOO ON EF 108852 1 895979 162687 1 804136 1 162687 0 000000 ere Example file 10 6 Contour file of Fig 10 5 b The most direct solu
35. log data exp analysis and anamorphosis transfor mations or user defined transformation 146 e analysis using a reference field for each layer generated on the basis of all data from the two neighbouring layers in addition to the layer data set Note These options are activated with a specific flag values in the driver 13 4 1 Inputs for production of climatologies in climatology directory Varlast yearlist input files defining the climatology monthlist constandrefe input file to activate advection constraint and or reference fields in climatology input directory contour depth file of depth values see example 12 1 param par file defining the analysis parameters provided here if not present in divaparam NCDFinfo Info file containing metadata for NetCDF files see example 13 5 divaparam subdirectory containing coastline files coast cont 100xx and parameters files param par var 100rx divadata subdirectory containing data set files var yyyyzzzz mmnn 1l00cx7 divarefe_all subdirectory containing reference field files see Section 12 4 1 divaUVcons_all subdirectory containing advection constraint fields see Section 12 4 1 Title string for 3D NetCDF file Diva 3D analysis Reference time for data if not climatological data months since since xxxx 01 O1 Time value if not climatological data 1200 Cell_method string time mean this mon
36. many error messages are written on the screen but you do not have to take them into account Here are some examples of plots created with gnuplot 9 2 Matlab Tools to display contours data meshes analysis and error fields are provided in the directory diva 4 3 src Matlab In latest versions from Diva 4 3 they are regrouped in a single directory x diva 4 3 src Matlab 9 2 1 Tools description In most of the cases you should only edit diva_start m where you will define e the variable you want to plot 94 ay 5 l KS s i 7 7 z2 r 2 N j f a Data and coastline b Filled coastline c Mesh Error falda dta Icon d Numbered mesh e Analysis f Error and data locations Figure 9 3 Visualization with gnuplot 95 variable 1 temperature 2 salinity 3 depth 4 velocity 5 correlation length 0 nothing e the path of your result and plot directories dir name name of your input output directories called with divaload divasave dir figures where you want figures to be saved e the prefix of the figure names casename Island e the figure format fig_format 1 jpeg 2 eps 3 png e the use of the m_map package for your plots is_mmap 1 if you have the m_map tool box installed 0 if not Various scripts allow you to create plots their purposes are
37. matrix size Na X Na on the data We could calculate the covariances matrices involved exactly as done for the exact error cal culation and then calculate 4 22 but this would be prohibitively expensive if done in a brute force approach However when done in a clever way it is feasible Direct approach Using 4 23 and 4 22 we can write 2_ pT _ pTEOT 1 A h Ph h C B R Ch 4 24 The term C h is readily interpreted as a columns vector containing N4 elements Element j is the weighted sum of the covariances of all integration points with the data point 7 The middle term is the analysis operator that provides the analysis on the grid points when providing on input a columns vector of size Ny Hence the recipe to calculate A without explicitly forming the error covariance matrices is the following e Perform a double sum on all covariances between grid points to calculate h P h e For the term to subtract evaluate it starting from the right form a pseudo data vector by summing covariances of all grid points with each data point analyse it and finally sum up the analysis at the grid points All we have to to is to be calculate covariance functions This can be done with the module covar of Diva which allows one to calculate a series of covariances with a single matrix inversion Hence the recipe of calculating 4 24 includes a Diva run to calculate covariances cost roughly equal to an analysis with full error field followe
38. nx max x of output grid nput paran lines 332 characters Figure A 13 File param par resulting from an interruption of divagcv 168 Diva uses a memory allocation for the largest problem encountered This translates in Windows to a request of virtual memory of around 1 3Gb During execution the real memory used can be much smaller than that and the problem actually fit in real memory even if you have less than 1Gb RAM The only problem is that if your Windows virtual memory the swap file is not big enough Diva will not execute How to solve it The best solution would be to add real memory your computer would benefit from it anyway but to make DIVA work you can simply increase the virtual memory of Windows by changing the windows settings As administrator my computer right click gt properties gt advanced gt performance gt settings gt advanced gt change Put there a virtual memory swap file of 2Gb initial and maximum and Diva should run Other solution consists of recompiling with lower nrea value see problem A 2 4 A 2 14 Cannot move directory permission denied messages p S W hy do I get this error An application has opened one or several files located in the directory you want to re move so that it is impossible to perform the operation How to solve it Simply close the application s that open the files of the concerned directory A 3 Older problems The following p
39. on the boundary In real situations this very rarely happens but when you use synthetic test cases use contours and analysis points which do not coincide look at divatest how the contour is made to avoid falling on the grid points of the analysis A 2 3 Command line scripts not working Mes documents SeaDataNet OldVersions Diva4 1 divastripped S divamesh VASAT Going to mesh data AAOOOOOCOOOOOOOOOOOOOEOOOOOAOOAOEOAAAAAAAAAAAAAA AAS divamesh line 4 r command not found divamesh line 5 r command not found cannot create regular file meshgenwork fort 1 r No such file or direct line 7 r command not found line 45 syntax error near unexpected token gt divamesh line 45 lt Filepar Figure A 3 Error messages due to bad ends of lines 160 Why do I get this error End of lines in Unix Windows and Mac files are different and this causes problems when switching from a system to the other Typically if you visualize a Windows end of line file under Unix you will see ends of line with symbols such as M or r When reading such files scripts get in trouble because they expect to read numbers but instead they find characters Note strange behaviours of Diva are often related to this topic therefore always be aware of this possible problem before undertaking more complex actions cygdrive d diva 4 2 0 divastripped Oo x H Corre lation Length lc
40. placed in the input divaparam if one wants to use relative correlation length They can be also automatically generated by Diva based of data distribution It is also possible to place only a unique file named RL dat to be used for all the levels 3Dconstraint is a two column file where each line corresponds to the level of the same number and contains the two constraint parameters to be used see Section 8 5 when performing analysis with advection constraint The advection constraint files are placed in the input divaUVcons subdirectory One can provide files named with regard to the variable and the level to which they corre spond Uvel var lrrrz Vvel var lxrxrz or only to the level Uvel larrz Vvel laxaxx Default files Uvel dat Vvel dat and UVinfo dat may be placed to be used for levels for which related advection files are missing CLminmax and or SNminmax can be placed in the divaparam subdirectory These files are used if present for L and or optimisation in the case where the maximum and the minimum acceptable values for correlation length and or signal to noise parameter values for each level is to be specified see Section 12 3 valatxy coord var xxrxx files two column at least lists of locations where one wants to have the performed analysis values in ascii files as an output for the related variable and level It is possible to provide files valat xy coord l xxzx for the corresponding levels only indepen
41. re ee 84 BA ENT ne a ee er ee ee ee ee er ee 85 8 4 1 Saving outputs 2 2 6 5 bbe ee es 85 4 2 Checking of installation lt s s lt ee ceca be be ba ee ee eae 85 8 5 Analysis with advection constraint activated 0280 85 8 5 1 Interplay with coordinate change on 86 8 6 Summary typical execution chains 2 0002 ee ee enes 90 8 61 Simple analysis ee ee ee ee a 90 8 6 2 Analysis with evaluation of parameters 91 8 1 Running a simple analysis 8 1 1 divadress The simplest procedure to carry out an analysis with Diva is using the command divadress which performs the four following operations 1 divaclean 2 divamesh 3 divacale 4 divagqcbis 79 8 1 2 divamesh Generates the finite element mesh based on contour s specified in file coast cont and cor relation length provided in param par remember that the correlation length shall have an appropriate value in order to obtain a correct mesh e Contour segments should not be much smaller than finite element length if your contour is too fine the tool divacck can be used in order to reduce the contour resolution e The typical length of a finite element should be smaller than the correlation length oth erwise the grid would be too coarse compared to the signal to resolve 100 DS Ask ERII WAALS ERAT Fa PKA ne CER ms Dosh BERS RA Wa ZEG EO JANE VF z S 90
42. reference field files in GHER format binary named with re gard to the corresponding variable name and depth level number and if available var lxrvrx datapoint ref data file three columns files which contains the variable reference field value at data points divamesh This subdirectory is located in the divastripped input directory and contains mesh files which can be used by Diva instead of generating a new ones This files can be produced previ ously by Diva in a preprocessing step It may contain the following files meshtopo lxxxx mesh dat lxrxrxre meshtopo 1zvrvx and related mesh dat 1zvxrxx named following the depth level num ber to which they correspond 12 2 Input info files contour depth amp 3Dinfo In order to use the three dimensional features of Diva one has to provide two info files in the DIVA3D divastripped input input directory 130 contour depth 3Dinfo 12 2 1 contour depth contour depth contains a list of depth values one value per line of the considered levels The first line corresponds to the deepest level and the last one to the top level 3Dinfo is the file where shell script reads the parameter values for the 3D execution variable name levels to be treated flags values controlling the execution of tasks to be performed and maximum and minimum acceptable values for correlation length L and signal to noise A parameters If one desires to specify t
43. repeated several times with different random vectors averaging of the different estimates The number of estimates is the parameter provided to the module GCVFAC of Diva Even if A is not available Az can be calculated easily by applying the analysis tool to a ran dom vector and retrieve the analysis of this random vector on the data locations Then the scalar product of the analysis of the random vector with the original random data provides the numerator of 3 16 while the denominator is simply the squared norm of the random vector Generalized cross validator In order to make the error estimator robust we take the average over all data points and define the generalized cross validator as N 1 i 2 y 2 i 1 Assuming temporarily e e hence having all misfits with the same weight the generalized cross validator is obtained 24 oe ldap Aa ae N 1 jtrace A 1 N trace I A The GCV consists in minimizing by changing the signal to noise ratio is a global estimate of the analysis error variance In view of 3 5 and 3 17 the expected variance of the noise can also by assuming a spatial average corresponds to a statistical expectation be calculated as ere 1 L trace a 3 18 When the observational errors are uncorrelated but vary in space we should replace the residual measure r d d d d by r d d R d d 3 19 to take into account the relative noise level For a
44. salinity Variable units string if no 1 data cleaning only 2 RL files 3 1 and 2 O if no 1 analyses 2 references value for gnuplot plots value for gnuplot plots salinity 3D NetCDF file Example file 12 2 3Dinfo file 12 3 3D analyses inputs preparation The working directory for running a 3D Diva analysis is DIVA3D divastripped direc tory All Diva 3D runs can be done by simply running the shell script diva3Ddress The diva3Ddress performs the actions prescribed in the info file 3Dinfo 12 3 1 Coast contour files generation To generate coast contour files for all the levels of which depth is present in the contour depth file in the divastripped input one has to choose the flag number 1 or 3 in the 3Dinfo file and provide as input in divastripped input a bathymetry file of the area of interest the input bathymetry file may be an ascii topo dat or a GHER format binary file topo grd and the related Topol nfo dat as described in Section 7 2 2 A param par file is also 134 needed and can be placed in the divastripped input input directory The resulting coast contour files coast cont lxxxrx are placed in the subdirectory input divaparam If the chosen flag number for contour generation in the 3Dinfo file is 3 advection constraint files anisotropic correlations along topography are generated as well and placed in input divaUVcons subdirectory Inpu
45. self explanatory for most of them l diva_data m 2 diva_contour m 3 diva_mesh m 4 diva_analysis m 5 diva_error m 6 diva_data_outliers m These six operations are summed in diva_plot_all m Along with these basic scripts you also have at your disposal m_map is a mapping package for Matlab created and made available by Rich Pawlowicz at http www eos ubc ca rich map html 96 e diva_analysis_mask m to plot the analysed field covered by a mask depending on the error field e diva_contour_depth m to plot all the contours generated through an execution of divacont needs a contour depth file to work e diva_covafit mto plot the fitted and experimental covariance functions e diva_inversetopo m to inverses the sign of the topography e diva_topo mto plot topography using topo grd file Tips 9 4 The provided Matlab scripts aim to show you how to create plots from files generated by Diva Therefore do not hesitate to modify and adapt them to your own need m Subroutines uread m performs the reading of files written in GHER format binary These files are opened and closed with the help of gzopen mand gzfclose m respectively These three files do not need to be modified 97 9 2 2 Examples of plot with Matlab Diva toolbox g 54 N 54 N BE r m 48 N of 2 N a J oN 2 j z gt 5 A o Ae 36 N D Y ts SEs ES a lt 2 Ws Kt Latitude OK
46. sub directories name input and output The four input files are then placed in casel input Let us assume that you created casel in Examples To copy them into the diva stripped input directory use the command bash 3 2S5 divaload casel Data In this example we work with salinity measurements in the Mediterranean Sea at a depth of 30 m in September for the 1980 1990 period Fig 10 1 The data set is built up by exploiting the SeaDataNet portal http www seadatanet org and the World Ocean Database 2009 WOD09 Boyer et al 2009 and contains 1061 data points Parameters We start with the parameter file 10 1 the regular grid for the analysis extends from 7 W to 36 E and from 30 15 N to 45 45 N with a horizontal resolution of about 10 km The icoordchange parameter is set to 2 meaning that a cosine projection will be used for the coordinates 103 icoordchange ispec oO ireg xori 7 yori 30 25 dx 0 09 dy step of ou 0 0625 nx max x of ou 500 step of ou ny max y of ou 250 valex 99 tpu tpu tpu tpu t output files required origin of output regul origin of output regul grid grid grid grid xclusion value snr signal to noise ratio 0 if position of data in km ar grid min val ar grid min val varbak variance of the background fiel
47. subtracted semi normed field ag 0 and large L obtained by two consecutive Diva executions In particular when no treatment is applied with ag gt 0 the minimization forces the analysis toward zero when there are no data points in a distance comparable to L This is coherent with the idea of an anomaly only 2 3 2 Resolution by Finite Element method Minimization of 2 10 is actually performed by a Finite Element FE method hence the need for generating a finite element grid Because the field to analyse is only defined in the water the minimization also works only within the contours defining the coastline or more generally the considered isobath 14 Thus the grid generation has to be consistent with the coasts existing in the considered region The corresponding mathematical problem is referred to the Constrained Triangulation To solve Eq 2 10 the real domain is split into a mesh of Ne triangular finite elements Fig 2 3 Ne Fle XL Tele 2 18 e 1 Figure 2 3 Triangular elements used for E external connector the mesh This kind of elements are re internal connector ferred to as Fraeijs de Veubeke ele x linear constraint ments see Brasseur 1994 for details One triangular element is made up of 3 sub triangles and has a total of 12 de grees of freedom In each element the solution is a combination of shape functions s 3 order polynomials and the continuity between elements is
48. 11 1 d d E TAN Ale so that knowing we can calculate the signal and noise variances from the data values 3 2 2 Ordinary Cross Validation OCV The objective is to optimize the parameter by searching for its value for which the analysis has a minimal error For this reason we need to find a proxy norm that we will be able to minimize As the difference of the analysis with the true field is not available we could try to work with the difference of the analysed field at the data points with respect to the original data field 6 di d 3 13 If we try to minimize this norm we will get an infinite signal to noise ratio and a perfect data analysis fit This is because the analysis at the data point is directly influenced by the corre sponding data To avoid this inconvenience the solution is to calculate the difference of the data value with re spect to the analysed field in which the data under investigation was not taken into account This is called the Ordinary Cross Validation and is with a practical trick implemented in divacv To make this estimate robust the analysis has to be repeated over a large number of data points increasing the computing cost so that OCV is generally too expensive to perform unless a trick as in divacv can be used there the analysis can be done without actually disregarding a data point but by correcting the difference as shown in the next section Variants of OCV take out se
49. 11 lt 0573 PCOPTD gt 2 0 CO 2 URL http journals ametsoc org doi abs 10 1175 1520 0485 28 198 1 29011 3C0573 3APCOPTD 3E2 0 CO 3B2 Schlitzer R 2002 Interactive analysis and visualization of geoscience data with Ocean Data View Computers amp Geosciences 28 10 1211 1218 doi 10 1016 S0098 3004 02 00040 T URL http www sciencedirect com science article B6V7D 46TBOP2 C 2 49937e4939d29fab0 1 0dc7f0af3 10bc8 Schlitzer R 2012 Ocean data view user s guide version 4 5 0 Tech rep Alfred Wegener Institute URL http odv awi de fileadmin user_upload odv misc odv4Guide pdf Schweikert D G 1966 An interpolation curve using a spline in tension Journal of Mathe matics and Physics 45 312 317 Shen S Smith T Ropelewski C amp Livezey R 1998 An optimal regional averaging method with error estimates and a test using tropical pacific SST data Journal of Climate 11 9 2340 2350 doi 10 1175 1520 0442 1998 011 lt 2340 AORAMW32 0 CO 2 Steele M Morley R amp Ermold W 2001 PHC A global ocean hydrography with a high quality Arctic Ocean Journal of Climate 14 9 2079 2087 doi 10 1175 1520 0442 2001 014 lt 2079 PAGOHW gt 2 0 CO 2 Tandeo P Ailliot P amp Autret E 2011 Linear Gaussian state space model with irregular sampling application to sea surface temperature Stochastic Environmental Research and Risk Assessment 25 793 804 doi 10 1007 s00477 010 0442 8 Teague W J Ca
50. 2 Resolution by Finite Element method 14 2 3 3 Kernel and correlation function 04 16 2 3 4 ComparisonOI VIM 2 000000005 18 2 3 5 Comparison between the spatial interpolation methods 18 2 4 Additional tools 1 2 ce ee ee ee ew ee ew we ee ee 19 2 4 1 Automatic estimation of analysis parameters 19 2 4 2 Additional physical constraint 4 19 2 4 3 Multi dimensional analysis 0048 19 2AA DINEOP occ ee ee eoh i eee ek ee eee OG 20 2 1 Data gridding The generation of gridded fields from non uniformly distributed observations both in space and time is a frequent concern in geosciences Similarly to Ooyama 1987 we will refer to an analysis or analysed field as the estimation of a continuous spatial field of a given variable from a set of discrete measurements The range of applications is wide going from model initialization to validation exercises or simple plotting purposes Mathematically gridding consists in determining a field y r on a regular grid at positions r using N4 measurements located in rj j 1 Na Fig 2 1 In this chapter we consider only two dimensional cases but generalization can be done to 3D and even 4D using distance in time but being aware of autocorrelations as in seasonal sig nals e d e Figure 2 1 Schema of the data gridding the blue o dots indicate data positions whil
51. 3008 doi 10 1029 2006JC003660 Alvera Azcarate A Barth A Beckers J M amp Weisberg R H 2007b Correction to Mul tivariate reconstruction of missing data in sea surface temperature chlorophyll and wind satellite fields Journal of Geophysical Research 112 C05099 doi 10 1029 2007JC004243 Alvera Azcarate A Barth A Rixen M amp Beckers J M 2005 Reconstruction of in complete oceanographic data sets using Empirical Orthogonal Functions Application to the Adriatic Sea Ocean Modelling 9 325 346 doi 10 1016 j ocemod 2004 08 001 Alvera Azcarate A Barth A Sirjacobs D amp Beckers J M 2009 Enhancing temporal correlations in EOF expansions for the reconstruction of missing data using DINEOF Ocean Science 5 4 475 485 doi 10 5194 os 5 475 2009 URL www ocean sci net 5 475 2009 Barth A Alvera Azcarate A Troupin C Ouberdous M amp Beckers J M 2010 A web interface for griding arbitrarily distributed in situ data based on Data Interpolating Variational Analysis DIVA Advances in Geosciences 28 29 37 doi 10 5194 adgeo 28 29 2010 URL www adv geosci net 28 29 2010 Beckers J M Barth A amp Alvera Azcarate A 2006 DINEOF reconstruction of clouded images including error maps Application to the sea surface temperature around Corsican island Ocean Science 2 183 199 doi 10 5194 os 2 183 2006 URL http www ocean sci net 2 183 2006 Beckers J M amp Rixen
52. 3Dinfo file see 12 2 e contour depth file see 12 1 e coast cont lxxrzx files for all considered levels in divaparam subdirectory see 12 3 1 e param par files param par var lxxrr for all considered levels and prepared for the considered variable put in divaparam subdirectory or param par lzxzrerz for all considered levels divaparam subdirectory or one param par file putin divastripped input directory or in divastripped input divaparam subdirectory data sets for all considered levels var lvxxx files in divadata subdirectory Tips 12 2 Jf for a level or all levels param par var xxxx is not present one default param par file must be placed in the divaparam subdirectory or in the input directory m Using relative length files If more than one relative length files are available they must be named and numbered fol lowing the variable and level to which they correspond as RL var lxxxx and must be pro vided in the input divaparam subdirectory One default file RL dat may be placed in input divaparam subdirectory to be used for the levels for which relative length files are missing One RLinfo dat ascii file grid info file must be placed with the relative length files binary GHER format If only one RL dat file of relative length is used it must be placed in the di vaparam subdi rectory or in the input directory 136 Convention When a RLinfo dat file is present in the divaparam subdirecto
53. 663706 90 80 1 12 5663706 90 70 1 12 5663706 16 30 2 12 5663706 16 20 2 12 5663706 16 10 2 12 5663706 Example file B 7 fort 20 Files produced as output fort fort fort fort fort fort fort fort 71 72 73 82 83 84 86 87 field value at data points given in fort 20 ascii format error value at data points given in fort 20 ascii format error at points given in fort 79 ascii format field value at points given in fort 79 ascii format field on regular grid ascii format field on regular grid gher format error field on regular grid ascii format error field on regular grid gher format B 2 3 Detrending calculation detrend a The execution of det rend a will create a new input data dat Files read as input fort 88 original data file fort 89 analysis at data points Files produced as output fort 90 modified data file with data detrended by groups and classes trends 1 dat trends for classes of group 1 trends 2 dat trends for classes of group 2 183 The DIVADEMECUM is a four page summary of the commands and the input output files you have to deal with when using Diva Contents Cl Scripts and actions 3 ee EO Os 185 Co WERON Sa e Ses eo es ate Wes eho eine Ww Wek os eos a Ow or 186 Co MPU TS eke ee eww See Sw ae ewe Re ewe A 187 CA AE Ne ee ee ws a nen 2 Ss eS eee Swe eB ees 188 184 C 1 Scripts
54. 7 A 2 13 Why dol getthiserror ocea oa ccro co ea emaer 0000 4 167 A 2 14 Cannot move directory permission denied messages 169 A 3 Older problems 2 2 eee eee eee eee ee eens 169 A 3 1 Jacobian matrix with null determinant 169 A 3 2 Analysed field with white stripes 0 171 A 3 3 Corrupted data file message 000 173 154 A l FAQ A 1 1 Where can I find the latest version The latest stable version if available at http modb oce ulg ac be mediawiki index php DIVA How_ to_get_the_code 3F A 1 2 How to report a bug or a problem The preferred option is to send a message to the Diva user group on google http groups google com group diva_users This has two advantages over emails 1 The questions is directly sent to all the Diva developers 2 The issues previously solved are archived and available for other users Along with a small description of the problem add relevant informations that would help us solving your issue e the version of Diva you are using e your operating system O S e your options for compiling the code check file compilation log in directory DIVA3D src For If the problem can be reproduced at the 2 D level i e working in the directory divast ripped add the input files that generated the problem as well so that we can check if the issue is machine dependent To know your O S you can type in the shel
55. 73464 xz ERROR CKSEL2 DET JACOBIAN ZERO xxx Iel isub detj 8809 2 11069 1665268654 xO x1 x2 y6 y1 y2 4632 89661941846 4056 39809849175 3958 52565619765 92505 32603819696 9328 74475179316 9595 66901910290 Will try to recover changed detj to 71248 5644788394 xz ERROR CKSEL2 DET JACOBIAN ZERO zz Iel isub detj 8809 3 1100 1665268651 x x1 x2 y8 yi y2 4632 89661941846 3958 52565619765 4083 76436356582 9565 32663819696 9595 66961916298 9591 56434369481 Will try to recover changed detj to 15684 7187946681 Figure A 14 Examples of Diva execution with problem with the Jacobian matrix 170 Why do I get this error This messages comes from a problem in the mesh generation some of the triangular elements are too deformed and generate a null value for the determinant Then the solver cannot work since it needs to inverse the Jacobian matrix How to solve it This problem was fixed in latest versions of Diva A 3 2 Analysed field with white stripes The analysed fields has stripes of NaN values Analysis Analysis Latitude N 5 4 3 2 4 o Longitude E 4 08 3 06 2 oa 1 o2 o 5 0 2 2 04 a 05 F 0 8 5 a 1 2 3 4 Longitude E Figure A 15 Examples of Diva outputs with random zones of NaN Why do I get this error This problem comes from a too aggressive optimisation to create executable diva a although during th
56. AV Vy 5 7 j we augment the cost function as D 5 g se I se L Tei a J i f jite pter Dag dD 5 8 j 47 5 2 1 Implementation K is easily modified by adding the decay term during the calculation of the constraint Os Os 07s 07s i 0 f By Azz SA T vs Os Os 0s 0s 2 dQ An v Dy Axa oe s d The source is a little bit more complicated each source has a contribution to the charge vector g of the type Os s 08 08 Q 2 t A A i dQ 5 9 CZ Ox mat A va where Q is taken constant over the sub element for simplicity otherwise we need to calculate the derivatives at the source location instead at the gauss integration points where we know them already e Each source unit unit of tracer by unit time is spread over sub element in which source is found Source file sources dat similar to data file Read in a similar way and sources sorted in a similar way also which needed some adaptations Files modified solver f constr f divainc h datapr f divacalc e File added sourcepr f e constraint dat can now contain a third optional parameter which is y Only two possibilities for coordinates and units e user coordinates i coordchange 0 velocity L T decay rate 1 T diffusion L7 T and decay 1 T and coordinates L must have same units Source has variable unit over time dimension e coordinates are degrees and are transformed to km icoordchange 1 vel
57. CO one minute topography Depth m 1000 30 0 32 N 1000 B Z 30 w l 2000 31 N 3000 30 4000 11 W kj 10 W 9 W Longitude Figure 7 4 Individual measurements of depths 69 Adapt parameters As in any Diva analysis you need to provide parameters concerning the analysis itself and the output grid file param par described extensively in Section 6 2 3 page 60 e Correlation length is chosen according to the resolution of the gridded topography you extracted i e the distance between two measurements e Signal to noise ratio is assigned with a large value typically 100 or more e x yorigin are chosen according to the region where you extracted data e dx and dy are the same as the values you use for your analysis Execute divatopo With the two files topo dat and param par located in divastripped input type divatopo to launch the analysis di vat opo automatically creates a contour file according to grid parameters taken in param par The interpolated field is presented on Fig 7 5 Outputs topo grdand TopoInfo dat may then be used to generate contours see Section 7 2 Depth m 1000 32 N 1000 Latitude 2000 31 N 3000 4000 30 Nowy 30 TIW 30 10 W 30 Longitude Figure 7 5 Interpolated topography 7 1 3 Method 3 by hand Create a gridded file in the same format as the analysis fields fieldgher an1 of topogra phy and call it to
58. Figure 8 8 Note that the diffusion coefficient is not changed If this coefficient is given in Cartesian coor dinates in this case it must be specified in m s if velocities are in m s but you provide input in degrees and do not set icoord 1 the diffusion coefficient is basically overestimated by a factor 10 For example in the grid with icoord 0 we can activate diffusion 89 Analysis A 4h D8 44 42 0 02 04 05 08 me F Figure 8 9 Diffusion coefficient divided by 110000 compared to the i coord 1 case With no coordinate change input values are taken as is To recover a similar but tilded and boundary modified solution we have to change manually the coefficient and divide by 110000 degrees to meter scaling so that the actual Reynolds number remains the same 8 6 Summary typical execution chains 8 6 1 Simple analysis It is assumed that all the input files are already prepared and the parameters correctly assigned 1 divaload your_directory 2 divadress 3 divasave your_directory 90 8 6 2 Analysis with evaluation of parameters You start with correct data and contour file but with parameters file that needs to be adapted 1 divaload your_directory 2 Gavetis r to compute the correlation length and replace its value in param par 3 divagey r to compute the signal to noise ration and variance of the background field and replace them in param par 4 divadress 5 divasav
59. HS LS ORE Be Ore RM 122 11 4 Parameters selection ke ee RR AR ER ESSER eee HES 122 115 Visual results Of divatity ccr ite bee 244 ienna te RASHES 123 11 6 Analysis and mask based on relative error 2 ag ee et Sew os 123 11 7 Exportation of the result field in different formats 123 11 8 Example of VG gridding and Diva gridding with ODV 124 12 1 Content of output 3Danalysis 44 ds amp doe be Ge Wee em 138 12 2 Content of output 3Danalysis Fields 0000 138 A l Simultaneous run of Diva vs 6 os ee eee ee eR Ew EW HEM HS 158 A 2 Examples of Diva outputs with zones of NaN at boundaries 160 A 3 Error messages due to bad ends of lines 2 2 240004 160 AA Example of bad ends of lines 2 ee Sed ee ee ee ee ee es 161 A 5 Error message obtained during compilation 2 162 A 6 Solution to the resource problem 2224 eee eee wee w eee enw en 163 A 7 Error message during execution of divacomp with gfortran 163 A 8 Error message during the run of divacalc 2 424 094 4 494 48940 4 164 A 9 Error message due to allocation problem o oo 165 A 10 Error message during execution of divacalc with gfortran a a 166 A 11 Error message with contour generation o oo 167 A l2 Small OES o ce eS p Oe p oa e Soe e Bo tae Oe we Weed does Woe wee 168 A 13 File param par resulting from an interruption of divagcv 168 A 14 Examples of Di
60. IMPLEMENTATIONS 11 1 Diva on web Upload d An Statistics Download analysis Link or embed Report a problem Help Upload observation Text file ODV4 File Choose File No file chosen Column separator space ortab Decimal separator dot B Format The file must be an ASCII text file with three columns The columns represent longitude latitude and value of the observation P respectively For example 14 06250 1 40625 29 7667 45 15 16 146 29 7667 45 15 16 346 Sample global temperature data from ARGO Next Figure 11 2 Upload of data Statistics Repor a problem fh Help Grid coordinates Longitude resolution o 1 Latitude resolution 0 1 Longitude range 28 2 41 8 Latitude range 41 45 5 Round longitude and latitude to resolution Depth level m o Bathymetric data base Global GEBCO 30sec Y a Previous AD 19531 39 16309 Figure 11 3 Grid coordinates Analysis Statistics Download analysis Link or embed Report a problem Help Analysis with Diva Correlation length deg 0 20086 Signal to noise ratio 0 53297 aati Quality of the fit 0 bad 1 good 0 97736 Optional parameters Maximum rel error from 0 to 1 0 3 Previous Make analysis Update 5 23926 39 07520 Figure 11 4 Parameters selection 122 11 1 Diva on web sampled covariance covariance used for
61. Lz which are the flag values for lower level number and upper level number in the driver 21 if analysis fields of the given variable are to be performed with log data exp analysis transformation 23 if reference fields of the given variable are to be performed with anamor phosis transformation 24 if reference fields of the given variable are to be performed with user chosen transformation function Adding 100 to the flag value 101 or 112 allows performing analysis using reference fields for each layer using all data from the two neighbouring layers in addition to the layer data set Only reference fields are performed 151 102 or 12z allows performing reference fields for each layer using all data from the two neighbouring layers in addition to the layer data set e Gnuplot plots Possible flag values are 0 and 1 Activate this action for a quick visu alization and assessment of the climatology production gnuplot executions can be included in the production process There are a few controls you can apply for these gnuplot plots VAR bounds contains the lower and upper bounds during the plotting for the variable VAR which is one of the variable names found in varlist VAR pal contains the color palette for the same variable plotboundingbox dat contains the box for plotting This is typically used to plot only the region of interest without overlapping regions with other climatologies
62. M 2003 EOF calculation and data filling from incomplete oceano graphic datasets Journal of Atmospheric and Oceanic Technology 20 10 1839 1856 doi 10 1175 1520 0426 2003 020 lt 1839 ECADFF gt 2 0 CO 2 Bhaskar T V S U Jayaram C amp Rao E P R 2012 Comparison between Argo derived sea surface temperature and microwave sea surface temperature in tropical Indian Ocean Remote Sensing Letters 4 2 141 150 doi 10 1080 2150704X 2012 711955 Boyer T P Antonov J I Baranova O K Garcia H E Johnson D R Locarnini R A Mishonov A V O Brien T D Seidov D Smolyar I V amp Zweng M M 2009 World Ocean Database 2009 Chapter 1 Introduction Tech rep U S Government Printing Office Washington D C 216 pp Brankart J M amp Brasseur P 1996 Optimal analysis of in situ data in the Western Mediterranean using statistics and cross validation Journal of Atmospheric and Oceanic Technology 13 477 491 doi 10 1175 1520 0426 1996 013 lt 0477 O0OAOISD gt 2 0 C0 2 190 URL http journals ametsoc org doi abs 10 1175 1520 0426 28 1996 29013 3C0477 3AOAOISD 3E2 0 CO 3B2 Brankart J M amp Brasseur P 1998 The general circulation in the Mediterranean Sea a climatological approach Journal of Marine Systems 18 1 3 41 70 doi 10 1016 S0924 7963 98 00005 0 URL http www sciencedirect com science article pii S0924796398000050 Brasseur P 1994 Reconstruction de champs d
63. PATP YSOWEATP ULS9TOVATP SS APLATP OTROCATP USOWEATPH sisAyeue ue Jas 0 UONIEXe ewur W yoayooxeweATp aTTdwooeATp uoneyyeysuy nn A EE S IsAyeue Y SPIEMOJ Execution order optional arguments are between line version of Diva Figure C 1 Scripts used in the command 186 C 3 Input files Correlation length in units of data if degrees S N icoordchange xscale O none l degtokm 2 sin projection ispec error output files required ireg subtraction of reference field 0 no l mean 2 plane O YH OF xori 4 999 yori 4 999 dx x step of output grid 0 1999 dy y step of output grid 0 1999 nx number of x points of output grid 51 ny number of y points of output grid 51 valex 9999 0 snr signal to noise ratio 10 varbak variance of the background field 1 origin of output regular grid min values of x origin of output regular grid min values of y exclusion value param par file content Parameters are self explaining except for error output specifica tion ispec 0 means no error field requested add 1 for a gridded error field 2 for error at data location and 4 for error at coordinates de fined in valatxy coord From there if you want e error based on real covariance ispec ispec e error based on real covariance with boundary ef fect ispec ispec 10 e poor man s error estimate quick and underesti m
64. SeaDataNet Diva User Guide C Troupin M Ouberdous D Sirjacobs A Alvera Azcarate A Barth M E Toussaint amp J M Beckers 350 F 400 QY 450 l e in D K X V D By SZ is A 4y Kh A i REI WW K N Z S A N SOR Mas aN K AY J A iy 500 K A X Q Y A AK SEZ AS Wy 550 last modified March 2013 GeoHydrodynamics and Environment Research MARE Departement of Astrophysics Geophysics and Oceanography B GH ER University of Li ge Universit __ eae gt n http modb oce ulg ac be de Li ge Environment Research Acknowledgments This document was written for helping oceanographers work with the Diva software This would not have been possible without the help of scientists involved in Data Analysis projects We would like to thank the participants to the Diva workshops in Li ge November 2006 Calvi November 2007 October 2008 October 2009 and November 2010 and Roumaillac October 2012 for their numerous valuable comments to improve the software and the manual J Carstensen Aarhus University Denmark for his contribution in the implementation of the detrending method the National Fund for Scientific Research FRS FNRS Belgium for funding the post doctoral positions of A Alvera Azcarate and A Barth as well as supercomputer facilities the Fund for Research Training in Industry and Agr
65. Then go into the divastripped directory and run the scripts you want Example file A 1 mydivacall Then your program has to prepare all input files exactly as for a normal Diva execution Once this is done your program needs to make a system call look at the documentation of your program on how to do it On a Unix machine you would then simply include a command like call system home lt path gt mydivacall For a Cygwin system it is more complicated call system c cygwin bin bash exe login i c c lt path gt mydivacall Once the script execution is finished you can read the diva output files with your program and continue to do whatever you want A 1 5 What value for parameter ireg should I choose for a semi normed analysis The best option is to choose ireg 0 The command divaseminorm performs four operations 156 l divarefe computing a reference fields with large value for L your value multiplied by 5 and low signal to noise ratio your value divided by 10 2 divaanom difference between your data values and the reference field at these data points 3 divacalc performs a Diva analysis with the parameters you put in param par on the data anomaly This is why you should choose ireg 0 you are working with anomalies thus no need to subtract any background field 4 divasumup reconstruction of the analysed field by summing the reference and anomaly fields A 1 6 How can one create monthly analysis
66. UPLOT Version 4 2 patchlevel 2 last nodif ied 31 Aug 2007 Systen HS Hindous 32 bit Copyright C 1986 1993 1998 2004 2007 Thonas Hillians Colin Kelley and nany others Tupe help to access the on line reference nanual The gnuplot FAQ is available fron http uuu gnuplot info faq 1 Send bug reports and suggest ions to lt http sourceforge net projects gnu plot gt at type set to uindous Figure 9 1 Gnuplot window gnuplot gt 2 X Windows System is already installed run again the Cygwin setup exe for down loading and updating your Cygwin installation in the Select Packages screen look for the Math entry select gnuplot and choose install Once this installation is finished gnuplot is launched from a XWin obtained after typing start x window by typing gnuplot 9 1 2 Utilization Normally Fortran sources forgnuplot f have been compiled during the Diva installation and executables placed into DIVA3D bin In directory divastripped gnuwork edit divaplotal1 and adapt the header so that gplot indicates the correct path to your gnuplotexecutable 93 Cygwin Setup Select Packages Select Packages Select packages to install Okeep OPrev Cur Obp View Category wa Size Package 427k _ftw3 doc Pdf and html documentation for using the fftw3 libraries 288k gmp GMP is a free library for arbitrary precision arthmetic 2489k _ gnuplot A commandiine diven interactive function plott
67. a From there applying the correction 1 1 yo we can use the covariances as input vector for a second Diva execution so as to perform an analysis of the covariance and getting access to the error of the analysis at the desired location Indeed using the equivalence of Diva and OI if the analysis step applied to a data vector d is formally written Ya Hd 4 14 then the error is i g e r o B r r o Hb 4 15 where Br r is the local relative background variance calculated by 4 11 and b is a vector filled according to 4 13 Usage Calculation of the full covariance function for error calculation is recommended when at least one of the following conditions is true e Advection constraint is strong e Signal to noise ratio is high and few data are available near the boundaries e penalizing gradients is different from 1 and the kernel is not 2 24 any more e The correlation length is variable over the domain In the aforementioned cases the assumptions for the hybrid approach are not fulfilled and the use of 4 6 to express the covariance will provide an error field that is not coherent with the analysis For instance lower errors can be obtained in regions void of observations 32 data point at 0 0 data point at 4 5 0 Theoretical kernel Gaussian function 0 5 Field value 0 25 Distance boundary indicating a larger background vari
68. a from a given class e g specific year and comparing the analysis to them divacvrand performs cross validation by taking out several points at once to calculate error estimates and repeat the exercise several times to make estimates robust divafit estimates the correlation length by fitting the data correlation function to the theo retical kernel divagcev estimates the signal to noise ratio by performing a generalised cross validation 56 divagcvalex divaguesssn divasnbygrid creates a grid with noise level and data weights 6 1 3 Contours and mesh divacc check the consistency of the initial contour file divacoa2cont converting ODV format coastlines to Diva format coastlines divacont creates the contours from a given bathymetry and a selected depth levels divacont2grid translate contours into gridded format divamesh generates the finite element mesh 6 1 4 Analysis divabigtest performs a test with a very large number of data points divacalc performs the Diva analysis divadetrend performs an analysis with the detrending option activated divadress performs a complete analysis cleaning divaclean mesh generation divamesh analysis divacalc outliers detection divaqcbis and outliers removal dvoutlierclean divaintegral compute the integral of the treated variable of the considered domain divamultivar performs an analysis with the multivariate approach divarefe computes a refere
69. a rate and A Capet and M Ouberdous and F Lenartz and M E Toussaint and J M Beckers title Generation of analysis and consistent error fields using the Data Interpolating Variational Analysis Diva journal om year 2012 volume 52 53 pages 90 101 doi 10 1016 j ocemod 2012 05 002 url http www sciencedirect com science article pii S1463500312000790 iv 1 5 Installation of the software 1 UE REMENE oo so i e i aar ee et ae ai a Be ai Baten Balen at 1 1 2 Download and extraction of the archive 04 2 1 3 Generation of the binaries executables 0 000000084 3 IA MMS o eeta Hoh a Dk eke A RE RAE EERE ORE HK 4 Diva Theory 6 General theory 7 Ldi MPG e 8 Be et BS Sh me RE ee 7 2 2 Optimal Interpolation 22454452428 836545 44 44 SHS 9 Lok WIAA inverse II a oe Bk ee GH Be HERG SE SY 12 2 4 Additional tools 26 Ge eke a RRR ER RRR RY eR ERR ERE ERE 19 Determination of analysis parameters 21 31 Correlation length os ce oe eee amp aoe cm aoe Gk ack oe Oe UR wo Boe Sb ee ge a 21 3 2 Determination of the signal to noise ratio 00 21 3 3 Quality OO o ee ae See eee Sk eee ee Se Bee REM eS 25 Error computation 29 TI e s se sose aose ace yare a Goe kgo Goe Se ee G oe Se RS 29 42 Methods implemented in Diva a aoaaa be Hd eee ewes 30 4 3 Numerical cost e es g ee g i dap ee heh as eh eh ek A 34 4 4 Comparison between the methods
70. aively this would be prohibitive since a new anal yse with another data set the unit data in different locations normally requests a new matrix inversion To save computing time a nice mathematical property was discovered and exploited perform ing an analysis that differs only by one data point from a previous analysis can be performed using an already existing matrix factorization In this case the generation of all covariances always changing only one data point can be performed with a cost similar to a single error analysis with prescribed mathematical covariance functions To explain the method let us suppose that we have constructed and inverted the stiffness matrix Ko for the same problem without any data point as explained in Section 2 3 2 Kg has a component that is related to the smoothness constraint not to the data Then adding a single data point with unit value at location 7 would demand the solution of Ko iSiS q pS 4 16 LU decomposition or factorization the matrix is written as the product of a lower triangular matrix L and an upper triangular matrix U 34 Here the Woodbury Sherman formula yields 1 K3 S 4 17 anes i Since the term in parenthesis is a scalar multiplicative factor the solution with the data is ob tained by analysing this data point with the stiffness matrix Ko and then multiplying all analyses by 1 1 mS K S The value of Yo 4S KFS 4 18 is actual
71. ame region This idea is implemented in Data Nterpolating Empirical Orthogonal Function DI NEOF Beckers amp Rixen 2003 Alvera Azcarate et al 2005 This tool is designed to exploit repeated observations with missing data e g a series of col located satellite images with clouds For more details about DINEOF please consult http modb oce ulg ac be mediawiki index php DINEOF and the other references describing the method Alvera Azcarate et al 2005 2007a 2009 Beckers et al 2006 20 3 DETERMINATION OF ANALYSIS PARAMETERS The purpose of this chapter is to describe the tools included in the Diva software and that provide estimates of the analysis parameters the correlation length L and the signal to noise ratio A The end of the chapter deals with the automatic quality control of data within the analysis Contents 3 1 Correlation length s seseo anono ee ee te et es 21 3 2 Determination of the signal to noise ratio 2 002 0 eee 21 S20 Generalities oos osod ria kp bee Pathe kG a Se a 21 3 2 2 Ordinary Cross Validation OCV aaaea 23 3 2 3 Generalised cross validation GCV aao aaa 24 33 Quality control s essre seess ano nana oe 25 dab Quality CHIBI o so a ee A a hae a a we a a 26 3 32 Normalized version 6 eo eh ee ee we 26 3 3 3 Implementation in Diva 044i 4 44 beh bb REG RS RRS 27 3 1 Determination of the correlation length The correlation length L gives an indication of th
72. ance Figure 4 1 Analysis in a square domain 5 5 x 5 5 with a point at the centre and another at 4 5 0 The signal to noise ratio A 1 for both cases Note the larger analysis value near the 33 4 3 Numerical cost Let us assume that the error is requested at N locations sparse points or regular grid The error computation with OI in its original formulation requires the inversion of a matrix of size Na X Na and the projection of onto the Ne locations We will now see how it can be done with Diva 4 3 1 Poor man s estimate An analysis is performed on a vector filled with constant covariance g As the vector of co variances is filled with identical values o the error is assessed for all the Ne locations with the same analysis Since the matrix to be inverted for the analysis the stiffness matrix K 2 22 is already factorized the additional cost is almost zero because a single analysis is needed 4 3 2 Hybrid method Again the cost is kept low by exploiting the already existing factorization For each of the Ne locations matrix vector operations are needed Roughly if the cost of the first analysis is M the error field calculation requests M N N operations where N is the number of degrees of freedom of the finite element mesh 4 3 3 Real covariance function For each of the NV points in which the error is to be evaluated an additional analyse providing the covariance function is needed If done n
73. and 30 x x x x 1 if correlation length parameters are to be estimated 2 if signal to noise ratio A parameters are to be estimated 1if correlation length parameters are to be estimated and vertically filtered 2 if signal to noise ratio A parameters are to be estimated and vertically fil tered 3 if both correlation length and signal to noise ratio parameters are to be esti mated 3 if both correlation length and signal to noise ratio parameters are to be esti mated and vertically filtered 10 if correlation length parameters are to be estimated using data mean distance as a minimum 10 if correlation length parameters are to be estimated using data mean distance as a minimum and vertically filtered 30 if both correlation length and signal to noise ratio parameters are to be esti mated using data mean distance as a minimum for L 30 if both correlation length and signal to noise ratio parameters are to be es timated using data mean distance as a minimum for L and both parameters verti cally filtered e Perform analysis Possible flag values are 0 1 and 2 x 2 if semi normed reference fields of the considered variable are to be performed for all the levels between L and Lz 1 if analysis fields of the considered variable are to be performed for all the levels between L and Lp 132 MazxCL maximum value for correlation length ignored if a CLmi
74. and actions Table C 1 DIVADEMECUM Diva in and outputs When not specified differently input files are from directory input and output files are placed in directory output Script divarefe takes the same inputs as divacalc while divaanom and divasumup use no other user provided files than the other scripts Brackets by the outputs from the scripts Input Action Execution enclose optional files or parameters Ex r will replace an input file Output mycase input load new case divaload mycase input topo dat param par make gridded topography divatopo r input TopoInfo dat input topo grd TopoInfo dat topo grd topo asc topo gebco use dbdb or gebco topography dbdb2diva r gebco2diva r input TopoInfo dat input topo grd TopoInfo dat topo grd TopoInfo dat topo grd contour depth make contours divacont r coast cont input coast cont param par coast coa use ODV contours divacoa2cont r coast cont input coast cont param par check hand made contours divacck r v coast cont checked input coast cont coast cont clean up directories fort divaclean data dat coast cont output fieldatdatapoint anl eliminate useless data divadataclean fmin fmax input data dat data dat coast cont output fieldgher anl bins of data coverage divadatacoverage n r DATABINS da
75. atapoint anl ref 8 3 2 divaanom The script use file fieldatdatapoint anl ref to compute the difference between data and analysed reference field to obtain anomalies Output files File data dat contains anomalies instead of the original data while file data dat full is the copy of your original data file 8 3 3 divacalc This command was previously described Section 8 1 3 The only difference is that it is applied here on anomalies 8 3 4 divasumup divasumup performs the last step of a semi normed analysis the sum of background field and analysed anomaly field Output files They are the same as those created through an execution of divacalc Note that after an execution of divasumup data dat contains the original data while data dat anom contains the previously computed anomalies 84 8 4 Extras 8 4 1 Saving outputs divasave is designed for saving the outputs in the folder out put to the chosen directory Example charles gherl3 divastripped divasave DIVA test will save the files into DIVA test 8 4 2 Checking of installation divacheck makes the comparison of analysis results with reference analysis for installation check compiler option testing or checking of new versions 8 5 Analysis with advection constraint activated The input files needed for such analysis are the same as for a basic analysis except that you need to provide a velocity or pseudo velocity
76. ated error field ispec ispec 10 ex ispec 12 makes a poor man s error estimate at data locations 5 2 22 34 8 19 36 1 100 10 constraint dat file content First value weight on advection constraint second value diffusion coefficient in advec tion diffusion equation O21 03 gcvsampling dat file content A list of trial values for the signal to noise ratio used in cross validation tools 1000 750 500 400 300 200 100 contour depth file content with depths for contours and subsequent analysis xinfo dat file describing the grid data dat file content Simple ascii file with x Y val and optional fourth column contain ing the relative weight on the data large value high confidence topo dat is just a special case where the third column represents depth positive for sea val ues ding parameters ded files such topo grd RL dat fieldgher anl errorfieldgher anl Here first grid point in 0 10 with steps 0 1 0 2 and 101 x 51 grid points Look at examples how to read write binary files with Fortran or Matlab of binary grid as Uyel d t 187 C 4 Output files 0 50E 01 1131 0 16E 02 0 43E 02 0 38E 02 0 37E 02 0 13E 00 flag ident x y dataval analysis expected misfit outliers dat Sorted outliers from most suspect to least suspect Column 1 out lier indicator larger than 3 suspect follow ing columns data identifier x and y coordi nates or
77. be lo cated in the sub folder plots input contains the input files presented in this section divawork is the working directory for the mesh generation output contains the analysis results In ghertonetcdf one can find the output in NetCDF format file results nc while meshvisu stores the files that describe the mesh 64 7 PREPARATION OF THE INPUT FILES We describe in this chapter the tools to prepare the various input files presented in Chapter 6 If you already have the input files at your disposal you way want to go directly to the next chapter Contents 7 1 Creation of topography 2 2 eee eee ee eee eens 65 7 1 1 Method 1 conversion from GEBCO topography 66 7 1 2 Method 2 interpolation of individual topography measurements 68 7413 Method 3 by band 2 62 e e ee eee eR AS 70 7 1 4 Deprecated method conversion of data from Topography Extractor 71 7 2 Creation of contours e es 2 ew ee ww ew ww we ee 71 Tad Jey WA e aae eh eS a Ge ee ea a a a 72 7 2 2 PROM iOpOgra pny gk ek ah le Pee ee OE a Oe a he 8 72 Sate UME ODY ol eo oe OR ew RR le ob we ee ae bee 74 Tat BCOMVSINGsE oeo ee ee a a eB a a he a eS 75 7 3 Determination of analysis parameters 2 ee eee 75 dao SOHNVSEIN paniei s mace ee ha Eee LA Be eae Ree 75 Tna diIVagOT e i sa na aa tb ia ad dre a oe oe we a a 76 Tas Uya reada 24 dom Bak e p de aha Hi dow Boda 24S 77 doe OCiveGvrant 2246 4 84 6444 Cbd bee
78. bee been 77 TA MIEC cosis caosa es a ees e E e dee aed ere 77 TAI diyacleah ics de ni ae ako Ped PRE aoe Sed oe A A 77 742 Givadataclean i626 ba ce ea e a e R eee as 77 PAS TIVES oo ek hk oak W a aa e aes we Be OT a a 78 TAJ OIVaceR s c2 dae mate ke Ee ed Gerke e ea EA 78 7 1 Creation of topography A topography may be the first thing you have to prepare in order to generate a climatology They are necessary in two cases 1 when you need contour files at different depths to perform analysis 2 when you work in a vertical plane and want to interpolate several profiles from a cruise Basically the procedure consists in creating files with a format readable by Diva The list of methods presented in this Section is not exhaustive but corresponds to different procedures to create topography files using different data bases freely available on the web 65 Convention Diva works with the convention that depth are positive under the sea level This is especially important when creating contours Matlab tools provided with the software create topographies which respect this convention but in case that you work with topography database that are not described in the following section Tips 7 1 A simple way to change the sign of a given column of a data file is to use the following command awk print 1 2 3 infile gt outfile where infile is the old file and out file the new one If you need to swi
79. ble for publications or diffusion The user is invited to create his own post processing tools for example appealing to the existing Matlab routines Tips 9 2 If you need larger fonts on some systems they are available and you can edit the plotting program gnuwork divaplotal11 and replace the driver definition by echo set terminal png transparent giant font system 14 size 1920 1540 crop ffffff gt gt bidon Tips 9 3 If you do not need all plots but only a few eg analysis error and coastline of them you can edit the plotting program gnuwork divaplotall and replace the script line for iin ls diva_ x by for i in diva_analysis diva_error diva_coastline 92 9 1 1 Installation gnuplotcan be easily downloaded for windows systems on the web page http www gnuplot info For Cygwin users there are two possibilities 1 you do not have X Windows System installed in this case it is advised to only install wgnuplot available at http downloads sourceforge net gnuplot gp422win32 zip for version 4 22 Once you have downloaded it just unzip the folder in the location of your choice pro vided it is located on the path of your system The gnuplot window is activated either by typing wgnuplot in the Cygwin shell or by creating a short cut on your desktop to the executable wgnuplot exe a gnuplot DAR Fie Plot Expressions Functions General Axes Chart Styles 3D Help Replot Open Save ChDir Print PrtSc Prev Next GN
80. brary nclib usr lib libnetcdff dll a into the compiling options When trying to make the cygwin NetCDF library to work you might need to use charles gherl3 cygcheck netcdfoutput a to see which libraries are still missing in our case sas1 and therefore to install them with the cygwin installer For a quick visualization of the results a software able to read and display the content of a NetCDF file is recommended e ncBrowse http www epic noaa gov java ncBrowse a Java application e Neview http meteora ucsd edu pierce ncview_home_page html a visual browser e Panoply http www giss nasa gov tools panoply the NASA data viewer for various data formats 1 2 Download and extraction of the archive Select a directory on your local disk here we install in a directory Software where you want install Diva and download the archive available at http modb oce ulg ac be mediawiki index php DIVA How_to_get_the_code 3F charles gher1l3 S cd Software charles gherl3 Software wget http modb oce ulg ac be mediawiki upload DIVA releases GODIVA_mm_yyyy tar gz Extract the archive and go in the main directory charles gherl3 Software tar xvf GODIVA_07_2012 tar gz charles gherl3 Software cd GODIVA_07_2012 The directory tree has the following structure charles gher1l3 GODIVA_07_2012 S tree d L 2 DIVA3D bi
81. coordinate change is performed or the option icoordchange xscale was used When i coordchange is one or two the surface units of the output are m Note that the tool is not designed for use with the poor man s error calculation i spec gt 10 Section 4 2 1 4 5 4 Interna e gridpointlist a creates a list of wet points of the analysis grid Input fort 20 gridded gher file fort 21 corresponding to GridInfo dat Output fort 22 list of points with value of analysis on wet points only x y val 1 1 e erroronintegrals a calculates the double sum on background covariance and pre pares the pseudo data sum of covariances of all grid points with a data point 4 Input fort 10 list of grid points for the integral including third column for value of field fort 11 data file fort 5 with scale lc datacol Output fort 14 double sum fort 12 pseudo data vector For exact covariance functions charles gherl3 divastripped divacalc pfsum is executed which allows the use of the full suite of Diva parameters including for example advection constraint Internally as we need the covariance of all integral points with all integral points and data locations we provide to divacalc pfsum in input data which are the integration points and ask in addition values in a list of points which are the original data location 42 5 ADDITIONAL CONSTRAINTS AND DETRENDING This chapter sh
82. cript file for climatologies performance is divadoa11 The actions that one can perform when running divadoall are 13 2 1 Actions performed by divadoall e Extraction of data at selected depth levels Boundary lines and coastlines generation contour files e Advection field generation based on coastlines Data cleaning on mesh Elimination of outliers from data sets e Generation of relative length fields Optimization of the correlation length parameter for each data set e Optimization of the signal to noise ratio parameter for each data set 141 Note Calculation of variable semi normed reference fields Performance of variable analysis fields using the following options analysis without option normal variational analysis analysis using a reference fields analysis using advection constraint analysis with data transformation analysis using reference fields for each level calculated on bases of mixed data from three neighbouring levels analysis using a filtered mean background field all levels mean are first calculated an vertically filtered before being used 3D analyses Gnuplot plots production Analysis with detrending method Note All actions performed by divadoal11 are prescribed in the file driver through flag values see section 13 4 4 and example 13 4 When data extraction is activated in the driver the execution is made for all levels found in conto
83. culated from O another estimate is then according to 3 18 1 LO trace a O 3 26 which can be calculatet directly from the RMS value of the misfit or residual and the gener alized cross validator This version can easily be used simultaneously with test 3 25 using the results of the GCV 3 3 2 Normalized version Let us consider the scaled variable s defined as d d r 3 27 Si Because we will look for outliers instead of working with mean values and variances more robust estimators are the median and median absolute deviation MAD A bias in the analysis is likely to exist if S median s is not much smaller than one the typical values of s should be of the order of one if the misfit estimate is correct on average Instead of calculating the standard deviation of s we calculate the median absolute deviation 6 defined as MAD s 1 4826 median s S 3 28 where the factor 1 4826 is introduced such that for a normal distribution the MAD is identical to the standard deviation 26 Hence we can detect points qualified as outliers if they satisfy the inequality a S gt 36 3 29 This normalized version of quality control to some extent corrects for inaccurate estimation of the expected misfits A 3 3 3 Implementation in Diva The overall signal to noise ratio is calculated as Z 3 30 The relative weights on the data are then defined as m pil
84. d 2 5 Correlation Length lc in km or degree according to param icoordchange 1 if position of data in deg comments to come ues of X ues of Y ree 104 Example file 10 1 First version of param par Contours The land sea contours are created from the GEBCO bathymetry The Black Sea and the Atlantic Ocean were masked in order to concentrate only on the Mediterranean Sea properties 27 E 36 E 0 9 E 18 E 45 N 42 N 39 N S AO OT ene oratsi 36 N SSN K TINE oe s 33 N 36 36 5 37 37 5 38 38 5 39 39 5 Figure 10 1 Finite element mesh and salinity measurements used for the application 10 1 2 Parameters determination Correlation length The toold divafit will provide a first guess of the parameters A and L It will generates the output files covariance dat contains distances between points the covariance and the number of data couples used to estimate the covariance covariancefit dat contains the distance between points the data covariance and the fitted covariance paramfit dat contains estimates for the correlation length L and for the signal to noise ratio You can manually replace the old values of and L in param par by the new ones from paramfit dat If you want the new L value to be automatically replaced type bash 3 2S5 divafit r 105 Correlation length 1 3565110 Signal to noise ratio 0 72524220 VARBAK 4 59391139E 02
85. d by a second Diva run to analyse the data C h Hybrid approach A simplified versions can be used using to some extend the fact the covariance functions in an infinite domain are known analytically when no advection constraint or variable correla tion length is activated We can indeed introduce an approximation that makes the calculation 39 manageable without calculating the covariances with Diva itself Instead of using the exact co variances on the background field we use the covariances we would find in an infinite domain with constant correlation length and without advection constraint In this case we know that the correlation function c between two points is T r e r K 4 25 where r is the distance between the two points L the correlation length and K a Bessel func tion To get the covariance function we simply have to multiply by the variance o of the background field This way we can estimate A by calculating these covariance functions between grid and data points and performing one analysis with Diva Inflation approach A second simplified approach makes even stronger assumptions but shows how we can try to extrapolate the error estimated from the sum of the diagonal terms of P to the estimation of the double sum To do so we assume that the analysis error has a spatial correlation scale similar to the analysis This is probably too severe and we will therefore overestimate the integral error Here we u
86. d range 1 92007 to 29 4112 Charles charles cygdrive d DIVA ClimatoAtlantic results winter 11 output Current i 24 j 535 5 29284 x 47 6 y 53 5 fieldascii anl gevval dat results ne i gt 4 it 2 D covariance dat fieldatdatapoint anl mesh dat valatxyascii anl gut Sal oO la ELEN elay l Ces covariancefit dat fieldgher anl mesh10 dat errorfieldascii anl gcv dat meshtopo dat ssec InvP InvC MagXi Linear Axes Range Repl Print errorfieldgher anl gcvsnvar dat paramfit dat Charles charles cygdrive d DIVA ClimatoAtlantic results winter 11 output Md 5 neview results nc Neview 1 93c David W Pierce 22 August 2006 fm analyzed field http meteora ucsd edut80 pierce neview_home_page htm Copyright C 1993 through 2006 David W Pierce 7 rey fn o race Neview comes with ABSOLUTELY NO WARRANTY for details type neview w Name Current Units This is free softwares type ncview c for redistribution details Degrees_nor Note no Neview app defaults file found using internal defaults calculating min and maxes for analyzed_field Degrees_eas results nc Figure 9 6 Plots of results with Nceview 101 10 REALISTIC EXAMPLES A few examples with real data are described in this chapter They can act as model for users who need to perform such kind of analysis Contents 10 1 Complete example s s es ee ee ee ee ee ee ee ee 103 10 1 1 Preparation of the input files 0 ee 103 10 1 2 Parameters
87. dently of the variable and only valat xy coord independent from variables and levels The output will be always related to variables and levels 12 1 3 More input subdirectories The directory DIVA3D divastripped input may also contents other subdirectories as described below divaUVcons This subdirectory is located in the divast ripped input directory and contains input files of advection constraint It may contain the following files UVinfo var leree UVinfo larrr UVinfo dat Uvel var lrzrrer Uvel lxzrer Uvel dat Vvyel var lrrer Vvel lrrrr Vvel dat 129 Uvel var lrvrrr Vvel var lxxxx and UVinfo var lzrxrx named with regard to the variable name and the corresponding level depth number and or Uvel lxxxz Vvel lxxrxx and UVinfo 1lxxxx numbered following the level to which they correspond and or Uvel dat and Vvel dat and UVinfo dat divarefe This subdirectory is located in the divastripped input directory and contains reference field files which can be used by Diva as background for the analyses This files can be semi normed reference field files produced previously by Diva It may contain the following files GridiInfo dat Var 120er Ler var lezty ascii ref var levrcr datapoint ref var lrrrxr ascii ref 2D gridded reference field files in ascii format named with regard to the corresponding variable name and depth level number and or var lxrrx ref 2D gridded
88. der to take into account the domain anisotropy Fig 10 10 illustrates the difference between horizontal and vertical scales as we represented the data within the domain with axes graduated in kilometres For L and L the same definitions as in Section 10 2 2 are used We find Lz 156 76 km Ly 204 40 m and the ratio r 0 0013 Computation of correlation length Correlation length is estimated with the help of divafit which gives us L 0 433 km We generate the mesh Fig 10 11 with this value 114 S PSU 2500 2000 1500 1000F 500 SRM EE BBE re em Depth km o t 500 1000 1500 2000 i 2500 t L 1 i L ji i 0 1000 2000 3000 4000 5000 6000 Distance km Figure 10 10 Data with axes in kilometres CEES SID See i DOORS ORCC OC OO DOO A UN a A OOOK Say NEETA OOTA TOA g DA OS se ae 1 1 L 1 L 0 1 2 3 4 5 6 F Distance km Figure 10 11 Mesh in the rescaled domain 115 37 5 37 36 5 36 35 5 35 i 0 3 Analysis of data from lt Chapter 10 REALISTIC EXAMPLES a Oneal ses ansec 10 3 4 Analysis Specification of the output grid To be coherent with the scaling we made with the contour we also have to consider scaled coordinates when specifying the output locations Working in this coordinate system we carry out an analysis with the following values in kilometres
89. determination o ce ss s we a ww ee ew es 105 Lids Comonrehecking lt o lt a ca e ou wean be ek ek a e a 106 10 14 Mesh erestton lt os s coea ee eo wa to ee ha eae S a a a 106 10 1 5 Generalised Cross Validation ooa 107 IOLO ANAIySIS o oc ae be we ee eH we a a 107 10 2 Analysis of profiles from acruise 2 2c eee ee eee 110 10 2 1 Creation of the contour 6 4 ee eee ba Bee eee EEG 110 10 2 2 Mesh genefaton o ssoi e ss erlea he ek ba we ae ad 110 LUZ ANYS 6 oh ee He ee ee ee eM be 112 10 3 Analysis of data from a transect 0 000 ee ee eevee 112 IWS Daa oe ase ew eho we he ee Ro Be 112 10 3 2 COMOUPCIESHON 2 4544 66 44 h4 24 Ba ke had amp eae ges 113 103 3 Mesh 6 4 62 ecg Bache eS beh be Ae ee ee bee 114 TOA DAVIS 6 ow a me ee oP ee Sd ee i e 116 10 4 Advection constraint 2 2 ee te ee ww ee we ww es 117 102 10 1 Complete example We present here a complete 2 D case treated in command line This example is taken from Troupin et al 2012 10 1 1 Preparation of the input files To perform an analysis you will need e a contour file coast cont e a data file data dat e a list of run parameters param par and e the locations of the points where you want to know the value of the analysed field valatxy coord Examples of these files are given in Chapter 6 We recommend to create a new directory let us call it case1 for each case you will treat and within this directory two
90. e c hybrid and d real covariance methods 37 4 5 Integrals over sub domains Very often we are not only interested in the analysed field itself but also in its integral over the total domain or a sub domain If we have the analysis on a sufficiently fine output grid the integral itself is then just a sum of the values at the grid points covering the integration domain multiplied by the grid cell surface We do not consider here the additional approximation brought by replacing a continuous integral by a discrete sum Indeed generally the output grid is fine compared to the scales of interest and the sum can be considered an exact integral Hence we will focus on the error on a discrete sum of the analysed field An application of this theory is found in Yari et al 2012 where the authors estimated trans ports through the Strait of Otranto Adriatic Sea using Diva and the calculation of integrals 4 5 1 Theory Formally if x is a column vector containing the analysed field values at the grid points defining the integration domain the weighted sum J over this values is I x h 4 19 where T stands for the transposed vector or matrix and h is a column vector of the same size as xX but whose components are the weight associated with each integration point The weight is typically the surface associated with the integration point For an integration over a uniform grid the weights can without loss of generality
91. e compilation no warning or error was issued How to solve it This problem has been fixed in latest version of Diva However if you are still using older versions and get this kind of outputs you can avoid them by changing the compilation flags and compile the source again The recommended change is to use 00 flags instead of 03 optimization flags when compiling the sources located in the Fort ran Calc directory 171 in DIVA3D divastripped Shell No 3 Konsole Session Edit View Bookmarks Settings Help os Shell No 3 Shell No 2 Shell No 4 Shell Bo Figure A 16 Error message during the reading of the data file 172 A 3 3 Corrupted data file message Why do I get this error This problem was observed when decimal numbers were written with commas instead of points How to solve it Simply convert the decimal separator e g using the commands described in the beginning of Chapter 6 Additional information The behaviour of awk is susceptible to change the points into commas when used in awk filter or other routines To fix the problem simply replace gawk by LC_ALL C gawk Remark in latest versions of the code this bug was fixed by adding export LC_ALL C in the scripts employing awk 173 B DIVA CODE The engine of Diva is a set of Fortran subroutines driven by local input and output files fort x This chapter is dedicated to the description of the
92. e distance over which a given data point influences its neighbourhood Section 2 3 1 Similarly to other interpolation techniques it is an essential parameter for obtaining meaningful results The value of L can be provided a priori by the user or determined using the data distribution itself as explained in the next Section The method to evaluate L is to fit the theoretical kernel of 2 11 see Fig 2 5 to the correlation between data assuming spatial isotropy and homogeneity in correlations The quality of the fit will depend on the number of data points a value of L obtained with few data points has to be considered with care 3 2 Determination of the signal to noise ratio Once the correlation length is determined the next step is to estimate the signal to noise ratio 3 2 1 Generalities Let us consider the vector d containing the N data anomalies Objective analysis of d leads to analysed field with minimal expected error variance The analysis y at any location r is given 21 by y r c B R d 3 1 where c is a vector containing the background covariance between the point in which the anal ysis is to be performed and all data point locations The optimal interpolation is based on the background covariance matrix B and error covariance matrix R of the data Let us call d the analysis vector at data points The two vectors d and d can be related by the expression d Ad 3 2 where the matrix A used to perform the ana
93. e methods are offered Schlitzer 2012 1 Quick gridding a weighted averaging algorithm optimized for speed adapted for situa tions with millions data points 2 VG gridding a more sophisticated weighted averaging algorithm 3 Diva gridding Temperature C Depth m 100 Temperature C Depth m 100 Figure 11 8 Example of VG gridding and Diva gridding with ODV from Schlitzer 2012 Diva gridding is a simplified version of Diva implemented inside ODV where the user can only modify a limited number of parameters 11 3 Matlab toolbox The Diva Matlab toolbox is an interface to perform 2 D analysis without having to compile the whole code and to type commands in a terminal 11 3 1 Installation Download the package from http modb oce ulg ac be mediawiki upload divaformatlab zip and un zip the archive 124 charles gherl13 Software wget http modb oce ulg ac be mediawiki upload divaformatlab zip charles gherl3 Software unzip divaformatlab zip The structure is the following charles gherl3 Software tree README divagrid m linux_binaries contourgen exe diva exe generopt exe testdivagrid m windows_binaries contourgen exe diva exe generopt exe 2 directories 9 files The main file is divagrid m while testdivagrid m provides a few examp
94. e the nodes of the grid are the points where the field has to be deter e o mined ee eee 2 1 1 Interpolation versus approximation For obtaining a field on a regular grid two main techniques have to be distinguished 1 The interpolation which implies a strict passage of the solution through the points of data Physically this means that one assumes that there is no error on the data Among the methods of interpolation let us mention the linear cubic inverse distance optimal interpolations the kriging 2 The approximation or analysis provides a solution smoother than the one given by inter polation in this case the solution does not necessarily have to contain all the data points The solution is close to the data points so its shape is still influenced by the data This technique allows taking into account errors on data as well as to treat multiple data with different values at the same location Figure 2 2 Interpolation black line provides a so lution that goes across all the data points while the approximation grey line has only to be close to the measurements but with a relative smoothness 2 1 2 Objective versus subjective data analysis methods In geosciences and in particular in oceanography it is frequent to have error on the measure ments and close data points Hence the approximation methods are preferred to strict interpola tion techniques We have to differentiate
95. e version of Diva please contact us in person You can purchase a version of Diva under a different license with no strings attached for example allowing you to take parts of Diva and integrate them into your own proprietary code All SeaDataNet2 products data and software are freely distributed to the scien tific community at the following conditions v The products should be used for scientific purposes only v Articles papers or written scientific works of any form based in whole or in part on data or software supplied by SeaDataNet will contain a suitable ac knowledgement to the SeaDataNet2 program of the European Union Re lated publications see bibliography should also be cited v The applications of SeaDataNet2 products are under the full responsibility of the users neither the Commission of the European Communities nor the SeaDataNet2 partners shall be held responsible for any consequence resulting from the use of SeaDataNet2 products v The recipient of these data will accept responsibility of informing all data users of these conditions ii How to use this guide This Diva User Guide aims to cover all the aspects of the methods the theory Part I the two dimension version Part II the climatology production with GO DIVA Part IID and the description of the scripts and the Fortran code Part IV The user who directly wants to perform analysis shall start with Part II which describes the input files and p
96. e your_directory 91 9 POSTPROCESSING TOOLS Various tools are available to visualize gridded fields some of them are presented in the fol lowing sections We consider it is up to the user to utilize his favourite drawing tools for representing the numerical results Nevertheless we provide several basic tools to facilitate this task Contents o1 Gupi s sk eee as he Goes She he a oa Goo shee ve eee ee eee UB ee ee See 92 SLA DORNON 2 hoe Bw ew ee A eR a eS 93 OUD MANO oee eed ot Mio wm oe i he eg Se 93 o3 Matlab eaccoir a PAE OE ERE EES EERE SBOE OS 94 9 2 1 Toolsdeseription s s ss bee be eee eR aS 94 9 2 2 Examples of plot with Matlab Diva toolbox 98 9 3 NcBrowse 1 eee ee ee ee we ww ee ee ee ee weer eee ee 98 Da NEVIE ecs she ees Se ee ee Rae ae end We ne eee a ee 100 94 1 Installation nder Linux lt o o wa saae es 100 9 4 2 Installation under Windows Cygwin 100 9 1 Gnuplot Gnuplot is a free portable command line driven interactive data and function plotting utility available for various platforms http www gnuplot info We provide some routines for plotting Diva inputs and outputs data contour mesh analysis etc with the help of this tool Running divagnu makes plots in png format Tips 9 1 Plots provided by gnuplotare made to help the user to have a quick look at the results immediately after the execution However these plots are not always suita
97. eckers J M amp Allen J 2001 Diagnosis of vertical velocities with the QG Omega equation a relocation method to obtain pseudo synoptic data sets Deep Sea Re search I 48 6 1347 1373 doi 10 1016 S0967 0637 00 00085 6 URL http www sciencedirect com science article pii S0967063700000856 Rixen M Beckers J M Brankart J M amp Brasseur P 2000 A numerically effi cient data analysis method with error map generation Ocean Modelling 2 1 2 45 60 doi 10 1016 S 1463 5003 00 00009 3 URL http www sciencedirect com science article pii S 1463500300000093 Rixen M Beckers J M Levitus S Antonov J Boyer T Maillard C Fichaut M Balopoulos E Iona S Dooley H Garcia M J Manca B Giorgetti A Manzella G Mikhailov N Pinardi N Zavatarelli M amp the Medar Consortium 2005a The West ern Mediterranean Deep Water a proxy for global climate change Geophysical Research 192 Letters 32 L12608 doi 10 1029 2005GL022702 URL http www agu org pubs crossref 2005 2005GL022702 shtml Rixen M Beckers J M Maillard C amp the MEDAR Group 2005b A hydrographic and bio chemical climatology of the Mediterranean and the Black Sea a technical note on the use of coastal data Bollettino di Geofisica Teorica e Applicata 46 319 327 Saunders P M 1981 Practical conversion of pressure to depth Journal of Physical Oceanog raphy 11 4 573 574 doi 10 1175 1520 0485 1981 0
98. ed2 ordivastripped_username1 The you can run Diva analysis separately in these directories Session Edit View Bookmarks Settings Help S CPU SMEM TIME COMMAND 134m 1516 0 Figure A 1 Simultaneous run of Diva A 1 9 What is the resolution of the output field One has to distinguish between 2 resolutions 1 the resolution brought by the finite element mesh of which the characteristic length should be in agreement with the typical scale of the studied region based on the data correlation in Diva 2 the grid resolution which can be anything larger smaller or similar to the mesh resolu tion It means that you can always work with a finer grid but that does not mean that the actual resolution will be improved So the best resolution you can obtain is the one allowed you by the data you are working with A 2 Error messages A 2 1 Command not found message MacBook Pro de GHER divastripped gherulgS divatest bash divatest command not found 158 Why do I get this error Although you are in the correct directory the command is not found This is because the current directory represented by is not in the path of your system How to solve it You can type name_of_the_command so that the system knows the command is the current directory A better solution is to adapt your path by typing PATH SPATH path_to_diva_directory where path _to _diva _directory has to be adapted
99. election with software GebcoCE_GridOnly Figure 7 2 Data exportation with software GebcoCE_GridOnly 67 If you need to mask regions edit gebcoprep and add lines as those put with awk followed by mv bidon They should be self explaining and allow excluding regions that are defined by relationships between longitude and latitude Example 2 gt 57 0 0 6 1 x 10 means that regions where latitude is larger than 57 0 6 longitude will be masked Once you defined the regions to be masked in this way execute gebcoprep When work ing on large domains the computation time can be very long However this step has not to be repeated a lot of times The execution of gebcoprep will create an ascii file called input topo gebco Now you are ready to prepare the gridded topography topo grd from which Diva will ex tract contours To prepare it copy or move input topo gebco into the diva working directory to have divastripped input topo gebco The best resolution offered by GEBCO is 30 arc seconds which might be much too fine for large scale analysis To avoid that run gebco2diva with optional arguments nx ny to make a grid using only every nx point in x direction and ny in y direction For example if you are interested in a Diva output resolution that is working at a 100 km scale gebco2dival5 15 would still provide a very fine topography with respect to the scales of interest In the divastripped directory the execution if gebc
100. elocity components Fig 5 5 Analysis Figure 5 4 Single data point with anti clockwise rotation and with diffusion Latitude N 46 Analysis 61 60 8 60 6 60 4 60 59 59 6 59 4 59 2 59 1 08 06 04 02 o 02 04 06 08 1 o Longitude E Figure 5 5 Single data point with clock wise rotation and with diffusion Latitude N 5 1 3 Generalization Zero diffusion simply leads to correlations that are increased in the direction of the vector u or decreased in the perpendicular direction if the global L is increased simultaneously The vector u does not need to be a velocity in this case but can be any vector indicating the di rection in which correlation is to be increased Hence it could be for example topography gradi ents rotated by 90 degrees or density gradients rotated by 90 degrees if we respectively assume across depth contour movements are more difficult and hence data correlation decreased or across frontal movements more difficult and hence correlation length across fronts decreased This idea is implemented in divaUVtopo which generates a pseudo velocity field along iso baths The advection constraint therefore allows any known anisotropy in the correlations to be in cluded into the analysis We notice that the vector field does not need to be divergence free 5 2 Adding linear sink s and local source s With the more complete equation u Vy X Q 5 F yp
101. en you run divatest Section 1 4 Issues with pipes were observed with some versions of the gfortran compiler B 1 4 Utilities src Fortran Util alpha computes the values of ap and a calcest f from relative weight on data points data file fort 44 and generalized cross validator value available in output gcvval dat produces the file containing the expected misfit value at data locations fort 76 tobe used by lookforoutliers a for outliers detection Used in divagcter calcestbis f from relative weight on data points data file fort 44 and the trace of the analysis matrix available in output gcvval dat produces the file contain ing the expected misfit value at data locations fort 76 to be used by Llookfor outliers a for outliers detection Used in divagqcbis calcmu f computes the coefficient u knowing the characteristic length L and the signal to noise ratio cverror f rms error by cross validation called in divacvrand cverroraii f sameascverror f butusing the missing data lemma called in divacv cvtotalerror f sum of the different error contributions in the resampling case called in divacvrand datacheck f take the input data input data dat and eliminates all data that fall outside the bounding box of the contours called in di vadataclean datadiff f compute data anomaly called in divaanom dbdb2diva f converts topography extracted from Navy website into Diva compatible
102. equally spaced in degrees as for the previous case you will obviously get an ellipse Fig 8 5 left 86 Analysis and Mesh Analysis and Mesh 80 8 60 8 604 Z2 o 59 6 594 59 2 1 08 06 04 02 0 02 04 06 O8 1 Longitude E 504 N Latitude Latitud 506 52 i 1 08 0 4 42 0 02 04 08 OB Longitude f Figure 8 5 Analysis with coordinate change the two figures represent the same field but are drawn with different scales for the axes If we add an advection constraint characterized by u v 1 m s the case with no coordinate change leads to a signal along the bisector Fig 8 6 Analysis and Mesh g 08 0 6 04 0 2 0 0 2 0 4 0 6 0 8 1 87 Figure 8 6 Analysis with advection but without coordinate change If coordinate change is activated the advection direction in real space is not any more along the bisector in degrees but in km Fig 8 7 Note that the advection constraint scales the overall velocity so that a coordinate change does not change the intensity of the advection constraint but only its direction Analysis and Mash 02 Analysis and Mesh N9 Latitude N g E3 Lattude 2 o 02 04 06 08 1 Longitude E Mb 06 04 02 0 2 04 08 Me E 0 Longitude E Figure 8 7 Analysis with advection and coordinate change 88 Analysis 4 bj i j D8 44 4200 02 04 0B OB I ti Longitude EJ
103. ertical sections see Section 10 2 ispec Four base values specify the required error outputs ispec 0 no error field requested 1 gridded error field specified by xori yori nx and ny 2 errors at data locations 4 errors at locations listed in valatxy coord Then you can combine these four values to obtain several error outputs Examples ispec 3 14 2 means you want gridded error field as well as errors at data loca tions ispec 7 1 2 4 means you want the three error files For computing errors with the real covariance function Section 4 2 3 simply multiply the ispec value by 1 Example ispec 7 means you want the three error files computed with the help of the real covariance function A poor man s error estimate quick and underestimated error field Section 4 2 1 is available by adding 10 to the ispec value Example ispec 16 means you want errors at data locations and at points listed in valatxy coord computed with the poor man s error estimate Finally adding 10 and multiplying ispec by 1 means that the error field is computed using the real covariance function and taking into account the boundary effects ireg Specification of the background field which is subtracted from the data field Section 2 3 1 ireg 0 no background field is subtracted assuming data are already anomalies l the data mean value is subtracted 2 the linear regression of the data plane is sub
104. ete CAMPER EERE ERS Oe Be BRS 10 2 Analysis of profiles from a cruise 2 2 eb ee ee 10 3 Analysis of data from a transect 24 4 4 6 eS bs Hee Oe Be ew aoe Gs 10 4 Advection constraint 524524524 Fee eee eR ee oS OH Ee ew SY Other implementations vi 54 55 56 58 63 65 65 71 75 T11 11 1 Diva on web 11 2 Ocean Data View 11 3 Matlab toolbox III 3 D analysis amp climatology production GODIVA 12 Diva 3D 12 1 Input subdirectories 12 2 Input info files contour ceprn a IDINO lt soe bs ea eH aoe aca 12 3 3D analyses inputs preparation 12 4 Performing 3D analyses diva3 13 Climatologies production Diva 4D 13 1 Climatology definition 13 2 Diva 4D Climatology performance soosoo a 13 3 Input data preparation 13 4 Production of Climatologies IV Appendix A Problems and solutions A 2 Error messages A 3 Older problems a B Diva code B 1 Fortrancode B 2 Input and output files for the executables C VADEMECUM C 1 Scripts and actions C2 Workflow 6 2 88054 C 3 Inputfiles 5 2a aes vii 126 127 127 130 134 136 140 140 141 143 146 153 154 155 158 169 174 174 179 C 4 Output files Useful links viii 1 NSTALLATION OF THE SOFTWARE Diva is a software designed to run with any operating system Micro
105. eters e the control parameters and e the treatment of anisotropy All the methods compared here are base on a minimisation of the error estimate except the Cressman method Cressman 1959 OI and VIM are similar methods they use the same control parameters and require similar a priori information To work in 3 D and in multivariate mode VIM needs a few adaptations The main difference concerns the number of operations which is almost independent on the number of data for VIM 18 Table 2 2 Characteristics of different methods of data analysis e denote available features in the interpolation method e indicate that the feature is available with some adaptations e r is the error estimate Nq the number of data points Na the number of grid points for analysis N the number of EOFs L the correlation length and o the signal to noise ratio Method min e 3 D Multivar Ops anal e r apriori C V anis Cressman e NaNa w r L L o OI e N NNa c r L L o 2 e VIM e e e N e K r L Lje e DINEOF e N e N 2 4 Additional tools Diva software is provided with additional tools designed for parameters adjustment quality control of data and application of physical constraints on the analysis 2 4 1 Automatic estimation of analysis parameters The correlation length can be estimated based on the dataset itself The method performs a least square fit of the data covariance function with a the
106. f the data correlation to the theoretical kernel 2 0 106 10 3 Analysed salinity field with the parameters from divagcv 108 10 4 Error field and data locations with the parameters from divagcv 109 10 5 Conto r generation 2 4 2 6 44 65 45 Boe Ree RE RED REDE EG 110 10 6 Mesh generated in the scaled domain 4 4 44485 44 Sew Sa was 111 10 7 Results of analysis co e c oa ee ee eee eee ee ee Eee REE ES 112 10 8 Transect stations e and bottom topography 404 113 10 9 Domain and data o oad ea Gian da wine dandne eens Bue ees 114 10 10Data with axes in kilometres 6 bac Re we Re eS Rw Re ee 115 10 11Mesh in the rescaled domain lt x Saw aa SR oe DAM eS a Ss 115 10 12Analysed field ooo ea ek ieee ee ae eee ee ee eee Re eS 116 196 10 13 Analysed field between 500 m and sea surface 117 10 14Isotropic OL 6 bee be BER ESE REE EEE EERE ESSERE HASH SS 117 10 15Diva with coastal effect back ae dk gt Ok WO ORS eae 118 10 16 Velocity field used for the advection constraint in the Mediterranean Sea 118 10 17 Diva with advection on full grid no direct topography but indirect via advection 118 10 18Diva with topography and advection 2 2 2 20004 119 11 1 Communications between the server and the client for analysis with Diva on web 121 11 2 UI s s ssp aR PKK EEK SOK SK ES Ee oe EOS 122 113 CC CO o o ok ee ke EH RS
107. first contour The convention for the contour is that the land is on the right when you follow the points successively The contour is automatically closed meaning that the last point of a given contour is be from the first one The following line is the number of points V2 of the second contour The last Ny lines are the coordinates of the points of the last contour 0 0 100 0 100 80 0 80 60 80 80 60 40 40 60 60 Example file 6 1 coast cont Here the contour is made up of 2 sub contours 58 e the first one with 4 points and 4 edges 0 0 100 0 100 80 and 0 80 It is the main contour e the second one with also 4 points It is the interior contour island In realistic application the contours are more complex they have more sub contours islands interior seas and each sub contour is made up of more points 80 60 40 20 0 0 20 40 60 80 100 Figure 6 1 Example of a contour file and its graphical representation 6 2 2 Data The data file data dat contains at least three columns 1 the x coordinate usually the longitude but can also be an horizontal distance in km or any coordinate 2 the y coordinate usually the latitude 3 the data value e The fourth column optional indicates the weight of the each data point If this column is empty the fourth column is assumed to take the value 1 e If there are more than four columns columns 5 and
108. gnal to noise ratio and analysed in any desired location r and r From these two values it is therefore easy to calculate the covariance function B inherently used in Diva 4 9 For the error calculation at a point r we have the following procedure 1 Put a unit value at r and perform an analysis with 1 2 Save the result at the locations of the original data and of the error calculation where the analysis value is a 4 10 r oe 31 3 Calculate the background variance B r r at the error field location by Po r r 4 11 F a 4 Calculate the covariance B r r between the error location and data locations Since at the data points 7 located at r Diva application provides A pa 4 12 B r r 1 the covariance Bir r is obtained as A Pi B r r 4 13 ae Up to the multiplication constant 1 1 po the non dimensional covariance of a point in position r with a list of other points can therefore be obtained by putting a unit data value in r and taking the value of the analysis at the coordinates of the list of points To illustrate the procedure we take a simple case with one point in the center of the domain and another point near the boundary Near the boundary data points influence more easily the analysis because rigidity is reduced Fig 4 1 This translates into a larger background variance Error fields will therefore be larger near boundaries when there are no nearby dat
109. h 26 7LDYNZ L nent gt Zero size array at idivainc h In subroutine extrt3 idivainc h 22 PARAMETERCnrea 25 68800088 gt Integer at lt gt too large idivainc h 23 PARAMETERCnent 2500000000 gt Figure A 5 Error message obtained during compilation A 2 4 Compilation problems A 2 5 Why do I get this error The array S defined in the various programs located in src Fortran Calc is too large to be handled by your compiler How to solve it You need to recompile the sources after reducing the values of parameter nrea in file src Fortran Ca PARAMETER nrea 150000000 Then use script divacompile to get the new executables see Section 1 3 1 If you get the same error message reduce again the value of nrea A 2 6 Undefined references to NetCDF routines Why do I get this error The NetCDF library required for compiling of net cdfoutput f netcdfoutputfield f and netcdfoutputerror f is not compatible with your compiler or not found by the linker How to solve it You have to make sure that di vacompile includes the appropriate link path 162 PSEUDO DYNAMIC ALLO storage areas NREA maximum NENT maximum IRE maximum IEN maximum I REMAX total n I ENMAX total n IPRC precisi COMMON ALLO Ctifdef DIVADYNAMIC c c c Declare and c COMMON SDYN c COMMON LDYN c c Helse PARAMETERCnrea PARAMETERCnent CATION OF MEMORY S and L are the two main amount
110. he data coverage the error field is expected to be higher where the data coverage is lower 2 the noise on the data the more uncertainties we have on the data the higher will be the error field OI Sections 2 2 allows the simultaneous derivation of analysis and error fields e r 07 r g r D g r 4 1 where g is the local variance of the background field This equality highlights that the error is provided by the analysis of a pseudo data array containing covariances g r 29 However in principle a new analysis has to be performed for each point r in which the error is requested and then is not adapted for large data sets On the contrary the error calculation in Diva is not trivial since the covariance functions are never explicitly specified We will see in the next sections how Diva computes this error field 4 2 Methods implemented in Diva According to the data sets the type of analysis with without dynamical constraints constant or variable correlation length several error calculation methods are available with Diva 4 2 1 The poor man s estimate To circumvent the main problems unknown covariance function and repeated analysis Brasseur 1994 estimated the error by analysing a vector of covariances with constant o As all co variances are identical the error can be assessed in all locations with the same analysis The advantage is the fast calculation but the drawback is a systematic underes
111. he group number all levels A subdirectory Meshes it contains the mesh files so that they can be re used for other ap plications Log files Two log files are generated e diva Log Log file of Fortran binaries run in output e var di iva3D 1og Log file of shell scripts execution in out put 3 139 Danalysis 13 CLIMATOLOGIES PRODUCTION DIVA 4D Diva can be used to produce climatologies for a given variable in an oceanic basin In this case Diva 3D tools are used to produce for successive climatological time periods 3D climatological analyses on the basin The resulting climatologies are gathered in 4D binary files GHER format and NetCDF The working directory to performs 4D analyses is GODIVA_mm_yyyy JRAx Climatology Contents 13 1 Climatology definition 1 2 2 ee ee eee ee ee eee ee 140 13 2 Diva 4D Climatology performance 0 02 ce eee eens 141 13 2 1 Actions performed by divadoall gt s cs ce ca cay ere ces 141 13 3 Input data preparation 2 2 2 eee eee ee eee ee ws 143 13 3 1 Inputs for input data preparation actions 143 13 3 2 Outputs of input data preparation actions 144 13 4 Production of Climatologies 0 2 ee eee renee 146 13 4 1 Inputs for production of climatologies 147 13 4 2 Advection constraint and reference field files 148 13 4 3 Diva 4D climatology producti
112. he maximum and the minimum values for L and or A parameter for each level a file CLminmax and or SNminmax must be placed in the divaparam subdirectory In this case the corresponding maximum and minimum values in the 3Dinfo file are ignored 2000 1500 1000 800 600 500 400 300 250 200 150 125 100 715 50 30 20 10 Example file 12 1 contour depth 12 2 2 The 3Dinfo file The information file 3Dinfo must be placed in the input directory and must contain all the following information and option flag values e var variable short name which names data files var lexvvx e L Number of the first level to be treated e L Number of the last level to be treated 131 e contour generation x x x if contour files are to be generated 2 if advection constraint anisotropic correlation along topography files are to be generated from topo grd 3 if contour files and advection constraint are to be generated e Cleaning data and Relative Length x x x x if data files are to be cleaned 2 if relative length files are to be generated 3 if data files are to be cleaned and relative length files are to be generated 4 if outliers are to be cleaned from data files 5 if outliers are to be cleaned from data files and relative length files to be gener ated e Parameter optimization Possible flag values are 0 1 2 3 1 2 3 10 10 30
113. higher are not used by the software except if you want to use the detrending tool Section 5 3 59 20 10 3 60 20 2 30 50 0 40 70 1 70 70 2 85 55 4 90 10 2 70 35 4 Example file 6 2 data dat 80 4 3 60 2 i 40 0 20 2 3 Po 20 40 60 80 Too Figure 6 2 Example of a data file and its graphical representation 6 2 3 Parameters The file input param par specifies the main analysis parameters and options of Diva A clear understanding of is essential for a proper use of the software A description of each parameter is provided below the example file Le The global correlation length L used for the analysis see Section 2 3 1 for the physical mean ing It has to be defined as a real positive number Note that the length of the finite elements will be computed according to the value of L icoordchange Specifies the desired type of coordinate system 60 Correlation Length lec 2 icoordchange ispec a ireg Xori dx 02 dy 02 nx it 0 0 1 0 0 yori 0 it 0 0 5 it 5 Example file 6 3 param par 61 icoordchange 0 if no change is necessary data position in kilometres 1 if data positions are given in degrees 2 if data positions are given in degrees and your domain extends on a wide span of latitude uses a cosine projection xscale to scale x coordinates by a factor xscale before doing anything for v
114. ical formulation the weights w are chosen from the study of the covariance between the values as a function of the distance between them 2 2 1 Mathematical formulation Let us recall previous notations from section 2 1 and introduce some new ones i the interpolated or reconstructed field Y the true unknown field d the vector containing the N4 data r the vector position The principle of OI is to minimize the expected error e r p r v x 2 3 stands for the statistical average where the bar Replacing the interpolated anomaly field by a linear combination of the data we have 2 e r gt wilr di r y r 2 4 We now have to determine the weights w that will minimize 2 4 Let us call w r the vector of size N4 containing the weights applied on the data to interpolate the field at position r The previous equation is now written as e r w d yi r pir w dd w 2y r d w We define the covariance matrix D dd and the covariance of the data with respect to the real field which is a function of r g vi r d 10 The expression of the error 2 4 becomes after some calculation elr plr w Dw 2g w gilt g Dg w D g D w Dtg 2 5 of which the minimum is reached when w D The corresponding error value is min e r y r g D g 2 6 and the interpolated field is computed as Na g
115. iculture FRIA for funding Damien and Charles PhD grants Diva was first developed during E U MODB and SeaDataNet projects the research leading to the last developments of Diva has received funding from the European Union Seventh Framework Programme FP7 2007 2013 under grant agreement No 283607 SeaDataNet 2 and from project EMODNET MARE 2008 03 Lot 3 Chemistry SI2 531432 from the Directorate General for Maritime Affairs and Fisheries Conditions of use Diva is a software developed at the GeoHydrodynamic and Environmental Re search GHER http modb oce ulg ac be group at the University of Li ge http Iwww ulg ac be and that will be further developed for SeaDataNet scientific data products in JRA4 activities Diva is copyright 2006 2013 by the GHER group and is distributed under the terms of the GNU General Public License GPL http www gnu org copyleft gpl html In short this means that everyone is free to use Diva and to redistribute it on a free basis Diva is not in the public domain it is copyrighted and there are restrictions on its distribution see the license http www gnu org copyleft gpl html and its associated FAQ http www gnu org copyleft gpl faq html For example you cannot integrate this version of Diva in full or in parts in any closed source software you plan to distribute commercially or not If you want to integrate Diva into a closed source software or want to sell a modified closed sourc
116. ields depending on the chosen flag number for analysis in the 3D info see Section 12 2 2 12 4 2 Diva 3D analysis outputs The outputs are placed in out put 3Danalysis and consist of The 3D analysis files in NetCDF and GHER binary format var levxx lyyyy fieldgher anl Var lover lyyyy anl nc var lrrrx lyyyy fieldgher ref var lavax lyyyy errorfieldgher anl var lxvxrx lyyyy ref nc Figure 12 1 Content of output 3Danalysis The 3D variable analysis NetCDF file contains the diva analysis of the variable and a set of variable related information fields relative error and error standard deviation fields variable masked using two relative error thresholds fields deepest values of the vari able field and the related masked fields It contains also fields of information about data distribution and outliers as well as fields of correlation length and signal to noise ratio parameters A subdirectory Fields containing all the Diva 2D output files for all levels GridInfo dat var lxrrxz ref var lxxrrx error var leerr anl var lxyrrx ascii ref var lvvrn errorascii var legercanl ne var lxrrx datapoint ref var larrx valatxyasc ref Vari lerrr asciisanl yar ler t ref pe valatxy var lxvxrrax var lxyrrz outliersbis var lrrrx outliersbis norm Figure 12 2 Content of output 3Danalysis Fields 138 A subdirectory datadetrend it contains trend data set files for trends i dat var lxvxrerz iis t
117. iginal data value analysed data value expected misfit Correlation length 3 69890785 Signal to noise ratio 0 902823746 VARBAK 16 7839489 For information in degrees latitude correlation length in km is 412 962524 paramfit dat Self explaining output from divafit When option r is used with divafit an adapted param par will be placed in input S N 1 99764168 VARBAK 1 14215052 gcvsnvar dat Self explaining output from divacv divagc divacvrand When option r is used with cross validation an adapted param par will be placed in input 188 SeaDataNet Home Page http www seadatanet org Diva Home Page http modb oce ulg ac be mediawiki index php DIVA GHER Home Page http modb oce ulg ac be Ocean Data View http odv awi de NetCDF http www unidata ucar edu software netcdf Msys http www mingw org msys shtml Cygwin http www cygwin com Matlab http www mathworks com Gnuplot www gnuplot info amp University of Li ge J http www ulg ac be 189 BIBLIOGRAPHY Abramowitz M amp Stegun I A 1964 Handbook of Mathematical Functions with Formulas Graphs and Mathematical Tables Dover New York Alvera Azcarate A Barth A Beckers J M amp Weisberg R 2007a Multivariate recon struction of missing data in sea surface temperature chlorophyll and wind satellite fields Journal of Geophysical Research 112 C0
118. ile and give in the corresponding flag values and run the divadoa11 files script For each action a specific inputs are needed 143 Action Inputs Data extraction darasource in Climatology qflist inClimatology Coastlines generation and Advection fields generation topogebco asc topo gebco or topo dat ascii file or topo grd GHER binary format file and its related TopoInfo dat ascii info file Data cleaning on mesh outliers elimination and generation of relative length fields divadata a directory which contains data set files of the considered layers di vaparama directory which contains coastlines coast cont 100z files for all considered layers and a param par file in input or input divaparam directory Parameters optimisation L and S N divadata directory which contains the data set files of the considered depths di vapa ram directory which contains coastlines coast cont 100 2 files of the considered basin and a template param par file in input or input divaparam directory Reference fields generation divadata directory which contains the data set files of the considered depths and time periods di vapa ram directory which contains coastlines coast cont 100xz files of the considered basin and a template param par file in input or aparam par var 100zz files in input divaparam directory 13 3 2 Outputs of input data preparation actions Outputs resulting from a
119. in km or degree according to param icoordchange i nordchenae 6 if position of data in km i if position of data in degree A ispec Coutput files required comments to come 3 ireg i xori Corigin of output regular grid min values of amp gt yori Corigin of output regular grid min values of Y B dx lt step of output grid gt it dy step of output grid 25 nx max x of output grid i A 99 Figure A 4 Example of bad ends of lines How to solve it Working on a individual file the command charles gher13 divastripped dos2unix name _of _the _file does the conversion between Windows and Unix end of lines According to the Linux distri bution dos2unix may requires options to perfom the conversion For example with Man driva 2010 it is necessary to add the option U charles gherl3 divastripped dos2unix U name _of _the _file When working with GODIVA the transformation is automatically done on all the files dos2unix is available using the package manager of most of Linux distributions but sometimes with the name fromdos 161 cygdrive d DIVA diva 4 2 0 src Fortran idivainc h In subroutine extrt2 idivainc h 22 PARAMETERCnrea 2568666000 gt Integer at lt gt too large idivainc h 23 PARAMETER Cnent 2500000000 gt Integer at lt gt too large idivainc h g 25 COMMON SDYN S lt nrea gt size array at idivainc
120. ing utility 1 931 lapack Comprehensive FORTRAN library for linear algebra operations 46k _libgmp devel Development library for GMP arbitrary precision arithmetic library F igure 9 2 Installi ng g n up l ot 240k _libgmp3 Runtime library for GMP arbitrary precision arithmetic library i 15k_lbmpfrdevel A library for multiple precision floating point arithmetic with exact round wit h Cygwin 46 libmpfr0 A library for mutiple precision floating point arithmetic with exact rounding 85k libmpfr1 A library for muttiple precision floating point arithmetic with exact rounding 205k mathomatic Computer Algebra System 196 mpfr A library for muitiple precision floating point arithmetic with exact rounding 7 425k octave The GNU Octave language for numerical computations 1 605 octave doc PDF documentation files for GNU Octave 5 662k octave forge octave sf net nja a O LI nja ja nja o ja nja nja nja nja nja nja nja nja Hide obsolete packages lt Pr c dent Suivant gt Annuler ADAPT the following to the gnuplot executable gplot cygdrive c cygwin usr gnuplot bin wgnuplot exe a From divast ripped after running an analysis type divagnu this will create the figures in directory gnuwork plots Note that divagnu will try to create all the possible figures even if the corresponding script was not run e g plot of outliers when no outlier detection was performed This is why so
121. ith the analysis the FE method prevent the information to cross land Hence the error reduction due to the analysis is lower with the hybrid method than with OI 2 Close to the coasts the variance of the background field in Diva is increased due to the specified boundary conditions Finally the error using the real covariance function Fig 4 2d is also close to the hybrid results The main differences between the two methods occur in the coastal areas for instance in the Adriatic Sea or around Cyprus In these regions the error is lower when the real covariance is employed because it allows for the consideration of coastline effects The choice of one particular method depends on several factors e The size of the output grid e The number of analyses to be performed e The sources of anisotropies advection coastlines If the objective is limited to having an indication of the area where the analysed field cannot be trusted then the poor man s estimate is sufficient If a more complex error field is to be constructed a bypass is the reduction of the output grid resolution This solution is particu larly welcome when a large number of analyses O 107 is required as it is the case for a climatology repeated analysis on months and depth levels 36 Act Jove A091 408 Uew JO0d Joce dove A091 408 Figure 4 2 Error fields computed using four different methods a OI b poor man s estimat
122. l MacBook Pro de GHER divastripped gherulg S uname a Darwin MacBook Pro de GHER local 11 3 0 Darwin Kernel Version 11 3 0 Thu Jan 12 18 47 41 PST 2012 root xnu 1699 24 23 1 RELEASE _X86_64 x86_64 A 1 3 How to register to the user group A 1 4 How can I use Diva in R Matlab IDL Ferret or any other software There are basically two ways 155 a Using special binaries and preparing fort files for Diva This approach has been taken in the incorporation of Diva into ODV and in the Matlab function in http modb oce ulg ac be mediawiki upload divaformatlab zip It requires some time you can try to understand the matlab function to see how to prepare the files and recover the results but has the advantage that you do not need to install Diva compilers NetCDF or Cygwin It also avoids creation of large subdirectory trees for Diva b Using a full Diva installation and preparation of normal Diva input files In this case you must have installed the Diva package and have access to either directly unix or Cygwin shells You also need to prepare a shell script You can call it whatever you want let s say mydivacall and it contains the instructions you want to execute with Diva So typically what you would type in the command line session when trying to make the analysis bin bash export LC_ALL C PATH SPATH cd home pwd echo This is a test echo Hello Diva world
123. lating the misfit in the minimisation part of Diva we include now an unknown trend value for each class dc dc So mldi do p z ys D gt ts di do Gla y 5 11 tECy iEC2 If we assume we know the function y x y minimisation with respect to each of the unknowns da yields E Dicc hi di 9 24 yi 5 12 Dee Mi and similarly for the other classes Hence we see that the trend for each class is the weighted misfit of the class with respect to the overall analysis The problem is of course that is not known since it is also the result of the minimisation process However we can iterate and start with an analysis without detrending Then using the field of y we can calculate a first guess of the trends in each group and subtract if from the original data Then a new analysis can be performed the trends recalculated and so on until convergence 49 5 3 2 Implementation Here we generalize by allowing several groups of classes The detrending is done hierarchically l gt oU N Trends for the first group are calculated and removed from the data The second group is treated and so on Once the data has been detrended a new diva analysis is performed better estimates of the trends This loop is repeated a predefined number of times 5 3 3 Generalizations With the new analysis the data analysis misfit or residual can be reused to calculate We can further add regula
124. lds If reference fields are present in the input divarefe subdirectory they will be used auto matically by Diva to perform 3D analysis using the reference field files as a background To use a variable reference field as background for given level number the GridInfo dat and at least one of the three types of reference files var lxvvxx ascii ref 2D ascii file var laxxx datapoint ref reference at data points or var lxxxx ref binary 2D GHER format must be present in the divarefe subdirectory Convention The use of reference fields for a given level is activated when the corre sponding reference field files are present in the divarefe subdirectory 137 Using detrending To perform Diva 3D analysis with detrending of data a det rendinfo file must be provided in the directory input The det rendinfo has two columns and one line where the group number of detrending is prescribed in the first column and the iterations number in the second see Section 5 3 In this case all data set files should have the right number of columns starting from the fifth and where classes are numbered Convention Diva 3D analysis with data detrending is activated when det rendinfo file is present in the input directory Running diva3Ddress To run Diva to perform a 3D analysis one has simply to run the shell script file di va3Ddress in divastripped Diva 3D analysis outputs are normal analysis of a variable or reference f
125. le analysis with a relatively low number of data For climatologies which requires the repetition of numerous analysis the use of Diva is necessary The server is accessible at http gher diva phys ulg ac be web vis diva html and a complete de scription of the interface is found in Barth et al 2010 11 1 1 Implementation The web interface of Diva is based on OpenLayer http openlayers org and is OGC compliant Open Geospatial Consortium http www opengeospatial org The server is a 2 quad core Xeon E5420 running under Linux The server and client software are available under GPL The Web Map Server use Python language along with the plotting packages mat plot1lib http matplotlib org and basemap http matplotlib org basemap Client Server Upload observations Bounding box and range of obs Figure 11 1 Communications between the Request analysis server and the client for analysis with Diva Range of analysis on web Request images Return images XML HTTP Requests Web Map Server WMS protocol 11 1 2 A complete example The steps to follow to obtain an analysed field is the following 1 Upload your data file see Section 6 2 2 for the correct file format Fig 11 2 2 Define the analysis grid Fig 11 3 3 Select the analysis parameters Fig 11 4 The script divafit provides an estimate for the correlation length Fig 11 5 4 Perform the analysis Fig 11 6 121 Chapter 11 OTHER
126. le of how the function can be used Directories linux binaries and windows_binaries 11 3 2 Usage The syntax divagrid m is close to matlab griddata m function but has additional pa rameters To run Diva with matlab divagrid m has to be in the matlab path as well as the three executables e contourgen exe e generopt exe e diva exe figures presented in diva workshop and SDN annual meeting Part Ill 3 D analysis amp climatology production GODIVA 126 Diva can be used to perform 3D analysis for a given variable in an oceanic basin In this case Diva tools are generally applied to successive horizontal layers at different depths of the basin The resulting 2D field analyses are gathered in 3D binary and NetCDF files The working directory to perform 3D analyses is the same as for 2D analyses GOD IVA_mm_yyyy D IVA3I D divastripped where mm and yyyy indicate the month and the year of the considered release Con tents 12 1 Input subdirectories 20 00 0206 ee ek ee ee ee 127 12 1 1 divadata subdirectory 2 6 0 eee et 127 12 1 2 divaparam subdirectory c o lt s be eee bee a 128 12 1 3 More input subdirectories 2 05 ocea eb we ee eee 129 12 2 Input info files contour depth amp 3Dinfo 130 l2enl contour depth 4 6444 256 od ee eee SE a a a aa a 131 1222 The DINEO lE o we ee ea Eee ew Oe RAE CRS 131 12 3 3D analyses inputs preparation 2
127. listed e Data extraction Possible flag values 0 1 1 and 10 If you activate the data extrac tion flag value divaselectoro contour depth 0 in the driver file the execution of divadoall will run the DV4 automatically including interpolation to the levels specified in Data will be extracted from the ODV spreadsheat file s specified in datasource Command divaselectorODV4 will recognises if the data export to ODV file was done with depths in meters or it was done with pressure in dbar vertical coordinate you can either choose to map it as if they were meters or apply the Saunders 1981 correction Choose flag 1 to use pressure coordinate and assume they are me ters and flag value 10 to use pressure coordinates and transform to meters by using the Saunders approach If there is a gflist file the selection with divaselectorODV4 will only use those measurements for which the quality flag is one of those found in the file qf List In the absence of qf1list no quality flag analysis is done and all data taken Note you can specify several ODV4 spreadsheet files as input files one file name or full path per line in datasource file they must have the same variables naming conven tion depth coordinates and quality flags conventions e Boundary lines and coastlines generation Possible flag values are 0 1 2 and 3 When this action is activated flag gt 1 you must provide i
128. ll contours e g Fig A 12 which will not necessarily add quality to your analysis A 2 11 Analysis yields empty field After the execution of divacalc you get very small input files with only one grid point Why do I get this error The most frequent reason is that the param par file has been modified during the execution of Generalised Cross Validation and the process was interrupted before it ends leaving a parameter file similar to A 13 Note that in order to save computational time nx and ny are set to 1 since the analysis at every grid points is not necessary How to solve it Simply edit param par to write the correct values of nx and ny then run again divacalc or divadress to have an analysis on the desired grid A 2 12 Windows runs out of virtual memory during diva execution A 2 13 Why do I get this error The problem arises probably because you have a computer with little RAM 167 60 50 40 30 20 10 Figure A 12 Small contours cre ated from DBDBV topography in the North Atlantic at 4500 m depth Ht A 2 Ht B Ht l Ht l A diva 4 2 1 divastripped rrelation Length icoordchange ispec Cerror output files required ireg xori Corigin of output regular grid min values of K gt 9661 yori Corigin of output regular grid min values of Y gt 7 it A i 1 1 vi 9 999 dx step of output grid 9999 dy step of output grid 9999
129. llow you not to have message error A 2 8 2 Generate a mesh with a value 3 5 times larger than the correlation length you want to use for the resolution this can be done be simply editing file input param par changing the value of correlation length and run divamesh 3 Once the mesh is generated edit again param par and assign the correct value to the correlation length and run an analysis with divacalc This procedure should help you to save memory otherwise used for the finite element mesh Working with a coarser mesh will not affect excessively your results 165 A 2 9 Permission denied for execution of d ive d DIVA diva 4 2 0 divastripped Data points 2 WARBAK 1 errors will be calculated To calculate data weights using Length scale SNR xi 4 660600 1666 666 Data 3 columns hence without relative weights divacalc line 325 bin diva a Permission Output of results for user fort 84 fort 82 fort 83 fort 87 fort 86 output fieldgher anl output valatxyascii anl output fieldascii anl output errorf ie ldgher anl _ output errorfieldascii anl output fieldatdatapoint anl 0utput gcvval dat fort 71 fort 77 Creation of file GridInfo dat fort 87 gt output ghertonetcdf fort 87 Creating netcdf file for field and associated error start end of file apparent state unit 87 named fort 87 las
130. ly nothing else than the analysis at the new data location again using the stiffness matrix Ko Hence the recipe for calculation of the covariances is now clear 1 Create and invert once the stiffness matrix Ko constructed without any data points 2 For each point for which the covariance is needed a Create the elementary charge vector u S b Apply the already inverted stiffness matrix K and the multiplicative factor of 4 17 to derive the values of yo and y c Compute the covariances using 4 11 and 4 13 The efficiency of the method is due to the fact that we remain within the same Diva execution where the matrix inversion K is much less expensive than the initial factorization Indeed the cost is reduced by a factor N with N typically around 104 105 thus gain is again significant Each covariance can be stored on disk for later use by the error calculation Overall the cost for the full error calculation is now roughly equivalent to twice the hybrid ap proach which is a substantial reduction compared to a brute force approach The only unsolved problem is the storage of the covariance functions if they are calculated before the actual Diva run for the error calculations This storage will take N x Ne words when JN points for error cal culations are requested The intermediate storage can however be avoided by using Unix pipes between concurrent execution of two Diva cores one providing the covariance for the other on
131. lysis at the data points is calculated according to A B B R 3 3 The data covariance matrix is the statistical average __ of data products dd B R 3 4 where it the transposed matrix or vector For uncorrelated observational errors error covariance matrix R is diagonal with a variance e for point i i e R diag c In that case we can show that the variance of expected misfit at point 2 is a ss i 2 1 Ay 3 5 In practice covariance matrices are known only imperfectly their structure is often considered to be fixed but with imperfectly known amplitude In other words it is often assumed that o 3 6a R eR 3 6b 5 tg P e 3 6c where matrices are fixed and non dimensional while the field variance g and the error variance are imperfectly known but their sum equal to the data variance assuming that spatial averaging has a similar effect than statistical averaging the ergodic hypothesis By definition of the average error and field variance we have 22 N 1 1 1 R N da giace R trace R 1 3 7 ee ee 8 1 3 8 o trace trac NN 7 yo The unknown parameter that controls the analysis is the ratio of the signal and noise variances called signal to noise ratio 3 9 because matrix A depends only on 1 A B B A R 3 10 Dividing both sides of Eq 3 6c by o and e we also find that d d a 2 Oo ina 3
132. mis et al 2001 Some adaptations have been made to the OI scheme to improve the numerical efficiency e g Hartman amp H ssjer 2008 Zhang amp Wang 2010 The quality of OI and other gridding techniques relies on the correct specification of the co variances of the observational error and of the background field The covariance functions used in OI are not restricted except that the covariance matrices have to be positive definite and symmetric allowing for example correlated observational errors Yet in most cases covari ances between two points are parametrized by simple expressions such as a Gaussian function depending on the sole distance between the points leading to isotropic functions which are not always well adapted to oceanography Indeed wich such functions the propagation of informa tion through islands and continents is enabled To circumvent this problem adaptations of the OI scheme are necessary in order to allow the use of anisotropic functions e g Tandeo et al 2011 Finally although OI provides the best analysis in the sense that it gives the minimum expected error the method has the drawback of not being fully objective the covariance of the unknown field and the standard deviation of observational errors generally have to be chosen subjectively by he user 2 3 The Variational Inverse Method and its implementation The Variational Inverse Method VIM was initially designed for climatology purposes
133. n divastripped SEC Doc JRA4 Climatology 7 directories e DIVA3D bin contains the executables generated by the code compilation Pre compiled executables for various operating systems are provided in the sub folders e DIVA3D divastripped is the main working directory at the 2 D level e DIVA3D src contains the Fortran source code This is where the compilation has to be done e Doc contains the link to publications For MTpXusers you find the corresponding BiBTpXentries in the file DivaPublications bib e JRA4 Climatology is the main working directory at the 3 D and 4 D levels 1 3 Generation of the binaries executables There are two possibilities to obtain the binaries 1 Compile the source code 2 Copy the provided binaries The second option is provided for cases where the compilation was not possible mainly because of missing libraries e g NetCDF or Fortran compilers 1 3 1 Compilation Go in the source directory charles gherl13 GODIVA_07_2012 cd DIVA3D src Fortran and edit the configuration file divacompile_options for the compilation according to your machine Name of the fortran compiler ex ifort gfortran pgi compiler ifort Compilation flags flags 03 Netcdf library nclib usr local lib netcdf3ifort libnetcdf a If your installation knows the nc config command the compiler and the
134. n from the Naval Oceanographic Office website Example of improper contours oo a we RA OE SS 195 15 17 17 33 45 7 7 Topography extraction from NVODS 20 73 7 8 Topography from Naval Oceanographic Office website 74 7 10 Contour generated every 500 m from surface to 2500 m 75 8 1 Mesh on a simple domain anaoa eee Re ERE RRR RS 80 8 2 Mesh refinement around the island a o a a 81 8 3 Example of analysed field ona aaa bee REE Re eS 82 8 4 Analysis without coordinate change ooo e ede Hes 86 8 5 Analysis with coordinate change ooo e 87 8 6 Analysis with advection but without coordinate change 87 8 7 Analysis with advection and coordinate change 88 DE J a a ROS EEE ESE RDG ASE ESE EDE ES EELEHESHRESDAS 89 8 9 Diffusion coefficient divided by 110000 compared to the icoord 1 case 90 9 1 Gnuplot Window e so os eac sanes ane SRR Rw Oe Ree ES 93 9 2 Installing gnuplot with cygwin 56 6 ee ke eee Hee Hee wee 94 9 3 Visualization with gnuplot lt 404 404 doe amp Oe Ae We we Ws 95 9 4 Examples of figures created with Matlab 98 9 5 Plots of results with NeBrowse 2 222262 8 bee eRe SRE ER ES 99 9 6 Plotsof results with Neview 422222 eee hee eee eae eee a ewan 101 10 1 Finite element mesh and salinity measurements used for the application 105 10 2 Fit o
135. n the input directory the files TopoiInfo dat and topo grd in addition to contour depth file 1 if contour files are to be generated 2 if advection constraint Anisotropic correlation along topography files are to be generated from topo grd 3 if contour files and advection constraint are to be generated e Cleaning data and Relative Length Possible flag values are 0 1 2 3 4 and 5 if data files are to be cleaned 2 if relative length files are to be generated 3 if data files are to be cleaned and relative length files are to be generated 4 if outliers 5 if outliers ated are to be cleaned from data files are to be cleaned from data files and relative length files to be gener e Parameter optimization Possible flag values are 0 1 2 3 1 2 3 10 10 30 and 30 1 if correlation length parameters are to be estimated 2 if signal to noise ratio S N parameters are to be estimated 150 1 if correlation length parameters are to be estimated and vertically filtered 2 if signal to noise ratio S N parameters are to be estimated and vertically filtered 3 if both correlation length and signal to noise ratio parameters are to be esti mated 3 if both correlation length and signal to noise ratio parameters are to be esti mated and vertically filtered 10 if correlation length parameter
136. nce field with a semi normed analysis with an increased value for L divaseminorm performs an analysis with a semi normed reference field computes the ref erence field divarefe computes the anomalies with respect to the reference field divaanom makes the analysis divacalc and add the reference field to the ob tained analysis divasumup divasumup performs the last step of a semi normed analysis the sum of background field and analysed anomaly field 6 1 5 Quality control and error field divacpme computes de the clever poor man s error divaexerr advanced method to compute the exact error field divaqc divaqcbis divaqcter performs quality control on data see Section 3 3 57 6 1 6 Misc divaclean cleans up the working directories by removing fort files from divawork and meshgenwork as well as output files from output divagnu prepares the plot of outputs using Gnuplot divaload load the input files from a given directory divasave saves the output files in a given directory 6 2 Input files 6 2 1 Contour The contour file coast cont delimits the region where the analysis has to be performed i e it specifies the boundary between land and sea The file is defined this way The first line indicates the number of contours M in the region of interest The second line tells the number of points N1 in the first contour The next N lines are the coordinates of the points of the
137. nd field Fig 2 4 In this particular case we performed an analysis with a point located at the center 0 0 of a square domain The correlation length is equal to 1 and the signal to noise ratio is taken equal to 1000 The exact function in an infinite domain is given by ig r K r K 2 24 r TIT 2 24 where r is the Euclidean distance L is the correlation length and K is the modified Bessel function Abramowitz amp Stegun 1964 page 359 The choice of this correlation model results from the mathematical structure of the variational method Brasseur et al 1996 Figure 2 5 shows both the exact solution 2 24 and the correlation function by a single point analysis The two curves are close to each other the differences between the two curves being only due to the boundaries In an infinite domain the correlation function was shown to be proportional to the Kernel of the VIM norm The Kernel function can be used to calibrate Diva parameters ao 1 4 so as to fit observed covariance functions This principle is used by the tool divafit which helps one to estimate the correlation length see Section 7 3 1 It can also be used for specifying the covariance for error calculations Chapter 4 16 Chapter 2 GENERAL THEORY 2 3 Variational Inverse Method Figure 2 4 Analysis of a single data point with high signal to noise ration and no background field 0 8 0 6 Fig
138. nd multiplying by L Nd o _ a i Jip 5 uL d plz yp J vwy VVo L Vo Vo aLe dD j 1 2 2 13 Hence ao fixes the length scale over which variations are significant to move the kernel function of the norm from one to zero aL 1 2 14 uL fixes the relative weight on data signal o versus regularization noise 2 pL 4r AnS N 2 15 13 Finally a fixes the influence of gradients aL 2 2 16 where 1 if penalization on the gradients is enforced 0 if no penalization is enforced is a non dimensional parameter close to one if the gradients are to be penalized with a similar weight than the second derivatives Weights on data A weight u can be assigned to each data d This weight expresses the confidence you have in a particular data It is expressed as a function of the signal to noise ratio and the correlation length Brankart amp Brasseur 1996 o Ar when 1 In Diva the fourth column of the data input file if present allows one to apply a different relative weight to each point Background field Normally interpolation and extrapolation works on anomalies with respect to a background field Eq 2 1 Diva allows you to work with different background fields e no treatment is applied the data you treat are already anomalies e the mean of data is subtracted from the data values e the linear regression plane is subtracted e additional
139. ng dat see example file 10 3 containing a list of values for the signal to noise ratio on which you want to try the estimator Type divagcev to perform the GCV on these values Optimal values for the parameters are given in gcvsnvar dat example file 10 4 You can then modify param par example file 10 5 according to these values before performing an analysis Example file 10 3 gvcsampling dat S N VARBAK 68 7858658 2 05896711 Example file 10 4 gcvsnvar dat 10 1 6 Analysis Diva analysis is executed by typing divacalc It not only provides the analysed field but also the error field if varbak is not equal to zero Results are presented in Figs 10 3 and 10 3 107 Le correlation length in units coherent with your data 2 76536822 icoordchange 0 if no change of coordinates is to be performed 1 if positions are in degrees and if you want to use real distances ispec output files required comments to come ireg mode selected for background field O null guess 1 mean of data 2 regression plan if at least 3 non aligned data provided xori x coordinate of the first grid point of the output 10 0 yori y coordinate of the first grid point of the output 30 dx step of output grid 0 2 dy step of output grid 0 2 nx number of grid points in the x direction 236 ny number of grid points in the y direction 81 vale
140. nge of bounds a maximum and a minimum The bounds can be prescribed for all levels in the 3Dfile see Section 12 2 2 or varying with levels by giving the list of bound in files CLminmax and or SNminmax To perform parameters optimisation one can place a default param par with an approxi mated values for correlation length L signal to noise ratio snr and variance VARBAK parameter values in input divaparam or input directory If parameter bounds are desired for each considered level one can place a bound file corresponding to the parameter s to be optimised CLminmax and or SNminmax in input divaparam or prescribe a general one in 3Dinfo file Choose the appropriate flag value in the 3Dinfo file see Sec tion 12 2 2 The 3D analysis parameter optimisation output is a set of param par indexed following the variable name and the corresponding level and summary files of estimated pa rameters before and or after vertical filtering 135 Input Output in input divaparam param par param par var lrrre in divaparam with optimised L snr and VARBAK or var CL dat filtered var CL dat notfiltered in input divaparam var SN dat filtered var SN dat notfiltered var VAR dat filtered var VAR dat notfiltered 12 4 Performing 3D analyses diva3Ddress 12 4 1 A simple analysis input files Input files in divastripped input The minimum input files for performing a Diva 3D analysis consists of e
141. ngular elements used for the mesh 2 25 2s ce eee eee es Analysis of a single data point with high signal to noise ration and no back gromad Held ss s Led tat iage ew dds tee ei be eRe eee eh es The theoretical Kernel function is given in red while the black curve comes from the analysis of a single point with a unit value Analysis in a square domain with a point at the centre and another at 4 5 0 Error fields computed using four different methods Single data point with unit value ina solid rotation Same as Fig 5 1 but without advection 2 000 Same as Fig 5 1 but with smaller length scale 0 Single data point with anti clockwise rotation and with diffusion Single data point with clockwise rotation and with diffusion Example of a reconstruction without and with detrending Trends obtained from the data using the detrending tool Example of a contour file and its graphical representation Example of a data file and its graphical representation Area selection with software GeGbcoCE_GridOnly Data exportation with software GebcoCE_GridOnly Topography from GEBCO one minute topography Individual measurements of depths 2 000 Interpolated topography deb ee eee Ree Ee Eee ee eee x Topography extractio
142. nmax file is provided in divaparam MinC L minimum value for correlation length ignored if a CLminma file is provided in divaparam MazxSN maximum value for signal to noise ratio ignored if a SNmi nmax file is pro vided in divaparam MinSN minimum value for signal to noise ratio ignored if a SNminmax file is pro vided in divaparam Gnoplt 1 if Gnuplot plot files are to be generated MinGP minimum value of the variable for Gnuplot plots MaxzGP maximum value of the variable for Gnuplot plots Title String Title string for 3D NetCDF file Variable name string Variable long name string Units string Variable units string 133 psal 25 3 Data cleaning 0 3 30 Perform analyses Variable minimum Variable maximum 40 Title string for psu Variable var to be analysed located in data var 1xxxx Number of the first level to be processed bottom Number of the last level to be processed surface Contours generation 0 1 2 3 Parameters optimisation 0 1 2 1 2 3 3 and or 10 20 and 30 inimum value for correlation length aximum value for correlation length inimum value for S N aximum value for S N Gnuplot plots generation 1 if yes 0 if no Diva 3D analysis of the variable Variable long name string Potential
143. o Diva format coastlines Simply copy coastline file in the input directory with the name coast coa along with a param par file and type divacoa2cont in the shell This provides you the new file input coast cont 74 Depth 0m Depth 500 m Depth 1000 m Latitude N Latitude N Latitude N at 105 10 95 3 85 a2 ms m 105 10 35 3 85 a na m mos a0 Longitude E Longitude E Longitude E Depth 1500 m Depth 2000 m Depth 2500 m Latitude N Latitude N Latitude N at 05 10 x 3 85 a2 as it m05 a0 35 9 85 a ma m mos a0 Longitude E Longitude E Longitude E Figure 7 10 Contour generated every 500 m from surface to 2500 m 7 2 4 From a mask Simply look at contourgen f and create the mask as you wish Alternatively you can create a pseudo topography with adequate pseudo depth at which you draw the contour 7 3 Determination of analysis parameters Two key parameters have to be adjusted before running an analysis the correlation length L and the signal to noise ratio A Several tools are provided in order to help the user for the determination of these parameters 7 3 1 divafit The script divafit uses the data input data dat for a direct fitting of the covari ance function see Section 2 3 3 Note that the fit needs a sufficiently large data set Command description divafit performs a fit
144. o grd and TopoInfo dat in the output directory The corresponding topography is drawn on Fig 7 8 7 2 Creation of contours As seen in first chapter a relevant asset of Diva is the fact that it takes into account real coast lines and topography of the region of interest We explain hereinafter the techniques to produce a correct coastline file of which the description is provided in Section 6 2 1 71 Naval Oceanographic Office DBDB V Version 4 3 Area Output Options CHRTR binary CHRTR MEDAL 6 0 CHRTR MEDAL 7 0 CHRTR AESS NIMAMUSE Raster VRML 2 0 ARC ASCII Grid YXZ GMT Contour Image PostScript Position 135 90 45 0 45 ASCII Report Eso Ho Bio Gos mo 0 05 GMT netCDF Grid IZ Coverage I Grid Mouse Position Loniet Zoomin Previous Pan Global GMT Contour Image GIF 30 135 Point Area Trackline Radial Extraction Properties Notation Example N 40 30 40 ox Top N33 Bottom N30 Java Applet Window Left jE 12 Spacing in Minutes 0 6 Coordinate System Equatorial v Right E 9 Naval Oceanographic Office Figure 7 6 Topography extraction from the Naval Oceanographic Office website 7 2 1 By hand The first possibility is to build your file by hand having at your disposal the location of different points of the coast longitude latitude simply create a file containing M contours with the i th contour having being made up of N poin
145. o2diva will generate two files in divastripped output for describing the topography topo grd a binary file containing the gridded topography TopoiInfo dat aascii file describing the topology of the grid and similar to GridInfo dat You can further check the two files by copying them into the divastripped input di rectory and executing divacont and divagnu If results seem right you can save the files TopoInfo data and topo grd into your main data directory to be used with divacont on all levels defined by contour depth If everything is stable you can erase topogebco asc and topo gebco to save disk space 7 1 2 Method 2 interpolation of individual topography measurements The principle of this method is to apply a Diva analysis to a data file containing depths at various locations Get topography measurements In the present example data points are extracted from http topex ucsd edu cgi bin get_data cgi in the same region as the previous case 9 12 W x 30 33 N The output file is com posed of three column longitude latitude depth i e the same format as data dat files used by Diva Once the file is downloaded edit its name in topo dat Fig 7 4 shows the individual measurements coloured dots in the region of interest 68 Depth m 33 N 1000 30 0 32 N 1000 Latitude 31 N 30 30 wW 11 W a 10 W W Longitude Figure 7 3 Topography from GEB
146. ocity must be in m s diffusion in m s decay in 1 s and source in variable units s Other limitations e With decay or source activated i reg should be zero but is not checked e Poor man error field is really bad for these cases 48 5 2 2 Example 5 3 Detrending data by defining groups and classes When analysing climatological data one is very often faced with data sets that have heteroge neous coverage in time and or in space This can lead to misinterpretations of the analysis if for example there have been much more measurements during a specially warm year than during other years It is also not uncommon that there are much less cruise data sets in stormy periods than in calm periods Here we present a method to deal with such problems by defining classes and groups A group is simply one way of subdividing the data into different members For example a group can be based on years and the classes are 1995 1996 1997 if we are looking at this period Another group could be based on seasons and classes could be winter spring summer and autumn 5 3 1 Theory In the functional to be minimised by Diva there is a data analysis misfit term Na do Haldi lai i 5 10 i 1 where ju is the data weight on data d found in location x y The solution of the minimisation is the analysed field y x y If we define one group each data point is in one and only one class C of this group Hence when calcu
147. of real variables in main vector amount of integer variables in main vector L index of real used during execution index of integer used during execution umber of real required for execution umber of integer required for execution on Creal 4 or real 8 gt IPRC I RE IEN I REMAX I ENMAX L allocatable and in common S L 15000000 gt 20000000 Figure A 6 Solution to the resource problem ic DOCUME 1 Char les LOCALS 1 Temp ccK1L353 o netcdfout puterror f text x8a4 gt undefined reference to nf_strerror_ ic gt DOCUME i Char les LOCALS 1 Temp ccKiL353 o netcdfout puterror f text xa gt undefined reference to nf_create_ ic DOCUME 1 Char les LOCALS 1 Temp ccK1L353 o netcdfout puterror f text xabf gt undefined reference to nf_def_dim_ ic DOCUME 1 Char les LOCALS 1 Temp ccK1L353 o netcdfout puterror f text xae5 undefined reference to nf_def_dim_ ic DOCUME 1 Char les LOCALS 1 Temp ccK1L353 o netcdfout puterror f text xbi1 gt undefined reference to nf_def_var_ ic DOCUME 1 Charles LOCALS 1 Temp ccK1L353 o netcdfout puterror f text xb3e gt undefined reference to nf_def_var_ ic DOCUME 1 Charles LOCALS 1 Temp ccK1L353 o netcdfoutputerror f text xb78 gt undefined reference to nf_def_var_ ic DOCUME 1 Char les LOCALS 1 Temp ccK1L353 o netcdfout puterror f
148. of the data correlation function based on the whole data set divarit r puts the new value of L in param par in function of the fit divafit n performs the fit on a sample of n n 1 2 couples of data sub sampling Example divafit r 100 performs a fit on 4950 couples of data and update the file param par 75 Tips 7 2 When dealing with very large datasets using divafit with sub sampling may save you a large amount of time m Note when using advection constraint and variable L di vafit will not provide a very mean ingful value Output files In output file output paramfit dat the best estimates are given and could be used as parameter values for running Diva Estimates of the correlation length are rather robust while those of the signal to noise ratio are neither precise nor robust especially for large values Output file covariance dat is the data based covariance function column 1 distance between points column 2 covariances column 3 number of data couples used to estimate the covariance Output file covariancefit dat allows looking at the fitted covariance function column 1 distance between points column 2 data covariance column 3 fitted covariance Finally file param par fit is the original param par file except that the correlation length has been replaced by the fitted value Note always have a look at the fit to judge on its quality 7 3 2 divagcv The script di vagcv ex
149. on column 1 the class number and on columns 2 the final trend value associated with it Columns 3 and 4 correspond to the next to last iteration and the last columns to the first iteration divagnu produces plots for the trend in each group 51 Notes e Presently you can define at maximum 5 groups with each group having 50 classes mem bers You can increase these limits by editing and compiling src Fortran detrend e It is assumed that the mesh already exists otherwise execute di vamesh before Additionnal options If you provide file det rend order in input then the columns for detrending will be taken in the order specified in the file Example if detrend order contains 8 5 7 6 and we call divadetrend 3 columns 8 5 7 will be used in this order for detrending If there is no fille det rend order then divadetrend 3 will use 5 67 in this order file det rend order or default order is written in fort 56 in divawork during execu tion 5 3 5 Example The example located in Examples Trends contains data sampled from a spatial pattern sin cosine structure over which was added e a seasonal cycle e a daily cycle and e inter annual variations Groups are years month and hours Matlab file pseudodata m can be used to generated such a data file The comparison between analysed field without and with detrending option is shown in Fig 5 6 on the left hand side the sin cosine structure is visible but perturbed by
150. on output 149 13 4 4 driver file actions and flag values 150 13 1 Climatology definition The climatologies to be produced are first defined by the mean of three files varlist one column file where each line defines the short name of a variable see example 13 1 yearlist one column file where the lines define the time period of years over which the climatologies of the variables are performed see example 13 2 monthlist one column file where the lines define the time period in the year for which the climatologies of the variables are performed see example 13 3 Temperature Salinity Example file 13 1 varlist 140 19001950 19501980 19802012 Example file 13 2 yearlist 0103 0406 0709 1012 Example file 13 3 monthlist Convention e In yearlist each time period must be in an eight digits number such as yyyyzzzz where yyyy is the start year and zzzz the end year time period e In monthlist each time period must be in a four digits number such as mmnn where mm is the start month and nn the last month numbers 13 2 Diva 4D Climatology performance All Diva shell scripts files for climatologies or 4D analyses production are located in GODIVA_mm_yyyy JRAx Climatology This directory has its proper subdirectories input where input data and files are placed and out put where Diva outputs are stored The main shell s
151. ones used by divadoall to create the newinput subdirectory on which divadocommit is run When reference fields are generated they are copied by the script file di vadocommit in a subdirectory input divarefe_all 145 extract flag 1 do it 0 do nothing 1 press coord 10 pressuret Saunders 1 boundary lines and coastlines generation 0 nothing 1 contours 2 UV 3 1 cleaning data on mesh 1 2 RL 3 both 4 1 outliers elimination 5 4 4 minimal number of data in a layer If less uses data from any month 10 isoptimise 0 nothing 1 L 2 SN 3 both negative values filter vertically 0 inimal L Oe dL aximal L 1 inimal SN 0 05 aximal SN 0 5 2 do reference 1 do analysis and 0 do nothing ig lowerlevel number 7 upperlevel number 11 reference to come 0 isplot 0 or 1 al number of groups for data detrending 0 if no detrending 0 Example file 13 4 The driver file 13 4 Production of Climatologies Diva 4D allows the production of climatologies based on simple Diva data analysis or based on Diva analysis using different option as in Diva 3D e relative length files e advection constraint e reference fields and detrending Note These options are automatically activated when the appropriate input data are provided More options available in Diva 4D are e analysis using vertically filtered mean background e analysis with data transformation
152. options for the NetCDF library will be detected automatically during the compilation If you want to check before compilation type charles gherl13 S nc config fc gfortran charles gherl3 S nc config flibs L usr lib lnetcdff lnetcdf Check the options of this command by typing nc config or visit the web page http www unidata ucar edu software netcdf workshops 201 I utilities Nc config html If you have installed sev eral versions of the NetCDF libraries you might find several nc config on your system Then run the compilation script charles gherl3 Fortran divacompileall and check the content of the log file compilation log You should obtain something similar to that Compilation time Thu Oct 25 14 21 54 CEST 2012 compiler ifort compilation flags 03 Calc directory 1 1 program compiled Extensions directory 12 12 programs compiled Mesh directory 9 9 programs compiled NC directory 3 3 programs compiled PIPlot directory 1 1 programs compiled Util directory 38 38 programs compiled Pipetest directory 1 1 program compiled Stabil directory 28 28 programs compiled TOTAL 93 93 programs compiled Binaries are located in directory home charles Software GODIVA_07_2012 DIVA3D bin 1 3 2 Direct copy of pre compiled binaries If the compilation failed go in the GODIVA_mm_yyyy DIVA3D bin directory and cop
153. oretical function The signal to noise ratio o7 e is estimated with a Generalized Cross Validation GCV GCV allows estimating global errors and calibration of the analysis parameters The tools will be further explained in Chapter 3 2 4 2 Additional physical constraint In the base formulation of Diva the cost function contains a term relative to the regularity of the reconstructed field and a term relative to the proximity to the observations We will see in Chapter 5 that physics advection diffusion source terms can be added in the cost function 2 4 3 Maulti dimensional analysis In order to perform three dimension analysis horizontal coordinates and depth the solution is to applying successive analysis in horizontal layers from the deeper to the shallower layer A set of scripts diva3D are designed to perform such analysis in an automatic way However the reconstruction of three dimensional fields of temperature and salinity by stack ing of layers of analysed fields may lead to unstable density fields An algorithm has been implemented in Diva in order to remove these instabilities These topics are addressed in Part III 19 2 4 4 DINEOF Diva is mainly designed to work with in situ data characterized by a scattered spatial distri bution When dealing with satellite images the spatial interpolation can be made in a clever way by using the information contained in the satellite images acquired before in the s
154. ows how additional dynamical constraints advection diffusion source decay can be added to the cost function that provide the analysed field in Diva It also describes the detrending tool which allows the extraction of trends from groups Contents 5 1 Adding advection to the cost function 2002 eee 43 SL Adlvection alone i seie ke ek ek ee ee a Ga E a a 44 5 1 2 Advectionand diffusion 2 220 00004 46 ALI Generaliza eee eee eo eer es Dae wr oe ee Bee 47 5 2 Adding linear sink s and local source s 1 1 2 eee eee ees 47 52 1 Implementation e seq co oca c4 bade ba ee eae ede ae 48 S22 Empleo ong we ee he he a we a 49 5 3 Detrending data by defining groups and classes 49 Sood TREO ode Ok ee ee eh ee OO ee oe a a 49 5S2 IUniplenientanom s a G08 Ge pak ea a ee ea Se SR eS 50 5 3 3 Generalizations e soea a 4 20 ba ba eee ee eae 50 pee NSA es Sb oe he eB eR ee Ae ee Bl 51 AAF EKIPIE oi ed on a ea E pie eae Oe eh 52 5 1 Adding advection to the cost function Activating an advection constraint on the tracers is done by adding a term to the norm of the field y 2 11 leading to J 5 1 II z 2 c oo lt 6 lt lt 6 jan Ns where U and L are characteristic velocity and length scales respectively We recognize a di mensionless version of stationary advection diffusion equation u Vy AV Vo 5 2 The parameter 0 allows one to adapt the weight of the
155. perature field b Zoom between 0 and 500 m Figure 10 7 Results of analysis 10 3 Analysis of data from a transect This case is very similar to the previous one the difference is that here data are collected along a trajectory of constant latitude 10 3 1 Data The track of the cruise Fig 10 8 follows a trajectory of constant latitude 24 N across the Atlantic Ocean Salinity for the year 1958 is represented on Fig 10 9 along with the topography 112 Depth m 30 N 24 N Latitude N z A 12 N 48 W Bow Longitude E Figure 10 8 Transect stations e and bottom topography 10 3 2 Contour creation We have to convert degrees of longitude into kilometres to be coherent with the units since the depth cannot be expressed in degrees To this end we used Matlab function distance m which calculates the great circle distances between two points on the surface of a sphere Extraction of topography We extract topography with the help of Matlab function m_tbase m which uses 5 minute TerrainBase database But any other source of topography suits 113 S PSU 37 5 36 5 Depth m 8 a s 36 5000 35 5 6000 35 7000 1 i L L 70 60 50 40 30 20 Longitude E Figure 10 9 Domain and data 10 3 3 Mesh Computation of length scales Similarly to the previous case we compute horizontal and vertical length scales in or
156. ploits Diva module gcvfac analysing random fields to assess the generalized cross validator GCV see Chapter 3 for theoretical developments The script divagcv is an example of how to minimize the estimator by changing the signal to noise ratio A value but could be adapted to optimize other parameters as well such as correlation length Input to the module is the number of random estimates required the larger the value the more robust the estimator Default value is 5 unless you change in divacalc The user has to provide an input file input gvcsampling dat containing the list of values for on which to try the estimator typically around the values provided by divafit During the di vagcv execution error field calculations are disabled to reduce computing time Tips 7 3 Ifa mesh already exists inmeshgenwork directory divagcv disables the divamesh procedure For this reason ensure you are working with the adequate mesh m 76 Output files File output gcv dat contains the GCV estimator column 1 signal to noise ratio column 2 GCV column 3 data anomaly variance and output gcvsnvar dat the best new estimate for the S N and VARBAK parameters In param par gcv you find an adapted version of the original param par 7 3 3 divacv divacv carries out a cross validation point by point without new matrix inversions 7 3 4 divacvrand divacv runs a cross validation by sub samples of points Note that
157. po grd The information on the grid s geographical dimensions are to be placed in TopoInfo dat 70 The grid is simply an array i 1 M and j 1 N where the coordinates of the grid nodes are x x i 1 dz y y j 1 dy The file TopoInfo dat contains simply x1 y1 dx dy M N Look into dvdv2diva f in src Fortran Util how to write such files from within a Fortran code 7 1 4 Deprecated method conversion of data from Topography Extractor This DBDB B topography is not available any more hence the method described below cannot be used It is kept in this manual for archival purposes Select your area Go to https idbms navo navy mil dbdbv dbvquery html select the area and spacing and download the corresponding file in CHRTR ascii format Fig 7 6 In this example we worked in the region delimited by 9 12 W x 30 33 N NW Africa with a resolution of 0 01 in both directions If the web server is not operational you can also access this database at http ferret pmel noaa gov NVODS servlets Then select your dataset by clicking on by Dataset Name and chose NAVAL OCEANOGRAPHIC OFFICE Bathymetry Topography 5min resolution Mark the topography box and click on Next Fig 7 7 a Delimit your region and select ASCII file as output Fig 7 7 b Put the asc file into divastripped input with the name topo asc and execute dbdb2diva in the shell You will get top
158. ption case of a square island in a square sea fort 11 the parameters required for the mesh generation Files produced as output fort 22 contains the finite element mesh as described here 1 the first part of the file has three columns the first column gives the numbers of the nodes the second and third ones give the x and y coordinates of the nodes respectively Example first line indicates that node no 1 is located in 1 1 2 the second part is composed of only one column which indicates the numbers of the interfaces 3 the last part has six columns columns 1 3 and 5 specify the line numbers where the coordinates of the triangle points can be found columns 2 4 and 6 specify the interfaces numbers of the considered element Example the last line says that the last elements has its coordinates in lines 2 3 and 5 i e at has points 1 1 1 1 and 0 3333333430 333333343 it also says that this element is composed of interfaces no 13 8 and 12 T ie la 9 ls l 4 1 1 wO le Iy T 05333333343 0333333343 5 11 6 12 8 2 13 3 3 6 4 7 5 8 AN 9 1 10 5 7 1 11 2 12 5 10 2 13 3 8 5 12 Example file B 2 fort 22 180 0 8 0 6 0 4 0 2 0 2 0 4 0 6 0 8 08 0 6 0 4 0 2 0 0 2 0 4 0 6 0 8 Figure B 1 Example of simple mesh corresponding to file fort 22 fort 23 contains the topological parameters 1
159. r X wi r di g Dd 2 7 i 1 Derivation of the covariances To determine the data covariance matrix D and the covariance of the data with the real field g the following assumptions are generally made 1 errors on measurements are not correlated i e aae where e is the variance of the errors on measurement i e the noise 2 errors on measurements are not correlated with the real field i e Ep 0 With these assumptions and considering that the data at r is the sum of the true field at r and an error we deduce Dij pelrijyprlrj esi o c ri rj big 2 8 gi plr di o c r rj 2 9 where c r rj is the correlation function and o is the signal of the data In the following we write D B R where matrix B contains the variance of the true field and R is the diagonal matrix containing the observational noise 11 2 2 2 Drawbacks of OI There are two main drawbacks when using OI as detailed in the following paragraphs e The numerical cost e The specification of the covariances As the method requires the inversion of a Ng x Ng matrix N4 being the number of data it is not adapted for situations with large number of observations number of operations proportional to N3 Moreover the method does not always produce the theoretical optimum specially when the number of data is not sufficient and the covariances are not correctly specified e g Rixen et al 2000 Go
160. rationpoints dat it will be used Otherwise it will be created and put in the output based on the analysis on the output grid This files must contain x y val 1 h If the file did not exist but was created it will pass through an execution of divaintegral divaintegral can be edited by the user to chose special points for the integration for example only those points for which the analysis is positive or points that fall in a given square etc When ispec is negative the full covariance calculation will be used When ispec is positive the hybrid covariance calculation will be used When called with the optional argument naive it also calculates the simple sum of the diagonal term of the analysis error variance The error field itself is calculated with the methods specified by ispec charles gherl3 divastripped divaintegral naive The output files generated are e output integral dat contains the integral value the surface of the integration domain and the average value integral divided by surface e output erroronintegral dat contains the error standard deviation on the in tegral in the same units as the integral e output erroronintegralnaive dat contains the naive approach summing only the diagonal terms the inflation factor and the inflated error Units are the same as the integral Units are units of the variable multiplied by the units of x and y of the data and contour file when no
161. rectory fort 71 gt output fieldatdatapoint anl Creation of file GridInfo dat cp cannot stat fort 84 No such file or directory Creating netcdf file only for field since Varbak and ispec are 1 start end of file apparent state unit 84 named fort 84 lately reading sequential unformatted external I0 This application has requested the Runtime to terminate it in an unusual way Please contact the application s support team for more information Figure A 8 Error message during the run of divacalc Why do I get this error The diva a executable requires to much memory to work This error comes from the operat ing system limitations How to solve it First try to cancel all unnecessary tasks running on your machine possibly rebooting This will clean up the system and free up resources If this is not sufficient the solution is the same as case A 2 4 recompile the sources after reducing the values of parameters nrea and nent in file sre Portran Calc divaine h PARAMETER nrea 25000000 PARAMETER nent 25000000 If you get the same error message reduce again the values of nrea and nent Note that maximal allowable values for these parameters depends on your compiler and system so it is not possible to assign them with universal values 164 cygdrive d DIVA diva 4 2 1 divastripped Variable L activated Going to read constraint file 61 61 Finished read constraint file ze 61 61
162. requires some particular routines extract f interface to select or extract Data from MODB and MED formatted databases fem3d f is based upon a mesh file and a bathymetry file regular grid in GHER format it creates a result file containing information to determinate if a mesh is in land or is sea for a given depth concat f is used to create the 3D file from the 2D files stiff f generates the rigidity file fort 60 in the 3D case mask masked the solution according to the bathymetry and the depth sum f writes the sum of two fields with same dimensions in GHER format substref f subtracts the reference field to the computed solution only available when us ing the semi normed reference field header2 and visu f are subroutines to visualize the data the mesh and the solution requires the PIPlot library Two versions of visu are provided one is located in diva 4 3 src Fortran P1Plot and the other in src Fortran NoP1Plot The first can be compiled only if you have installed the PIPlotlibrary on your computer for now only under Linux B 2 Input and output files for the executables This section describes the input and output files fort related to the executables or binaries which are the files ending by a and located in GODIVA_mm_yyyy DIVA3D bin 179 B 2 1 Mesh generation generopt a Files readed as input fort 10 coast file identical to coast cont see example file with descri
163. rization constraints on the calculated trends For example if there a few data available for estimating the trend of class Cj we should be not be too confident on the trend and rather perform a standard analysis i e reducing the value of dc We can modify the cost function associated with data in class C as follows hi di do p z w Falda iEC j where the coefficient a regularizes the trend amplitude and Dec Hi ldi p z yi do Hees Li Qi af If N is the number of points with non zero weights we can define 1 fig 5p DL Hi J ieC and a proposed scaling for regularization constants is aj fig Nj This has been implemented 5 13 5 14 5 15 5 16 If the detrending is included in a 3 D loop with the same groups and classes defined in each layer we can further request that the values of the trends in a given layer are not too far from those in the surrounding layers and modify the norm as XO ui di de 9 xi y 04 de B dg de 67 dg de iECj 50 5 17 where the coefficient 3 regularize the trend differences between layers and where refers to the value in the layer above and to the layer below Obviously the solution of this problem will involve tridiagonal solvers For the lowest and uppermost layer we can simply assume a zero gradient for the trends Similarly the 6 can be scaled based on the two layers involved ji
164. roblems should not appear any more in the latest version of Diva Should you encounter them please let use know A 3 1 Jacobian matrix with null determinant The value of the Jacobian determinant is zero Fig A 14 169 SSS ET EES ESOS SSSSSOSOOSSL ES EE EE CALL TO SOLVER MODULE IPR 1 SSS SESE SES ES SSSESES SESE SES EE SE solver 1 ERROR CKSEL2 DET JACOBIAN ZERO xz Output of FESUITS For user fort 84 gt output fieldgher anl fort 82 output valatxyascii anl fort 837 output fieldascii anl fort 8 _ output errorf ie ldgher anl fort 86 gt output errorfieldascii anl cp cannot stat fort 71 No such file or directory Creation of file GridInfo dat fort 87 gt output ghertonetcdf fort 87 Creating netcdf file only for field since Varbak and ispec are forrtl severe 24 gt end of file during read unit 84 file baobab ctroupin DIV A diva 4 2 6 divastripped out put ghertonetcdf fort 84 Image PC Rout ine Line Source metcdfoutputfield G 8G D3F43 Unknown Unknown Unknown 971 61187562987 Will try to recover changed deti to 59916 7179939824 zz ERROR CKSEL2 DET JACOBIAN ZERO 777 lel isub detj oo 1 114UY 1665268654 xO x1 x2 48 y1 42 4632 89661941846 4683 76430356582 4056 392809849175 9565 32603819696 9591 56434369481 9328 74475179316 Will try to recover changed detj to 69074 13788
165. rovides examples of realistic stmple runs The Diva demecum Chapter C is particularly useful to have a small summary of all the commands and options For more theoretical developments the user is invited to read Part I as well as the corresponding bibliography To make easier the reading of the document different font colors are used for different type of files e the files ascii or binary e the commands which can also be ascii files but that are executable e the directories Various example files are provided for different situations iii How to cite e This document Troupin C Ouberdous M Sirjacobs D Alvera Azcarate A Barth A Toussaint M E amp Beckers J M 2013 Diva User Guide http modb oce ulg ac be mediawiki upload DIVA notes DivaUserGuide_ March2013 pdf e and the related peer reviewed publication Troupin C Sirjacobs D Rixen M Brasseur P Brankart J M Barth A Alvera Azcarate A Capet A Ouberdous M Lenartz F Toussaint M E amp Beckers J M 2012 Generation of analysis and consistent er ror fields using the Data Interpolating Variational Analysis Diva Ocean Modelling 52 53 90 101 doi 10 1016 j ocemod 2012 05 002 http www sciencedirect com science article pii S 14635003 12000790 BIBTpXxXcode ARTICLE TROUPIN2012b0M author C Troupin and D Sirjacobs and M Rixen and P Brasseur and J M Brankart and A Barth and A Alvera Azc
166. rron M J amp Hogan P J 1990 A comparison between the Generalized Digital Environmental Model and Levitus climatologies Journal of Geophysical Research 95 C5 7167 7183 doi 10 1029 JC095iC05p07 167 The MEDAR group 2005 A Mediterranean and Black Sea oceanographic database and net work Bollettino di Geofisica Teorica ed Applicata 46 329 343 Troupin C 2011 Study of the Cape Ghir upwelling filament using variational data analysis and regional numerical model Ph D thesis University of Li ge 224 pp URL http hdl handle net 2268 105400 Troupin C Machin F Ouberdous M Sirjacobs D Barth A amp Beckers J M 2010 High resolution climatology of the north east atlantic using data interpolating variational analysis Diva Journal of Geophysical Research 115 C08005 193 doi 10 1029 2009JC0055 12 URL http www agu org pubs crossref 2010 2009JC0055 12 shtml Troupin C Sirjacobs D Rixen M Brasseur P Brankart J M Barth A Alvera Azcarate A Capet A Ouberdous M Lenartz F Toussaint M E amp Beckers J M 2012 Gener ation of analysis and consistent error fields using the Data Interpolating Variational Analysis Diva Ocean Modelling 52 53 90 101 doi 10 1016 j ocemod 2012 05 002 URL http www sciencedirect com science article pii S 14635003 12000790 Tyberghein L Verbruggen H Klaas P Troupin C Mineur F amp De Clerck O 2012 ORACLE a global en
167. ry or in the input directory Diva will perform 3D analysis using relative length files Using advection constraint To perform 3D analysis with avection constraint the files UVinfo var lxrera Uvel var lrrrz Vvel var lxxxx must be then placed in input divaUVcons subdirectory The advection constraint is activated when a constraint dat file is present in the input directory see Section 8 4 If one wants to use different advection parameters 0 and A see Section 8 5 a two column 3Dconstraint file must be placed in input divaparam subdirectory where each line contains the advection parameters for the corresponding level number If UVinfo files are identical for all the levels only one file UVinfo dat may be placed in the input directory or in the input divaUVcons subdirectory If for some levels the pair of files Uvel var lxxxrr Vvel var lrrerz or Uvel lxrrera Vvel lxxrexxr is not available A default Uvel dat and Vvel dat files must be placed in the input divaUVcons subdirectory as well as a UVinfo dat if using different UVinfo files If for all levels the same advection files are used only Uvel dat Vvel dat and UVinfo dat may be placed in the input divaUVcons subdirectory or simply in the input directory Convention The advection constraint is activated when a 3Dconstraint file is present in the divaparam subdirectory or a const raint dat is present in the input directory Using reference fie
168. s and divagcter multiply does what its name says called in divarefe subsampling f creates a subsampling of the data called in dvsamp1le sumgrid f performs the sum of two gridded fields in GHER format called in di vasumup sumup f performs the sum element by element of two ascii files called in divasumup topoprep f makes easier the generation of the topography using a collection of local mea surements called in divatopo Remark grid definition for users is based on an origin which is the first grid point In the code xori and yori are defined by x xori 7Az and is thus shifted one grid space to the left compared to the user origin Input file fort 13 is modified from the param par grid information by griddef a accordingly while GridInfo dat contains the user grid as defined in param par B 1 5 NetCDF output src Fortran NC Three files allow getting an output in NetCDF format netcdfoutputfield f netcdfoutputerror f netcdfoutput f The two first routines write the analysed and the error fields in two different NetCDF files anlysed_field ncanderror_field nc The last programs generates results nc which contains both the analysis and the error fields The information required for the coordi nates xorigin y origin dx dy xend yend are read from GridInfo dat 178 100 100 Example file B l GridiInfo dat B 1 6 GUI programs src Fortran Extensions The graphical interface
169. s are to be estimated using data mean distance as a minimum 10 if correlation length parameters are to be estimated using data mean distance as a minimum and vertically filtered 30 if both correlation length and signal to noise ratio parameters are to be esti mated using data mean distance as a minimum for L 30 if both correlation length and signal to noise ratio parameters are to be es timated using data mean distance as a minimum for L and both parameters verti cally filtered e Analysis analysis and reference fields can be performed in different ways Perform analysis Possible flag values are 1 10 11 12 13 and 14 if analysis fields of the given variable are to be performed for all the layers between L and La which are the flag values for lower level number and upper level number in the driver 11 if analysis fields of the given variable are to be performed with exp data log analysis transformation 13 if analysis fields of the given variable are to be performed with anamor phosis transformation 14 if analysis fields of the given variable are to be performed with user chosen transformation function Perform reference fields Possible flag values are 2 20 21 22 23 and 24 21f semi normed reference fields of the given variables prescribed in var list and for time periods described in yearlist and month1list are to be per formed for all the layers between L and
170. s divaqc also generate out liers normalized dat which contain in a sorted way from the most suspect data to less suspect the possible outliers from the normalized misfits test 3 29 Tips 8 2 By default the criterion used in divadress is divagqcbis but you can change it by editing the file divadress and replacing divagcbis by one of the other quality test divagcordivagqcter m 8 3 Running a semi normed analysis A semi normed analysis consists of four steps 1 create a so called reference field which will act as background field Section 2 1 2 2 subtract the reference field from the data values in order to work with anomalies 3 perform an analysis on the anomalies 4 reconstruct the field by adding the analysed anomaly field to the background reference field These four steps are executed by running script di vaseminorm and the implemented tools described hereinafter Note that the parameters written in the original param par file will be used during the analysis on the anomalies Thus it is advised to specify ireg 0 so that no background field will be subtracted from the anomaly 83 8 3 1 divarefe This script performs an analysis on your original data but modify the analysis parameters L is multiplied by 5 and J by 0 1 Output files They are the same as those created through an execution of di vacalc but assigned with a suf fix ref fieldgher anl ref fieldascii anl ref valatxyascii anl ref and fieldatd
171. se a continuous formulation to calculate an approximation of A noted A by starting from the sum expressed as continuous integral 1 Os ee J lt x e x gt dx dx 4 26 DJD where x and x stand for positions in the domain of integration D When we suppose the covariance is isotropic and note r the distance between points x and x we have cong J lt e x e x gt c r dx dx 4 27 DJD which we can evaluate in polar coordinates the inner integral expanded to infinity to find an approximate value e 2 eo 2 Te i lt 7 x e7 x gt rc r dr dx 4 28 with the Bessel function for the correlation function c this yields An L 2 a a MS nano l lt E x e x gt dx 4 29 If we had used the naive approach of neglecting the spatial covariances the double sum would have been restricted to a simple sum on diagonal and we would calculated the underestimated error 7 i A mmf lt x e x gt dx 4 30 4nL AxzAy of the error standard deviation In practice this inflation factor is probably a little too high we assumed the analysis error to have the same correlation length as the analysis while in reality it is generally smaller and we extended one of the integrals to an infinite domain adding up more errors Hence we see that we should apply an inflation factor of on A to get a better estimate 40 4 5 3 Use All approaches were implemented into divaintegral If there is a file input integ
172. se programs in order to allow the advanced user to adapt the code according to his needs Contents Bl Fortran code lt esceto cececa a ERE EERE e e Hw es 174 Bld Calculation programs ss ss oe scesa sae ee ee e 175 Bl Mesh programs o reo eek ee De ew OG ee ee eS 176 BALS EPN ee 2 Ged Ba BSE oeke seo ee e OH Sod SS 177 B44 Wilities oq g a ee bh eh bb eh ba eee pe oe 177 BLS Ne DE GUPI o o oc at Bade eee A ow Sd ea a a 178 B6 GUL paisa os kl oA ee ee we ee a oS EW 179 B 2 Input and output files for the executables 2 006 179 B 2 1 Mesh generation generopt a 2 2 a 180 B 2 2 Dive interpolation diva a 2 i4 ei hata ee eRe ee eS 181 B 2 3 Detrending calculation detrend a 0 183 B 1 Fortran code x x x The Fortran programs are sorted according to their purpose charles gherl3 Fortran tree d L 1 Cale Extensions Mesh NC NoPlplot Pipetest Plplot Stabil Nee UCL tE rt 9 directories 174 B 1 1 Calculation programs src Fortran Calc The main file of the Fortran code is diva f this routine calls the subroutines enumerated below in order to perform a Diva analysis mathpr f describes the mathematical problem topolo f describes the topology of the finite element grid meshgn f generates a square finite element mesh on a regular grid datapr f input of data to be fitted by spline smoothing bcondi
173. sis 28 4 ERROR COMPUTATION This chapter presents the different methods for computing the error field associated to the anal ysis as well as the error resulting from the calculation of the integral of a field over a domain Contents MA nir duction gt se se s aa ee wicw s e a we ew Eee ew a 29 4 2 Methods implemented in Diva 2020000 30 4 2 1 The poorman s estimate 2 2 52 be cacaus pa nsa 30 4 2 2 The bybrid approach 2 05 4 s e e we aa e ee aa 30 4 2 3 The real covariance method oaoa a 31 a5 Numerical cost se secese esterren eses es e Os 34 4 3 1 Poorman sestmate lt o 066 62 68 24 65 bs casto anuai 34 Ae Hynd method ssc acai ee a a ea hee ee ei ees 34 4 3 3 Real covariance function 0 2 000002 ae 34 4 4 Comparison between the methods 000 cee eseees 35 4 5 Integrals over sub domains 0 ce eee ee wee ewes 38 MSM TROY lt 6 5 4 ea we ek ee ae 38 4 5 2 Doplememtatign s as s on ae OR ee ee ee a 39 AS Use 2 4 Jc cv be eee ee ba ee bee ba hee RR ee 41 dod Tne ee ek eet e i ee a a we Oe Ree 41 4 1 Introduction The analysis performed with the optimised parameters should have the lowest global error as measured by 3 21 Nevertheless the spatial distribution of the error is also of interest for any interpolation or analysis method since it gives the user an indication of the reliability of the results The error field is expected to be affected by 1 t
174. soft Windows Linux Mac OS X The main steps for the the installation are described in this chapter A more detailed and up to date list of instructions is available on the Installation web page of Diva http modb oce ulg ac be mediawiki index php Diva_installation Contents 11 Requirements ss o osaa a ee ee ee ee 1 2 Download and extraction of the archive 22 22004 1 3 Generation of the binaries executables 20 00 eee eee L31 Compilgh n an as as es ew A ee ee a e at 1 3 2 Direct copy of pre compiled binaries LA Runts os ce eoe a a a a EE ww ee ee IAT Ba sict st o oc soco iee a eae a e a cb a eee ee a na A A A LU U N me LAZ Large memory test 2 6 44 io e eee haw a a ea ee a 1 1 Requirements The basic requirements to compile and run Diva are 1 A command line interface With Linux or Mac the interface is directly available it is the shell or terminal With Windows it is necessary to install a Unix like environment such as Cygwin http www cygwin com 2 A Fortran 95 compiler such as e gfortran http gcc gnu org wiki GFortran e ifort Intel http software intel com en us intel compilers e pgf Portland Group http www pgroup com 3 The NetCDF library http www unidata ucar edu software netcdf for Fortran Note that the library is available in recent versions of the cygwin installer but does not properly work in all cases and you must add the li
175. subjective analysis for which the way the approximation is performed is decided by hand and objective analysis which is based on predefined mathematical opera tions Note that beyond these two kinds of analysis data assimilation uses in addition physi cal biochemical dynamic governing equations Since data assimilation depends on the region and the model and the subjective analysis is not sufficiently objective the objective analysis is chosen here 2 1 3 Background field and anomalies The field y r can be decomposed as the sum of a background field p and an anomaly yy plr plr y r 2 1 Instead of working with the data themselves we will work with the anomalies of these data with respect to the background field The background field is defined a priori and the anomalies are calculated with respect to this reference field e g climatological average linear regression theoretical solution The anomalies are assumed to be computed as a linear combination of the data i e Na plr polr X wy dj 2 2 j 1 where d is the data anomaly at r rj and w is the relative weight of the data j The weighting functions are the new unknowns to determine once the background field and the weighting functions are known the field y can be computed at any position r hence gridding is possible From here on we will work with anomaly only and therefore formally use p 0 2 1 4 Noise on data When measuring a field
176. t RL dat param par data dat estimate L and S N divafit n r covariance dat covariancefit dat paramfit dat param par fit input param par param par coast cont coast cont dens make FE mesh divamesh divamesh outputs gcvsampling dat param par data dat divamesh outputs Uvel dat Vvel dat UVinfo dat constraint dat RL dat RLinfo dat optimise S N by cross validation divacv r divacvrand ns nt r divagev r gcv dat gcvsnvar dat gcvval dat param par gcev input param par param par data dat divamesh outputs Uvel dat Vvel dat UVinfo dat constraint dat RL dat RLinfo dat valatxy coord make analysis divacalc GridInfo dat field anl errorx anl nc valatxyascii anl param par data dat output meshvisu Uvel dat Vvel dat UVinfo dat constraint dat RL dat RLinfo dat perform full quality control divaqc outliers dat outliers normalized dat param par data dat divacalc outputs perform simple quality control divaqcbis outliersbis dat outliersbis normalized dat param par data dat divacalc outputs perform simple quality control divaqcter outlierster dat outlierster normalized dat make some plots output divagnu fmm fmax gnuwork plots save results output divasave mycase mycase outut 185 C 2 Workflow dnunseaTp oTeOeATP WOUBBATP 9J9ILATP WIOUTWASBATP STQODEATP OTPO
177. t Output param par contour depth coast cont lrxrrx in divaparam topo dat or Uvel lxvxx and Vvel lxxrxrx in divaUVcons topo grdand TopoiInfo dat 12 3 2 Data sets cleaning All data sets provided in DIVA3D divastripped input divadata can be cleaned from data points located outside the mesh and from suspected outliers Choose a flag number corresponding to the desired action for data sets cleaning in the 3Dinfo file A param par file is also needed and can be placed in the divastripped input input directory At this stage field of scaling factors to the correlation length can be generated on the basis of data distribution and for the levels corresponding to each data set see Section 12 2 2 Input Output in input divadata param par var lxrxx notcln original data set files amp var lxxxx clean data set files cleaned from data out of the mesh var larrr var lxxxxn withoutliers data set files cleaned with outliers var lxxrxx The cleaned data set files 12 3 3 Parameters optimisation The estimation of analysis parameters see Chapter 3 can be done for all levels using diva3Ddress It is possible to optimise one or more parameter for a range of levels with different options see Section 12 2 2 The parameters which can be optimised are correlation length L signal to noise ratio and the error variance background VARBAK The parameters optimisation can be done within a ra
178. t creates input files to simulate a case with a large number of data and a very fine mesh Again the results obtained after a few minutes are viewable using the command charles gherl13 divastripped ncview output ghertonetcdf results nc and should be close to Fig 1 2 CEE z Neview 1 93g David W Pierce 24 February 2009 variable analyzed_field No scan axis displayed range 4 7126 to 1 73341 Current i 1 j 97 0 0607118 x 0 98 y 0 9399999 Quit i 44 4 AALALA bright InvP InvC MX3 Linear Axes Range Repl Print 0 1 Var Dim Name i Units Degrees_nor Degrees_eas Figure 1 2 Results obtained with divabigtest Part I Diva Theory 2 DIVA GENERAL THEORY This chapter describes the theory behind the Diva interpolation method and compares it with the Optimal Interpolation Contents 2 1 Datagridding s sa sepes eneo ns ew ee ee te wt es 7 2 1 1 Interpolation versus approximation 8 2 1 2 Objective versus subjective data analysis methods 8 2 1 3 Background field and anomalies 04 9 21A Norcon dia on QoS dg Yad eo a ee a E E a 9 2 2 Optimal Interpolation 2 2 sses sne eee eee eee rene 9 2 2 1 Mathematical formulation 04 4 10 222 Diowbads ai Ol 0 4 ed ee eo ey ewe he a a a a 12 2 3 Variational Inverse Method 2 2 002 cee eeeeeeee 12 2A Pomiilaet 2 4 6 e 42 ds 200d da pega dda ae a4 13 2 3
179. t format list io lately reading sequential unformatted external IO iva a 1 660660 denied Figure A 10 Error message during execution of divacalc with gfortran Why do I get this error Although the compilation worked without any message error diva a cannot be executed This problem seems to occur only with gfortran compiler under Cygwin Actually the problem is not related to permission command chmod will not solve the problem but with compilation As described in problem A 2 7 values of parameters nrea and nent shall be decreased and the sources recompiled How to solve it Same as problem A 2 7 A 2 10 Problem with contour generation See Fig A 11 Why do I get this error The number of contours created from a given topography Section 7 2 2 is too high How to solve it Modify the first line of contourgen f locatedin src Fortran Mesh and increase the value of nm parameter nm 5000000 166 input contour depth dos 8L 48C written ctroupin baobab divastripped divacont VAOOOCOOOOOOOOOOOOAAAAAAAAAAAAAAAS Contour generation VAOCOCOPCOOOOAOEOOAAAAAAAAAA AAAS Cleaning up old files Cleaning finished 6680 Figure A 11 Error message with contour generation Additional information As the default value of nm is already large you may also consider working with a topography with lower resolution This should avoid the creation of of a great number of very sma
180. tch two columns of a file type awk print 2 51 3 infile gt outfile 7 1 1 Method 1 conversion from GEBCO topography Download the complete global GEBCO One Minute Grid file 90n90s180w180e zip from http www bodc ac uk data online_delivery gebco and unzip it to obtain the file GridOne grd Download the software GGbcoCE_GridOn1y as well and run it Select your area Select your region of interest Fig 7 1 possibly slightly increased to make sure boundaries are well included in the topography Then select File gt Export Data gt Gridded Data Chose Ascii longitude latitude depth default For the longitude range use 180 180 for european seas Note regions you possibly want to mask later by their coordinate ranges Use topo gebco asc as output file name into a directory where you have your main climato logical working place Push OK and be patient Fig 7 2 Convert the file into gher format Go into Cygwin or into Linux mode and place yourself in the main directory of your clima tology production You should have a big topogebco asc file on which you can apply charles gherl3 input head 20 topogebco asc to see if the file was created correctly You also should have a gebcoprep file If not copy the gebcoprep example file as gebcoprep 66 Chapter 7 PREPARATION OF THE INPUT FILES 7 1 Creation of topography GEBCO Centenary Edition Chart Definition Dialog Figure 7 1 Area s
181. th data from all years Institution name where the dataset was produced University of Liege AGO GHER Production group and e mail Diva group E mails JM Beckers ulg ac be Source observation radiosonde database model generated data data_from various sources Comment This is only for DIVA development and testing work Author e mail address or contact person to report problems m ouberdous ulg ac be r Example file 13 5 NCDFinfo 147 13 4 2 Advection constraint and reference field files To perform Diva 4D analyses with advection constraint and or using reference fields the ad vection constraint and reference field files must be provided in the corresponding subdirectory divarefe_alland divaUVcon_allininput directory see Sections 12 4 1 and 12 4 1 Note The naming conventions for advection field and advection constraint field files is the same as for Diva 3D advection condtraint files are named as UVinfo var yyyy zzzz mmnn lxrrrz Uvel var yyyy zzzz mmnn lrrrz Vvel var yyyy zzzz mmnn lrrrer andaconstraint dat file and for reference fild files var yyyy zzzz mmnn lxrrrx ascii ref var yyyy zZzzz mmnn lerrx datapoint ref and var yyyyzz22 mmnn leree ref Using advection constraint and or reference field The advection constraint and or reference fields usage actions are activated by the correspond ing flag values in constandrefe
182. th unit O 60 i A 3 value in a solid rotation EET 59 6 59 4 59 2 59 1 0 8 0 6 0 4 0 2 0 0 2 0 4 0 6 0 8 Y Longitude E Without advection Fig 5 2 the across velocity scale remains and isotropy is recovered except for boundary effect on the right side Analysis 61 60 8 60 6 60 4 59 6 59 4 59 2 59 1 08 06 04 02 0 02 04 O86 08 1 o Longitude E o N Latitude N 8 ov o w Figure 5 2 Same as Fig 5 1 but without advection To decrease the cross frontal scale we must decrease L but add advection to keep along current scale larger Fig 5 3 45 Analysis 60 2 Figure 5 3 Same as Fig 5 1 but with smaller length scale a Z v uel a p ip o D w 1 08 06 04 02 o 02 04 06 08 1 a Longitude E Adding advection without decreasing L increases correlation length along front and keeps cross front correlation length 5 1 2 Advection and diffusion Adding diffusion makes possible the distinction between up and downwind direction Fig 5 4 in this case higher values are found upwind of the data location this is natural because the data is observed and Diva tries to infer the field that explains the sample This requests higher values upwind because downwind values decrease Because of the square in the formulation to change the flow direction you can simply change the sign of the diffusion coefficient or change the sign of the v
183. the various cycles superimposed on it After the detrending the structure is perfectly recovered Along with the field without trend the divadet rend tool also provides the trend for each group Fig 5 7 a 05 05 E gt La gt La Begue 1 05 l 0 6 1 5 0 8 _ a l 1 0 5 1 a b gt 0 5 Figure 5 6 Example of a reconstruction without a and with detrending b Note the difference in the color bars 1 5 5 10 15 20 25 30 2 4 6 8 10 12 a Inter annual b Seasonal 1 5 1 5 5 1 0 1 5 20 c Daily Figure 5 7 Trends obtained from the data using the detrending tool 53 Part Il 2 D implementation 54 6 SCRIPTS INPUT FILES AND DIRECTORIES This chapter starts with the description of the scripts used by Diva then input files required for simple 2 D analysis are presented here Basically only three files are needed as input 1 a file containing the data data dat 2 the specification of the domain of analysis coast cont and 3 the list of the parameters used during the analysis param par Contents 6 1 Listof2 Dtools 2 ce ew srca danes ew we ee ee 56 6 1 1 Operations on data o o se s ee ee a 56 6 1 2 Patamict res mati n o oe co wo ceed ea ka Hae ee ia ead 56 6 1 3 Contours and mesh gt a oca ss cece coco he eel eb eae 57 Gld Analysis
184. the numerical fields include the overlapping regions only the plotting is limited with the plotboundingbox dat file Note the gnuplot colorbars use a scale that is actually remapped to the bounds found in VAR bound Example if your colorbar definition goes from 0 to 10 and the VAR bounds are from 0 and 100 a value of 50 in the variable analysed will use the color found in the colorbar definition at value 5 To help you designing a specially adapted color bar lets say for salinity it is therefore a good idea to define the colorbar with the same bounds as those in VAR bounds Note for adapting the color palette file gnuplotcolornames contains a list of pre existing colors and their hexadecimal codes you can use instead of names e Detrending Possible flag values are 0 and n the action is activated when choosing flag value an integer n gt 0 The chosen value n must be equal or smaller to groups number in data files Note If you use divadoall or divaselectorODV4 to extract data and create data input files columns 5 6 7 and 8 contain respectively groups years months days and hours 1 for the first year in the selection etc Part IV Appendix 153 A PROBLEMS AND SOLUTIONS This chapter contains a list of Frequently Asked Questions concerning many aspects of Diva as well as a list of solved issues or bugs Contents Al FAQ so eo eo 6s eS ee oe eae OL 6h 8 ee Ve 155 A 1 1 Where canI find the latest
185. themselves are found as the solution of the minimization process K Ka q g 5 3 The stiffness matrix K K K4 is composed by the different terms related to the derivatives K and a final term related to the location of data Na i 1 where S is a column vector containing the shape functions associated with a data point 7 This vector has zeros everywhere except for all connectors of the element in which the data point lies Similarly the data value d come into the formulation by a projection of the data onto the charge vector of the connectors g Sid 5 5 and the total charge vector is the sum of the individual ones When a constraint is added in the original version the stiffness matrix is augmented by com ponents for each element Q which are computed Os Os 0 0 s Os Os 0s 0s Q i f Ox j Oy A oy a Oy OF 7 Oy A ox A Oy i 240 where s are the shape functions of the element 5 1 1 Advection alone Figure 5 1 shows an example of a single data point located at 0 7 60 with unit value in a solid rotation centred in 0 60 In the absence of diffusion up and downwind are identical The Reynolds number measures the ratio of the inertial effects over the viscosity effects 44 Chapter 5 ADDITIONAL CONSTRAINTS 5 1 Adding advection to the cost AND DETRENDING function covariance counts Analysis 61 60 8 60 6 60 4 Zez i mS Figure 5 1 Single data point wi
186. there is always an uncertainty on the value obtained whatever the instrument and the field Noise does not only take into account instrumental error which is generally low but also e the representativeness errors meaning that what one measures is not always what ones intends to analyse e g skin temperature inadequate scales e the synopticity errors occuring when the measurements are assumed to be taken at the same time e g data from a cruise Rixen ef al 2001 Because of the multiple sources of error a perfect fit to data is not advised and the noise on the measurements has to be considered during the analysis 2 2 The Optimal Interpolation method Before explaining the core of Diva technique the main principles of Optimal interpolation OI von Storch amp Zwiers 1999 Chil s amp Delfiner 1999 are explained OI is a popular analysis tool owing to its ease of use and the error field associated to the analysis e g Shen et al 1998 Kaplan et al 2000 The first references of the method are Gandin 1965 and Bretherton et al 1976 The idea is to minimise the expected error variance of the analysis This conditions lead to the determination of the weights w 2 2 with the assumption that the true anomaly field y is one realization out of a zero mean ensemble Note that Kriging Krige 1951 Matheron 1963 is an equivalent technique it uses the same criterion as OI but with a different mathemat
187. timation of the actual errors since the error reduction by the overestimated covariances 4 1 is also overestimated The poor man s error field is a very efficient way to assess data coverage and determine the regions where the analysis cannot be trusted 4 2 2 The hybrid approach In this approach Brankart amp Brasseur 1998 and Rixen ef al 2000 proposed a heuristic statistical error expression for the VIM in Diva error fields are calculated by analogy with OI since analysis in OI is equivalent to analysis with VIM insofar as the reproducing Kernel of VIM and the covariance function of OI are identical and since error field of OI equals analysis of covariance fields error field of VIM equals analysis by VIM of covariance fields Mathematically according to the developments of Section 2 2 we have Solution OL y r g r D d 4 2 Solution VIM e r Ti r K T2 r d 4 3 SSS x Error OI e r o r g r D g r 4 4 Error VIM e r o r Ti r K T r g r 4 5 SESS xx In practice the data input of the analysis tool for an error calculation is a vector containing the covariance of data points g r with the point in which the error estimate is to be calculated 30 The covariance vector to be analysed is calculated using the correlation function or Kernel c of an infinite domain in terms of the Bessel function as shown in 2 24 e r 0 r o r Ti r K T2 r c r
188. tion is to compute for Ly the mean distance between two stations and for L the mean distance between two measurements on a same profile Then we compute the ratio and multiply the horizontal coordinates by r This allows one to work with the same length scale both on vertical and horizontal directions With the data set from Fig 10 5 b we obtain Le 4 4km Ly 55m r 0 0125 We then compute the length scale with the help of divafit and generate a new mesh showed on Fig 10 6 Figure 10 6 Mesh generated in the scaled domain 111 Use of negative icoordchange A more direct way to do the previous operation consists in changing the value of icoord change in file param par by assigning a negative value to this parameter we apply a scaling on the x coordinate Sec 6 2 3 In the present case we would put icoordchange 0 0125 Then the classical Diva operations can be done 10 2 3 Analysis Once the mesh is created the analysis is straightforward The only thing to be aware of is the specification of the domain in file param par as we worked with scaled coordinates when generating the mesh we have to do the same when specifying x yorigin and dx y After the analysis we may simply multiply the x coordinate by r to recover the original values The results are presented on Fig 10 7 Depth m Depth m uo 10 2 30 40 50 60 70 80 90 100 40 50 Distance km Distance km a Reconstructed tem
189. to your installation For example ctroupin predator Software Diva DIVA3D divastripped pwd hnome ctroupin Software Diva DIVA3D divastripped ctroupin predator Software Diva DIVA3D divastripped Sexport PATH SPATH home ctroupin Software Diva DIVA3D divastripped ctroupin predator Software Diva DIVA3D divastripped echo PATH usr local sbin usr local bin usr sbin usr bin home ctroupin Software Diva DIVA3D divastripped For example in cygwin e gointhe ect e edit file bash bashrc file and add the following line export PATH SPATH e type source bash bashrc in order to take into account the modification made A 2 2 Analysed field with white boxes near boundaries The analysed fields has points of not a number NaN values Why do I get this error This problem arises from the fact that you request the analysis almost exactly on the boundary 159 y eeyrces_nuruly y Degrees_north 0 20 0 40 0 60 0 80 1 00 0 00 0 20 0 40 0 60 0 80 1 00 x Degrees_east x Degrees_east Figure A 2 Examples of Diva outputs with zones of NaN at boundaries For the right the solution to the problem was applied How to solve it Internally Diva makes some coordinates changes and therefore roundings on boundary posi tions The decision of a point falls in the domain or not can therefore be very sensitive to rounding if you place a request for analysis exactly
190. tput and output type of product Then set the 4 D region lon lat depth time and any additional constraints Select view Longitude Latitude map xy Next gt Select output ASCII file ke Select region Full Region Use the two click map Help Previous Output Define variable 60 0 N 50 0 W 0 0 E 0 0 N Zma zomon LAS Amstrong 1 1 1 Select options o Evaluate expression o ASCII file format Tab separated v Interpolate normal to plot Off v Figure 7 7 Topography extraction from NVODS 73 Depth m 33 N 500 20h i 1000 32 N eR al 1500 2000 A ee re TRET i 2500 3000 3500 30 ecscssacustaccad 30 N o 30 O 30 a0 O wW 11 W 10 W ow 4000 Figure 7 8 Topography from Naval Oceanographic Office website where nn corresponds to the nn level defined in contour depth File coast cont con tains the coastline at the surface level z 0 As an illustration we want to have contours from surface to a depth of 1000 m every 200 m with topo grd and TopoInfo dat created in the Section 7 1 To this end we use the following file 2500 2000 1500 1000 500 0 Example file 7 1 contour depth Contours for the specified depths are showed on Fig 7 10 7 2 3 Using ODV Tool divacoa2cont allows converting ODV format coastlines t
191. tracted 62 xori yori nx ny xori yori indicate the coordinates of the first grid point while nx ny indicate the number of grid points in x y directions valex Exclusion value value used to fill the output matrix when a point corresponds with land Any value is accepted but the user has to ensure that the exclusion value cannot be a value obtained by the interpolation of the measurements snr Signal to noise ratio of the whole dataset Section 2 3 1 It has to be defined as a real positive number as the correlation length varbak Variance of the background field 6 2 4 Locations of additional points where analysis is required optional The file valat xy coord is a two column list of locations where you want the analysis to be performed in addition to the regular grid defined in param par 20 20 0 60 10 40 40 Example file 6 4 valatxy coord If they exist columns 3 and higher are not used 6 3 Working directories 2 D analysis For 2 D analysis the main working directory is divast ripped Inside it we have charles gherl3 divastripped tree d L 2 divawork sub gnuwork gnuplottools plots 63 input meshgenwork output ghertonetcdf meshvisu 10 directories divawork is where the intermediate files are produced gnuwork contains the scripts for generating the plots with Gnuplot These plots will
192. ts i 1 2 N Be aware that some cases Fig 7 9 are to be avoided since problems arise during the mesh generation when crossings occur in the contour Also note that as contours are automatically closed by Diva the segment joining the first and the last points may generate errors Figure 7 9 Example of improper contours Left crossing of two segments of a same contour up crossing of two different contours right first and last points of the contour generate a segment that crosses the other parts down two contours having a common segment Remember that you can use the tool di vacck for checking and thinning of contours 7 2 2 From topography Once you have placed files topo grd and Topo nfo dat in directory input type divacont in the command line shell This will generate several coastline files named coast cont 100n1 12 Chapter 7 PREPARATION OF THE INPUT P FILES 7 2 Creation of contours NVODS OPeNDAP F TDS THREDDS Index Search Go Datasets gt by Dataset Name gt NA Select a variable and then click Next gt to proceed to the Constraints page Dataset variable s Reset Select all Unselect all Constraints a Topography Next gt Previous Output Define variable About Contact LAS Amstrong 1 1 1 a NVODS OPeNDAP F TDS THREDDS Indes Search Datasets Variables Constraints Select your desired view geometry of ou
193. ue of 2 5 for the global mesh specified in param par and define a finer mesh around the island through the following coast cont dens file which means that we want a length scale of 0 125 in the domain defined by by the four points 1 1 4 1 4 4 1 4 Be sure that the domain where you want to have a finer mesh is on the left when following the contour The mesh generated with these conditions is presented on Fig 8 2 80 WWNN BOW WO BN aaoo NON WWD Example file 8 1 coast cont Poe BRP OR 125 4 BP rR Example file 8 2 coast cont dens VIN ve D DENNY SSENT A BEROA A NAAG RLA IOSA r ENA NINIMETNIN ENEO BERS RE OAA Waa RD CR EROS RADARS iS ATA lt P Y Figure 8 2 Mesh refinement around the island 81 8 1 3 di divacalc vacalc is the script that runs the analysis by solving the variational principle over the domain of interest To work properly it needs a data file a parameter file and a finite element mesh Tips 8 1 As the mesh generation is often the most time consuming part of a Diva execution remember that once you have created the mesh you do need to run divadress each time you want a new analysis but just divacalc m Latitude Figure 8 3 Example of anal ysed field 0 10 20 30 40 50 60 70 80 90 100 Longitude Output files e fieldgher anl and errorfieldgher anl are respectively the analysis and the error fields in gher
194. ur depth file provided in the subdirectory input It is also taking into account a minimum number of data in a layer with regard to the corresponding flag value given in driver When boundary lines and coastlines generation is activated in the driver the execu tion is made for all levels found in contour depth file provided in the subdirectory Input When parameters optimisation and or analysis is activated the execution is made for the levels between the values chosen for the lower and upper level numbers and takes into account the bound values maximum and minimum prescribed in the driver All actions performed by divadoal11 use the input files yvarlist yearlist in climatology directory monthlist contour depth inclimatology input directory param par in climatology input orin climatology input divaparam directory 142 13 3 Input data preparation 13 3 1 Inputs for input data preparation actions In Diva 4D or Climatology production we can use all the tools provided in Diva 3D for input data preparation Input data preparation consists in the following actions e Data set for extraction e Boundary lines and coastlines generation and advection field generation e Data cleaning on mesh outliers elimination from data sets and generation of Relative Length fields e Parameters optimisation and reference fields generation To perform an action one has to configure the driver f
195. ure 2 5 The theoretical Kernel func Field value tion is given in red while the black curve comes from the analysis of a single point with a unit value 0 4 0 2 0 1 2 3 4 5 Distance r L 17 2 3 4 Comparison OI VIM Rixen et al 2000 compared the two methods by testing quasi synoptic salinity data Results showed that the main differences between OA and VIM occur in coastal areas and around islands O 0 10 whereas the differences range from 0 01 to 0 02 within the domain The same conclusions were drawn when they compared OI and VIM in the case of climatological data set both fields were nearly identical except in the vicinity of the coasts differences of up to 0 1 A summary of the main characteristics of the two methods is found in Tab 2 1 Table 2 1 Statistical equivalence between OI and VIM from Rixen et al 2000 OI VIM Minimization e r p r pi r de 4 te 6 ri loll Solution olr c r D d g r c r D Data correlation D o c ri rj 6 D K ti rj aT ij Data field covariance c oc r ri c K r ri 2 3 5 Comparison between the spatial interpolation methods Table 2 2 compares characteristics of different spatial interpolation methods e the error minimization min e the extension to 3 dimensions 3 D e the multivariate analysis e the number of operations per analysis e the error estimate e r e apriori known param
196. v random fields Computational Statistics amp Data Analysis 52 5 2331 2349 doi 10 1016 j csda 2007 09 018 Kaplan A Kushnir Y amp Cane M A 2000 Reduced space optimal interpolation of historical marine sea level pressure 1854 1992 Journal of Climate 13 16 2987 3002 doi 10 1175 1520 0442 2000 013 lt 2987 RSOIOH gt 2 0 CO 2 URL http journals ametsoc org doi abs 10 1175 1520 0442 282000 29013 3C2987 3ARSOIOH 3E2 0 CO 3B2 Karafistan A Martin J M Rixen M amp Beckers J M 2002 Space and time dis tributions of phosphates in the Mediterranean Sea Deep Sea Research I 49 1 67 82 doi 10 1016 S0967 0637 01 00042 5 URL http www sciencedirect com science article pii S0967063701000425 Krige D G 1951 A statistical approach to some basic mine valuation problems on the Witwatersrand Journal of Geophysical Research 95 13529 13541 Matheron G 1963 Principles of geostatistics J Chem Metall and Min Soc South Africa 52 119 139 McIntosh P C 1990 Oceanographic data interpolation objective analysis and splines Jour nal of Geophysical Research 95 13529 13541 Ooyama K V 1987 Scale controlled objective analysis Monthly Weather Review 115 10 2479 2506 doi 10 1175 1520 0493 1987 115 lt 2479 SCOA gt 2 0 CO 2 Ouberdous M Troupin C Lenartz F Barth A amp Beckers J M 2011 Diva hydrographic data sets stabilisation an optimal method In prep Rixen M B
197. va execution with problem with the Jacobian matrix 170 197 A 15 Examples of Diva outputs with random zones of NaN 171 A 16 Error message during the reading of the datafile 172 Bl Exa ampleof simple mesh gt os sea Sek eu be KS eK Ee ESS BSS Ss 181 C 1 Scripts used in the command line version of Diva 186 198 LIST OF TABLES 2 1 Statistical equivalence between OI and VIM 18 2 2 Characteristics of different methods of data analysis 19 C 1 DIVADEMECUM Diva input and output files 185 199
198. var yyyyzzzz mmnn larax lyyyy fieldgher ref var yyyyzzzz mmnn errr lyyyy ref ne A subdirectory Fields containing all the Diva 2D output files for all levels Gri Var val var Var Var Var var var adinto dat var yyyyzzzz mmnn lexix ref yyyyzzzz mmnn lerre anl var yyyyzzzz mmnn lxexrrx ascii ref yyyyzzzz mmnn lerrx anl ne var yyyyzzzz mmnn lxxrrx datapoint ref yyyyzzzz mmnn lerrx ascii anl var yyyyzzzz mmnn lxxrx ref nc yyyyzzzz mmnn lerrx outliersbis var yyyyzzzz mmnn lxxrzx outliersbis norm yyyyzzzz mmnn lerrx error yyyyzzzz mmnn lexrx errorascii yyyyzzzz mmnn lerrx valatxyasc ref atxy var yyyyzzzz mmnn lrer A subdirectory datadetrend it contains trend data set files for all levels trends i dat var yyyyzzzz mmnn lxxxx 7 is the group number A subdirectory Meshes it contains the mesh files so that they can be re used for other ap plications Log and metadata files Two log files and a text metadata file are generated e var Metainfo txt All the information about domain grid variable and run parameters e var yyyyzzzz mmnn Fortran 1log Log file of fortran binaries run e var yyyyzzzz mmnn diva3D 1og Log file of shell scripts execution 149 13 4 4 driver file actions and flag values All actions performed by divadoall are prescribed in the file driver through flag values In this section all possible actions and corresponding flag values are
199. veral points at once to calculate error estimates and repeat the exer cise several times to make estimates robust In Diva this options are available in di vacvrand A variant is divacvclasses in which all data from a given class e g specific year are set aside and the analysis compared to 23 3 2 3 Generalised cross validation GCV According to Craven amp Wahba 1978 modifying the error estimate as follows d di S 1 Ax 3 14 allows one to keep the data during the analysis and will reduce the computing cost In this formulation the denominator penalizes more heavily data points in which the analysis is forced to be close the data and accounts therefore for the self influence of the data point which is absent in the case of pure cross validation Computation of A When the matrix A is not explicitly calculated A can be obtained by performing an analysis with a vector e 00 010 0 zero on all data locations except at point i where its value is one This demands an analysis for every data point in which the estimator is constructed The associated computational cost can be reduced by replacing A by the average value and assuming 1 Ay gt gace A 3 15 To avoid calculating all A and summing them up we can use the following estimate Girard 1989 z Az 3 16 1 trace A gt where z is a vector of random variables of zero mean For robustness the trace estimate can be
200. version 4 155 A 1 2 Howto report a bug oraproblem 155 A 1 3 How to register to the user group 2 2 2 eee ee 155 A 1 4 How can I use Diva in R Matlab IDL Ferret or any other software 155 A 1 5 What value for parameter ireg should I choose for a semi normed MHOIVRIS 6 be E ee ee be bebe ee oe es 156 A 1 6 How can one create monthly analysis where the reference field is the annual analysis cg ae ek ee A we ee we 157 A 1 7 How to contribute to the development 157 A 1 8 How can Irun Diva on a multi processor machine 158 A 1 9 What is the resolution of the output field 0 158 AZ Error WIUSSARES e eea PS Re eS OS OE MOE es 158 A 2 1 Command not found message 004 158 A 2 2 Analysed field with white boxes near boundaries 159 A 2 3 Command line scripts not working 160 A 2 4 Compilation problems 2 0000 162 AZ 5 Whydolgetthiserar 0 6c ee ee ee 162 A 2 6 Undefined references to NetCDF routines 162 A 2 7 Resource temporarily unavailable 164 A28 Enrorofallocation o eea ea cero cd be eee eee eas 165 A 2 9 Permission denied for execution of diva a 166 A 2 10 Problem with contour generation o oaoa aa 166 A 2 11 Analysis yields empty field o o o onua o 167 A 2 12 Windows runs out of virtual memory during diva execution 16
201. vironmental dataset for marine species distribution modeling Global Ecology and Biogeography 21 2 272 281 doi 10 1111 1466 8238 201 1 00656 x URL http onlinelibrary wiley com doi 10 1111 j 1466 8238 201 1 00656 x pdf von Storch H amp Zwiers F 1999 Statistical analysis in climate research Cambridge Uni versity Press Cambridge 484 pp ISBN 0 521 45071 3 Wahba G 1975 Smoothing noisy data with spline functions Numerische Mathematik 24 383 393 Wahba G amp Wendelberger J 1980 Some new mathematical methods for variational objec tive analysis using splines and cross validation Monthly Weather Review 108 1122 1143 Yari S Kova evi V Cardin V Ga i M amp Bryden H L 2012 Direct estimate of water heat and salt transport through the Strait of Otranto Journal of Geophysical Research 117 C09009 doi 10 1029 2012JC007936 URL http www agu org journals jc jc1209 2012JC007936 Zhang H amp Wang Y 2010 Kriging and cross validation for massive spatial data Environ metrics 21 3 4 290 304 doi 10 1002 env 1023 194 1 1 1 2 2d 2 2 23 2 4 23 4 1 4 2 al 3a S3 5 4 S 5 6 5 7 6 1 6 2 Ld Ta T a 74 Tla 7 6 Ta Results obtained with divatest 000 e a eee Results obtained with divabigtest aaao a 69 eau eS Schema of the data gridding 2424456468 e Interpolation vs approximation o oo e 000002 eae Tria
202. where the reference field is the annual analysis The latest version of di vaanom is able to use an existing reference field This field should be present as a binary file in the output directory with the name fieldgher anl ref and the GridInfo dat file should be present in output ghertonetcdf directory An execution of divaanom will provide you with data dat which contains anomalies with respect to your reference field annual analysis in this case Then you can work with data dat as usual The last step is to apply divasumup to reconstruct the field by summing the anomaly analysis and the reference field In summary the steps to follow are 1 apply divadress to the annual data after the optimisation of the parameters 2 copy the output fieldgher anl with the name fieldgher anl ref 3 for each month a copy the corresponding data file into the input directory b apply divaanon c perform an analysis on the anomalies d apply divasumup A 1 7 How to contribute to the development Any suggestion concerning the development of the software is welcome Simply send a de scription of what improvements tools you would like to see and we will check if this could be easily added to the general distribution 157 A 1 8 How can I run Diva on a multi processor machine The best option is to copy the whole directory divast ripped in the directory in which it is located but with a different name e g divastripp
203. x exclusion value 9999 0 snr signal to noise ratio of the whole data set 68 7858658 varbak variance of the background field If zero no error fields are produced If one relativ rrors are obtained 2 05896711 Example file 10 5 Adapted version of param par Analysis 46 40 44 42 D Q o Latitude N g Q oO 34 32 Longitude E Figure 10 3 Analysed salinity field with the parameters from divagcv 108 Error field 46 1 4 44 42 D Latitude N 2 Ww O 34 32 Longitude E Figure 10 4 Error field and data locations with the parameters from divagcv 109 10 2 Analysis of profiles from a cruise Usually Diva is used in horizontal planes and the coordinate system deals with longitude and latitude One may also want to use Diva for interpolating data obtained during a campaign i e several profiles along a determinate trajectory In this case the user will work in vertical planes x coordinate will be a curvilinear distance and y coordinate will be the depth In horizontal planes domains are physically limited by coastlines while in vertical planes the boundaries will be the sea surface and the bottom The domain will be closed by artifi cial vertical lines for example lines that originate from the first and last stations of the cruise Fig 10 5 b We present hereinafter a complete example for this type of
204. xori 0 yori 6 0 dx 0 01 dy 0 002 which gives us a 809 x 299 point grid Results are presented on Figs 10 12 and 10 13 S PSU 37 5 1000 ca 2000 ae 36 5 3000 Depth m 4000 Js M aaf 35 5 5000 COS E t Petreatl Ce A 4 35 80005 1000 2000 3000 4000 5000 6000 Distance km Figure 10 12 Analysed field 116 S PSU 37 5 36 5 Depth m 35 5 0 1000 2000 3000 4000 5000 6000 Distance km Figure 10 13 Analysed field between 500 m and sea surface 10 4 Advection constraint Mediterranean Sea In this example data points are located on a regular grid with alternate values of 1 and 1 An analysis with isotropic OI yields the field shown in Fig 10 14 we obtain a pattern of alternating circular isolines on the whole domain land is treated as it was sea The analysis with Diva shows the influence of coastlines as differences between the two cases are more obvious near coasts Fig 10 15 Analysis 44 A2 4 zZ ga Figure 10 14 Isotropic OIl sus ed 32 5 D 5 10 15 20 25 39 35 Longitude E 117 Latitude N B a 4 Analysis a 4 5 o 5 10 is 2 Longitude E 0 45 D Figure 10 15 Diva with coastal effect 0 5 0 25 37 35 An illustration of the advection constraint is also presented the velocity field is shown in Fig 10 16 and the analysis produces the field of Fig 10
205. y directly the binaries available in the sub directories For example for Windows with the Cygwin tool charles gherl3 bin cp f cygwin 1 4 Run tests In the main working directory GODIVA_mm_yyyy DIVA3D divastripped run one the two available tests divatest and divabigtest 1 4 1 Basic test divatest creates basic input files see Chapter 6 for details performs a simple Diva execu tion checks if awk is appropriate and checks if the pipes are supported in your operating system O S If divatest hangs during the pipe test it means pipes are not supported as for some gfortran versions and you can use a CTRL C to exit The analysis output can be checked using any software for reading NetCDF files In this case we use ncview see Chapter 9 for details and installation charles gherl3 divastripped divatest charles gherl3 divastripped ncview output ghertonetcdf results nc The results you obtain have to be similar to those of Fig 1 1 output ghert f results nc m X Neview 1 93g David W Pierce 24 February 2009 variable analyzed_field No scan axis displayed range 0 703694 to 0 434476 Current i 49 j 0 0 162365 x 0 98 y 0 Quit 4 4 gt gt Edt Delay E opts bright InvP InvC MX6 Linear Axes Range Repl Print Units Degrees_nor Degrees_eas Figure 1 1 Results obtained with divatest 1 4 2 Large memory test divabigtes

Download Pdf Manuals

image

Related Search

Related Contents

Transcend 1.8" 64GB eSATA SSD  HT BusinessConnect for iPhone - User Guide - T-com  Zend Enterprise PHP Patterns  

Copyright © All rights reserved.
Failed to retrieve file