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 508 for trunk/NEMO/OPA_SRC/step.F90 – NEMO

Ignore:
Timestamp:
2006-10-03T17:58:55+02:00 (18 years ago)
Author:
opalod
Message:

nemo_v1_update_071:RB: add iom for restart and reorganization of restart

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEMO/OPA_SRC/step.F90

    r503 r508  
    44   !! Time-stepping    : manager of the ocean, tracer and ice time stepping 
    55   !!====================================================================== 
    6    !! History : 
    7    !!        !  91-03  ()  Original code 
    8    !!        !  91-11  (G. Madec) 
    9    !!        !  92-06  (M. Imbard)  add a first output record 
    10    !!        !  96-04  (G. Madec)  introduction of dynspg 
    11    !!        !  96-04  (M.A. Foujols)  introduction of passive tracer 
    12    !!   8.0  !  97-06  (G. Madec)  new architecture of call 
    13    !!   8.2  !  97-06  (G. Madec, M. Imbard, G. Roullet)  free surface 
    14    !!   8.2  !  99-02  (G. Madec, N. Grima)  hpg implicit 
    15    !!   8.2  !  00-07  (J-M Molines, M. Imbard)  Open Bondary Conditions 
    16    !!   9.0  !  02-06  (G. Madec)  free form, suppress macro-tasking 
    17    !!    "   !  04-08  (C. Talandier) New trends organization 
    18    !!    "   !  05-01  (C. Ethe) Add the KPP closure scheme 
    19    !!    "   !  05-11  (V. Garnier) Surface pressure gradient organization 
    20    !!    "   !  05-11  (G. Madec)  Reorganisation of tra and dyn calls 
     6   !! History :        !  91-03  ()  Original code 
     7   !!                  !  91-11  (G. Madec) 
     8   !!                  !  92-06  (M. Imbard)  add a first output record 
     9   !!                  !  96-04  (G. Madec)  introduction of dynspg 
     10   !!                  !  96-04  (M.A. Foujols)  introduction of passive tracer 
     11   !!             8.0  !  97-06  (G. Madec)  new architecture of call 
     12   !!             8.2  !  97-06  (G. Madec, M. Imbard, G. Roullet)  free surface 
     13   !!             8.2  !  99-02  (G. Madec, N. Grima)  hpg implicit 
     14   !!             8.2  !  00-07  (J-M Molines, M. Imbard)  Open Bondary Conditions 
     15   !!             9.0  !  02-06  (G. Madec)  free form, suppress macro-tasking 
     16   !!             " "  !  04-08  (C. Talandier) New trends organization 
     17   !!             " "  !  05-01  (C. Ethe) Add the KPP closure scheme 
     18   !!             " "  !  05-11  (V. Garnier) Surface pressure gradient organization 
     19   !!             " "  !  05-11  (G. Madec)  Reorganisation of tra and dyn calls 
     20   !!             " "  !  06-01  (L. Debreu, C. Mazauric)  Agrif implementation 
     21   !!             " "  !  06-07  (S. Masson)  restart using iom 
    2122   !!---------------------------------------------------------------------- 
    2223   !!   stp            : OPA system time-stepping 
    2324   !!---------------------------------------------------------------------- 
    24    !! * Modules used 
    2525   USE oce             ! ocean dynamics and tracers variables 
    2626   USE dom_oce         ! ocean space and time domain variables  
     
    3030   USE cpl_oce         ! coupled ocean-atmosphere variables 
    3131   USE in_out_manager  ! I/O manager 
     32   USE iom 
    3233   USE lbclnk 
    3334 
     
    126127   PRIVATE 
    127128 
    128    !! * Routine accessibility 
    129129   PUBLIC stp            ! called by opa.F90 
    130130 
     
    135135   !!   OPA 9.0 , LOCEAN-IPSL (2005)  
    136136   !! $Header$  
    137    !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt  
     137   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)  
    138138   !!---------------------------------------------------------------------- 
    139139 
    140140CONTAINS 
    141141 
    142 #if !defined key_agrif 
     142#if defined key_agrif 
     143   SUBROUTINE stp( ) 
     144#else 
    143145   SUBROUTINE stp( kstp ) 
    144 #else 
    145    SUBROUTINE stp( ) 
    146146#endif 
    147147      !!---------------------------------------------------------------------- 
     
    160160      !!              -7- Compute the diagnostics variables (rd,N2, div,cur,w) 
    161161      !!              -8- Outputs and diagnostics 
    162       !! 
    163162      !!---------------------------------------------------------------------- 
    164163      !! * Arguments 
    165 #if !defined key_agrif    
     164#if defined key_agrif    
     165      INTEGER               :: kstp   ! ocean time-step index 
     166#else 
    166167      INTEGER, INTENT( in ) :: kstp   ! ocean time-step index 
    167 #else 
    168       INTEGER               :: kstp   ! ocean time-step index 
    169168#endif       
    170169 
     
    176175      kstp = nit000 + Agrif_Nb_Step() 
    177176!      IF ( Agrif_Root() .and. lwp) Write(*,*) '---' 
    178 !      IF (lwp) Write(*,*) 'Grid N°',Agrif_Fixed(),' time step ',kstp 
     177!      IF (lwp) Write(*,*) 'Grid Number',Agrif_Fixed(),' time step ',kstp 
    179178#endif    
    180179      indic = 1                    ! reset to no error condition 
     180 
    181181      adatrj = adatrj + rdt/86400._wp 
    182182 
    183183      CALL day( kstp )             ! Calendar 
     184 
     185      CALL rst_opn( kstp )         ! Open the restart file 
    184186 
    185187      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     
    326328                             CALL tra_ldf    ( kstp )       ! lateral mixing 
    327329#if defined key_agrif 
    328       IF (.NOT. Agrif_Root())  CALL Agrif_Sponge_tra( kstp )          ! tracers sponge 
     330      IF(.NOT. Agrif_Root()) CALL Agrif_Sponge_tra( kstp )  ! tracers sponge 
    329331#endif 
    330332                             CALL tra_zdf    ( kstp )       ! vertical mixing 
     
    363365                               CALL dyn_ldf( kstp )           ! lateral mixing 
    364366#if defined key_agrif 
    365       IF (.NOT. Agrif_Root())  CALL Agrif_Sponge_dyn( kstp )         ! momemtum sponge 
     367      IF(.NOT. Agrif_Root())   CALL Agrif_Sponge_dyn( kstp )  ! momemtum sponge 
    366368#endif 
    367369                               CALL dyn_hpg( kstp )           ! horizontal gradient of Hydrostatic pressure 
     
    400402 
    401403      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    402       ! Control, diagnostics and outputs 
    403       !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    404       ! N.B. ua, va, ta, sa arrays are used as workspace in this section 
    405       !----------------------------------------------------------------------- 
    406  
    407       !                                            ! Time loop: control and print 
    408                        CALL stp_ctl( kstp, indic ) 
    409                        IF ( indic < 0 ) CALL ctl_stop( 'step: indic < 0' )  
    410  
    411       IF ( nstop == 0 ) THEN 
    412          !                                         ! Diagnostics: 
     404      ! Control, and restarts 
     405      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
     406      ! N.B. ua, va, ta, sa arrays are used as workspace in this section 
     407      !----------------------------------------------------------------------- 
     408      !                                                     ! Time loop: control and print 
     409                                 CALL stp_ctl( kstp, indic ) 
     410      IF( indic < 0          )   CALL ctl_stop( 'step: indic < 0' ) 
     411 
     412      IF( kstp == nit000     )   CALL iom_close( numror )             ! close input  ocean restart file 
     413      IF( lrst_oce           )   CALL rst_write  ( kstp )             ! write output ocean restart file 
     414      IF( lk_obc             )   CALL obc_rst_wri( kstp )             ! write open boundary restart file 
     415      IF( lk_trdmld          )   CALL trd_mld_rst_write( kstp )       ! ocean model: restart file output for trends diagnostics 
     416 
     417 
     418      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     419      ! diagnostics and outputs 
     420      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
     421      ! N.B. ua, va, ta, sa arrays are used as workspace in this section 
     422      !----------------------------------------------------------------------- 
     423 
     424      IF ( nstop == 0 ) THEN                                ! Diagnostics 
    413425         IF( lk_floats  )   CALL flo_stp( kstp )                 ! drifting Floats 
    414426         IF( lk_trddyn  )   CALL trd_dwr( kstp )                 ! trends: dynamics  
     
    423435         IF( ln_diaptr  )   CALL dia_ptr( kstp )                 ! Poleward TRansports diagnostics 
    424436 
    425          !                                         ! save and outputs 
    426                             CALL rst_write  ( kstp )             ! ocean model: restart file output 
    427          IF( lk_obc     )   CALL obc_rst_wri( kstp )             ! ocean model: open boundary restart file output 
    428          IF( lk_trdmld  )   CALL trd_mld_rst_write( kstp )       ! ocean model: restart file output for trends diagnostics 
     437         !                                                 ! Outputs 
    429438                            CALL dia_wri    ( kstp, indic )      ! ocean model: outputs 
    430  
    431439      ENDIF 
    432440 
     
    436444 
    437445      IF( lk_cpl    )   CALL cpl_stp( kstp )                 ! coupled mode : field exchanges 
    438  
     446      ! 
    439447   END SUBROUTINE stp 
    440448 
Note: See TracChangeset for help on using the changeset viewer.