step.F90 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. MODULE step
  2. !!======================================================================
  3. !! *** MODULE step ***
  4. !! Time-stepping : manager of the ocean, tracer and ice time stepping
  5. !! version for standalone surface scheme
  6. !!======================================================================
  7. !! History : OPA ! 1991-03 (G. Madec) Original code
  8. !! . ! .
  9. !! . ! .
  10. !! NEMO 3.5 ! 2012-03 (S. Alderson)
  11. !!----------------------------------------------------------------------
  12. !!----------------------------------------------------------------------
  13. !! stp : OPA system time-stepping
  14. !!----------------------------------------------------------------------
  15. USE oce ! ocean dynamics and tracers variables
  16. USE dom_oce ! ocean space and time domain variables
  17. USE in_out_manager ! I/O manager
  18. USE sbc_oce
  19. USE sbccpl
  20. USE iom !
  21. USE lbclnk
  22. #if defined key_iomput
  23. USE xios
  24. #endif
  25. USE daymod ! calendar (day routine)
  26. USE sbcmod ! surface boundary condition (sbc routine)
  27. USE sbcrnf ! surface boundary condition: runoff variables
  28. USE eosbn2 ! equation of state (eos_bn2 routine)
  29. USE diawri ! Standard run outputs (dia_wri routine)
  30. USE stpctl ! time stepping control (stp_ctl routine)
  31. USE prtctl ! Print control (prt_ctl routine)
  32. USE timing ! Timing
  33. USE bdy_par ! clem: mandatory for LIM3
  34. #if defined key_bdy
  35. USE bdydta ! clem: mandatory for LIM3
  36. #endif
  37. IMPLICIT NONE
  38. PRIVATE
  39. PUBLIC stp ! called by opa.F90
  40. !! * Substitutions
  41. # include "domzgr_substitute.h90"
  42. # include "zdfddm_substitute.h90"
  43. !!----------------------------------------------------------------------
  44. !! NEMO/OPA 3.3 , NEMO Consortium (2010)
  45. !! $Id: step.F90 2544 2015-08-24 09:00:45Z ufla $
  46. !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
  47. !!----------------------------------------------------------------------
  48. CONTAINS
  49. #if defined key_agrif
  50. SUBROUTINE stp( )
  51. INTEGER :: kstp ! ocean time-step index
  52. #else
  53. SUBROUTINE stp( kstp )
  54. INTEGER, INTENT(in) :: kstp ! ocean time-step index
  55. #endif
  56. !!----------------------------------------------------------------------
  57. !! *** ROUTINE stp ***
  58. !!
  59. !! ** Purpose : - Time stepping of SBC (surface boundary)
  60. !!
  61. !! ** Method : -1- Update forcings and data
  62. !! -2- Outputs and diagnostics
  63. !!----------------------------------------------------------------------
  64. INTEGER :: indic ! error indicator if < 0
  65. !! ---------------------------------------------------------------------
  66. #if defined key_agrif
  67. kstp = nit000 + Agrif_Nb_Step()
  68. # if defined key_iomput
  69. IF( Agrif_Nbstepint() == 0 ) CALL iom_swap( cxios_context )
  70. # endif
  71. #endif
  72. IF( kstp == nit000 ) CALL iom_init( cxios_context ) ! iom_put initialization (must be done after nemo_init for AGRIF+XIOS+OASIS)
  73. IF( kstp /= nit000 ) CALL day( kstp ) ! Calendar (day was already called at nit000 in day_init)
  74. CALL iom_setkt( kstp - nit000 + 1, cxios_context ) ! tell iom we are at time step kstp
  75. ! ==> clem: open boundaries is mandatory for LIM3 because ice BDY is not decoupled from
  76. ! the environment of ocean BDY. Therefore bdy is called in both OPA and SAS modules.
  77. ! From SAS: ocean bdy data are wrong (but we do not care) and ice bdy data are OK.
  78. ! This is not clean and should be changed in the future.
  79. #if defined key_bdy
  80. IF( lk_bdy ) CALL bdy_dta ( kstp, time_offset=+1 ) ! update dynamic & tracer data at open boundaries
  81. #endif
  82. ! ==>
  83. CALL sbc ( kstp ) ! Sea Boundary Condition (including sea-ice)
  84. CALL dia_wri( kstp ) ! ocean model: outputs
  85. indic = 0 ! although indic is not changed in stp_ctl
  86. ! need to keep the same interface
  87. CALL stp_ctl( kstp, indic )
  88. !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
  89. ! Coupled mode
  90. !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  91. IF( lk_oasis ) CALL sbc_cpl_snd( kstp ) ! coupled mode : field exchanges if OASIS-coupled ice
  92. #if defined key_iomput
  93. IF( kstp == nitend .OR. indic < 0 ) THEN
  94. CALL iom_context_finalize( cxios_context ) ! needed for XIOS+AGRIF
  95. ENDIF
  96. #endif
  97. !
  98. IF( nn_timing == 1 .AND. kstp == nit000 ) CALL timing_reset
  99. !
  100. END SUBROUTINE stp
  101. !!======================================================================
  102. END MODULE step