- Timestamp:
- 2017-04-11T15:10:20+02:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2017/dev_r7832_HPC08_lbclnk_3rd_dim/NEMOGCM/NEMO/OPA_SRC/stpctl.F90
r6140 r7897 9 9 !! NEMO 1.0 ! 2002-06 (G. Madec) F90: Free form and module 10 10 !! 2.0 ! 2009-07 (G. Madec) Add statistic for time-spliting 11 !! 3.7 ! 2016-09 (G. Madec) Remove solver 12 !! 4.0 ! 2017-04 (G. Madec) regroup 11 13 !!---------------------------------------------------------------------- 12 14 … … 27 29 PUBLIC stp_ctl ! routine called by step.F90 28 30 !!---------------------------------------------------------------------- 29 !! NEMO/OPA 3.3 , NEMO Consortium (2010)31 !! NEMO/OPA 4.0 , NEMO Consortium (2017) 30 32 !! $Id$ 31 33 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) … … 41 43 !! ** Method : - Save the time step in numstp 42 44 !! - Print it each 50 time steps 43 !! - Stop the run IF problem ( indic < 0 ) 45 !! - Stop the run IF problem encountered by setting indic=-3 46 !! Problems checked: U max>10 m/s and SSS min < 0 44 47 !! 45 48 !! ** Actions : 'time.step' file containing the last ocean time-step … … 51 54 INTEGER :: ji, jj, jk ! dummy loop indices 52 55 INTEGER :: ii, ij, ik ! local integers 53 REAL(wp) :: zumax, zsmin, zssh2 ! local scalars54 INTEGER , DIMENSION(3) :: ilocu!55 INTEGER, DIMENSION(2) :: ilocs !56 INTEGER , DIMENSION(3) :: ilocu ! 57 INTEGER , DIMENSION(2) :: ilocs ! 58 REAL(wp), DIMENSION(3) :: zmax ! 56 59 !!---------------------------------------------------------------------- 57 60 ! … … 60 63 WRITE(numout,*) 'stp_ctl : time-stepping control' 61 64 WRITE(numout,*) '~~~~~~~' 62 ! open time.step file65 ! ! open time.step file 63 66 CALL ctl_opn( numstp, 'time.step', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp, narea ) 67 ! ! open run.stat file 68 CALL ctl_opn( numrun, 'run.stat', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp, narea ) 64 69 ENDIF 65 70 ! 66 IF(lwp) WRITE ( numstp, '(1x, i8)' ) kt !* save the current time step in numstp67 IF(lwp) REWIND( numstp ) ! --------------------------71 IF(lwp) WRITE ( numstp, '(1x, i8)' ) kt !== current time step ==! ("time.step" file) 72 IF(lwp) REWIND( numstp ) 68 73 ! 69 ! !* Test maximum of velocity (zonal only) 70 ! ! ------------------------ 71 !! zumax = MAXVAL( ABS( un(:,:,:) ) ) ! slower than the following loop on NEC SX5 72 zumax = 0.e0 73 DO jk = 1, jpk 74 DO jj = 1, jpj 75 DO ji = 1, jpi 76 zumax = MAX(zumax,ABS(un(ji,jj,jk))) 77 END DO 78 END DO 79 END DO 80 IF( lk_mpp ) CALL mpp_max( zumax ) ! max over the global domain 74 ! !== test of extrema ==! 75 zmax(1) = MAXVAL( ABS( un(:,:,:) ) ) ! velocity max (zonal only) 76 zmax(2) = MAXVAL( -tsn(:,:,1,jp_sal) , mask = tmask(:,:,1) == 1._wp ) ! minus surface salinity max 77 zmax(3) = MAXVAL( sshn(:,:)*sshn(:,:), mask = tmask(:,:,1) == 1._wp ) ! ssh^2 max 81 78 ! 82 IF( MOD( kt, nwrite ) == 1 .AND. lwp ) WRITE(numout,*) ' ==>> time-step= ',kt,' abs(U) max: ', zumax79 IF( lk_mpp ) CALL mpp_max_multiple( zmax(:), 3 ) ! max over the global domain 83 80 ! 84 IF( zumax > 20.e0 ) THEN 81 IF( MOD( kt, nwrite ) == 1 .AND. lwp ) THEN 82 WRITE(numout,*) ' ==>> time-step= ',kt,' abs(U) max: ', zmax(1), ' SSS min:', - zmax(2) 83 ENDIF 84 ! 85 IF( zmax(1) > 10._wp ) THEN !* too large velocity ( > 10 m/s) 85 86 IF( lk_mpp ) THEN 86 CALL mpp_maxloc( ABS(un),umask,zumax,ii,ij,ik)87 CALL mpp_maxloc( ABS(un), umask, zmax(1), ii, ij, ik ) 87 88 ELSE 88 89 ilocu = MAXLOC( ABS( un(:,:,:) ) ) … … 95 96 WRITE(numout,*) ' stpctl: the zonal velocity is larger than 20 m/s' 96 97 WRITE(numout,*) ' ====== ' 97 WRITE(numout,9400) kt, z umax, ii, ij, ik98 WRITE(numout,9400) kt, zmax(1), ii, ij, ik 98 99 WRITE(numout,*) 99 WRITE(numout,*) ' output of last fields in numwso'100 WRITE(numout,*) ' output of last computed fields in output.abort.nc file' 100 101 ENDIF 101 102 kindic = -3 … … 103 104 9400 FORMAT (' kt=',i6,' max abs(U): ',1pg11.4,', i j k: ',3i5) 104 105 ! 105 ! !* Test minimum of salinity 106 ! ! ------------------------ 107 !! zsmin = MINVAL( tsn(:,:,1,jp_sal), mask = tmask(:,:,1) == 1.e0 ) slower than the following loop on NEC SX5 108 zsmin = 100._wp 109 DO jj = 2, jpjm1 110 DO ji = 1, jpi 111 IF( tmask(ji,jj,1) == 1) zsmin = MIN(zsmin,tsn(ji,jj,1,jp_sal)) 112 END DO 113 END DO 114 IF( lk_mpp ) CALL mpp_min( zsmin ) ! min over the global domain 115 ! 116 IF( MOD( kt, nwrite ) == 1 .AND. lwp ) WRITE(numout,*) ' ==>> time-step= ',kt,' SSS min:', zsmin 117 ! 118 IF( zsmin < 0.) THEN 119 IF (lk_mpp) THEN 120 CALL mpp_minloc ( tsn(:,:,1,jp_sal),tmask(:,:,1), zsmin, ii,ij ) 106 IF( -zmax(2) < 0._wp ) THEN !* negative salinity 107 IF( lk_mpp ) THEN 108 CALL mpp_minloc( tsn(:,:,1,jp_sal),tmask(:,:,1), - zmax(2), ii, ij ) 121 109 ELSE 122 ilocs = MINLOC( tsn(:,:,1,jp_sal), mask = tmask(:,:,1) == 1. e0)110 ilocs = MINLOC( tsn(:,:,1,jp_sal), mask = tmask(:,:,1) == 1._wp ) 123 111 ii = ilocs(1) + nimpp - 1 124 112 ij = ilocs(2) + njmpp - 1 … … 129 117 WRITE(numout,*) 'stp_ctl : NEGATIVE sea surface salinity' 130 118 WRITE(numout,*) '======= ' 131 WRITE(numout,9500) kt, zsmin, ii, ij119 WRITE(numout,9500) kt, -zmax(2), ii, ij 132 120 WRITE(numout,*) 133 121 WRITE(numout,*) ' output of last fields in numwso' … … 137 125 9500 FORMAT (' kt=',i6,' min SSS: ',1pg11.4,', i j: ',2i5) 138 126 ! 127 ! !== run statistics ==! ("run.stat" file) 128 IF(lwp) WRITE(numrun,9200) kt, zmax(3), zmax(1), - zmax(2) ! formerly called "solver.stat" file 139 129 ! 140 IF( lk_c1d ) RETURN ! No log file in case of 1D vertical configuration 141 142 ! log file (ssh statistics) 143 ! -------- !* ssh statistics (and others...) 144 IF( kt == nit000 .AND. lwp ) THEN ! open ssh statistics file (put in solver.stat file) 145 CALL ctl_opn( numsol, 'solver.stat', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp, narea ) 146 ENDIF 147 ! 148 zssh2 = SUM( sshn(:,:) * sshn(:,:) * tmask_i(:,:) ) 149 IF( lk_mpp ) CALL mpp_sum( zssh2 ) ! sum over the global domain 150 ! 151 IF(lwp) WRITE(numsol,9300) kt, zssh2, zumax, zsmin ! ssh statistics 152 ! 153 9200 FORMAT('it:', i8, ' iter:', i4, ' r: ',e16.10, ' b: ',e16.10 ) 154 9300 FORMAT(' it :', i8, ' ssh2: ', e16.10, ' Umax: ',e16.10,' Smin: ',e16.10) 130 9200 FORMAT(' it :', i8, ' ssh2: ', e16.10, ' Umax: ',e16.10,' Smin: ',e16.10) 155 131 ! 156 132 END SUBROUTINE stp_ctl
Note: See TracChangeset
for help on using the changeset viewer.