[11637] | 1 | MODULE step_c1d |
---|
| 2 | !!====================================================================== |
---|
| 3 | !! *** MODULE step_c1d *** |
---|
| 4 | !! Time-stepping : manager of the ocean, tracer and ice time stepping - c1d case |
---|
| 5 | !!====================================================================== |
---|
| 6 | !! History : 2.0 ! 2004-04 (C. Ethe) adapted from step.F90 for C1D |
---|
| 7 | !! 3.0 ! 2008-04 (G. Madec) redo the adaptation to include SBC |
---|
| 8 | !!---------------------------------------------------------------------- |
---|
| 9 | #if defined key_c1d |
---|
| 10 | !!---------------------------------------------------------------------- |
---|
| 11 | !! 'key_c1d' 1D Configuration |
---|
| 12 | !!---------------------------------------------------------------------- |
---|
| 13 | !! stp_c1d : NEMO system time-stepping in c1d case |
---|
| 14 | !!---------------------------------------------------------------------- |
---|
| 15 | USE step_oce ! time stepping definition modules |
---|
| 16 | !LB:USE dyncor_c1d ! Coriolis term (c1d case) (dyn_cor_1d ) |
---|
| 17 | !LB:USE dynnxt ! time-stepping (dyn_nxt routine) |
---|
| 18 | !LB:USE dyndmp ! U & V momentum damping (dyn_dmp routine) |
---|
| 19 | USE restart ! restart |
---|
| 20 | |
---|
| 21 | IMPLICIT NONE |
---|
| 22 | PRIVATE |
---|
| 23 | |
---|
| 24 | PUBLIC stp_c1d ! called by nemogcm.F90 |
---|
| 25 | |
---|
| 26 | !!---------------------------------------------------------------------- |
---|
| 27 | !! NEMO/OCE 4.0 , NEMO Consortium (2018) |
---|
| 28 | !! $Id: step_c1d.F90 10068 2018-08-28 14:09:04Z nicolasmartin $ |
---|
| 29 | !! Software governed by the CeCILL license (see ./LICENSE) |
---|
| 30 | !!---------------------------------------------------------------------- |
---|
| 31 | CONTAINS |
---|
| 32 | |
---|
| 33 | SUBROUTINE stp_c1d( kstp ) |
---|
| 34 | !!---------------------------------------------------------------------- |
---|
| 35 | !! *** ROUTINE stp_c1d *** |
---|
| 36 | !! |
---|
| 37 | !! ** Purpose : - Time stepping of SBC including sea ice (dynamic and thermodynamic eqs.) |
---|
| 38 | !! - Time stepping of OPA (momentum and active tracer eqs.) |
---|
| 39 | !! - Time stepping of TOP (passive tracer eqs.) |
---|
| 40 | !! |
---|
| 41 | !! ** Method : -1- Update forcings and data |
---|
| 42 | !! -2- Update vertical ocean physics |
---|
| 43 | !! -3- Compute the t and s trends |
---|
| 44 | !! -4- Update t and s |
---|
| 45 | !! -5- Compute the momentum trends |
---|
| 46 | !! -6- Update the horizontal velocity |
---|
| 47 | !! -7- Compute the diagnostics variables (rd,N2, div,cur,w) |
---|
| 48 | !! -8- Outputs and diagnostics |
---|
| 49 | !!---------------------------------------------------------------------- |
---|
| 50 | INTEGER, INTENT(in) :: kstp ! ocean time-step index |
---|
| 51 | ! |
---|
| 52 | INTEGER :: jk ! dummy loop indice |
---|
| 53 | INTEGER :: indic ! error indicator if < 0 |
---|
| 54 | !! --------------------------------------------------------------------- |
---|
| 55 | |
---|
| 56 | indic = 0 ! reset to no error condition |
---|
| 57 | IF( kstp == nit000 ) CALL iom_init( "nemo") ! iom_put initialization (must be done after nemo_init for AGRIF+XIOS+OASIS) |
---|
| 58 | IF( kstp /= nit000 ) CALL day( kstp ) ! Calendar (day was already called at nit000 in day_init) |
---|
| 59 | CALL iom_setkt( kstp - nit000 + 1, "nemo" ) ! say to iom that we are at time step kstp |
---|
| 60 | |
---|
| 61 | CALL sbc ( kstp ) ! Sea Boundary Condition (including sea-ice) |
---|
| 62 | |
---|
| 63 | CALL dia_wri( kstp ) ! ocean model: outputs |
---|
| 64 | |
---|
| 65 | |
---|
| 66 | !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> |
---|
| 67 | ! Control |
---|
| 68 | !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
---|
[11930] | 69 | CALL stp_ctl( kstp, indic ) |
---|
| 70 | IF( indic < 0 ) THEN |
---|
| 71 | CALL ctl_stop( 'step: indic < 0' ) |
---|
| 72 | CALL dia_wri_state( 'output.abort' ) |
---|
| 73 | ENDIF |
---|
[11637] | 74 | |
---|
| 75 | IF( kstp == nit000 ) CALL iom_close( numror ) ! close input ocean restart file |
---|
| 76 | |
---|
[11930] | 77 | !#LB: from C1D: |
---|
[11637] | 78 | IF( lrst_oce ) CALL rst_write( kstp ) ! write output ocean restart file |
---|
| 79 | ! |
---|
| 80 | #if defined key_iomput |
---|
| 81 | IF( kstp == nitend .OR. indic < 0 ) CALL xios_context_finalize() ! needed for XIOS |
---|
| 82 | #endif |
---|
| 83 | |
---|
[11930] | 84 | !#LB: from SAS" |
---|
[11637] | 85 | !#if defined key_iomput |
---|
| 86 | ! IF( kstp == nitrst ) THEN |
---|
| 87 | ! IF(.NOT.lwxios) THEN |
---|
| 88 | ! CALL iom_close( numrow ) |
---|
| 89 | ! ELSE |
---|
| 90 | ! CALL iom_context_finalize( cwxios_context ) |
---|
| 91 | ! ENDIF |
---|
| 92 | ! lrst_oce = .FALSE. |
---|
| 93 | ! ENDIF |
---|
| 94 | ! IF( kstp == nitend .OR. indic < 0 ) THEN |
---|
| 95 | ! CALL iom_context_finalize( cxios_context ) ! needed for XIOS+AGRIF |
---|
| 96 | ! ENDIF |
---|
| 97 | !#endif |
---|
| 98 | ! ! |
---|
| 99 | ! IF( ln_timing .AND. kstp == nit000 ) CALL timing_reset |
---|
| 100 | ! |
---|
| 101 | END SUBROUTINE stp_c1d |
---|
| 102 | |
---|
| 103 | #else |
---|
| 104 | !!---------------------------------------------------------------------- |
---|
| 105 | !! Default key NO 1D Config |
---|
| 106 | !!---------------------------------------------------------------------- |
---|
| 107 | CONTAINS |
---|
| 108 | SUBROUTINE stp_c1d ( kt ) ! dummy routine |
---|
| 109 | IMPLICIT NONE |
---|
| 110 | INTEGER, INTENT( in ) :: kt |
---|
| 111 | WRITE(*,*) 'stp_c1d: You should not have seen this print! error?', kt |
---|
| 112 | END SUBROUTINE stp_c1d |
---|
| 113 | #endif |
---|
| 114 | |
---|
| 115 | !!====================================================================== |
---|
| 116 | END MODULE step_c1d |
---|