/[MITgcm]/MITgcm_contrib/verification_other/shelfice_remeshing/code/shelfice_massmin.F
ViewVC logotype

Annotation of /MITgcm_contrib/verification_other/shelfice_remeshing/code/shelfice_massmin.F

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


Revision 1.1 - (hide annotations) (download)
Tue May 24 08:25:41 2016 UTC (9 years, 1 month ago) by ksnow
Branch: MAIN
Routine to calculate the new massmin given depth+time depenent pload

1 ksnow 1.1 C $Header: /u/gcmpack/MITgcm_contrib/verification_other/shelfice_remeshing/code/shelfice_massmin.F,v 1.1 2016/05/11 18:16:04 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     CEOP
49    
50     C Initialize variables
51     R_min = 0 _d 0
52     drLoc = 0 _d 0
53     pLoad_min = 0 _d 0
54     DO k=1,Nr
55     vert_rho(k) = 0 _d 0
56     ENDDO
57     DO bj = myByLo(myThid), myByHi(myThid)
58     DO bi = myBxLo(myThid), myBxHi(myThid)
59     DO j=1-OLy,sNy+OLy
60     DO i=1-OLx,sNx+OLx
61     massMin(i,j,bi,bj) = 0 _d 0
62     ENDDO
63     ENDDO
64     ENDDO
65     ENDDO
66    
67     C First need vertical profile of density anomaly;
68     CALL SHELFICE_VERT_DENS( vert_rho, myThid )
69     C calcaulte hydrostatic pressure based on density profile
70     DO k = 1,Nr
71     drho(k) = vert_rho(k)
72     IF (k.EQ.1) THEN
73     phiHydF(k) = 0.
74     ENDIF
75     phiHydC(k)=phiHydF(k) + halfRL*drF(k)*gravity*drho(k)
76     & *recip_rhoConst
77     phiHydF(k+1)=phiHydC(k) + halfRL*drF(k)*gravity*drho(k)
78     & *recip_rhoConst
79     ENDDO
80    
81     C calculate the level of minimum pressure and from that massMin
82     C based on R_MCWT
83     DO bj = myByLo(myThid), myByHi(myThid)
84     DO bi = myBxLo(myThid), myBxHi(myThid)
85     DO j=1-OLy,sNy+OLy
86     DO i=1-OLx,sNx+OLx
87     R_min(i,j,bi,bj)=R_Low(i,j,bi,bi)+R_MWCT(i,j,bi,bj)
88     DO k =1,Nr
89     IF ((R_min(i,j,bi,bj) .GT. rF(k+1)) .AND.
90     & (R_min(i,j,bi,bj) .LE. rF(k))) THEN
91     drLoc = 1 - hFacC(i,j,k,bi,bj)
92     sum_hFac = 0. _d 0
93     DO k2 =k,Nr
94     sum_hFac = sum_hFac + hFacC(i,j,k2,bi,bj)*drF(k2)
95     ENDDO
96    
97     pLoad_min = (phiHydF(k) + drLoc*
98     & (phiHydF(k+1)-phiHydF(k)))*rhoConst
99     massMin(i,j,bi,bj) = pLoad_min*recip_gravity -
100     & (sum_hFac+R_Low(i,j,bi,bj))*rhoConst
101     R_min(i,j,bi,bj) = sum_hFac+R_Low(i,j,bi,bj)
102     ENDIF
103     ENDDO
104     ENDDO
105     ENDDO
106     ENDDO
107     ENDDO
108    
109     #endif /* ALLOW_SHELFICE */
110    
111     RETURN
112     END

  ViewVC Help
Powered by ViewVC 1.1.22