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.
Changeset 12489 for NEMO/trunk/src/OCE/TRA/traatf.F90 – NEMO

Ignore:
Timestamp:
2020-02-28T16:55:11+01:00 (4 years ago)
Author:
davestorkey
Message:

Preparation for new timestepping scheme #2390.
Main changes:

  1. Initial euler timestep now handled in stp and not in TRA/DYN routines.
  2. Renaming of all timestep parameters. In summary, the namelist parameter is now rn_Dt and the current timestep is rDt (and rDt_ice, rDt_trc etc).
  3. Renaming of a few miscellaneous parameters, eg. atfp -> rn_atfp (namelist parameter used everywhere) and rau0 -> rho0.

This version gives bit-comparable results to the previous version of the trunk.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/trunk/src/OCE/TRA/traatf.F90

    r12377 r12489  
    113113      IF( ln_bdy )   CALL bdy_tra( kt, Kbb, pts, Kaa )  ! BDY open boundaries 
    114114  
    115       ! set time step size (Euler/Leapfrog) 
    116       IF( neuler == 0 .AND. kt == nit000 ) THEN   ;   r2dt =        rdt   ! at nit000             (Euler) 
    117       ELSEIF( kt <= nit000 + 1 )           THEN   ;   r2dt = 2._wp* rdt   ! at nit000 or nit000+1 (Leapfrog) 
    118       ENDIF 
    119  
    120115      ! trends computation initialisation 
    121116      IF( l_trdtra )   THEN                     
     
    128123         ENDIF 
    129124         ! total trend for the non-time-filtered variables.  
    130          zfact = 1.0 / rdt 
     125         zfact = 1.0 / rn_Dt 
    131126         ! G Nurser 23 Mar 2017. Recalculate trend as Delta(e3t*T)/e3tn; e3tn cancel from pts(Kmm) terms 
    132127         DO jk = 1, jpkm1 
     
    144139      ENDIF 
    145140 
    146       IF( neuler == 0 .AND. kt == nit000 ) THEN       ! Euler time-stepping  
     141      IF( l_1st_euler ) THEN       ! Euler time-stepping  
    147142         ! 
    148143         IF (l_trdtra .AND. .NOT. ln_linssh ) THEN   ! Zero Asselin filter contribution must be explicitly written out since for vvl 
     
    156151      ELSE                                            ! Leap-Frog + Asselin filter time stepping 
    157152         ! 
    158          IF( ln_linssh ) THEN   ;   CALL tra_atf_fix( kt, Kbb, Kmm, Kaa, nit000,      'TRA', pts, jpts )  ! linear free surface  
    159          ELSE                   ;   CALL tra_atf_vvl( kt, Kbb, Kmm, Kaa, nit000, rdt, 'TRA', pts, sbc_tsc, sbc_tsc_b, jpts )  ! non-linear free surface 
     153         IF( ln_linssh ) THEN   ;   CALL tra_atf_fix( kt, Kbb, Kmm, Kaa, nit000,        'TRA', pts, jpts )  ! linear free surface  
     154         ELSE                   ;   CALL tra_atf_vvl( kt, Kbb, Kmm, Kaa, nit000, rn_Dt, 'TRA', pts, sbc_tsc, sbc_tsc_b, jpts )  ! non-linear free surface 
    160155         ENDIF 
    161156         ! 
     
    167162      ! 
    168163      IF( l_trdtra .AND. ln_linssh ) THEN      ! trend of the Asselin filter (tb filtered - tb)/dt      
    169          zfact = 1._wp / r2dt              
     164         zfact = 1._wp / rDt              
    170165         DO jk = 1, jpkm1 
    171166            ztrdt(:,:,jk) = ( pts(:,:,jk,jp_tem,Kmm) - ztrdt(:,:,jk) ) * zfact 
     
    219214            ztd = pt(ji,jj,jk,jn,Kaa) - 2._wp * ztn + pt(ji,jj,jk,jn,Kbb)  ! time laplacian on tracers 
    220215            ! 
    221             pt(ji,jj,jk,jn,Kmm) = ztn + atfp * ztd                      ! pt <-- filtered pt 
     216            pt(ji,jj,jk,jn,Kmm) = ztn + rn_atfp * ztd                      ! pt <-- filtered pt 
    222217         END_3D 
    223218         ! 
     
    234229      !!  
    235230      !! ** Method  : - Apply a thickness weighted Asselin time filter on now fields. 
    236       !!             pt(Kmm)  = ( e3t(Kmm)*pt(Kmm) + atfp*[ e3t(Kbb)*pt(Kbb) - 2 e3t(Kmm)*pt(Kmm) + e3t_a*pt(Kaa) ] ) 
    237       !!                       /( e3t(Kmm)         + atfp*[ e3t(Kbb)         - 2 e3t(Kmm)         + e3t(Kaa)    ] ) 
     231      !!             pt(Kmm)  = ( e3t(Kmm)*pt(Kmm) + rn_atfp*[ e3t(Kbb)*pt(Kbb) - 2 e3t(Kmm)*pt(Kmm) + e3t_a*pt(Kaa) ] ) 
     232      !!                       /( e3t(Kmm)         + rn_atfp*[ e3t(Kbb)         - 2 e3t(Kmm)         + e3t(Kaa)    ] ) 
    238233      !! 
    239234      !! ** Action  : - pt(Kmm) ready for the next time step 
     
    277272      ENDIF 
    278273      zfact = 1._wp / p2dt 
    279       zfact1 = atfp * p2dt 
    280       zfact2 = zfact1 * r1_rau0 
     274      zfact1 = rn_atfp * p2dt 
     275      zfact2 = zfact1 * r1_rho0 
    281276      DO jn = 1, kjpt       
    282277         DO_3D_00_00( 1, jpkm1 ) 
     
    292287            ztc_d  = ztc_a  - 2. * ztc_n  + ztc_b 
    293288            ! 
    294             ze3t_f = ze3t_n + atfp * ze3t_d 
    295             ztc_f  = ztc_n  + atfp * ztc_d 
     289            ze3t_f = ze3t_n + rn_atfp * ze3t_d 
     290            ztc_f  = ztc_n  + rn_atfp * ztc_d 
    296291            ! 
    297292            ! Add asselin correction on scale factors: 
Note: See TracChangeset for help on using the changeset viewer.