/[MITgcm]/MITgcm_contrib/dgoldberg/CPL1/code/shelfice_massmin.F
ViewVC logotype

Contents of /MITgcm_contrib/dgoldberg/CPL1/code/shelfice_massmin.F

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


Revision 1.1 - (show annotations) (download)
Wed Jul 6 18:01:26 2016 UTC (9 years ago) by dgoldberg
Branch: MAIN
CVS Tags: HEAD
moving experiment out of shelfice_remeshing to replace with vertical remeshing only

1 C $Header: /u/gcmpack/MITgcm_contrib/verification_other/shelfice_remeshing/code/shelfice_massmin.F,v 1.2 2016/05/26 11:32:17 ksnow Exp $
2 C $Name: $
3
4 C KS_dens------
5
6 #include "SHELFICE_OPTIONS.h"
7
8 CBOP
9 SUBROUTINE SHELFICE_MASSMIN( R_min, massMin, myThid )
10 C *============================================================*
11 C | SUBROUTINE SHELFICE_MASSMIN
12 C | o Routine to determine the minimum mass based on MCWT
13 C *============================================================*
14 IMPLICIT NONE
15
16 C === Global variables ===
17 #include "SIZE.h"
18 #include "EEPARAMS.h"
19 #include "PARAMS.h"
20 #include "GRID.h"
21 #include "SHELFICE.h"
22 #include "DYNVARS.h"
23 #ifdef ALLOW_COST
24 # include "SHELFICE_COST.h"
25 #endif /* ALLOW_COST */
26
27 C === Routine arguments ===
28 C myThid - Number of this instance
29 C
30 C This subroutine calculates the minimum mass to allow MWCT space
31 C under the grounded ice.
32
33 _RL massMin(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
34 _RL R_min(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
35 INTEGER myThid
36
37 CEndOfInterface
38
39 #ifdef ALLOW_SHELFICE
40 C === Local variables ===
41 C i,j,bi,bj - Loop counters
42 INTEGER i, j, k, bi, bj, k2
43 _RL drho (Nr)
44 _RL phiHydF(Nr+1)
45 _RL phiHydC(Nr)
46 _RL vert_rho(Nr)
47 _RL drLoc, pLoad_min, sum_hFac
48 _RL SEALEVEL, ETA
49 CEOP
50
51 C Initialize variables
52 R_min = 0 _d 0
53 drLoc = 0 _d 0
54 pLoad_min = 0 _d 0
55 DO k=1,Nr
56 vert_rho(k) = 0 _d 0
57 ENDDO
58 DO bj = myByLo(myThid), myByHi(myThid)
59 DO bi = myBxLo(myThid), myBxHi(myThid)
60 DO j=1-OLy,sNy+OLy
61 DO i=1-OLx,sNx+OLx
62 massMin(i,j,bi,bj) = 0 _d 0
63 ENDDO
64 ENDDO
65 ENDDO
66 ENDDO
67
68 C First need vertical profile of density anomaly;
69 CALL SHELFICE_VERT_DENS( vert_rho, myThid )
70 C Get the average open ocean ssh
71 SEALEVEL = 0. _d 0
72 ETA = 0. _d 0
73 CALL SHELFICE_SEA_LEVEL_AVG( SEALEVEL,ETA, myThid )
74 C calcaulte hydrostatic pressure based on density profile
75 DO k = 1,Nr
76 drho(k) = vert_rho(k)
77 IF (k.EQ.1) THEN
78 phiHydF(k) = 0.
79 C phiHydF(k) = SEALEVEL*gravity*drho(k)*recip_rhoConst
80 ENDIF
81 phiHydC(k)=phiHydF(k) + halfRL*drF(k)*gravity*drho(k)
82 & *recip_rhoConst
83 phiHydF(k+1)=phiHydC(k) + halfRL*drF(k)*gravity*drho(k)
84 & *recip_rhoConst
85 ENDDO
86
87 C calculate the level of minimum pressure and from that massMin
88 C based on R_MCWT
89 DO bj = myByLo(myThid), myByHi(myThid)
90 DO bi = myBxLo(myThid), myBxHi(myThid)
91 DO j=1-OLy,sNy+OLy
92 DO i=1-OLx,sNx+OLx
93 R_min(i,j,bi,bj)=R_Low(i,j,bi,bi)+R_MWCT(i,j,bi,bj)
94 DO k =1,Nr
95 IF ((R_min(i,j,bi,bj) .GT. rF(k+1)) .AND.
96 & (R_min(i,j,bi,bj) .LE. rF(k))) THEN
97 drLoc = (rF(k)-R_min(i,j,bi,bj))/drF(k)
98
99 pLoad_min = (phiHydF(k) + drLoc*
100 & (phiHydF(k+1)-phiHydF(k)))*rhoConst
101 & + gravity*rhoConst*(drLoc*drF(k))
102
103 massMin(i,j,bi,bj) = pLoad_min*recip_gravity -
104 & rF(k)*rhoConst
105 ENDIF
106 ENDDO
107 ENDDO
108 ENDDO
109 ENDDO
110 ENDDO
111
112 #endif /* ALLOW_SHELFICE */
113
114 RETURN
115 END

  ViewVC Help
Powered by ViewVC 1.1.22