[8586] | 1 | MODULE icestp |
---|
| 2 | !!====================================================================== |
---|
| 3 | !! *** MODULE icestp *** |
---|
[9604] | 4 | !! sea ice : Master routine for all the sea ice model |
---|
[8586] | 5 | !!===================================================================== |
---|
[9604] | 6 | !! |
---|
| 7 | !! The sea ice model SI3 (Sea Ice modelling Integrated Initiative), |
---|
| 8 | !! aka Sea Ice cube for its nickname |
---|
| 9 | !! |
---|
[14072] | 10 | !! is originally based on LIM3, developed in Louvain-la-Neuve by: |
---|
[9604] | 11 | !! * Martin Vancoppenolle (UCL-ASTR, Belgium) |
---|
| 12 | !! * Sylvain Bouillon (UCL-ASTR, Belgium) |
---|
| 13 | !! * Miguel Angel Morales Maqueda (NOC-L, UK) |
---|
| 14 | !! thanks to valuable earlier work by |
---|
| 15 | !! * Thierry Fichefet |
---|
| 16 | !! * Hugues Goosse |
---|
| 17 | !! thanks also to the following persons who contributed |
---|
| 18 | !! * Gurvan Madec, Claude Talandier, Christian Ethe (LOCEAN, France) |
---|
| 19 | !! * Xavier Fettweis (UCL-ASTR), Ralph Timmermann (AWI, Germany) |
---|
| 20 | !! * Bill Lipscomb (LANL), Cecilia Bitz (UWa) and Elisabeth Hunke (LANL), USA. |
---|
| 21 | !! |
---|
| 22 | !! SI3 has been made possible by a handful of persons who met as working group |
---|
[9866] | 23 | !! (from France, Belgium, UK and Italy) |
---|
[9653] | 24 | !! * Clement Rousset, Martin Vancoppenolle & Gurvan Madec (LOCEAN, France) |
---|
| 25 | !! * Matthieu Chevalier & David Salas (Meteo France, France) |
---|
| 26 | !! * Gilles Garric (Mercator Ocean, France) |
---|
| 27 | !! * Thierry Fichefet & Francois Massonnet (UCL, Belgium) |
---|
| 28 | !! * Ed Blockley & Jeff Ridley (Met Office, UK) |
---|
| 29 | !! * Danny Feltham & David Schroeder (CPOM, UK) |
---|
| 30 | !! * Yevgeny Aksenov (NOC, UK) |
---|
| 31 | !! * Paul Holland (BAS, UK) |
---|
| 32 | !! * Dorotea Iovino (CMCC, Italy) |
---|
[9604] | 33 | !!====================================================================== |
---|
| 34 | !! History : 4.0 ! 2018 (C. Rousset) Original code SI3 |
---|
[8586] | 35 | !!---------------------------------------------------------------------- |
---|
[9570] | 36 | #if defined key_si3 |
---|
[8586] | 37 | !!---------------------------------------------------------------------- |
---|
[9570] | 38 | !! 'key_si3' SI3 sea-ice model |
---|
[8586] | 39 | !!---------------------------------------------------------------------- |
---|
| 40 | !! ice_stp : sea-ice model time-stepping and update ocean SBC over ice-covered area |
---|
| 41 | !! ice_init : initialize sea-ice |
---|
| 42 | !!---------------------------------------------------------------------- |
---|
| 43 | USE oce ! ocean dynamics and tracers |
---|
| 44 | USE dom_oce ! ocean space and time domain |
---|
| 45 | USE c1d ! 1D vertical configuration |
---|
| 46 | USE ice ! sea-ice: variables |
---|
| 47 | USE ice1D ! sea-ice: thermodynamical 1D variables |
---|
| 48 | ! |
---|
| 49 | USE phycst ! Define parameters for the routines |
---|
| 50 | USE eosbn2 ! equation of state |
---|
| 51 | USE sbc_oce ! Surface boundary condition: ocean fields |
---|
| 52 | USE sbc_ice ! Surface boundary condition: ice fields |
---|
| 53 | ! |
---|
[10535] | 54 | USE icesbc ! sea-ice: Surface boundary conditions |
---|
[8586] | 55 | USE icedyn ! sea-ice: dynamics |
---|
| 56 | USE icethd ! sea-ice: thermodynamics |
---|
| 57 | USE iceupdate ! sea-ice: sea surface boundary condition update |
---|
| 58 | USE icedia ! sea-ice: budget diagnostics |
---|
| 59 | USE icewri ! sea-ice: outputs |
---|
| 60 | USE icerst ! sea-ice: restarts |
---|
| 61 | USE icevar ! sea-ice: operations |
---|
| 62 | USE icectl ! sea-ice: control |
---|
| 63 | USE iceistate ! sea-ice: initial state |
---|
| 64 | USE iceitd ! sea-ice: remapping thickness distribution |
---|
| 65 | USE icealb ! sea-ice: albedo |
---|
| 66 | ! |
---|
| 67 | USE bdy_oce , ONLY : ln_bdy ! flag for bdy |
---|
| 68 | USE bdyice ! unstructured open boundary data for sea-ice |
---|
| 69 | # if defined key_agrif |
---|
| 70 | USE agrif_ice |
---|
[9596] | 71 | USE agrif_ice_interp |
---|
[8586] | 72 | # endif |
---|
| 73 | ! |
---|
| 74 | USE in_out_manager ! I/O manager |
---|
| 75 | USE iom ! I/O manager library |
---|
| 76 | USE lib_mpp ! MPP library |
---|
| 77 | USE lib_fortran ! fortran utilities (glob_sum + no signed zero) |
---|
| 78 | USE timing ! Timing |
---|
| 79 | USE prtctl ! Print control |
---|
| 80 | |
---|
| 81 | IMPLICIT NONE |
---|
| 82 | PRIVATE |
---|
| 83 | |
---|
| 84 | PUBLIC ice_stp ! called by sbcmod.F90 |
---|
| 85 | PUBLIC ice_init ! called by sbcmod.F90 |
---|
| 86 | |
---|
[13641] | 87 | !! * Substitutions |
---|
| 88 | # include "do_loop_substitute.h90" |
---|
[8586] | 89 | !!---------------------------------------------------------------------- |
---|
[9598] | 90 | !! NEMO/ICE 4.0 , NEMO Consortium (2018) |
---|
[10069] | 91 | !! $Id$ |
---|
[10068] | 92 | !! Software governed by the CeCILL license (see ./LICENSE) |
---|
[8586] | 93 | !!---------------------------------------------------------------------- |
---|
| 94 | CONTAINS |
---|
| 95 | |
---|
[12377] | 96 | SUBROUTINE ice_stp( kt, Kbb, Kmm, ksbc ) |
---|
[8586] | 97 | !!--------------------------------------------------------------------- |
---|
| 98 | !! *** ROUTINE ice_stp *** |
---|
| 99 | !! |
---|
| 100 | !! ** Purpose : sea-ice model time-stepping and update ocean surface |
---|
| 101 | !! boundary condition over ice-covered area |
---|
| 102 | !! |
---|
| 103 | !! ** Method : ice model time stepping |
---|
| 104 | !! - call the ice dynamics routine |
---|
| 105 | !! - call the ice advection/diffusion routine |
---|
| 106 | !! - call the ice thermodynamics routine |
---|
| 107 | !! - call the routine that computes mass and |
---|
| 108 | !! heat fluxes at the ice/ocean interface |
---|
| 109 | !! - save the outputs |
---|
| 110 | !! - save the outputs for restart when necessary |
---|
| 111 | !! |
---|
| 112 | !! ** Action : - time evolution of the LIM sea-ice model |
---|
| 113 | !! - update all sbc variables below sea-ice: |
---|
| 114 | !! utau, vtau, taum, wndm, qns , qsr, emp , sfx |
---|
| 115 | !!--------------------------------------------------------------------- |
---|
[12377] | 116 | INTEGER, INTENT(in) :: kt ! ocean time step |
---|
| 117 | INTEGER, INTENT(in) :: Kbb, Kmm ! ocean time level indices |
---|
| 118 | INTEGER, INTENT(in) :: ksbc ! flux formulation (user defined, bulk, or Pure Coupled) |
---|
[8586] | 119 | ! |
---|
| 120 | INTEGER :: jl ! dummy loop index |
---|
| 121 | !!---------------------------------------------------------------------- |
---|
| 122 | ! |
---|
[14005] | 123 | IF( ln_timing ) CALL timing_start('icestp') |
---|
[8586] | 124 | ! |
---|
| 125 | ! !-----------------------! |
---|
| 126 | IF( MOD( kt-1, nn_fsbc ) == 0 ) THEN ! --- Ice time step --- ! |
---|
| 127 | ! !-----------------------! |
---|
| 128 | ! |
---|
| 129 | kt_ice = kt ! -- Ice model time step |
---|
| 130 | ! |
---|
| 131 | u_oce(:,:) = ssu_m(:,:) ! -- mean surface ocean current |
---|
| 132 | v_oce(:,:) = ssv_m(:,:) |
---|
| 133 | ! |
---|
| 134 | CALL eos_fzp( sss_m(:,:) , t_bo(:,:) ) ! -- freezing temperature [Kelvin] (set to rt0 over land) |
---|
| 135 | t_bo(:,:) = ( t_bo(:,:) + rt0 ) * tmask(:,:,1) + rt0 * ( 1._wp - tmask(:,:,1) ) |
---|
| 136 | ! |
---|
[9482] | 137 | ! !== AGRIF Parent to Child ==! |
---|
| 138 | #if defined key_agrif |
---|
[9872] | 139 | ! ! nbstep_ice ranges from 1 to the nb of child ocean steps inside one parent ice step |
---|
| 140 | IF( .NOT. Agrif_Root() ) nbstep_ice = MOD( nbstep_ice, Agrif_irhot() * Agrif_Parent(nn_fsbc) / nn_fsbc ) + 1 |
---|
[9482] | 141 | ! ! these calls must remain here for restartability purposes |
---|
[14072] | 142 | CALL agrif_interp_ice( 'T' ) |
---|
[9610] | 143 | CALL agrif_interp_ice( 'U' ) |
---|
| 144 | CALL agrif_interp_ice( 'V' ) |
---|
[9482] | 145 | #endif |
---|
| 146 | CALL store_fields ! Store now ice values |
---|
[8586] | 147 | ! |
---|
| 148 | !------------------------------------------------! |
---|
| 149 | ! --- Dynamical coupling with the atmosphere --- ! |
---|
| 150 | !------------------------------------------------! |
---|
| 151 | ! It provides the following fields used in sea ice model: |
---|
| 152 | ! utau_ice, vtau_ice = surface ice stress [N/m2] |
---|
| 153 | !------------------------------------------------! |
---|
[14072] | 154 | CALL ice_sbc_tau( kt, ksbc, utau_ice, vtau_ice ) |
---|
[8586] | 155 | !-------------------------------------! |
---|
| 156 | ! --- ice dynamics and advection --- ! |
---|
| 157 | !-------------------------------------! |
---|
[9482] | 158 | CALL diag_set0 ! set diag of mass, heat and salt fluxes to 0 |
---|
[14072] | 159 | CALL ice_rst_opn( kt ) ! Open Ice restart file (if necessary) |
---|
[8586] | 160 | ! |
---|
| 161 | IF( ln_icedyn .AND. .NOT.lk_c1d ) & |
---|
[12377] | 162 | & CALL ice_dyn( kt, Kmm ) ! -- Ice dynamics |
---|
[8586] | 163 | ! |
---|
[13641] | 164 | CALL diag_trends( 1 ) ! record dyn trends |
---|
| 165 | ! |
---|
[8586] | 166 | ! !== lateral boundary conditions ==! |
---|
| 167 | IF( ln_icethd .AND. ln_bdy ) CALL bdy_ice( kt ) ! -- bdy ice thermo |
---|
| 168 | ! |
---|
[9482] | 169 | ! !== previous lead fraction and ice volume for flux calculations |
---|
| 170 | CALL ice_var_glo2eqv ! h_i and h_s for ice albedo calculation |
---|
[14072] | 171 | CALL ice_var_agg(1) ! at_i for coupling |
---|
[9482] | 172 | CALL store_fields ! Store now ice values |
---|
[8586] | 173 | ! |
---|
| 174 | !------------------------------------------------------! |
---|
| 175 | ! --- Thermodynamical coupling with the atmosphere --- ! |
---|
| 176 | !------------------------------------------------------! |
---|
| 177 | ! It provides the following fields used in sea ice model: |
---|
| 178 | ! emp_oce , emp_ice = E-P over ocean and sea ice [Kg/m2/s] |
---|
| 179 | ! sprecip = solid precipitation [Kg/m2/s] |
---|
| 180 | ! evap_ice = sublimation [Kg/m2/s] |
---|
| 181 | ! qsr_tot , qns_tot = solar & non solar heat flux (total) [W/m2] |
---|
| 182 | ! qsr_ice , qns_ice = solar & non solar heat flux over ice [W/m2] |
---|
| 183 | ! dqns_ice = non solar heat sensistivity [W/m2] |
---|
| 184 | ! qemp_oce, qemp_ice, = sensible heat (associated with evap & precip) [W/m2] |
---|
| 185 | ! qprec_ice, qevap_ice |
---|
| 186 | !------------------------------------------------------! |
---|
[10535] | 187 | CALL ice_sbc_flx( kt, ksbc ) |
---|
[8586] | 188 | !----------------------------! |
---|
| 189 | ! --- ice thermodynamics --- ! |
---|
| 190 | !----------------------------! |
---|
[14072] | 191 | IF( ln_icethd ) CALL ice_thd( kt ) ! -- Ice thermodynamics |
---|
[8586] | 192 | ! |
---|
[13641] | 193 | CALL diag_trends( 2 ) ! record thermo trends |
---|
[9482] | 194 | CALL ice_var_glo2eqv ! necessary calls (at least for coupling) |
---|
| 195 | CALL ice_var_agg( 2 ) ! necessary calls (at least for coupling) |
---|
| 196 | ! |
---|
[8586] | 197 | CALL ice_update_flx( kt ) ! -- Update ocean surface mass, heat and salt fluxes |
---|
[10415] | 198 | ! |
---|
[14072] | 199 | IF( ln_icediahsb ) CALL ice_dia( kt ) ! -- Diagnostics outputs |
---|
[8586] | 200 | ! |
---|
[14072] | 201 | IF( ln_icediachk ) CALL ice_drift_wri( kt ) ! -- Diagnostics outputs for conservation |
---|
[13601] | 202 | ! |
---|
[14072] | 203 | CALL ice_wri( kt ) ! -- Ice outputs |
---|
[8586] | 204 | ! |
---|
[14072] | 205 | IF( lrst_ice ) CALL ice_rst_write( kt ) ! -- Ice restart file |
---|
[8586] | 206 | ! |
---|
[13472] | 207 | IF( ln_icectl ) CALL ice_ctl( kt ) ! -- Control checks |
---|
[8586] | 208 | ! |
---|
| 209 | ENDIF ! End sea-ice time step only |
---|
| 210 | |
---|
| 211 | !-------------------------! |
---|
| 212 | ! --- Ocean time step --- ! |
---|
| 213 | !-------------------------! |
---|
[13721] | 214 | CALL ice_update_tau( kt, uu(:,:,1,Kbb), vv(:,:,1,Kbb) ) ! -- update surface ocean stresses |
---|
[8586] | 215 | !!gm remark, the ocean-ice stress is not saved in ice diag call above ..... find a solution!!! |
---|
| 216 | ! |
---|
[14005] | 217 | IF( ln_timing ) CALL timing_stop('icestp') |
---|
[8586] | 218 | ! |
---|
| 219 | END SUBROUTINE ice_stp |
---|
| 220 | |
---|
| 221 | |
---|
[12377] | 222 | SUBROUTINE ice_init( Kbb, Kmm, Kaa ) |
---|
[8586] | 223 | !!---------------------------------------------------------------------- |
---|
| 224 | !! *** ROUTINE ice_init *** |
---|
| 225 | !! |
---|
| 226 | !! ** purpose : Initialize sea-ice parameters |
---|
| 227 | !!---------------------------------------------------------------------- |
---|
[12377] | 228 | INTEGER, INTENT(in) :: Kbb, Kmm, Kaa |
---|
| 229 | ! |
---|
[13472] | 230 | INTEGER :: ierr |
---|
[8586] | 231 | !!---------------------------------------------------------------------- |
---|
| 232 | IF(lwp) WRITE(numout,*) |
---|
[14072] | 233 | IF(lwp) WRITE(numout,*) 'Sea Ice Model: SI3 (Sea Ice modelling Integrated Initiative)' |
---|
[10519] | 234 | IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~~' |
---|
| 235 | IF(lwp) WRITE(numout,*) |
---|
[14072] | 236 | IF(lwp) WRITE(numout,*) 'ice_init: Arrays allocation & Initialization of all routines & init state' |
---|
[8586] | 237 | IF(lwp) WRITE(numout,*) '~~~~~~~~' |
---|
| 238 | ! |
---|
[12377] | 239 | ! ! Load the reference and configuration namelist files and open namelist output file |
---|
| 240 | CALL load_nml( numnam_ice_ref, 'namelist_ice_ref', numout, lwm ) |
---|
| 241 | CALL load_nml( numnam_ice_cfg, 'namelist_ice_cfg', numout, lwm ) |
---|
| 242 | IF(lwm) CALL ctl_opn( numoni , 'output.namelist.ice', 'UNKNOWN', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp, 1 ) |
---|
[8586] | 243 | ! |
---|
| 244 | CALL par_init ! set some ice run parameters |
---|
| 245 | ! |
---|
[13216] | 246 | #if defined key_agrif |
---|
| 247 | CALL Agrif_Declare_Var_ice ! " " " " " Sea ice |
---|
| 248 | #endif |
---|
| 249 | ! |
---|
[8586] | 250 | ! ! Allocate the ice arrays (sbc_ice already allocated in sbc_init) |
---|
| 251 | ierr = ice_alloc () ! ice variables |
---|
[14072] | 252 | ierr = ierr + sbc_ice_alloc () ! surface boundary conditions |
---|
[8586] | 253 | ierr = ierr + ice1D_alloc () ! thermodynamics |
---|
| 254 | ! |
---|
[10425] | 255 | CALL mpp_sum( 'icestp', ierr ) |
---|
[8586] | 256 | IF( ierr /= 0 ) CALL ctl_stop('STOP', 'ice_init : unable to allocate ice arrays') |
---|
| 257 | ! |
---|
[13472] | 258 | ! ! set max concentration in both hemispheres |
---|
| 259 | WHERE( gphit(:,:) > 0._wp ) ; rn_amax_2d(:,:) = rn_amax_n ! NH |
---|
| 260 | ELSEWHERE ; rn_amax_2d(:,:) = rn_amax_s ! SH |
---|
| 261 | END WHERE |
---|
| 262 | ! |
---|
[13546] | 263 | CALL diag_set0 ! set diag of mass, heat and salt fluxes to 0: needed for Agrif child grids |
---|
| 264 | ! |
---|
[8586] | 265 | CALL ice_itd_init ! ice thickness distribution initialization |
---|
| 266 | ! |
---|
[9118] | 267 | CALL ice_thd_init ! set ice thermodynics parameters (clem: important to call it first for melt ponds) |
---|
| 268 | ! |
---|
[13558] | 269 | CALL ice_sbc_init ! set ice-ocean and ice-atm. coupling parameters |
---|
| 270 | ! |
---|
| 271 | CALL ice_istate_init ! Initial sea-ice state |
---|
[13472] | 272 | IF ( ln_rstart .OR. nn_iceini_file == 2 ) THEN |
---|
| 273 | CALL ice_rst_read( Kbb, Kmm, Kaa ) ! start from a restart file |
---|
| 274 | ELSE |
---|
| 275 | CALL ice_istate( nit000, Kbb, Kmm, Kaa ) ! start from rest or read a file |
---|
[8586] | 276 | ENDIF |
---|
| 277 | CALL ice_var_glo2eqv |
---|
[9725] | 278 | CALL ice_var_agg(1) |
---|
[8586] | 279 | ! |
---|
[9118] | 280 | CALL ice_dyn_init ! set ice dynamics parameters |
---|
[8586] | 281 | ! |
---|
| 282 | CALL ice_update_init ! ice surface boundary condition |
---|
| 283 | ! |
---|
| 284 | CALL ice_alb_init ! ice surface albedo |
---|
| 285 | ! |
---|
| 286 | CALL ice_dia_init ! initialization for diags |
---|
| 287 | ! |
---|
[13601] | 288 | CALL ice_drift_init ! initialization for diags of conservation |
---|
| 289 | ! |
---|
[8586] | 290 | fr_i (:,:) = at_i(:,:) ! initialisation of sea-ice fraction |
---|
| 291 | tn_ice(:,:,:) = t_su(:,:,:) ! initialisation of surface temp for coupled simu |
---|
| 292 | ! |
---|
[13970] | 293 | IF( ln_rstart ) THEN |
---|
| 294 | CALL iom_close( numrir ) ! close input ice restart file |
---|
| 295 | IF(lrxios) CALL iom_context_finalize( cr_icerst_cxt ) |
---|
| 296 | ENDIF |
---|
[8586] | 297 | ! |
---|
| 298 | END SUBROUTINE ice_init |
---|
| 299 | |
---|
| 300 | |
---|
| 301 | SUBROUTINE par_init |
---|
| 302 | !!------------------------------------------------------------------- |
---|
| 303 | !! *** ROUTINE par_init *** |
---|
| 304 | !! |
---|
| 305 | !! ** Purpose : Definition generic parameters for ice model |
---|
| 306 | !! |
---|
| 307 | !! ** Method : Read namelist and check the parameter |
---|
| 308 | !! values called at the first timestep (nit000) |
---|
| 309 | !! |
---|
| 310 | !! ** input : Namelist nampar |
---|
| 311 | !!------------------------------------------------------------------- |
---|
[9169] | 312 | INTEGER :: ios ! Local integer |
---|
| 313 | !! |
---|
[10531] | 314 | NAMELIST/nampar/ jpl, nlay_i, nlay_s, ln_virtual_itd, ln_icedyn, ln_icethd, rn_amax_n, rn_amax_s, & |
---|
[8586] | 315 | & cn_icerst_in, cn_icerst_indir, cn_icerst_out, cn_icerst_outdir |
---|
| 316 | !!------------------------------------------------------------------- |
---|
| 317 | ! |
---|
| 318 | READ ( numnam_ice_ref, nampar, IOSTAT = ios, ERR = 901) |
---|
[11536] | 319 | 901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'nampar in reference namelist' ) |
---|
[8586] | 320 | READ ( numnam_ice_cfg, nampar, IOSTAT = ios, ERR = 902 ) |
---|
[11536] | 321 | 902 IF( ios > 0 ) CALL ctl_nam ( ios , 'nampar in configuration namelist' ) |
---|
[9169] | 322 | IF(lwm) WRITE( numoni, nampar ) |
---|
[8586] | 323 | ! |
---|
| 324 | IF(lwp) THEN ! control print |
---|
| 325 | WRITE(numout,*) |
---|
[9169] | 326 | WRITE(numout,*) ' par_init: ice parameters shared among all the routines' |
---|
| 327 | WRITE(numout,*) ' ~~~~~~~~' |
---|
| 328 | WRITE(numout,*) ' Namelist nampar: ' |
---|
| 329 | WRITE(numout,*) ' number of ice categories jpl = ', jpl |
---|
| 330 | WRITE(numout,*) ' number of ice layers nlay_i = ', nlay_i |
---|
| 331 | WRITE(numout,*) ' number of snow layers nlay_s = ', nlay_s |
---|
[10531] | 332 | WRITE(numout,*) ' virtual ITD param for jpl=1 (T) or not (F) ln_virtual_itd = ', ln_virtual_itd |
---|
[9169] | 333 | WRITE(numout,*) ' Ice dynamics (T) or not (F) ln_icedyn = ', ln_icedyn |
---|
| 334 | WRITE(numout,*) ' Ice thermodynamics (T) or not (F) ln_icethd = ', ln_icethd |
---|
[14072] | 335 | WRITE(numout,*) ' maximum ice concentration for NH = ', rn_amax_n |
---|
[9169] | 336 | WRITE(numout,*) ' maximum ice concentration for SH = ', rn_amax_s |
---|
[8586] | 337 | ENDIF |
---|
[10994] | 338 | ! !--- change max ice concentration for roundoff errors |
---|
| 339 | rn_amax_n = MIN( rn_amax_n, 1._wp - epsi10 ) |
---|
| 340 | rn_amax_s = MIN( rn_amax_s, 1._wp - epsi10 ) |
---|
[8586] | 341 | ! !--- check consistency |
---|
[10531] | 342 | IF ( jpl > 1 .AND. ln_virtual_itd ) THEN |
---|
| 343 | ln_virtual_itd = .FALSE. |
---|
[8586] | 344 | IF(lwp) WRITE(numout,*) |
---|
[10531] | 345 | IF(lwp) WRITE(numout,*) ' ln_virtual_itd forced to false as jpl>1, no need with multiple categories to emulate them' |
---|
[8586] | 346 | ENDIF |
---|
[8933] | 347 | ! |
---|
[9604] | 348 | IF( ln_cpl .AND. nn_cats_cpl /= 1 .AND. nn_cats_cpl /= jpl ) THEN |
---|
| 349 | CALL ctl_stop( 'STOP', 'par_init: in coupled mode, nn_cats_cpl should be either 1 or jpl' ) |
---|
| 350 | ENDIF |
---|
[8586] | 351 | ! |
---|
[12489] | 352 | rDt_ice = REAL(nn_fsbc) * rn_Dt !--- sea-ice timestep and its inverse |
---|
| 353 | r1_Dt_ice = 1._wp / rDt_ice |
---|
[9169] | 354 | IF(lwp) WRITE(numout,*) |
---|
[12489] | 355 | IF(lwp) WRITE(numout,*) ' ice timestep rDt_ice = nn_fsbc*rn_Dt = ', rDt_ice |
---|
[8586] | 356 | ! |
---|
| 357 | r1_nlay_i = 1._wp / REAL( nlay_i, wp ) !--- inverse of nlay_i and nlay_s |
---|
| 358 | r1_nlay_s = 1._wp / REAL( nlay_s, wp ) |
---|
| 359 | ! |
---|
| 360 | END SUBROUTINE par_init |
---|
| 361 | |
---|
| 362 | |
---|
| 363 | SUBROUTINE store_fields |
---|
| 364 | !!---------------------------------------------------------------------- |
---|
| 365 | !! *** ROUTINE store_fields *** |
---|
| 366 | !! |
---|
| 367 | !! ** purpose : store ice variables at "before" time step |
---|
| 368 | !!---------------------------------------------------------------------- |
---|
| 369 | INTEGER :: ji, jj, jl ! dummy loop index |
---|
| 370 | !!---------------------------------------------------------------------- |
---|
| 371 | ! |
---|
| 372 | a_i_b (:,:,:) = a_i (:,:,:) ! ice area |
---|
| 373 | v_i_b (:,:,:) = v_i (:,:,:) ! ice volume |
---|
| 374 | v_s_b (:,:,:) = v_s (:,:,:) ! snow volume |
---|
[14005] | 375 | v_ip_b(:,:,:) = v_ip(:,:,:) ! pond volume |
---|
| 376 | v_il_b(:,:,:) = v_il(:,:,:) ! pond lid volume |
---|
[8586] | 377 | sv_i_b(:,:,:) = sv_i(:,:,:) ! salt content |
---|
| 378 | e_s_b (:,:,:,:) = e_s (:,:,:,:) ! snow thermal energy |
---|
| 379 | e_i_b (:,:,:,:) = e_i (:,:,:,:) ! ice thermal energy |
---|
| 380 | WHERE( a_i_b(:,:,:) >= epsi20 ) |
---|
[10415] | 381 | h_i_b(:,:,:) = v_i_b(:,:,:) / a_i_b(:,:,:) ! ice thickness |
---|
| 382 | h_s_b(:,:,:) = v_s_b(:,:,:) / a_i_b(:,:,:) ! snw thickness |
---|
[8586] | 383 | ELSEWHERE |
---|
| 384 | h_i_b(:,:,:) = 0._wp |
---|
| 385 | h_s_b(:,:,:) = 0._wp |
---|
| 386 | END WHERE |
---|
[9169] | 387 | ! |
---|
[8586] | 388 | ! ice velocities & total concentration |
---|
| 389 | at_i_b(:,:) = SUM( a_i_b(:,:,:), dim=3 ) |
---|
| 390 | u_ice_b(:,:) = u_ice(:,:) |
---|
| 391 | v_ice_b(:,:) = v_ice(:,:) |
---|
| 392 | ! |
---|
| 393 | END SUBROUTINE store_fields |
---|
| 394 | |
---|
| 395 | |
---|
| 396 | SUBROUTINE diag_set0 |
---|
| 397 | !!---------------------------------------------------------------------- |
---|
| 398 | !! *** ROUTINE diag_set0 *** |
---|
| 399 | !! |
---|
| 400 | !! ** purpose : set ice-ocean and ice-atm. fluxes to zeros at the beggining |
---|
| 401 | !! of the time step |
---|
| 402 | !!---------------------------------------------------------------------- |
---|
[13641] | 403 | INTEGER :: ji, jj, jl ! dummy loop index |
---|
[8586] | 404 | !!---------------------------------------------------------------------- |
---|
| 405 | |
---|
[13641] | 406 | DO_2D( 1, 1, 1, 1 ) |
---|
| 407 | sfx (ji,jj) = 0._wp ; |
---|
| 408 | sfx_bri(ji,jj) = 0._wp ; sfx_lam(ji,jj) = 0._wp |
---|
| 409 | sfx_sni(ji,jj) = 0._wp ; sfx_opw(ji,jj) = 0._wp |
---|
| 410 | sfx_bog(ji,jj) = 0._wp ; sfx_dyn(ji,jj) = 0._wp |
---|
| 411 | sfx_bom(ji,jj) = 0._wp ; sfx_sum(ji,jj) = 0._wp |
---|
| 412 | sfx_res(ji,jj) = 0._wp ; sfx_sub(ji,jj) = 0._wp |
---|
| 413 | ! |
---|
| 414 | wfx_snw(ji,jj) = 0._wp ; wfx_ice(ji,jj) = 0._wp |
---|
| 415 | wfx_sni(ji,jj) = 0._wp ; wfx_opw(ji,jj) = 0._wp |
---|
| 416 | wfx_bog(ji,jj) = 0._wp ; wfx_dyn(ji,jj) = 0._wp |
---|
| 417 | wfx_bom(ji,jj) = 0._wp ; wfx_sum(ji,jj) = 0._wp |
---|
| 418 | wfx_res(ji,jj) = 0._wp ; wfx_sub(ji,jj) = 0._wp |
---|
[14072] | 419 | wfx_spr(ji,jj) = 0._wp ; wfx_lam(ji,jj) = 0._wp |
---|
[13641] | 420 | wfx_snw_dyn(ji,jj) = 0._wp ; wfx_snw_sum(ji,jj) = 0._wp |
---|
| 421 | wfx_snw_sub(ji,jj) = 0._wp ; wfx_ice_sub(ji,jj) = 0._wp |
---|
[14072] | 422 | wfx_snw_sni(ji,jj) = 0._wp |
---|
[13641] | 423 | wfx_pnd(ji,jj) = 0._wp |
---|
[8586] | 424 | |
---|
[13641] | 425 | hfx_thd(ji,jj) = 0._wp ; |
---|
| 426 | hfx_snw(ji,jj) = 0._wp ; hfx_opw(ji,jj) = 0._wp |
---|
| 427 | hfx_bog(ji,jj) = 0._wp ; hfx_dyn(ji,jj) = 0._wp |
---|
| 428 | hfx_bom(ji,jj) = 0._wp ; hfx_sum(ji,jj) = 0._wp |
---|
| 429 | hfx_res(ji,jj) = 0._wp ; hfx_sub(ji,jj) = 0._wp |
---|
| 430 | hfx_spr(ji,jj) = 0._wp ; hfx_dif(ji,jj) = 0._wp |
---|
| 431 | hfx_err_dif(ji,jj) = 0._wp |
---|
| 432 | wfx_err_sub(ji,jj) = 0._wp |
---|
| 433 | ! |
---|
| 434 | diag_heat(ji,jj) = 0._wp ; diag_sice(ji,jj) = 0._wp |
---|
| 435 | diag_vice(ji,jj) = 0._wp ; diag_vsnw(ji,jj) = 0._wp |
---|
[14005] | 436 | diag_aice(ji,jj) = 0._wp ; diag_vpnd(ji,jj) = 0._wp |
---|
[8586] | 437 | |
---|
[13641] | 438 | tau_icebfr (ji,jj) = 0._wp ! landfast ice param only (clem: important to keep the init here) |
---|
| 439 | qsb_ice_bot(ji,jj) = 0._wp ! (needed if ln_icethd=F) |
---|
| 440 | |
---|
| 441 | fhld(ji,jj) = 0._wp ! needed if ln_icethd=F |
---|
| 442 | |
---|
| 443 | ! for control checks (ln_icediachk) |
---|
| 444 | diag_trp_vi(ji,jj) = 0._wp ; diag_trp_vs(ji,jj) = 0._wp |
---|
| 445 | diag_trp_ei(ji,jj) = 0._wp ; diag_trp_es(ji,jj) = 0._wp |
---|
| 446 | diag_trp_sv(ji,jj) = 0._wp |
---|
| 447 | ! |
---|
| 448 | diag_adv_mass(ji,jj) = 0._wp |
---|
| 449 | diag_adv_salt(ji,jj) = 0._wp |
---|
| 450 | diag_adv_heat(ji,jj) = 0._wp |
---|
| 451 | END_2D |
---|
| 452 | |
---|
| 453 | DO jl = 1, jpl |
---|
| 454 | DO_2D( 1, 1, 1, 1 ) |
---|
| 455 | ! SIMIP diagnostics |
---|
| 456 | t_si (ji,jj,jl) = rt0 ! temp at the ice-snow interface |
---|
| 457 | qcn_ice_bot(ji,jj,jl) = 0._wp |
---|
| 458 | qcn_ice_top(ji,jj,jl) = 0._wp ! conductive fluxes |
---|
| 459 | cnd_ice (ji,jj,jl) = 0._wp ! effective conductivity at the top of ice/snow (ln_cndflx=T) |
---|
| 460 | qcn_ice (ji,jj,jl) = 0._wp ! conductive flux (ln_cndflx=T & ln_cndemule=T) |
---|
| 461 | qtr_ice_bot(ji,jj,jl) = 0._wp ! part of solar radiation transmitted through the ice needed at least for outputs |
---|
[14005] | 462 | ! Melt pond surface melt diagnostics (mv - more efficient: grouped into one water volume flux) |
---|
| 463 | dh_i_sum_2d(ji,jj,jl) = 0._wp |
---|
| 464 | dh_s_mlt_2d(ji,jj,jl) = 0._wp |
---|
[13641] | 465 | END_2D |
---|
| 466 | ENDDO |
---|
| 467 | |
---|
[8586] | 468 | END SUBROUTINE diag_set0 |
---|
| 469 | |
---|
[13641] | 470 | |
---|
| 471 | SUBROUTINE diag_trends( kn ) |
---|
| 472 | !!---------------------------------------------------------------------- |
---|
| 473 | !! *** ROUTINE diag_trends *** |
---|
| 474 | !! |
---|
| 475 | !! ** purpose : diagnostics of the trends. Used for conservation purposes |
---|
| 476 | !! and outputs |
---|
| 477 | !!---------------------------------------------------------------------- |
---|
| 478 | INTEGER, INTENT(in) :: kn ! 1 = after dyn ; 2 = after thermo |
---|
| 479 | !!---------------------------------------------------------------------- |
---|
| 480 | ! |
---|
| 481 | ! --- trends of heat, salt, mass (used for conservation controls) |
---|
| 482 | IF( ln_icediachk .OR. iom_use('hfxdhc') ) THEN |
---|
| 483 | ! |
---|
| 484 | diag_heat(:,:) = diag_heat(:,:) & |
---|
| 485 | & - SUM(SUM( e_i (:,:,1:nlay_i,:) - e_i_b (:,:,1:nlay_i,:), dim=4 ), dim=3 ) * r1_Dt_ice & |
---|
| 486 | & - SUM(SUM( e_s (:,:,1:nlay_s,:) - e_s_b (:,:,1:nlay_s,:), dim=4 ), dim=3 ) * r1_Dt_ice |
---|
| 487 | diag_sice(:,:) = diag_sice(:,:) & |
---|
| 488 | & + SUM( sv_i(:,:,:) - sv_i_b(:,:,:) , dim=3 ) * r1_Dt_ice * rhoi |
---|
| 489 | diag_vice(:,:) = diag_vice(:,:) & |
---|
| 490 | & + SUM( v_i (:,:,:) - v_i_b (:,:,:) , dim=3 ) * r1_Dt_ice * rhoi |
---|
| 491 | diag_vsnw(:,:) = diag_vsnw(:,:) & |
---|
| 492 | & + SUM( v_s (:,:,:) - v_s_b (:,:,:) , dim=3 ) * r1_Dt_ice * rhos |
---|
[14005] | 493 | diag_vpnd(:,:) = diag_vpnd(:,:) & |
---|
| 494 | & + SUM( v_ip + v_il - v_ip_b - v_il_b , dim=3 ) * r1_Dt_ice * rhow |
---|
[13641] | 495 | ! |
---|
| 496 | IF( kn == 2 ) CALL iom_put ( 'hfxdhc' , diag_heat ) ! output of heat trend |
---|
| 497 | ! |
---|
| 498 | ENDIF |
---|
| 499 | ! |
---|
| 500 | ! --- trends of concentration (used for simip outputs) |
---|
| 501 | IF( iom_use('afxdyn') .OR. iom_use('afxthd') .OR. iom_use('afxtot') ) THEN |
---|
| 502 | ! |
---|
| 503 | diag_aice(:,:) = diag_aice(:,:) + SUM( a_i(:,:,:) - a_i_b(:,:,:), dim=3 ) * r1_Dt_ice |
---|
| 504 | ! |
---|
| 505 | IF( kn == 1 ) CALL iom_put( 'afxdyn' , diag_aice ) ! dyn trend |
---|
| 506 | IF( kn == 2 ) CALL iom_put( 'afxthd' , SUM( a_i(:,:,:) - a_i_b(:,:,:), dim=3 ) * r1_Dt_ice ) ! thermo trend |
---|
| 507 | IF( kn == 2 ) CALL iom_put( 'afxtot' , diag_aice ) ! total trend |
---|
| 508 | ! |
---|
| 509 | ENDIF |
---|
| 510 | ! |
---|
| 511 | END SUBROUTINE diag_trends |
---|
| 512 | |
---|
[8586] | 513 | #else |
---|
| 514 | !!---------------------------------------------------------------------- |
---|
[9570] | 515 | !! Default option Dummy module NO SI3 sea-ice model |
---|
[8586] | 516 | !!---------------------------------------------------------------------- |
---|
| 517 | CONTAINS |
---|
| 518 | SUBROUTINE ice_stp ( kt, ksbc ) ! Dummy routine |
---|
| 519 | INTEGER, INTENT(in) :: kt, ksbc |
---|
| 520 | WRITE(*,*) 'ice_stp: You should not have seen this print! error?', kt |
---|
| 521 | END SUBROUTINE ice_stp |
---|
| 522 | SUBROUTINE ice_init ! Dummy routine |
---|
| 523 | END SUBROUTINE ice_init |
---|
| 524 | #endif |
---|
| 525 | |
---|
| 526 | !!====================================================================== |
---|
| 527 | END MODULE icestp |
---|