- Timestamp:
- 2017-09-18T16:54:04+02:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2017/dev_r8183_ICEMODEL/NEMOGCM/NEMO/LIM_SRC_3/iceistate.F90
r8531 r8534 2 2 !!====================================================================== 3 3 !! *** MODULE iceistate *** 4 !! Initialisation of diagnosticsice variables4 !! sea-ice : Initialization of ice variables 5 5 !!====================================================================== 6 6 !! History : 2.0 ! 2004-01 (C. Ethe, G. Madec) Original code … … 12 12 #if defined key_lim3 13 13 !!---------------------------------------------------------------------- 14 !! 'key_lim3' LIM3sea-ice model14 !! 'key_lim3' ESIM sea-ice model 15 15 !!---------------------------------------------------------------------- 16 16 !! ice_istate : initialization of diagnostics ice variables 17 17 !! ice_istate_init : initialization of ice state and namelist read 18 18 !!---------------------------------------------------------------------- 19 USE par_oce ! ocean parameters20 19 USE phycst ! physical constant 21 20 USE oce ! dynamics and tracers variables … … 29 28 ! 30 29 USE in_out_manager ! I/O manager 30 USE iom ! I/O manager library 31 31 USE lib_mpp ! MPP library 32 USE lib_fortran ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined)32 USE lib_fortran ! fortran utilities (glob_sum + no signed zero) 33 33 USE fldread ! read input fields 34 USE iom35 34 36 35 IMPLICIT NONE … … 82 81 !! values in the namelist 83 82 !! 84 !! ** Steps : 1) Read namelist85 !! 2) Basal temperature; ice and hemisphere masks83 !! ** Steps : 1) Set initial surface and basal temperatures 84 !! 2) Recompute or read sea ice state variables 86 85 !! 3) Fill in the ice thickness distribution using gaussian 87 86 !! 4) Fill in space-dependent arrays for state variables 88 !! 5) Diagnostic arrays89 !! 6) Lateral boundary conditions87 !! 5) snow-ice mass computation 88 !! 6) store before fields 90 89 !! 91 90 !! ** Notes : o_i, t_su, t_s, t_i, s_i must be filled everywhere, even … … 109 108 110 109 !-------------------------------------------------------------------- 111 ! 1) Read namelist110 ! 1) Set surface and bottom temperatures to initial values 112 111 !-------------------------------------------------------------------- 113 112 ! … … 122 121 t_bo(:,:) = ( t_bo(:,:) + rt0 ) * tmask(:,:,1) 123 122 124 !--------------------------------------------------------------------125 ! 2) Initialization of sea ice state variables126 !--------------------------------------------------------------------127 123 IF( ln_iceini ) THEN 124 !----------------------------------------------------------- 125 ! 2) Compute or read sea ice variables ===> single category 126 !----------------------------------------------------------- 128 127 ! 129 IF( ln_iceini_file )THEN 130 ! 128 ! !---------------! 129 IF( ln_iceini_file )THEN ! Read a file ! 130 ! !---------------! 131 ! 131 132 zht_i_ini(:,:) = si(jp_hti)%fnow(:,:,1) 132 133 zht_s_ini(:,:) = si(jp_hts)%fnow(:,:,1) … … 139 140 ELSEWHERE ; zswitch(:,:) = 0._wp 140 141 END WHERE 142 zvt_i_ini(:,:) = zht_i_ini(:,:) * zat_i_ini(:,:) 141 143 ! 142 ELSE ! ln_iceini_file = F 143 144 !-------------------------------------------------------------------- 145 ! 3) Basal temperature, ice mask 146 !-------------------------------------------------------------------- 147 ! no ice if sst <= t-freez + ttest 144 ! !---------------! 145 ELSE ! Read namelist ! 146 ! !---------------! 147 148 ! no ice if sst <= t-freez + ttest 148 149 WHERE( ( sst_m(:,:) - (t_bo(:,:) - rt0) ) * tmask(:,:,1) >= rn_thres_sst ) ; zswitch(:,:) = 0._wp 149 150 ELSEWHERE ; zswitch(:,:) = tmask(:,:,1) 150 151 END WHERE 151 152 152 !-----------------------------153 ! 3.1) Hemisphere-dependent arrays154 !-----------------------------155 153 ! assign initial thickness, concentration, snow depth and salinity to an hemisphere-dependent array 156 154 WHERE( ff_t(:,:) >= 0._wp ) … … 169 167 ztm_i_ini(:,:) = rn_tmi_ini_s * zswitch(:,:) 170 168 END WHERE 169 zvt_i_ini(:,:) = zht_i_ini(:,:) * zat_i_ini(:,:) 171 170 ! 172 ENDIF ! ln_iceini_file171 ENDIF 173 172 174 zvt_i_ini(:,:) = zht_i_ini(:,:) * zat_i_ini(:,:) ! ice volume 175 !--------------------------------------------------------------------- 176 ! 3.2) Distribute ice concentration and thickness into the categories 177 !--------------------------------------------------------------------- 173 !------------------------------------------------------------------ 174 ! 3) Distribute ice concentration and thickness into the categories 175 !------------------------------------------------------------------ 178 176 ! a gaussian distribution for ice concentration is used 179 177 ! then we check whether the distribution fullfills … … 187 185 IF( zat_i_ini(ji,jj) > 0._wp .AND. zht_i_ini(ji,jj) > 0._wp )THEN 188 186 189 ! --- jl0: most likely index where cc will be maximum187 ! find which category (jl0) the input ice thickness falls into 190 188 jl0 = jpl 191 189 DO jl = 1, jpl … … 196 194 END DO 197 195 ! 198 ! initialisation of tests 199 itest(:) = 0 200 201 i_fill = jpl + 1 !==================================== 202 DO WHILE ( ( SUM( itest(:) ) /= 4 ) .AND. ( i_fill >= 2 ) ) ! iterative loop on i_fill categories 203 ! iteration !==================================== 196 itest(:) = 0 197 i_fill = jpl + 1 !------------------------------------ 198 DO WHILE ( ( SUM( itest(:) ) /= 4 ) .AND. ( i_fill >= 2 ) ) ! iterative loop on i_fill categories 199 ! !------------------------------------ 204 200 i_fill = i_fill - 1 205 206 ! initialisation of ice variables for each try 201 ! 207 202 zh_i_ini(ji,jj,:) = 0._wp 208 203 za_i_ini(ji,jj,:) = 0._wp 209 204 itest(:) = 0 210 205 ! 211 ! *** case very thin ice: fill only category 1 212 IF ( i_fill == 1 ) THEN 206 IF ( i_fill == 1 ) THEN !-- case very thin ice: fill only category 1 213 207 zh_i_ini(ji,jj,1) = zht_i_ini(ji,jj) 214 208 za_i_ini(ji,jj,1) = zat_i_ini(ji,jj) 215 216 ! *** case ice is thicker: fill categories >1 217 ELSE 218 219 ! Fill ice thicknesses in the (i_fill-1) cat by hmean 209 ELSE !-- case ice is thicker: fill categories >1 210 ! thickness 220 211 DO jl = 1, i_fill-1 221 212 zh_i_ini(ji,jj,jl) = hi_mean(jl) 222 213 END DO 223 214 ! 224 ! --- Concentrations215 ! concentration 225 216 za_i_ini(ji,jj,jl0) = zat_i_ini(ji,jj) / SQRT(REAL(jpl)) 226 217 DO jl = 1, i_fill - 1 … … 230 221 ENDIF 231 222 END DO 232 ! 233 ! Concentration in the last (i_fill)category223 224 ! last category 234 225 za_i_ini(ji,jj,i_fill) = zat_i_ini(ji,jj) - SUM( za_i_ini(ji,jj,1:i_fill-1) ) 235 236 ! Ice thickness in the last (i_fill) category237 226 zV = SUM( za_i_ini(ji,jj,1:i_fill-1) * zh_i_ini(ji,jj,1:i_fill-1) ) 238 227 zh_i_ini(ji,jj,i_fill) = ( zvt_i_ini(ji,jj) - zV ) / MAX( za_i_ini(ji,jj,i_fill), epsi10 ) … … 252 241 ENDIF 253 242 ! 254 ENDIF ! case ice is thick or thin 255 256 !--------------------- 243 ENDIF 244 257 245 ! Compatibility tests 258 !--------------------- 259 ! Test 1: area conservation 260 zconv = ABS( zat_i_ini(ji,jj) - SUM( za_i_ini(ji,jj,1:jpl) ) ) 246 zconv = ABS( zat_i_ini(ji,jj) - SUM( za_i_ini(ji,jj,1:jpl) ) ) ! Test 1: area conservation 261 247 IF ( zconv < epsi06 ) itest(1) = 1 262 248 263 ! Test 2: volume conservation 264 zconv = ABS( zat_i_ini(ji,jj) * zht_i_ini(ji,jj) & 249 zconv = ABS( zat_i_ini(ji,jj) * zht_i_ini(ji,jj) & ! Test 2: volume conservation 265 250 & - SUM( za_i_ini (ji,jj,1:jpl) * zh_i_ini (ji,jj,1:jpl) ) ) 266 251 IF ( zconv < epsi06 ) itest(2) = 1 267 252 268 ! Test 3: thickness of the last category is in-bounds ? 269 IF ( zh_i_ini(ji,jj,i_fill) >= hi_max(i_fill-1) ) itest(3) = 1 253 IF ( zh_i_ini(ji,jj,i_fill) >= hi_max(i_fill-1) ) itest(3) = 1 ! Test 3: thickness of the last category is in-bounds ? 270 254 271 ! Test 4: positivity of ice concentrations272 255 itest(4) = 1 273 256 DO jl = 1, i_fill 274 IF ( za_i_ini(ji,jj,jl) < 0._wp ) itest(4) = 0 257 IF ( za_i_ini(ji,jj,jl) < 0._wp ) itest(4) = 0 ! Test 4: positivity of ice concentrations 275 258 END DO 276 ! !============================277 END DO ! end iteration on categories278 ! !============================259 ! !---------------------------- 260 END DO ! end iteration on categories 261 ! !---------------------------- 279 262 ! 280 263 IF( lwp .AND. SUM(itest) /= 4 ) THEN … … 288 271 ENDIF 289 272 290 ENDIF ! zat_i_ini(ji,jj) > 0._wp .AND. zht_i_ini(ji,jj) > 0._wp273 ENDIF 291 274 ! 292 275 END DO … … 294 277 295 278 !--------------------------------------------------------------------- 296 ! 3.3) Space-dependent arrays for ice state variables279 ! 4) Fill in sea ice arrays 297 280 !--------------------------------------------------------------------- 298 281 … … 426 409 at_i (:,:) = at_i (:,:) + a_i (:,:,jl) 427 410 END DO 428 429 !-------------------------------------------------------------------- 430 ! 4) Global ice variables for output diagnostics | 431 !-------------------------------------------------------------------- 411 ! 412 ! --- set ice velocities --- ! 432 413 u_ice (:,:) = 0._wp 433 414 v_ice (:,:) = 0._wp 434 415 ! 435 !---------------------------------------------- ----------------------436 ! Snow-ice mass (case ice is fully embedded) |437 !---------------------------------------------- ----------------------416 !---------------------------------------------- 417 ! 5) Snow-ice mass (case ice is fully embedded) 418 !---------------------------------------------- 438 419 snwice_mass (:,:) = tmask(:,:,1) * ( rhosn * vt_s(:,:) + rhoic * vt_i(:,:) ) ! snow+ice mass 439 420 snwice_mass_b(:,:) = snwice_mass(:,:) … … 556 537 WRITE(numout,*) '~~~~~~~~~~~~~~~' 557 538 WRITE(numout,*) ' Namelist namini:' 558 WRITE(numout,*) ' initialization with ice (T) or not (F) ln_iceini = ', ln_iceini559 WRITE(numout,*) ' ice initialization from a netcdf file ln_iceini_file = ', ln_iceini_file560 WRITE(numout,*) ' max delta ocean temp. above Tfreeze with initial ice rn_thres_sst = ', rn_thres_sst561 WRITE(numout,*) ' initial snow thickness in the north rn_hts_ini_n = ', rn_hts_ini_n562 WRITE(numout,*) ' initial snow thickness in the south rn_hts_ini_s = ', rn_hts_ini_s563 WRITE(numout,*) ' initial ice thickness in the north rn_hti_ini_n = ', rn_hti_ini_n564 WRITE(numout,*) ' initial ice thickness in the south rn_hti_ini_s = ', rn_hti_ini_s565 WRITE(numout,*) ' initial ice concentr. in the north rn_ati_ini_n = ', rn_ati_ini_n566 WRITE(numout,*) ' initial ice concentr. in the north rn_ati_ini_s = ', rn_ati_ini_s567 WRITE(numout,*) ' initial ice salinity in the north rn_smi_ini_n = ', rn_smi_ini_n568 WRITE(numout,*) ' initial ice salinity in the south rn_smi_ini_s = ', rn_smi_ini_s569 WRITE(numout,*) ' initial ice/snw temp in the north rn_tmi_ini_n = ', rn_tmi_ini_n570 WRITE(numout,*) ' initial ice/snw temp in the south rn_tmi_ini_s = ', rn_tmi_ini_s539 WRITE(numout,*) ' initialization with ice (T) or not (F) ln_iceini = ', ln_iceini 540 WRITE(numout,*) ' ice initialization from a netcdf file ln_iceini_file = ', ln_iceini_file 541 WRITE(numout,*) ' max delta ocean temp. above Tfreeze with initial ice rn_thres_sst = ', rn_thres_sst 542 WRITE(numout,*) ' initial snow thickness in the north rn_hts_ini_n = ', rn_hts_ini_n 543 WRITE(numout,*) ' initial snow thickness in the south rn_hts_ini_s = ', rn_hts_ini_s 544 WRITE(numout,*) ' initial ice thickness in the north rn_hti_ini_n = ', rn_hti_ini_n 545 WRITE(numout,*) ' initial ice thickness in the south rn_hti_ini_s = ', rn_hti_ini_s 546 WRITE(numout,*) ' initial ice concentr. in the north rn_ati_ini_n = ', rn_ati_ini_n 547 WRITE(numout,*) ' initial ice concentr. in the north rn_ati_ini_s = ', rn_ati_ini_s 548 WRITE(numout,*) ' initial ice salinity in the north rn_smi_ini_n = ', rn_smi_ini_n 549 WRITE(numout,*) ' initial ice salinity in the south rn_smi_ini_s = ', rn_smi_ini_s 550 WRITE(numout,*) ' initial ice/snw temp in the north rn_tmi_ini_n = ', rn_tmi_ini_n 551 WRITE(numout,*) ' initial ice/snw temp in the south rn_tmi_ini_s = ', rn_tmi_ini_s 571 552 ENDIF 572 553 … … 595 576 #else 596 577 !!---------------------------------------------------------------------- 597 !! Default option : Empty module NO LIM sea-ice model578 !! Default option : Empty module NO ESIM sea-ice model 598 579 !!---------------------------------------------------------------------- 599 580 #endif
Note: See TracChangeset
for help on using the changeset viewer.