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/TOP/TRP – 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.

Location:
NEMO/trunk/src/TOP/TRP
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • NEMO/trunk/src/TOP/TRP/trcadv.F90

    r12377 r12489  
    125125         CALL tra_adv_cen( kt, nittrc000,'TRC',          zuu, zvv, zww,      Kmm, ptr, jptra, Krhs, nn_cen_h, nn_cen_v ) 
    126126      CASE ( np_FCT )                                 ! FCT      : 2nd / 4th order 
    127          CALL tra_adv_fct( kt, nittrc000,'TRC', r2dttrc, zuu, zvv, zww, Kbb, Kmm, ptr, jptra, Krhs, nn_fct_h, nn_fct_v ) 
     127         CALL tra_adv_fct( kt, nittrc000,'TRC', rDt_trc, zuu, zvv, zww, Kbb, Kmm, ptr, jptra, Krhs, nn_fct_h, nn_fct_v ) 
    128128      CASE ( np_MUS )                                 ! MUSCL 
    129          CALL tra_adv_mus( kt, nittrc000,'TRC', r2dttrc, zuu, zvv, zww, Kbb, Kmm, ptr, jptra, Krhs, ln_mus_ups         )  
     129         CALL tra_adv_mus( kt, nittrc000,'TRC', rDt_trc, zuu, zvv, zww, Kbb, Kmm, ptr, jptra, Krhs, ln_mus_ups         )  
    130130      CASE ( np_UBS )                                 ! UBS 
    131          CALL tra_adv_ubs( kt, nittrc000,'TRC', r2dttrc, zuu, zvv, zww, Kbb, Kmm, ptr, jptra, Krhs, nn_ubs_v           ) 
     131         CALL tra_adv_ubs( kt, nittrc000,'TRC', rDt_trc, zuu, zvv, zww, Kbb, Kmm, ptr, jptra, Krhs, nn_ubs_v           ) 
    132132      CASE ( np_QCK )                                 ! QUICKEST 
    133          CALL tra_adv_qck( kt, nittrc000,'TRC', r2dttrc, zuu, zvv, zww, Kbb, Kmm, ptr, jptra, Krhs                     ) 
     133         CALL tra_adv_qck( kt, nittrc000,'TRC', rDt_trc, zuu, zvv, zww, Kbb, Kmm, ptr, jptra, Krhs                     ) 
    134134      ! 
    135135      END SELECT 
  • NEMO/trunk/src/TOP/TRP/trcatf.F90

    r12377 r12489  
    7171      !!      the divergence of two consecutive time-steps and tr arrays 
    7272      !!      to prepare the next time_step: 
    73       !!         (tr(Kmm)) = (tr(Kmm)) + atfp [ (tr(Kbb)) + (tr(Kaa)) - 2 (tr(Kmm)) ] 
     73      !!         (tr(Kmm)) = (tr(Kmm)) + rn_atfp [ (tr(Kbb)) + (tr(Kaa)) - 2 (tr(Kmm)) ] 
    7474      !! 
    7575      !! 
     
    111111 
    112112         ! total trend for the non-time-filtered variables.  
    113          zfact = 1.0 / rdttrc 
     113         zfact = 1.0 / rn_Dt 
    114114         ! G Nurser 23 Mar 2017. Recalculate trend as Delta(e3t*T)/e3tn; e3tn cancel from ts(Kmm) terms 
    115115         IF( ln_linssh ) THEN       ! linear sea surface height only 
     
    139139      ENDIF 
    140140      !                                ! Leap-Frog + Asselin filter time stepping 
    141       IF( (neuler == 0 .AND. kt == nittrc000) .OR. ln_top_euler ) THEN    ! Euler time-stepping  
     141      IF( l_1st_euler .OR. ln_top_euler ) THEN    ! Euler time-stepping  
    142142         ! 
    143143         IF (l_trdtrc .AND. .NOT. ln_linssh ) THEN   ! Zero Asselin filter contribution must be explicitly written out since for vvl 
     
    152152         IF( .NOT. l_offline ) THEN ! Leap-Frog + Asselin filter time stepping 
    153153            IF( ln_linssh ) THEN   ;   CALL tra_atf_fix( kt, Kbb, Kmm, Kaa, nittrc000,         'TRC', ptr, jptra )                     !     linear ssh 
    154             ELSE                   ;   CALL tra_atf_vvl( kt, Kbb, Kmm, Kaa, nittrc000, rdttrc, 'TRC', ptr, sbc_trc, sbc_trc_b, jptra ) ! non-linear ssh 
     154            ELSE                   ;   CALL tra_atf_vvl( kt, Kbb, Kmm, Kaa, nittrc000, rn_Dt, 'TRC', ptr, sbc_trc, sbc_trc_b, jptra ) ! non-linear ssh 
    155155            ENDIF 
    156156         ELSE 
     
    164164         DO jn = 1, jptra 
    165165            DO jk = 1, jpkm1 
    166                zfact = 1._wp / r2dttrc   
     166               zfact = 1._wp / rDt_trc   
    167167               ztrdt(:,:,jk,jn) = ( ptr(:,:,jk,jn,Kbb) - ztrdt(:,:,jk,jn) ) * zfact  
    168168            END DO 
     
    200200      !!                  /( e3t(:,:,:,Kmm)    + rbcp*[ e3t(:,:,:,Kbb)    - 2 e3t(:,:,:,Kmm)    + e3t(:,:,:,Kaa)    ] )    
    201201      !!             ztm = 0                                                       otherwise 
    202       !!             tb  = ( e3t_n*tn + atfp*[ e3t_b*tb - 2 e3t_n*tn + e3t_a*ta ] ) 
    203       !!                  /( e3t(:,:,:,Kmm)    + atfp*[ e3t(:,:,:,Kbb)    - 2 e3t(:,:,:,Kmm)    + e3t(:,:,:,Kaa)    ] ) 
     202      !!             tb  = ( e3t_n*tn + rn_atfp*[ e3t_b*tb - 2 e3t_n*tn + e3t_a*ta ] ) 
     203      !!                  /( e3t(:,:,:,Kmm)    + rn_atfp*[ e3t(:,:,:,Kbb)    - 2 e3t(:,:,:,Kmm)    + e3t(:,:,:,Kaa)    ] ) 
    204204      !!             tn  = ta  
    205205      !!             ta  = zt        (NB: reset to 0 after eos_bn2 call) 
     
    222222         IF(lwp) WRITE(numout,*) '~~~~~~~~~~~' 
    223223         IF( .NOT. ln_linssh ) THEN 
    224             rfact1 = atfp * rdttrc 
    225             rfact2 = rfact1 / rau0 
     224            rfact1 = rn_atfp * rn_Dt 
     225            rfact2 = rfact1 / rho0 
    226226         ENDIF 
    227227        !   
     
    241241            ztc_d  = ztc_a  - 2. * ztc_n  + ztc_b 
    242242            ! 
    243             ze3t_f = ze3t_n + atfp * ze3t_d 
    244             ztc_f  = ztc_n  + atfp * ztc_d 
     243            ze3t_f = ze3t_n + rn_atfp * ze3t_d 
     244            ztc_f  = ztc_n  + rn_atfp * ztc_d 
    245245            ! 
    246246            IF( .NOT. ln_linssh .AND. jk == mikt(ji,jj) ) THEN           ! first level  
  • NEMO/trunk/src/TOP/TRP/trcrad.F90

    r12377 r12489  
    147147     ! 
    148148     IF( l_trdtrc )   ALLOCATE( ztrtrd(jpi,jpj,jpk) ) 
    149      zs2rdt = 1. / ( 2. * rdt ) 
     149     zs2rdt = 1. / ( 2. * rn_Dt ) 
    150150     ! 
    151151     DO jt = 1,2  ! Loop over time indices since exactly the same fix is applied to "now" and "after" fields 
  • NEMO/trunk/src/TOP/TRP/trcsbc.F90

    r12377 r12489  
    121121         DO jn = 1, jptra 
    122122            DO_2D_01_00 
    123                sbc_trc(ji,jj,jn) = zsfx(ji,jj) * r1_rau0 * ptr(ji,jj,1,jn,Kmm) 
     123               sbc_trc(ji,jj,jn) = zsfx(ji,jj) * r1_rho0 * ptr(ji,jj,1,jn,Kmm) 
    124124            END_2D 
    125125         END DO 
     
    129129         DO jn = 1, jptra 
    130130            DO_2D_01_00 
    131                sbc_trc(ji,jj,jn) = ( zsfx(ji,jj) + fmmflx(ji,jj) ) * r1_rau0 * ptr(ji,jj,1,jn,Kmm) 
     131               sbc_trc(ji,jj,jn) = ( zsfx(ji,jj) + fmmflx(ji,jj) ) * r1_rho0 * ptr(ji,jj,1,jn,Kmm) 
    132132            END_2D 
    133133         END DO 
     
    145145               ztfx  = zftra                        ! net tracer flux 
    146146               ! 
    147                zdtra = r1_rau0 * ( ztfx + ( zsfx(ji,jj) + fmmflx(ji,jj) ) * ptr(ji,jj,1,jn,Kmm) )  
     147               zdtra = r1_rho0 * ( ztfx + ( zsfx(ji,jj) + fmmflx(ji,jj) ) * ptr(ji,jj,1,jn,Kmm) )  
    148148               IF ( zdtra < 0. ) THEN 
    149                   zdtra  = MAX(zdtra, -ptr(ji,jj,1,jn,Kmm) * e3t(ji,jj,1,Kmm) / r2dttrc )   ! avoid negative concentrations to arise 
     149                  zdtra  = MAX(zdtra, -ptr(ji,jj,1,jn,Kmm) * e3t(ji,jj,1,Kmm) / rDt_trc )   ! avoid negative concentrations to arise 
    150150               ENDIF 
    151151               sbc_trc(ji,jj,jn) =  zdtra  
  • NEMO/trunk/src/TOP/TRP/trczdf.F90

    r12377 r12489  
    5656      IF( l_trdtrc )   ztrtrd(:,:,:,:)  = ptr(:,:,:,:,Krhs) 
    5757      ! 
    58       CALL tra_zdf_imp( kt, nittrc000, 'TRC', r2dttrc, Kbb, Kmm, Krhs, ptr, Kaa, jptra )    !   implicit scheme           
     58      CALL tra_zdf_imp( kt, nittrc000, 'TRC', rDt_trc, Kbb, Kmm, Krhs, ptr, Kaa, jptra )    !   implicit scheme           
    5959      ! 
    6060      IF( l_trdtrc )   THEN                      ! save the vertical diffusive trends for further diagnostics 
    6161         DO jn = 1, jptra 
    6262            DO jk = 1, jpkm1 
    63                ztrtrd(:,:,jk,jn) = ( ( ptr(:,:,jk,jn,Kaa) - ptr(:,:,jk,jn,Kbb) ) / r2dttrc ) - ztrtrd(:,:,jk,jn) 
     63               ztrtrd(:,:,jk,jn) = ( ( ptr(:,:,jk,jn,Kaa) - ptr(:,:,jk,jn,Kbb) ) / rDt_trc ) - ztrtrd(:,:,jk,jn) 
    6464            END DO 
    6565            CALL trd_tra( kt, Kmm, Krhs, 'TRC', jn, jptra_zdf, ztrtrd(:,:,:,jn) ) 
  • NEMO/trunk/src/TOP/TRP/trdmxl_trc.F90

    r12377 r12489  
    401401         DO jn = 1, jptra 
    402402            IF( ln_trdtrc(jn) ) THEN 
    403                !-- Compute total trends    (use rdttrc instead of rdt ???) 
     403               !-- Compute total trends  
    404404               IF ( ln_trcadv_muscl .OR. ln_trcadv_muscl2 ) THEN  ! EULER-FORWARD schemes 
    405                   ztmltot(:,:,jn) =  ( tml_trc(:,:,jn) - tmlbn_trc(:,:,jn) )/rdt 
     405                  ztmltot(:,:,jn) =  ( tml_trc(:,:,jn) - tmlbn_trc(:,:,jn) )/rn_Dt 
    406406               ELSE                                                                     ! LEAP-FROG schemes 
    407                   ztmltot(:,:,jn) =  ( tml_trc(:,:,jn) - tmlbn_trc(:,:,jn) + tmlb_trc(:,:,jn) - tmlbb_trc(:,:,jn))/(2.*rdt) 
     407                  ztmltot(:,:,jn) =  ( tml_trc(:,:,jn) - tmlbn_trc(:,:,jn) + tmlb_trc(:,:,jn) - tmlbb_trc(:,:,jn))/(2.*rn_Dt) 
    408408               ENDIF 
    409409                
     
    439439            IF( ln_trdtrc(jn) ) THEN 
    440440               tml_sum_trc(:,:,jn) = tmlbn_trc(:,:,jn) + 2 * ( tml_sum_trc(:,:,jn) - tml_trc(:,:,jn) ) + tml_trc(:,:,jn) 
    441                ztmltot2   (:,:,jn) = ( tml_sum_trc(:,:,jn) - tml_sumb_trc(:,:,jn) ) /  ( 2.*rdt )    ! now tracer unit is /sec 
     441               ztmltot2   (:,:,jn) = ( tml_sum_trc(:,:,jn) - tml_sumb_trc(:,:,jn) ) /  ( 2.*rn_Dt )    ! now tracer unit is /sec 
    442442            ENDIF 
    443443         END DO 
     
    852852         CALL ctl_stop( 'STOP', 'trd_mxl_trc : this was never checked. Comment this line to proceed...' ) 
    853853      ENDIF 
    854       zsto = nn_trd_trc * rdt 
     854      zsto = nn_trd_trc * rn_Dt 
    855855      clop = "inst("//TRIM(clop)//")" 
    856856#  else 
    857857      IF( ln_trdmxl_trc_instant ) THEN 
    858          zsto = rdt                                               ! inst. diags : we use IOIPSL time averaging 
     858         zsto = rn_Dt                                               ! inst. diags : we use IOIPSL time averaging 
    859859      ELSE 
    860          zsto = nn_trd_trc * rdt                                    ! mean  diags : we DO NOT use any IOIPSL time averaging 
     860         zsto = nn_trd_trc * rn_Dt                                    ! mean  diags : we DO NOT use any IOIPSL time averaging 
    861861      ENDIF 
    862862      clop = "ave("//TRIM(clop)//")" 
    863863#  endif 
    864       zout = nn_trd_trc * rdt 
     864      zout = nn_trd_trc * rn_Dt 
    865865      iiter = nittrc000 - 1 
    866866 
     
    869869      ! II.2 Compute julian date from starting date of the run 
    870870      ! ------------------------------------------------------ 
    871       CALL ymds2ju( nyear, nmonth, nday, rdt, zjulian ) 
     871      CALL ymds2ju( nyear, nmonth, nday, rn_Dt, zjulian ) 
    872872      zjulian = zjulian - adatrj   !   set calendar origin to the beginning of the experiment 
    873873      IF(lwp) WRITE(numout,*)' '   
     
    901901            CALL dia_nam( clhstnam, nn_trd_trc, csuff ) 
    902902            CALL histbeg( clhstnam, jpi, glamt, jpj, gphit,                                            & 
    903                &        1, jpi, 1, jpj, iiter, zjulian, rdt, nh_t(jn), nidtrd(jn), domain_id=nidom, snc4chunks=snc4set ) 
     903               &        1, jpi, 1, jpj, iiter, zjulian, rn_Dt, nh_t(jn), nidtrd(jn), domain_id=nidom, snc4chunks=snc4set ) 
    904904       
    905905            !-- Define the ML depth variable 
     
    938938               CALL histdef(nidtrd(jn), trim(clvar)//trim(ctrd_trc(jl,2)), clmxl//" "//clvar//ctrd_trc(jl,1),                      &  
    939939                 &    cltrcu, jpi, jpj, nh_t(jn), 1  , 1, 1  , -99 , 32, clop, zsto, zout ) ! IOIPSL: time mean 
    940             END DO                                                                         ! if zsto=rdt above 
     940            END DO                                                                         ! if zsto=rn_Dt above 
    941941          
    942942            CALL histdef(nidtrd(jn), trim(clvar)//trim(ctrd_trc(jpmxl_trc_radb,2)), clmxl//" "//clvar//ctrd_trc(jpmxl_trc_radb,1), &  
Note: See TracChangeset for help on using the changeset viewer.