Back to home page

MITgcm

 
 

    


File indexing completed on 2024-01-13 06:10:45 UTC

view on githubraw file Latest commit 005af54e on 2024-01-12 20:10:27 UTC
8f81ce1bc7 Mart*0001 #include "SHELFICE_OPTIONS.h"
                0002 
90b0349f4d Mart*0003 CBOP
8f81ce1bc7 Mart*0004       SUBROUTINE SHELFICE_INIT_VARIA( myThid )
d28329b3d8 Jean*0005 C     *============================================================*
                0006 C     | SUBROUTINE SHELFICE_INIT_VARIA
                0007 C     | o Routine to initialize SHELFICE variables.
                0008 C     *============================================================*
                0009 C     | Initialize SHELFICE parameters and variables.
                0010 C     *============================================================*
8f81ce1bc7 Mart*0011       IMPLICIT NONE
                0012 
                0013 C     === Global variables ===
                0014 #include "SIZE.h"
                0015 #include "EEPARAMS.h"
                0016 #include "PARAMS.h"
                0017 #include "GRID.h"
                0018 #include "SHELFICE.h"
abed653eb5 Mart*0019 #ifdef ALLOW_COST
                0020 # include "SHELFICE_COST.h"
                0021 #endif /* ALLOW_COST */
8f81ce1bc7 Mart*0022 
                0023 C     === Routine arguments ===
                0024 C     myThid -  Number of this instance of SHELFICE_INIT_VARIA
                0025       INTEGER myThid
90b0349f4d Mart*0026 CEndOfInterface
8f81ce1bc7 Mart*0027 
                0028 #ifdef ALLOW_SHELFICE
                0029 C     === Local variables ===
d28329b3d8 Jean*0030 C     i,j,bi,bj - Loop counters
                0031       INTEGER i, j, bi, bj
90b0349f4d Mart*0032 CEOP
8f81ce1bc7 Mart*0033 
                0034       DO bj = myByLo(myThid), myByHi(myThid)
                0035        DO bi = myBxLo(myThid), myBxHi(myThid)
d28329b3d8 Jean*0036         DO j = 1-OLy, sNy+OLy
                0037          DO i = 1-OLx, sNx+OLx
c96d63ff5a Jean*0038            shelficeForcingT      (i,j,bi,bj) = 0. _d 0
                0039            shelficeForcingS      (i,j,bi,bj) = 0. _d 0
                0040            shelficeHeatFlux      (i,j,bi,bj) = 0. _d 0
                0041            shelficeFreshWaterFlux(i,j,bi,bj) = 0. _d 0
                0042            shiTransCoeffT        (i,j,bi,bj) = 0. _d 0
                0043            shiTransCoeffS        (i,j,bi,bj) = 0. _d 0
                0044            shelficeMass          (i,j,bi,bj) = 0. _d 0
7b8b86ab99 Timo*0045            shiCDragFld           (i,j,bi,bj) = 0. _d 0
                0046            shiDragQuadFld        (i,j,bi,bj) = 0. _d 0
8f81ce1bc7 Mart*0047          ENDDO
                0048         ENDDO
                0049        ENDDO
                0050       ENDDO
c69ccc91fb antn*0051 #ifdef ALLOW_AUTODIFF
                0052 C- Note: To simplify dependency & avoid recomputations, when compiling
                0053 C        pkg/autodiff, we always call SHELFICE_INIT_VARIA to initialise control
                0054 C        variables (as done above) without condition on useShelfIce.
                0055 C        Therefore, in this case, the "If useShelfIce" is added back here:
                0056       IF ( useShelfIce ) THEN
                0057 #endif
                0058 
0aa1a849b4 Mart*0059       IF ( .NOT. SHELFICEuseGammaFrict ) THEN
4014d9eb9b Dimi*0060        IF ( SHELFICETransCoeffTFile .NE. ' ' ) THEN
                0061         CALL READ_FLD_XY_RL( SHELFICETransCoeffTFile, ' ',
                0062      &                       shiTransCoeffT, 0, myThid )
                0063         _EXCH_XY_RL( shiTransCoeffT, myThid )
                0064         DO bj = myByLo(myThid), myByHi(myThid)
                0065          DO bi = myBxLo(myThid), myBxHi(myThid)
                0066           DO j = 1-OLy, sNy+OLy
                0067            DO i = 1-OLx, sNx+OLx
7b8b86ab99 Timo*0068             shiTransCoeffS(i,j,bi,bj) = SHELFICEsaltToHeatRatio *
4014d9eb9b Dimi*0069      &                                  shiTransCoeffT(i,j,bi,bj)
                0070            ENDDO
                0071           ENDDO
                0072          ENDDO
                0073         ENDDO
                0074        ELSE
0aa1a849b4 Mart*0075 C     set coefficients to constant values
4014d9eb9b Dimi*0076         DO bj = myByLo(myThid), myByHi(myThid)
                0077          DO bi = myBxLo(myThid), myBxHi(myThid)
                0078           DO j = 1-OLy, sNy+OLy
                0079            DO i = 1-OLx, sNx+OLx
                0080             shiTransCoeffT(i,j,bi,bj) = SHELFICEheatTransCoeff
                0081             shiTransCoeffS(i,j,bi,bj) = SHELFICEsaltTransCoeff
                0082            ENDDO
0aa1a849b4 Mart*0083           ENDDO
                0084          ENDDO
                0085         ENDDO
4014d9eb9b Dimi*0086        ENDIF
0aa1a849b4 Mart*0087       ENDIF
7b8b86ab99 Timo*0088 C     Update the spatially varying version of the drag coefficient
                0089 C     shiCDragFld used in shelfice_thermodynamics
                0090 C     shiCDragQuadFld used in shelfice_u/v_drag_coeff
                0091       DO bj = myByLo(myThid), myByHi(myThid)
                0092        DO bi = myBxLo(myThid), myBxHi(myThid)
                0093         DO j = 1-OLy, sNy+OLy
                0094          DO i = 1-OLx, sNx+OLx
                0095           shiCDragFld(i,j,bi,bj) = shiCDrag
                0096           shiDragQuadFld(i,j,bi,bj) = SHELFICEDragQuadratic
                0097          ENDDO
                0098         ENDDO
                0099        ENDDO
                0100       ENDDO
359d9ec3d7 Patr*0101 
a0178c5a01 Jean*0102       DO bj = myByLo(myThid), myByHi(myThid)
                0103        DO bi = myBxLo(myThid), myBxHi(myThid)
                0104         DO j = 1-OLy, sNy+OLy
                0105          DO i = 1-OLx, sNx+OLx
c96d63ff5a Jean*0106            shelficeMass(i,j,bi,bj) = shelficeMassInit(i,j,bi,bj)
3d2f509a67 Dani*0107          ENDDO
                0108         ENDDO
                0109        ENDDO
a0178c5a01 Jean*0110       ENDDO
3d2f509a67 Dani*0111 
9952f046d7 dngo*0112       IF ( SHELFICEMassStepping .AND.
                0113      &     ( nIter0.NE.0 .OR. startTime.NE.baseTime
                0114      &                   .OR. pickupSuff.NE.' ') ) THEN
                0115         CALL SHELFICE_READ_PICKUP( 1, nIter0, myThid )
005af54e38 Jean*0116       ENDIF
c96d63ff5a Jean*0117 
005af54e38 Jean*0118 #ifdef ALLOW_SHELFICE_REMESHING
                0119       IF ( SHI_update_kTopC ) THEN
c96d63ff5a Jean*0120 C     set/update "kTopC" to agree with changing ice-shelf mass
                0121         DO bj = myByLo(myThid), myByHi(myThid)
                0122          DO bi = myBxLo(myThid), myBxHi(myThid)
                0123           DO j = 1-OLy, sNy+OLy
                0124            DO i = 1-OLx, sNx+OLx
                0125              IF ( kSurfC(i,j,bi,bj).LE.Nr .AND.
                0126      &            shelficeMass(i,j,bi,bj).GT.zeroRL ) THEN
                0127                kTopC(i,j,bi,bj) = kSurfC(i,j,bi,bj)
                0128              ELSE
                0129                kTopC(i,j,bi,bj) = 0
                0130              ENDIF
                0131            ENDDO
                0132           ENDDO
                0133          ENDDO
                0134         ENDDO
198f6904ea Dani*0135       ENDIF
005af54e38 Jean*0136 #endif /* ALLOW_SHELFICE_REMESHING */
198f6904ea Dani*0137 
359d9ec3d7 Patr*0138 #ifdef ALLOW_COST
                0139       DO bj = myByLo(myThid), myByHi(myThid)
                0140        DO bi = myBxLo(myThid), myBxHi(myThid)
d28329b3d8 Jean*0141          DO j = 1-OLy, sNy+OLy
                0142           DO i = 1-OLx, sNx+OLx
359d9ec3d7 Patr*0143            cMeanSHIforT (i,j,bi,bj) = 0. _d 0
                0144            cMeanSHIforS (i,j,bi,bj) = 0. _d 0
                0145           ENDDO
                0146          ENDDO
                0147        ENDDO
                0148       ENDDO
                0149 c--
                0150       DO bj = myByLo(myThid), myByHi(myThid)
                0151        DO bi = myBxLo(myThid), myBxHi(myThid)
c96d63ff5a Jean*0152          objf_shelfice(bi,bj) = 0. _d 0
                0153          objf_shifwflx(bi,bj) = 0. _d 0
                0154          num_shifwflx(bi,bj)  = 0. _d 0
359d9ec3d7 Patr*0155        ENDDO
                0156       ENDDO
abed653eb5 Mart*0157 #endif /* ALLOW_COST */
359d9ec3d7 Patr*0158 
c69ccc91fb antn*0159 #ifdef ALLOW_AUTODIFF
                0160 C-    end if useShelfIce block
                0161       ENDIF
                0162 #endif
                0163 
8f81ce1bc7 Mart*0164 #endif /* ALLOW_SHELFICE */
                0165 
                0166       RETURN
                0167       END