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 8784 – NEMO

Changeset 8784


Ignore:
Timestamp:
2017-11-22T12:32:41+01:00 (6 years ago)
Author:
gm
Message:

#1911 (ENHANCE-09): PART I.3 - improvement of stpctl.F90 (test NaN + test 2D salinity min, not just SSS

File:
1 edited

Legend:

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

    r8769 r8784  
    5757      INTEGER  ::   iih, ijh               ! local integers 
    5858      INTEGER  ::   iiu, iju, iku          !   -       - 
    59       INTEGER  ::   iis, ijs               !   -       - 
     59      INTEGER  ::   iis, ijs, iks          !   -       - 
    6060      REAL(wp) ::   zzz                    ! local real  
    61       INTEGER , DIMENSION(3) ::   ilocu 
    62       INTEGER , DIMENSION(2) ::   ilocs, iloch 
     61      INTEGER , DIMENSION(3) ::   ilocu, ilocs 
     62      INTEGER , DIMENSION(2) ::   iloch 
    6363      REAL(wp), DIMENSION(3) ::   zmax 
    6464      !!---------------------------------------------------------------------- 
     
    8282      zmax(1) = MAXVAL(  ABS( sshn(:,:) )  )                                  ! ssh max 
    8383      zmax(2) = MAXVAL(  ABS( un(:,:,:) )  )                                  ! velocity max (zonal only) 
    84       zmax(3) = MAXVAL( -tsn(:,:,1,jp_sal) , mask = tmask(:,:,1) == 1._wp )   ! minus surface salinity max 
     84      zmax(3) = MAXVAL( -tsn(:,:,:,jp_sal) , mask = tmask(:,:,:) == 1._wp )   ! minus salinity max 
    8585      ! 
    8686      IF( lk_mpp )   CALL mpp_max_multiple( zmax(:), 3 ) ! max over the global domain 
     
    8888      IF( MOD( kt, nwrite ) == 1 .AND. lwp ) THEN 
    8989         WRITE(numout,*) ' ==>> time-step= ', kt, ' |ssh| max: ',   zmax(1), ' |U| max: ', zmax(2),   & 
    90             &                                     ' SSS min: '  , - zmax(3) 
     90            &                                     ' S min: '    , - zmax(3) 
    9191      ENDIF 
    9292      ! 
     
    9696         &  ISNAN( zmax(1) + zmax(2) + zmax(3) )  ) THEN   ! NaN encounter in the tests 
    9797         IF( lk_mpp ) THEN 
    98             CALL mpp_maxloc( ABS(sshn)        , tmask(:,:,1), zzz, iih, ijh ) 
    99             CALL mpp_maxloc( ABS(un)          , umask(:,:,:), zzz, iiu, iju, iku ) 
    100             CALL mpp_minloc( tsn(:,:,1,jp_sal), tmask(:,:,1), zzz, iis, ijs ) 
     98            CALL mpp_maxloc( ABS(sshn)        , ssmask(:,:)  , zzz, iih, ijh ) 
     99            CALL mpp_maxloc( ABS(un)          , umask (:,:,:), zzz, iiu, iju, iku ) 
     100            CALL mpp_minloc( tsn(:,:,:,jp_sal), tmask (:,:,:), zzz, iis, ijs, iks ) 
    101101         ELSE 
    102             iloch = MINLOC( ABS( sshn(:,:) ) ) 
    103             ilocu = MAXLOC( ABS( un(:,:,:) ) ) 
    104             ilocs = MINLOC( tsn(:,:,1,jp_sal), mask = tmask(:,:,1) == 1._wp ) 
     102            iloch = MINLOC( ABS( sshn(:,:)   )                              ) 
     103            ilocu = MAXLOC( ABS( un  (:,:,:) )                              ) 
     104            ilocs = MINLOC( tsn(:,:,:,jp_sal) , mask = tmask(:,:,:) == 1._wp ) 
    105105            iih = iloch(1) + nimpp - 1   ;   ijh = iloch(2) + njmpp - 1 
    106106            iiu = ilocu(1) + nimpp - 1   ;   iju = ilocu(2) + njmpp - 1   ;   iku = ilocu(3) 
    107             iis = ilocs(1) + nimpp - 1   ;   ijs = ilocs(2) + njmpp - 1 
     107            iis = ilocs(1) + nimpp - 1   ;   ijs = ilocs(2) + njmpp - 1   ;   iks = ilocu(3) 
    108108         ENDIF 
    109109         IF(lwp) THEN 
    110110            WRITE(numout,cform_err) 
    111             WRITE(numout,*) ' stpctl: |ssh| > 10 m   or   |U| > 10 m/s   or   SSS < 0   or   NaN encounter in the tests' 
     111            WRITE(numout,*) ' stpctl: |ssh| > 10 m   or   |U| > 10 m/s   or   S < 0   or   NaN encounter in the tests' 
    112112            WRITE(numout,*) ' ====== ' 
    113113            WRITE(numout,9100) kt,   zmax(1), iih, ijh 
    114114            WRITE(numout,9200) kt,   zmax(2), iiu, iju, iku 
    115             WRITE(numout,9300) kt, - zmax(3), iis, ijs 
     115            WRITE(numout,9300) kt, - zmax(3), iis, ijs, iks 
    116116            WRITE(numout,*) 
    117117            WRITE(numout,*) '          output of last computed fields in output.abort.nc file' 
     
    1211219100  FORMAT (' kt=',i8,'   |ssh| max: ',1pg11.4,', at  i j  : ',2i5) 
    1221229200  FORMAT (' kt=',i8,'   |U|   max: ',1pg11.4,', at  i j k: ',3i5) 
    123 9300  FORMAT (' kt=',i8,'   SSS   min: ',1pg11.4,', at  i j  : ',2i5) 
     1239300  FORMAT (' kt=',i8,'   S     min: ',1pg11.4,', at  i j  : ',2i5) 
    124124      ! 
    125125      !                                            !==  run statistics  ==!   ("run.stat" file) 
    126126      IF(lwp) WRITE(numrun,9400) kt, zmax(1), zmax(2), - zmax(3) 
    127127      ! 
    128 9400  FORMAT(' it :', i8, '    |ssh|_max: ', e16.10, ' |U|_max: ',e16.10,' SSS_min: ',e16.10) 
     1289400  FORMAT(' it :', i8, '    |ssh|_max: ', e16.10, ' |U|_max: ',e16.10,' S_min: ',e16.10) 
    129129      ! 
    130130   END SUBROUTINE stp_ctl 
Note: See TracChangeset for help on using the changeset viewer.