Home
Reference Manual & User's Guide
Contents
1. Modules Routines Parameters dynadv dyn_adv_ctl daymod day_mth lib mpp mpi comm opa par_oce ipni jpnj jpnij zdftke tke rst eosbn2 neos init tradmp cofdis dtacof dtacof zoom strdmp ttrdmp resto traqsr nksr gdsr Table 1 2 List of modified declarations in the direct code NEMO e uslp vslp the slope of neutral surface slope of isopycnal surfaces referenced locally are treated as passive in order to not recomputed them at each step They are used in routine traldf_iso_tam F90 e wslpi j vertical mixing coefficient due to lateral mixing They are used in routine trazd imp_tam F90 1 4 2 Simplifications e removal of the upstream part of the second order centered scheme for traadv_cen2_tam F90 It introduces some non differentiabilities Some complementary test must be held to fully implement the second order scheme e removal of zonal mean lateral diffusive heat and salt transport pht ldf and pst_Idf 1 5 Hand coding status The current status for the hand coding part of NEMOTAM NEMOVAR is gathered in Tables 1 3 and 1 4 1 6 Available options in NEMOTAM This sections contains information on current available configuration for NEMOTAM To have an overview on available routines please see the TAM development progress table We use the following method The physical choices are set through cpp keys and namelist parameters We use below a similar table used for NEMO See tables
2. gt alem 122 zleci Pi RSS Pl P2 PI gt 2loc2 Pl S zlec P2 zlock PJ 3 legal deca K or Jj task B zglo operation aele PA 3 1 zleel Pil zejle P1 2 2 zloe Pil we then write the adjoint as follows zlee2 Pls Ziloc2 Pls zolo Pl5 3 2 zejle pileli na 0 IOC LIP ibys zlegl Pls s zejle 191 2 1 zolo Piles s i 0 zelo Tors zele Ple zolo P2 i e mpp_sum_nfd because zloc Pis ie moe mull mers lass zlocl Pils zlog Pile zlecl P2 zlocil_ 12 zaga our 8 1 z legi Pls aolo totes 8 2 22 Deliverable D1 3 NEMOTAM Reference Manual amp User s Guide Chapter 2 NEMOTAM USER S GUIDE 2 1 Source code structuration The project will work with three repositories see Fig 2 1b c d e a NEMOBASE repository with an official NEMO released version currently the tag nemo_v3 available at https forge ipsl jussieu fr nemo browser tags nemo_v3 e a NEMOVAR repository with all developments related to the nemovar project including new and modified files for NEMO this is the standard version of NEMOVAR currently tag N3 0 A2 0 e a VODA repository including new development for NEMOTAM and NEMOVAR within the VODA project Gj NEMOBASE Z AGRIF v VODA CONFIG v NEMO Gi CVSROOT v Mi NEMOVAR gt M OPA SRC Gi Doc V fi NEMO Y NEMOASSIM A 1o1PSL gt Z OPA SRC gt M SESAM SRC BI NEMO Y NEMOASSIM gt i SIM SRC Scns gt ase gt vast ga LIM SRC 3 gt J VAR SRC Y A NEMOTAM
3. How to compile the GYRE configuration Similar to ORCA2 configuration replacing ORCA2_Z31 by GYRE_Z31 How to run the GYRE configuration Similar to ORCA2 configuration replacing ORCA2 Z31 by GYRE_Z31 Tangent Linear Hypothesis HLT validity To illustrate the tangent linear hypothesis validity test We use an initial state x ten years from spin up and an increment x computed from an previous assimiilation with x7 lt 1 l xs lt 0 1 32 l9zy lt 0 0022 and O7y lt 0 0019 see figure 2 4 Deliverable D1 3 NEMOTAM Reference Manual amp User s Guide R VODA ANR 08 COSI 016 V DA 0 012 0 0025 si UY V gaa 0 0020 0 008 0 0015 0 006 0 0010 0 004 0 002 0 0005 ooo 50 100 150 200 250 300 350 400 ooo 50 100 150 200 250 300 350 300 990005 50 100 150 200 250 300 350 400 0 000045 9 9996e 1 s le 7 9 999998e 1 1 0000 T S Ka I zo ESS 0 000035 0 9996 0 000030 15 0 9994 Pa 9 0 000025 0 9992 0 000020 0 9990 1 0 0 000015 0 9988 0 000010 0 9986 0 5 RL 50 100 150 200 250 300 350 400 0 50 100 150 200 250 300 350 300 999840 50 100 150 200 250 300 350 400 nb days nb days nb days Figure 2 4 Tangent linear hypothsesis validty for GYRE Z31 plot in function of time window in days over 1 year Top graphs are RMS of T S U and V variables in S I units Bottom graphs are related coefficient correlation 2
4. Z NST SRC gt I NEMOQC gt Z OPATAM SRC Ga OFF SRC v NEMOTAM v Mm UTIL V di GIT REF Ga OPA SRC gt Z misc gt 3 build gt Z NEMOBASE al TOP SRC gt Z OPATAM SRC gt fem gt I NEMOVAR CA NVIK gt 3 TOOLS gt 3 python gt Z VODA UTIL gt uTIL gt 3 scripts a GIT tree b NEMOBASE c NEMOVAR d VODA Figure 2 1 Code organization 23 R VODA ANR 08 COSI 016 V DA The building process will look for both repositories if any redundancy is found a VODA files will overwrite the corresponding NEMOVAR file and a NEMOVAR file will overwrite the corresponding NEMOBASE file in the building folder The NEMOBASE repository see Fig 2 1b is the standard NEMO folder The NEMOVAR repository see Fig 2 lc is subdivided into 6 components NEMO NEMOQC NEMOTAM NEMOASSIM UTIL and TOOL The NEMOTAM folder is a mimic of the NEMO folder mean ing we have an OPATAM_SRC folder subdivided into components as ASM DOM DYN LDF TRA The VODA folder see Fig 2 1d mimic the NEMOVAR folder with additional contri butions This organization gives a clear snapshot of what is being developped and lets some room for further development 2 2 Getting started tutorial 2 2 1 Installing the code using the NEMOVAR GIT repository Checking out the code from the GIT repository You need to ask the VODA project team to have developer access to the VODA project on the gforge inria fr server and access to the NEMO IPSL
5. 252818496373574E 17 2E 15 2E 14 ok dynvor_adj ens 252818508381207E 17 252818508381207E 17 0E 00 2E 14 ok dynvor_adj een 252818506922870E 17 252818506922870E 17 0E 00 2E 14 ok dynldf_adj lap 311731217229964E 17 311731217229965E 17 3E 15 2E 14 ok dynldf adj blp 252575821916828E 17 252575821916828E 17 2E 15 2E 14 ok dyn_zdf_adj 252556994319522E 17 252556994319522E 17 0E 00 2E 14 ok dyn spg fit TI 790035995408866E 24 790035995408866E 24 0E 00 2E 14 ok dyn spg fit T2 315978990829171E 25 315978990829171E 25 3E 15 2E 14 ok dyn_hpg_adj 2539535 104302 15E 17 253953510430214E 17 3E 15 2E 14 ok dyn nxt adj 758385105599429E 17 758385105599429E 17 0E 00 2E 14 ok wzv adj 258438017479678E 13 258438017479678E 13 0E 00 2E 14 ok tra_sbc_adj 517847966550809E 15 517847966550810E 15 5E 15 2E 14 ok tra gsr adj 1 134738569058199E 19 134738569058200E 19 1E 14 2E 14 ok tra gsr adj 2 134738569058199E 19 134738569058200E 19 1E 14 2E 14 ok tra dmp adj TI 152739703065678E419 152739703065678E 19 OE 00 2E 14 ok tra dmp adj T2 152739703065678E 19 152739703065678E 19 0E 00 2E 14 ok tra dmp adj T3 152739703065678E 19 152739703065678E 19 OE 00 2E 14 ok tra_adv_cen2 152558770733990E 19 152558770733990E 19 1E 14 2E 14 ok tra_cla_adj Gi 4875 13953864278E 16 487513953864278E 16 2E 15 2E 14 ok tra cla adj BM 158030397951644E 15 158030397951644E 15 6E 15 2E 14 ok t
6. TAF Transformation of Algorithms in Fortran G n rateur automatique de code tangent et adjoint utilis pour MITgcm TAM Mod les Tangent et Adjoint TAPENADE G n rateur automatique de code tangent et adjoint d velopp par le projet TROPICS de l INRIA Deliverable D1 3 NEMOTAM Reference Manual amp User s Guide
7. communication receive send communication gather scatter arithmetic scatter gather inpout Output write read inpout Output read write Table 1 9 ORCA2 Results of Adjoint test fo sub routines There is no tangent of bc_Ink The direct routine is used For the adjoint part we use the coding rule described in table 1 9 1 8 2 Adjoint of MPI ALLGATHER From revision 3 2 of NEMO a new treatment of north fold horizontal bondary condition is per formed using Ibcnfd F90 routine This induces a MPI_ALLGATHER usage in libmpp F90 module mpp Ibc_north_3d and mpp bc north 2d MPI ALLGATHER gathers data from all tasks and distribute it to all Before MPI Allgather Process 1 Process 2 Process 3 Process 4 After MPI Allgather Process 1 Process 2 Process 3 Process 4 Figure 1 1 MPI_ALLGATHER task description ref http rc usf edu tutorials classes tutorial mpi chapter8 html If we call zloc P the data from task i and the zglo the result of MPLALLGATHER and zloc adj P zglo_adj their adjoint equivalent The adjoint counter part of MPI_ALLGATHER zglo zloc 1S Deliverable D1 3 NEMOTAM Reference Manual amp User s Guide 21 R VODA ANR 08 COSI 016 V DA MPI_SUM zglo_ adj zleg Pi zele adler As short demonstration we consider a two task case P and Po MPI_ALLGATHER zglo zloc is equivalent to for P 1 send and receive local data send 2 loc Pi Pil 2
8. ing as p order of 1 Bottom right d non linear routine with a residual decreasing as p order of 1 Legend Solid line is N M x por M x circle symbol Lo k por triangle symbol NE Lg e ci sede ciei actu RHR 284 29 Tangent linear hypothsesis validty for GYRE_Z31 plot in function of time window in days over 1 year Top graphs are RMS of T S U and V variables in S I units Bottom graphs are related coefficient correlation 33 39 VODA ANR 08 COSI 016 V DA 40 Deliverable D1 3 NEMOTAM Reference Manual amp User s Guide List of Tables 1 1 12 1 3 1 4 1 5 1 6 1 7 1 8 1 9 2 1 2 2 ZO 2 4 Fields stored in the reference trajectory wae ae tr We ee 4e List of modified declarations in the direct code NEMO Hand coding status of NEMOTAM Dynamics part Hand coding status of NEMOTAM Tracers and Surface Boundary Condition part Available option in NEMOTAM partl Available option in NEMOTAM part2 Adjoint test labels definition lt s se cs ec nesca A OE Re sei a Tangent Linear tests First order check a and second order check b ORCAZ2 Results of Adjoint test fo sub routines ORCA2 Results of Tangent tests for sub routines ORCA2 Results of the Adjoint tests for the main sub routines ORCA2 Results of the Adjoint tests for the main routine s
9. of Tangent Linear with respect to the model is decreasing as p Note that the second test b is not relevant if M is linear Deliverable D1 3 NEMOTAM Reference Manual amp User s Guide 17 VODA ANR 08 COSI 016 V DA Test Expression behaviour Norm Np i a gt a Norm L b Na n Te Cst p Table 1 8 Tangent Linear tests First order check a and second order check b Build the tangent test The tangent test is embedded into nemotam To build it the user must add the compilation key key_tst_tlm in the CPP key set Otherwise a error message will raise during the run Run the tangent test To run the tangent test the code must e set the directory where the direct trajectory is stored e in the namelist namtst set In_tst to true e in the namelist namtst_tlm set In_tst_nemotam to true switch for M adjoint and tangent tests set ln tst tan cpd or In_tst_tan to true switch for tangent tests set In tst cpd tam and ln tst stp tam to false switch for adjoint tests set tim bch to true branching 0 for M X 1 for M X pod X and 2 for Lpax set curr loop to true current iteration set h ratio to true value of the ratio factor p applied to 0X namtst_tlm te Jin lo cia c r Looe ns rario Il S li Il 1 M X h ratio dx 2 SIL la ratio 0X near direct with perturbation namtst_tlm LA
10. the difference is around 10715 Category b illustrated by eos_insitu_tan p p in figure 2 3 gathers tangent linear routines behaving as expected w r t to their direct routine not linear counter part the computed residual is equivalent to a O p Categories c and d il lustrated by dynspg_flt_tan and tra adv cen2 tan in figure 2 3 gather suspicious cases we need to validate or invalidate through the choice made for the tangent linear Case c is for direct linear routine and d direct non linear routine Routine L Category class solsor_tan a dynadv_tan b dynhpg_tan a traldf lap tan b trazdf imp tan borc tra zpshde tan b trasbe tan b bn2 tan b eos Ipt tan b eos insitu2d tan b eos insp tan b eos insitu tan b dynspg fit tan Cc traadv_cen2_flt_tan d Table 2 1 ORCA2 Results of Tangent tests for sub routines The case of traadv_cen2_fit_tan is fully understood as an approximation was done on the nu merical scheme the tangent linear does not include the upstream component of the numerical scheme Below a certain threshold the upstream part which is a O p in N is no longer small compared to the second order scheme and thus Lp Testing the adjoint model The adjoint test for the ORCA2 configuration has proven satisfactory for the unitary routine tests see table 2 2 and the global test see tables 2 3 and 2 4 For the latter the integration
11. use of AD tool being left aside for the time being We may reconsider this in a medium or long term though 6 Deliverable D1 3 NEMOTAM Reference Manual amp User s Guide R VODA ANR 08 COSI 016 V DA 1 2 Tangent and adjoint models TAM basics 1 2 1 TAM but what for The development of tangent and adjoint models is an important step in addressing sensitivity anal ysis and variational data assimilation problems in Oceanography Sensitivity analysis is the study of how model output varies with changes in model inputs The sensitivity information given by the adjoint model is used directly to gain an understanding of the physical processes In data as similation one considers a cost function which is a measure of the model data misfit The adjoint sensitivities are used to build the gradient for descent algorithms Similarly the tangent model is used in the context of the incremental algorithms to linearize the cost function around a background control 1 2 2 Tangent and Adjoint coding principle The original program P whatever its size and run time computes a function F X R Y ER which is the composition of the elementary functions computed by each run time instruction In other words if P executes a sequence of elementary statements Ip k 1 p then P actually evaluates F fpo fot On OF where each f is the function implemented bu Therefore one can apply the chain rule of deriva
12. 1 5 and 1 6 Deliverable D1 3 NEMOTAM Reference Manual amp User s Guide 11 R VODA ANR 08 COSI 016 V DA Modules called Module s called Opio TET by step tam by previous one Ocean dynamics DYN cla_div_tam F90 cla_tam F90 divcur_tam F90 dynadv_tam F90 dynkeg tam F90 dynzad tam F90 dynadv cen2 tam F90 dynadv ubs tam F90 not in reference not in reference dynhpg tam F90 hpg zco hpg zps hpg sco hpg hel hpg_wdj hpg dje hpg rot dynldf_tam F90 dynldf_lap_tam F90 dynldf_bilap_tam F90 dynldf_iso_tam F90 dynldf_bilapg_tam F90 not in reference not in reference dynnxt_tam F90 Ik vvl non linear key obc key bdy not in reference key agrif not in reference dynspg tam F90 dynspg it tam F90 dynspg ts tam F90 not in reference dynspg_exp_tam F90 not in reference dynvor_tam F90 dyn_vor_ens dyn_vor_een dyn_vor_ene dyn_vor_mix not in reference not in reference dynzdf_tam F90 dynzdf_exp_tam F90 dynzdf_imp_tam F90 param avmu and avmv as passive variables if not non differentiability issue see zdftke formulation should be treated as active var when key_zdf_noncst is activated dynmem_tam F90 wzvmod_tam F90 12 Table 1 3 Hand coding status of NEMOTAM Dynamics part Deliverable D1 3 NEMOTAM Reference Manual amp User s Guide VODA ANR 08 COSI 016 V DA M
13. 231 cfg e You are now ready to compile the code You need to create a scratch directory for example SCRATCH_ORCA2 below where compilation and execution will be performed cd VODA GIT VODA UTIL build Ecmvmake ksh t SSCRATCH ORCA2 c mac intel B NEMO G ORCA2 731 cmvmake ksh t SCRATCH ORCA2 c mac intel B NEMOTAM G ORCA2_Z31 How to run the ORCA2 configuration A sample minimal script is given just as an example The direct model NEMO SVODA_GIT VODA UTIL scripts runnemo ksh t SCRATCH ORCA2 A mac intel v NEMO g ORCA2 Z31 The adjoint model NEMO tests SVODA_GIT VODA UTIL scripts runnemo ksh t SCRATCH ORCA2 A mac intel j TRAJ v NEMOTAM g ORCA2_Z31 where STRAJ is the reference trajectory directory This script absolutely needs to be customized with respect to your working environment Please have a look at this script before proceeding further You will first need to create a reference trajectory by running only the direct model NEMO and you then may want to use NEMOTAM to e launch the generic TAM test interface e investigate the time span over which the tangent linear hypothethis remains valid e etc Testing the tangent model and the tangent linear hypothesis As discussed previously the aims of the test is to illustrate the correctness of the tangent and how we have dealt with the non linearity if it exits of the direct model 28 Deliverable D1 3 NEMOTAM Reference Manu
14. 3 3 The POMME configuration toy model for handling open boundaries Description of the configuration NEMO is distributed with some reference configurations allowing the users to set up a first appli cation and the developers to validate their developments POMME is a small square box configu ration 30 x 40 x 46 grid points extracted from NEMO DRAKKAR ORCA025 All boundaries are open ocean boundaries including the corners This configuration was set up to facilitate de velopments and tests for regional configurations however it is not yet an official NEMO reference configuration It should be soon included in the NVTK validation toolkit How to compile the POMME configuration You must first follow the steps described in 2 2 1 The compilation process described below then relies upon the FCM Flexible Configuration Manager toolbox which is included in VODA tree see e g the following directory ls VODA GIT VODA UTIL fcm bin Then you may proceed in the following manner e Get sample input data needed for the model to run wget http www locean ipsl upmc fr cdlod data data POMME Z46 tar gz Deliverable D1 3 NEMOTAM Reference Manual amp User s Guide 33 R VODA ANR 08 COSI 016 V DA e Customize the first configuration file nemo cfg which is located according to your platform architecture mac_intel here vi SVODA_GIT VODA UTIL build fcmconfig bld mac_intel nemo cfg e Customize the second configurati
15. AGENCE NATIONALE DE LA JR Deliverable DI 3 NEMO Tangent amp Adjoint Models NemoTam Reference Manual amp User s Guide Arthur Vidard Franck Vigilant INRIA LJK Grenoble Charles Deltel Rachid Benshila LOCEAN IPSL Paris VODA ANR 08 COSI 016 VODA ANR 08 COSI 016 V DA Deliverable D1 3 NEMOTAM Reference Manual amp User s Guide Contents 1 NEMOTAM REFERENCE MANUAL 5 11 Introduction e eee Re Rw REEDS a de SES 5 KIT ABSIT o eh aeeie a ae e le e Ge BT E G HR A Bre RVE z 5 EZ SOOO ae rauna AAA e E A 5 1 2 Tangent and adjoint models TAM basics 7 121 TAM but what for Z 1 2 2 Tangent and Adjoint coding principle 7 ke PRIMN s o ae A ath aka bis te 8 L3 DREN ES INA Je A A A HD ee WS A te A ei STA 8 1 3 1 Storing the non linear trajectory ss dus ee ew vas 4 8 1 3 2 Modified routines in the direct code 66 eRe eRe Re ss 10 1 3 3 Modified declarations in the direct code eee aa 10 1 4 Tangent linear model approximations 4 248 boss 2445464 244 kla 10 1 4 1 Active variables degraded to passve 10 1 4 2 Simplifications 2 3e 434 Lux 224s eS Hho ed adrad 11 1 5 Hand coding Status RA RR RR AR AR RA RARA 11 1 6 Available options in NEMOTAM 00 00 0 ar a be me au k 4 11 1 7 Tle generic validation inerla e lt s s be 4 4 sa heehee heehee teed es 16 Lee o lt sses e
16. H 509250348807475E 10 509250348807474E 10 2E 14 2E 14 ok step_adj 206971044341451E 19 206971044341451E 19 1E 15 2E 14 ok Table 2 3 ORCA2 Results of the Adjoint tests for the main routine step tam for a run window of one day From line one to four each control parameter is perturbed individually Column six all control parameter are perturbed Routine L L x T Wdy oda LTW y Rel Err Mach eps Status step_adj U 102643067009108E 18 102643067009108E 18 2E 15 2E 14 ok step_adj V 167827302823834E 18 167827302823834E 18 4E 15 2E 14 ok step_adj T 893406215846414E 18 893406215846413E 18 7E 15 2E 14 ok step_adj S 220114453479612E 18 220114453479612E 18 4E 15 2E 14 ok step_adj SSH 265003707314821E 10 265003707314821E 10 4E 15 2E 14 ok step_adj 137645166426475E 19 137645166426475E 19 6E 15 2E 14 ok Table 2 4 ORCA2 Results of the Adjoint tests for the main routine step_tam for a run window of five days From line one to four each control parameter is perturbed individually Column six all control parameter are perturbed 2 3 2 The GYRE regional configuration GYRE is an idealized configuration representing double gyres in the Northern hemisphere It is B plane with a regular grid spacing at 1 degree horizontal resolution There is 31 verticles levels The configuration is forced with analytical heat freswater and wind stress fields
17. K EK EK Be be Eee owe oe Swe 16 1 7 2 Adjomt test 2 sua de gobe 6 es SHEE G 16 1 7 3 Tange t Linear valida lt lt s e c cce coe b Ge Poe Ree ee dos 17 1 74 Tangent Linear Hypothesis HLT validity 24 aaa 19 1 8 MPIparallelization s 2 ze ct eee a naa ll 20 13 1 General features 24428 sr eiua RE RE ER ERE ER G 20 1 8 2 Adjoint of MPLALLGATHER 21 2 NEMOTAM USER S GUIDE 23 2 1 Soui eDdE SEGUIDOR a a ir ARA AAA A EUX Se 23 2 2 Gens started tornal gt a ee ae a ua BE SUN SEAR ERS SRS SEES 24 2 2 1 Installing the code using the NEMOVAR GIT repository 24 2 2 2 Installing the code using the NEMOTAM SVN repository 25 2 2 3 Which executable for which test lt s coe oce s soa araca aore ae RA 26 DEN or oe Oe a e a eee oba a a Ga ore g 26 R VODA ANR 08 COSI 016 V DA 2 3 1 The ORCA global configuration 44 ds dus pus oe aie 26 2 3 2 The GYRE regional configuration 4 2 du 4 hui sd ci 32 2 3 3 The POMME configuration toy model for handling open boundaries 33 2 4 How to update NEMOTAM with your contribution 34 221 Coding Die tor TAM o scc a Li ee a Se De Re eue 34 2 4 2 Workflow for introducing additional developments 35 eo Frequently asked guestions 0 0 Du wh ds eee Qed a a 36 2 5 1 Ican tuse GDB after compiling with FCM 36 2 5 2 Ihave many commas in the namelist generate
18. NCE ESSE PARAITRE l cur loop current loop iteration h ratio current h ratio elja bea clag res ranch 0 M X direct without perturbation l l 18 Deliverable D1 3 NEMOTAM Reference Manual amp User s Guide R VODA ANR 08 COSI 016 V DA Tangent test ouputs The output is saved with the name tan_diag output_0000 The header give information on the com puted parameters For iteration n the output gives the follwing data routine name N M X p 0X M X En Nn L pn X Ern Nn L pndX L pndX L pr9X Nn L pndX En 1 Pn Ern pn To have an overview of the behaviour of the tangent iteration can be made by the user changing the factor ratio p The factor takes usually a geometric progression as p Por with initial value py and common ratio r 1 7 4 Tangent Linear Hypothesis HLT validity The innovation vector validity relies on the validity of the Tangent Linear Before any 4DVar as similation we must insure that the tangent model is valid within our assimilation time window Otherwise the optimisation may fail as the cost function gradient will be degraded or even wrong We define a maximum assimilation time window 77 This time window will be different for each configuration According to each application the user its own criteria to define to define T to fulfill its needs The size of 77 may vary from 1 to 3 months To estimate 77 we study the behaviour o
19. NEMOVA O EMOASSIM E E E E EMOQC z NEMO NEMOASSIM NEMOTAM NS URIE Building the code in default mode ORCA2 validation interface NEMOTAM makes use of the fem based NEMOVAR compiling environment a simple call to VODA UTIL build femvmake ksh with the usual arguments and the nemoa11 keyword should do the trick gt fcmvmake ksh c COMPILE t SWORKDIR B nemoall the above requires that you create a voDA UTIL build fcmconfig bld COMPILE nemo cfg de scribing your compilation environment examples are given in the same directory How to run the code is described in section 2 3 2 2 2 Installing the code using the NEMOTAM SVN repository Checking out the code from the SVN repository NEMOTAM can be extracted using svn like NEMO People should first to register on NEMO web site www nemo ocean eu Then NEMOTAM is available through modipsl framework so modipsl has to be extracted first Deliverable D1 3 NEMOTAM Reference Manual amp User s Guide 25 R VODA ANR 08 COSI 016 V DA e Extract modipsl svn co http forge ipsl jussieu fr igcmg svn modips1 trunk modipsl e Extract NEMOTAM cd modipsl util model NEMOTAM Building the code in default mode ORCA2 validation interface Choose the configuration to build You can edit the script fait config tam to add a new one cd modipsl modeles UTIL fait contig tam ORCA2 TAM You can build the direct mod
20. You can then follow the steps described below Create first a new directory where the source code will be installed For instance cd VODA GIT HOME VODA PROJECT VODA_GIT e So gt Install NEMOBASE go to https forge ipsl jussieu fr nemo browser tags nemo _v3 authentication required and click on zip archive at the bottom of the page put this archive in VODA_GIT unzip it and rename the obtained directory NEMOBASE this name is mandatory gt Install NEMOVAR Download the following bundles located on the gforge server under the files tab NEMOVAR N3 0 A2 0 gt nemovar_N3 0 A2 0 bundle and put them in the VODA GIT BUNDLES directory In VODA_GIT you now have tree BUNDLES BUNDLES NEMOBASE bundle 20090902 nemovar_N3 0 A2 0 bundle Clone these bundles git clone BUNDLES NEMOBASE bundle 20090902 NEMOBASE git clone BUNDLES nemovar_N3 0 A2 0 bundle NEMOVAR 24 Deliverable D1 3 NEMOTAM Reference Manual amp User s Guide R VODA ANR 08 COSI 016 V DA gt JLaseelli YODA git clone gittssh cdeltelescm gforge inria fr gitroot voda voda git VODA gt mimal Struceure er tne SVODA CTE chrecrory tree d L 2 SVODA_GIT VODA_GIT BUNDLES NEMOBASE MERE CONE UG CVSIROOW DOE WOME SIL NEMO INV T U da zal
21. _tst_cpd_tan In_tst T nemovar inner exe fl In_tst nemotam T In_tst obsadj In_tst_bkgadj In_tst T In_tst_nemotam T In tst grd namhlt model hlt exe nstg 1 2 3 Figure 2 2 Releationships between executable files first column and available tests second col umn The thrid column focuses on the main namelist s parameters namtst for adjoint gradient tangent tests namobs for single obs experiement and namhlt for linear tangent hypothesis Deliverable D1 3 NEMOTAM Reference Manual amp User s Guide 27 R VODA ANR 08 COSI 016 V DA How to compile the ORCA2 configuration You must first follow the steps described in 2 2 1 The compilation process described below then relies upon the FCM Flexible Configuration Manager toolbox which is included in VODA tree see e g the following directory ls VODA_GIT VODA UTIL fcm bin Then you may proceed in the following manner e Get sample input data needed for the model to run http ljk imag fr membres Arthur Vidard docs nemov3_testdata tar gz e Customize the first configuration file nemo cfg which is located according to your platform architecture mac_intel here vi SVODA_GIT VODA UTIL build fcmconfig bld mac_intel nemo cfg e Customize the second configuration file with CPP keys eppkeys ORCA2 Z31 cfg A sam ple file is ready to be used which you can modify vi SVODA_GIT VODA UTIL build fcmconfig nemo cppkeys ORCA2_
22. al amp User s Guide VODA ANR 08 COSI 016 V DA le 15 le 10 100000 solsor_tan N 1 le 05 le 10 le 15 AAALAAAAA le 20 e 10 le 08 1e 060 0001 0 01 1 100 10000 1e 06 p factor le 15 le 10 100000 dyn_spg_fit gt Norm le 20 le 10 le 08 le 060 0001 0 01 1 100 10000 1e 06 p factor Norm2 Norm2 le 15 le 10 100000 le 20 le 10 le 08 1e 060 0001 0 01 1 100 10000 1e 06 p factor le 15 le 10 100000 le 20 le 10 le 08 le 060 0001 0 01 1 100 10000 1e 06 p factor Figure 2 3 Tangent test type Four kinds of test results Top left a linear routine with a residual following the error machine Top right b non linear routine with a residual decreasing as p order of 2 Bottom left c linear routine with a residual decreasing as p order of 1 Bottom right d non linear routine with a residual decreasing as p order of 1 Legend Solid line is N M x pox M x circle symbol Z L p x triangle symbol N Lp Deliverable D1 3 NEMOTAM Reference Manual amp User s Guide 29 R VODA ANR 08 COSI 016 V DA Discussion We have divided the results into four categories a b c and d for analysis see table 2 1 Category a illustrated by solsor_tan in figure 2 3 gathers tangent linear routines behaving as expected w r t to their direct routine also linear counter part the computed residual is close to the L error machine
23. d by piano 36 2 5 3 have negative values in my cost function terms 36 2 54 My run stops with PROBLEM WITH THE MATRIX OR WITH THE PRECONDITIONER on stderr os coso Gee bis Gee hae Ewes 36 Deliverable D1 3 NEMOTAM Reference Manual amp User s Guide Chapter 1 NEMOTAM REFERENCE MANUAL 1 1 Introduction This document still contains empty parts This is done on purpose since it will be the basis for the next deliverable D1 3 NEMOTAM Manual We will fill them in as we proceed 1 1 1 Abstract The development of the tangent linear and adjoint models TAM in the following of the dynamical core of the NEMO ocean engine NEMOTAM is a key objective of the VODA project TAM are widely used for variational assimilation applications but they are also powerful tools for the anal ysis of physical processes since they can be used for sensitivity analysis parameter identification and for the computation of characteristic vectors singular vectors Liapunov vectors etc In the framework of VODA a work package has been set up in order to develop a comprehen sive NEMOTAM package and to define an effective long term development strategy for ensuring synchronisation of NEMOTAM with future NEMO releases This is a heavy task but it is worth the effort since NEMOTAM will benefit all NEMO users for the wide range of applications described above Ideally this strategy should be defined to allow NEMOTAM to adapt to futur
24. demonstrate that 1 the adjoint code is the adjoint of its tangent code 2 the tangent linear code is the tangent linear of the direct code with defined criteria In general TAM modules are subdivided into four parts a tangent linear routine an adjoint routine an adjoint test routine 4 a tangent linear routine UND Item 3 and 4 are optional The strategy is to perform adjoint and tangent linear tests for all critical sub modules and the main module step_tam for time step integration 1 7 2 Adjoint test By definition A or A in a finite dimension case is the adjoint operator of a linear operator A defined on a Hilbert space if it has the following property Az y z Ay 1 4 In practice we apply the comparison to random perturbations dx in the model space and dy in the adjoint model space We have then Adz dy dr Ady 1 5 Adjoint test requirements e A saved trajectory of the direct model e An additionnal namelist namtst for adjoint test namtst_tlm for tangent test Unitary test versus Global test Unitary test involves one or a limited set of routines The pertubation vectors 0X and dY are the input output variables identified as actives variables There is no time evolution Global test in volves time evolution loop on step tam and 6X and dY are input output variables identified as the control vector or variables of main interest 16 Deliverable D1 3 NEMOTAM Reference Ma
25. e NEMO devel opments as quickly and as efficiently as possible so that new releases of NEMOTAM can be made soon after new releases of NEMO This will require careful coordination between the main de velopment teams of NEMO NEMOTAM and possibly NEMOVAR INRIA NEMO Team CER FACS ECMWE 1 1 2 Introduction The NEMO ocean engine was previously known as the OPA model It used to have a TAM called OPATAM fully hand coded and maintained mainly by A Weaver OPATAM was initially developed for a Pacific ocean configuration and targeted at variational data assimilation applications in the framework of OPAVAR OPATAM OPAVAR were extended to other re gional basins Mediterranean sea North Atlantic 1 3 South Atlantic 1 to the global 5 R VODA ANR 08 COSI 016 V DA ocean ORCA 2 and were used for methodological studies such as control of the 3D model error control of the surface forcing and open boundary conditions OPATAM was also used for sensitivity studies singular vectors etc For several reasons mainly because of lack of workforce OPATAM OPAVAR and related developments were not included in the standard release of OPA As a consequence synchronisation of OPATAM with OPA s releases could not be achieved on a regular basis and all developments were on individual branches without feedback to the OPATAM OPAVAR system The pool of potential users was reduced consequently It is i
26. el in the same way cd modipsl modeles UTIL oca eemiilej ORCAZ 1 10M To create the Makefiles edit first modipsl util AA_make gdef to find or add your compiler then cd modipsl util ins_make To compile cd modipsl modeles NEMOTAM WORK gmake 2 2 3 Which executable for which test To run a bunch of tests to verify your configuration you need to compile several executable accord ing to your test target The graph 2 2 give an overview of the relationship between the executable and the available tests Running the code 2 3 Demonstrators 2 3 1 The ORCA2 global configuration ORCA is the generic name given to global ocean configurations Its specificity lies on the horizon tal curvilinear mesh used to overcome the North Pole singularity found for geographical meshes ORCA is based on a 2 degrees Mercator mesh i e variation of meridian scale factor as cosinus of the latitude In the northern hemisphere the mesh has two poles so that the ratio of anisotropy is nearly one everywhere The vertical domain spreads from the surface to a depth of 5000m There are 31 levels with 10 levels in the to 100m The time step depends on the resolution It is 1h36 for ORCA2 so that there is 15 time steps in one day 26 Deliverable D1 3 NEMOTAM Reference Manual amp User s Guide NR VODA ANR 08 COSI 016 V DA In_tst T ln tst nemotam T In tst_cpd_tam ln tst stp tam In_tst In_tst_tan T In
27. es etc This library is a temporary one generated by FCM during the build process but it is removed once the compilation is finished This problem only appears on Mac OSX s computers For unknown reasons the linker looses track when going from fcm s temporary libraries to the final libraries The temporary workaround is to recreate these temporary libraries from the object files but you will have to redo it each time you compile cd SCRATCH POMME fcmbuild POMME Z46 mac intel l 1 build lib ar q lib fem nemotam a obj x o 2 5 2 have many commas in the namelist generated by piano This happens if your config namelist have lines ending with a comma This feature is accepted by FORTRAN but the PIANO python script parser do not handle this Removing the commas at the end of each line will solve the problem 2 5 3 Ihave negative values in my cost function terms See congrad F90 Compute cost for diagnostic purposes only pf zf0 0 5 DOT_PRODUCT It is this term in congrad which appears to be lt 0 and is written to the cost file whereas we would expect to write the pcost from simvar F90 Under investigation 2 5 4 My run stops with PROBLEM WITH THE MATRIX OR WITH THE PRECONDITIONER on stderr This problem was reported in the POMME and GYRE configurations First it is worth noting that this message disappears if you set la tst grad a MRU s which is absolutely not a normal behaviour Needs further investigat
28. es a weight vector Y in the output space The resulting Xaa is the gradient of the dot product Y Y From equation 1 we find Xaa FX x Yaa f X0 X X foi Xp 2 X A X A X Yaa 1 3 which is also most cheaply executed from right to left However this uses the intermediate values Xy in the inverse of their building order in P For specific details about practical adjoint coding refer to 1 2 3 Potential issues e the major approximations non differentiability issues simplification of the direct model before linearization validity of the tangent linear hypothesis over some time window etc e the validation interface classical tests for checking the correctness of tangent and adjoint models e numerical problems e numerical cost issues 1 3 Direct model changes Some modifications and additions are compulsory to integrate the Tangent and Adjoint Module to NEMO They mainly consist in e changing subroutines or parameters declaration from private to public for initialization re use e adding a subroutine to save the non linear trajectory e adding parameters e updating namelist 1 3 1 Storing the non linear trajectory To evaluate the tangent and or the adjoint at a time t some actual parameters of the direct model are needed at the corresponding time t To fulfill this purpose a subroutine tamtrj_wri is added to write the trajectory It is controlled with one logical parameter In trjwri The traject
29. f yy M t0 081 with respect to yg M t0 Lio 021 The Tangent Linear will be valid as long as the difference y ya is small As discussed in 2 definition criteria of 77 will rely on threshold on the RMS of y ye and the coefficient correlation p y A correlation coefficient py y above 90 is considered as very good gt y vh RMS yi ya ns n number of ocean points 1 8 Puyo n number of ocean points 1 9 Eu ij Eu ijo The initial condition as well as the increment 6 are critical to define 7 The user should work with a typical increment x of its configuration HLT test tool NEMOTAM offers the possibility to analize the Tangent Linear Hypothesis through a dedicate ex ecutable model_hlt exe The increments dx is either given by the user either computed from two restarts file xy and x then dx zo x To compute y and yo model hlt exe should be run three times two for the direct model trajectories M o 91 and M4 _ 0 and one for Deliverable D1 3 NEMOTAM Reference Manual amp User s Guide 19 R VODA ANR 08 COSI 016 V DA the tangent trajectory L4 _ 0x It is driven through the namelists namhlt and tl tamtrj namhlt tangent linear hypothesis test parameters msieg flag for to compute model with or withou
30. ion The problem is solved by increasing the namelist nmin parameter For example change nmin 200 minimum of iterations for the SOR solver into nmin 500 mia Or itezarioVms roc cas SOIR sole 36 Deliverable D1 3 NEMOTAM Reference Manual amp User s Guide R VODA ANR 08 COSI 016 V DA in namsol This behaviour is not normal it suggests a convergence problem in the tangent barotropic solver Needs further investigation Deliverable D1 3 NEMOTAM Reference Manual amp User s Guide 37 VODA ANR 08 COSI 016 V DA 38 Deliverable D1 3 NEMOTAM Reference Manual amp User s Guide List of Figures 1 1 2 1 2 2 27 2 4 MPI_ALLGATHER task description ref http rc usf edu tutorials classes ftutborlal mpi hapterg html dede ue Woe gos ea k gere Ba al de 21 Cod organizatioi gt es c sa cesera eR EN ESR EN RES EEE e sis 23 Releationships between executable files first column and available tests second column The thrid column focuses on the main namelist s parameters namtst for adjoint gradient tangent tests namobs for single obs experiement and namhlr for linear tangent hypothesis 4 lt 2 hav oe be Eee ros e e 27 Tangent test type Four kinds of test results Top left a linear routine with a resid ual following the error machine Top right b non linear routine with a residual decreasing as p order of 2 Bottom left c linear routine with a residual decreas
31. mportant not to repeat this error in the future so as to ensure that NEMOTAM become a widely used community tool A NEMOTAM working group was initiated in the framework of a CNRS INSU LEFE ASSIM 2006 project to investigate the feasibility of using TAPENADE an AD tool to speed up the writing of TAM for OPA9 the dynamical ocean component of NEMO The goal of this working group was twofold The first goal was to identify the strengths and weaknesses of TAPENADE by applying it directly to the NEMO source code with as little human intervention as possible in order to build a NEMOTAM prototype The second goal was to define based on the experience deriving the prototype a strategy for developing a general purpose NEMOTAM that both respects the NEMO code style structure and gives acceptable computer performance in terms of both CPU and memory requirements for realistic ocean configurations Providing feedback to the TAPE NADE developers was an important aspect of this work to help improve future versions of the TAPENADE software The results from this feasibility study demonstrated that TAPENADE was able to produce tangent linear and adjoint models for NEMO albeit for a fixed and somewhat simplified config uration ORCA 2 with all non differentiable options switched off Even for this simplified configuration however substantial human intervention and additional work was required to ob tain a useable product from the raw TAPENADE genera
32. nual amp User s Guide R VODA ANR 08 COSI 016 V DA Test Pass Criteria We note if exists the relative error Err The pass test criteria is based on the comparison of Err with the epsilon machine Emachine eps Adz dy dr Ady Err dd Adz dy Es The adjoint test results output is the file adjoint_test output_xxx with the following label Test status is OK Err lt Eps test status is WARNING Eps lt Err lt 100 x Eps Test status is FAILED Err gt 100 x Eps Table 1 7 Adjoint test labels definition Run the adjoint test e set the directory where the direct trajectory is stored e in the namelist namtst set ln tst nemotam to true switch for M adjoint and tangent tests set In_tst_cpd_tam to true switch for adjoint tests of the sub components set ln tst stp tam to true switch for adjoint tests of main components step tam set In tst tan cpd and In tst tan to false switch for tangent tests 1 7 3 Tangent Linear validation The tangent validation test checks that the Tangent Linear model L is a first order approximation of the direct model M Then we have the following second order Taylor expansion M X poX M X pL X 1 7 When the factor p tends to zero 1 Np M X pdX M X tends to Lp pL 0X first order validation 2 e behaves as O p second order validation this means that for a given po for p smaller than po the error
33. odules called Module s called i Options Remarks by step tam by previous one Ocean tracers TRA traadv_tam F90 traadv_cen2_tam F90 no a ee equivalent to zcofi 0 traadv_tvd_tam F90 not differenciable traadv_muscl_tam F90 not differentiable traadv_muscl2_tam F90 not differentiable traadv_ubs_tam F90 not differenciable traadv_qck_tam F90 not differentiable traadv_eiv_tam F90 not differentiable trabbc_tam F90 hlmp is saved in direct Sa odel to handle uslp vslp traldf tam F90 key Idf ano uslp vslp treated as passive traldf bilap tam F90 traldf bilapg tam F90 traldf lap tam F90 not in reference not in reference pht_ldf pst_ldf not include tranxt tam F90 key obc key bdy not in reference key agrif not in reference tragsr tam F90 trasbe tam F90 trazdf_tam F90 Ik_vvl non linear trazdf_imp_tam F90 Ik_vvl wslpi wslpj treated as passive trazdf_exp_tam F90 Ik vvl Surface boundary conditions SB C sbcmod_tam F90 sbc_gyre_tam F90 sbc_fix_tam F90 sbc_ssr_tam F90 sbc_fwb_tam F90 sbc_clo_tam F90 sbc_ana_tam F90 Table 1 4 Hand coding status of NEMOTAM Tracers and Surface Boundary Condition part Deliverable D1 3 NEMOTAM Reference Manual amp User s Guide 13 R VODA ANR 08 COSI 016 V DA Used for Functionalities CPP keys Associated namelist logical Horizontal Diffusion Viscosity Lateral diffusion along key ldfslp isopycinal slopes Ho
34. on file with CPP keys cppkeys POMME Z46 cfg A sample file is ready to be used which you can modify vi VODA GIT VODA UTIL build fcmconfig nemo cppkeys POMME Z46 cfg e You are now ready to compile the code You need to create a seratch directory for example SCRATCH POMME below where compilation and execution will be performed cd VODA GIT VODA UTIL build cmvmake ksh t SCRATCH POMM cmvmake ksh t SCRATCH POMM c mac intel B NEMO G POMME _ c mac intel B NEMOTAM G POMME lesi JES ESE N N How to run the POMME configuration A sample minimal script is given just as an example vi VODA_GIT VODA UTIL scripts run_pomme ksh This script absolutely needs to be customized with respect to your working environment Please have a look at this script before proceeding further You will first need to create a reference trajec tory by running only the direct model NEMO and you then may want to use NEMOTAM to e launch the generic TAM test interface e investigate the time span over which the tangent linear hypothethis remains valid e etc Testing the tangent model and the tangent linear hypothesis coming soon Testing the adjoint model coming soon 2 4 How to update NEMOTAM with your contribution 2 4 1 Coding rules for TAM NEMOTAM modules should follow the NEMO convention However additional rules has to be followed e For a given direct module mod F90 that contains
35. ory is saved upon a given frequency nittrjfrg only if the logical parameter is set to TRUE New subroutine tam_trj_wri A new subdirectory TAM is created into OPA SRC named TAM The file is tamtrj F90 The purpose of this routine is to write on disk the model state trajectory for use with 4DVar It is called in the opa model routine for the initializiation and in the stp routine in order to perform the actual saving of the trajectory The currently stored fields are listed in Table 1 1 8 Deliverable D1 3 NEMOTAM Reference Manual amp User s Guide R VODA ANR 08 COSI 016 V DA Parameters Associated ccp keys emp emps un vn tn sn ta sa tb sb avmu avmv aeiu Ik_traldf_eiv aelv Ik traldf eiv aciw Ik traldf eiv uslp key ldfslp vslp key_ldfslp wslpi key ldfslp wslpj key ldfslp avs key_zdfddm strdmp key_tradmp hmlp key_tradmp Table 1 1 Fields stored in the reference trajectory Deliverable D1 3 NEMOTAM Reference Manual amp User s Guide 9 R VODA ANR 08 COSI 016 V DA Specific management of the initial state For the initial state of the model we call the tam_trj_wri in the step routine just before the tracer block We then have access to some parameters tke and sbc for instance as they are not yet computed in opa outside step Linear interpolation For efficiency matters the whole trajectory is of course n
36. ot saved Only a predefined subset of the time steps is saved The frequency on which the trajectory is saved is controlled by namelist parameter nittrjfrq The intermediate steps will be estimated in TAM by the mean of a linear interpolation Namelist Parameters related to the model state saving is controlled by the namelist namt am with e In trjwri Logical switch for writing out state trajectory e nittrjfrg saving frequency of the trajectory 1 3 2 Modified routines in the direct code e opa F90 include initilialization of the module that handles the trajectory saving USE tamtrj e step F90 include calls for saving the trajectory CALL tamtrj wri add temporary variables zta zsa to save ta sa this is a temporary fix because these variables are currently used as workspace in dynamic block 1 3 3 Modified declarations in the direct code The following table describes the change from PRIVATE to PUBLIC of some routines and param eters 1 4 Tangent linear model approximations 1 4 1 Active variables degraded to passive Some active variables are treated as passive mainly due to non differentiability characteristics e avmu avmv the vertical eddy viscosity The turbulent closure scheme zdftke induces some non differentiabilities for there variables They are used in routine dynzdf_imp_tam F90 10 Deliverable D1 3 NEMOTAM Reference Manual amp User s Guide VODA ANR 08 COSI 016 V DA
37. ra_ldf_iso_ad 152906929763072E 19 152906929763072E 19 OE 00 2E 14 ok trazdf exp adj 235296147886893E 37 235296147886893E 37 6E 15 2E 14 ok trazdfimpadjT1 208237542411001E 25 208237542411001E 25 5E 15 2E 14 ok trazdfimpadjT2 208237542411001E 25 208237542411001E 25 5E 15 2E 14 ok trazdfimpadjT3 208237542411001E 25 208237542411001E 25 5E 15 2E 14 ok tra nxt adj 405901725366058E 19 405901725366058E 19 9E 15 2E 14 ok eos_adj insitu 405930021470975E 11 405930021470975E 11 0E 00 2E 14 ok eos_adj pot 241698506116296E 17 241698506116297E 17 5E 15 2E 14 ok eos_adj 2d 249470161251995E 09 249470161251995E 09 4E 15 2E 14 ok eos_adj 1pt 108202320860649E 10 108202320860649E 10 2E 15 2E 14 ok zps hde adj 417898655654515E 18 4178986556545 15E 18 2E 15 2E 14 ok istate tst 140086193684597E 19 140086193684597E 19 7E 15 2E 14 ok Table 2 2 ORCA2 Results of the Adjoint tests for the main sub routines Deliverable D1 3 NEMOTAM Reference Manual amp User s Guide 31 VODA ANR 08 COSI 016 V DA Routine L L x T Wdy oda LT Wo y Rel Err Mach eps Status step_adj U 161275281471349E 18 161275281471349E 18 6E 15 2E 14 ok step_adj V 318648865958325E 18 318648865958325E 18 4E 15 2E 14 ok step_adj T 132120109179127E 19 132120109179127E 19 OE 00 2E 14 ok step_adj S 281362832449564E 18 281362832449564E 18 0E 00 2E 14 ok step_adj SS
38. rizontal Tracer diffusion Tracer lateral diffusion eddy induced velocity parametrization key_traldf_eiv Tracer lateral laplacian In_traldf_lap Iso neutral application direction for operator In_traldf_iso Tracer lateral diffusion 1d f depth 2d f lat ion or 3d f lat ion depth key traldf c2d Horizontal Dynamics Viscosity nam dynldf Dynamic Laplacian operator lateral viscosity ln dynldf lap Dynamic biLaplacian operator lateral viscosity ln dynldf bilap Geopotential application direction viscosity ln dynldf lap Dynamic lateral viscosity key dynldf 3cd 1d 2d or 3d Vertical viscosity Diffusivity Vertical diffusion based on TKE key zditke er closure scheme Vertical double diffusion mixing key_zdfddm ne for salinity Vertical convective processes enhanced vertical diffusion di In_zdfevd parametrization namsbc Surface forcing d fields key tau daily Initial state and damping Internal Newtonian tracers tes td dt T S damping eee es Use a 3D monthly salinity data Levitus key dtasal Use a monthly temperature data Levitus key dtatem Use a monthly sst data Levitus FORGE namsbc Sea surface temperature damping namsbc_ssr In_ssr namsbc 14 Sea surface salinity namsbc ssr dampiffliverable D1 3 NEMOTAM Referenca Manyal amp User s Guide Table 1 5 Available option in NEMOTAM par
39. t perturbation 0 M X l Le Mich 2 OS D dm Kilt ogical switch for applying temperature increments IS ogical switch for applying salinity increments V Ia aler ogical switch for applying horizontal velocity increments iia alesen ogical switch for applying sea surface height increments U a meo ogical swith to compute dx F or reading from file T in hnorm MCGUCAl Sith CO amoBaealizeacioa 1 CG moe P weing astel slageccole Upper bound of normalization factor for temperature l rhstds Upper bound of normalization factor for salinity rhstduv Upper bound of normalization factor for velocity rhstdssh Upper bound of normalization factor for sea surface height amp namhlt nstg 2 lm alert TRUE La alte RUE lia lalueuy RUE ln hltssh FALSE e aleine Ww ln incdx FALSE ln hnorm TRUE rhstdt 1 rhstds 0 a ik rhstduv 0 01 hise sis 0 01 l namtl trj tangent linear trajectory freguency output ln trjwri tan Logical switch rajectory output nittrjfrq tan frequency output for linear tangent snamtl trj d a ee v scan e RWI MINCE tae sia 96 1 8 MPI parallelization 1 8 1 General features We remind some basics for coding the corresponding adjoint of the tangent linear part 20 Deliverable D1 3 NEMOTAM Reference Manual amp User s Guide R VODA ANR 08 COSI 016 V DA Operation Tangent Linear Adjoint communication send receive
40. t1 VODA ANR 08 COSI 016 V DA Used for Functionalities CPP keys Associated namelist logical On line diagnostics Eddy induced velocit say TE ios a FAIRE Thermocline 20 C 28 C f isotherm depths ey Enable observation operator key diaobs High Performances computing Enable MPP computing mica with MPI key_mpi send reproductibility key_mpi_send Vertical coordinates nam zgr Full steps Z ln zco Partial steps PS ln zps Pressure gradient treatment Filtered free surface algorithm key dynspg fit Vorticity seheme nam dynvor enstrophy conserving In dynvor ens energy and enstrophy conserving In dynvor een Advection schemes nam_traadv 2nd order centered In_traadv_cen2 Configuration Idealized Double Gyre yore configuration with a flat bottom E Global ORCA configuration key_orca_r2 at 2deg resolution Open boundaries POMME c a at 0 25 resolution a k Other CPP keys Geothermal boundary condition flux nambbc Diffusive Bottom Boundary Layer key trabbl dif nambbl Table 1 6 Available option in NEMOTAM part2 Deliverable D1 3 NEMOTAM Reference Manual amp User s Guide 15 R VODA ANR 08 COSI 016 V DA 1 7 The generic validation interface 1 7 1 Introduction The validation interface aims at showing the consistency of the TAM with respect to the direct code To fulfill this goal we
41. ted code Three main drawbacks with TAPENADE were identified for this application First the memory management and CPU perfor mance of the raw code were rather poor Second the current version of TAPENADE generates single processor code only and cannot handle directives from the C PreProcessor CPP keys which are widespread in NEMO Third the technique of binomial checkpointing that is used in TAPENADE to handle nonlinearities see is not compatible at least in its present implemen tation with the incremental algorithm of NEMOVAR which employs separate executables and possibly different resolutions for the outer and inner loops Improved memory management and extensions to support MPP and CPP keys are planned in future versions of TAPENADE so the first two deficiencies are not fundamental The third deficiency however is more problematic and it is likely that the trajectory management for nonlinearities in NEMOTAM will be done differ ently from TAPENADE possibly along the lines of the simpler strategy implemented in OPAVAR The modifications required to make TAPENADE or whatever other AD tool compatible with the multi incremental approach are really substantial and cannot be done in a short or medium term Moreover the numerical performances of the TAPENADE generated TAM do not allow yet their use for big configurations and for operational applications From that experience it has been decided to go toward the hand coding approach the
42. tep_tam for a run window of one day From line one to four each control parameter is perturbed individually Column six all control parameter are perturbed ORCA2 Results of the Adjoint tests for the main routine step_tam for a run window of five days From line one to four each control parameter is perturbed individu ally Column six all control parameter are perturbed 41 32 R VODA ANR 08 COSI 016 V DA 42 APPENDIX Acronyms AD Automatic differentiation AGRIF Adaptive Grid Refinement In Fortran Outil de raffinement de maillage et de nesting d velopp au sein de MOISE et inclus dans NEMO ESOPA Equipe Syst me OPA qui g rait les d veloppements de OPA A t remplac e par la NEMO Team apr s la mise en place du consortium NEMO MITgcm Mod le de circulation g n ral pour l oc an et l atmosph re d velopp au MIT NEMO Nucleus for European Modelling of the Ocean NEMOTAM TAM pour NEMO NEMO Team Equipe g rant les d veloppements de NEMO NEMOVAR syst me d assimilation variationnelle de donn es pour NEMO OPA Ocean Parall lis Le mod le direct d oc an composant de NEMO OPATAM TAM pour OPA 8 x OPAVAR syst me d assimilation variationnelle de donn s pour OPA 8 x ORCA grille globale pour OPA PONGO Pole d Oc an Num rique GrenOblois regroupant les quipes MOISE LJK IN RIA et MEOM LEGI ROMS Regional Ocean Modelling System e
43. the subroutine sub a corresponding mod ule mod_tam F90 has to be created and it should contain the tangent linear subroutine called sub tan the adjoint subroutine sub adj and the corresponding testing routine sub adj tst 34 Deliverable D1 3 NEMOTAM Reference Manual amp User s Guide R VODA ANR 08 COSI 016 V DA e Fora given active direct variable var the corresponding tangent linear and adjoint variable should be named var_tl and var_ad respectively The underscore is omitted for local active variable To summarized active variables un pun zun will give un tl pun tl and zun_tl in the tangent module e For historical reasons some modules do not follow these rules feel free to update them If the TAM module is a direct translation of the corresponding OPATAM routine a good practice is to account for it in the first line of the history i i stating that the 8 2 version was done by e g Huey Dewey and Louie 2 4 2 Workflow for introducing additional developments coming soon Deliverable D1 3 NEMOTAM Reference Manual amp User s Guide 35 R VODA ANR 08 COSI 016 V DA 2 5 Frequently asked questions 2 5 1 I can t use GDB after compiling with FCM When I run the code with GDB for debugging purposes the library lib fem nemotam a is not found and thus gdb does not have access to symbolic informations associated with the modules of the code we can t set breakpoints we can t look for the content of variabl
44. time tested varied from 1 to 15 days 30 Deliverable D1 3 NEMOTAM Reference Manual amp User s Guide R VODA ANR 08 COSI 016 VSDA Routine L L x T Wdy oda LTW y Rel Err Mach eps Status sol sor adj 525406844734452E 15 525406844734452E 15 0E 00 2E 14 ok sbcfwb_adj 1 1 711617836790924E 12 111617836790924E 12 7E 15 2E 14 ok sbcfwb_adj 21 711586863123878E 12 711586863123878E 12 0E 00 2E 14 ok sbcfwb_adj 12 721405227628168E 12 721405227628168E 12 0E 00 2E 14 ok sbcfwb_adj 22 721331456200554E 12 721331456200554E 12 0E 00 2E 14 ok sbcfwb_adj 13 711617836790924E 12 111617836790924E 12 7E 15 2E 14 ok sbcfwb_adj 23 711586863123878E 12 711586863123878E 12 0E 00 2E 14 ok sbc_ssr_adj 289793337319649E 21 289793337319649E 21 2E 15 2E 14 ok sbc_gyre_adj 1 575805928604001E 19 575805928604001E 19 OE 00 2E 14 ok sbc_gyre_adj 2 575805928604001E 19 575805928604001E 19 0E 00 2E 14 ok sbc_ssm adj 585782123944269E 15 585782123944269E 15 0E 00 2E 14 ok bn2_adj 763641537078732E 10 163641537078733E 10 5E 15 2E 14 ok div cla adj 134110702040363E 17 134110702040363E 17 1E 15 2E 14 ok div_cur_adj T1 307633707985862E 07 307633707985862E 07 0E 00 2E 14 ok div cur adj T2 321541201767843E 07 321541201767843E 07 6E 15 2E 14 ok dyn adv adj 2528 18496373574E 17
45. tive calculus to get the Jacobian matrix F i e the partial derivatives of each component of Y with respect to each component of X Calling Xy X and Xy f X 1 the successive values of all intermediate variables 1 e the successive states of the memory throughout execution of P we get F X fp Xp 1 x p ilXp 2 X X fi Xo 1 1 The derivatives f of each elementary instruction are easily built and must be inserted in the differentiated program so that each of them has the values X directly available for use This process yields analytic derivatives that are exact up to numerical accuracy In practice two sorts of derivatives are of particular importance in scientific computing the tangent or directional derivatives and the adjoint or reverse derivatives The tangent derivative is the product dY F X x dX of the full Jacobian times a direction dX in the input space From equation 1 1 we find aY P xaX Sa Ga KE p 1 Xp 2 A fi Xo x dX 1 2 which is most cheaply executed from right to left because matrix x vector products are much cheaper than matrix x matrix products This is also the most convenient execution order because it uses the intermediate values X in the same order as the program P builds them On the other Deliverable D1 3 NEMOTAM Reference Manual amp User s Guide 7 R VODA ANR 08 COSI 016 V DA hand the adjoint derivative is the product Xaa F X x Yaa of the transposed Jacobian tim
Download Pdf Manuals
Related Search
Related Contents
T40/T40m EXTER - Beijer Electronics スライド タイトルなし Page 1 Page 2 Page 3 )はじめに 本書は, YSー。。シリーズ計器に付加 MANUALE UTENTE USER MANUAL Halo Lighting System L10530 User's Manual Toastmaster 310/310CAN User's Manual Philips DLM4307 APart CMS6BBI flat panel wall mount Signature Series User`s Manual Copyright © All rights reserved.
Failed to retrieve file