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