- Timestamp:
- 2019-12-13T19:48:00+01:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
NEMO/branches/2019/dev_r11943_MERGE_2019/tests/STATION_ASF/MY_SRC/stpctl.F90
r11930 r12249 12 12 !! 3.7 ! 2016-09 (G. Madec) Remove solver 13 13 !! 4.0 ! 2017-04 (G. Madec) regroup global communications 14 !! 4.x ! 2019-10 (L. Brodeau) adapted for STATION_ASF test-case15 14 !!---------------------------------------------------------------------- 16 15 … … 18 17 !! stp_ctl : Control the run 19 18 !!---------------------------------------------------------------------- 20 !USE oce ! ocean dynamics and tracers variables21 19 USE dom_oce ! ocean space and time domain variables 22 !USE ice , ONLY : vt_i, u_ice, tm_i23 !24 20 USE sbc_oce ! surface fluxes and stuff 25 USE diawri 21 USE diawri ! Standard run outputs (dia_wri_state routine) 26 22 ! 27 23 USE in_out_manager ! I/O manager … … 42 38 !! Software governed by the CeCILL license (see ./LICENSE) 43 39 !!---------------------------------------------------------------------- 44 45 40 CONTAINS 46 41 47 SUBROUTINE stp_ctl( kt, kindic )42 SUBROUTINE stp_ctl( kt, Kbb, Kmm, kindic ) 48 43 !!---------------------------------------------------------------------- 49 44 !! *** ROUTINE stp_ctl *** … … 57 52 !! ** Actions : "time.step" file = last ocean time-step 58 53 !! "run.stat" file = run statistics 54 !! nstop indicator sheared among all local domain (lk_mpp=T) 59 55 !!---------------------------------------------------------------------- 60 56 INTEGER, INTENT(in ) :: kt ! ocean time-step index 57 INTEGER, INTENT(in ) :: Kbb, Kmm ! ocean time level index 61 58 INTEGER, INTENT(inout) :: kindic ! error indicator 62 59 !! … … 67 64 ! 68 65 ll_wrtstp = ( MOD( kt, sn_cfctl%ptimincr ) == 0 ) .OR. ( kt == nitend ) 69 ll_colruns = ll_wrtstp .AND. ( ln_ctl .OR.sn_cfctl%l_runstat )70 ll_wrtruns = ll_colruns 66 ll_colruns = ll_wrtstp .AND. ( sn_cfctl%l_runstat ) 67 ll_wrtruns = ll_colruns .AND. lwm 71 68 IF( kt == nit000 .AND. lwp ) THEN 72 69 WRITE(numout,*) … … 74 71 WRITE(numout,*) '~~~~~~~' 75 72 ! ! open time.step file 76 CALL ctl_opn( numstp, 'time.step', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp, narea )73 IF( lwm ) CALL ctl_opn( numstp, 'time.step', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp, narea ) 77 74 ! ! open run.stat file(s) at start whatever 78 75 ! ! the value of sn_cfctl%ptimincr 79 IF( l n_ctl .OR. sn_cfctl%l_runstat) THEN76 IF( lwm .AND. ( sn_cfctl%l_runstat ) ) THEN 80 77 CALL ctl_opn( numrun, 'run.stat', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp, narea ) 81 78 clname = 'run.stat.nc' … … 91 88 IF( kt == nit000 ) lsomeoce = COUNT( ssmask(:,:) == 1._wp ) > 0 92 89 ! 93 IF(l l_wrtstp) THEN !== current time step ==! ("time.step" file)90 IF(lwm .AND. ll_wrtstp) THEN !== current time step ==! ("time.step" file) 94 91 WRITE ( numstp, '(1x, i8)' ) kt 95 92 REWIND( numstp ) … … 103 100 IF( ll_colruns ) THEN 104 101 CALL mpp_max( "stpctl", zmax ) ! max over the global domain 102 nstop = NINT( zmax(3) ) ! nstop indicator sheared among all local domains 105 103 ENDIF 106 104 ! !== run statistics ==! ("run.stat" files) … … 114 112 END IF 115 113 ! !== error handling ==! 116 IF( ( ln_ctl .OR. lsomeoce ) .AND. ( & ! have use mpp_max (because ln_ctl=.T.) or contains some ocean points114 IF( ( sn_cfctl%l_glochk .OR. lsomeoce ) .AND. ( & ! domain contains some ocean points, check for sensible ranges 117 115 & zmax(1) > 5._wp .OR. & ! too large wind stress ( > 5 N/m^2 ) 118 116 & zmax(2) > 2000._wp .OR. & ! too large non-solar heat flux ( > 2000 W/m^2) … … 126 124 WRITE(ctmp6,*) ' ===> output of last computed fields in output.abort.nc file' 127 125 128 CALL dia_wri_state( 'output.abort' ) ! create an output.abort file126 CALL dia_wri_state( Kmm, 'output.abort' ) ! create an output.abort file 129 127 130 IF( .NOT. ln_ctl) THEN128 IF( .NOT. sn_cfctl%l_glochk ) THEN 131 129 WRITE(ctmp8,*) 'E R R O R message from sub-domain: ', narea 132 130 CALL ctl_stop( 'STOP', ctmp1, ' ', ctmp2, ' ', ctmp6, ' ' )
Note: See TracChangeset
for help on using the changeset viewer.