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 11134 for branches/UKMO/r6232_collate_bgc_diagnostics/NEMOGCM/NEMO/OPA_SRC/TRA/tranxt.F90 – NEMO

Ignore:
Timestamp:
2019-06-18T17:48:39+02:00 (5 years ago)
Author:
jcastill
Message:

Full set of changes as in the original branch

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/UKMO/r6232_collate_bgc_diagnostics/NEMOGCM/NEMO/OPA_SRC/TRA/tranxt.F90

    r11132 r11134  
    5858 
    5959   REAL(wp) ::   rbcp   ! Brown & Campana parameters for semi-implicit hpg 
     60   INTEGER  ::   warn_1, warn_2   ! indicators for warning statement 
    6061 
    6162   !! * Substitutions 
     
    9394      INTEGER, INTENT(in) ::   kt    ! ocean time-step index 
    9495      !! 
    95       INTEGER  ::   jk, jn    ! dummy loop indices 
    96       REAL(wp) ::   zfact     ! local scalars 
     96      INTEGER  ::   jk, jn, ji, jj     ! dummy loop indices 
     97      REAL(wp) ::   zfact, zfreeze     ! local scalars 
    9798      REAL(wp), POINTER, DIMENSION(:,:,:) ::  ztrdt, ztrds 
    9899      !!---------------------------------------------------------------------- 
     
    125126      ELSEIF( kt <= nit000 + 1 )           THEN   ;   r2dtra(:) = 2._wp* rdttra(:)      ! at nit000 or nit000+1 (Leapfrog) 
    126127      ENDIF 
     128 
     129#if ( ! defined key_lim3 && ! defined key_lim2 && ! key_cice ) 
     130      IF ( kt == nit000 ) warn_1=0 
     131      warn_2=0 
     132      DO jk = 1, jpkm1 
     133         DO jj = 1, jpj 
     134            DO ji = 1, jpi 
     135               IF ( tsa(ji,jj,jk,jp_tem) .lt. 0.0 ) THEN 
     136                  ! calculate freezing point 
     137                  zfreeze = ( -0.0575_wp + 1.710523E-3 * Sqrt(Abs(tsn(ji,jj,jk,jp_sal)))   &  
     138                            - 2.154996E-4 * tsn(ji,jj,jk,jp_sal) ) * tsn(ji,jj,jk,jp_sal) - 7.53E-4 * ( 10.0_wp + fsdept(ji,jj,jk) ) 
     139                  IF ( tsa(ji,jj,jk,jp_tem) .lt. zfreeze ) THEN 
     140                     tsa(ji,jj,jk,jp_tem)=zfreeze 
     141                     warn_2=1 
     142                  ENDIF 
     143               ENDIF 
     144            END DO 
     145         END DO 
     146      END DO 
     147      CALL mpp_max(warn_1) 
     148      CALL mpp_max(warn_2) 
     149      IF ( (warn_1 == 0) .and. (warn_2 /= 0) ) THEN 
     150         IF(lwp) THEN 
     151            CALL ctl_warn( ' Temperatures dropping below freezing point, ', & 
     152                      &    ' being forced to freezing point, no longer conservative' )  
     153         ENDIF 
     154         warn_1=1 
     155      ENDIF 
     156#endif 
    127157 
    128158      ! trends computation initialisation 
Note: See TracChangeset for help on using the changeset viewer.