/[MITgcm]/MITgcm/pkg/seaice/seaice_tracer_phys.F
ViewVC logotype

Diff of /MITgcm/pkg/seaice/seaice_tracer_phys.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.2 by gforget, Thu Jun 9 19:37:01 2011 UTC revision 1.5 by gforget, Fri Feb 3 13:34:32 2012 UTC
# Line 41  C     === Local variables === Line 41  C     === Local variables ===
41        _RL HEFFprev, HEFFpost, growFact, meltPart, tmpscal1        _RL HEFFprev, HEFFpost, growFact, meltPart, tmpscal1
42        _RL SItrExpand  (1:sNx,1:sNy)        _RL SItrExpand  (1:sNx,1:sNy)
43        _RL AREAprev, AREApost, expandFact        _RL AREAprev, AREApost, expandFact
44          CHARACTER*8   diagName
45    
46  #ifdef ALLOW_SITRACER_DIAG  #ifdef ALLOW_SITRACER_DEBUG_DIAG
47        _RL DIAGarray     (1:sNx,1:sNy,Nr)        _RL DIAGarray     (1:sNx,1:sNy,Nr)
48  #endif  #endif
49    
# Line 56  cgf eventually I will need to handle the Line 57  cgf eventually I will need to handle the
57        DO bi=myBxLo(myThid),myBxHi(myThid)        DO bi=myBxLo(myThid),myBxHi(myThid)
58        DO iTr=1,SItrMaxNum        DO iTr=1,SItrMaxNum
59    
60  c 0) set ice-ocean and ice-snow exchange values        c 0) set ice-ocean and ice-snow exchange values
61  c =============================================  c =============================================
62        DO J=1,sNy        DO J=1,sNy
63         DO I=1,sNx         DO I=1,sNx
# Line 68  c ====================================== Line 69  c ======================================
69        if (SItrName(iTr).EQ.'age') then        if (SItrName(iTr).EQ.'age') then
70  c age tracer: no age in ocean, or effect from ice cover changes  c age tracer: no age in ocean, or effect from ice cover changes
71        elseif (SItrName(iTr).EQ.'salinity') then        elseif (SItrName(iTr).EQ.'salinity') then
72  c salinity tracer:  c salinity tracer:
73         DO J=1,sNy         DO J=1,sNy
74          DO I=1,sNx          DO I=1,sNx
75           SItrFromOcean(i,j)=SIsal0           SItrFromOcean(i,j)=SIsal0
76  #ifdef SEAICE_VARIABLE_SALINITY  #ifdef SEAICE_VARIABLE_SALINITY
77           if (SIsalFRAC.GT.0.)           if (SIsalFRAC.GT.0.)
78       &   SItrFromOcean(i,j)=SIsalFRAC*salt(I,j,ks,bi,bj)       &   SItrFromOcean(i,j)=SIsalFRAC*salt(I,j,ks,bi,bj)
79  #endif  #endif
80  c as of now, flooding implies no salt extraction from ocean  c as of now, flooding implies no salt extraction from ocean
# Line 94  c ================================== Line 95  c ==================================
95        DO J=1,sNy        DO J=1,sNy
96         DO I=1,sNx         DO I=1,sNx
97          HEFFprev=SItrHEFF(i,j,bi,bj,1)          HEFFprev=SItrHEFF(i,j,bi,bj,1)
98  #ifdef ALLOW_SITRACER_DIAG  #ifdef ALLOW_SITRACER_DEBUG_DIAG
99          diagArray(I,J,5+(iTr-1)*5) =          DIAGarray(I,J,5+(iTr-1)*5) =
100       &    HEFFprev*SItracer(i,j,bi,bj,iTr) + SItrBucket(i,j,bi,bj,iTr)       &    HEFFprev*SItracer(i,j,bi,bj,iTr) + SItrBucket(i,j,bi,bj,iTr)
101  #endif  #endif
102  c apply the sequence of thermodynamics increments to actual traceur  c apply the sequence of thermodynamics increments to actual traceur
# Line 131  c rk: flooding can only imply an ocean-i Line 132  c rk: flooding can only imply an ocean-i
132  c as we dont have snow tracers, so it goes through SItrBucket.  c as we dont have snow tracers, so it goes through SItrBucket.
133            SItrBucket(i,j,bi,bj,iTr)=SItrBucket(i,j,bi,bj,iTr)            SItrBucket(i,j,bi,bj,iTr)=SItrBucket(i,j,bi,bj,iTr)
134       &             -HEFFpost*SItrFromFlood(i,j)*(1. _d 0 - growFact)       &             -HEFFpost*SItrFromFlood(i,j)*(1. _d 0 - growFact)
135  #ifdef ALLOW_SITRACER_DIAG  #ifdef ALLOW_SITRACER_DEBUG_DIAG
136          diagArray(I,J,5+(iTr-1)*5) = HEFFpost*SItracer(i,j,bi,bj,iTr)          DIAGarray(I,J,5+(iTr-1)*5) = HEFFpost*SItracer(i,j,bi,bj,iTr)
137       &  +SItrBucket(i,j,bi,bj,iTr)-diagArray(I,J,5+(iTr-1)*5)       &  +SItrBucket(i,j,bi,bj,iTr)-DIAGarray(I,J,5+(iTr-1)*5)
138  #endif  #endif
139         ENDDO         ENDDO
140        ENDDO        ENDDO
# Line 141  c TAF?      if (SItrMate(iTr).EQ.'AREA') Line 142  c TAF?      if (SItrMate(iTr).EQ.'AREA')
142        else        else
143  c 1) or seaice cover expansion  c 1) or seaice cover expansion
144  c ============================  c ============================
145  c this is much simpler than for ice volume/mass tracers, because  c this is much simpler than for ice volume/mass tracers, because
146  c properties of the ice surface are not be conserved across the  c properties of the ice surface are not be conserved across the
147  c ocean-ice system, the contraction/expansion terms are all  c ocean-ice system, the contraction/expansion terms are all
148  c simultaneous (which is sane), and the only generic effect  c simultaneous (which is sane), and the only generic effect
149  c is due to expansion (new cover).  c is due to expansion (new cover).
150        DO J=1,sNy        DO J=1,sNy
151         DO I=1,sNx         DO I=1,sNx
# Line 200  c ice melt reduces ridges/roughness Line 201  c ice melt reduces ridges/roughness
201        endif        endif
202  c 3) ice-ocean tracer exchange/mapping to external variables  c 3) ice-ocean tracer exchange/mapping to external variables
203  c ==========================================================  c ==========================================================
204    #ifdef ALLOW_DIAGNOSTICS
205          if (SItrMate(iTr).EQ.'HEFF') then
206            WRITE(diagName,'(A4,I2.2,A2)') 'SItr',iTr,'FX'
207            tmpscal1=-ONE/SEAICE_deltaTtherm*SEAICE_rhoIce
208            CALL DIAGNOSTICS_SCALE_FILL(SItrBucket(1-oLx,1-oLy,bi,bj,iTr),
209         &   tmpscal1, 1, diagName,0,1,2,bi,bj,myThid)
210          endif
211    #endif
212        if (SItrName(iTr).EQ.'age') then        if (SItrName(iTr).EQ.'age') then
213  c age tracer: not passed to ocean  c age tracer: not passed to ocean
214        elseif (SItrName(iTr).EQ.'salinity') then        elseif (SItrName(iTr).EQ.'salinity') then
# Line 217  c "ice concentration" tracer: not passed Line 226  c "ice concentration" tracer: not passed
226        endif        endif
227        DO J=1,sNy        DO J=1,sNy
228         DO I=1,sNx         DO I=1,sNx
229  #ifdef ALLOW_SITRACER_DIAG  #ifdef ALLOW_SITRACER_DEBUG_DIAG
230          diagArray(I,J,4+(iTr-1)*5) = - SItrBucket(i,j,bi,bj,iTr)          DIAGarray(I,J,4+(iTr-1)*5) = - SItrBucket(i,j,bi,bj,iTr)
231       &  *HEFFM(I,J,bi,bj)/SEAICE_deltaTtherm*SEAICE_rhoIce       &  *HEFFM(I,J,bi,bj)/SEAICE_deltaTtherm*SEAICE_rhoIce
232  #endif  #endif
233  c empty bucket  c empty bucket
# Line 228  c empty bucket Line 237  c empty bucket
237  c TAF? elseif (SItrMate(iTr).EQ.'AREA') then  c TAF? elseif (SItrMate(iTr).EQ.'AREA') then
238  c 4) diagnostics  c 4) diagnostics
239  c ==============  c ==============
240  #ifdef ALLOW_SITRACER_DIAG  #ifdef ALLOW_SITRACER_DEBUG_DIAG
241        if (SItrMate(iTr).EQ.'HEFF') then        if (SItrMate(iTr).EQ.'HEFF') then
242        DO J=1,sNy        DO J=1,sNy
243         DO I=1,sNx         DO I=1,sNx
244          HEFFpost=SItrHEFF(i,j,bi,bj,5)          HEFFpost=SItrHEFF(i,j,bi,bj,5)
245          DIAGarray(I,J,1+(iTr-1)*5) = SItracer(i,j,bi,bj,iTr)          DIAGarray(I,J,1+(iTr-1)*5) = SItracer(i,j,bi,bj,iTr)
246          DIAGarray(I,J,2+(iTr-1)*5) = SItracer(i,j,bi,bj,iTr)*HEFFpost          DIAGarray(I,J,2+(iTr-1)*5) = SItracer(i,j,bi,bj,iTr)*HEFFpost
247  c diagArray(:,:,3) is the term of comparison for diagArray(:,:,2)  c DIAGarray(:,:,3) is the term of comparison for DIAGarray(:,:,2)
248          if (SItrName(iTr).EQ.'age') then          if (SItrName(iTr).EQ.'salinity') then
           DIAGarray(I,J,3+(iTr-1)*5) = IceAgeTr(i,j,bi,bj,2)  
         elseif (SItrName(iTr).EQ.'salinity') then  
249            DIAGarray(I,J,3+(iTr-1)*5) = HSALT(i,j,bi,bj)/SEAICE_rhoIce            DIAGarray(I,J,3+(iTr-1)*5) = HSALT(i,j,bi,bj)/SEAICE_rhoIce
250          elseif (SItrName(iTr).EQ.'one') then          elseif (SItrName(iTr).EQ.'one') then
251            DIAGarray(I,J,3+(iTr-1)*5) = HEFFpost            DIAGarray(I,J,3+(iTr-1)*5) = HEFFpost
252          endif          endif
253  c diagArray(:,:,4) allows check of conservation : del(SItrBucket)+del(SItr*HEFF)=0. over do_phys  c DIAGarray(:,:,4) allows check of conservation : del(SItrBucket)+del(SItr*HEFF)=0. over do_phys
254  c diagArray(:,:,5) is the tracer flux from the ocean (<0 incr. ocean tracer)  c DIAGarray(:,:,5) is the tracer flux from the ocean (<0 incr. ocean tracer)
255         ENDDO         ENDDO
256        ENDDO        ENDDO
257        else        else
# Line 253  c diagArray(:,:,5) is the tracer flux fr Line 260  c diagArray(:,:,5) is the tracer flux fr
260          AREApost=SItrAREA(i,j,bi,bj,3)          AREApost=SItrAREA(i,j,bi,bj,3)
261          DIAGarray(I,J,1+(iTr-1)*5) = SItracer(i,j,bi,bj,iTr)          DIAGarray(I,J,1+(iTr-1)*5) = SItracer(i,j,bi,bj,iTr)
262          DIAGarray(I,J,2+(iTr-1)*5) = SItracer(i,j,bi,bj,iTr)*AREApost          DIAGarray(I,J,2+(iTr-1)*5) = SItracer(i,j,bi,bj,iTr)*AREApost
 c diagArray(:,:,3) is the term of comparison for diagArray(:,:,2)  
         if (SItrName(iTr).EQ.'age') then  
           DIAGarray(I,J,3+(iTr-1)*5) = IceAgeTr(i,j,bi,bj,1)  
         endif  
263         ENDDO         ENDDO
264        ENDDO        ENDDO
265        endif        endif
266  #endif  #endif
267        ENDDO        ENDDO
268  #ifdef ALLOW_SITRACER_DIAG  #ifdef ALLOW_SITRACER_DEBUG_DIAG
269        CALL DIAGNOSTICS_FILL(DIAGarray,'UDIAG1  ',0,Nr,3,bi,bj,myThid)  c     CALL DIAGNOSTICS_FILL(DIAGarray,'UDIAG1  ',0,Nr,3,bi,bj,myThid)
270  #endif  #endif
271        ENDDO        ENDDO
272        ENDDO        ENDDO

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.5

  ViewVC Help
Powered by ViewVC 1.1.22