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 6808 for branches/NERC/dev_r5549_BDY_ZEROGRAD/NEMOGCM/NEMO/OPA_SRC/IOM/restart.F90 – NEMO

Ignore:
Timestamp:
2016-07-19T10:38:35+02:00 (8 years ago)
Author:
jamesharle
Message:

merge with trunk@6232 for consistency with SSB code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/NERC/dev_r5549_BDY_ZEROGRAD/NEMOGCM/NEMO/OPA_SRC/IOM/restart.F90

    r5407 r6808  
    99   !!            3.3  !  2010-04  (M. Leclair, G. Madec)  modified LF-RA 
    1010   !!            - -  !  2010-10  (C. Ethe, G. Madec) TRC-TRA merge (T-S in 4D) 
     11   !!            3.7  !  2014-01  (G. Madec) suppression of curl and hdiv from the restart 
     12   !!             -   !  2014-12  (G. Madec) remove KPP scheme 
    1113   !!---------------------------------------------------------------------- 
    1214 
     
    1820   USE oce             ! ocean dynamics and tracers  
    1921   USE dom_oce         ! ocean space and time domain 
     22   USE sbc_ice         ! only lk_lim3  
    2023   USE phycst          ! physical constants 
     24   USE eosbn2          ! equation of state            (eos bn2 routine) 
     25   USE trdmxl_oce      ! ocean active mixed layer tracers trends variables 
     26   ! 
    2127   USE in_out_manager  ! I/O manager 
    2228   USE iom             ! I/O module 
    23    USE eosbn2          ! equation of state            (eos bn2 routine) 
    24    USE trdmxl_oce      ! ocean active mixed layer tracers trends variables 
    25    USE divcur          ! hor. divergence and curl      (div & cur routines) 
    26  
     29   USE diurnal_bulk 
     30    
    2731   IMPLICIT NONE 
    2832   PRIVATE 
     
    3438 
    3539   !! * Substitutions 
    36 #  include "domzgr_substitute.h90" 
    3740#  include "vectopt_loop_substitute.h90" 
    3841   !!---------------------------------------------------------------------- 
     
    9295               WRITE(numout,*) 
    9396               SELECT CASE ( jprstlib ) 
    94                CASE ( jprstdimg )   ;   WRITE(numout,*)                            & 
    95                    '             open ocean restart binary file: ',TRIM(clpath)//clname 
    9697               CASE DEFAULT         ;   WRITE(numout,*)                            & 
    9798                   '             open ocean restart NetCDF file: ',TRIM(clpath)//clname 
     
    123124      !!---------------------------------------------------------------------- 
    124125 
    125                      CALL iom_rstput( kt, nitrst, numrow, 'rdt'    , rdt       )   ! dynamics time step 
    126                      CALL iom_rstput( kt, nitrst, numrow, 'rdttra1', rdttra(1) )   ! surface tracer time step 
    127  
     126                     CALL iom_rstput( kt, nitrst, numrow, 'rdt'    , rdt       )   ! dynamics and tracer time step 
     127 
     128      IF ( .NOT. ln_diurnal_only ) THEN 
    128129                     CALL iom_rstput( kt, nitrst, numrow, 'ub'     , ub        )     ! before fields 
    129130                     CALL iom_rstput( kt, nitrst, numrow, 'vb'     , vb        ) 
    130131                     CALL iom_rstput( kt, nitrst, numrow, 'tb'     , tsb(:,:,:,jp_tem) ) 
    131132                     CALL iom_rstput( kt, nitrst, numrow, 'sb'     , tsb(:,:,:,jp_sal) ) 
    132                      CALL iom_rstput( kt, nitrst, numrow, 'rotb'   , rotb      ) 
    133                      CALL iom_rstput( kt, nitrst, numrow, 'hdivb'  , hdivb     ) 
    134133                     CALL iom_rstput( kt, nitrst, numrow, 'sshb'   , sshb      ) 
    135134                     ! 
     
    138137                     CALL iom_rstput( kt, nitrst, numrow, 'tn'     , tsn(:,:,:,jp_tem) ) 
    139138                     CALL iom_rstput( kt, nitrst, numrow, 'sn'     , tsn(:,:,:,jp_sal) ) 
    140                      CALL iom_rstput( kt, nitrst, numrow, 'rotn'   , rotn      ) 
    141                      CALL iom_rstput( kt, nitrst, numrow, 'hdivn'  , hdivn     ) 
    142139                     CALL iom_rstput( kt, nitrst, numrow, 'sshn'   , sshn      ) 
    143140                     CALL iom_rstput( kt, nitrst, numrow, 'rhop'   , rhop      ) 
    144 #if defined key_zdfkpp 
    145                      CALL iom_rstput( kt, nitrst, numrow, 'rhd'    , rhd       ) 
    146 #endif 
     141 
     142                  ! extra variable needed for the ice sheet coupling 
     143                  IF ( ln_iscpl ) THEN  
     144                     CALL iom_rstput( kt, nitrst, numrow, 'tmask'  , tmask     ) ! need to extrapolate T/S 
     145                     CALL iom_rstput( kt, nitrst, numrow, 'umask'  , umask     ) ! need to correct barotropic velocity 
     146                     CALL iom_rstput( kt, nitrst, numrow, 'vmask'  , vmask     ) ! need to correct barotropic velocity 
     147                     CALL iom_rstput( kt, nitrst, numrow, 'smask'  , ssmask    ) ! need to correct barotropic velocity 
     148                     CALL iom_rstput( kt, nitrst, numrow, 'e3t_n', e3t_n(:,:,:) )   ! need to compute temperature correction 
     149                     CALL iom_rstput( kt, nitrst, numrow, 'e3u_n', e3u_n(:,:,:) )   ! need to compute bt conservation 
     150                     CALL iom_rstput( kt, nitrst, numrow, 'e3v_n', e3v_n(:,:,:) )   ! need to compute bt conservation 
     151                     CALL iom_rstput( kt, nitrst, numrow, 'gdepw_n', gdepw_n(:,:,:) ) ! need to compute extrapolation if vvl 
     152                  END IF 
     153      ENDIF 
     154       
     155      IF (ln_diurnal) CALL iom_rstput( kt, nitrst, numrow, 'Dsst', x_dsst    )   
     156 
    147157      IF( kt == nitrst ) THEN 
    148158         CALL iom_close( numrow )     ! close the restart file (only at last time step) 
     
    179189            SELECT CASE ( jprstlib ) 
    180190            CASE ( jpnf90    )   ;   WRITE(numout,*) 'rst_read : read oce NetCDF restart file' 
    181             CASE ( jprstdimg )   ;   WRITE(numout,*) 'rst_read : read oce binary restart file' 
    182191            END SELECT 
    183192            IF ( snc4set%luse )      WRITE(numout,*) 'rst_read : configured with NetCDF4 support' 
     
    187196         clpath = TRIM(cn_ocerst_indir) 
    188197         IF( clpath(LEN_TRIM(clpath):) /= '/' ) clpath = TRIM(clpath) // '/' 
    189          IF ( jprstlib == jprstdimg ) THEN 
    190            ! eventually read netcdf file (monobloc)  for restarting on different number of processors 
    191            ! if {cn_ocerst_in}.nc exists, then set jlibalt to jpnf90 
    192            INQUIRE( FILE = TRIM(cn_ocerst_indir)//'/'//TRIM(cn_ocerst_in)//'.nc', EXIST = llok ) 
    193            IF ( llok ) THEN ; jlibalt = jpnf90  ; ELSE ; jlibalt = jprstlib ; ENDIF 
    194          ENDIF 
    195198         CALL iom_open( TRIM(clpath)//cn_ocerst_in, numror, kiolib = jlibalt ) 
    196199      ENDIF 
    197200   END SUBROUTINE rst_read_open 
     201 
    198202 
    199203   SUBROUTINE rst_read 
     
    205209      !! ** Method  :   Read in restart.nc file fields which are necessary for restart 
    206210      !!---------------------------------------------------------------------- 
    207       REAL(wp) ::   zrdt, zrdttra1 
     211      REAL(wp) ::   zrdt 
    208212      INTEGER  ::   jk 
    209       LOGICAL  ::   llok 
    210213      !!---------------------------------------------------------------------- 
    211214 
     
    217220         IF( zrdt /= rdt )   neuler = 0 
    218221      ENDIF 
    219       IF( iom_varid( numror, 'rdttra1', ldstop = .FALSE. ) > 0 )   THEN 
    220          CALL iom_get( numror, 'rdttra1', zrdttra1 ) 
    221          IF( zrdttra1 /= rdttra(1) )   neuler = 0 
    222       ENDIF 
    223       !  
     222 
     223      ! Diurnal DSST  
     224      IF( ln_diurnal ) CALL iom_get( numror, jpdom_autoglo, 'Dsst' , x_dsst  )  
     225      IF ( ln_diurnal_only ) THEN  
     226         IF(lwp) WRITE( numout, * ) & 
     227         &   "rst_read:- ln_diurnal_only set, setting rhop=rau0"  
     228         rhop = rau0 
     229         CALL iom_get( numror, jpdom_autoglo, 'tn'     , tsn(:,:,1,jp_tem) )  
     230         RETURN  
     231      ENDIF   
     232       
    224233      IF( iom_varid( numror, 'ub', ldstop = .FALSE. ) > 0 ) THEN 
    225234         CALL iom_get( numror, jpdom_autoglo, 'ub'     , ub      )   ! before fields 
     
    227236         CALL iom_get( numror, jpdom_autoglo, 'tb'     , tsb(:,:,:,jp_tem) ) 
    228237         CALL iom_get( numror, jpdom_autoglo, 'sb'     , tsb(:,:,:,jp_sal) ) 
    229          CALL iom_get( numror, jpdom_autoglo, 'rotb'   , rotb    ) 
    230          CALL iom_get( numror, jpdom_autoglo, 'hdivb'  , hdivb   ) 
    231238         CALL iom_get( numror, jpdom_autoglo, 'sshb'   , sshb    ) 
    232239      ELSE 
     
    239246      CALL iom_get( numror, jpdom_autoglo, 'sn'     , tsn(:,:,:,jp_sal) ) 
    240247      CALL iom_get( numror, jpdom_autoglo, 'sshn'   , sshn    ) 
    241       IF( iom_varid( numror, 'rotn', ldstop = .FALSE. ) > 0 ) THEN 
    242          CALL iom_get( numror, jpdom_autoglo, 'rotn'   , rotn    ) 
    243          CALL iom_get( numror, jpdom_autoglo, 'hdivn'  , hdivn   ) 
    244       ELSE 
    245          CALL div_cur( 0 )                              ! Horizontal divergence & Relative vorticity 
    246       ENDIF 
    247248      IF( iom_varid( numror, 'rhop', ldstop = .FALSE. ) > 0 ) THEN 
    248249         CALL iom_get( numror, jpdom_autoglo, 'rhop'   , rhop    )   ! now    potential density 
    249250      ELSE 
    250          CALL eos    ( tsn, rhd, rhop, fsdept_n(:,:,:) )    
    251       ENDIF 
    252 #if defined key_zdfkpp 
    253       IF( iom_varid( numror, 'rhd', ldstop = .FALSE. ) > 0 ) THEN 
    254          CALL iom_get( numror, jpdom_autoglo, 'rhd'    , rhd     )   ! now    in situ density anomaly 
    255       ELSE 
    256          CALL eos( tsn, rhd, fsdept_n(:,:,:) )   ! compute rhd 
    257       ENDIF 
    258 #endif 
     251         CALL eos( tsn, rhd, rhop, gdept_n(:,:,:) )    
     252      ENDIF 
    259253      ! 
    260254      IF( neuler == 0 ) THEN                                  ! Euler restart (neuler=0) 
     
    262256         ub   (:,:,:)   = un   (:,:,:) 
    263257         vb   (:,:,:)   = vn   (:,:,:) 
    264          rotb (:,:,:)   = rotn (:,:,:) 
    265          hdivb(:,:,:)   = hdivn(:,:,:) 
    266258         sshb (:,:)     = sshn (:,:) 
    267  
    268          IF( lk_vvl ) THEN 
     259         ! 
     260         IF( .NOT.ln_linssh ) THEN 
    269261            DO jk = 1, jpk 
    270                fse3t_b(:,:,jk) = fse3t_n(:,:,jk) 
     262               e3t_b(:,:,jk) = e3t_n(:,:,jk) 
    271263            END DO 
    272264         ENDIF 
    273  
     265         ! 
    274266      ENDIF 
    275267      ! 
Note: See TracChangeset for help on using the changeset viewer.