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 14179 for NEMO/trunk/src – NEMO

Changeset 14179 for NEMO/trunk/src


Ignore:
Timestamp:
2020-12-15T23:17:09+01:00 (3 years ago)
Author:
techene
Message:

#2385 restart with qco bug fix for euler 1st and RK3

Location:
NEMO/trunk/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • NEMO/trunk/src/OCE/DIA/diawri.F90

    r14143 r14179  
    215215      ENDIF 
    216216 
    217       CALL iom_put( "rhop", rhop(:,:,:) )          ! 3D potential density (sigma0) 
     217      IF( .NOT.lk_SWE )   CALL iom_put( "rhop", rhop(:,:,:) )          ! 3D potential density (sigma0) 
    218218 
    219219      IF ( iom_use("taubot") ) THEN                ! bottom stress 
  • NEMO/trunk/src/OCE/DOM/domqco.F90

    r14053 r14179  
    116116      !                    !== Set of all other vertical scale factors  ==!  (now and before) 
    117117      !                                ! Horizontal interpolation of e3t 
     118#if defined key_RK3 
     119      CALL dom_qco_r3c( ssh(:,:,Kbb), r3t(:,:,Kbb), r3u(:,:,Kbb), r3v(:,:,Kbb), r3f(:,:) ) 
     120      CALL dom_qco_r3c( ssh(:,:,Kmm), r3t(:,:,Kmm), r3u(:,:,Kmm), r3v(:,:,Kmm)           ) 
     121#else 
    118122      CALL dom_qco_r3c( ssh(:,:,Kbb), r3t(:,:,Kbb), r3u(:,:,Kbb), r3v(:,:,Kbb)           ) 
    119123      CALL dom_qco_r3c( ssh(:,:,Kmm), r3t(:,:,Kmm), r3u(:,:,Kmm), r3v(:,:,Kmm), r3f(:,:) ) 
     124#endif 
    120125      ! 
    121126   END SUBROUTINE dom_qco_zgr 
  • NEMO/trunk/src/OCE/IOM/restart.F90

    r14145 r14179  
    4747   !! * Substitutions 
    4848#  include "do_loop_substitute.h90" 
     49#  include "domzgr_substitute.h90" 
    4950   !!---------------------------------------------------------------------- 
    5051   !! NEMO/OCE 4.0 , NEMO Consortium (2018) 
     
    169170         ENDIF 
    170171         ! 
     172#if ! defined key_RK3 
    171173         CALL iom_rstput( kt, nitrst, numrow, 'sshn'   , ssh(:,:        ,Kmm) )     ! now fields 
    172174         CALL iom_rstput( kt, nitrst, numrow, 'un'     , uu(:,:,:       ,Kmm) ) 
     
    177179            CALL iom_rstput( kt, nitrst, numrow, 'rhop', rhop                 ) 
    178180         ENDIF 
     181#endif 
    179182      ENDIF 
    180183 
     
    264267      INTEGER  ::   jk 
    265268      REAL(wp), DIMENSION(jpi, jpj, jpk) :: w3d 
     269      REAL(wp), ALLOCATABLE, DIMENSION(:,:,:)   :: zgdept       ! 3D workspace for QCO 
    266270      !!---------------------------------------------------------------------- 
    267271      ! 
     
    279283      ENDIF 
    280284      ! 
    281       !                             !*  Read Kmm fields 
     285#if defined key_RK3 
     286      !                             !*  Read Kbb fields   (NB: in RK3 Kmm = Kbb = Nbb) 
     287      IF(lwp) WRITE(numout,*) '           Kbb u, v and T-S fields read in the restart file' 
     288      CALL iom_get( numror, jpdom_auto, 'ub'   , uu(:,:,:       ,Kbb), cd_type = 'U', psgn = -1._wp ) 
     289      CALL iom_get( numror, jpdom_auto, 'vb'   , vv(:,:,:       ,Kbb), cd_type = 'V', psgn = -1._wp ) 
     290      IF( .NOT.lk_SWE ) THEN 
     291         CALL iom_get( numror, jpdom_auto, 'tb', ts(:,:,:,jp_tem,Kbb) ) 
     292         CALL iom_get( numror, jpdom_auto, 'sb', ts(:,:,:,jp_sal,Kbb) ) 
     293      ENDIF 
     294#else 
     295      !                             !*  Read Kmm fields   (MLF only) 
    282296      IF(lwp) WRITE(numout,*)    '           Kmm u, v and T-S fields read in the restart file' 
    283297      CALL iom_get( numror, jpdom_auto, 'un'   , uu(:,:,:       ,Kmm), cd_type = 'U', psgn = -1._wp ) 
     
    288302      ENDIF 
    289303      ! 
    290       IF( l_1st_euler ) THEN        !*  Euler restart 
     304      IF( l_1st_euler ) THEN        !*  Euler restart   (MLF only) 
    291305         IF(lwp) WRITE(numout,*) '           Kbb u, v and T-S fields set to Kmm values' 
    292306         uu(:,:,:  ,Kbb) = uu(:,:,:  ,Kmm)         ! all before fields set to now values 
     
    294308         IF( .NOT.lk_SWE ) ts(:,:,:,:,Kbb) = ts(:,:,:,:,Kmm) 
    295309         ! 
    296       ELSE                          !* Leap frog restart 
     310      ELSE                          !* Leap frog restart   (MLF only) 
    297311         IF(lwp) WRITE(numout,*) '           Kbb u, v and T-S fields read in the restart file' 
    298312         CALL iom_get( numror, jpdom_auto, 'ub'   , uu(:,:,:       ,Kbb), cd_type = 'U', psgn = -1._wp ) 
     
    303317         ENDIF 
    304318      ENDIF 
     319#endif 
    305320      ! 
    306321      IF( .NOT.lk_SWE ) THEN 
     
    308323            CALL iom_get( numror, jpdom_auto, 'rhop'   , rhop )   ! now    potential density 
    309324         ELSE 
     325#if defined key_qco 
     326            ALLOCATE( zgdept(jpi,jpj,jpk) ) 
     327            DO jk = 1, jpk 
     328               zgdept(:,:,jk) = gdept(:,:,jk,Kmm) 
     329            END DO 
     330            CALL eos( ts(:,:,:,:,Kmm), rhd, rhop, zgdept ) 
     331            DEALLOCATE( zgdept ) 
     332#else 
    310333            CALL eos( ts(:,:,:,:,Kmm), rhd, rhop, gdept(:,:,:,Kmm) ) 
     334#endif 
    311335         ENDIF 
    312336      ENDIF 
     
    347371         !                         !=============================! 
    348372         ! 
    349          !                                     !*  Read ssh at Kmm 
     373#if defined key_RK3 
     374         !                                     !*  RK3: Read ssh at Kbb 
     375         IF(lwp) WRITE(numout,*) 
     376         IF(lwp) WRITE(numout,*)    '      Kbb sea surface height read in the restart file' 
     377         CALL iom_get( numror, jpdom_auto, 'sshb'   , ssh(:,:,Kbb) ) 
     378         ! 
     379         !                                     !*  RK3: Set ssh at Kmm for AGRIF 
     380         ssh(:,:,Kmm) = 0._wp 
     381#else 
     382         !                                     !*  MLF: Read ssh at Kmm 
    350383         IF(lwp) WRITE(numout,*) 
    351384         IF(lwp) WRITE(numout,*)    '      Kmm sea surface height read in the restart file' 
    352385         CALL iom_get( numror, jpdom_auto, 'sshn'   , ssh(:,:,Kmm) ) 
    353386         ! 
    354          IF( l_1st_euler ) THEN                !* Euler at first time-step 
     387         IF( l_1st_euler ) THEN                !*  MLF: Euler at first time-step 
    355388            IF(lwp) WRITE(numout,*) 
    356389            IF(lwp) WRITE(numout,*) '      Euler first time step : ssh(Kbb) = ssh(Kmm)' 
    357390            ssh(:,:,Kbb) = ssh(:,:,Kmm) 
    358391            ! 
    359          ELSE                                  !* read ssh at Kbb 
     392         ELSE                                  !*  MLF: read ssh at Kbb 
    360393            IF(lwp) WRITE(numout,*) 
    361394            IF(lwp) WRITE(numout,*) '      Kbb sea surface height read in the restart file' 
    362395            CALL iom_get( numror, jpdom_auto, 'sshb', ssh(:,:,Kbb) ) 
    363396         ENDIF 
     397#endif 
    364398         !                         !============================! 
    365399      ELSE                         !==  Initialize at "rest"  ==! 
     
    390424         ENDIF 
    391425         ! 
    392          ssh(:,:,Kmm) = ssh(:,:,Kbb)           !* set now values from to before ones  
     426#if defined key_RK3 
     427         ssh(:,:,Kmm) = 0._wp                  !* RK3: set Kmm to 0 for AGRIF 
     428#else 
     429         ssh(:,:,Kmm) = ssh(:,:,Kbb)           !* MLF: set now values from to before ones  
     430#endif 
    393431      ENDIF 
    394432      ! 
    395433      !                            !==========================! 
    396       ssh(:,:,Kaa) = 0._wp         !==  Set to 0 for agrif  ==! 
     434      ssh(:,:,Kaa) = 0._wp         !==  Set to 0 for AGRIF  ==! 
    397435      !                            !==========================! 
    398436      ! 
  • NEMO/trunk/src/SWE/stprk3.F90

    r14143 r14179  
    129129      CALL dyn_ldf( kstp, Nbb, Nbb, uu, vv, Nrhs )  ! lateral mixing 
    130130#endif 
    131 !!st       ! 
    132 !!st       DO_3D( 0,0, 0,0, 1,jpkm1 ) 
    133 !!st          !                                          ! horizontal pressure gradient 
    134 !!st          uu(ji,jj,jk,Nrhs) = uu(ji,jj,jk,Nrhs) - grav * ( ssh(ji+1,jj,Nbb) - ssh(ji,jj,Nbb) ) * r1_e1u(ji,jj) 
    135 !!st          vv(ji,jj,jk,Nrhs) = vv(ji,jj,jk,Nrhs) - grav * ( ssh(ji,jj+1,Nbb) - ssh(ji,jj,Nbb) ) * r1_e2v(ji,jj) 
    136 !!st       END_3D 
    137 !!st       ! 
    138 !!st #if defined key_RK3all  
    139 !!st       !                                             ! wind stress and layer friction 
    140 !!st       z5_6 = 5._wp/6._wp 
    141 !!st       DO_3D( 0, 0, 0, 0,1,jpkm1) 
    142 !!st          uu(ji,jj,jk,Nrhs) = uu(ji,jj,jk,Nrhs) + r1_rho0 * ( z5_6*utau_b(ji,jj) + (1._wp - z5_6)*utau(ji,jj) ) / e3u(ji,jj,jk,Nbb)   & 
    143 !!st             &                                  - rn_rfr * uu(ji,jj,jk,Nbb) 
    144 !!st          vv(ji,jj,jk,Nrhs) = vv(ji,jj,jk,Nrhs) + r1_rho0 * ( z5_6*vtau_b(ji,jj) + (1._wp - z5_6)*vtau(ji,jj) ) / e3v(ji,jj,jk,Nbb)   & 
    145 !!st             &                                  - rn_rfr * vv(ji,jj,jk,Nbb) 
    146 !!st       END_3D 
    147 !!st #endif 
    148 !!st why not ? 
    149131      z5_6 = 5._wp/6._wp 
    150132      DO_3D( 0, 0, 0, 0, 1, jpkm1 ) 
     
    163145         vv(ji,jj,jk,Nrhs) = vv(ji,jj,jk,Nrhs) + zrhs_v 
    164146      END_3D 
    165 !!st end 
    166147      ! 
    167148      !                                 !==  Time stepping of ssh Eq.  ==!   (and update r3_Naa) 
     
    229210         vv(ji,jj,jk,Nrhs) = vv(ji,jj,jk,Nrhs) + zrhs_v 
    230211      END_3D 
    231 !!st       ! 
    232 !!st       DO_3D( 0, 0, 0, 0, 1, jpkm1 ) 
    233 !!st          !                                          ! horizontal pressure gradient 
    234 !!st          uu(ji,jj,jk,Nrhs) = uu(ji,jj,jk,Nrhs) - grav * ( ssh(ji+1,jj,Nnn) - ssh(ji,jj,Nnn) ) * r1_e1u(ji,jj) 
    235 !!st          vv(ji,jj,jk,Nrhs) = vv(ji,jj,jk,Nrhs) - grav * ( ssh(ji,jj+1,Nnn) - ssh(ji,jj,Nnn) ) * r1_e2v(ji,jj) 
    236 !!st       END_3D 
    237 !!st       ! 
    238 !!st #if defined key_RK3all 
    239 !!st       !                                             ! wind stress and layer friction 
    240 !!st       z3_4 = 3._wp/4._wp 
    241 !!st       DO_3D( 0, 0, 0, 0,1,jpkm1) 
    242 !!st          uu(ji,jj,jk,Nrhs) = uu(ji,jj,jk,Nrhs) + r1_rho0 * ( z3_4*utau_b(ji,jj) + (1._wp - z3_4)*utau(ji,jj) ) / e3u(ji,jj,jk,Nbb)   & 
    243 !!st             &                                  - rn_rfr * uu(ji,jj,jk,Nbb) 
    244 !!st          vv(ji,jj,jk,Nrhs) = vv(ji,jj,jk,Nrhs) + r1_rho0 * ( z3_4*vtau_b(ji,jj) + (1._wp - z3_4)*vtau(ji,jj) ) / e3v(ji,jj,jk,Nbb)   & 
    245 !!st             &                                  - rn_rfr * vv(ji,jj,jk,Nbb) 
    246 !!st       END_3D 
    247 !!st #endif 
    248212      ! 
    249213      !                                 !==  Time stepping of ssh Eq.  ==!   (and update r3_Naa) 
     
    344308 
    345309      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    346       ! diagnostics and outputs 
     310      ! diagnostics and outputs at Nbb (i.e. the just computed time step) 
    347311      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    348312       
    349       IF( ln_diacfl  )   CALL dia_cfl      ( kstp,      Nnn )      ! Courant number diagnostics 
    350                          CALL dia_wri      ( kstp,      Nnn )      ! ocean model: outputs 
    351       ! 
    352       IF( lrst_oce   )   CALL rst_write    ( kstp, Nbb, Nnn )   ! write output ocean restart file 
     313      IF( ln_diacfl  )   CALL dia_cfl      ( kstp,      Nbb )      ! Courant number diagnostics 
     314                         CALL dia_wri      ( kstp,      Nbb )      ! ocean model: outputs 
     315      ! 
     316      IF( lrst_oce   )   CALL rst_write    ( kstp, Nbb, Nbb )   ! write output ocean restart file 
    353317 
    354318      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    355319      ! Control 
    356320      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    357                          CALL stp_ctl_SWE  ( kstp     , Nnn ) 
     321                         CALL stp_ctl_SWE  ( kstp     , Nbb ) 
    358322 
    359323      IF( kstp == nit000 ) THEN                          ! 1st time step only 
Note: See TracChangeset for help on using the changeset viewer.