[[PageOutline]] Last edited [[Timestamp]] [[BR]] '''Author''' : Gurvan Madec '''Ticket ''' : #927 '''Branch''' : [https://forge.ipsl.jussieu.fr/nemo/browser/branches/2012/dev_r3309_LOCEAN12_Ediag 2012/dev_r3309_LOCEAN12_Ediag ] ---- == '''LOCEAN .12 - Energy diagnostics''' == ''' Motivation: ''' output 3D trends of tracers, momentum, kinetic energy and potential energy.[[BR]] ''' Status :''' the extraction of trends terms exists, but not the 3D output of the trends [[BR]] ''' Main tasks :''' [[BR]] (1) implement the 3D output of tracers and momentum trends using iom_put [[BR]] (2) compute and output the 3D trends of PE and KE [[BR]] (3) validatation + documentation [[BR]] ''' Science Reviewer:''' NOCS guy? [[BR]] ''' System Reviewer:''' NOCS guy? [[BR]] ''' Deadline:''' spring 2012 [[BR]] ''' Priority:''' high [[BR]] ''' Depends on:''' gurvan disponibilities [[BR]] ''' Principal Investigator : ''' Gurvan Madec and Simona Flavoni (simona.flavoni@locean-ipsl.upmc.fr) [[BR]] [[BR]] ---- == ''' Detail of the implementation''' == ---- === ''' Step I : add the 3D output ''' === see [https://forge.ipsl.jussieu.fr/nemo/log/branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/OPA_SRC?rev=3316 revision 3316] '''trdmod_oce''' module and '''namtrd namelist''' [[BR]] logical flags added in namlist namtrd which now controls what is done with the trends. [[BR]] All the types of treatment of a given trend are available at the same time. The memory requirement will only increase due to the time averaged arrays defined in IOM. {{{ LOGICAL , PUBLIC :: ln_dyn_trd = .FALSE. !: (T) 3D momentum trends or (F) not LOGICAL , PUBLIC :: ln_tra_trd = .FALSE. !: (T) 3D tracer trends or (F) not LOGICAL , PUBLIC :: ln_PE_trd = .FALSE. !: (T) 3D Potential Energy trends or (F) not LOGICAL , PUBLIC :: ln_KE_trd = .FALSE. !: (T) 3D Kinetic Energy trends or (F) not LOGICAL , PUBLIC :: ln_vor_trd = .FALSE. !: (T) 3D barotropic vorticity trends or (F) not LOGICAL , PUBLIC :: ln_glo_trd = .FALSE. !: (T) global domain averaged diag for T, T^2, KE, and PE LOGICAL , PUBLIC :: ln_dyn_mld = .FALSE. !: (T) 2D tracer trends averaged over the mixed layer LOGICAL , PUBLIC :: ln_tra_mld = .FALSE. !: (T) 2D momentum trends averaged over the mixed layer }}} Add these new logical in the namelist. '''==>>> CAUTION only in the ORCA2_LIM directory''' [[BR]] NB: here is the new name set in revision number XXXX[[BR]] [[BR]] '''trdtra''' module[[BR]] Add a systematic mask of the trend.[[BR]] Change the comments to better describe the purpose of this module. Its purpose is: [[BR]] 'TRA' case: to regroup T & S trends and send them to trd_mod, with, in case of advection, transform the incoming advective fluxes into advctive trend (U.grad[T])[[BR]] 'TRC' case: send trend to ted_mod_trc, with, in case of advection, transform the incoming advective fluxes into advective trend [[BR]] all cases : mask the trend ('''===>>> PROBABLY add in the module a lbc_lnk so that the trend is defined everywhere''') [[BR]] '''dynadv_cen2 and _ubs''' modules[[BR]] change jpdyn_trd_had into jpdyn_trd_keg. Now in flux form _keg corresponds to the horizontal advection trends and _rvo to the metric terms[[BR]] [[BR]] '''dynnxt''' module[[BR]] add the output using mom of the total den trend (except asselin time filter) ("utrd_tot", "vtrd_tot") and of the asselin time filter trend ("utrd_atf", "vtrd_atf") but with a shift by one time step[[BR]] [[BR]] '''dynvor, trdvor and trdmod_oce''' modules[[BR]] suppress the call to trd_mod in the jpdyn_trd_dat case (computation of beta.V) add add the calculation of beta.V term in 'trdvor' in jpvor_pvo case. And obviously suppress jpdyn_trd_dat from trdmod_oce [[BR]] Also suppress the jpdyn_trd_had case horizontal advection for the dynamics is 'keg' + 'vor' ; in case of flux form, 'had' is put in 'keg' and the metric terms is put in 'vor' [[BR]] there is now only 10 trends on the dynamics instead of 12[[BR]] [[BR]] '''trdmod''' module[[BR]] 1- introduce the new logical namelist parameters[[BR]] 2- introduce new subroutines : '''trd_budget''' : computation of the domain averaged T,T^2^, PE, KE trends formerly computes in trd_mod routine)[[BR]] ''' trd_3Diom''': output of the 3D trends using IOM [[BR]] [[BR]] '''trdicp''' module[[BR]] add in trd_twr routine the computation of the vertical diffusive trend on T & S in case of iso-neutral diffusion (ln_traldf_iso=T). These trends ("ttrd_zdfp", "strd_zdfp") name zdfp for "PURE" vertical diffusion trends are output so that by difference with "zdf" trends we can access to the vertical contribution of the iso-neutral operator [[BR]] [[BR]] '''iodef.xml''' file[[BR]] add all the trends nick name : '''==>>> CAUTION only in the ORCA2_LIM directory''' [[BR]] [[BR]] ---- === ''' Step II : simplification of the structure ''' === '''trdicp and trdicp_oce''' modules[[BR]] see [https://forge.ipsl.jussieu.fr/nemo/log/branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/OPA_SRC?rev=3317 revision 3317] 1- suppress trdicp_oce module (put required variables in trdmod_oce parameters)[[BR]] 2- use the jptra_trd_... instead of jpicp_... 3- move trd_budget subroutine from trdmod to trdicp.F90. Suppress trd_icp routine (i.e. trd_2d, trd_3d) as the work is now simply done in trd_budget.[[BR]] 4- rescan all dyn/tra trend indices. add jptra_trd_zdfp for "PURE Kz dissusive trend when ln_traldf_iso=T (see also changes in tranxt where a call to trd_tra is done just before the swap, so that PURE Kz trends can be diagnosed in tra_trd. See also xml file). 5- jptra_trd_nsr and jptra_trd_cdt are 3D trends as their incorporate both surface forcing AND runoff, the later being possibly spread in depth ('''==>>> probably to be changed''')[[BR]] 6- suppress the key_trddyn key trdtra from trdicp[[BR]] '''trdtra - trddyn - trdmod - trdvor''' module[[BR]] see [https://forge.ipsl.jussieu.fr/nemo/log/branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/OPA_SRC?rev=XXXX revision XXXX] Change the logic : split DYN and TRA trend diagnostics in separate modules[[BR]] move the call to trd_... from the end of step to the select CASE(jp..._atf) i.e. when the last trend is send to trdtra or trddyn[[BR]] Change the name of the trend indices from jptra_trd_xxx to jptra_xxx and from jpdyn_trd_yyy to jpdyn_yyy. This impact TRA,DYN, TRD but also all TOP_SRC[[BR]] 0- move trdmod_oce into trd_oce 1- trdvor: move the trdvor 1st part from trdmod to trevor module. Suppress the call of trd_vor from step (now called in trddyn for each trend, with the output done for the last trend (_atf). [[BR]] 2- create a trddyn that manage the distribution to iom, global mean, KE, vor, mld [[BR]] 3- trdtra in TRC case pre-process advective trends and then call trdmod_trc ; in TRA case: it regroups T & S trend in one and calla local routine to manage the distribution to iom, global mean, PE, mld[[BR]] 4- trdmod now contains only the trdmod_init routine. Rename all as trdini.F90 and ted_init subroutine NB: atmospheric pressure gradient trend not taken into account (see dynspg.F90 '''To be done !!!!'''[[BR]] NB: kpp non-local trend put in zdf trends !!! this will not work ! a additional trend term should be add '''To be done !!!!'''[[BR]] [[BR]] [[BR]] [[BR]] [[BR]] [[BR]] [[BR]] [[BR]] [[BR]] '''NB''' problems to be solved: vvl case for tracer sad trends ; flux form case for had (keg) and zad momentum trends[[BR]] [[BR]] '''Pending issues''' : add separate modules for each option ... create the momentum diag over the ML create the 3D trends for KE and PE ---- === Testing === Testing could consider (where appropriate) other configurations in addition to NVTK]. ||NVTK Tested||!'''YES/NO!'''|| ||Other model configurations||!'''YES/NO!'''|| ||Processor configurations tested||[ Enter processor configs tested here ]|| ||If adding new functionality please confirm that the [[BR]]New code doesn't change results when it is switched off [[BR]]and !''works!'' when switched on||!'''YES/NO/NA!'''|| (Answering UNSURE is likely to generate further questions from reviewers.) 'Please add further summary details here' * Processor configurations tested * etc---- === Bit Comparability === ||Does this change preserve answers in your tested standard configurations (to the last bit) ?||!'''YES/NO !'''|| ||Does this change bit compare across various processor configurations. (1xM, Nx1 and MxN are recommended)||!'''YES/NO!'''|| ||Is this change expected to preserve answers in all possible model configurations?||!'''YES/NO!'''|| ||Is this change expected to preserve all diagnostics? [[BR]]!,,!''Preserving answers in model runs does not necessarily imply preserved diagnostics. !''||!'''YES/NO!'''|| If you answered !'''NO!''' to any of the above, please provide further details: * Which routine(s) are causing the difference? * Why the changes are not protected by a logical switch or new section-version * What is needed to achieve regression with the previous model release (e.g. a regression branch, hand-edits etc). If this is not possible, explain why not. * What do you expect to see occur in the test harness jobs? * Which diagnostics have you altered and why have they changed?Please add details here........ ---- === System Changes === ||Does your change alter namelists?||!'''YES/NO !'''|| ||Does your change require a change in compiler options?||!'''YES/NO !'''|| If any of these apply, please document the changes required here....... ---- === Resources === !''Please !''summarize!'' any changes in runtime or memory use caused by this change......!'' ---- === IPR issues === ||Has the code been wholly (100%) produced by NEMO developers staff working exclusively on NEMO?||!'''YES/ NO !'''|| If No: * Identify the collaboration agreement details * Ensure the code routine header is in accordance with the agreement, (Copyright/Redistribution etc).Add further details here if required..........