[825] | 1 | MODULE limistate |
---|
| 2 | !!====================================================================== |
---|
| 3 | !! *** MODULE limistate *** |
---|
| 4 | !! Initialisation of diagnostics ice variables |
---|
| 5 | !!====================================================================== |
---|
[2528] | 6 | !! History : 2.0 ! 2004-01 (C. Ethe, G. Madec) Original code |
---|
[4161] | 7 | !! 4.0 ! 2011-02 (G. Madec) dynamical allocation |
---|
| 8 | !! - ! 2012 (C. Rousset) add par_oce (for jp_sal)...bug? |
---|
[2528] | 9 | !!---------------------------------------------------------------------- |
---|
[825] | 10 | #if defined key_lim3 |
---|
| 11 | !!---------------------------------------------------------------------- |
---|
[834] | 12 | !! 'key_lim3' : LIM3 sea-ice model |
---|
[825] | 13 | !!---------------------------------------------------------------------- |
---|
| 14 | !! lim_istate : Initialisation of diagnostics ice variables |
---|
| 15 | !! lim_istate_init : initialization of ice state and namelist read |
---|
| 16 | !!---------------------------------------------------------------------- |
---|
[2528] | 17 | USE phycst ! physical constant |
---|
| 18 | USE oce ! dynamics and tracers variables |
---|
| 19 | USE dom_oce ! ocean domain |
---|
| 20 | USE sbc_oce ! Surface boundary condition: ocean fields |
---|
[4161] | 21 | USE sbc_ice ! Surface boundary condition: ice fields |
---|
[2528] | 22 | USE eosbn2 ! equation of state |
---|
| 23 | USE ice ! sea-ice variables |
---|
| 24 | USE par_ice ! ice parameters |
---|
[4161] | 25 | USE par_oce ! ocean parameters |
---|
[2528] | 26 | USE dom_ice ! sea-ice domain |
---|
| 27 | USE in_out_manager ! I/O manager |
---|
| 28 | USE lbclnk ! lateral boundary condition - MPP exchanges |
---|
[2715] | 29 | USE lib_mpp ! MPP library |
---|
[4161] | 30 | USE lib_fortran ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined) |
---|
[3294] | 31 | USE wrk_nemo ! work arrays |
---|
[825] | 32 | |
---|
| 33 | IMPLICIT NONE |
---|
| 34 | PRIVATE |
---|
| 35 | |
---|
[2528] | 36 | PUBLIC lim_istate ! routine called by lim_init.F90 |
---|
[825] | 37 | |
---|
[4166] | 38 | !! * Module variables |
---|
| 39 | ! !!** init namelist (namiceini) ** |
---|
| 40 | REAL(wp) :: ttest ! threshold water temperature for initial sea ice |
---|
| 41 | REAL(wp) :: hninn ! initial snow thickness in the north |
---|
| 42 | REAL(wp) :: hnins ! initial snow thickness in the south |
---|
| 43 | REAL(wp) :: hginn ! initial ice thickness in the north |
---|
| 44 | REAL(wp) :: hgins ! initial ice thickness in the south |
---|
| 45 | REAL(wp) :: aginn ! initial leads area in the north |
---|
| 46 | REAL(wp) :: agins ! initial leads area in the south |
---|
| 47 | REAL(wp) :: sinn ! initial salinity |
---|
| 48 | REAL(wp) :: sins |
---|
| 49 | |
---|
[825] | 50 | !!---------------------------------------------------------------------- |
---|
[4161] | 51 | !! LIM 3.0, UCL-LOCEAN-IPSL (2008) |
---|
[1156] | 52 | !! $Id$ |
---|
[4161] | 53 | !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) |
---|
[825] | 54 | !!---------------------------------------------------------------------- |
---|
[4161] | 55 | |
---|
[825] | 56 | CONTAINS |
---|
| 57 | |
---|
| 58 | SUBROUTINE lim_istate |
---|
| 59 | !!------------------------------------------------------------------- |
---|
| 60 | !! *** ROUTINE lim_istate *** |
---|
| 61 | !! |
---|
| 62 | !! ** Purpose : defined the sea-ice initial state |
---|
| 63 | !! |
---|
[4161] | 64 | !! ** Method : |
---|
| 65 | !! This routine will put some ice where ocean |
---|
| 66 | !! is at the freezing point, then fill in ice |
---|
| 67 | !! state variables using prescribed initial |
---|
| 68 | !! values in the namelist |
---|
| 69 | !! |
---|
| 70 | !! ** Steps : |
---|
| 71 | !! 1) Read namelist |
---|
| 72 | !! 2) Basal temperature; ice and hemisphere masks |
---|
| 73 | !! 3) Fill in the ice thickness distribution using gaussian |
---|
| 74 | !! 4) Fill in space-dependent arrays for state variables |
---|
| 75 | !! 5) Diagnostic arrays |
---|
| 76 | !! 6) Lateral boundary conditions |
---|
| 77 | !! |
---|
[4333] | 78 | !! ** Notes : o_i, t_su, t_s, t_i, s_i must be filled everywhere, even |
---|
| 79 | !! where there is no ice (clem: I do not know why but it is mandatory) |
---|
| 80 | !! |
---|
[4161] | 81 | !! History : |
---|
| 82 | !! 2.0 ! 01-04 (C. Ethe, G. Madec) Original code |
---|
| 83 | !! 3.0 ! 2007 (M. Vancoppenolle) Rewrite for ice cats |
---|
| 84 | !! 4.0 ! 09-11 (M. Vancoppenolle) Enhanced version for ice cats |
---|
| 85 | !!-------------------------------------------------------------------- |
---|
| 86 | |
---|
| 87 | !! * Local variables |
---|
| 88 | INTEGER :: ji, jj, jk, jl ! dummy loop indices |
---|
[4333] | 89 | REAL(wp) :: epsi20, ztmelts, zdh |
---|
[4161] | 90 | INTEGER :: i_hemis, i_fill, jl0 |
---|
| 91 | REAL(wp) :: ztest_1, ztest_2, ztest_3, ztest_4, ztests, zsigma, zarg, zA, zV, zA_cons, zV_cons, zconv |
---|
| 92 | REAL(wp), POINTER, DIMENSION(:) :: zhm_i_ini, zat_i_ini, zvt_i_ini, zhm_s_ini, zsm_i_ini |
---|
| 93 | REAL(wp), POINTER, DIMENSION(:,:) :: zht_i_ini, za_i_ini, zv_i_ini |
---|
| 94 | REAL(wp), POINTER, DIMENSION(:,:) :: zidto ! ice indicator |
---|
| 95 | INTEGER, POINTER, DIMENSION(:,:) :: zhemis ! hemispheric index |
---|
[825] | 96 | !-------------------------------------------------------------------- |
---|
[921] | 97 | |
---|
[3294] | 98 | CALL wrk_alloc( jpi, jpj, zidto ) |
---|
[4161] | 99 | CALL wrk_alloc( jpi, jpj, zhemis ) |
---|
| 100 | CALL wrk_alloc( jpl, 2, zht_i_ini, za_i_ini, zv_i_ini ) |
---|
| 101 | CALL wrk_alloc( 2, zhm_i_ini, zat_i_ini, zvt_i_ini, zhm_s_ini, zsm_i_ini ) |
---|
[2715] | 102 | |
---|
[4161] | 103 | epsi20 = 1.0e-20 |
---|
| 104 | IF(lwp) WRITE(numout,*) |
---|
| 105 | IF(lwp) WRITE(numout,*) 'lim_istate : Ice initialization ' |
---|
| 106 | IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ' |
---|
| 107 | |
---|
[825] | 108 | !-------------------------------------------------------------------- |
---|
[4161] | 109 | ! 1) Read namelist |
---|
[825] | 110 | !-------------------------------------------------------------------- |
---|
| 111 | |
---|
| 112 | CALL lim_istate_init ! reading the initials parameters of the ice |
---|
| 113 | |
---|
[1037] | 114 | !!gm in lim2 the initialisation if only done if required in the namelist : |
---|
| 115 | !!gm IF( .NOT. ln_limini ) THEN |
---|
| 116 | !!gm this should be added in lim3 namelist... |
---|
[825] | 117 | |
---|
| 118 | !-------------------------------------------------------------------- |
---|
[4161] | 119 | ! 2) Basal temperature, ice mask and hemispheric index |
---|
[825] | 120 | !-------------------------------------------------------------------- |
---|
| 121 | |
---|
[4161] | 122 | ! Basal temperature is set to the freezing point of seawater in Celsius |
---|
[3294] | 123 | t_bo(:,:) = tfreez( tsn(:,:,1,jp_sal) ) * tmask(:,:,1) ! freezing/melting point of sea water [Celcius] |
---|
[825] | 124 | |
---|
[1037] | 125 | DO jj = 1, jpj ! ice if sst <= t-freez + ttest |
---|
| 126 | DO ji = 1, jpi |
---|
[4161] | 127 | IF( tsn(ji,jj,1,jp_tem) - t_bo(ji,jj) >= ttest ) THEN ; zidto(ji,jj) = 0._wp ! no ice |
---|
| 128 | ELSE ; zidto(ji,jj) = 1._wp ! ice |
---|
[1037] | 129 | ENDIF |
---|
| 130 | END DO |
---|
| 131 | END DO |
---|
| 132 | |
---|
[4161] | 133 | t_bo(:,:) = t_bo(:,:) + rt0 ! conversion to Kelvin |
---|
[1037] | 134 | |
---|
[4161] | 135 | ! Hemispheric index |
---|
| 136 | ! MV 2011 new initialization |
---|
[825] | 137 | DO jj = 1, jpj |
---|
| 138 | DO ji = 1, jpi |
---|
[2528] | 139 | IF( fcor(ji,jj) >= 0._wp ) THEN |
---|
[4161] | 140 | zhemis(ji,jj) = 1 ! Northern hemisphere |
---|
| 141 | ELSE |
---|
| 142 | zhemis(ji,jj) = 2 ! Southern hemisphere |
---|
| 143 | ENDIF |
---|
| 144 | END DO |
---|
| 145 | END DO |
---|
| 146 | ! END MV 2011 new initialization |
---|
[825] | 147 | |
---|
[4161] | 148 | !-------------------------------------------------------------------- |
---|
| 149 | ! 3) Initialization of sea ice state variables |
---|
| 150 | !-------------------------------------------------------------------- |
---|
[825] | 151 | |
---|
[4161] | 152 | !----------------------------- |
---|
| 153 | ! 3.1) Hemisphere-dependent arrays |
---|
| 154 | !----------------------------- |
---|
| 155 | ! assign initial thickness, concentration, snow depth and salinity to |
---|
| 156 | ! an hemisphere-dependent array |
---|
| 157 | zhm_i_ini(1) = hginn ; zhm_i_ini(2) = hgins ! ice thickness |
---|
| 158 | zat_i_ini(1) = aginn ; zat_i_ini(2) = agins ! ice concentration |
---|
| 159 | zvt_i_ini(:) = zhm_i_ini(:) * zat_i_ini(:) ! ice volume |
---|
| 160 | zhm_s_ini(1) = hninn ; zhm_s_ini(2) = hnins ! snow depth |
---|
| 161 | zsm_i_ini(1) = sinn ; zsm_i_ini(2) = sins ! bulk ice salinity |
---|
[825] | 162 | |
---|
[4161] | 163 | !--------------------------------------------------------------------- |
---|
| 164 | ! 3.2) Distribute ice concentration and thickness into the categories |
---|
| 165 | !--------------------------------------------------------------------- |
---|
| 166 | ! a gaussian distribution for ice concentration is used |
---|
| 167 | ! then we check whether the distribution fullfills |
---|
| 168 | ! volume and area conservation, positivity and ice categories bounds |
---|
| 169 | DO i_hemis = 1, 2 |
---|
[825] | 170 | |
---|
[4161] | 171 | ztest_1 = 0 ; ztest_2 = 0 ; ztest_3 = 0 ; ztest_4 = 0 |
---|
[825] | 172 | |
---|
[4161] | 173 | ! note for the great nemo engineers: |
---|
| 174 | ! only very few of the WRITE statements are necessary for the reference version |
---|
| 175 | ! they were one day useful, but now i personally doubt of their |
---|
| 176 | ! potential for bringing anything useful |
---|
[825] | 177 | |
---|
[4161] | 178 | DO i_fill = jpl, 1, -1 |
---|
| 179 | IF ( ( ztest_1 + ztest_2 + ztest_3 + ztest_4 ) .NE. 4 ) THEN |
---|
| 180 | !---------------------------- |
---|
| 181 | ! fill the i_fill categories |
---|
| 182 | !---------------------------- |
---|
| 183 | ! *** 1 category to fill |
---|
| 184 | IF ( i_fill .EQ. 1 ) THEN |
---|
| 185 | zht_i_ini(1,i_hemis) = zhm_i_ini(i_hemis) |
---|
| 186 | za_i_ini(1,i_hemis) = zat_i_ini(i_hemis) |
---|
| 187 | zht_i_ini(2:jpl,i_hemis) = 0._wp |
---|
| 188 | za_i_ini(2:jpl,i_hemis) = 0._wp |
---|
| 189 | ELSE |
---|
[825] | 190 | |
---|
[4161] | 191 | ! *** >1 categores to fill |
---|
| 192 | !--- Ice thicknesses in the i_fill - 1 first categories |
---|
| 193 | DO jl = 1, i_fill - 1 |
---|
| 194 | zht_i_ini(jl,i_hemis) = 0.5 * ( hi_max(jl) + hi_max(jl-1) ) |
---|
| 195 | END DO |
---|
[825] | 196 | |
---|
[4161] | 197 | !--- jl0: most likely index where cc will be maximum |
---|
[825] | 198 | DO jl = 1, jpl |
---|
[4161] | 199 | IF ( ( zhm_i_ini(i_hemis) .GT. hi_max(jl-1) ) .AND. & |
---|
| 200 | ( zhm_i_ini(i_hemis) .LE. hi_max(jl) ) ) THEN |
---|
| 201 | jl0 = jl |
---|
| 202 | ENDIF |
---|
| 203 | END DO |
---|
| 204 | jl0 = MIN(jl0, i_fill) |
---|
[825] | 205 | |
---|
[4161] | 206 | !--- Concentrations |
---|
| 207 | za_i_ini(jl0,i_hemis) = zat_i_ini(i_hemis) / SQRT(REAL(jpl)) |
---|
| 208 | DO jl = 1, i_fill - 1 |
---|
| 209 | IF ( jl .NE. jl0 ) THEN |
---|
| 210 | zsigma = 0.5 * zhm_i_ini(i_hemis) |
---|
| 211 | zarg = ( zht_i_ini(jl,i_hemis) - zhm_i_ini(i_hemis) ) / zsigma |
---|
| 212 | za_i_ini(jl,i_hemis) = za_i_ini(jl0,i_hemis) * EXP(-zarg**2) |
---|
| 213 | ENDIF |
---|
| 214 | END DO |
---|
[825] | 215 | |
---|
[4161] | 216 | zA = 0. ! sum of the areas in the jpl categories |
---|
| 217 | DO jl = 1, i_fill - 1 |
---|
| 218 | zA = zA + za_i_ini(jl,i_hemis) |
---|
| 219 | END DO |
---|
| 220 | za_i_ini(i_fill,i_hemis) = zat_i_ini(i_hemis) - zA ! ice conc in the last category |
---|
| 221 | IF ( i_fill .LT. jpl ) za_i_ini(i_fill+1:jpl, i_hemis) = 0._wp |
---|
| 222 | |
---|
| 223 | !--- Ice thickness in the last category |
---|
| 224 | zV = 0. ! sum of the volumes of the N-1 categories |
---|
| 225 | DO jl = 1, i_fill - 1 |
---|
| 226 | zV = zV + za_i_ini(jl,i_hemis)*zht_i_ini(jl,i_hemis) |
---|
| 227 | END DO |
---|
| 228 | zht_i_ini(i_fill,i_hemis) = ( zvt_i_ini(i_hemis) - zV ) / za_i_ini(i_fill,i_hemis) |
---|
| 229 | IF ( i_fill .LT. jpl ) zht_i_ini(i_fill+1:jpl, i_hemis) = 0._wp |
---|
[825] | 230 | |
---|
[4161] | 231 | !--- volumes |
---|
| 232 | zv_i_ini(:,i_hemis) = za_i_ini(:,i_hemis) * zht_i_ini(:,i_hemis) |
---|
| 233 | IF ( i_fill .LT. jpl ) zv_i_ini(i_fill+1:jpl, i_hemis) = 0._wp |
---|
[921] | 234 | |
---|
[4161] | 235 | ENDIF ! i_fill |
---|
[825] | 236 | |
---|
[4161] | 237 | !--------------------- |
---|
| 238 | ! Compatibility tests |
---|
| 239 | !--------------------- |
---|
| 240 | ! Test 1: area conservation |
---|
| 241 | zA_cons = SUM(za_i_ini(:,i_hemis)) ; zconv = ABS(zat_i_ini(i_hemis) - zA_cons ) |
---|
| 242 | IF ( zconv .LT. 1.0e-6 ) THEN |
---|
| 243 | ztest_1 = 1 |
---|
| 244 | ELSE |
---|
| 245 | ! this write is useful |
---|
| 246 | IF(lwp) WRITE(numout,*) ' * TEST1 AREA NOT CONSERVED *** zA_cons = ', zA_cons,' zat_i_ini = ',zat_i_ini(i_hemis) |
---|
| 247 | ztest_1 = 0 |
---|
| 248 | ENDIF |
---|
[825] | 249 | |
---|
[4161] | 250 | ! Test 2: volume conservation |
---|
| 251 | zV_cons = SUM(zv_i_ini(:,i_hemis)) |
---|
| 252 | zconv = ABS(zvt_i_ini(i_hemis) - zV_cons) |
---|
[825] | 253 | |
---|
[4161] | 254 | IF ( zconv .LT. 1.0e-6 ) THEN |
---|
| 255 | ztest_2 = 1 |
---|
| 256 | ELSE |
---|
| 257 | ! this write is useful |
---|
| 258 | IF(lwp) WRITE(numout,*) ' * TEST2 VOLUME NOT CONSERVED *** zV_cons = ', zV_cons, & |
---|
| 259 | ' zvt_i_ini = ', zvt_i_ini(i_hemis) |
---|
| 260 | ztest_2 = 0 |
---|
| 261 | ENDIF |
---|
[825] | 262 | |
---|
[4161] | 263 | ! Test 3: thickness of the last category is in-bounds ? |
---|
| 264 | IF ( zht_i_ini(i_fill, i_hemis) .GT. hi_max(i_fill-1) ) THEN |
---|
| 265 | ztest_3 = 1 |
---|
| 266 | ELSE |
---|
| 267 | ! this write is useful |
---|
| 268 | IF(lwp) WRITE(numout,*) ' * TEST 3 THICKNESS OF THE LAST CATEGORY OUT OF BOUNDS *** zht_i_ini(i_fill,i_hemis) = ', & |
---|
| 269 | zht_i_ini(i_fill,i_hemis), ' hi_max(jpl-1) = ', hi_max(i_fill-1) |
---|
| 270 | ztest_3 = 0 |
---|
| 271 | ENDIF |
---|
[825] | 272 | |
---|
[4161] | 273 | ! Test 4: positivity of ice concentrations |
---|
| 274 | ztest_4 = 1 |
---|
| 275 | DO jl = 1, jpl |
---|
| 276 | IF ( za_i_ini(jl,i_hemis) .LT. 0._wp ) THEN |
---|
| 277 | ! this write is useful |
---|
| 278 | IF(lwp) WRITE(numout,*) ' * TEST 4 POSITIVITY NOT OK FOR CAT ', jl, ' WITH A = ', za_i_ini(jl,i_hemis) |
---|
| 279 | ztest_4 = 0 |
---|
[825] | 280 | ENDIF |
---|
[4161] | 281 | END DO |
---|
[825] | 282 | |
---|
[4161] | 283 | ENDIF ! ztest_1 + ztest_2 + ztest_3 + ztest_4 |
---|
| 284 | |
---|
| 285 | ztests = ztest_1 + ztest_2 + ztest_3 + ztest_4 |
---|
[825] | 286 | |
---|
[4161] | 287 | END DO ! i_fill |
---|
[825] | 288 | |
---|
[4161] | 289 | IF(lwp) THEN |
---|
| 290 | WRITE(numout,*), ' ztests : ', ztests |
---|
| 291 | IF ( ztests .NE. 4 ) THEN |
---|
| 292 | WRITE(numout,*) |
---|
| 293 | WRITE(numout,*), ' !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ' |
---|
| 294 | WRITE(numout,*), ' !!!! RED ALERT !!! ' |
---|
| 295 | WRITE(numout,*), ' !!!! BIIIIP BIIIP BIIIIP BIIIIP !!!' |
---|
| 296 | WRITE(numout,*), ' !!!! Something is wrong in the LIM3 initialization procedure ' |
---|
| 297 | WRITE(numout,*), ' !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ' |
---|
| 298 | WRITE(numout,*) |
---|
| 299 | WRITE(numout,*), ' *** ztests is not equal to 4 ' |
---|
| 300 | WRITE(numout,*), ' *** ztest_i (i=1,4) = ', ztest_1, ztest_2, ztest_3, ztest_4 |
---|
| 301 | WRITE(numout,*), ' zat_i_ini : ', zat_i_ini(i_hemis) |
---|
| 302 | WRITE(numout,*), ' zhm_i_ini : ', zhm_i_ini(i_hemis) |
---|
| 303 | ENDIF ! ztests .NE. 4 |
---|
| 304 | ENDIF |
---|
| 305 | |
---|
| 306 | END DO ! i_hemis |
---|
[825] | 307 | |
---|
[4161] | 308 | !--------------------------------------------------------------------- |
---|
| 309 | ! 3.3) Space-dependent arrays for ice state variables |
---|
| 310 | !--------------------------------------------------------------------- |
---|
[825] | 311 | |
---|
[4333] | 312 | ! Ice concentration, thickness and volume, ice salinity, ice age, surface temperature |
---|
[4161] | 313 | DO jl = 1, jpl ! loop over categories |
---|
| 314 | DO jj = 1, jpj |
---|
| 315 | DO ji = 1, jpi |
---|
| 316 | a_i(ji,jj,jl) = zidto(ji,jj) * za_i_ini (jl,zhemis(ji,jj)) ! concentration |
---|
| 317 | ht_i(ji,jj,jl) = zidto(ji,jj) * zht_i_ini(jl,zhemis(ji,jj)) ! ice thickness |
---|
[4333] | 318 | ht_s(ji,jj,jl) = ht_i(ji,jj,jl) * ( zhm_s_ini( zhemis(ji,jj) ) / zhm_i_ini( zhemis(ji,jj) ) ) ! snow depth |
---|
| 319 | sm_i(ji,jj,jl) = zidto(ji,jj) * zsm_i_ini(zhemis(ji,jj)) + ( 1._wp - zidto(ji,jj) ) * s_i_min ! salinity |
---|
[4161] | 320 | o_i(ji,jj,jl) = zidto(ji,jj) * 1._wp + ( 1._wp - zidto(ji,jj) ) ! age |
---|
[4333] | 321 | t_su(ji,jj,jl) = zidto(ji,jj) * 270.0 + ( 1._wp - zidto(ji,jj) ) * 270.0 ! surf temp |
---|
| 322 | |
---|
| 323 | ! This case below should not be used if (ht_s/ht_i) is ok in namelist |
---|
| 324 | ! In case snow load is in excess that would lead to transformation from snow to ice |
---|
| 325 | ! Then, transfer the snow excess into the ice (different from limthd_dh) |
---|
| 326 | zdh = MAX( 0._wp, ( rhosn * ht_s(ji,jj,jl) + ( rhoic - rau0 ) * ht_i(ji,jj,jl) ) * r1_rau0 ) |
---|
| 327 | ! recompute ht_i, ht_s avoiding out of bounds values |
---|
| 328 | ht_i(ji,jj,jl) = MIN( hi_max(jl), ht_i(ji,jj,jl) + zdh ) |
---|
| 329 | ht_s(ji,jj,jl) = MAX( 0._wp, ht_s(ji,jj,jl) - zdh * rhoic / rhosn ) |
---|
| 330 | |
---|
| 331 | ! ice volume, salt content, age content |
---|
[4161] | 332 | v_i(ji,jj,jl) = ht_i(ji,jj,jl) * a_i(ji,jj,jl) ! ice volume |
---|
| 333 | v_s(ji,jj,jl) = ht_s(ji,jj,jl) * a_i(ji,jj,jl) ! snow volume |
---|
| 334 | smv_i(ji,jj,jl) = MIN( sm_i(ji,jj,jl) , sss_m(ji,jj) ) * v_i(ji,jj,jl) ! salt content |
---|
| 335 | oa_i(ji,jj,jl) = o_i(ji,jj,jl) * a_i(ji,jj,jl) ! age content |
---|
| 336 | END DO ! ji |
---|
| 337 | END DO ! jj |
---|
| 338 | END DO ! jl |
---|
[825] | 339 | |
---|
[4161] | 340 | ! Snow temperature and heat content |
---|
| 341 | DO jk = 1, nlay_s |
---|
| 342 | DO jl = 1, jpl ! loop over categories |
---|
| 343 | DO jj = 1, jpj |
---|
| 344 | DO ji = 1, jpi |
---|
| 345 | t_s(ji,jj,jk,jl) = zidto(ji,jj) * 270.0 + ( 1._wp - zidto(ji,jj) ) * rtt |
---|
| 346 | ! Snow energy of melting |
---|
| 347 | e_s(ji,jj,jk,jl) = zidto(ji,jj) * rhosn * ( cpic * ( rtt - t_s(ji,jj,jk,jl) ) + lfus ) |
---|
| 348 | ! Change dimensions |
---|
| 349 | e_s(ji,jj,jk,jl) = e_s(ji,jj,jk,jl) / unit_fac |
---|
| 350 | ! Multiply by volume, so that heat content in 10^9 Joules |
---|
| 351 | e_s(ji,jj,jk,jl) = e_s(ji,jj,jk,jl) * area(ji,jj) * v_s(ji,jj,jl) / nlay_s |
---|
| 352 | END DO ! ji |
---|
| 353 | END DO ! jj |
---|
| 354 | END DO ! jl |
---|
| 355 | END DO ! jk |
---|
[825] | 356 | |
---|
[4161] | 357 | ! Ice salinity, temperature and heat content |
---|
| 358 | DO jk = 1, nlay_i |
---|
| 359 | DO jl = 1, jpl ! loop over categories |
---|
| 360 | DO jj = 1, jpj |
---|
| 361 | DO ji = 1, jpi |
---|
| 362 | t_i(ji,jj,jk,jl) = zidto(ji,jj) * 270.00 + ( 1._wp - zidto(ji,jj) ) * rtt |
---|
| 363 | s_i(ji,jj,jk,jl) = zidto(ji,jj) * zsm_i_ini(zhemis(ji,jj)) + ( 1._wp - zidto(ji,jj) ) * s_i_min |
---|
| 364 | ztmelts = - tmut * s_i(ji,jj,jk,jl) + rtt !Melting temperature in K |
---|
[825] | 365 | |
---|
[4161] | 366 | ! heat content per unit volume |
---|
| 367 | e_i(ji,jj,jk,jl) = zidto(ji,jj) * rhoic * ( cpic * ( ztmelts - t_i(ji,jj,jk,jl) ) & |
---|
| 368 | + lfus * ( 1._wp - (ztmelts-rtt) / MIN((t_i(ji,jj,jk,jl)-rtt),-epsi20) ) & |
---|
| 369 | - rcp * ( ztmelts - rtt ) ) |
---|
[825] | 370 | |
---|
[4161] | 371 | ! Correct dimensions to avoid big values |
---|
| 372 | e_i(ji,jj,jk,jl) = e_i(ji,jj,jk,jl) / unit_fac |
---|
[825] | 373 | |
---|
[4161] | 374 | ! Mutliply by ice volume, and divide by number of layers |
---|
| 375 | ! to get heat content in 10^9 J |
---|
| 376 | e_i(ji,jj,jk,jl) = e_i(ji,jj,jk,jl) * area(ji,jj) * v_i(ji,jj,jl) / nlay_i |
---|
| 377 | END DO ! ji |
---|
| 378 | END DO ! jj |
---|
| 379 | END DO ! jl |
---|
| 380 | END DO ! jk |
---|
[825] | 381 | |
---|
| 382 | !-------------------------------------------------------------------- |
---|
[4161] | 383 | ! 4) Global ice variables for output diagnostics | |
---|
[825] | 384 | !-------------------------------------------------------------------- |
---|
[4161] | 385 | fsbbq (:,:) = 0._wp |
---|
| 386 | u_ice (:,:) = 0._wp |
---|
| 387 | v_ice (:,:) = 0._wp |
---|
| 388 | stress1_i(:,:) = 0._wp |
---|
| 389 | stress2_i(:,:) = 0._wp |
---|
| 390 | stress12_i(:,:) = 0._wp |
---|
[825] | 391 | |
---|
[4161] | 392 | # if defined key_coupled |
---|
| 393 | albege(:,:) = 0.8 * tms(:,:) |
---|
| 394 | # endif |
---|
[825] | 395 | |
---|
| 396 | !-------------------------------------------------------------------- |
---|
[4161] | 397 | ! 5) Moments for advection |
---|
[825] | 398 | !-------------------------------------------------------------------- |
---|
| 399 | |
---|
[4161] | 400 | sxopw (:,:) = 0._wp |
---|
| 401 | syopw (:,:) = 0._wp |
---|
| 402 | sxxopw(:,:) = 0._wp |
---|
| 403 | syyopw(:,:) = 0._wp |
---|
| 404 | sxyopw(:,:) = 0._wp |
---|
[3610] | 405 | |
---|
[4161] | 406 | sxice (:,:,:) = 0._wp ; sxsn (:,:,:) = 0._wp ; sxa (:,:,:) = 0._wp |
---|
| 407 | syice (:,:,:) = 0._wp ; sysn (:,:,:) = 0._wp ; sya (:,:,:) = 0._wp |
---|
| 408 | sxxice(:,:,:) = 0._wp ; sxxsn(:,:,:) = 0._wp ; sxxa (:,:,:) = 0._wp |
---|
| 409 | syyice(:,:,:) = 0._wp ; syysn(:,:,:) = 0._wp ; syya (:,:,:) = 0._wp |
---|
| 410 | sxyice(:,:,:) = 0._wp ; sxysn(:,:,:) = 0._wp ; sxya (:,:,:) = 0._wp |
---|
[825] | 411 | |
---|
[4161] | 412 | sxc0 (:,:,:) = 0._wp ; sxe (:,:,:,:)= 0._wp |
---|
| 413 | syc0 (:,:,:) = 0._wp ; sye (:,:,:,:)= 0._wp |
---|
| 414 | sxxc0 (:,:,:) = 0._wp ; sxxe (:,:,:,:)= 0._wp |
---|
| 415 | syyc0 (:,:,:) = 0._wp ; syye (:,:,:,:)= 0._wp |
---|
| 416 | sxyc0 (:,:,:) = 0._wp ; sxye (:,:,:,:)= 0._wp |
---|
[825] | 417 | |
---|
[4161] | 418 | sxsal (:,:,:) = 0._wp |
---|
| 419 | sysal (:,:,:) = 0._wp |
---|
| 420 | sxxsal (:,:,:) = 0._wp |
---|
| 421 | syysal (:,:,:) = 0._wp |
---|
| 422 | sxysal (:,:,:) = 0._wp |
---|
[825] | 423 | |
---|
| 424 | !-------------------------------------------------------------------- |
---|
[4161] | 425 | ! 6) Lateral boundary conditions | |
---|
[825] | 426 | !-------------------------------------------------------------------- |
---|
| 427 | |
---|
| 428 | DO jl = 1, jpl |
---|
[4161] | 429 | |
---|
[825] | 430 | CALL lbc_lnk( a_i(:,:,jl) , 'T', 1. ) |
---|
| 431 | CALL lbc_lnk( v_i(:,:,jl) , 'T', 1. ) |
---|
| 432 | CALL lbc_lnk( v_s(:,:,jl) , 'T', 1. ) |
---|
| 433 | CALL lbc_lnk( smv_i(:,:,jl), 'T', 1. ) |
---|
| 434 | CALL lbc_lnk( oa_i(:,:,jl) , 'T', 1. ) |
---|
[4161] | 435 | |
---|
[825] | 436 | CALL lbc_lnk( ht_i(:,:,jl) , 'T', 1. ) |
---|
| 437 | CALL lbc_lnk( ht_s(:,:,jl) , 'T', 1. ) |
---|
| 438 | CALL lbc_lnk( sm_i(:,:,jl) , 'T', 1. ) |
---|
| 439 | CALL lbc_lnk( o_i(:,:,jl) , 'T', 1. ) |
---|
| 440 | CALL lbc_lnk( t_su(:,:,jl) , 'T', 1. ) |
---|
| 441 | DO jk = 1, nlay_s |
---|
| 442 | CALL lbc_lnk(t_s(:,:,jk,jl), 'T', 1. ) |
---|
[869] | 443 | CALL lbc_lnk(e_s(:,:,jk,jl), 'T', 1. ) |
---|
[825] | 444 | END DO |
---|
| 445 | DO jk = 1, nlay_i |
---|
| 446 | CALL lbc_lnk(t_i(:,:,jk,jl), 'T', 1. ) |
---|
| 447 | CALL lbc_lnk(e_i(:,:,jk,jl), 'T', 1. ) |
---|
| 448 | END DO |
---|
[2528] | 449 | ! |
---|
| 450 | a_i(:,:,jl) = tms(:,:) * a_i(:,:,jl) |
---|
[825] | 451 | END DO |
---|
[4161] | 452 | |
---|
| 453 | at_i (:,:) = 0.0_wp |
---|
| 454 | DO jl = 1, jpl |
---|
| 455 | at_i (:,:) = at_i (:,:) + a_i (:,:,jl) |
---|
| 456 | END DO |
---|
[825] | 457 | |
---|
| 458 | CALL lbc_lnk( at_i , 'T', 1. ) |
---|
| 459 | at_i(:,:) = tms(:,:) * at_i(:,:) ! put 0 over land |
---|
[2528] | 460 | ! |
---|
[825] | 461 | CALL lbc_lnk( fsbbq , 'T', 1. ) |
---|
[2528] | 462 | ! |
---|
[4161] | 463 | !-------------------------------------------------------------------- |
---|
| 464 | ! 6) ???? | |
---|
| 465 | !-------------------------------------------------------------------- |
---|
| 466 | tn_ice (:,:,:) = t_su (:,:,:) |
---|
| 467 | |
---|
[3294] | 468 | CALL wrk_dealloc( jpi, jpj, zidto ) |
---|
[4161] | 469 | CALL wrk_dealloc( jpi, jpj, zhemis ) |
---|
| 470 | CALL wrk_dealloc( jpl, 2, zht_i_ini, za_i_ini, zv_i_ini ) |
---|
| 471 | CALL wrk_dealloc( 2, zhm_i_ini, zat_i_ini, zvt_i_ini, zhm_s_ini, zsm_i_ini ) |
---|
| 472 | |
---|
[825] | 473 | END SUBROUTINE lim_istate |
---|
| 474 | |
---|
| 475 | SUBROUTINE lim_istate_init |
---|
| 476 | !!------------------------------------------------------------------- |
---|
| 477 | !! *** ROUTINE lim_istate_init *** |
---|
| 478 | !! |
---|
| 479 | !! ** Purpose : Definition of initial state of the ice |
---|
| 480 | !! |
---|
[4161] | 481 | !! ** Method : Read the namiceini namelist and check the parameter |
---|
| 482 | !! values called at the first timestep (nit000) |
---|
[825] | 483 | !! |
---|
[4161] | 484 | !! ** input : |
---|
| 485 | !! Namelist namiceini |
---|
| 486 | !! |
---|
| 487 | !! history : |
---|
| 488 | !! 8.5 ! 03-08 (C. Ethe) original code |
---|
| 489 | !! 8.5 ! 07-11 (M. Vancoppenolle) rewritten initialization |
---|
[825] | 490 | !!----------------------------------------------------------------------------- |
---|
[4166] | 491 | NAMELIST/namiceini/ ttest, hninn, hnins, hginn, hgins, aginn, agins, sinn, sins |
---|
| 492 | ! |
---|
[4147] | 493 | INTEGER :: ios ! Local integer output status for namelist read |
---|
[825] | 494 | !!----------------------------------------------------------------------------- |
---|
[2528] | 495 | ! |
---|
[4147] | 496 | REWIND( numnam_ice_ref ) ! Namelist namiceini in reference namelist : Ice initial state |
---|
| 497 | READ ( numnam_ice_ref, namiceini, IOSTAT = ios, ERR = 901) |
---|
| 498 | 901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namiceini in reference namelist', lwp ) |
---|
| 499 | |
---|
| 500 | REWIND( numnam_ice_cfg ) ! Namelist namiceini in configuration namelist : Ice initial state |
---|
| 501 | READ ( numnam_ice_cfg, namiceini, IOSTAT = ios, ERR = 902 ) |
---|
| 502 | 902 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namiceini in configuration namelist', lwp ) |
---|
| 503 | WRITE ( numoni, namiceini ) |
---|
[4161] | 504 | |
---|
| 505 | ! Define the initial parameters |
---|
| 506 | ! ------------------------- |
---|
| 507 | |
---|
| 508 | IF(lwp) THEN |
---|
[825] | 509 | WRITE(numout,*) |
---|
| 510 | WRITE(numout,*) 'lim_istate_init : ice parameters inititialisation ' |
---|
| 511 | WRITE(numout,*) '~~~~~~~~~~~~~~~' |
---|
| 512 | WRITE(numout,*) ' threshold water temp. for initial sea-ice ttest = ', ttest |
---|
| 513 | WRITE(numout,*) ' initial snow thickness in the north hninn = ', hninn |
---|
| 514 | WRITE(numout,*) ' initial snow thickness in the south hnins = ', hnins |
---|
[4161] | 515 | WRITE(numout,*) ' initial ice thickness in the north hginn = ', hginn |
---|
| 516 | WRITE(numout,*) ' initial ice thickness in the south hgins = ', hgins |
---|
| 517 | WRITE(numout,*) ' initial ice concentr. in the north aginn = ', aginn |
---|
| 518 | WRITE(numout,*) ' initial ice concentr. in the north agins = ', agins |
---|
| 519 | WRITE(numout,*) ' initial ice salinity in the north sinn = ', sinn |
---|
| 520 | WRITE(numout,*) ' initial ice salinity in the south sins = ', sins |
---|
[825] | 521 | ENDIF |
---|
[4161] | 522 | |
---|
[825] | 523 | END SUBROUTINE lim_istate_init |
---|
| 524 | |
---|
| 525 | #else |
---|
| 526 | !!---------------------------------------------------------------------- |
---|
| 527 | !! Default option : Empty module NO LIM sea-ice model |
---|
| 528 | !!---------------------------------------------------------------------- |
---|
| 529 | CONTAINS |
---|
| 530 | SUBROUTINE lim_istate ! Empty routine |
---|
| 531 | END SUBROUTINE lim_istate |
---|
| 532 | #endif |
---|
| 533 | |
---|
| 534 | !!====================================================================== |
---|
| 535 | END MODULE limistate |
---|