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 13458 for NEMO/trunk/src/SAS – NEMO

Changeset 13458 for NEMO/trunk/src/SAS


Ignore:
Timestamp:
2020-09-11T11:22:24+02:00 (4 years ago)
Author:
smasson
Message:

trunk: mpp_min(max)loc testing only inner domain, see #2521

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/trunk/src/SAS/stpctl.F90

    r13136 r13458  
    2020   USE dom_oce         ! ocean space and time domain variables  
    2121   USE ice      , ONLY : vt_i, u_ice, tm_i 
     22   USE phycst   , ONLY : rt0 
    2223   ! 
    2324   USE diawri          ! Standard run outputs       (dia_wri_state routine) 
     
    4849      !! 
    4950      !! ** Method  : - Save the time step in numstp 
    50       !!              - Print it each 50 time steps 
    5151      !!              - Stop the run IF problem encountered by setting nstop > 0 
    5252      !!                Problems checked: ice thickness maximum > 100 m 
     
    111111      !                                   !==            test of local extrema           ==! 
    112112      !                                   !==  done by all processes at every time step  ==! 
    113       llmsk(:,:) = tmask(:,:,1) == 1._wp 
     113      ! 
     114      llmsk(   1:Nis1,:) = .FALSE.                                              ! exclude halos from the checked region 
     115      llmsk(Nie1: jpi,:) = .FALSE. 
     116      llmsk(:,   1:Njs1) = .FALSE. 
     117      llmsk(:,Nje1: jpj) = .FALSE. 
     118      ! 
     119      llmsk(Nis0:Nie0,Njs0:Nje0) = tmask(Nis0:Nie0,Njs0:Nje0,1) == 1._wp   ! test only the inner domain 
    114120      IF( COUNT( llmsk(:,:) ) > 0 ) THEN   ! avoid huge values sent back for land processors... 
    115          zmax(1) = MAXVAL(      vt_i (:,:)            , mask = llmsk )   ! max ice thickness 
    116          zmax(2) = MAXVAL( ABS( u_ice(:,:) )          , mask = llmsk )   ! max ice velocity (zonal only) 
    117          zmax(3) = MAXVAL(     -tm_i (:,:) + 273.15_wp, mask = llmsk )   ! min ice temperature 
     121         zmax(1) = MAXVAL(      vt_i (:,:)      , mask = llmsk )   ! max ice thickness 
     122         zmax(2) = MAXVAL( ABS( u_ice(:,:) )    , mask = llmsk )   ! max ice velocity (zonal only) 
     123         zmax(3) = MAXVAL(     -tm_i (:,:) + rt0, mask = llmsk )   ! min ice temperature (in degC) 
    118124      ELSE 
    119125         IF( ll_colruns ) THEN    ! default value: must not be kept when calling mpp_max -> must be as small as possible 
     
    154160            IF( lwm .AND. kt /= nitend )   istatus = NF90_CLOSE(nrunid) 
    155161            ! get global loc on the min/max 
    156             CALL mpp_maxloc( 'stpctl',      vt_i(:,:)            , tmask(:,:,1), zzz, iloc(1:2,1) )   ! mpp_maxloc ok if mask = F  
    157             CALL mpp_maxloc( 'stpctl',ABS( u_ice(:,:) )          , tmask(:,:,1), zzz, iloc(1:2,2) ) 
    158             CALL mpp_minloc( 'stpctl',      tm_i(:,:) - 273.15_wp, tmask(:,:,1), zzz, iloc(1:2,3) ) 
     162            CALL mpp_maxloc( 'stpctl',      vt_i(:,:)      , llmsk, zzz, iloc(1:2,1) )   ! mpp_maxloc ok if mask = F  
     163            CALL mpp_maxloc( 'stpctl',ABS( u_ice(:,:) )    , llmsk, zzz, iloc(1:2,2) ) 
     164            CALL mpp_minloc( 'stpctl',      tm_i(:,:) - rt0, llmsk, zzz, iloc(1:2,3) ) 
    159165            ! find which subdomain has the max. 
    160166            iareamin(:) = jpnij+1   ;   iareamax(:) = 0   ;   iareasum(:) = 0 
     
    169175         ELSE                    ! find local min and max locations: 
    170176            ! if we are here, this means that the subdomain contains some oce points -> no need to test the mask used in maxloc 
    171             iloc(1:2,1) = MAXLOC(       vt_i(:,:)            , mask = llmsk ) + (/ nimpp - 1, njmpp - 1/) 
    172             iloc(1:2,2) = MAXLOC( ABS( u_ice(:,:) )          , mask = llmsk ) + (/ nimpp - 1, njmpp - 1/) 
    173             iloc(1:2,3) = MINLOC(       tm_i(:,:) - 273.15_wp, mask = llmsk ) + (/ nimpp - 1, njmpp - 1/) 
     177            iloc(1:2,1) = MAXLOC(       vt_i(:,:)      , mask = llmsk ) 
     178            iloc(1:2,2) = MAXLOC( ABS( u_ice(:,:) )    , mask = llmsk ) 
     179            iloc(1:2,3) = MINLOC(       tm_i(:,:) - rt0, mask = llmsk ) 
     180            DO ji = 1, 3   ! local domain indices ==> global domain indices, excluding halos 
     181               iloc(1:2,ji) = (/ mig0(iloc(1,ji)), mjg0(iloc(2,ji)) /) 
     182            END DO 
    174183            iareamin(:) = narea   ;   iareamax(:) = narea   ;   iareasum(:) = 1         ! this is local information 
    175184         ENDIF 
Note: See TracChangeset for help on using the changeset viewer.