Version 3 (modified by vigilant, 11 years ago) (diff)

Last edited Timestamp?

Direct Model Changes

Some modifications and additions are compulsory to integrate the Tangent and Adjoint Module to NEMO. They mainly consist in:

  • changing subroutines or parameters declaration from Private to Public for:
    • initialization
    • re-use
  • adding a subroutine to save the trajectory
  • adding parameters
  • updating namelist

1 - 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: ln_trjwri. The trajectory is saved upon a given frequency "nittrjfrq" only if the logical parameter is set to TRUE.

Subroutine: tam_trj_wri

A new subdirectory is created into /OPA/ named TAM. The file is tamtrj.F90. The purpose of this routine is to write to file the model state trajectory for use with 4DVar. It is called in opa_model routine to initialize tamtrj routine TAM and at in the stp routine.

Currently the following parameters are saved:

Parameters Associated ccp keys
aeiu lk_traldf_eiv
aeiv lk_traldf_eiv
aeiw lk_traldf_eiv
uslp key_ldfslp
vslp key_ldfslp
wslpi key_ldfslp
wslpj key_ldfslp
avs key_zdfddm
strdmp key_tradmp
hmlp key_tradmp

Specific management of the initial state

For the initial state of the model, we call the tam_trj_wri in '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 Interpollation

For efficiency matters, the whole trajectory is of course not saved. Only a predefined steptime frequency is saved. The frequency nittrjfrq is controlled by namelist. The intermediate steptime will be estimated in TAM by linear interpollation.


Parameters related to the model state saving is controlled by the namelist namtam with:

  • ln_trjwri: Logical switch for writing out state trajectory
  • nittrjfrq: saving frequency of the trajectory

2 - Routine modification

  • opa.F90:
    • include initilialization of trajectory saving handling (USE tamtrj)
  • step.F90:
    • include calls for trajectory saving (CALL tam_trj_wri)
    • add temporary variables (zta, zsa) to save ta/sa (used as workspace in dynamic block)

3 - Declaration Changes

The following table describes the change from PRIVATE to PUBLIC of some routines and parameters.

Modules Routines parameters
dynadv dyn_adv_ctl
daymod day_mth
eosbn2 neos_init
sbcmod all from namelist namsbc
tradmp cofdis, dtacof, dtacof_zoom
strdmp, ttrdmp, resto
traqsr nksr, gdsr

note: is it worth to add why (and where) there will be a need of these variables later in TAM?