File indexing completed on 2018-10-27 05:10:25 UTC
view on githubraw file Latest commit 68432e7b on 2018-10-26 15:18:26 UTC
5ca83cd8f7 Dani*0001
0002 #include "STREAMICE_OPTIONS.h"
0003
0004
0005
0006 SUBROUTINE STREAMICE_UPD_FFRAC_UNCOUPLED ( myThid )
0007
0008
0009
0010
0011
0012 IMPLICIT NONE
0013 #include "SIZE.h"
0014 #include "EEPARAMS.h"
0015 #include "PARAMS.h"
0016 #include "STREAMICE.h"
0017 #include "GRID.h"
0018
0019
0020 INTEGER myThid
0021
0022
0023 #ifdef ALLOW_STREAMICE
0024
0025 INTEGER bi, bj, i, j
e4cfce0a6c Dani*0026 _RL OD, rhoi, rhow, delta, r, h, hf, i_r, rlo
68432e7ba3 dngo*0027 #ifdef STREAMICE_SMOOTH_FLOATATION2
5ca83cd8f7 Dani*0028 _RL ETA_GL_STREAMICE
0029 external ETA_GL_STREAMICE
68432e7ba3 dngo*0030 #endif
0031 #if defined(STREAMICE_SMOOTH_FLOATATION2) || defined(STREAMICE_SMOOTH_FLOATATION)
5ca83cd8f7 Dani*0032 _RL PHI_GL_STREAMICE
0033 external PHI_GL_STREAMICE
0034 #endif
e4cfce0a6c Dani*0035 #ifdef STREAMICE_FIRN_CORRECTION
0036 _RL firn_depth
0037 #endif
5ca83cd8f7 Dani*0038
0039 rhoi = streamice_density
0040 rhow = streamice_density_ocean_avg
0041 r=rhoi/rhow
0042 i_r = 1/r
0043 delta=1-r
e4cfce0a6c Dani*0044 #ifdef STREAMICE_FIRN_CORRECTION
0045 firn_depth = streamice_density *
0046 & streamice_firn_correction
0047 & / (streamice_density-streamice_density_firn)
0048 #endif
5ca83cd8f7 Dani*0049
0050
68432e7ba3 dngo*0051 #ifdef STREAMICE_SMOOTH_FLOATATION2
5ca83cd8f7 Dani*0052
0053 DO bj = myByLo(myThid), myByHi(myThid)
0054 DO bi = myBxLo(myThid), myBxHi(myThid)
0055 DO j=1-Oly,sNy+Oly
0056 DO i=1-Olx,sNx+Olx
0057
0058 if (STREAMICE_hmask(i,j,bi,bj).eq.1.0 .or.
0059 & STREAMICE_hmask(i,j,bi,bj).eq.2.0) THEN
0060
0061 h = H_streamice(i,j,bi,bj)
0062
0063 # ifdef USE_ALT_RLOW
0064 hf = -1.0 * i_r * R_low_si (i,j,bi,bj)
0065 # else
0066 hf = -1.0 * i_r * R_low (i,j,bi,bj)
0067 # endif
0068
0069 surf_el_streamice(i,j,bi,bj) =
0070 & ETA_GL_STREAMICE (
0071 & h-hf,
0072 & delta,
0073 & 1. _d 0,
0074 & delta*hf,
0075 & streamice_smooth_gl_width)
0076
0077 base_el_streamice(i,j,bi,bj) =
0078 & surf_el_streamice(i,j,bi,bj) - h
0079
0080 float_frac_streamice(i,j,bi,bj) =
0081 & PHI_GL_STREAMICE (
0082 & h-hf,
0083 & streamice_smooth_gl_width)
0084
0085 ENDIF
0086 ENDDO
0087 ENDDO
0088 ENDDO
0089 ENDDO
0090
e4cfce0a6c Dani*0091 #else
68432e7ba3 dngo*0092
5ca83cd8f7 Dani*0093
0094 DO bj = myByLo(myThid), myByHi(myThid)
0095 DO bi = myBxLo(myThid), myBxHi(myThid)
0096 DO j=1-Oly,sNy+Oly
0097 DO i=1-Olx,sNx+Olx
68432e7ba3 dngo*0098 h = H_streamice(i,j,bi,bj)
5ca83cd8f7 Dani*0099 # ifdef USE_ALT_RLOW
e4cfce0a6c Dani*0100 rlo = R_low_si (i,j,bi,bj)
5ca83cd8f7 Dani*0101 # else
e4cfce0a6c Dani*0102 rlo = R_low (i,j,bi,bj)
0103 #endif
5ca83cd8f7 Dani*0104
e4cfce0a6c Dani*0105 #ifdef STREAMICE_FIRN_CORRECTION
0106 if (STREAMICE_apply_firn_correction) then
1c4746d960 Dani*0107
0108 if (h_streamice(i,j,bi,bj).lt.firn_depth) then
0109 OD = -1.0 * rlo - streamice_density_firn/rhow *
0110 & h_streamice(i,j,bi,bj)
e4cfce0a6c Dani*0111 else
1c4746d960 Dani*0112 OD = -1.0 * rlo - rhoi/rhow *
0113 & (h_streamice(i,j,bi,bj)-streamice_firn_correction)
e4cfce0a6c Dani*0114 endif
0115 else
0116 #endif
0117 OD = -1.0 * Rlo -
68432e7ba3 dngo*0118 & H * rhoi/rhow
e4cfce0a6c Dani*0119 #ifdef STREAMICE_FIRN_CORRECTION
0120 endif
0121 #endif
5ca83cd8f7 Dani*0122
0123 IF (OD .ge. 0. _d 0) THEN
0124
0125
68432e7ba3 dngo*0126
e4cfce0a6c Dani*0127 base_el_streamice(i,j,bi,bj) = Rlo+OD
0128 #ifdef STREAMICE_FIRN_CORRECTION
0129 if (STREAMICE_apply_firn_correction) then
68432e7ba3 dngo*0130 if (h.lt.firn_depth) then
e4cfce0a6c Dani*0131 surf_el_streamice(i,j,bi,bj) =
68432e7ba3 dngo*0132 & (1-streamice_density_firn/rhow)*h
e4cfce0a6c Dani*0133 else
0134 surf_el_streamice(i,j,bi,bj) =
68432e7ba3 dngo*0135 & (1-rhoi/rhow)*h +
1c4746d960 Dani*0136 & rhoi/rhow*streamice_firn_correction
e4cfce0a6c Dani*0137 endif
0138 else
0139 #endif
5ca83cd8f7 Dani*0140 surf_el_streamice(i,j,bi,bj) =
68432e7ba3 dngo*0141 & (1-rhoi/rhow)*H
e4cfce0a6c Dani*0142 #ifdef STREAMICE_FIRN_CORRECTION
0143 endif
0144 #endif
0145
5ca83cd8f7 Dani*0146 ELSE
0147
0148
68432e7ba3 dngo*0149
e4cfce0a6c Dani*0150 base_el_streamice(i,j,bi,bj) = Rlo
0151 surf_el_streamice(i,j,bi,bj) = Rlo
68432e7ba3 dngo*0152 & + H
5ca83cd8f7 Dani*0153 ENDIF
68432e7ba3 dngo*0154
0155 #ifndef STREAMICE_SMOOTH_FLOATATION
0156
0157
0158 IF (OD .ge. 0. _d 0) THEN
0159 float_frac_streamice(i,j,bi,bj) = 0.0
0160 ELSE
0161 float_frac_streamice(i,j,bi,bj) = 1.0
0162 ENDIF
0163
0164 #else
0165
0166 if (STREAMICE_hmask(i,j,bi,bj).eq.1.0 .or.
0167 & STREAMICE_hmask(i,j,bi,bj).eq.2.0) THEN
0168 # ifdef USE_ALT_RLOW
0169 hf = -1.0 * i_r * R_low_si (i,j,bi,bj)
0170 # else
0171 hf = -1.0 * i_r * R_low (i,j,bi,bj)
0172 # endif
0173
0174 float_frac_streamice(i,j,bi,bj) =
0175 & PHI_GL_STREAMICE (
0176 & h-hf+streamice_smooth_gl_width/2.,
0177 & streamice_smooth_gl_width)
0178
0179 endif
0180 #endif
0181
5ca83cd8f7 Dani*0182 ENDDO
0183 ENDDO
0184 ENDDO
0185 ENDDO
0186
0187 #endif
0188
0189 _EXCH_XY_RL(float_frac_streamice, myThid )
0190 _EXCH_XY_RL(base_el_streamice, myThid )
0191 _EXCH_XY_RL(surf_el_streamice, myThid )
0192
0193
0194
0195
0196 #endif /* ALLOW_STREAMICE */
0197
0198 RETURN
0199 END