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

Annotation of /MITgcm/pkg/seaice/seaice_oceandrag_coeffs.F

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


Revision 1.2 - (hide annotations) (download)
Thu Feb 14 17:02:25 2013 UTC (11 years, 3 months ago) by mlosch
Branch: MAIN
CVS Tags: checkpoint64y, checkpoint64x, checkpoint64z, checkpoint64o, checkpoint64q, checkpoint64p, checkpoint64s, checkpoint64r, checkpoint64u, checkpoint64t, checkpoint64w, checkpoint64v, checkpoint64n, checkpoint64e, checkpoint64d, checkpoint64g, checkpoint64f, checkpoint65b, checkpoint65c, checkpoint65a, checkpoint65f, checkpoint65d, checkpoint65e, checkpoint64i, checkpoint64h, checkpoint64k, checkpoint65, checkpoint64j, checkpoint64m, checkpoint64l
Changes since 1.1: +3 -3 lines
extend loop ranges; this was the reason that made the hack in r1.17 of
seaice_preconditioner.F necessary

1 mlosch 1.2 C $Header: /u/gcmpack/MITgcm/pkg/seaice/seaice_oceandrag_coeffs.F,v 1.1 2012/10/16 06:53:00 mlosch Exp $
2 mlosch 1.1 C $Name: $
3    
4     #include "SEAICE_OPTIONS.h"
5     #ifdef ALLOW_OBCS
6     # include "OBCS_OPTIONS.h"
7     #endif
8    
9     CBOP
10     C !ROUTINE: SEAICE_OCEANDRAG_COEFFS
11     C !INTERFACE:
12     SUBROUTINE SEAICE_OCEANDRAG_COEFFS(
13     I uIceLoc, vIceLoc,
14     O CwatC,
15     I iStep, myTime, myIter, myThid )
16    
17     C !DESCRIPTION: \bv
18     C *==========================================================*
19     C | SUBROUTINE SEAICE_OCEANDRAG_COEFFS
20     C | o Compute the drag coefficients for ice-ocean drag,
21     C | so that we can use the same code for different solvers
22     C *==========================================================*
23     C | written by Martin Losch, Oct 2012
24     C *==========================================================*
25     C \ev
26    
27     C !USES:
28     IMPLICIT NONE
29    
30     C === Global variables ===
31     #include "SIZE.h"
32     #include "EEPARAMS.h"
33     #include "PARAMS.h"
34     #include "GRID.h"
35     #include "DYNVARS.h"
36     #include "SEAICE_SIZE.h"
37     #include "SEAICE_PARAMS.h"
38    
39     #ifdef ALLOW_AUTODIFF_TAMC
40     # include "tamc.h"
41     #endif
42    
43     C !INPUT/OUTPUT PARAMETERS:
44     C === Routine arguments ===
45     C myTime :: Simulation time
46     C myIter :: Simulation timestep number
47     C myThid :: my Thread Id. number
48     C iStep :: current sub-time step iterate
49     _RL myTime
50     INTEGER myIter
51     INTEGER myThid
52     INTEGER iStep
53     C u/vIceLoc :: local copies of the current ice velocity
54     _RL uIceLoc(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
55     _RL vIceLoc(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
56     C CwatC :: drag coefficients
57     _RL CwatC(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
58    
59     #if ( (defined SEAICE_CGRID) && (defined SEAICE_ALLOW_DYNAMICS) )
60     C === local variables ===
61     C i,j,bi,bj,ksrf :: loop indices
62     INTEGER i,j,bi,bj
63     INTEGER kSrf
64     _RL TEMPVAR
65     CEOP
66    
67     kSrf=1
68    
69     DO bj=myByLo(myThid),myByHi(myThid)
70     DO bi=myBxLo(myThid),myBxHi(myThid)
71 mlosch 1.2 DO j=1-OLy,sNy+Oly-1
72     DO i=1-OLx,sNx+OLy-1
73 mlosch 1.1 C non-linear water drag coefficients DWATN
74     #ifdef OBCS_UVICE_OLD
75     TEMPVAR = 0.25 _d 0*(
76     & ( ( uIceLoc(i ,j,bi,bj)-uVel(i ,j,kSrf,bi,bj) )
77     & +( uIceLoc(i+1,j,bi,bj)-uVel(i+1,j,kSrf,bi,bj) )
78     & )**2
79     & + ( ( vIceLoc(i, j ,bi,bj)-vVel(i, j ,kSrf,bi,bj) )
80     & +( vIceLoc(i,j+1,bi,bj)-vVel(i,j+1,kSrf,bi,bj) )
81     & )**2 )
82     #else /* OBCS_UVICE_OLD */
83     TEMPVAR = 0.25 _d 0*(
84     & ( ( uIceLoc(i ,j,bi,bj)-uVel(i ,j,kSrf,bi,bj) )
85     & *maskInW( i ,j,bi,bj)
86     & +( uIceLoc(i+1,J,bi,bj)-uVel(i+1,j,kSrf,bi,bj) )
87     & *maskInW(i+1,j,bi,bj) )**2
88     & + ( ( vIceLoc(i,j ,bi,bj)-vVel(i,j ,kSrf,bi,bj) )
89     & *maskInS(i, j ,bi,bj)
90     & +( vIceLoc(i,j+1,bi,bj)-vVel(i,j+1,kSrf,bi,bj) )
91     & *maskInS(i,j+1,bi,bj) )**2 )
92     #endif /* OBCS_UVICE_OLD */
93     IF ( YC(I,J,bi,bj) .LT. ZERO ) THEN
94     IF ( SEAICE_waterDrag_south.LE.0. ) THEN
95     CwatC(I,J,bi,bj)=0.
96     ELSEIF ( TEMPVAR
97     & .LE.(0.25 _d 0/SEAICE_waterDrag_south)**2 ) THEN
98     CwatC(I,J,bi,bj)=0.25 _d 0
99     ELSE
100     CwatC(I,J,bi,bj)=SEAICE_waterDrag_south*SQRT(TEMPVAR)
101     ENDIF
102     ELSE
103     IF ( SEAICE_waterDrag.LE.0. ) THEN
104     CwatC(I,J,bi,bj)=0.
105     ELSEIF ( TEMPVAR.LE.(0.25 _d 0/SEAICE_waterDrag)**2 ) THEN
106     CwatC(I,J,bi,bj)=0.25 _d 0
107     ELSE
108     CwatC(I,J,bi,bj)=SEAICE_waterDrag*SQRT(TEMPVAR)
109     ENDIF
110     ENDIF
111     CwatC(I,J,bi,bj) = CwatC(I,J,bi,bj) * maskC(I,J,kSrf,bi,bj)
112     ENDDO
113     ENDDO
114     ENDDO
115     ENDDO
116    
117     #endif /* SEAICE_ALLOW_DYNAMICS and SEAICE_CGRID */
118    
119     RETURN
120     END

  ViewVC Help
Powered by ViewVC 1.1.22