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 7614 for branches/UKMO/dev_r5518_min_temp_wo_ice – NEMO

Ignore:
Timestamp:
2017-01-27T10:15:11+01:00 (8 years ago)
Author:
kingr
Message:

Code changes to prevent water temperature falling below pressure-dependent freezing point

File:
1 edited

Legend:

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

    r6331 r7614  
    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  ::   ji,jj,jk, jn     ! dummy loop indices 
     97      REAL(wp) ::   zfact, zfreeze   ! local scalars 
    9798      REAL(wp), POINTER, DIMENSION(:,:,:) ::  ztrdt, ztrds 
    9899      !!---------------------------------------------------------------------- 
     
    151152      ENDIF      
    152153      ! 
     154#if ( ! defined key_lim3 && ! defined key_lim2 && ! key_cice )  
     155      IF ( kt == nit000 ) warn_1=0  
     156      warn_2=0  
     157      DO jk = 1, jpkm1  
     158        DO jj = 1, jpj  
     159          DO ji = 1, jpi  
     160            IF ( tsa(ji,jj,jk,jp_tem) .lt. 0.0 ) THEN  
     161               ! calculate the freezing point  
     162               zfreeze = ( -0.0575_wp + 1.710523E-3 * Sqrt (Abs(tsn(ji,jj,jk,jp_sal)))   &  
     163                         - 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) )  
     164               IF ( tsn(ji,jj,jk,jp_tem) .lt. zfreeze ) THEN  
     165                  tsn(ji,jj,jk,jp_tem)=zfreeze  
     166                  warn_2=1  
     167               ENDIF  
     168            ENDIF  
     169          END DO  
     170        END DO  
     171      END DO  
     172      CALL mpp_max(warn_1)  
     173      CALL mpp_max(warn_2)  
     174      IF ( (warn_1 == 0) .and. (warn_2 /= 0) ) THEN  
     175        IF(lwp) THEN  
     176          CALL ctl_warn( ' Temperatures dropping below freezing point, ', &  
     177                    &    ' being forced to freezing point, no longer conservative' )  
     178        ENDIF  
     179        warn_1=1  
     180      ENDIF  
     181#endif   
    153182     ! trends computation 
    154183      IF( l_trdtra ) THEN      ! trend of the Asselin filter (tb filtered - tb)/dt      
Note: See TracChangeset for help on using the changeset viewer.