New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
ticket/0927_Energy_diag (diff) – NEMO

Changes between Version 26 and Version 27 of ticket/0927_Energy_diag


Ignore:
Timestamp:
2012-03-19T18:09:53+01:00 (12 years ago)
Author:
fabien.roquet
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ticket/0927_Energy_diag

    v26 v27  
    1 [[PageOutline]] 
    2 Last edited [[Timestamp]] 
     1[[PageOutline]] Last edited [[Timestamp]] 
    32 
    4 [[BR]] 
    5  
    6 '''Author''' : Gurvan Madec  
     3'''Author''' : Gurvan Madec 
    74 
    85'''Ticket ''' : #927 
    96 
    10 '''Branch''' : [https://forge.ipsl.jussieu.fr/nemo/browser/branches/2012/dev_r3309_LOCEAN12_Ediag      2012/dev_r3309_LOCEAN12_Ediag ]  
     7'''Branch''' : [https://forge.ipsl.jussieu.fr/nemo/browser/branches/2012/dev_r3309_LOCEAN12_Ediag 2012/dev_r3309_LOCEAN12_Ediag] 
    118 
    129---- 
     10== '''LOCEAN .12 - Energy diagnostics''' == 
     11'''     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]] 
    1312 
    14 == '''LOCEAN .12 - Energy diagnostics''' == 
    15 '''     Motivation: '''    output 3D trends of tracers, momentum, kinetic energy and potential energy.[[BR]] 
    16 '''     Status :''' the extraction of trends terms exists, but not the 3D output of the trends   [[BR]] 
    17 '''     Main tasks :'''         [[BR]]      
    18  (1) implement the 3D output of tracers and momentum trends using iom_put [[BR]] 
    19  (2) compute and output the 3D trends of PE and KE [[BR]]     
    20  (3) validatation + documentation  [[BR]]   
    21 '''     Science Reviewer:''' NOCS guy?     [[BR]]     '''     System Reviewer:'''  NOCS guy?     [[BR]]    
    22 '''     Deadline:'''   spring 2012   [[BR]] 
    23 '''     Priority:'''      high    [[BR]] 
    24 '''     Depends on:'''    gurvan disponibilities   [[BR]] 
    25 '''     Principal Investigator : '''      Gurvan Madec and Simona Flavoni (simona.flavoni@locean-ipsl.upmc.fr)  [[BR]] 
    26 [[BR]] 
     13  (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]] 
    2714 
     15'''     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]] 
    2816 
    2917---- 
     18== ''' Detail of the implementation''' == 
     19---- 
     20=== ''' Step I : add the 3D output ''' === 
     21see [https://forge.ipsl.jussieu.fr/nemo/log/branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/OPA_SRC?rev=3316 revision 3316] 
    3022 
    31 == ''' Detail of the implementation''' == 
     23  ''' trdmod_oce'''  module and ''' namtrd namelist'''  [[BR]] 
    3224 
    33  
    34 ---- 
    35  
    36 === ''' Step I : add the 3D output ''' === 
    37  
    38 see [https://forge.ipsl.jussieu.fr/nemo/log/branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/OPA_SRC?rev=3316  revision 3316] 
    39  
    40   '''trdmod_oce''' module and '''namtrd namelist''' [[BR]] 
    41 logical flags added in namlist namtrd which now controls what is done with the trends. [[BR]] 
    42 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. 
     25logical 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. 
    4326 
    4427{{{ 
     
    5235   LOGICAL , PUBLIC  ::   ln_tra_mld   = .FALSE.        !: (T) 2D momentum trends averaged over the mixed layer  
    5336}}} 
    54 Add these new logical in the namelist. '''==>>> CAUTION only in the ORCA2_LIM directory''' [[BR]] 
    55 NB: here is the new name set in revision number 3318[[BR]] 
     37Add these new logical in the namelist. '''==>>> CAUTION only in the ORCA2_LIM directory''' [[BR]] NB: here is the new name set in revision number 3318[[BR]] 
    5638 
    57 [[BR]] 
     39  ''' trdtra'''  module[[BR]] 
    5840 
    59   '''trdtra''' module[[BR]] 
    60 Add a systematic mask of the trend.[[BR]] 
    61 Change the comments to better describe the purpose of this module. Its purpose is: [[BR]] 
    62   '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]] 
    63   'TRC' case:  send trend to ted_mod_trc, with,  in case of advection,  transform the incoming advective fluxes into advective trend [[BR]] 
    64   all cases  : mask the trend    ('''===>>>   PROBABLY add in the module a lbc_lnk so that the trend is defined everywhere''') 
    65 [[BR]] 
     41Add a systematic mask of the trend.[[BR]] Change the comments to better describe the purpose of this module. Its purpose is: [[BR]] 
    6642 
    67   '''dynadv_cen2 and _ubs''' modules[[BR]] 
    68 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]] 
    69 [[BR]] 
     43  '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''' ) 
    7044 
    71   '''dynnxt''' module[[BR]] 
    72 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]] 
    73 [[BR]] 
     45  ''' dynadv_cen2 and _ubs'''  modules[[BR]] 
    7446 
    75   '''dynvor, trdvor and trdmod_oce''' modules[[BR]] 
    76 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]] 
    77 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]] 
    78 there is now only 10 trends on the dynamics instead of 12[[BR]] 
    79 [[BR]] 
     47change 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]] 
    8048 
    81   '''trdmod''' module[[BR]] 
    82 1- introduce the new logical namelist parameters[[BR]] 
    83 2- introduce new subroutines : 
    84 '''trd_budget''' : computation of the domain averaged T,T^2^, PE, KE trends formerly computes in trd_mod routine)[[BR]] 
    85 ''' trd_3Diom''': output of the 3D trends using IOM [[BR]] 
    86 [[BR]] 
     49  ''' dynnxt'''  module[[BR]] 
    8750 
    88   '''trdicp''' module[[BR]] 
    89 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")  
    90 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]] 
    91 [[BR]] 
     51add 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]] 
    9252 
    93   '''iodef.xml''' file[[BR]] 
    94 add all the trends nick name : '''==>>> CAUTION only in the ORCA2_LIM directory''' [[BR]] 
    95 [[BR]] 
     53  ''' dynvor, trdvor and trdmod_oce'''  modules[[BR]] 
     54 
     55suppress 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]] 
     56 
     57  ''' trdmod'''  module[[BR]] 
     58 
     591- 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]] 
     60 
     61  ''' trdicp'''  module[[BR]] 
     62 
     63add 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]] 
     64 
     65  ''' iodef.xml'''  file[[BR]] 
     66 
     67add all the trends nick name : '''==>>> CAUTION only in the ORCA2_LIM directory''' [[BR]] [[BR]] 
    9668 
    9769---- 
     70=== ''' Step II : simplification of the structure ''' === 
     71  ''' trdicp and trdicp_oce'''  modules[[BR]] 
    9872 
     73see [https://forge.ipsl.jussieu.fr/nemo/log/branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/OPA_SRC?rev=3317 revision 3317] 
    9974 
    100 === ''' Step II : simplification of the structure ''' === 
     751- 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]] 
    10176 
    102   '''trdicp and trdicp_oce''' modules[[BR]] 
    103 see [https://forge.ipsl.jussieu.fr/nemo/log/branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/OPA_SRC?rev=3317  revision 3317] 
     77  ''' trdtra - trddyn - trdmod - trdvor'''  modules : impact on ''' TRA''' , ''' DYN''' , ''' TRD'''  and almost all ''' TOP_SRC'''  modules[[BR]] 
    10478 
    105 1- suppress trdicp_oce module (put required variables in trdmod_oce parameters)[[BR]] 
    106 2- use the jptra_trd_...  instead of jpicp_...  
    107 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]] 
    108 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).  
    109 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]] 
    110 6- suppress the key_trddyn key trdtra  from trdicp[[BR]] 
    111  
    112    '''trdtra - trddyn - trdmod - trdvor''' modules : impact on '''TRA''', '''DYN''', '''TRD''' and almost all '''TOP_SRC''' modules[[BR]] 
    113 see [https://forge.ipsl.jussieu.fr/nemo/log/branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/OPA_SRC?rev=3318  revision 3318] 
     79see [https://forge.ipsl.jussieu.fr/nemo/log/branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/OPA_SRC?rev=3318 revision 3318] 
    11480 
    11581Change the logic : split DYN and TRA trend diagnostics in separate modules[[BR]] 
     
    11985Change 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]] 
    12086 
    121  
    122 0- move trdmod_oce into trd_oce[[BR]] 
    123 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]] 
    124 2- create a trddyn that manage the distribution to iom, global mean, KE, vor, mld [[BR]] 
    125 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]] 
    126 4- trdmod now contains only the trdmod_init routine. Rename all as trdini.F90 and ted_init subroutine 
    127 5- suppress all '''key_trd...''' keys (thanks to dynamical allocation) except for the top key: '''key_trdmld_trc'''.   ''' ==>>> To be done''' 
    128 [[BR]] 
    129  
     870- move trdmod_oce into trd_oce[[BR]] 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 5- suppress all '''key_trd...''' keys (thanks to dynamical allocation) except for the top key: '''key_trdmld_trc'''.   ''' ==>>> To be done''' [[BR]] 
    13088 
    13189---- 
     90=== ''' Step III : addition of 3D KE diagnostics ''' === 
     91  ''' trdken'''  module[[BR]] 
    13292 
    133  
    134 === ''' Step III : addition of 3D KE diagnostics ''' === 
    135  
    136   '''trdken''' module[[BR]] 
    137 see [https://forge.ipsl.jussieu.fr/nemo/log/branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/OPA_SRC?rev=3325  revision 3325] 
     93see [https://forge.ipsl.jussieu.fr/nemo/log/branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/OPA_SRC?rev=3325 revision 3325] 
    13894 
    139950- bug correction:  in trddyn.F90  (ji,jj) ==>> (:,:) in surface stress computation[[BR]] 
     
    146102 
    147103---- 
     104=== ''' Step IV : addition of 3D PE diagnostics ''' === 
     105  ''' trdpen'''  module[[BR]] 
    148106 
     107see [https://forge.ipsl.jussieu.fr/nemo/log/branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/OPA_SRC?rev=3326 revision 3326] and [https://forge.ipsl.jussieu.fr/nemo/log/branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/OPA_SRC?rev=3327 revision 3327] 0- correct a bug in trdtra and trdken 
    149108 
    150 === ''' Step IV : addition of 3D PE diagnostics ''' === 
     1091- add xml name for both PE and KE   2- create a trdpen.F90 module which compute the PE trends at T-point and out them using IOM 
    151110 
    152   '''trdpen''' module[[BR]] 
    153 see [https://forge.ipsl.jussieu.fr/nemo/log/branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/OPA_SRC?rev=3326  revision 3326] 
    154 and [https://forge.ipsl.jussieu.fr/nemo/log/branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/OPA_SRC?rev=3327  revision 3327] 
    155 0- correct a bug in trdtra and trdken 
    156  
    157 1- add xml name for both PE and KE 
    158   
    159 2- create a trdpen.F90 module which compute the PE trends at T-point and out them using IOM 
    160  
    161 3- introduce in eosbn2 a subroutine, eos_drau_dtds, that computes the partial derivative off in situ density with respect to T and S (NB: only coded the 2 linear eos, '''TO BE DONE  for the UNESCO eos''' (nn_eos=0)  
     1113- introduce in eosbn2 a subroutine, eos_drau_dtds, that computes the partial derivative off in situ density with respect to T and S (NB: only coded the 2 linear eos, '''TO BE DONE  for the UNESCO eos''' (nn_eos=0) 
    162112 
    1631134- correct a few bugs and adopt almost systematic CASE structure in trdtra (see revision 3327) 
    164114 
    165  
    166115NB: to be verified: the addition of a ssh term in PE for NOT lk_vvl case 
    167116 
    168 NB: runoff put as a source term in the divergence computation since v3.3 (see divcur), implication for source term in PE, but also tracer trends ? '''Think about that!''' 
     117NB: runoff put as a source term in the divergence computation since v3.3 (see divcur), implication for source term in PE, but also tracer trends ? '''Think about that!'''''' 
    169118 
    170 [[BR]] 
    171 [[BR]] 
    172 [[BR]] 
    173 [[BR]] 
    174 [[BR]] 
    175 [[BR]] 
    176 [[BR]] 
    177 [[BR]] 
    178 [[BR]] 
    179 '''Pending issues''' :  
     119[[BR]] [[BR]] [[BR]] [[BR]] [[BR]] [[BR]] [[BR]] [[BR]] [[BR]] '''Pending issues''' : 
    180120 
    181   atmospheric pressure gradient trend not taken into account (see dynspg.F90  '''To be done !!!!'''[[BR]] 
     121  atmospheric pressure gradient trend not taken into account (see dynspg.F90  ''' To be done !!!!''' [[BR]]''' 
    182122 
    183   kpp non-local trend put in zdf trends !!!  this will not work ! a additional trend term should be add '''To be done !!!!'''[[BR]] 
     123  kpp non-local trend put in zdf trends !!!  this will not work ! a additional trend term should be add ''' To be done !!!!''' [[BR]]''' 
    184124 
    185125  problems to be solved: vvl case for tracer sad trends ; flux form case for had (keg) and zad momentum trends[[BR]] 
     
    190130 
    191131  reshape trdtra so that T and S are treated separately in all ted routine (including mld diag...) 
     132   
    192133 
     134'''Changes done by Fabien R.''' 
     135 
     136  In trdtra.F90, removed semi-colon on lines 118 and 267. 
    193137 
    194138---- 
     
    196140Testing could consider (where appropriate) other configurations in addition to NVTK]. 
    197141 
    198 ||NVTK Tested||!'''YES/NO!'''|| 
    199 ||Other model configurations||!'''YES/NO!'''|| 
    200 ||Processor configurations tested||[ Enter processor configs tested here ]|| 
    201 ||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!'''|| 
     142|| NVTK Tested || !'''YES/NO!''' || 
     143|| Other model configurations || !'''YES/NO!''' || 
     144|| Processor configurations tested || [ Enter processor configs tested here ] || 
     145|| 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!''' || 
    202146 
    203147(Answering UNSURE is likely to generate further questions from reviewers.) 
     
    209153 
    210154=== Bit Comparability === 
    211 ||Does this change preserve answers in your tested standard configurations (to the last bit) ?||!'''YES/NO !'''|| 
    212 ||Does this change bit compare across various processor configurations. (1xM, Nx1 and MxN are recommended)||!'''YES/NO!'''|| 
    213 ||Is this change expected to preserve answers in all possible model configurations?||!'''YES/NO!'''|| 
    214 ||Is this change expected to preserve all diagnostics? [[BR]]!,,!''Preserving answers in model runs does not necessarily imply preserved diagnostics. !''||!'''YES/NO!'''|| 
     155|| Does this change preserve answers in your tested standard configurations (to the last bit) ? || !'''YES/NO !''' || 
     156|| Does this change bit compare across various processor configurations. (1xM, Nx1 and MxN are recommended) || !'''YES/NO!''' || 
     157|| Is this change expected to preserve answers in all possible model configurations? || !'''YES/NO!''' || 
     158|| Is this change expected to preserve all diagnostics? [[BR]]!,,!''Preserving answers in model runs does not necessarily imply preserved diagnostics. !'' || !'''YES/NO!''' || 
    215159 
    216160If you answered !'''NO!''' to any of the above, please provide further details: 
     
    224168---- 
    225169=== System Changes === 
    226 ||Does your change alter namelists?||!'''YES/NO !'''|| 
    227 ||Does your change require a change in compiler options?||!'''YES/NO !'''|| 
     170|| Does your change alter namelists? || !'''YES/NO !''' || 
     171|| Does your change require a change in compiler options? || !'''YES/NO !''' || 
    228172 
    229173If any of these apply, please document the changes required here....... 
     
    235179---- 
    236180=== IPR issues === 
    237 ||Has the code been wholly (100%) produced by NEMO developers staff working exclusively on NEMO?||!'''YES/ NO !'''|| 
     181|| Has the code been wholly (100%) produced by NEMO developers staff working exclusively on NEMO? || !'''YES/ NO !''' || 
    238182 
    239183If No: