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 2528 for trunk/NEMOGCM/NEMO/OPA_SRC/IOM/restart.F90 – NEMO

Ignore:
Timestamp:
2010-12-27T18:33:53+01:00 (14 years ago)
Author:
rblod
Message:

Update NEMOGCM from branch nemo_v3_3_beta

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEMOGCM/NEMO/OPA_SRC/IOM/restart.F90

    • Property svn:eol-style deleted
    r1613 r2528  
    44   !! Ocean restart :  write the ocean restart file 
    55   !!====================================================================== 
    6    !! History :        !  99-11  (M. Imbard)  Original code 
    7    !!             8.5  !  02-08  (G. Madec)  F90: Free form 
    8    !!             9.0  !  05-11  (V. Garnier) Surface pressure gradient organization 
    9    !!             9.0  !  06-07  (S. Masson)  use IOM for restart 
     6   !! History :  OPA  !  1999-11  (M. Imbard)  Original code 
     7   !!   NEMO     1.0  !  2002-08  (G. Madec)  F90: Free form 
     8   !!            2.0  !  2006-07  (S. Masson)  use IOM for restart 
     9   !!            3.3  !  2010-04  (M. Leclair, G. Madec)  modified LF-RA 
     10   !!            - -  !  2010-10  (C. Ethe, G. Madec) TRC-TRA merge (T-S in 4D) 
    1011   !!---------------------------------------------------------------------- 
    1112 
     
    1516   !!   rst_read   : read the ocean restart file 
    1617   !!---------------------------------------------------------------------- 
     18   USE oce             ! ocean dynamics and tracers  
    1719   USE dom_oce         ! ocean space and time domain 
    18    USE oce             ! ocean dynamics and tracers  
    1920   USE phycst          ! physical constants 
    2021   USE in_out_manager  ! I/O manager 
    2122   USE iom             ! I/O module 
    22    USE c1d             ! re-initialization of u-v mask for the 1D configuration 
    23    USE zpshde          ! partial step: hor. derivative (zps_hde routine) 
    2423   USE eosbn2          ! equation of state            (eos bn2 routine) 
    25    USE zdfddm          ! double diffusion mixing  
    26    USE zdfmxl          ! mixed layer depth 
    2724   USE trdmld_oce      ! ocean active mixed layer tracers trends variables 
     25   USE domvvl          ! variable volume 
     26   USE traswp          ! swap from 4D T-S to 3D T & S and vice versa 
    2827 
    2928   IMPLICIT NONE 
     
    3433   PUBLIC   rst_read   ! routine called by opa  module 
    3534 
    36    LOGICAL, PUBLIC ::   lrst_oce =  .FALSE.       !: logical to control the oce restart write  
    37    INTEGER, PUBLIC ::   numror, numrow            !: logical unit for cean restart (read and write) 
     35   LOGICAL, PUBLIC ::   lrst_oce =  .FALSE.   !: logical to control the oce restart write  
     36   INTEGER, PUBLIC ::   numror, numrow        !: logical unit for cean restart (read and write) 
    3837 
    3938   !! * Substitutions 
     39#  include "domzgr_substitute.h90" 
    4040#  include "vectopt_loop_substitute.h90" 
    4141   !!---------------------------------------------------------------------- 
    42    !!  OPA 9.0 , LOCEAN-IPSL (2006)  
     42   !! NEMO/OPA 3.3 , NEMO Consortium (2010) 
    4343   !! $Id$ 
    44    !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 
    45    !!---------------------------------------------------------------------- 
    46  
     44   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt) 
     45   !!---------------------------------------------------------------------- 
    4746CONTAINS 
    4847 
     
    8887            CASE DEFAULT         ;   WRITE(numout,*) '             open ocean restart NetCDF file: '//clname 
    8988            END SELECT 
     89            IF ( snc4set%luse )      WRITE(numout,*) '             opened for NetCDF4 chunking and compression' 
    9090            IF( kt == nitrst - 1 ) THEN   ;   WRITE(numout,*) '             kt = nitrst - 1 = ', kt 
    9191            ELSE                          ;   WRITE(numout,*) '             kt = '             , kt 
    9292            ENDIF 
    9393         ENDIF 
    94  
     94         ! 
    9595         CALL iom_open( clname, numrow, ldwrt = .TRUE., kiolib = jprstlib ) 
    9696         lrst_oce = .TRUE. 
     
    107107      !! 
    108108      !! ** Method  :   Write in numrow when kt == nitrst in NetCDF 
    109       !!      file, save fields which are necessary for restart 
     109      !!              file, save fields which are necessary for restart 
    110110      !!---------------------------------------------------------------------- 
    111111      INTEGER, INTENT(in) ::   kt   ! ocean time-step 
    112112      !!---------------------------------------------------------------------- 
    113113 
    114       CALL iom_rstput( kt, nitrst, numrow, 'rdt'    , rdt       )   ! dynamics time step 
    115       CALL iom_rstput( kt, nitrst, numrow, 'rdttra1', rdttra(1) )   ! surface tracer time step 
    116  
    117       CALL iom_rstput( kt, nitrst, numrow, 'ub'     , ub      )     ! before fields 
    118       CALL iom_rstput( kt, nitrst, numrow, 'vb'     , vb      ) 
    119       CALL iom_rstput( kt, nitrst, numrow, 'tb'     , tb      ) 
    120       CALL iom_rstput( kt, nitrst, numrow, 'sb'     , sb      ) 
    121       CALL iom_rstput( kt, nitrst, numrow, 'rotb'   , rotb    ) 
    122       CALL iom_rstput( kt, nitrst, numrow, 'hdivb'  , hdivb   ) 
    123       CALL iom_rstput( kt, nitrst, numrow, 'sshb'   , sshb    ) 
    124       ! 
    125       CALL iom_rstput( kt, nitrst, numrow, 'un'     , un      )     ! now fields 
    126       CALL iom_rstput( kt, nitrst, numrow, 'vn'     , vn      ) 
    127       CALL iom_rstput( kt, nitrst, numrow, 'tn'     , tn      ) 
    128       CALL iom_rstput( kt, nitrst, numrow, 'sn'     , sn      ) 
    129       CALL iom_rstput( kt, nitrst, numrow, 'rotn'   , rotn    ) 
    130       CALL iom_rstput( kt, nitrst, numrow, 'hdivn'  , hdivn   ) 
    131       CALL iom_rstput( kt, nitrst, numrow, 'sshn'   , sshn    ) 
    132  
    133       CALL iom_rstput( kt, nitrst, numrow, 'rhop'   , rhop    ) 
     114                     CALL iom_rstput( kt, nitrst, numrow, 'rdt'    , rdt       )   ! dynamics time step 
     115                     CALL iom_rstput( kt, nitrst, numrow, 'rdttra1', rdttra(1) )   ! surface tracer time step 
     116 
     117                     CALL iom_rstput( kt, nitrst, numrow, 'ub'     , ub        )     ! before fields 
     118                     CALL iom_rstput( kt, nitrst, numrow, 'vb'     , vb        ) 
     119                     CALL iom_rstput( kt, nitrst, numrow, 'tb'     , tb        ) 
     120                     CALL iom_rstput( kt, nitrst, numrow, 'sb'     , sb        ) 
     121                     CALL iom_rstput( kt, nitrst, numrow, 'rotb'   , rotb      ) 
     122                     CALL iom_rstput( kt, nitrst, numrow, 'hdivb'  , hdivb     ) 
     123                     CALL iom_rstput( kt, nitrst, numrow, 'sshb'   , sshb      ) 
     124      IF( lk_vvl )   CALL iom_rstput( kt, nitrst, numrow, 'fse3t_b', fse3t_b(:,:,:) ) 
     125                     ! 
     126                     CALL iom_rstput( kt, nitrst, numrow, 'un'     , un        )     ! now fields 
     127                     CALL iom_rstput( kt, nitrst, numrow, 'vn'     , vn        ) 
     128                     CALL iom_rstput( kt, nitrst, numrow, 'tn'     , tn        ) 
     129                     CALL iom_rstput( kt, nitrst, numrow, 'sn'     , sn        ) 
     130                     CALL iom_rstput( kt, nitrst, numrow, 'rotn'   , rotn      ) 
     131                     CALL iom_rstput( kt, nitrst, numrow, 'hdivn'  , hdivn     ) 
     132                     CALL iom_rstput( kt, nitrst, numrow, 'sshn'   , sshn      ) 
     133                     CALL iom_rstput( kt, nitrst, numrow, 'rhop'   , rhop      ) 
    134134#if defined key_zdfkpp 
    135       CALL iom_rstput( kt, nitrst, numrow, 'rhd'  , rhd   ) 
     135                     CALL iom_rstput( kt, nitrst, numrow, 'rhd'    , rhd       ) 
    136136#endif 
    137  
    138137      IF( kt == nitrst ) THEN 
    139138         CALL iom_close( numrow )     ! close the restart file (only at last time step) 
     
    153152      !!---------------------------------------------------------------------- 
    154153      REAL(wp) ::   zrdt, zrdttra1 
    155       INTEGER  ::   jlibalt = jprstlib 
     154      INTEGER  ::   jk, jlibalt = jprstlib 
    156155      LOGICAL  ::   llok 
    157156      !!---------------------------------------------------------------------- 
     
    163162         CASE ( jprstdimg )   ;   WRITE(numout,*) 'rst_read : read oce binary restart file' 
    164163         END SELECT 
     164         IF ( snc4set%luse )      WRITE(numout,*) 'rst_read : configured with NetCDF4 support' 
    165165         WRITE(numout,*) '~~~~~~~~' 
    166166      ENDIF 
     
    184184      ENDIF 
    185185      !  
    186       CALL iom_get( numror, jpdom_autoglo, 'ub'   , ub    )        ! before fields 
    187       CALL iom_get( numror, jpdom_autoglo, 'vb'   , vb    ) 
    188       CALL iom_get( numror, jpdom_autoglo, 'tb'   , tb    ) 
    189       CALL iom_get( numror, jpdom_autoglo, 'sb'   , sb    ) 
    190       CALL iom_get( numror, jpdom_autoglo, 'rotb' , rotb  ) 
    191       CALL iom_get( numror, jpdom_autoglo, 'hdivb', hdivb ) 
    192       CALL iom_get( numror, jpdom_autoglo, 'sshb' , sshb  ) 
    193       ! 
    194       CALL iom_get( numror, jpdom_autoglo, 'un'   , un    )        ! now    fields 
    195       CALL iom_get( numror, jpdom_autoglo, 'vn'   , vn    ) 
    196       CALL iom_get( numror, jpdom_autoglo, 'tn'   , tn    ) 
    197       CALL iom_get( numror, jpdom_autoglo, 'sn'   , sn    ) 
    198       CALL iom_get( numror, jpdom_autoglo, 'rotn' , rotn  ) 
    199       CALL iom_get( numror, jpdom_autoglo, 'hdivn', hdivn ) 
    200       CALL iom_get( numror, jpdom_autoglo, 'sshn' , sshn  ) 
    201  
    202       CALL iom_get( numror, jpdom_autoglo, 'rhop' , rhop  )        ! now    potential density 
     186                     CALL iom_get( numror, jpdom_autoglo, 'ub'     , ub      )   ! before fields 
     187                     CALL iom_get( numror, jpdom_autoglo, 'vb'     , vb      ) 
     188                     CALL iom_get( numror, jpdom_autoglo, 'tb'     , tb      ) 
     189                     CALL iom_get( numror, jpdom_autoglo, 'sb'     , sb      ) 
     190                     CALL iom_get( numror, jpdom_autoglo, 'rotb'   , rotb    ) 
     191                     CALL iom_get( numror, jpdom_autoglo, 'hdivb'  , hdivb  ) 
     192                     CALL iom_get( numror, jpdom_autoglo, 'sshb'   , sshb    ) 
     193      IF( lk_vvl )   CALL iom_get( numror, jpdom_autoglo, 'fse3t_b', fse3t_b(:,:,:) ) 
     194                     ! 
     195                     CALL iom_get( numror, jpdom_autoglo, 'un'     , un      )   ! now    fields 
     196                     CALL iom_get( numror, jpdom_autoglo, 'vn'     , vn      ) 
     197                     CALL iom_get( numror, jpdom_autoglo, 'tn'     , tn      ) 
     198                     CALL iom_get( numror, jpdom_autoglo, 'sn'     , sn      ) 
     199                     CALL iom_get( numror, jpdom_autoglo, 'rotn'   , rotn    ) 
     200                     CALL iom_get( numror, jpdom_autoglo, 'hdivn'  , hdivn   ) 
     201                     CALL iom_get( numror, jpdom_autoglo, 'sshn'   , sshn    ) 
     202                     CALL iom_get( numror, jpdom_autoglo, 'rhop'   , rhop    )   ! now    potential density 
    203203#if defined key_zdfkpp 
    204204      IF( iom_varid( numror, 'rhd', ldstop = .FALSE. ) > 0 ) THEN 
    205          CALL iom_get( numror, jpdom_autoglo, 'rhd' , rhd  )       ! now    in situ density anomaly 
     205                     CALL iom_get( numror, jpdom_autoglo, 'rhd'    , rhd     )   ! now    in situ density anomaly 
    206206      ELSE 
    207          CALL eos( tn, sn, rhd )   ! compute rhd 
     207                     CALL tra_swap 
     208                     CALL eos( tsn, rhd )   ! compute rhd 
    208209      ENDIF 
    209210#endif 
    210  
     211      ! 
    211212      IF( neuler == 0 ) THEN                                  ! Euler restart (neuler=0) 
    212213         tb   (:,:,:) = tn   (:,:,:)                             ! all before fields set to now values 
     
    217218         hdivb(:,:,:) = hdivn(:,:,:) 
    218219         sshb (:,:)   = sshn (:,:) 
     220         IF( lk_vvl ) THEN 
     221            DO jk = 1, jpk 
     222               fse3t_b(:,:,jk) = fse3t_n(:,:,jk) 
     223            END DO 
     224         ENDIF 
    219225      ENDIF 
    220226      ! 
Note: See TracChangeset for help on using the changeset viewer.