New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
Changeset 7902 for branches/2017/dev_r7832_HPC08_lbclnk_3rd_dim/NEMOGCM/NEMO – NEMO

Ignore:
Timestamp:
2017-04-13T07:28:04+02:00 (7 years ago)
Author:
gm
Message:

#1880: (HPC-08) stp_cfl, check |ssh| instead of ssh2

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2017/dev_r7832_HPC08_lbclnk_3rd_dim/NEMOGCM/NEMO/OPA_SRC/stpctl.F90

    r7901 r7902  
    4444      !!              - Print it each 50 time steps 
    4545      !!              - Stop the run IF problem encountered by setting indic=-3 
    46       !!                Problems checked: |U| and |ssh| maximum larger than 10 m/s  
    47       !!                                  sea surface salinity (SSS) minimum < 0 
     46      !!                Problems checked: |U| maximum larger than 10 m/s  
     47      !!                                  negative sea surface salinity 
    4848      !! 
    49       !! ** Actions :   'time.step' file containing the last ocean time-step 
    50       !!                 
     49      !! ** Actions :   "time.step" file = last ocean time-step 
     50      !!                "run.stat"  file = run statistics 
    5151      !!---------------------------------------------------------------------- 
    5252      INTEGER, INTENT(in   ) ::   kt       ! ocean time-step index 
     
    5454      !! 
    5555      INTEGER  ::   ji, jj, jk             ! dummy loop indices 
    56       INTEGER  ::   ii, ij, ik             ! local integers 
    57       REAL(wp) ::   zzt                    ! local real  
    58       INTEGER , DIMENSION(3) ::   ilocu    !  
    59       INTEGER , DIMENSION(2) ::   ilocs    !  
    60       REAL(wp), DIMENSION(3) ::   zmax     !   
     56      INTEGER  ::   iih, ijh               ! local integers 
     57      INTEGER  ::   iiu, iju, iku          !   -       - 
     58      INTEGER  ::   iis, ijs               !   -       - 
     59      REAL(wp) ::   zzz                    ! local real  
     60      INTEGER , DIMENSION(3) ::   ilocu 
     61      INTEGER , DIMENSION(2) ::   ilocs, iloch 
     62      REAL(wp), DIMENSION(3) ::   zmax 
    6163      !!---------------------------------------------------------------------- 
    6264      ! 
     
    7678      ENDIF 
    7779      ! 
    78       !                                            !==  test of extrema  ==! 
    79       zmax(1) = MAXVAL(  ABS( un(:,:,:) )  )                                  ! velocity max (zonal only) 
    80       zmax(2) = MAXVAL( -tsn(:,:,1,jp_sal) , mask = tmask(:,:,1) == 1._wp )   ! minus surface salinity max 
    81       zmax(3) = MAXVAL( sshn(:,:)*sshn(:,:), mask = tmask(:,:,1) == 1._wp )   ! ssh^2 max 
     80      !                                   !==  test of extrema  ==! 
     81      zmax(1) = MAXVAL(  ABS( sshn(:,:) )  )                                  ! ssh max 
     82      zmax(2) = MAXVAL(  ABS( un(:,:,:) )  )                                  ! velocity max (zonal only) 
     83      zmax(3) = MAXVAL( -tsn(:,:,1,jp_sal) , mask = tmask(:,:,1) == 1._wp )   ! minus surface salinity max 
    8284      ! 
    83       IF( lk_mpp )   CALL mpp_max_multiple( zmax(:), 3 )          ! max over the global domain 
     85      IF( lk_mpp )   CALL mpp_max_multiple( zmax(:), 3 ) ! max over the global domain 
    8486      ! 
    8587      IF( MOD( kt, nwrite ) == 1 .AND. lwp ) THEN 
     
    8789      ENDIF 
    8890      ! 
    89       IF( zmax(1) > 10._wp ) THEN                     !* too large velocity ( > 10 m/s) 
     91      IF ( zmax(2) > 10._wp .OR.   &                     ! too large sea surface height ( > 10 m) 
     92         & zmax(2) > 10._wp .OR.   &                     ! too large velocity ( > 10 m/s) 
     93         & zmax(3) >  0._wp ) THEN                       ! negative sea surface salinity 
    9094         IF( lk_mpp ) THEN 
    91             CALL mpp_maxloc( ABS(un), umask, zmax(1), ii, ij, ik ) 
     95            CALL mpp_maxloc( ABS(sshn)        , tmask(:,:,1), zzz, iih, ijh ) 
     96            CALL mpp_maxloc( ABS(un)          , umask       , zzz, iiu, iju, iku ) 
     97            CALL mpp_minloc( tsn(:,:,1,jp_sal), tmask(:,:,1), zzz, iis, ijs ) 
    9298         ELSE 
     99            iloch = MINLOC( ABS( sshn(:,:) ) ) 
    93100            ilocu = MAXLOC( ABS( un(:,:,:) ) ) 
    94             ii = ilocu(1) + nimpp - 1 
    95             ij = ilocu(2) + njmpp - 1 
    96             ik = ilocu(3) 
     101            ilocs = MINLOC( tsn(:,:,1,jp_sal), mask = tmask(:,:,1) == 1._wp ) 
     102            iih = iloch(1) + nimpp - 1   ;   ijh = iloch(2) + njmpp - 1 
     103            iiu = ilocu(1) + nimpp - 1   ;   iju = ilocu(2) + njmpp - 1   ;   iku = ilocu(3) 
     104            iis = ilocs(1) + nimpp - 1   ;   ijs = ilocs(2) + njmpp - 1 
    97105         ENDIF 
    98106         IF(lwp) THEN 
    99107            WRITE(numout,cform_err) 
    100             WRITE(numout,*) ' stpctl: the zonal velocity is larger than 20 m/s' 
     108            WRITE(numout,*) ' stpctl: |ssh| > 10 m   or   |U| > 10 m/s   or   SSS < 0' 
    101109            WRITE(numout,*) ' ====== ' 
    102             WRITE(numout,9400) kt, zmax(1), ii, ij, ik 
     110            WRITE(numout,9100) kt,   zmax(1), iih, ijh 
     111            WRITE(numout,9200) kt,   zmax(2), iiu, iju, iku 
     112            WRITE(numout,9300) kt, - zmax(3), iis, ijs 
    103113            WRITE(numout,*) 
    104114            WRITE(numout,*) '          output of last computed fields in output.abort.nc file' 
     
    106116         kindic = -3 
    107117      ENDIF 
    108 9400  FORMAT (' kt=',i6,' max abs(U): ',1pg11.4,', i j k: ',3i5) 
    109       ! 
    110       IF( -zmax(2) < 0._wp ) THEN                     !* negative salinity 
    111          IF( lk_mpp ) THEN 
    112             CALL mpp_minloc( tsn(:,:,1,jp_sal),tmask(:,:,1), zzt, ii, ij ) 
    113          ELSE 
    114             ilocs = MINLOC( tsn(:,:,1,jp_sal), mask = tmask(:,:,1) == 1._wp ) 
    115             ii = ilocs(1) + nimpp - 1 
    116             ij = ilocs(2) + njmpp - 1 
    117          ENDIF 
    118          ! 
    119          IF(lwp) THEN 
    120             WRITE(numout,cform_err) 
    121             WRITE(numout,*) 'stp_ctl : NEGATIVE sea surface salinity' 
    122             WRITE(numout,*) '======= ' 
    123             WRITE(numout,9500) kt, -zmax(2), ii, ij 
    124             WRITE(numout,*) 
    125             WRITE(numout,*) '          output of last fields in numwso' 
    126          ENDIF 
    127          kindic = -3 
    128       ENDIF 
    129 9500  FORMAT (' kt=',i6,' min SSS: ',1pg11.4,', i j: ',2i5) 
     1189100  FORMAT (' kt=',i8,'   |ssh| max: ',1pg11.4,', at  i j  : ',2i5) 
     1199200  FORMAT (' kt=',i8,'   |U|   max: ',1pg11.4,', at  i j k: ',3i5) 
     1209300  FORMAT (' kt=',i8,'   SSS   min: ',1pg11.4,', at  i j  : ',2i5) 
    130121      ! 
    131122      !                                            !==  run statistics  ==!   ("run.stat" file) 
    132       IF(lwp) WRITE(numrun,9200) kt, zmax(3), zmax(1), - zmax(2)      !  formerly called "solver.stat" file 
     123      IF(lwp) WRITE(numrun,9400) kt, zmax(1), zmax(2), - zmax(3) 
    133124      ! 
    134 9200  FORMAT(' it :', i8, ' ssh2: ', e16.10, ' Umax: ',e16.10,' Smin: ',e16.10) 
     1259400  FORMAT(' it :', i8, '    |ssh|max: ', e16.10, ' |U|max: ',e16.10,' SSS min: ',e16.10) 
    135126      ! 
    136127   END SUBROUTINE stp_ctl 
Note: See TracChangeset for help on using the changeset viewer.