/[MITgcm]/MITgcm_contrib/shelfice_remeshing/DIG/code/shelfice_sea_level_avg.F
ViewVC logotype

Annotation of /MITgcm_contrib/shelfice_remeshing/DIG/code/shelfice_sea_level_avg.F

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


Revision 1.1 - (hide annotations) (download)
Fri Apr 1 10:19:38 2016 UTC (9 years, 3 months ago) by dgoldberg
Branch: MAIN
CVS Tags: HEAD
Added rough code to dig ice shelf to make continuous ocean

1 dgoldberg 1.1 C $Header: /u/gcmpack/MITgcm_contrib/verification_other/shelfice_remeshing/code/shelfice_sea_level_avg.F,v 1.1 2016/01/25 14:08:44 dgoldberg Exp $
2     C $Name: $
3    
4     #include "SHELFICE_OPTIONS.h"
5    
6     CBOP
7     SUBROUTINE SHELFICE_SEA_LEVEL_AVG( avgSL, myThid )
8     C *============================================================*
9     C | SUBROUTINE SHELFICE_INIT_VARIA
10     C | o Routine to initialize SHELFICE variables.
11     C *============================================================*
12     C | Initialize SHELFICE parameters and variables.
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 averages eta over all cells where
31     C here is open ocean, assessed by
32     C - maskInC = 1
33     C - kTopC = 0
34     C - shelficemass = 0
35    
36     _RL avgSL
37     INTEGER myThid
38    
39     CEndOfInterface
40    
41     #ifdef ALLOW_SHELFICE
42     C === Local variables ===
43     C i,j,bi,bj - Loop counters
44     INTEGER i, j, bi, bj
45     _RL locsum_eta (nSx,nSy)
46     _RL locsum_area (nSx,nSy)
47     _RL eta_loc, area_loc
48     _RL sum_eta
49     _RL sum_area
50     CEOP
51    
52     avgSL = 0. _d 0
53    
54     DO bj = myByLo(myThid), myByHi(myThid)
55     DO bi = myBxLo(myThid), myBxHi(myThid)
56     locsum_eta (bi,bj) = 0. _d 0
57     locsum_area (bi,bj) = 0. _d 0
58     ENDDO
59     ENDDO
60    
61     DO bj = myByLo(myThid), myByHi(myThid)
62     DO bi = myBxLo(myThid), myBxHi(myThid)
63     DO j = 1, sNy
64     DO i = 1, sNx
65    
66     IF ((maskInC(i,j,bi,bj) .eq. 1) .and.
67     & (kTopC(i,j,bi,bj) .eq. 0) .and.
68     & (shelficeMass(i,j,bi,bj) .lt. .01)) then
69    
70    
71    
72     eta_loc = etaN (i,j,bi,bj)
73     area_loc = rA (i,j,bi,bj)
74     ! print *, "GOT HERE ", i,j, eta_loc
75     locsum_eta(bi,bj) = locsum_eta(bi,bj) +
76     & eta_loc * area_loc
77     locsum_area(bi,bj) = locsum_area(bi,bj) + area_loc
78    
79     ENDIF
80     ENDDO
81     ENDDO
82     ENDDO
83     ENDDO
84    
85     CALL GLOBAL_SUM_TILE_RL( locsum_eta, sum_eta, myThid )
86     CALL GLOBAL_SUM_TILE_RL( locsum_area, sum_area, myThid )
87    
88    
89     IF (sum_area .le. 0.0) THEN
90     avgSL = 0. _d 0
91     ELSE
92     avgSL = sum_eta / sum_area
93     ENDIF
94    
95    
96     #endif /* ALLOW_SHELFICE */
97    
98     RETURN
99     END

  ViewVC Help
Powered by ViewVC 1.1.22