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 15630 for NEMO/branches/2021 – NEMO

Changeset 15630 for NEMO/branches/2021


Ignore:
Timestamp:
2022-01-05T19:02:55+01:00 (2 years ago)
Author:
techene
Message:

#2605 correct r3f bug in RK3

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2021/dev_r14318_RK3_stage1/src/OCE/stprk3_stg.F90

    r15627 r15630  
    128128            ALLOCATE( r3ta(jpi,jpj) , r3ua(jpi,jpj) , r3va(jpi,jpj) , r3fa(jpi,jpj) , r3fb(jpi,jpj) ) 
    129129            ! 
    130             r3fb(:,:) = r3f(:,:)       !!st dirty fix check with gm 
     130            r3fb(:,:) = r3f(:,:) 
    131131            CALL dom_qco_r3c_RK3( ssha, r3ta, r3ua, r3va, r3fa ) 
    132132            ! 
    133133            CALL lbc_lnk( 'stprk3_stg', r3ua, 'U', 1._wp, r3va, 'V', 1._wp, r3fa, 'F', 1._wp ) 
    134134            ! 
    135             r3t(:,:,Kaa) = r2_3 * r3t(:,:,Kbb) + r1_3 * r3ta(:,:) 
     135            r3t(:,:,Kaa) = r2_3 * r3t(:,:,Kbb) + r1_3 * r3ta(:,:)   ! at N+1/3 (Kaa) 
    136136            r3u(:,:,Kaa) = r2_3 * r3u(:,:,Kbb) + r1_3 * r3ua(:,:) 
    137137            r3v(:,:,Kaa) = r2_3 * r3v(:,:,Kbb) + r1_3 * r3va(:,:) 
    138             r3f(:,:) = r2_3 * r3fb(:,:) + r1_3 * r3fa(:,:) 
     138            ! r3f = r3f(Kbb=Kmm)                                    ! at N     (Kmm) 
    139139         ENDIF 
    140140         ! 
     
    152152         ! 
    153153         IF( .NOT.lk_linssh ) THEN 
    154             r3t(:,:,Kaa) = r1_2 * ( r3t(:,:,Kbb) + r3ta(:,:) ) 
     154            r3t(:,:,Kaa) = r1_2 * ( r3t(:,:,Kbb) + r3ta(:,:) )   ! at N+1/2 (Kaa) 
    155155            r3u(:,:,Kaa) = r1_2 * ( r3u(:,:,Kbb) + r3ua(:,:) ) 
    156156            r3v(:,:,Kaa) = r1_2 * ( r3v(:,:,Kbb) + r3va(:,:) ) 
    157             r3f(:,:) = r1_2 * ( r3fb(:,:) + r3fa(:,:) ) 
     157            r3f(:,:)     = r2_3 * r3fb(:,:) + r1_3 * r3fa(:,:)   ! at N+1/3 (Kmm) 
    158158         ENDIF 
    159159         ! 
     
    172172         ! 
    173173         IF( .NOT.lk_linssh ) THEN 
    174             r3t(:,:,Kaa) = r3ta(:,:) 
     174            r3t(:,:,Kaa) = r3ta(:,:)                          ! at N+1   (Kaa) 
    175175            r3u(:,:,Kaa) = r3ua(:,:) 
    176176            r3v(:,:,Kaa) = r3va(:,:) 
    177             r3f(:,:    ) = r3fa(:,:) 
    178             DEALLOCATE( r3ta, r3ua, r3va, r3fa, r3fb ) 
     177            r3f(:,:)     = r1_2 * ( r3fb(:,:) + r3fa(:,:) )   ! at N+1/2 (Kmm) 
     178            DEALLOCATE( r3ta, r3ua, r3va, r3fb )              ! deallocate all r3. except r3fa which will be 
     179            !                                                 ! saved in r3f at the end of the time integration and then deallocated 
    179180            ! 
    180181         ENDIF 
     
    419420         IF( ln_zdfnpc  )   CALL tra_npc( kstp,      Kmm, Krhs, ts    , Kaa  )  ! update after fields by non-penetrative convection 
    420421         ! 
     422         r3f(:,:) = r3fa(:,:)                                         ! save r3fa in r3f before deallocation 
     423         DEALLOCATE( r3fa )                                           ! (r3f = r3f(Kbb) of the next time step)  
     424         ! 
    421425      END SELECT       
    422426      !                                         !==  correction of the barotropic (all stages)  ==!    at Kaa = N+1/3, N+1/2 or N+1 
Note: See TracChangeset for help on using the changeset viewer.