Last edited [[Timestamp]] = ''' Adjoint test ''' = [[PageOutline]] == Principle == The adjoint test checks that the adjoint is the adjoint of the tangent using the adjoint deļ¬nition. By definition, given a linear operator '''A''' going from a space '''E''' to a spece '''F''', and scalar products <.,.>_E, and <.,.>_F in these respective spcaces, the adjoint of '''A''' is the linear operator '''A_ad''' such that for any vectors (x,y) in the suitable spaces, {{{ _F = _E }}} In practice, we apply the comparison to perturbations state vectors '''dx''' and '''dy'''. We have then to compare: {{{ _F = _E }}} W: diagonal matrix of scale factors == Requierements == To run the some adjoint test we need the following features: * a direct trajectory (computed with NEMO) * additionnal namelist (for instance ''namtst'' to setup adjoint test parameter (off or on) == Initialization == discuss about: * tangent and adjoint variables initalization * ramdom noise generation (repeatability) == Unitary Test == We call ''unitary test'' some test involving only one subroutine (or at least a limited set of subroutines). It is performed on a single pertubation state vector '''dX'''. There is no time evolution. When needed several configuration are tested (for instance ''n_cla''=0/1, ''nn_fwb''=1/2...) discuss about: * _tan and _adj initialization (means "why we should do _tan(nit000) vs. _adj(nitend)" for instance == Global Test == The ''global test'' involves time evolution by reading foward the trajectory (for the tangent) and then backward (for the adjoint). It concerns mainly the ''step_tam'' routine. It is more conmplex as it stressed out: * initializations * interactions between routines * handling of direct trajectory == MPP test == discuss about: * handling of domain/domain border for MPP test == Test Pass Criteria == With the above notations, we note (if exists) the reltive error Err = |_F - _E | / |_F| We compare the relative error (Err) to the epsilon machine Eps. It is '''passed''' when Err < 100*Eps and '''failed''' otherwise. The adjoint test results output are gathered in the file '''adjoint_test.output_xxx''' with the following labels: {{{ * Test status is OK if Err < Eps * Test status is WARNING if Eps <= Err < 100*Eps * Test status is RED ALERT if Err >= 100 *Eps }}} == Results == Currently we perform 51 tests (unitary routines and step_tam routine) with 100% passed rate on the different machines (see list below). {{{ Test Layout: - configuration ORCA2 / GYRE - monodomain - ndays = 1/2/3/10 }}} === Machines description === || '''Name''' || '''CPU type''' || '''RAM (per node)''' || '''OS''' ||'''Compiler'' || ||Mirage ||Itanium 1.4 GHz || 4 Go || SuSe || Intel 9.0 || ||Abel || Itanium 1.4 GHz || 4 Go || SuSe || Intel 8.1 || || Marvin || Core2Duo 2.8 GHz || 4 Go || OS X || g95 0.91 ||