MODULE step_c1d !!====================================================================== !! *** MODULE step_c1d *** !! Time-stepping : manager of the ocean, tracer and ice time stepping - c1d case !!====================================================================== !! History : 2.0 ! 2004-04 (C. Ethe) adapted from step.F90 for C1D !! 3.0 ! 2008-04 (G. Madec) redo the adaptation to include SBC !!---------------------------------------------------------------------- #if defined key_c1d !!---------------------------------------------------------------------- !! 'key_c1d' 1D Configuration !!---------------------------------------------------------------------- !! stp_c1d : NEMO system time-stepping in c1d case !!---------------------------------------------------------------------- USE step_oce ! time stepping definition modules !LB:USE dyncor_c1d ! Coriolis term (c1d case) (dyn_cor_1d ) !LB:USE dynnxt ! time-stepping (dyn_nxt routine) !LB:USE dyndmp ! U & V momentum damping (dyn_dmp routine) USE restart ! restart IMPLICIT NONE PRIVATE PUBLIC stp_c1d ! called by nemogcm.F90 !!---------------------------------------------------------------------- !! NEMO/OCE 4.0 , NEMO Consortium (2018) !! $Id: step_c1d.F90 10068 2018-08-28 14:09:04Z nicolasmartin $ !! Software governed by the CeCILL license (see ./LICENSE) !!---------------------------------------------------------------------- CONTAINS SUBROUTINE stp_c1d( kstp ) !!---------------------------------------------------------------------- !! *** ROUTINE stp_c1d *** !! !! ** Purpose : - Time stepping of SBC including sea ice (dynamic and thermodynamic eqs.) !! - Time stepping of OPA (momentum and active tracer eqs.) !! - Time stepping of TOP (passive tracer eqs.) !! !! ** Method : -1- Update forcings and data !! -2- Update vertical ocean physics !! -3- Compute the t and s trends !! -4- Update t and s !! -5- Compute the momentum trends !! -6- Update the horizontal velocity !! -7- Compute the diagnostics variables (rd,N2, div,cur,w) !! -8- Outputs and diagnostics !!---------------------------------------------------------------------- INTEGER, INTENT(in) :: kstp ! ocean time-step index ! INTEGER :: jk ! dummy loop indice INTEGER :: indic ! error indicator if < 0 !! --------------------------------------------------------------------- indic = 0 ! reset to no error condition IF( kstp == nit000 ) CALL iom_init( "nemo") ! iom_put initialization (must be done after nemo_init for AGRIF+XIOS+OASIS) IF( kstp /= nit000 ) CALL day( kstp ) ! Calendar (day was already called at nit000 in day_init) CALL iom_setkt( kstp - nit000 + 1, "nemo" ) ! say to iom that we are at time step kstp CALL sbc ( kstp ) ! Sea Boundary Condition (including sea-ice) CALL dia_wri( kstp ) ! ocean model: outputs !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> ! Control !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< !LOLO: ! LOLO: should write a stp_ctl, who checks on flux realism (current SAS version checks ice fields...) ! CALL stp_ctl( kstp, indic ) !IF( indic < 0 ) THEN ! CALL ctl_stop( 'step: indic < 0' ) ! CALL dia_wri_state( 'output.abort' ) !ENDIF !LOLO. IF( kstp == nit000 ) CALL iom_close( numror ) ! close input ocean restart file !LOLO: from C1D: IF( lrst_oce ) CALL rst_write( kstp ) ! write output ocean restart file ! #if defined key_iomput IF( kstp == nitend .OR. indic < 0 ) CALL xios_context_finalize() ! needed for XIOS #endif !LOLO: from SAS" !#if defined key_iomput ! IF( kstp == nitrst ) THEN ! IF(.NOT.lwxios) THEN ! CALL iom_close( numrow ) ! ELSE ! CALL iom_context_finalize( cwxios_context ) ! ENDIF ! lrst_oce = .FALSE. ! ENDIF ! IF( kstp == nitend .OR. indic < 0 ) THEN ! CALL iom_context_finalize( cxios_context ) ! needed for XIOS+AGRIF ! ENDIF !#endif ! ! ! IF( ln_timing .AND. kstp == nit000 ) CALL timing_reset ! END SUBROUTINE stp_c1d #else !!---------------------------------------------------------------------- !! Default key NO 1D Config !!---------------------------------------------------------------------- CONTAINS SUBROUTINE stp_c1d ( kt ) ! dummy routine IMPLICIT NONE INTEGER, INTENT( in ) :: kt WRITE(*,*) 'stp_c1d: You should not have seen this print! error?', kt END SUBROUTINE stp_c1d #endif !!====================================================================== END MODULE step_c1d