Back to home page

MITgcm

 
 

    


File indexing completed on 2019-06-15 05:10:38 UTC

view on githubraw file Latest commit e0f9a7ba on 2019-06-14 16:32:02 UTC
c0d1c06c15 Matt*0001 #include "BLING_OPTIONS.h"
                0002 
                0003 CBOP
36b4355075 Matt*0004       subroutine BLING_MIN_VAL(
e0f9a7ba0b Matt*0005      I           PTR, min_val, adj, bi, bj )
c0d1c06c15 Matt*0006 
                0007 C     =================================================================
36b4355075 Matt*0008 C     | subroutine bling_min_val
                0009 C     | o replaces tracer values that are too small or negative
e0f9a7ba0b Matt*0010 C     |   (in a separate routine so can be hidden from adjoint)
c0d1c06c15 Matt*0011 C     =================================================================
                0012 
e0f9a7ba0b Matt*0013       IMPLICIT NONE
                0014 
c0d1c06c15 Matt*0015 C     === Global variables ===
                0016 #include "SIZE.h"
36b4355075 Matt*0017 #include "GRID.h"
c0d1c06c15 Matt*0018 
                0019 C     === Routine arguments ===
36b4355075 Matt*0020       INTEGER bi, bj
                0021 C     === Input ===
c0d1c06c15 Matt*0022       _RL     PTR(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
                0023       _RL     min_val
e0f9a7ba0b Matt*0024       _RL     adj(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
c0d1c06c15 Matt*0025 CEOP
                0026 
                0027 C     == Local variables ==
                0028       INTEGER i,j,k
                0029 
                0030        DO k=1,Nr
                0031          DO i=1,sNx
                0032           DO j=1,sNy
e0f9a7ba0b Matt*0033            adj(i,j,k) = PTR(i,j,k)
36b4355075 Matt*0034            PTR(i,j,k) = max( min_val*maskC(i,j,k,bi,bj), PTR(i,j,k) )
e0f9a7ba0b Matt*0035            adj(i,j,k) = PTR(i,j,k)-adj(i,j,k)
c0d1c06c15 Matt*0036           ENDDO
                0037          ENDDO
                0038        ENDDO
                0039 
                0040       RETURN
                0041       END