Back to home page

MITgcm

 
 

    


File indexing completed on 2024-11-26 06:11:17 UTC

view on githubraw file Latest commit 80fd5561 on 2024-11-25 21:30:13 UTC
f50f58ec54 Gael*0001 #include "SEAICE_OPTIONS.h"
80fd556159 Ou W*0002 #ifdef ALLOW_SALT_PLUME
                0003 # include "SALT_PLUME_OPTIONS.h"
                0004 #endif
f50f58ec54 Gael*0005 
                0006 CStartOfInterface
                0007       SUBROUTINE SEAICE_TRACER_PHYS( myTime, myIter, myThid )
dc0a9dc58e Jean*0008 C     *=======================================================*
                0009 C     | SUBROUTINE seaice_tracer_phys
                0010 C     | o Time step SItr/SItrEFF as a result of
                0011 C     |   seaice thermodynamics and specific tracer physics
                0012 C     *=======================================================*
f50f58ec54 Gael*0013       IMPLICIT NONE
                0014 
                0015 C     === Global variables ===
                0016 #include "SIZE.h"
                0017 #include "EEPARAMS.h"
f1c91a595d Jean*0018 #include "PARAMS.h"
f50f58ec54 Gael*0019 #include "FFIELDS.h"
                0020 #include "DYNVARS.h"
                0021 #include "SEAICE_SIZE.h"
                0022 #include "SEAICE.h"
                0023 #include "SEAICE_PARAMS.h"
                0024 #include "SEAICE_TRACER.h"
8bc8bee483 Gael*0025 #ifdef ALLOW_SALT_PLUME
                0026 # include "SALT_PLUME.h"
                0027 #endif
f50f58ec54 Gael*0028 
                0029 C     === Routine arguments ===
                0030 C     INPUT:
                0031 C     myTime  :: Simulation time
                0032 C     myIter  :: Simulation timestep number
                0033 C     myThid  :: Thread no. that called this routine.
                0034 C     OUTPUT:
                0035       _RL myTime
                0036       INTEGER myIter, myThid
                0037 CEndOfInterface
                0038 
                0039 C     === Local variables ===
                0040 #ifdef ALLOW_SITRACER
                0041 
80fd556159 Ou W*0042       INTEGER iTr, jTh, i, j, bi, bj, ks
f50f58ec54 Gael*0043       _RL SItrFromOcean  (1:sNx,1:sNy)
bb24b8a3e6 Gael*0044       _RL SItrFromFlood   (1:sNx,1:sNy)
f50f58ec54 Gael*0045       _RL HEFFprev, HEFFpost, growFact, meltPart, tmpscal1
bb24b8a3e6 Gael*0046       _RL SItrExpand  (1:sNx,1:sNy)
                0047       _RL AREAprev, AREApost, expandFact
3721cfe5e4 Gael*0048       CHARACTER*8   diagName
f50f58ec54 Gael*0049 
3721cfe5e4 Gael*0050 #ifdef ALLOW_SITRACER_DEBUG_DIAG
f50f58ec54 Gael*0051       _RL DIAGarray     (1:sNx,1:sNy,Nr)
                0052 #endif
                0053 
                0054 cgf for now I do not fully account for ocean-ice fluxes of tracer
                0055 cgf -> I just prescribe it consistent with age tracer
                0056 cgf eventually I will need to handle them as function params
                0057 
                0058       ks=1
                0059 
                0060       DO bj=myByLo(myThid),myByHi(myThid)
                0061       DO bi=myBxLo(myThid),myBxHi(myThid)
8bc8bee483 Gael*0062       DO iTr=1,SItrNumInUse
f50f58ec54 Gael*0063 
fcdcf3fa1d Jean*0064 c 0) set ice-ocean and ice-snow exchange values
f50f58ec54 Gael*0065 c =============================================
80fd556159 Ou W*0066       DO j=1,sNy
                0067        DO i=1,sNx
8bc8bee483 Gael*0068         SItrFromOcean(i,j)=SItrFromOcean0(iTr)
                0069         SItrFromFlood(i,j)=SItrFromFlood0(iTr)
                0070         SItrExpand(i,j)=SItrExpand0(iTr)
f50f58ec54 Gael*0071        ENDDO
                0072       ENDDO
fcdcf3fa1d Jean*0073 c salinity tracer:
dc0a9dc58e Jean*0074       if ( (SItrName(iTr).EQ.'salinity').AND.
8bc8bee483 Gael*0075      &      (SItrFromOceanFrac(iTr).GT.ZERO) ) then
80fd556159 Ou W*0076        DO j=1,sNy
                0077         DO i=1,sNx
                0078          SItrFromOcean(i,j)=SItrFromOceanFrac(iTr)*salt(i,j,ks,bi,bj)
                0079          SItrFromFlood(i,j)=SItrFromFloodFrac(iTr)*salt(i,j,ks,bi,bj)
f50f58ec54 Gael*0080         ENDDO
                0081        ENDDO
                0082       endif
                0083 c 1) seaice thermodynamics processes
                0084 c ==================================
bb24b8a3e6 Gael*0085       if (SItrMate(iTr).EQ.'HEFF') then
80fd556159 Ou W*0086       DO j=1,sNy
                0087        DO i=1,sNx
f50f58ec54 Gael*0088         HEFFprev=SItrHEFF(i,j,bi,bj,1)
3721cfe5e4 Gael*0089 #ifdef ALLOW_SITRACER_DEBUG_DIAG
80fd556159 Ou W*0090         DIAGarray(i,j,5+(iTr-1)*5) =
f50f58ec54 Gael*0091      &    HEFFprev*SItracer(i,j,bi,bj,iTr) + SItrBucket(i,j,bi,bj,iTr)
                0092 #endif
f61838dfc1 Torg*0093 c apply the sequence of thermodynamics increments to actual tracer
f50f58ec54 Gael*0094 c (see seaice_growth.F)
                0095 c (jTh=1 tendency due to ice-ocean interaction)
                0096 c (jTh=2 tendency due to the atmosphere, over ice covered part)
                0097 c (jTh=3 tendency due to the atmosphere, over open water part)
                0098 c (jTh=4 tendency due to flooding)
                0099         DO jTh=1,3
                0100          HEFFprev=SItrHEFF(i,j,bi,bj,jTh)
                0101          HEFFpost=SItrHEFF(i,j,bi,bj,jTh+1)
                0102 c compute ratio in [0. 1.] range for either growth or melt
                0103          growFact=1. _d 0
                0104          meltPart=0. _d 0
                0105          if (HEFFpost.GT.HEFFprev) growFact=HEFFprev/HEFFpost
                0106          if (HEFFpost.LT.HEFFprev) meltPart=HEFFprev-HEFFpost
                0107 c update SItr accordingly
                0108          SItracer(i,j,bi,bj,iTr)=SItracer(i,j,bi,bj,iTr)*growFact
                0109      &                      +SItrFromOcean(i,j)*(1. _d 0 - growFact)
                0110          SItrBucket(i,j,bi,bj,iTr)=SItrBucket(i,j,bi,bj,iTr)
                0111      &             -HEFFpost*SItrFromOcean(i,j)*(1. _d 0 - growFact)
                0112          SItrBucket(i,j,bi,bj,iTr)=SItrBucket(i,j,bi,bj,iTr)
                0113      &                            +meltPart*SItracer(i,j,bi,bj,iTr)
                0114         ENDDO
                0115 c apply flooding term
                0116         growFact=1. _d 0
                0117         HEFFprev=SItrHEFF(i,j,bi,bj,4)
                0118         HEFFpost=SItrHEFF(i,j,bi,bj,5)
                0119         if (HEFFpost.GT.HEFFprev) growFact=HEFFprev/HEFFpost
                0120         SItracer(i,j,bi,bj,iTr)=SItracer(i,j,bi,bj,iTr)*growFact
bb24b8a3e6 Gael*0121      &                     +SItrFromFlood(i,j) *(1. _d 0 - growFact)
                0122 c rk: flooding can only imply an ocean-ice tracer exchange, as long
                0123 c as we dont have snow tracers, so it goes through SItrBucket.
f50f58ec54 Gael*0124           SItrBucket(i,j,bi,bj,iTr)=SItrBucket(i,j,bi,bj,iTr)
bb24b8a3e6 Gael*0125      &             -HEFFpost*SItrFromFlood(i,j)*(1. _d 0 - growFact)
3721cfe5e4 Gael*0126 #ifdef ALLOW_SITRACER_DEBUG_DIAG
80fd556159 Ou W*0127         DIAGarray(i,j,5+(iTr-1)*5) = HEFFpost*SItracer(i,j,bi,bj,iTr)
                0128      &  +SItrBucket(i,j,bi,bj,iTr)-DIAGarray(i,j,5+(iTr-1)*5)
f50f58ec54 Gael*0129 #endif
                0130        ENDDO
                0131       ENDDO
bb24b8a3e6 Gael*0132 c TAF?      if (SItrMate(iTr).EQ.'AREA') then
                0133       else
                0134 c 1) or seaice cover expansion
                0135 c ============================
fcdcf3fa1d Jean*0136 c this is much simpler than for ice volume/mass tracers, because
                0137 c properties of the ice surface are not be conserved across the
bb24b8a3e6 Gael*0138 c ocean-ice system, the contraction/expansion terms are all
fcdcf3fa1d Jean*0139 c simultaneous (which is sane), and the only generic effect
bb24b8a3e6 Gael*0140 c is due to expansion (new cover).
80fd556159 Ou W*0141       DO j=1,sNy
                0142        DO i=1,sNx
bb24b8a3e6 Gael*0143 c apply expansion
                0144         AREAprev=SItrAREA(i,j,bi,bj,2)
                0145         AREApost=SItrAREA(i,j,bi,bj,3)
                0146 c compute ratio in [0. 1.] range for expansion/contraction
                0147         expandFact=1. _d 0
                0148         if (AREApost.GT.AREAprev) expandFact=AREAprev/AREApost
                0149 c update SItr accordingly
                0150          SItracer(i,j,bi,bj,iTr)=SItracer(i,j,bi,bj,iTr)*expandFact
                0151      &                      +SItrExpand(i,j)*(1. _d 0 - expandFact)
                0152        ENDDO
                0153       ENDDO
                0154       endif
f50f58ec54 Gael*0155 c 2) very ice tracer processes
                0156 c ============================
                0157       if (SItrName(iTr).EQ.'age') then
                0158 c age tracer: grow old as time passes by
80fd556159 Ou W*0159        DO j=1,sNy
                0160         DO i=1,sNx
bb24b8a3e6 Gael*0161           if (( (SItrHEFF(i,j,bi,bj,5).GT.0. _d 0).AND.(SItrMate(iTr)
                0162      &     .EQ.'HEFF') ).OR.( (SItrAREA(i,j,bi,bj,3).GT.0. _d 0).AND.
                0163      &     (SItrMate(iTr).EQ.'AREA') )) then
f50f58ec54 Gael*0164             SItracer(i,j,bi,bj,iTr)=
                0165      &      SItracer(i,j,bi,bj,iTr)+SEAICE_deltaTtherm
                0166           else
                0167             SItracer(i,j,bi,bj,iTr)=0. _d 0
                0168           endif
                0169         ENDDO
                0170        ENDDO
                0171       elseif (SItrName(iTr).EQ.'salinity') then
                0172 c salinity tracer: no specific process
                0173       elseif (SItrName(iTr).EQ.'one') then
                0174 c "ice concentration" tracer: no specific process
bb24b8a3e6 Gael*0175       elseif (SItrName(iTr).EQ.'ridge') then
                0176 c simple, made up, ice surface roughness index prototype
80fd556159 Ou W*0177        DO j=1,sNy
                0178         DO i=1,sNx
bb24b8a3e6 Gael*0179 c ridging increases roughness
                0180           SItracer(i,j,bi,bj,iTr)=SItracer(i,j,bi,bj,iTr)+
                0181      &    MAX(0. _d 0, SItrAREA(i,j,bi,bj,1)-SItrAREA(i,j,bi,bj,2))
                0182 c ice melt reduces ridges/roughness
                0183           HEFFprev=SItrHEFF(i,j,bi,bj,1)
                0184           HEFFpost=SItrHEFF(i,j,bi,bj,4)
                0185           tmpscal1=1. _d 0
                0186           if (HEFFprev.GT.HEFFpost) tmpscal1=HEFFpost/HEFFprev
                0187           SItracer(i,j,bi,bj,iTr)=SItracer(i,j,bi,bj,iTr)*tmpscal1
                0188         ENDDO
                0189        ENDDO
f50f58ec54 Gael*0190       endif
bb24b8a3e6 Gael*0191 c 3) ice-ocean tracer exchange/mapping to external variables
                0192 c ==========================================================
3721cfe5e4 Gael*0193 #ifdef ALLOW_DIAGNOSTICS
f1c91a595d Jean*0194       IF ( useDiagnostics .AND. SItrMate(iTr).EQ.'HEFF') THEN
2eab512e2a Gael*0195         WRITE(diagName,'(A4,I2.2,A2)') 'SItr',iTr,'Fx'
3721cfe5e4 Gael*0196         tmpscal1=-ONE/SEAICE_deltaTtherm*SEAICE_rhoIce
dc0a9dc58e Jean*0197         CALL DIAGNOSTICS_SCALE_FILL(SItrBucket(1-OLx,1-OLy,bi,bj,iTr),
3721cfe5e4 Gael*0198      &   tmpscal1, 1, diagName,0,1,2,bi,bj,myThid)
f1c91a595d Jean*0199       ENDIF
3721cfe5e4 Gael*0200 #endif
8bc8bee483 Gael*0201 
                0202       if ( (SItrName(iTr).EQ.'salinity').AND.
                0203      &     (SEAICE_salinityTracer) ) then
f50f58ec54 Gael*0204 c salinity tracer: salt flux
80fd556159 Ou W*0205         DO j=1,sNy
                0206          DO i=1,sNx
                0207           saltFlux(i,j,bi,bj) = - SItrBucket(i,j,bi,bj,iTr)
                0208      &      *HEFFM(i,j,bi,bj)/SEAICE_deltaTtherm*SEAICE_rhoIce
f50f58ec54 Gael*0209 c note: at this point of the time step, that is the correct sign
8bc8bee483 Gael*0210 #ifdef ALLOW_SALT_PLUME
                0211 c should work for both constant and variable ice salinity -- to be tested
80fd556159 Ou W*0212           saltPlumeFlux(i,j,bi,bj) = MAX(zeroRS,saltFlux(i,j,bi,bj))
                0213      &      *SPsalFRAC*(salt(i,j,ks,bi,bj)-SItrFromOcean(i,j))
8bc8bee483 Gael*0214 #endif
                0215          ENDDO
                0216         ENDDO
f50f58ec54 Gael*0217       endif
dc0a9dc58e Jean*0218 
80fd556159 Ou W*0219       DO j=1,sNy
                0220        DO i=1,sNx
3721cfe5e4 Gael*0221 #ifdef ALLOW_SITRACER_DEBUG_DIAG
80fd556159 Ou W*0222         DIAGarray(i,j,4+(iTr-1)*5) = - SItrBucket(i,j,bi,bj,iTr)
                0223      &  *HEFFM(i,j,bi,bj)/SEAICE_deltaTtherm*SEAICE_rhoIce
f50f58ec54 Gael*0224 #endif
                0225 c empty bucket
f61838dfc1 Torg*0226 c  but not for 'grease' (see seaice_growth.F)
0320e25227 Mart*0227         if (SItrName(iTr).NE.'grease')
f61838dfc1 Torg*0228      &      SItrBucket(i,j,bi,bj,iTr)=0. _d 0
f50f58ec54 Gael*0229        ENDDO
                0230       ENDDO
dc0a9dc58e Jean*0231 
bb24b8a3e6 Gael*0232 c TAF? elseif (SItrMate(iTr).EQ.'AREA') then
8bc8bee483 Gael*0233 
f50f58ec54 Gael*0234 c 4) diagnostics
                0235 c ==============
3721cfe5e4 Gael*0236 #ifdef ALLOW_SITRACER_DEBUG_DIAG
bb24b8a3e6 Gael*0237       if (SItrMate(iTr).EQ.'HEFF') then
80fd556159 Ou W*0238       DO j=1,sNy
                0239        DO i=1,sNx
f50f58ec54 Gael*0240         HEFFpost=SItrHEFF(i,j,bi,bj,5)
80fd556159 Ou W*0241         DIAGarray(i,j,1+(iTr-1)*5) = SItracer(i,j,bi,bj,iTr)
                0242         DIAGarray(i,j,2+(iTr-1)*5) = SItracer(i,j,bi,bj,iTr)*HEFFpost
3721cfe5e4 Gael*0243 c DIAGarray(:,:,3) is the term of comparison for DIAGarray(:,:,2)
e54fe3e1f9 Gael*0244         if (SItrName(iTr).EQ.'salinity') then
80fd556159 Ou W*0245           DIAGarray(i,j,3+(iTr-1)*5) = HSALT(i,j,bi,bj)/SEAICE_rhoIce
f50f58ec54 Gael*0246         elseif (SItrName(iTr).EQ.'one') then
80fd556159 Ou W*0247           DIAGarray(i,j,3+(iTr-1)*5) = HEFFpost
f50f58ec54 Gael*0248         endif
3721cfe5e4 Gael*0249 c DIAGarray(:,:,4) allows check of conservation : del(SItrBucket)+del(SItr*HEFF)=0. over do_phys
                0250 c DIAGarray(:,:,5) is the tracer flux from the ocean (<0 incr. ocean tracer)
f50f58ec54 Gael*0251        ENDDO
                0252       ENDDO
bb24b8a3e6 Gael*0253       else
80fd556159 Ou W*0254       DO j=1,sNy
                0255        DO i=1,sNx
bb24b8a3e6 Gael*0256         AREApost=SItrAREA(i,j,bi,bj,3)
80fd556159 Ou W*0257         DIAGarray(i,j,1+(iTr-1)*5) = SItracer(i,j,bi,bj,iTr)
                0258         DIAGarray(i,j,2+(iTr-1)*5) = SItracer(i,j,bi,bj,iTr)*AREApost
bb24b8a3e6 Gael*0259        ENDDO
                0260       ENDDO
                0261       endif
f50f58ec54 Gael*0262 #endif
                0263       ENDDO
3721cfe5e4 Gael*0264 #ifdef ALLOW_SITRACER_DEBUG_DIAG
fcdcf3fa1d Jean*0265 c     CALL DIAGNOSTICS_FILL(DIAGarray,'UDIAG1  ',0,Nr,3,bi,bj,myThid)
f50f58ec54 Gael*0266 #endif
                0267       ENDDO
                0268       ENDDO
                0269 
                0270 #endif /* ALLOW_SITRACER */
                0271 
                0272       RETURN
                0273       END