Last edited [[Timestamp]] = ''' Direct Model Changes ''' = [[PageOutline]] ---- 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, ''asm_trj_wri'' is added to write the trajectory. It is controlled with two logical parameters: ''lk_asminc'' and ''ln_trjwri''. The trajectory is saved with a certain saving frequency and only both logical parameter are set to TRUE. Th === Subroutine: asm_trj_wri === A new subdirectory is created into /OPA/ named '''ASM'''. The file is '''asmtrj.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 save the initial state needed for the TAM and at the end of the ''stp'' routine. Currently the following parameters are saved: || '''Parameters''' || '''Associated ccp keys''' || ||emp || || ||emps || || ||un || || ||vn || || ||tn || || ||sn || || ||ta || || ||sa || || ||tb || || ||sb || || ||avmu || || ||avmv || || ||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 || ''note: is it worth to add why (and where) there will be a need of these variables later in TAM?'' ==== Specific management of the initial state ==== For the initial state of the model, some parameters need to be computed in ''asmtrj'' as they are not yet computed in opa. ''note: we still have zero value in emp/emps parameters. It needs to be solved quickly.'' ==== Linear Interpollation ==== For efficiency matters, the whole trajectory is of course not saved. Only a predefined steptime frequency is saved. The frequency ''nittrjfreq'' is controlled by namelist. The intermediate steptime will be estimated in TAM by linear interpollation. ==== Namelist ==== Parameters related to the model state saving is controlled by the namelist '''nam_asminc''' with: * ln_trjwri: Logical switch for writing out state trajectory * nittrjfrq: frequency of the trajectory used in 4D-VAR == 2 - Routine modification == * '''opa.F90''': * include output trajectory fields (USE asmtrj and CALL asm_trj_wri) * '''step.F90''': * include output trajectory fields (CALL asm_trj_wri) * add temporary variables to save ta/sa (used as workspace in standard) == 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 || || || || || sec1jan000 || ||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?''