Version 4 (modified by acc, 17 months ago) (diff)

KERNEL-02_DaveStorkey_RK3Preparation

The PI is responsible to closely follow the progress of the action, and especially to contact NEMO project manager if the delay on preview (or review) are longer than the 2 weeks expected.

Help

The action has to be detailed briefly in the 'Summary' for later inclusion in other pages. To do so, edit 'Summary' section as a common wiki page and set links for the development ticket and branch.

Out of this, the rest of the page ('Abstract'|'Preview'|'Tests'|'Review') can be edited on-line inside the form fields considering the following color code given hereafter: PI(S), Previewer(s) and Reviewer(s).
Record your modifications for the section you have edited by clicking on the corresponding button at the end of the section with 'Save …' button. Just above, the log record will be updated.

The informations inside the form fields and this wiki page itself are stored in 2 separate databases. As a consequence, there is absolutely no risk to make any modification in the page itself as long as you don't rename the page or modify the source code of {{{#!TracForm ... }}} processors.

Summary

Action KERNEL-02_DaveStorkey_RK3Preparation
PI(S) Dave Storkey

Digest

Reorganisation of code to prepare for implementation of RK3 timestepping:

  1. Prognostic fields to be passed to tendency routines as arguments.
  2. Tracers to be consistency updated as extensive (volume-weighted) quantities throughout the code.
Dependencies
Target
Trac Ticket #0000
SVN branch branches/$YEAR/dev_r{REV}_{SCOPE}-{NUM}_{PIS}-{KEYWORDS}
Previewer(s) Gurvan Madec
Reviewer(s) Gurvan Madec
Link

'.' => '/nemo/wiki/2019WP/KERNEL-02_Storkey_Coward_IMMERSE_first_steps'

Abstract

This section should be completed before starting to develop the code, in order to find agreement on the method beforehand.

Description

Implementation

Reference manual and web pages updates

Updated on 12/03/2019 16:49:00 by davestorkey

Once the PI has completed this section, he should send a mail to the previewer(s) asking them to preview the work within two weeks.

Preview

Part of the reorganisation for RK3 requires the refactoring of arrays such as un, ub into a single, 4 dimensional array with a time-level dimension. It is expected that much of the work required here can be automated to the extent that it is feasible to re-apply these changes after the annual merge. Below is a working example of how this might be achieved. Perl is used to carry out the pattern matching and substitution because of its ability to match patterns extending over several lines. A random subset of source files are used in this example and several to illustrate the successes and caveats for the method.

Step 1 Perl is used in a 'edit in place' mode so the original files will be overwritten. Step 1 is therefore to create copies of the test files:

#!/bin/bash
mkdir TEST_FILES
cp FLO/flo_oce.F90 FLO/floats.F90 SBC/sbcfwb.F90 DYN/dynadv_ubs.F90 DYN/dynkeg.F90 DYN/dynvor.F90 DYN/dynadv_cen2.F90 TEST_FILES
cp FLO/flo_oce.F90 FLO/floats.F90 SBC/sbcfwb.F90 DYN/dynadv_ubs.F90 DYN/dynkeg.F90 DYN/dynvor.F90 DYN/dynadv_cen2.F90 TEST_FILES_ORG

The refactoring script

#!/bin/bash
#
 INVARS=( ub  vb  wb  un  vn  wn )
OUTVARS=( uu  vv  ww  uu  vv  ww )
  TLEVS=( jtb jtb jtb jtn jtn jtn )
#
rm patch.list
for f in TEST_FILES/*.F90
do
 echo "{{{#!diff" >> patch.list
 echo "Index: "$f >> patch.list
 echo "==============================" >> patch.list
 n=0
 for n in `seq 0 1 $(( ${#INVARS[*]} - 1 ))`
 do
  perl -0777 -pi -e 's:([+.(,\s\-\/\*\%])'${INVARS[$n]}'\s*\(([^)]*)\):\1'${OUTVARS[$n]}'\(\2,'${TLEVS[$n]}'\):g'  $f
 done
 diff -u TEST_FILES_ORG/`basename $f` $f >> patch.list
 echo "}}}" >> patch.list
done

Some contrived tests:

cat TEST_FILES_ORG/contrived_tests.F90
   un(:,:,:)                    ! The simplest test. Should ==> uu(:,:,:,jtn)
  pun(:,:,:)                    ! target preceded by non-whitespace or operator. Should be unchanged
  sbc_fwb(:,:,:)                ! target preceded by non-whitespace or operator. Should be unchanged
   un ( ji   , jj,   : )        ! Check alternative simple case ==> uu ( ji   , jj,   :,jtn)
   a+ub(:,:,jk)                 ! Check preceeding operators are correctly recognised
   a-vb(:,:,jk)                 ! Check preceeding operators are correctly recognised
   a*vn(:,:,jk)                 ! Check preceeding operators are correctly recognised
   a/wb(:,:,jk)                 ! Check preceeding operators are correctly recognised
   a%wn(:,:,jk)                 ! Check preceeding operators are correctly recognised
 .OR.wn(:,:,jk)                 ! Check preceeding operators are correctly recognised
    (wn(:,:,jk) + wn(:,:,jk-1)) ! Check preceeding brackets are correctly recognised
   un ( ji+1 ,     &            ! Check entries over multiple lines ae handled
  &     jj, jk - 1 )            ! Check entries over multiple lines ae handled
   un( mi0(ii) , mj0(jj ))      ! Brackets within arguments will break [ does this occur?]

Result of the script on the contrived tests:

cat TEST_FILES/contrived_tests.F90
   uu(:,:,:,jtn)                    ! The simplest test. Should ==> uu(:,:,:,jtn)
  pun(:,:,:)                    ! target preceded by non-whitespace or operator. Should be unchanged
  sbc_fwb(:,:,:)                ! target preceded by non-whitespace or operator. Should be unchanged
   uu( ji   , jj,   : ,jtn)        ! Check alternative simple case ==> uu ( ji   , jj,   :,jtn)
   a+uu(:,:,jk,jtb)                 ! Check preceeding operators are correctly recognised
   a-vv(:,:,jk,jtb)                 ! Check preceeding operators are correctly recognised
   a*vv(:,:,jk,jtn)                 ! Check preceeding operators are correctly recognised
   a/ww(:,:,jk,jtb)                 ! Check preceeding operators are correctly recognised
   a%ww(:,:,jk,jtn)                 ! Check preceeding operators are correctly recognised
 .OR.ww(:,:,jk,jtn)                 ! Check preceeding operators are correctly recognised
    (ww(:,:,jk,jtn) + ww(:,:,jk-1,jtn)) ! Check preceeding brackets are correctly recognised
   uu( ji+1 ,     &            ! Check entries over multiple lines ae handled
  &     jj, jk - 1 ,jtn)            ! Check entries over multiple lines ae handled
   uu( mi0(ii,jtn) , mj0(jj ))      ! Brackets within arguments will break [ does this occur?]
  • contrived_tests.F90

    ==============================
    old new  
    1    un(:,:,:)                    ! The simplest test. Should ==> uu(:,:,:,jtn) 
     1   uu(:,:,:,jtn)                    ! The simplest test. Should ==> uu(:,:,:,jtn) 
    22  pun(:,:,:)                    ! target preceded by non-whitespace or operator. Should be unchanged 
    33  sbc_fwb(:,:,:)                ! target preceded by non-whitespace or operator. Should be unchanged 
    4    un ( ji   , jj,   : )        ! Check alternative simple case ==> uu ( ji   , jj,   :,jtn) 
    5    a+ub(:,:,jk)                 ! Check preceeding operators are correctly recognised 
    6    a-vb(:,:,jk)                 ! Check preceeding operators are correctly recognised 
    7    a*vn(:,:,jk)                 ! Check preceeding operators are correctly recognised 
    8    a/wb(:,:,jk)                 ! Check preceeding operators are correctly recognised 
    9    a%wn(:,:,jk)                 ! Check preceeding operators are correctly recognised 
    10  .OR.wn(:,:,jk)                 ! Check preceeding operators are correctly recognised 
    11     (wn(:,:,jk) + wn(:,:,jk-1)) ! Check preceeding brackets are correctly recognised 
    12    un ( ji+1 ,     &            ! Check entries over multiple lines ae handled 
    13   &     jj, jk - 1 )            ! Check entries over multiple lines ae handled 
    14    un( mi0(ii) , mj0(jj ))      ! Brackets within arguments will break [ does this occur?] 
     4   uu( ji   , jj,   : ,jtn)        ! Check alternative simple case ==> uu ( ji   , jj,   :,jtn) 
     5   a+uu(:,:,jk,jtb)                 ! Check preceeding operators are correctly recognised 
     6   a-vv(:,:,jk,jtb)                 ! Check preceeding operators are correctly recognised 
     7   a*vv(:,:,jk,jtn)                 ! Check preceeding operators are correctly recognised 
     8   a/ww(:,:,jk,jtb)                 ! Check preceeding operators are correctly recognised 
     9   a%ww(:,:,jk,jtn)                 ! Check preceeding operators are correctly recognised 
     10 .OR.ww(:,:,jk,jtn)                 ! Check preceeding operators are correctly recognised 
     11    (ww(:,:,jk,jtn) + ww(:,:,jk-1,jtn)) ! Check preceeding brackets are correctly recognised 
     12   uu( ji+1 ,     &            ! Check entries over multiple lines ae handled 
     13  &     jj, jk - 1 ,jtn)            ! Check entries over multiple lines ae handled 
     14   uu( mi0(ii,jtn) , mj0(jj ))      ! Brackets within arguments will break [ does this occur?] 

So all changes were made correctly (apart from the last which was expected). Also those entries which were potential pitfalls (pun and abc_fwb) were correctly ignored. Time to try a real set:

The results on the sample set of files (patch.list):

  • dynadv_cen2.F90

    ==================================================
    old new  
    6666      !                             !==  Horizontal advection  ==! 
    6767      ! 
    6868      DO jk = 1, jpkm1                    ! horizontal transport 
    69          zfu(:,:,jk) = 0.25_wp * e2u(:,:) * e3u_n(:,:,jk) * un(:,:,jk) 
    70          zfv(:,:,jk) = 0.25_wp * e1v(:,:) * e3v_n(:,:,jk) * vn(:,:,jk) 
     69         zfu(:,:,jk) = 0.25_wp * e2u(:,:) * e3u_n(:,:,jk) * uu(:,:,jk,jtn) 
     70         zfv(:,:,jk) = 0.25_wp * e1v(:,:) * e3v_n(:,:,jk) * vv(:,:,jk,jtn) 
    7171         DO jj = 1, jpjm1                 ! horizontal momentum fluxes (at T- and F-point) 
    7272            DO ji = 1, fs_jpim1   ! vector opt. 
    73                zfu_t(ji+1,jj  ,jk) = ( zfu(ji,jj,jk) + zfu(ji+1,jj,jk) ) * ( un(ji,jj,jk) + un(ji+1,jj  ,jk) ) 
    74                zfv_f(ji  ,jj  ,jk) = ( zfv(ji,jj,jk) + zfv(ji+1,jj,jk) ) * ( un(ji,jj,jk) + un(ji  ,jj+1,jk) ) 
    75                zfu_f(ji  ,jj  ,jk) = ( zfu(ji,jj,jk) + zfu(ji,jj+1,jk) ) * ( vn(ji,jj,jk) + vn(ji+1,jj  ,jk) ) 
    76                zfv_t(ji  ,jj+1,jk) = ( zfv(ji,jj,jk) + zfv(ji,jj+1,jk) ) * ( vn(ji,jj,jk) + vn(ji  ,jj+1,jk) ) 
     73               zfu_t(ji+1,jj  ,jk) = ( zfu(ji,jj,jk) + zfu(ji+1,jj,jk) ) * ( uu(ji,jj,jk,jtn) + uu(ji+1,jj  ,jk,jtn) ) 
     74               zfv_f(ji  ,jj  ,jk) = ( zfv(ji,jj,jk) + zfv(ji+1,jj,jk) ) * ( uu(ji,jj,jk,jtn) + uu(ji  ,jj+1,jk,jtn) ) 
     75               zfu_f(ji  ,jj  ,jk) = ( zfu(ji,jj,jk) + zfu(ji,jj+1,jk) ) * ( vv(ji,jj,jk,jtn) + vv(ji+1,jj  ,jk,jtn) ) 
     76               zfv_t(ji  ,jj+1,jk) = ( zfv(ji,jj,jk) + zfv(ji,jj+1,jk) ) * ( vv(ji,jj,jk,jtn) + vv(ji  ,jj+1,jk,jtn) ) 
    7777            END DO 
    7878         END DO 
    7979         DO jj = 2, jpjm1                 ! divergence of horizontal momentum fluxes 
     
    105105      IF( ln_linssh ) THEN                ! linear free surface: advection through the surface 
    106106         DO jj = 2, jpjm1 
    107107            DO ji = fs_2, fs_jpim1 
    108                zfu_uw(ji,jj,1) = 0.5_wp * ( e1e2t(ji,jj) * wn(ji,jj,1) + e1e2t(ji+1,jj) * wn(ji+1,jj,1) ) * un(ji,jj,1) 
    109                zfv_vw(ji,jj,1) = 0.5_wp * ( e1e2t(ji,jj) * wn(ji,jj,1) + e1e2t(ji,jj+1) * wn(ji,jj+1,1) ) * vn(ji,jj,1) 
     108               zfu_uw(ji,jj,1) = 0.5_wp * ( e1e2t(ji,jj) * ww(ji,jj,1,jtn) + e1e2t(ji+1,jj) * ww(ji+1,jj,1,jtn) ) * uu(ji,jj,1,jtn) 
     109               zfv_vw(ji,jj,1) = 0.5_wp * ( e1e2t(ji,jj) * ww(ji,jj,1,jtn) + e1e2t(ji,jj+1) * ww(ji,jj+1,1,jtn) ) * vv(ji,jj,1,jtn) 
    110110            END DO 
    111111         END DO 
    112112      ENDIF 
    113113      DO jk = 2, jpkm1                    ! interior advective fluxes 
    114114         DO jj = 2, jpj                       ! 1/4 * Vertical transport 
    115115            DO ji = 2, jpi 
    116                zfw(ji,jj,jk) = 0.25_wp * e1e2t(ji,jj) * wn(ji,jj,jk) 
     116               zfw(ji,jj,jk) = 0.25_wp * e1e2t(ji,jj) * ww(ji,jj,jk,jtn) 
    117117            END DO 
    118118         END DO 
    119119         DO jj = 2, jpjm1 
    120120            DO ji = fs_2, fs_jpim1   ! vector opt. 
    121                zfu_uw(ji,jj,jk) = ( zfw(ji,jj,jk) + zfw(ji+1,jj  ,jk) ) * ( un(ji,jj,jk) + un(ji,jj,jk-1) ) 
    122                zfv_vw(ji,jj,jk) = ( zfw(ji,jj,jk) + zfw(ji  ,jj+1,jk) ) * ( vn(ji,jj,jk) + vn(ji,jj,jk-1) ) 
     121               zfu_uw(ji,jj,jk) = ( zfw(ji,jj,jk) + zfw(ji+1,jj  ,jk) ) * ( uu(ji,jj,jk,jtn) + uu(ji,jj,jk-1,jtn) ) 
     122               zfv_vw(ji,jj,jk) = ( zfw(ji,jj,jk) + zfw(ji  ,jj+1,jk) ) * ( vv(ji,jj,jk,jtn) + vv(ji,jj,jk-1,jtn) ) 
    123123            END DO 
    124124         END DO 
    125125      END DO 
  • dynadv_ubs.F90

    ==============================
    old new  
    101101      DO jk = 1, jpkm1                       !  Laplacian of the velocity  ! 
    102102         !                                   ! =========================== ! 
    103103         !                                         ! horizontal volume fluxes 
    104          zfu(:,:,jk) = e2u(:,:) * e3u_n(:,:,jk) * un(:,:,jk) 
    105          zfv(:,:,jk) = e1v(:,:) * e3v_n(:,:,jk) * vn(:,:,jk) 
     104         zfu(:,:,jk) = e2u(:,:) * e3u_n(:,:,jk) * uu(:,:,jk,jtn) 
     105         zfv(:,:,jk) = e1v(:,:) * e3v_n(:,:,jk) * vv(:,:,jk,jtn) 
    106106         ! 
    107107         DO jj = 2, jpjm1                          ! laplacian 
    108108            DO ji = fs_2, fs_jpim1   ! vector opt. 
    109                zlu_uu(ji,jj,jk,1) = ( ub (ji+1,jj  ,jk) - 2.*ub (ji,jj,jk) + ub (ji-1,jj  ,jk) ) * umask(ji,jj,jk) 
    110                zlv_vv(ji,jj,jk,1) = ( vb (ji  ,jj+1,jk) - 2.*vb (ji,jj,jk) + vb (ji  ,jj-1,jk) ) * vmask(ji,jj,jk) 
    111                zlu_uv(ji,jj,jk,1) = ( ub (ji  ,jj+1,jk) - ub (ji  ,jj  ,jk) ) * fmask(ji  ,jj  ,jk)   & 
    112                   &               - ( ub (ji  ,jj  ,jk) - ub (ji  ,jj-1,jk) ) * fmask(ji  ,jj-1,jk) 
    113                zlv_vu(ji,jj,jk,1) = ( vb (ji+1,jj  ,jk) - vb (ji  ,jj  ,jk) ) * fmask(ji  ,jj  ,jk)   & 
    114                   &               - ( vb (ji  ,jj  ,jk) - vb (ji-1,jj  ,jk) ) * fmask(ji-1,jj  ,jk) 
     109               zlu_uu(ji,jj,jk,1) = ( uu(ji+1,jj  ,jk,jtb) - 2.*uu(ji,jj,jk,jtb) + uu(ji-1,jj  ,jk,jtb) ) * umask(ji,jj,jk) 
     110               zlv_vv(ji,jj,jk,1) = ( vv(ji  ,jj+1,jk,jtb) - 2.*vv(ji,jj,jk,jtb) + vv(ji  ,jj-1,jk,jtb) ) * vmask(ji,jj,jk) 
     111               zlu_uv(ji,jj,jk,1) = ( uu(ji  ,jj+1,jk,jtb) - uu(ji  ,jj  ,jk,jtb) ) * fmask(ji  ,jj  ,jk)   & 
     112                  &               - ( uu(ji  ,jj  ,jk,jtb) - uu(ji  ,jj-1,jk,jtb) ) * fmask(ji  ,jj-1,jk) 
     113               zlv_vu(ji,jj,jk,1) = ( vv(ji+1,jj  ,jk,jtb) - vv(ji  ,jj  ,jk,jtb) ) * fmask(ji  ,jj  ,jk)   & 
     114                  &               - ( vv(ji  ,jj  ,jk,jtb) - vv(ji-1,jj  ,jk,jtb) ) * fmask(ji-1,jj  ,jk) 
    115115               ! 
    116116               zlu_uu(ji,jj,jk,2) = ( zfu(ji+1,jj  ,jk) - 2.*zfu(ji,jj,jk) + zfu(ji-1,jj  ,jk) ) * umask(ji,jj,jk) 
    117117               zlv_vv(ji,jj,jk,2) = ( zfv(ji  ,jj+1,jk) - 2.*zfv(ji,jj,jk) + zfv(ji  ,jj-1,jk) ) * vmask(ji,jj,jk) 
     
    131131      !                                      !  Horizontal advection  ! 
    132132      DO jk = 1, jpkm1                       ! ====================== ! 
    133133         !                                         ! horizontal volume fluxes 
    134          zfu(:,:,jk) = 0.25_wp * e2u(:,:) * e3u_n(:,:,jk) * un(:,:,jk) 
    135          zfv(:,:,jk) = 0.25_wp * e1v(:,:) * e3v_n(:,:,jk) * vn(:,:,jk) 
     134         zfu(:,:,jk) = 0.25_wp * e2u(:,:) * e3u_n(:,:,jk) * uu(:,:,jk,jtn) 
     135         zfv(:,:,jk) = 0.25_wp * e1v(:,:) * e3v_n(:,:,jk) * vv(:,:,jk,jtn) 
    136136         ! 
    137137         DO jj = 1, jpjm1                          ! horizontal momentum fluxes at T- and F-point 
    138138            DO ji = 1, fs_jpim1   ! vector opt. 
    139                zui = ( un(ji,jj,jk) + un(ji+1,jj  ,jk) ) 
    140                zvj = ( vn(ji,jj,jk) + vn(ji  ,jj+1,jk) ) 
     139               zui = ( uu(ji,jj,jk,jtn) + uu(ji+1,jj  ,jk,jtn) ) 
     140               zvj = ( vv(ji,jj,jk,jtn) + vv(ji  ,jj+1,jk,jtn) ) 
    141141               ! 
    142142               IF( zui > 0 ) THEN   ;   zl_u = zlu_uu(ji  ,jj,jk,1) 
    143143               ELSE                 ;   zl_u = zlu_uu(ji+1,jj,jk,1) 
     
    163163               ENDIF 
    164164               ! 
    165165               zfv_f(ji  ,jj  ,jk) = ( zfvi - gamma2 * ( zlv_vu(ji,jj,jk,2) + zlv_vu(ji+1,jj  ,jk,2) )  )   & 
    166                   &                * ( un(ji,jj,jk) + un(ji  ,jj+1,jk) - gamma1 * zl_u ) 
     166                  &                * ( uu(ji,jj,jk,jtn) + uu(ji  ,jj+1,jk,jtn) - gamma1 * zl_u ) 
    167167               zfu_f(ji  ,jj  ,jk) = ( zfuj - gamma2 * ( zlu_uv(ji,jj,jk,2) + zlu_uv(ji  ,jj+1,jk,2) )  )   & 
    168                   &                * ( vn(ji,jj,jk) + vn(ji+1,jj  ,jk) - gamma1 * zl_v ) 
     168                  &                * ( vv(ji,jj,jk,jtn) + vv(ji+1,jj  ,jk,jtn) - gamma1 * zl_v ) 
    169169            END DO 
    170170         END DO 
    171171         DO jj = 2, jpjm1                          ! divergence of horizontal momentum fluxes 
     
    198198      IF( ln_linssh ) THEN                         ! constant volume : advection through the surface 
    199199         DO jj = 2, jpjm1 
    200200            DO ji = fs_2, fs_jpim1 
    201                zfu_uw(ji,jj,1) = 0.5_wp * ( e1e2t(ji,jj) * wn(ji,jj,1) + e1e2t(ji+1,jj) * wn(ji+1,jj,1) ) * un(ji,jj,1) 
    202                zfv_vw(ji,jj,1) = 0.5_wp * ( e1e2t(ji,jj) * wn(ji,jj,1) + e1e2t(ji,jj+1) * wn(ji,jj+1,1) ) * vn(ji,jj,1) 
     201               zfu_uw(ji,jj,1) = 0.5_wp * ( e1e2t(ji,jj) * ww(ji,jj,1,jtn) + e1e2t(ji+1,jj) * ww(ji+1,jj,1,jtn) ) * uu(ji,jj,1,jtn) 
     202               zfv_vw(ji,jj,1) = 0.5_wp * ( e1e2t(ji,jj) * ww(ji,jj,1,jtn) + e1e2t(ji,jj+1) * ww(ji,jj+1,1,jtn) ) * vv(ji,jj,1,jtn) 
    203203            END DO 
    204204         END DO 
    205205      ENDIF 
    206206      DO jk = 2, jpkm1                          ! interior fluxes 
    207207         DO jj = 2, jpj 
    208208            DO ji = 2, jpi 
    209                zfw(ji,jj,jk) = 0.25_wp * e1e2t(ji,jj) * wn(ji,jj,jk) 
     209               zfw(ji,jj,jk) = 0.25_wp * e1e2t(ji,jj) * ww(ji,jj,jk,jtn) 
    210210            END DO 
    211211         END DO 
    212212         DO jj = 2, jpjm1 
    213213            DO ji = fs_2, fs_jpim1   ! vector opt. 
    214                zfu_uw(ji,jj,jk) = ( zfw(ji,jj,jk)+ zfw(ji+1,jj,jk) ) * ( un(ji,jj,jk) + un(ji,jj,jk-1) ) 
    215                zfv_vw(ji,jj,jk) = ( zfw(ji,jj,jk)+ zfw(ji,jj+1,jk) ) * ( vn(ji,jj,jk) + vn(ji,jj,jk-1) ) 
     214               zfu_uw(ji,jj,jk) = ( zfw(ji,jj,jk)+ zfw(ji+1,jj,jk) ) * ( uu(ji,jj,jk,jtn) + uu(ji,jj,jk-1,jtn) ) 
     215               zfv_vw(ji,jj,jk) = ( zfw(ji,jj,jk)+ zfw(ji,jj+1,jk) ) * ( vv(ji,jj,jk,jtn) + vv(ji,jj,jk-1,jtn) ) 
    216216            END DO 
    217217         END DO 
    218218      END DO 
  • dynkeg.F90

    ==============================
    old new  
    5656      !!         zhke = 1/2 [ mi-1( un^2 ) + mj-1( vn^2 ) ] 
    5757      !!              * kscheme = nkeg_HW : Hollingsworth correction following 
    5858      !!      Arakawa (2001). The now horizontal kinetic energy is given by: 
    59       !!         zhke = 1/6 [ mi-1(  2 * un^2 + ((un(j+1)+un(j-1))/2)^2  ) 
    60       !!                    + mj-1(  2 * vn^2 + ((vn(i+1)+vn(i-1))/2)^2  ) ] 
     59      !!         zhke = 1/6 [ mi-1(  2 * un^2 + ((uu(j+1,jtn)+uu(j-1,jtn))/2)^2  ) 
     60      !!                    + mj-1(  2 * vn^2 + ((vv(I+1,jtn)+vv(i-1,jtn))/2)^2  ) ] 
    6161      !! 
    6262      !!      Take its horizontal gradient and add it to the general momentum 
    6363      !!      trend (ua,va). 
     
    108108                     ii   = idx_bdy(ib_bdy)%nbi(jb,igrd) 
    109109                     ij   = idx_bdy(ib_bdy)%nbj(jb,igrd) 
    110110                     ifu   = NINT( idx_bdy(ib_bdy)%flagu(jb,igrd) ) 
    111                      un(ii-ifu,ij,jk) = un(ii,ij,jk) * umask(ii,ij,jk) 
     111                     uu(ii-ifu,ij,jk,jtn) = uu(ii,ij,jk,jtn) * umask(ii,ij,jk) 
    112112                  END DO 
    113113               END DO 
    114114               ! 
     
    118118                     ii   = idx_bdy(ib_bdy)%nbi(jb,igrd) 
    119119                     ij   = idx_bdy(ib_bdy)%nbj(jb,igrd) 
    120120                     ifv   = NINT( idx_bdy(ib_bdy)%flagv(jb,igrd) ) 
    121                      vn(ii,ij-ifv,jk) = vn(ii,ij,jk) * vmask(ii,ij,jk) 
     121                     vv(ii,ij-ifv,jk,jtn) = vv(ii,ij,jk,jtn) * vmask(ii,ij,jk) 
    122122                  END DO 
    123123               END DO 
    124124            ENDIF 
     
    131131         DO jk = 1, jpkm1 
    132132            DO jj = 2, jpj 
    133133               DO ji = fs_2, jpi   ! vector opt. 
    134                   zu =    un(ji-1,jj  ,jk) * un(ji-1,jj  ,jk)   & 
    135                      &  + un(ji  ,jj  ,jk) * un(ji  ,jj  ,jk) 
    136                   zv =    vn(ji  ,jj-1,jk) * vn(ji  ,jj-1,jk)   & 
    137                      &  + vn(ji  ,jj  ,jk) * vn(ji  ,jj  ,jk) 
     134                  zu =    uu(ji-1,jj  ,jk,jtn) * uu(ji-1,jj  ,jk,jtn)   & 
     135                     &  + uu(ji  ,jj  ,jk,jtn) * uu(ji  ,jj  ,jk,jtn) 
     136                  zv =    vv(ji  ,jj-1,jk,jtn) * vv(ji  ,jj-1,jk,jtn)   & 
     137                     &  + vv(ji  ,jj  ,jk,jtn) * vv(ji  ,jj  ,jk,jtn) 
    138138                  zhke(ji,jj,jk) = 0.25_wp * ( zv + zu ) 
    139139               END DO 
    140140            END DO 
     
    144144         DO jk = 1, jpkm1 
    145145            DO jj = 2, jpjm1 
    146146               DO ji = fs_2, jpim1   ! vector opt. 
    147                   zu = 8._wp * ( un(ji-1,jj  ,jk) * un(ji-1,jj  ,jk)    & 
    148                      &         + un(ji  ,jj  ,jk) * un(ji  ,jj  ,jk) )  & 
    149                      &   +     ( un(ji-1,jj-1,jk) + un(ji-1,jj+1,jk) ) * ( un(ji-1,jj-1,jk) + un(ji-1,jj+1,jk) )   & 
    150                      &   +     ( un(ji  ,jj-1,jk) + un(ji  ,jj+1,jk) ) * ( un(ji  ,jj-1,jk) + un(ji  ,jj+1,jk) ) 
     147                  zu = 8._wp * ( uu(ji-1,jj  ,jk,jtn) * uu(ji-1,jj  ,jk,jtn)    & 
     148                     &         + uu(ji  ,jj  ,jk,jtn) * uu(ji  ,jj  ,jk,jtn) )  & 
     149                     &   +     ( uu(ji-1,jj-1,jk,jtn) + uu(ji-1,jj+1,jk,jtn) ) * ( uu(ji-1,jj-1,jk,jtn) + uu(ji-1,jj+1,jk,jtn) )   & 
     150                     &   +     ( uu(ji  ,jj-1,jk,jtn) + uu(ji  ,jj+1,jk,jtn) ) * ( uu(ji  ,jj-1,jk,jtn) + uu(ji  ,jj+1,jk,jtn) ) 
    151151                     ! 
    152                   zv = 8._wp * ( vn(ji  ,jj-1,jk) * vn(ji  ,jj-1,jk)    & 
    153                      &         + vn(ji  ,jj  ,jk) * vn(ji  ,jj  ,jk) )  & 
    154                      &  +      ( vn(ji-1,jj-1,jk) + vn(ji+1,jj-1,jk) ) * ( vn(ji-1,jj-1,jk) + vn(ji+1,jj-1,jk) )   & 
    155                      &  +      ( vn(ji-1,jj  ,jk) + vn(ji+1,jj  ,jk) ) * ( vn(ji-1,jj  ,jk) + vn(ji+1,jj  ,jk) ) 
     152                  zv = 8._wp * ( vv(ji  ,jj-1,jk,jtn) * vv(ji  ,jj-1,jk,jtn)    & 
     153                     &         + vv(ji  ,jj  ,jk,jtn) * vv(ji  ,jj  ,jk,jtn) )  & 
     154                     &  +      ( vv(ji-1,jj-1,jk,jtn) + vv(ji+1,jj-1,jk,jtn) ) * ( vv(ji-1,jj-1,jk,jtn) + vv(ji+1,jj-1,jk,jtn) )   & 
     155                     &  +      ( vv(ji-1,jj  ,jk,jtn) + vv(ji+1,jj  ,jk,jtn) ) * ( vv(ji-1,jj  ,jk,jtn) + vv(ji+1,jj  ,jk,jtn) ) 
    156156                  zhke(ji,jj,jk) = r1_48 * ( zv + zu ) 
    157157               END DO 
    158158            END DO 
     
    163163 
    164164      IF (ln_bdy) THEN 
    165165         ! restore velocity masks at points outside boundary 
    166          un(:,:,:) = un(:,:,:) * umask(:,:,:) 
    167          vn(:,:,:) = vn(:,:,:) * vmask(:,:,:) 
     166         uu(:,:,:,jtn) = uu(:,:,:,jtn) * umask(:,:,:) 
     167         vv(:,:,:,jtn) = vv(:,:,:,jtn) * vmask(:,:,:) 
    168168      ENDIF 
    169169 
    170170      ! 
Index: TEST_FILES/dynvor.F90
==============================
  • flo_oce.F90

    ==============================
    old new  
    5959      !!---------------------------------------------------------------------- 
    6060      !!                 ***  FUNCTION flo_oce_alloc  *** 
    6161      !!---------------------------------------------------------------------- 
    62       ALLOCATE( wb(jpi,jpj,jpk) , nfloat(jpnfl) , nisobfl(jpnfl) , ngrpfl(jpnfl) , & 
     62      ALLOCATE( ww(jpi,jpj,jpk,jtb) , nfloat(jpnfl) , nisobfl(jpnfl) , ngrpfl(jpnfl) , & 
    6363         &      flxx(jpnfl)     , flyy(jpnfl)   , flzz(jpnfl)    ,                 & 
    6464         &      tpifl(jpnfl)    , tpjfl(jpnfl)  , tpkfl(jpnfl)   , STAT=flo_oce_alloc ) 
    6565      ! 

Ok This was wrong. jtb is not what should go into the ALLOCATE statement

  • floats.F90

    ==============================
    old new  
    6464      ! 
    6565      CALL flo_rst( kt )      ! trajectories restart 
    6666      ! 
    67       wb(:,:,:) = wn(:,:,:)         ! Save the old vertical velocity field 
     67      ww(:,:,:,jtb) = ww(:,:,:,jtn)         ! Save the old vertical velocity field 
    6868      ! 
    6969      IF( ln_timing )   CALL timing_stop('flo_stp') 
    7070      ! 
     
    131131      ! 
    132132      CALL flo_dom                  ! compute/read initial position of floats 
    133133      ! 
    134       wb(:,:,:) = wn(:,:,:)         ! set wb for computation of floats trajectories at the first time step 
     134      ww(:,:,:,jtb) = ww(:,:,:,jtn)         ! set wb for computation of floats trajectories at the first time step 
    135135      ! 
    136136   END SUBROUTINE flo_init 
    137137 
Index: TEST_FILES/sbcfwb.F90
==============================

So far so good….

Since the preview step must be completed before the PI starts the coding, the previewer(s) answers are expected to be completed within the two weeks after the PI has sent his request.
For each question, an iterative process should take place between PI and previewer(s) in order to reach a "YES" answer for each of the following questions.

Questions Answer Comment
Does the previewer agree with the proposed methodology?
Does the previewer agree with the proposed flowchart and list of routines to be changed?
Does the previewer agree with the proposed new list of variables, including agreement with coding rules?
Does the previewer agree with the proposed summary of updates in reference manual?
… … …

Updated on 07/16/2020 16:03:48 by anonymous

Once all "YES" have been reached, the PI can start the development into his development branch.

Tests

Once the development is done, the PI should complete this section below and ask the reviewers to start their review in the lower section.

Questions Answer Comment
Can this change be shown to produce expected impact? (if option activated)?
Can this change be shown to have a null impact? (if option not activated)
Detailed results of restartability and reproducibility when the option is activated. Please indicate the configuration used for this test
Detailed results of SETTE tests (restartability and reproducibility for each of the reference configuration)
Results of the required bit comparability tests been run: Are there no differences when activating the development?
If some differences appear, is reason for the change valid/understood?
If some differences appear, is the !ticket describing in detail the impact this change will have on model configurations?
Is this change expected to preserve all diagnostics?
If no, is reason for the change valid/understood?
Are there significant changes in run time/memory?
… … …

Updated on 12/03/2019 16:40:57 by davestorkey

Review

A successful review is needed to schedule the merge of this development into the future NEMO release during next Merge Party (usually in November).

Code changes and documentation

Question Answer Comment
Is the proposed methodology now implemented?
Are the code changes in agreement with the flowchart defined at Preview step?
Are the code changes in agreement with list of routines and variables as proposed at Preview step?
If not, are the discrepancies acceptable?
Is the in-line documentation accurate and sufficient?
Do the code changes comply with NEMO coding standards?
Is the !ticket of development documented with sufficient details for others to understand the impact of the change?
Are the reference manual tex files now updated following the proposed summary in preview section?
Is there a need for some documentation on the web pages (in addition to in-line and reference manual)?
If yes, please describe and ask PI. A yes answer must include all documentation available.
… … …

Review Summary

Is the review fully successful?

Updated on 07/16/2020 16:03:48 by anonymous

Once review is successful, the development must be scheduled for merge during next Merge Party Meeting.

Attachments (1)

Download all attachments as: .zip