stpctl.F90 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. MODULE stpctl
  2. !!======================================================================
  3. !! *** MODULE stpctl ***
  4. !! Ocean run control : gross check of the ocean time stepping
  5. !! version for standalone surface scheme
  6. !!======================================================================
  7. !! History : OPA ! 1991-03 (G. Madec) Original code
  8. !! 6.0 ! 1992-06 (M. Imbard)
  9. !! 8.0 ! 1997-06 (A.M. Treguier)
  10. !! NEMO 1.0 ! 2002-06 (G. Madec) F90: Free form and module
  11. !! 2.0 ! 2009-07 (G. Madec) Add statistic for time-spliting
  12. !! 3.5 ! 2012-03 (S. Alderson)
  13. !!----------------------------------------------------------------------
  14. !!----------------------------------------------------------------------
  15. !! stp_ctl : Control the run
  16. !!----------------------------------------------------------------------
  17. USE oce ! ocean dynamics and tracers variables
  18. USE dom_oce ! ocean space and time domain variables
  19. USE in_out_manager ! I/O manager
  20. USE lbclnk ! ocean lateral boundary conditions (or mpp link)
  21. USE lib_mpp ! distributed memory computing
  22. IMPLICIT NONE
  23. PRIVATE
  24. PUBLIC stp_ctl ! routine called by step.F90
  25. !!----------------------------------------------------------------------
  26. !! NEMO/OPA 3.3 , NEMO Consortium (2010)
  27. !! $Id: stpctl.F90 2355 2015-05-20 07:11:50Z ufla $
  28. !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
  29. !!----------------------------------------------------------------------
  30. CONTAINS
  31. SUBROUTINE stp_ctl( kt, kindic )
  32. !!----------------------------------------------------------------------
  33. !! *** ROUTINE stp_ctl ***
  34. !!
  35. !! ** Purpose : Control the run
  36. !!
  37. !! ** Method : - Save the time step in numstp
  38. !! - Print it each 50 time steps
  39. !!
  40. !! ** Actions : 'time.step' file containing the last ocean time-step
  41. !!
  42. !!----------------------------------------------------------------------
  43. INTEGER, INTENT( in ) :: kt ! ocean time-step index
  44. INTEGER, INTENT( inout ) :: kindic ! indicator of solver convergence
  45. !!----------------------------------------------------------------------
  46. IF( kt == nit000 .AND. lwp ) THEN
  47. WRITE(numout,*)
  48. WRITE(numout,*) 'stp_ctl : time-stepping control'
  49. WRITE(numout,*) '~~~~~~~'
  50. ! open time.step file
  51. CALL ctl_opn( numstp, 'time.step', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp, narea )
  52. ENDIF
  53. IF(lwp) WRITE ( numstp, '(1x, i8)' ) kt !* save the current time step in numstp
  54. IF(lwp) REWIND( numstp ) ! --------------------------
  55. END SUBROUTINE stp_ctl
  56. !!======================================================================
  57. END MODULE stpctl