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

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

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


Revision 1.3 - (show annotations) (download)
Mon Oct 20 03:20:58 2014 UTC (9 years, 7 months ago) by gforget
Branch: MAIN
CVS Tags: checkpoint66g, checkpoint66f, checkpoint66e, checkpoint66d, checkpoint66c, checkpoint66b, checkpoint66a, checkpoint66o, checkpoint66n, checkpoint66m, checkpoint66l, checkpoint66k, checkpoint66j, checkpoint66i, checkpoint66h, checkpoint65z, checkpoint65x, checkpoint65y, checkpoint65r, checkpoint65s, checkpoint65p, checkpoint65q, checkpoint65v, checkpoint65w, checkpoint65t, checkpoint65u, checkpoint65j, checkpoint65k, checkpoint65h, checkpoint65i, checkpoint65n, checkpoint65o, checkpoint65l, checkpoint65m, checkpoint65g, HEAD
Changes since 1.2: +4 -1 lines
- ECCO_OPTIONS.h is needed when including ecco_cost.h, ecco.h
- AUTODIFF_OPTIONS.h is needed when including tamc.h, tamc_keys.h
- CTRL_OPTIONS.h is needed when including ctrl.h, etc

- pkg/seaice/seaice_cost*.F : clean up CPP brackets
- SEAICE_SIZE.h : replace ALLOW_AUTODIFF_TAMC with ALLOW_AUTODIFF to
  avoid needing AUTODIFF_OPTIONS.h anytime SEAICE_SIZE.h is included
  (it seems that THSICE_SIZE.h, PTRACERS_SIZE.h have the same issue...)

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

  ViewVC Help
Powered by ViewVC 1.1.22