Back to home page

MITgcm

 
 

    


File indexing completed on 2023-08-04 05:10:45 UTC

view on githubraw file Latest commit 45315406 on 2023-08-03 16:50:12 UTC
e97d1f6d02 Gael*0001 #include "SEAICE_OPTIONS.h"
                0002 
                0003 CBOP
                0004       SUBROUTINE SEAICE_FREEDRIFT( myTime, myIter, myThid )
850adf2a7e Jean*0005 C     *==========================================================*
                0006 C     | SUBROUTINE  SEAICE_FREEDRIFT
                0007 C     | o Solve ice approximate momentum equation analytically
                0008 C     *==========================================================*
e97d1f6d02 Gael*0009       IMPLICIT NONE
                0010 
                0011 C     === Global variables ===
                0012 #include "SIZE.h"
                0013 #include "EEPARAMS.h"
                0014 #include "PARAMS.h"
                0015 #include "DYNVARS.h"
                0016 #include "GRID.h"
03c669d1ab Jean*0017 #include "SEAICE_SIZE.h"
e97d1f6d02 Gael*0018 #include "SEAICE_PARAMS.h"
03c669d1ab Jean*0019 #include "SEAICE.h"
e97d1f6d02 Gael*0020 
                0021 C     === Routine arguments ===
                0022 C     myTime :: Simulation time
                0023 C     myIter :: Simulation timestep number
                0024 C     myThid :: my Thread Id. number
                0025       _RL     myTime
                0026       INTEGER myIter
                0027       INTEGER myThid
                0028 CEOP
                0029 
45315406aa Mart*0030 #if ( defined SEAICE_CGRID && defined SEAICE_ALLOW_FREEDRIFT )
e97d1f6d02 Gael*0031 
                0032 C     === Local variables ===
73c8571595 Jean*0033       INTEGER i, j, kSrf, bi, bj
e97d1f6d02 Gael*0034 
                0035       _RL tmpscal1,tmpscal2,tmpscal3,tmpscal4
                0036 
                0037       _RL taux_onIce_cntr, tauy_onIce_cntr, uvel_cntr, vvel_cntr
                0038       _RL mIceCor, rhs_x, rhs_y, rhs_n, rhs_a, sol_n, sol_a
                0039 
850adf2a7e Jean*0040       _RL uice_cntr(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0041       _RL vice_cntr(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
e97d1f6d02 Gael*0042 
0320e25227 Mart*0043       IF ( usingPCoords ) THEN
                0044        kSrf = Nr
                0045       ELSE
                0046        kSrf = 1
                0047       ENDIF
e97d1f6d02 Gael*0048 
850adf2a7e Jean*0049 C initialize fields:
                0050 C ==================
e97d1f6d02 Gael*0051 
0320e25227 Mart*0052       DO bj=myByLo(myThid),myByHi(myThid)
                0053        DO bi=myBxLo(myThid),myBxHi(myThid)
                0054         DO j=1-OLy,sNy+OLy
                0055          DO i=1-OLx,sNx+OLx
                0056           uice_fd(i,j,bi,bj)=0. _d 0
                0057           vice_fd(i,j,bi,bj)=0. _d 0
                0058           uice_cntr(i,j,bi,bj)=0. _d 0
                0059           Vice_cntr(i,j,bi,bj)=0. _d 0
e97d1f6d02 Gael*0060          ENDDO
                0061         ENDDO
                0062        ENDDO
0320e25227 Mart*0063       ENDDO
e97d1f6d02 Gael*0064 
0320e25227 Mart*0065       DO bj=myByLo(myThid),myByHi(myThid)
                0066        DO bi=myBxLo(myThid),myBxHi(myThid)
                0067         DO j=1,sNy
                0068          DO i=1,sNx
73c8571595 Jean*0069 
850adf2a7e Jean*0070 C preliminary computations:
                0071 C =========================
                0072 C air-ice stress at cell center
0320e25227 Mart*0073           taux_onIce_cntr=HALF*
                0074      &      (FORCEX0(i,j,bi,bj)+FORCEX0(i+1,j,bi,bj))
                0075           tauy_onIce_cntr=HALF*
                0076      &      (FORCEY0(i,j,bi,bj)+FORCEY0(i,j+1,bi,bj))
850adf2a7e Jean*0077 C mass of ice per unit area (kg/m2) times coriolis f
0320e25227 Mart*0078           mIceCor=SEAICE_rhoIce*HEFF(i,j,bi,bj)*_fCori(i,j,bi,bj)
850adf2a7e Jean*0079 C ocean velocity at cell center
0320e25227 Mart*0080           uvel_cntr=HALF*(uvel(i,j,kSrf,bi,bj)+uvel(i+1,j,kSrf,bi,bj))
                0081           vvel_cntr=HALF*(vvel(i,j,kSrf,bi,bj)+vvel(i,j+1,kSrf,bi,bj))
850adf2a7e Jean*0082 C right hand side of free drift equation:
0320e25227 Mart*0083           rhs_x= -taux_onIce_cntr -mIceCor*vvel_cntr
                0084           rhs_y= -tauy_onIce_cntr +mIceCor*uvel_cntr
e97d1f6d02 Gael*0085 
850adf2a7e Jean*0086 C norm of angle of rhs
0320e25227 Mart*0087           tmpscal1=rhs_x*rhs_x + rhs_y*rhs_y
                0088           IF ( tmpscal1.GT.ZERO ) THEN
                0089            rhs_n=SQRT( rhs_x*rhs_x + rhs_y*rhs_y )
                0090            rhs_a=ATAN2(rhs_y,rhs_x)
                0091           ELSE
                0092            rhs_n=0. _d 0
                0093            rhs_a=0. _d 0
                0094           ENDIF
e97d1f6d02 Gael*0095 
850adf2a7e Jean*0096 C solve for norm:
                0097 C ===============
0320e25227 Mart*0098           IF ( YC(i,j,bi,bj) .LT. ZERO ) THEN
                0099            tmpscal1 = 1. _d 0 /rhoConst/SEAICE_waterDrag_south
                0100           ELSE
                0101            tmpscal1 = 1. _d 0 /rhoConst/SEAICE_waterDrag
                0102           ENDIF
850adf2a7e Jean*0103 C polynomial coefficients
0320e25227 Mart*0104           tmpscal2= tmpscal1*tmpscal1*mIceCor*mIceCor
                0105           tmpscal3= tmpscal1*tmpscal1*rhs_n*rhs_n
850adf2a7e Jean*0106 C discriminant
0320e25227 Mart*0107           tmpscal4=tmpscal2*tmpscal2+4. _d 0*tmpscal3
                0108           IF ( tmpscal3.GT.ZERO ) THEN
                0109            sol_n=SQRT(HALF*(SQRT(tmpscal4)-tmpscal2))
                0110           ELSE
                0111            sol_n=0. _d 0
                0112           ENDIF
e97d1f6d02 Gael*0113 
850adf2a7e Jean*0114 C solve for angle:
                0115 C ================
0320e25227 Mart*0116           IF ( YC(i,j,bi,bj) .LT. ZERO ) THEN
                0117            tmpscal1 = SEAICE_waterDrag_south*rhoConst
                0118           ELSE
                0119            tmpscal1 = SEAICE_waterDrag*rhoConst
                0120           ENDIF
                0121 
                0122           tmpscal2= tmpscal1*sol_n*sol_n
                0123           tmpscal3= mIceCor*sol_n
                0124 
                0125           tmpscal4=tmpscal2*tmpscal2 + tmpscal3*tmpscal3
                0126           IF ( tmpscal4.GT.ZERO ) THEN
                0127            sol_a=rhs_a-ATAN2(tmpscal3,tmpscal2)
                0128           ELSE
                0129            sol_a=0. _d 0
                0130           ENDIF
e97d1f6d02 Gael*0131 
850adf2a7e Jean*0132 C compute uice, vice at cell center:
                0133 C ==================================
0320e25227 Mart*0134           uice_cntr(i,j,bi,bj)=uvel_cntr-sol_n*COS(sol_a)
                0135           vice_cntr(i,j,bi,bj)=vvel_cntr-sol_n*SIN(sol_a)
e97d1f6d02 Gael*0136 
                0137          ENDDO
                0138         ENDDO
                0139        ENDDO
0320e25227 Mart*0140       ENDDO
e97d1f6d02 Gael*0141 
850adf2a7e Jean*0142 C interpolated to velocity points:
                0143 C ================================
e97d1f6d02 Gael*0144 
0320e25227 Mart*0145       CALL EXCH_UV_AGRID_3D_RL(uice_cntr,vice_cntr,.TRUE.,1,myThid)
                0146 
                0147       DO bj=myByLo(myThid),myByHi(myThid)
                0148        DO bi=myBxLo(myThid),myBxHi(myThid)
                0149         DO j=1,sNy
                0150          DO i=1,sNx
                0151           uice_fd(i,j,bi,bj)=HALF*
                0152      &      (uice_cntr(i-1,j,bi,bj)+uice_cntr(i,j,bi,bj))
                0153           vice_fd(i,j,bi,bj)=HALF*
                0154      &      (vice_cntr(i,j-1,bi,bj)+vice_cntr(i,j,bi,bj))
e97d1f6d02 Gael*0155          ENDDO
                0156         ENDDO
                0157        ENDDO
0320e25227 Mart*0158       ENDDO
e97d1f6d02 Gael*0159 
0320e25227 Mart*0160       CALL EXCH_UV_XY_RL( uice_fd, vice_fd, .TRUE., myThid )
e97d1f6d02 Gael*0161 
73c8571595 Jean*0162 C     Apply masks (same/similar to seaice_evp.F/seaice_lsr.F)
                0163       DO bj=myByLo(myThid),myByHi(myThid)
                0164        DO bi=myBxLo(myThid),myBxHi(myThid)
850adf2a7e Jean*0165         DO j=1-OLy,sNy+OLy
                0166          DO i=1-OLx,sNx+OLx
ec0d7df165 Mart*0167           uIce_fd(i,j,bi,bj)=uIce_fd(i,j,bi,bj)*SIMaskU(i,j,bi,bj)
                0168           vIce_fd(i,j,bi,bj)=vIce_fd(i,j,bi,bj)*SIMaskV(i,j,bi,bj)
73c8571595 Jean*0169          ENDDO
                0170         ENDDO
                0171        ENDDO
                0172       ENDDO
                0173 
45315406aa Mart*0174 #endif /* SEAICE_CGRID and SEAICE_ALLOW_FREEDRIFT */
e97d1f6d02 Gael*0175       RETURN
                0176       END