Version 20 (modified by cetlod, 9 years ago) (diff)

Last edited Timestamp?


Author : Christian Ethé

ticket : #842

Branch : 2011/dev_r2787_LOCEAN3_TRA_TRP


Description

Motivations
Merge of active and passive tracer advection/diffusion modules to avoid duplication of almost identical modules. Continuation of the work done in 2010

Status
The merge has been done for transport routines, using a switch to avoid the suppression of T and S array at this time, See wiki:ticket/664_TRA_TRP?

Main tasks

(1) Merge dtatem-dtasal into dtatsd

In previous version of NEMO, the 3D field of T and S were used for (1) internal damping to levitus (key_tradmp) and (2) for sst and sss restoring. This was the reason why dta_tem and dta_sal where called at the beginning of step before the surface fluxes computation and the tra_dmp call. With the new surface module, the optional restoring to sst ans sss now uses another data file containing only the 2D temp and salinity data required for the sea surface restoring. The read of 3D field is now only required if the key_tradmp is defined (and in the initialisation, when starting from levitus). Therefore, the call to dta_tem and _sal can now be moved in tradmp module. Furthermore, we combine the two modules (dtatem & dtasal) into a single module ( dtatsd ) as they are almost identical.
Actions :

  • merge of dtatem.F90 & dtasal.F90 into dtatsd.F90
  • move the dta_tsd call from step.F90 to tradmp.F90
  • suppression of key_dtatem & key_dtasal and replace them by one namelist parameter ln_tsd_init
  • suppression of key_tradmp and replace it by a namelist parameter ln_tradmp

(2) Re-introduce a horizontal diffusivity coefficient for passive tracers

After the merge of TRA-TRP, we wanted to keep in the system the use of different transport scheme for active & passive tracers. But, in nemo_v3_1, the diffusive coefficient define for T & S are the one used also for the passive tracers.

Because of space varying of those coefficients - defined in the code by the use of statement function -, we need to find a trick to solve that problem in a easier way

One solution is to multiply the existing coef defining in ldftra_substitute by a factor rldf

#if defined key_traldf_c3d
!   'key_traldf_c3d' :                 aht: 3D coefficient
#       define   fsahtt(i,j,k)   rldf * ahtt(i,j,k)
#elif defined key_traldf_c2d
!   'key_traldf_c2d' :                 aht: 2D coefficient
#       define   fsahtt(i,j,k)   rldf * ahtt(i,j)
#elif defined key_traldf_c1d
!   'key_traldf_c1d' :                aht: 1D coefficient
#       define   fsahtt(i,j,k)   rldf * ahtt(k)
#else
!   Default option :             aht: Constant coefficient
#      define   fsahtt(i,j,k)   rldf * aht0
#endif

rldf is equal to :

  • 1 for active tracers
  • rn_ahtrc_0 / rn_aht_0 ( the ratio between passive tracers and active tracers coef.)

In the code, we ensure that the 2 coef have the same sign ( < 0 for bilaplacian operator ; > 0 for laplacian operator )

(3) replace 3D T & S arrays by 4D array TS throughout the code

Actions :

  • suppression of module traswap.F90
  • replacement in OBC, BDY, ASM, FLO and in AGRIF
  • redefine the pointers ta/sa with tsa. Most of the routines in sub-directory OPA_SRC/DYN are modified due to that change ; see an example below in the routine dynvor.F90
       SUBROUTINE dyn_vor( kt )
          !!----------------------------------------------------------------------
          !!
          !! ** Purpose :   compute the lateral ocean tracer physics.
          !!
          !! ** Action : - Update (ua,va) with the now vorticity term trend
          !!             - save the trends in (ztrdu,ztrdv) in 2 parts (relative
          !!               and planetary vorticity trends) ('key_trddyn')
          !!----------------------------------------------------------------------
          USE oce, ONLY :   ztrdu => ta   ! use ta as 3D workspace
          USE oce, ONLY :   ztrdv => sa   ! use sa as 3D workspace
          !!
          INTEGER, INTENT( in ) ::   kt   ! ocean time-step index
          !!----------------------------------------------------------------------
    
   SUBROUTINE dyn_vor( kt )
      !!----------------------------------------------------------------------
      !!
      !! ** Purpose :   compute the lateral ocean tracer physics.
      !!
      !! ** Action : - Update (ua,va) with the now vorticity term trend
      !!             - save the trends in (ztrdu,ztrdv) in 2 parts (relative
      !!               and planetary vorticity trends) ('key_trddyn')
      !!----------------------------------------------------------------------
      USE oce, ONLY:   tsa            ! tsa used as 2 3D workspace
      !!
      INTEGER, INTENT( in ) ::   kt   ! ocean time-step index
      !
      REAL(wp), POINTER, DIMENSION(:,:,:) ::  ztrdu, ztrdv
      !!----------------------------------------------------------------------
      !
      IF( l_trddyn )   THEN
         ztrdu => tsa(:,:,:,1)
         ztrdv => tsa(:,:,:,2)
      END IF

(4) Use of fldrea.F90 to read/interpolate initial data for passive tracers

  • rewrite dtatrc.F90 in te same way than dtatsd.F90
  • suppression of key_dtatrc & key_trcdmp replace them by namelist parameter ln_dtatrc & ln_trcdmp
  • suppression of key_diatrc a namelist parameter ln_diatrc

(5) Pending issues

  • Documentation : description of new namelist parameter and update in relation with the suppression of CPP keys
  • There remains only one routine in OPA_SRC/DTA directory. We propose to move this routine in OPA_SRC/DOM together with restart.F90 locating in OPA_SRC/IOM and then remove the DTA sub-directory


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
New code doesn't change results when it is switched off
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 : ORCA2_LIM_PISCES, ORCA2_OFF_PISCES_CFC_C14b, GYRE_LOBSTER, POMME, ORCA2_LIM_AGRIF on 1 single processor and 1x4 processors
  • 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?
,,''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
Does your change require a change in compiler options?'''YES/NO '''
  • we merge the two namelists &namdta_tem and &namdta_sal in one &namtsd and add a new namelist parameter ln_tsd_init to replace the 2 CPP keys key_dtatem & key_dtasal
!-----------------------------------------------------------------------
&namdta_tem    !   surface boundary condition : sea surface restoring
!-----------------------------------------------------------------------
!              !     file name                  ! frequency (hours) ! variable   ! time interpol. !  clim   !'yearly' or ! weights  ! rotation !
!              !                                !  (if <0  months)  !   name     !    (logical)   !  (T/F)  ! 'monthly'  ! filename ! pairing  !
  sn_tem       = 'data_1m_potential_temperature_nomask',  -1        , 'votemper' ,     .true.     , .true.  , 'yearly'   , ' '      , ' '
!  
  cn_dir       = './'      !  root directory for the location of the runoff files 
/  
!-----------------------------------------------------------------------
&namdta_sal    !   surface boundary condition : sea surface restoring
!-----------------------------------------------------------------------
!              !     file name                  ! frequency (hours) ! variable   ! time interpol. !  clim   ! 'yearly' or ! weights  ! rotation !
!              !                                !  (if <0  months)  !   name     !    (logical)   !  (T/F)  !  'monthly'  ! filename ! pairing  !
   sn_sal      =  'data_1m_salinity_nomask'     ,         -1        , 'vosaline' ,     .true.     , .true.  , 'yearly'    , ''       , ' '
!  
   cn_dir      = './'      !  root directory for the location of the runoff files
/  

by

!-----------------------------------------------------------------------
&namtsd    !   data : Temperature  & Salinity     
!-----------------------------------------------------------------------
!          ! file name ! frequency (hours)    ! variable ! time interp. ! clim  !'yearly' or ! weights  ! rotation !
!          !           !  (if <0  months)     !   name   !  (logical)   ! (T/F) ! 'monthly'  ! filename ! pairing  !
   sn_tem  = 'data_1m_potential_temperature_nomask', -1,'votemper',  .true.  , .true., 'yearly'   , ' '      , ' '
   sn_sal  = 'data_1m_salinity_nomask'             , -1,'vosaline',  .true.  , .true., 'yearly'   , ''       , ' '
   !
   cn_dir        = './'     !  root directory for the location of the runoff files
   ln_tsd_init   = .true.   !  Initialisation of ocean T & S with T &S input data (T) or not (F)
   ln_tsd_tradmp = .true.   !  damping of ocean T & S toward T &S input data (T) or not (F)
/
  • we add a in namelist_top new namelist for data initialisation with fldread
!-----------------------------------------------------------------------
&namtrc_dta      !    Initialisation from data input file
!-----------------------------------------------------------------------
!
!                !  file name               ! frequency (hours) ! variable   ! time interp. !  clim  ! 'yearly'/ ! weights  ! rotation !
!                !                          !  (if <0  months)  !   name     !   (logical)  !  (T/F) ! 'monthly' ! filename ! pairing  !
   sn_trcdta(1)  = 'data_DIC_nomask'        ,        -12        ,  'DIC'     ,    .false.   , .true. , 'yearly'  , ''       , ''
   sn_trcdta(2)  = 'data_Alkalini_nomask'   ,        -12        ,  'Alkalini',    .false.   , .true. , 'yearly'  , ''       , ''
   sn_trcdta(3)  = 'data_O2_nomask'         ,        -1         ,  'O2'      ,    .true.    , .true. , 'yearly'  , ''       , ''
   sn_trcdta(5)  = 'data_PO4_nomask'        ,        -1         ,  'PO4'     ,    .true.    , .true. , 'yearly'  , ''       , ''
   sn_trcdta(7)  = 'data_Si_nomask'         ,        -1         ,  'Si'      ,    .true.    , .true. , 'yearly'  , ''       , ''
   sn_trcdta(10) = 'data_DOC_nomask'        ,        -12        ,  'DOC'     ,    .false.   , .true. , 'yearly'  , ''       , ''
   sn_trcdta(14) = 'data_Fer_nomask'        ,        -12        ,  'Fer'     ,    .false.   , .true. , 'yearly'  , ''       , ''
   sn_trcdta(23) = 'data_NO3_nomask'        ,        -1         ,  'NO3'     ,    .true.    , .true. , 'yearly'  , ''       , ''
!
   cn_dir        =  './'      !  root directory for the location of the data files
   rn_trfac(1)   =   1.0e-06  !  multiplicative factor
   rn_trfac(2)   =   1.0e-06  !  -      -      -     -
   rn_trfac(3)   =  44.6e-06  !  -      -      -     -
   rn_trfac(5)   = 122.0e-06  !  -      -      -     -
   rn_trfac(7)   =   1.0e-06  !  -      -      -     -
   rn_trfac(10)  =   1.0      !  -      -      -     -
   rn_trfac(14)  =   1.0      !  -      -      -     -
   rn_trfac(23)  =   7.6e-06  !  -      -      -     -
/

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……….