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 14063 for NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/src/OCE/IOM/restart.F90 – NEMO

Ignore:
Timestamp:
2020-12-03T17:45:05+01:00 (4 years ago)
Author:
laurent
Message:

Catch up with trunk at r14060

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/src/OCE/IOM/restart.F90

    r14017 r14063  
    1111   !!            3.7  !  2014-01  (G. Madec) suppression of curl and hdiv from the restart 
    1212   !!             -   !  2014-12  (G. Madec) remove KPP scheme 
     13   !!            4.1  !  2020-11  (S. Techene, G. Madec)  move ssh initiatlisation in DYN/sshwzv:ssh_init_rst 
    1314   !!---------------------------------------------------------------------- 
    1415 
     
    139140      !! ** Method  :   Write in numrow when kt == nitrst in NetCDF 
    140141      !!              file, save fields which are necessary for restart 
     142      !! 
     143      !!                NB: ssh is written here (rst_write) 
     144      !!                    but is read or set in DYN/sshwzv:shh_init_rst 
    141145      !!---------------------------------------------------------------------- 
    142146      INTEGER, INTENT(in) ::   kt         ! ocean time-step 
     
    233237      !!                   ***  ROUTINE rst_read  *** 
    234238      !! 
    235       !! ** Purpose :   Read files for NetCDF restart 
    236       !! 
    237       !! ** Method  :   Read in restart.nc file fields which are necessary for restart 
     239      !! ** Purpose :   Read velocity and T-S fields in the restart file 
     240      !! 
     241      !! ** Method  :   Read in restart.nc fields which are necessary for restart 
     242      !! 
     243      !!                NB: restart file openned           in DOM/domain.F90:dom_init 
     244      !!                    before field in restart tested in DOM/domain.F90:dom_init 
     245      !!                    (sshb) 
     246      !! 
     247      !!                NB: ssh is read or set in DYN/sshwzv:shh_init_rst 
     248      !!                    but is written     in IOM/restart:rst_write 
    238249      !!---------------------------------------------------------------------- 
    239250      INTEGER, INTENT(in) ::   Kbb, Kmm   ! ocean time level indices 
    240       REAL(wp) ::   zrdt 
    241251      INTEGER  ::   jk 
    242252      REAL(wp), DIMENSION(jpi, jpj, jpk) :: w3d 
    243253      !!---------------------------------------------------------------------- 
    244  
    245       CALL rst_read_open           ! open restart for reading (if not already opened) 
    246  
    247       ! Check dynamics and tracer time-step consistency and force Euler restart if changed 
    248       IF( iom_varid( numror, 'rdt', ldstop = .FALSE. ) > 0 )   THEN 
    249          CALL iom_get( numror, 'rdt', zrdt ) 
    250          IF( zrdt /= rn_Dt ) THEN 
    251             IF(lwp) WRITE( numout,*) 
    252             IF(lwp) WRITE( numout,*) 'rst_read:  rdt not equal to the read one' 
    253             IF(lwp) WRITE( numout,*) 
    254             IF(lwp) WRITE( numout,*) '      ==>>>   forced euler first time-step' 
    255             l_1st_euler =  .TRUE. 
    256          ENDIF 
    257       ENDIF 
    258  
     254      ! 
    259255      IF(.NOT.lrxios ) CALL iom_delay_rst( 'READ', 'OCE', numror )   ! read only ocean delayed global communication variables 
    260  
    261       ! Diurnal DSST 
    262       IF( ln_diurnal ) CALL iom_get( numror, jpdom_auto, 'Dsst' , x_dsst ) 
     256      ! 
     257      !                             !*  Diurnal DSST 
     258      IF( ln_diurnal )   CALL iom_get( numror, jpdom_auto, 'Dsst' , x_dsst ) 
    263259      IF ( ln_diurnal_only ) THEN 
    264260         IF(lwp) WRITE( numout, * ) & 
     
    269265         RETURN 
    270266      ENDIF 
    271  
    272       IF( iom_varid( numror, 'ub', ldstop = .FALSE. ) > 0 ) THEN 
    273          ! before fields 
     267      ! 
     268      !                             !*  Read Kmm fields 
     269      IF(lwp) WRITE(numout,*)    '           Kmm u, v and T-S fields read in the restart file' 
     270      CALL iom_get( numror, jpdom_auto, 'un'     , uu(:,:,:       ,Kmm), cd_type = 'U', psgn = -1._wp ) 
     271      CALL iom_get( numror, jpdom_auto, 'vn'     , vv(:,:,:       ,Kmm), cd_type = 'V', psgn = -1._wp ) 
     272      CALL iom_get( numror, jpdom_auto, 'tn'     , ts(:,:,:,jp_tem,Kmm) ) 
     273      CALL iom_get( numror, jpdom_auto, 'sn'     , ts(:,:,:,jp_sal,Kmm) ) 
     274      ! 
     275      IF( l_1st_euler ) THEN        !*  Euler restart 
     276         IF(lwp) WRITE(numout,*) '           Kbb u, v and T-S fields set to Kmm values' 
     277         ts(:,:,:,:,Kbb) = ts(:,:,:,:,Kmm)         ! all before fields set to now values 
     278         uu(:,:,:  ,Kbb) = uu(:,:,:  ,Kmm) 
     279         vv(:,:,:  ,Kbb) = vv(:,:,:  ,Kmm) 
     280      ELSE                          !* Leap frog restart 
     281         IF(lwp) WRITE(numout,*) '           Kbb u, v and T-S fields read in the restart file' 
    274282         CALL iom_get( numror, jpdom_auto, 'ub'     , uu(:,:,:       ,Kbb), cd_type = 'U', psgn = -1._wp ) 
    275283         CALL iom_get( numror, jpdom_auto, 'vb'     , vv(:,:,:       ,Kbb), cd_type = 'V', psgn = -1._wp ) 
    276284         CALL iom_get( numror, jpdom_auto, 'tb'     , ts(:,:,:,jp_tem,Kbb) ) 
    277285         CALL iom_get( numror, jpdom_auto, 'sb'     , ts(:,:,:,jp_sal,Kbb) ) 
    278          CALL iom_get( numror, jpdom_auto, 'sshb'   ,ssh(:,:         ,Kbb) ) 
    279       ELSE 
    280          l_1st_euler =  .TRUE.      ! before field not found, forced euler 1st time-step 
    281       ENDIF 
    282       ! 
    283       ! now fields 
    284       CALL iom_get( numror, jpdom_auto, 'un'     , uu(:,:,:       ,Kmm), cd_type = 'U', psgn = -1._wp ) 
    285       CALL iom_get( numror, jpdom_auto, 'vn'     , vv(:,:,:       ,Kmm), cd_type = 'V', psgn = -1._wp ) 
    286       CALL iom_get( numror, jpdom_auto, 'tn'     , ts(:,:,:,jp_tem,Kmm) ) 
    287       CALL iom_get( numror, jpdom_auto, 'sn'     , ts(:,:,:,jp_sal,Kmm) ) 
    288       CALL iom_get( numror, jpdom_auto, 'sshn'   ,ssh(:,:         ,Kmm) ) 
     286      ENDIF 
     287      ! 
    289288      IF( iom_varid( numror, 'rhop', ldstop = .FALSE. ) > 0 ) THEN 
    290289         CALL iom_get( numror, jpdom_auto, 'rhop'   , rhop )   ! now    potential density 
     
    293292      ENDIF 
    294293      ! 
    295       IF( l_1st_euler ) THEN                                  ! Euler restart 
    296          ts   (:,:,:,:,Kbb) = ts   (:,:,:,:,Kmm)              ! all before fields set to now values 
    297          uu   (:,:,:  ,Kbb) = uu   (:,:,:  ,Kmm) 
    298          vv   (:,:,:  ,Kbb) = vv   (:,:,:  ,Kmm) 
    299          ssh  (:,:    ,Kbb) = ssh  (:,:    ,Kmm) 
    300       ENDIF 
    301       ! 
    302294   END SUBROUTINE rst_read 
    303295 
Note: See TracChangeset for help on using the changeset viewer.