[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 |
---|
| 19 | USE iom ! |
---|
| 20 | USE lbclnk |
---|
[3769] | 21 | #if defined key_iomput |
---|
| 22 | USE xios |
---|
| 23 | #endif |
---|
[3331] | 24 | |
---|
| 25 | USE daymod ! calendar (day routine) |
---|
| 26 | |
---|
| 27 | USE sbcmod ! surface boundary condition (sbc routine) |
---|
| 28 | USE sbcrnf ! surface boundary condition: runoff variables |
---|
| 29 | |
---|
| 30 | USE eosbn2 ! equation of state (eos_bn2 routine) |
---|
| 31 | |
---|
| 32 | USE diawri ! Standard run outputs (dia_wri routine) |
---|
| 33 | USE stpctl ! time stepping control (stp_ctl routine) |
---|
| 34 | USE prtctl ! Print control (prt_ctl routine) |
---|
| 35 | |
---|
| 36 | USE timing ! Timing |
---|
| 37 | |
---|
| 38 | IMPLICIT NONE |
---|
| 39 | PRIVATE |
---|
| 40 | |
---|
| 41 | PUBLIC stp ! called by opa.F90 |
---|
| 42 | |
---|
| 43 | !! * Substitutions |
---|
| 44 | # include "domzgr_substitute.h90" |
---|
| 45 | # include "zdfddm_substitute.h90" |
---|
| 46 | !!---------------------------------------------------------------------- |
---|
| 47 | !! NEMO/OPA 3.3 , NEMO Consortium (2010) |
---|
| 48 | !! $Id: step.F90 3294 2012-01-28 16:44:18Z rblod $ |
---|
| 49 | !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) |
---|
| 50 | !!---------------------------------------------------------------------- |
---|
| 51 | CONTAINS |
---|
| 52 | |
---|
| 53 | #if defined key_agrif |
---|
| 54 | SUBROUTINE stp( ) |
---|
| 55 | INTEGER :: kstp ! ocean time-step index |
---|
| 56 | #else |
---|
| 57 | SUBROUTINE stp( kstp ) |
---|
| 58 | INTEGER, INTENT(in) :: kstp ! ocean time-step index |
---|
| 59 | #endif |
---|
| 60 | !!---------------------------------------------------------------------- |
---|
| 61 | !! *** ROUTINE stp *** |
---|
| 62 | !! |
---|
[3358] | 63 | !! ** Purpose : - Time stepping of SBC (surface boundary) |
---|
[3331] | 64 | !! |
---|
| 65 | !! ** Method : -1- Update forcings and data |
---|
[3358] | 66 | !! -2- Outputs and diagnostics |
---|
[3331] | 67 | !!---------------------------------------------------------------------- |
---|
| 68 | INTEGER :: indic ! error indicator if < 0 |
---|
| 69 | !! --------------------------------------------------------------------- |
---|
| 70 | |
---|
| 71 | #if defined key_agrif |
---|
| 72 | kstp = nit000 + Agrif_Nb_Step() |
---|
| 73 | # if defined key_iomput |
---|
[4166] | 74 | IF( Agrif_Nbstepint() == 0 ) CALL iom_swap( "nemo" ) |
---|
[3331] | 75 | # endif |
---|
| 76 | #endif |
---|
[4166] | 77 | IF( kstp == nit000 ) CALL iom_init( "nemo" ) ! iom_put initialization (must be done after nemo_init for AGRIF+XIOS+OASIS) |
---|
[3331] | 78 | IF( kstp /= nit000 ) CALL day( kstp ) ! Calendar (day was already called at nit000 in day_init) |
---|
[4166] | 79 | CALL iom_setkt( kstp, "nemo" ) ! say to iom that we are at time step kstp |
---|
[3331] | 80 | |
---|
| 81 | CALL sbc ( kstp ) ! Sea Boundary Condition (including sea-ice) |
---|
| 82 | |
---|
| 83 | CALL dia_wri( kstp ) ! ocean model: outputs |
---|
| 84 | |
---|
[3362] | 85 | indic = 0 ! although indic is not changed in stp_ctl |
---|
| 86 | ! need to keep the same interface |
---|
[3331] | 87 | CALL stp_ctl( kstp, indic ) |
---|
[3769] | 88 | #if defined key_iomput |
---|
[4166] | 89 | IF( kstp == nitend ) CALL iom_context_finalize( "nemo" ) ! needed for XIOS+AGRIF |
---|
[3769] | 90 | #endif |
---|
[3331] | 91 | ! |
---|
| 92 | IF( nn_timing == 1 .AND. kstp == nit000 ) CALL timing_reset |
---|
| 93 | ! |
---|
| 94 | END SUBROUTINE stp |
---|
| 95 | |
---|
| 96 | !!====================================================================== |
---|
| 97 | END MODULE step |
---|