1 |
jmc |
1.3 |
C $Header: /u/gcmpack/models/MITgcmUV/model/src/update_surf_dr.F,v 1.2 2001/09/26 18:09:16 cnh Exp $ |
2 |
jmc |
1.1 |
C $Name: $ |
3 |
|
|
|
4 |
|
|
#include "CPP_OPTIONS.h" |
5 |
|
|
|
6 |
cnh |
1.2 |
CBOP |
7 |
|
|
C !ROUTINE: UPDATE_SURF_DR |
8 |
|
|
C !INTERFACE: |
9 |
jmc |
1.1 |
SUBROUTINE UPDATE_SURF_DR( myTime, myIter, myThid ) |
10 |
cnh |
1.2 |
C !DESCRIPTION: \bv |
11 |
|
|
C *==========================================================* |
12 |
|
|
C | SUBROUTINE UPDATE_SURF_DR |
13 |
|
|
C | o Update the surface-level thickness fraction (hFacC,W,S) |
14 |
|
|
C | according to the surface r-position = Non-Linear FrSurf |
15 |
|
|
C *==========================================================* |
16 |
|
|
C \ev |
17 |
|
|
|
18 |
|
|
C !USES: |
19 |
jmc |
1.1 |
IMPLICIT NONE |
20 |
|
|
C == Global variables |
21 |
|
|
#include "SIZE.h" |
22 |
|
|
#include "EEPARAMS.h" |
23 |
|
|
#include "PARAMS.h" |
24 |
|
|
c #include "DYNVARS.h" |
25 |
|
|
#include "GRID.h" |
26 |
|
|
#include "SURFACE.h" |
27 |
|
|
|
28 |
cnh |
1.2 |
C !INPUT/OUTPUT PARAMETERS: |
29 |
jmc |
1.1 |
C == Routine arguments == |
30 |
|
|
C myTime - Current time in simulation |
31 |
|
|
C myIter - Current iteration number in simulation |
32 |
|
|
C myThid - Thread number for this instance of the routine. |
33 |
|
|
_RL myTime |
34 |
|
|
INTEGER myIter |
35 |
|
|
INTEGER myThid |
36 |
|
|
|
37 |
cnh |
1.2 |
C !LOCAL VARIABLES: |
38 |
jmc |
1.1 |
#ifdef NONLIN_FRSURF |
39 |
|
|
C Local variables |
40 |
|
|
C i,j,k,bi,bj - loop counter |
41 |
|
|
INTEGER i,j,k,bi,bj |
42 |
|
|
INTEGER ks |
43 |
cnh |
1.2 |
CEOP |
44 |
jmc |
1.1 |
|
45 |
|
|
DO bj=myByLo(myThid), myByHi(myThid) |
46 |
|
|
DO bi=myBxLo(myThid), myBxHi(myThid) |
47 |
|
|
|
48 |
|
|
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
49 |
jmc |
1.3 |
|
50 |
|
|
#ifdef ALLOW_OBCS |
51 |
|
|
C-- Apply OBC to hFac_surfW,S before updating hFacW,S |
52 |
|
|
IF (useOBCS) CALL OBCS_APPLY_SURF_DR( |
53 |
|
|
I bi, bj, ksurfC, ksurfW, ksurfS, |
54 |
|
|
U hFac_surfC, hFac_surfW, hFac_surfS, |
55 |
|
|
I myThid ) |
56 |
|
|
#endif /* ALLOW_OBCS */ |
57 |
|
|
|
58 |
jmc |
1.1 |
C-- Update the fractional thickness "hFacC" of the surface level ksurfC : |
59 |
|
|
DO j=1-Oly,sNy+Oly |
60 |
|
|
DO i=1-Olx,sNx+Olx |
61 |
|
|
ks = ksurfC(i,j,bi,bj) |
62 |
|
|
IF (ks.LE.Nr) THEN |
63 |
|
|
hFacC(i,j,ks,bi,bj) = hFac_surfC(i,j,bi,bj) |
64 |
|
|
recip_hFacC(i,j,ks,bi,bj)= 1. _d 0 / hFac_surfC(i,j,bi,bj) |
65 |
|
|
ENDIF |
66 |
|
|
ENDDO |
67 |
|
|
ENDDO |
68 |
|
|
|
69 |
|
|
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
70 |
|
|
C-- Update fractional thickness "hFacW" & "hFacS" (at U and V points) |
71 |
|
|
|
72 |
|
|
DO j=1-Oly,sNy+Oly |
73 |
|
|
DO i=2-Olx,sNx+Olx |
74 |
|
|
ks = ksurfW(i,j,bi,bj) |
75 |
|
|
IF (ks.LE.Nr) THEN |
76 |
|
|
hFacW(i,j,ks,bi,bj) = hFac_surfW(i,j,bi,bj) |
77 |
|
|
recip_hFacW(i,j,ks,bi,bj)= 1. _d 0 / hFac_surfW(i,j,bi,bj) |
78 |
|
|
ENDIF |
79 |
|
|
ENDDO |
80 |
|
|
ENDDO |
81 |
|
|
DO j=2-Oly,sNy+Oly |
82 |
|
|
DO i=1-Olx,sNx+Olx |
83 |
|
|
ks = ksurfS(i,j,bi,bj) |
84 |
|
|
IF (ks.LE.Nr) THEN |
85 |
|
|
hFacS(i,j,ks,bi,bj) = hFac_surfS(i,j,bi,bj) |
86 |
|
|
recip_hFacS(i,j,ks,bi,bj)= 1. _d 0 / hFac_surfS(i,j,bi,bj) |
87 |
|
|
ENDIF |
88 |
|
|
ENDDO |
89 |
|
|
ENDDO |
90 |
|
|
|
91 |
|
|
C- end bi,bj loop |
92 |
|
|
ENDDO |
93 |
|
|
ENDDO |
94 |
|
|
|
95 |
|
|
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
96 |
|
|
#endif /* NONLIN_FRSURF */ |
97 |
|
|
|
98 |
|
|
RETURN |
99 |
|
|
END |