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