/[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.1 by gforget, Tue Jun 7 03:58:23 2011 UTC revision 1.2 by gforget, Thu Jun 9 19:37:01 2011 UTC
# Line 37  C     === Local variables === Line 37  C     === Local variables ===
37    
38        INTEGER iTr, jTh, I, J, bi, bj, ks        INTEGER iTr, jTh, I, J, bi, bj, ks
39        _RL SItrFromOcean  (1:sNx,1:sNy)        _RL SItrFromOcean  (1:sNx,1:sNy)
40        _RL SItrFromSnow   (1:sNx,1:sNy)        _RL SItrFromFlood   (1:sNx,1:sNy)
41        _RL HEFFprev, HEFFpost, growFact, meltPart, tmpscal1        _RL HEFFprev, HEFFpost, growFact, meltPart, tmpscal1
42          _RL SItrExpand  (1:sNx,1:sNy)
43          _RL AREAprev, AREApost, expandFact
44    
45  #ifdef ALLOW_SITRACER_DIAG  #ifdef ALLOW_SITRACER_DIAG
46        _RL DIAGarray     (1:sNx,1:sNy,Nr)        _RL DIAGarray     (1:sNx,1:sNy,Nr)
# Line 59  c ====================================== Line 61  c ======================================
61        DO J=1,sNy        DO J=1,sNy
62         DO I=1,sNx         DO I=1,sNx
63          SItrFromOcean(i,j)=0. _d 0          SItrFromOcean(i,j)=0. _d 0
64          SItrFromSnow(i,j)=0. _d 0          SItrFromFlood(i,j)=0. _d 0
65            SItrExpand(i,j)=0. _d 0
66         ENDDO         ENDDO
67        ENDDO        ENDDO
68        if (SItrName(iTr).EQ.'age') then        if (SItrName(iTr).EQ.'age') then
69  c age tracer: not passed from ocean or snow  c age tracer: no age in ocean, or effect from ice cover changes
        DO J=1,sNy  
         DO I=1,sNx  
          SItrFromOcean(i,j)=0. _d 0  
         ENDDO  
        ENDDO  
70        elseif (SItrName(iTr).EQ.'salinity') then        elseif (SItrName(iTr).EQ.'salinity') then
71  c salinity tracer:  c salinity tracer:
72         DO J=1,sNy         DO J=1,sNy
# Line 78  c salinity tracer: Line 76  c salinity tracer:
76           if (SIsalFRAC.GT.0.)           if (SIsalFRAC.GT.0.)
77       &   SItrFromOcean(i,j)=SIsalFRAC*salt(I,j,ks,bi,bj)       &   SItrFromOcean(i,j)=SIsalFRAC*salt(I,j,ks,bi,bj)
78  #endif  #endif
79    c as of now, flooding implies no salt extraction from ocean
80          ENDDO          ENDDO
81         ENDDO         ENDDO
82        elseif (SItrName(iTr).EQ.'one') then        elseif (SItrName(iTr).EQ.'one') then
# Line 85  c "ice concentration" tracer that should Line 84  c "ice concentration" tracer that should
84         DO J=1,sNy         DO J=1,sNy
85          DO I=1,sNx          DO I=1,sNx
86           SItrFromOcean(i,j)=1. _d 0           SItrFromOcean(i,j)=1. _d 0
87           SItrFromSnow(i,j)=1. _d 0           SItrFromFlood(i,j)=1. _d 0
88          ENDDO          ENDDO
89         ENDDO         ENDDO
90        endif        endif
91  c 1) seaice thermodynamics processes  c 1) seaice thermodynamics processes
92  c ==================================  c ==================================
93          if (SItrMate(iTr).EQ.'HEFF') then
94        DO J=1,sNy        DO J=1,sNy
95         DO I=1,sNx         DO I=1,sNx
96          HEFFprev=SItrHEFF(i,j,bi,bj,1)          HEFFprev=SItrHEFF(i,j,bi,bj,1)
# Line 126  c apply flooding term Line 126  c apply flooding term
126          HEFFpost=SItrHEFF(i,j,bi,bj,5)          HEFFpost=SItrHEFF(i,j,bi,bj,5)
127          if (HEFFpost.GT.HEFFprev) growFact=HEFFprev/HEFFpost          if (HEFFpost.GT.HEFFprev) growFact=HEFFprev/HEFFpost
128          SItracer(i,j,bi,bj,iTr)=SItracer(i,j,bi,bj,iTr)*growFact          SItracer(i,j,bi,bj,iTr)=SItracer(i,j,bi,bj,iTr)*growFact
129       &                     +SItrFromSnow(i,j) *(1. _d 0 - growFact)       &                     +SItrFromFlood(i,j) *(1. _d 0 - growFact)
130          if ((SItrName(iTr).EQ.'age').OR.(SItrName(iTr).EQ.'one')) then  c rk: flooding can only imply an ocean-ice tracer exchange, as long
131  c Including this term in the bucket only makes sense for diagnostics purposes  c as we dont have snow tracers, so it goes through SItrBucket.
 c and should not be done for tracers that are exchanged with the ocean (we would  
 c need another bucket for ice-snow exchange, and snow tracers to start with).  
132            SItrBucket(i,j,bi,bj,iTr)=SItrBucket(i,j,bi,bj,iTr)            SItrBucket(i,j,bi,bj,iTr)=SItrBucket(i,j,bi,bj,iTr)
133       &             -HEFFpost*SItrFromSnow(i,j)*(1. _d 0 - growFact)       &             -HEFFpost*SItrFromFlood(i,j)*(1. _d 0 - growFact)
         endif  
134  #ifdef ALLOW_SITRACER_DIAG  #ifdef ALLOW_SITRACER_DIAG
135          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)
136       &  +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)
137  #endif  #endif
138         ENDDO         ENDDO
139        ENDDO        ENDDO
140    c TAF?      if (SItrMate(iTr).EQ.'AREA') then
141          else
142    c 1) or seaice cover expansion
143    c ============================
144    c this is much simpler than for ice volume/mass tracers, because
145    c properties of the ice surface are not be conserved across the
146    c ocean-ice system, the contraction/expansion terms are all
147    c simultaneous (which is sane), and the only generic effect
148    c is due to expansion (new cover).
149          DO J=1,sNy
150           DO I=1,sNx
151    c apply expansion
152            AREAprev=SItrAREA(i,j,bi,bj,2)
153            AREApost=SItrAREA(i,j,bi,bj,3)
154    c compute ratio in [0. 1.] range for expansion/contraction
155            expandFact=1. _d 0
156            if (AREApost.GT.AREAprev) expandFact=AREAprev/AREApost
157    c update SItr accordingly
158             SItracer(i,j,bi,bj,iTr)=SItracer(i,j,bi,bj,iTr)*expandFact
159         &                      +SItrExpand(i,j)*(1. _d 0 - expandFact)
160           ENDDO
161          ENDDO
162          endif
163  c 2) very ice tracer processes  c 2) very ice tracer processes
164  c ============================  c ============================
165        if (SItrName(iTr).EQ.'age') then        if (SItrName(iTr).EQ.'age') then
166  c age tracer: grow old as time passes by  c age tracer: grow old as time passes by
167         DO J=1,sNy         DO J=1,sNy
168          DO I=1,sNx          DO I=1,sNx
169            if (SItrHEFF(i,j,bi,bj,5).GT.0. _d 0) then            if (( (SItrHEFF(i,j,bi,bj,5).GT.0. _d 0).AND.(SItrMate(iTr)
170         &     .EQ.'HEFF') ).OR.( (SItrAREA(i,j,bi,bj,3).GT.0. _d 0).AND.
171         &     (SItrMate(iTr).EQ.'AREA') )) then
172              SItracer(i,j,bi,bj,iTr)=              SItracer(i,j,bi,bj,iTr)=
173       &      SItracer(i,j,bi,bj,iTr)+SEAICE_deltaTtherm       &      SItracer(i,j,bi,bj,iTr)+SEAICE_deltaTtherm
174            else            else
# Line 158  c age tracer: grow old as time passes by Line 180  c age tracer: grow old as time passes by
180  c salinity tracer: no specific process  c salinity tracer: no specific process
181        elseif (SItrName(iTr).EQ.'one') then        elseif (SItrName(iTr).EQ.'one') then
182  c "ice concentration" tracer: no specific process  c "ice concentration" tracer: no specific process
183          elseif (SItrName(iTr).EQ.'ridge') then
184    c simple, made up, ice surface roughness index prototype
185    #ifndef SEAICE_GROWTH_LEGACY
186           DO J=1,sNy
187            DO I=1,sNx
188    c ridging increases roughness
189              SItracer(i,j,bi,bj,iTr)=SItracer(i,j,bi,bj,iTr)+
190         &    MAX(0. _d 0, SItrAREA(i,j,bi,bj,1)-SItrAREA(i,j,bi,bj,2))
191    c ice melt reduces ridges/roughness
192              HEFFprev=SItrHEFF(i,j,bi,bj,1)
193              HEFFpost=SItrHEFF(i,j,bi,bj,4)
194              tmpscal1=1. _d 0
195              if (HEFFprev.GT.HEFFpost) tmpscal1=HEFFpost/HEFFprev
196              SItracer(i,j,bi,bj,iTr)=SItracer(i,j,bi,bj,iTr)*tmpscal1
197            ENDDO
198           ENDDO
199    #endif
200        endif        endif
201  c 3) ice-ocean tracer exchange  c 3) ice-ocean tracer exchange/mapping to external variables
202  c =============================  c ==========================================================
203        if (SItrName(iTr).EQ.'age') then        if (SItrName(iTr).EQ.'age') then
204  c age tracer: not passed to ocean  c age tracer: not passed to ocean
205        elseif (SItrName(iTr).EQ.'salinity') then        elseif (SItrName(iTr).EQ.'salinity') then
# Line 186  c empty bucket Line 225  c empty bucket
225          SItrBucket(i,j,bi,bj,iTr)=0. _d 0          SItrBucket(i,j,bi,bj,iTr)=0. _d 0
226         ENDDO         ENDDO
227        ENDDO        ENDDO
228    c TAF? elseif (SItrMate(iTr).EQ.'AREA') then
229  c 4) diagnostics  c 4) diagnostics
230  c ==============  c ==============
231  #ifdef ALLOW_SITRACER_DIAG  #ifdef ALLOW_SITRACER_DIAG
232          if (SItrMate(iTr).EQ.'HEFF') then
233        DO J=1,sNy        DO J=1,sNy
234         DO I=1,sNx         DO I=1,sNx
235          HEFFpost=SItrHEFF(i,j,bi,bj,5)          HEFFpost=SItrHEFF(i,j,bi,bj,5)
# Line 206  c diagArray(:,:,4) allows check of conse Line 247  c diagArray(:,:,4) allows check of conse
247  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)
248         ENDDO         ENDDO
249        ENDDO        ENDDO
250          else
251          DO J=1,sNy
252           DO I=1,sNx
253            AREApost=SItrAREA(i,j,bi,bj,3)
254            DIAGarray(I,J,1+(iTr-1)*5) = SItracer(i,j,bi,bj,iTr)
255            DIAGarray(I,J,2+(iTr-1)*5) = SItracer(i,j,bi,bj,iTr)*AREApost
256    c diagArray(:,:,3) is the term of comparison for diagArray(:,:,2)
257            if (SItrName(iTr).EQ.'age') then
258              DIAGarray(I,J,3+(iTr-1)*5) = IceAgeTr(i,j,bi,bj,1)
259            endif
260           ENDDO
261          ENDDO
262          endif
263  #endif  #endif
264        ENDDO        ENDDO
265  #ifdef ALLOW_SITRACER_DIAG  #ifdef ALLOW_SITRACER_DIAG

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

  ViewVC Help
Powered by ViewVC 1.1.22