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/OCE/IOM/restart.F90 – NEMO

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

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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      ! 
Note: See TracChangeset for help on using the changeset viewer.