[3331] | 1 | MODULE stpctl |
---|
| 2 | !!====================================================================== |
---|
| 3 | !! *** MODULE stpctl *** |
---|
| 4 | !! Ocean run control : gross check of the ocean time stepping |
---|
| 5 | !! version for standalone surface scheme |
---|
| 6 | !!====================================================================== |
---|
| 7 | !! History : OPA ! 1991-03 (G. Madec) Original code |
---|
| 8 | !! 6.0 ! 1992-06 (M. Imbard) |
---|
| 9 | !! 8.0 ! 1997-06 (A.M. Treguier) |
---|
| 10 | !! NEMO 1.0 ! 2002-06 (G. Madec) F90: Free form and module |
---|
| 11 | !! 2.0 ! 2009-07 (G. Madec) Add statistic for time-spliting |
---|
| 12 | !! 3.5 ! 2012-03 (S. Alderson) |
---|
[9267] | 13 | !! 4.0 ! 2017-04 (G. Madec) regroup global communications |
---|
[3331] | 14 | !!---------------------------------------------------------------------- |
---|
| 15 | |
---|
| 16 | !!---------------------------------------------------------------------- |
---|
| 17 | !! stp_ctl : Control the run |
---|
| 18 | !!---------------------------------------------------------------------- |
---|
| 19 | USE oce ! ocean dynamics and tracers variables |
---|
| 20 | USE dom_oce ! ocean space and time domain variables |
---|
[9267] | 21 | USE ice , ONLY : vt_i, u_ice, tm_i |
---|
| 22 | ! |
---|
[3331] | 23 | USE in_out_manager ! I/O manager |
---|
| 24 | USE lbclnk ! ocean lateral boundary conditions (or mpp link) |
---|
| 25 | USE lib_mpp ! distributed memory computing |
---|
| 26 | |
---|
| 27 | IMPLICIT NONE |
---|
| 28 | PRIVATE |
---|
| 29 | |
---|
| 30 | PUBLIC stp_ctl ! routine called by step.F90 |
---|
| 31 | !!---------------------------------------------------------------------- |
---|
[9267] | 32 | !! NEMO/OPA 4.0 , NEMO Consortium (2017) |
---|
[5215] | 33 | !! $Id$ |
---|
[3331] | 34 | !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) |
---|
| 35 | !!---------------------------------------------------------------------- |
---|
| 36 | |
---|
| 37 | CONTAINS |
---|
| 38 | |
---|
| 39 | SUBROUTINE stp_ctl( kt, kindic ) |
---|
| 40 | !!---------------------------------------------------------------------- |
---|
| 41 | !! *** ROUTINE stp_ctl *** |
---|
| 42 | !! |
---|
| 43 | !! ** Purpose : Control the run |
---|
| 44 | !! |
---|
| 45 | !! ** Method : - Save the time step in numstp |
---|
| 46 | !! - Print it each 50 time steps |
---|
| 47 | !! |
---|
[9267] | 48 | !! ** Actions : "time.step" file = last ocean time-step |
---|
| 49 | !! "run.stat" file = run statistics |
---|
[3331] | 50 | !! |
---|
| 51 | !!---------------------------------------------------------------------- |
---|
[9267] | 52 | INTEGER, INTENT( in ) :: kt ! ocean time-step index |
---|
| 53 | INTEGER, INTENT( inout ) :: kindic ! indicator of solver convergence |
---|
| 54 | !! |
---|
| 55 | REAL(wp), DIMENSION(3) :: zmax |
---|
[3331] | 56 | !!---------------------------------------------------------------------- |
---|
| 57 | |
---|
| 58 | IF( kt == nit000 .AND. lwp ) THEN |
---|
| 59 | WRITE(numout,*) |
---|
| 60 | WRITE(numout,*) 'stp_ctl : time-stepping control' |
---|
| 61 | WRITE(numout,*) '~~~~~~~' |
---|
[9267] | 62 | ! ! open time.step file |
---|
[3331] | 63 | CALL ctl_opn( numstp, 'time.step', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp, narea ) |
---|
[9267] | 64 | ! ! open run.stat file |
---|
| 65 | CALL ctl_opn( numrun, 'run.stat', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp, narea ) |
---|
[3331] | 66 | ENDIF |
---|
[9267] | 67 | ! |
---|
| 68 | IF(lwp) THEN !== current time step ==! ("time.step" file) |
---|
| 69 | WRITE ( numstp, '(1x, i8)' ) kt |
---|
| 70 | REWIND( numstp ) |
---|
| 71 | ENDIF |
---|
| 72 | ! !== test of extrema ==! |
---|
| 73 | zmax(1) = MAXVAL( vt_i (:,:) ) ! max ice thickness |
---|
| 74 | zmax(2) = MAXVAL( ABS( u_ice(:,:) ) ) ! max ice velocity (zonal only) |
---|
| 75 | zmax(3) = MAXVAL( -tm_i (:,:)+273.15_wp , mask = ssmask(:,:) == 1._wp ) ! min ice temperature |
---|
| 76 | ! |
---|
| 77 | IF( lk_mpp ) THEN |
---|
| 78 | CALL mpp_max_multiple( zmax(:), 3 ) ! max over the global domain |
---|
| 79 | ENDIF |
---|
| 80 | ! |
---|
| 81 | IF( MOD( kt, nwrite ) == 1 .AND. lwp ) THEN |
---|
| 82 | WRITE(numout,*) ' ==>> time-step= ', kt, ' vt_i max: ', zmax(1), ' |u_ice| max: ', zmax(2), ' tm_i min: ', -zmax(3) |
---|
| 83 | ENDIF |
---|
[3331] | 84 | |
---|
[9267] | 85 | ! !== run statistics ==! ("run.stat" file) |
---|
| 86 | IF(lwp) WRITE(numrun,9400) kt, zmax(1), zmax(2), -zmax(3) |
---|
| 87 | ! |
---|
| 88 | 9400 FORMAT(' it :', i8, ' vt_i_max: ', e16.10, ' |u_ice|_max: ',e16.10,' tm_i_min: ',e16.10) |
---|
| 89 | ! |
---|
[3331] | 90 | END SUBROUTINE stp_ctl |
---|
| 91 | |
---|
| 92 | !!====================================================================== |
---|
| 93 | END MODULE stpctl |
---|