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 15422 for NEMO/branches/UKMO/r14075_India_uncoupled/src/OCE/stpctl.F90 – NEMO

Ignore:
Timestamp:
2021-10-21T11:19:25+02:00 (3 years ago)
Author:
jcastill
Message:

Changes tested so that they can merged with the CO9 Met Office branch - jpmax_harmo should be 34 with FES14 tides, but the last components are not used anyway

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/UKMO/r14075_India_uncoupled/src/OCE/stpctl.F90

    r14075 r15422  
    126126         zmax(1) = MAXVAL(  ABS( sshn(:,:) )  )                               ! ssh max 
    127127      ENDIF 
    128       zmax(2) = MAXVAL(  ABS( un(:,:,:) )  )                                  ! velocity max (zonal only) 
     128      zmax(2) = MAXVAL(  un(:,:,:)*un(:,:,:) + vn(:,:,:)*vn(:,:,:)  )         ! velocity max 
    129129      llmsk(:,:,:) = tmask(:,:,:) == 1._wp 
    130130      IF( COUNT( llmsk(:,:,:) ) > 0 ) THEN   ! avoid huge values sent back for land processors...       
     
    167167      !                                   !==  error handling  ==! 
    168168      IF(   zmax(1) >   20._wp .OR.   &                    ! too large sea surface height ( > 20 m ) 
    169          &  zmax(2) >   10._wp .OR.   &                    ! too large velocity ( > 10 m/s) 
     169         &  zmax(2) >  100._wp .OR.   &                    ! too large velocity ( > 10 m/s) 
    170170         &  zmax(3) >=   0._wp .OR.   &                    ! negative or zero sea surface salinity 
    171171         &  zmax(4) >= 100._wp .OR.   &                    ! too large sea surface salinity ( > 100 ) 
     
    177177            IF( lwm .AND. kt /= nitend )   istatus = NF90_CLOSE(idrun) 
    178178            CALL mpp_maxloc( 'stpctl', ABS(sshn)        , ssmask(:,:)  , zzz, ih(1:2)  )   ;   ih(3) = 0 
    179             CALL mpp_maxloc( 'stpctl', ABS(un)          , umask (:,:,:), zzz, iu  ) 
     179            CALL mpp_maxloc( 'stpctl', un*un + vn*vn    , umask (:,:,:), zzz, iu  ) 
    180180            CALL mpp_minloc( 'stpctl', tsn(:,:,:,jp_sal), tmask (:,:,:), zzz, is1 ) 
    181181            CALL mpp_maxloc( 'stpctl', tsn(:,:,:,jp_sal), tmask (:,:,:), zzz, is2 ) 
     
    192192         ELSE 
    193193            ih(1:2)= MAXLOC( ABS( sshn(:,:)   )                              ) + (/ nimpp - 1, njmpp - 1    /)   ;   ih(3) = 0 
    194             iu(:)  = MAXLOC( ABS( un  (:,:,:) )                              ) + (/ nimpp - 1, njmpp - 1, 0 /) 
     194            iu(:)  = MAXLOC( un(:,:,:)*un(:,:,:) + vn(:,:,:)*vn(:,:,:)       ) + (/ nimpp - 1, njmpp - 1, 0 /) 
    195195            is1(:) = MINLOC( tsn(:,:,:,jp_sal), mask = tmask(:,:,:) == 1._wp ) + (/ nimpp - 1, njmpp - 1, 0 /) 
    196196            is2(:) = MAXLOC( tsn(:,:,:,jp_sal), mask = tmask(:,:,:) == 1._wp ) + (/ nimpp - 1, njmpp - 1, 0 /) 
     
    200200         WRITE(ctmp1,*) ' stp_ctl: |ssh| > 20 m  or  |U| > 10 m/s  or  S <= 0  or  S >= 100  or  NaN encounter in the tests' 
    201201         CALL wrt_line(ctmp2, kt, ' |ssh| max ',   zmax(1), ih , iareasum(1), iareamin(1), iareamax(1) )  
    202          CALL wrt_line(ctmp3, kt, ' |U|   max ',   zmax(2), iu , iareasum(2), iareamin(2), iareamax(2) )  
     202         CALL wrt_line(ctmp3, kt, ' Vel2  max ',   zmax(2), iu , iareasum(2), iareamin(2), iareamax(2) )  
    203203         CALL wrt_line(ctmp4, kt, ' Sal   min ', - zmax(3), is1, iareasum(3), iareamin(3), iareamax(3) )  
    204204         CALL wrt_line(ctmp5, kt, ' Sal   max ',   zmax(4), is2, iareasum(4), iareamin(4), iareamax(4) )  
     
    226226      ENDIF 
    227227      ! 
    228 9500  FORMAT(' it :', i8, '    |ssh|_max: ', D23.16, ' |U|_max: ', D23.16,' S_min: ', D23.16,' S_max: ', D23.16) 
     2289500  FORMAT(' it :', i8, '    |ssh|_max: ', D23.16, ' Vel2_max: ', D23.16,' S_min: ', D23.16,' S_max: ', D23.16) 
    229229      ! 
    230230   END SUBROUTINE stp_ctl 
Note: See TracChangeset for help on using the changeset viewer.