New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
icesbc.F90 in NEMO/branches/2019/dev_r12072_MERGE_OPTION2_2019/src/ICE – NEMO

source: NEMO/branches/2019/dev_r12072_MERGE_OPTION2_2019/src/ICE/icesbc.F90 @ 12154

Last change on this file since 12154 was 12154, checked in by cetlod, 4 years ago

commit

  • Property svn:keywords set to Id
File size: 18.0 KB
RevLine 
[10535]1MODULE icesbc
[8586]2   !!======================================================================
[10535]3   !!                       ***  MODULE  icesbc  ***
4   !! Sea-Ice :   air-ice sbc fields
[8586]5   !!=====================================================================
[9604]6   !! History :  4.0  !  2017-08  (C. Rousset)       Original code
7   !!            4.0  !  2018     (many people)      SI3 [aka Sea Ice cube]
[8586]8   !!----------------------------------------------------------------------
[9570]9#if defined key_si3
[8586]10   !!----------------------------------------------------------------------
[9570]11   !!   'key_si3' :                                     SI3 sea-ice model
[8586]12   !!----------------------------------------------------------------------
13   USE oce            ! ocean dynamics and tracers
14   USE dom_oce        ! ocean space and time domain
15   USE ice            ! sea-ice: variables
16   USE sbc_oce        ! Surface boundary condition: ocean fields
17   USE sbc_ice        ! Surface boundary condition: ice   fields
18   USE usrdef_sbc     ! Surface boundary condition: user defined
19   USE sbcblk         ! Surface boundary condition: bulk
20   USE sbccpl         ! Surface boundary condition: coupled interface
[8884]21   USE icealb         ! sea-ice: albedo
[8586]22   !
23   USE in_out_manager ! I/O manager
24   USE iom            ! I/O manager library
25   USE lib_mpp        ! MPP library
26   USE lib_fortran    ! fortran utilities (glob_sum + no signed zero)
27   USE lbclnk         ! lateral boundary conditions (or mpp links)
28   USE timing         ! Timing
[12154]29   USE fldread        !!GS: needed by agrif
[8586]30
31   IMPLICIT NONE
32   PRIVATE
33
[10535]34   PUBLIC ice_sbc_tau   ! called by icestp.F90
35   PUBLIC ice_sbc_flx   ! called by icestp.F90
36   PUBLIC ice_sbc_init  ! called by icestp.F90
[8586]37
38   !! * Substitutions
39#  include "vectopt_loop_substitute.h90"
40   !!----------------------------------------------------------------------
[10068]41   !! NEMO/ICE 4.0 , NEMO Consortium (2018)
[10069]42   !! $Id$
[10068]43   !! Software governed by the CeCILL license (see ./LICENSE)
[8586]44   !!----------------------------------------------------------------------
45CONTAINS
46
[10535]47   SUBROUTINE ice_sbc_tau( kt, ksbc, utau_ice, vtau_ice )
[8586]48      !!-------------------------------------------------------------------
[10535]49      !!                  ***  ROUTINE ice_sbc_tau  ***
[8586]50      !!
51      !! ** Purpose : provide surface boundary condition for sea ice (momentum)
52      !!
53      !! ** Action  : It provides the following fields:
54      !!              utau_ice, vtau_ice : surface ice stress (U- & V-points) [N/m2]
55      !!-------------------------------------------------------------------
[9169]56      INTEGER                     , INTENT(in   ) ::   kt                   ! ocean time step
57      INTEGER                     , INTENT(in   ) ::   ksbc                 ! type of sbc flux
58      REAL(wp), DIMENSION(jpi,jpj), INTENT(  out) ::   utau_ice, vtau_ice   ! air-ice stress   [N/m2]
[8586]59      !!
60      INTEGER  ::   ji, jj                 ! dummy loop index
61      REAL(wp), DIMENSION(jpi,jpj) ::   zutau_ice, zvtau_ice 
62      !!-------------------------------------------------------------------
[9169]63      !
[10535]64      IF( ln_timing )   CALL timing_start('ice_sbc')
[9169]65      !
[8586]66      IF( kt == nit000 .AND. lwp ) THEN
67         WRITE(numout,*)
[10535]68         WRITE(numout,*)'ice_sbc_tau: Surface boundary condition for sea ice (momentum)'
[8586]69         WRITE(numout,*)'~~~~~~~~~~~~~~~'
70      ENDIF
[9169]71      !
[8586]72      SELECT CASE( ksbc )
73         CASE( jp_usr     )   ;    CALL usrdef_sbc_ice_tau( kt )                 ! user defined formulation
[12154]74         CASE( jp_blk     )   ;    CALL blk_ice_1( sf(jp_wndi)%fnow(:,:,1), sf(jp_wndj)%fnow(:,:,1),   &
75            &                                      sf(jp_tair)%fnow(:,:,1), sf(jp_humi)%fnow(:,:,1),   &
76            &                                      sf(jp_slp )%fnow(:,:,1), u_ice, v_ice, tm_su    ,   &   ! inputs
77            &                                      putaui = utau_ice, pvtaui = vtau_ice            )       ! outputs                             
78 !        CASE( jp_abl     )    utau_ice & vtau_ice are computed in ablmod
[8920]79         CASE( jp_purecpl )   ;    CALL sbc_cpl_ice_tau( utau_ice , vtau_ice )   ! Coupled      formulation
[8586]80      END SELECT
[9169]81      !
[8586]82      IF( ln_mixcpl) THEN                                                        ! Case of a mixed Bulk/Coupled formulation
83                                   CALL sbc_cpl_ice_tau( zutau_ice , zvtau_ice )
84         DO jj = 2, jpjm1
85            DO ji = 2, jpim1
86               utau_ice(ji,jj) = utau_ice(ji,jj) * xcplmask(ji,jj,0) + zutau_ice(ji,jj) * ( 1. - xcplmask(ji,jj,0) )
87               vtau_ice(ji,jj) = vtau_ice(ji,jj) * xcplmask(ji,jj,0) + zvtau_ice(ji,jj) * ( 1. - xcplmask(ji,jj,0) )
88            END DO
89         END DO
[10535]90         CALL lbc_lnk_multi( 'icesbc', utau_ice, 'U', -1., vtau_ice, 'V', -1. )
[8586]91      ENDIF
[9169]92      !
[10535]93      IF( ln_timing )   CALL timing_stop('ice_sbc')
[8586]94      !
[10535]95   END SUBROUTINE ice_sbc_tau
[8586]96
97   
[10535]98   SUBROUTINE ice_sbc_flx( kt, ksbc )
[8586]99      !!-------------------------------------------------------------------
[10535]100      !!                  ***  ROUTINE ice_sbc_flx  ***
[8586]101      !!
102      !! ** Purpose : provide surface boundary condition for sea ice (flux)
103      !!
104      !! ** Action  : It provides the following fields used in sea ice model:
105      !!                emp_oce , emp_ice                        = E-P over ocean and sea ice                    [Kg/m2/s]
106      !!                sprecip                                  = solid precipitation                           [Kg/m2/s]
107      !!                evap_ice                                 = sublimation                                   [Kg/m2/s]
108      !!                qsr_tot , qns_tot                        = solar & non solar heat flux (total)           [W/m2]
109      !!                qsr_ice , qns_ice                        = solar & non solar heat flux over ice          [W/m2]
110      !!                dqns_ice                                 = non solar  heat sensistivity                  [W/m2]
111      !!                qemp_oce, qemp_ice, qprec_ice, qevap_ice = sensible heat (associated with evap & precip) [W/m2]
112      !!            + some fields that are not used outside this module:
113      !!                qla_ice                                  = latent heat flux over ice                     [W/m2]
114      !!                dqla_ice                                 = latent heat sensistivity                      [W/m2]
115      !!                tprecip                                  = total  precipitation                          [Kg/m2/s]
116      !!                alb_ice                                  = albedo above sea ice
117      !!-------------------------------------------------------------------
118      INTEGER, INTENT(in) ::   kt     ! ocean time step
119      INTEGER, INTENT(in) ::   ksbc   ! flux formulation (user defined, bulk or Pure Coupled)
120      !
[11536]121      INTEGER  ::   ji, jj, jl      ! dummy loop index
122      REAL(wp) ::   zmiss_val       ! missing value retrieved from xios
123      REAL(wp), DIMENSION(jpi,jpj,jpl)              ::   zalb_os, zalb_cs  ! ice albedo under overcast/clear sky
124      REAL(wp), DIMENSION(:,:)        , ALLOCATABLE ::   zalb, zmsk00      ! 2D workspace
[8586]125      !!--------------------------------------------------------------------
126      !
[10535]127      IF( ln_timing )   CALL timing_start('ice_sbc_flx')
[8586]128
129      IF( kt == nit000 .AND. lwp ) THEN
130         WRITE(numout,*)
[10535]131         WRITE(numout,*)'ice_sbc_flx: Surface boundary condition for sea ice (flux)'
[8586]132         WRITE(numout,*)'~~~~~~~~~~~~~~~'
133      ENDIF
134
[11536]135      ! get missing value from xml
136      CALL iom_miss_val( "icetemp", zmiss_val )
137
[8586]138      ! --- cloud-sky and overcast-sky ice albedos --- !
[8637]139      CALL ice_alb( t_su, h_i, h_s, ln_pnd_alb, a_ip_frac, h_ip, zalb_cs, zalb_os )
[8586]140
141      ! albedo depends on cloud fraction because of non-linear spectral effects
142!!gm cldf_ice is a real, DOCTOR naming rule: start with cd means CHARACTER passed in argument !
143      alb_ice(:,:,:) = ( 1. - cldf_ice ) * zalb_cs(:,:,:) + cldf_ice * zalb_os(:,:,:)
144      !
[8920]145      !
146      SELECT CASE( ksbc )   !== fluxes over sea ice ==!
147      !
148      CASE( jp_usr )              !--- user defined formulation
[8962]149                                  CALL usrdef_sbc_ice_flx( kt, h_s, h_i )
[12154]150      CASE( jp_blk, jp_abl )  !--- bulk formulation & ABL formulation
151                                  CALL blk_ice_2    ( t_su, h_s, h_i, alb_ice, sf(jp_tair)%fnow(:,:,1), sf(jp_humi)%fnow(:,:,1),    &
152            &                                           sf(jp_slp)%fnow(:,:,1), sf(jp_qlw)%fnow(:,:,1), sf(jp_prec)%fnow(:,:,1), sf(jp_snow)%fnow(:,:,1) )    !
[8906]153         IF( ln_mixcpl        )   CALL sbc_cpl_ice_flx( picefr=at_i_b, palbi=alb_ice, psst=sst_m, pist=t_su, phs=h_s, phi=h_i )
[8920]154         IF( nn_flxdist /= -1 )   CALL ice_flx_dist   ( t_su, alb_ice, qns_ice, qsr_ice, dqns_ice, evap_ice, devap_ice, nn_flxdist )
[10534]155         !                        !    compute conduction flux and surface temperature (as in Jules surface module)
156         IF( ln_cndflx .AND. .NOT.ln_cndemulate ) &
157            &                     CALL blk_ice_qcn    ( ln_virtual_itd, t_su, t_bo, h_s, h_i )
[8920]158      CASE ( jp_purecpl )         !--- coupled formulation
[8906]159                                  CALL sbc_cpl_ice_flx( picefr=at_i_b, palbi=alb_ice, psst=sst_m, pist=t_su, phs=h_s, phi=h_i )
[8920]160         IF( nn_flxdist /= -1 )   CALL ice_flx_dist   ( t_su, alb_ice, qns_ice, qsr_ice, dqns_ice, evap_ice, devap_ice, nn_flxdist )
[8586]161      END SELECT
162
[8920]163      !--- output ice albedo and surface albedo ---!
[11536]164      IF( iom_use('icealb') .OR. iom_use('albedo') ) THEN
165
166         ALLOCATE( zalb(jpi,jpj), zmsk00(jpi,jpj) )
167
[11575]168         WHERE( at_i_b < 1.e-03 )
[11536]169            zmsk00(:,:) = 0._wp
170            zalb  (:,:) = rn_alb_oce
171         ELSEWHERE
172            zmsk00(:,:) = 1._wp           
173            zalb  (:,:) = SUM( alb_ice * a_i_b, dim=3 ) / at_i_b
[8586]174         END WHERE
[11536]175         ! ice albedo
176         CALL iom_put( 'icealb' , zalb * zmsk00 + zmiss_val * ( 1._wp - zmsk00 ) )
177         ! ice+ocean albedo
[8586]178         zalb(:,:) = SUM( alb_ice * a_i_b, dim=3 ) + rn_alb_oce * ( 1._wp - at_i_b )
[11536]179         CALL iom_put( 'albedo' , zalb )
180
181         DEALLOCATE( zalb, zmsk00 )
182
[8586]183      ENDIF
184      !
[10535]185      IF( ln_timing )   CALL timing_stop('ice_sbc_flx')
[8586]186      !
[10535]187   END SUBROUTINE ice_sbc_flx
[8586]188
189
[10534]190   SUBROUTINE ice_flx_dist( ptn_ice, palb_ice, pqns_ice, pqsr_ice, pdqn_ice, pevap_ice, pdevap_ice, k_flxdist )
[8586]191      !!-------------------------------------------------------------------
192      !!                  ***  ROUTINE ice_flx_dist  ***
193      !!
194      !! ** Purpose :   update the ice surface boundary condition by averaging
195      !!              and/or redistributing fluxes on ice categories
196      !!
197      !! ** Method  :   average then redistribute
198      !!
[10534]199      !! ** Action  :   depends on k_flxdist
[8586]200      !!                = -1  Do nothing (needs N(cat) fluxes)
201      !!                =  0  Average N(cat) fluxes then apply the average over the N(cat) ice
202      !!                =  1  Average N(cat) fluxes then redistribute over the N(cat) ice
203      !!                                                 using T-ice and albedo sensitivity
204      !!                =  2  Redistribute a single flux over categories
205      !!-------------------------------------------------------------------
[10534]206      INTEGER                   , INTENT(in   ) ::   k_flxdist  ! redistributor
[8586]207      REAL(wp), DIMENSION(:,:,:), INTENT(in   ) ::   ptn_ice    ! ice surface temperature
208      REAL(wp), DIMENSION(:,:,:), INTENT(in   ) ::   palb_ice   ! ice albedo
209      REAL(wp), DIMENSION(:,:,:), INTENT(inout) ::   pqns_ice   ! non solar flux
210      REAL(wp), DIMENSION(:,:,:), INTENT(inout) ::   pqsr_ice   ! net solar flux
211      REAL(wp), DIMENSION(:,:,:), INTENT(inout) ::   pdqn_ice   ! non solar flux sensitivity
212      REAL(wp), DIMENSION(:,:,:), INTENT(inout) ::   pevap_ice  ! sublimation
213      REAL(wp), DIMENSION(:,:,:), INTENT(inout) ::   pdevap_ice ! sublimation sensitivity
214      !
215      INTEGER  ::   jl      ! dummy loop index
216      !
217      REAL(wp), DIMENSION(jpi,jpj) ::   z1_at_i   ! inverse of concentration
218      !
219      REAL(wp), ALLOCATABLE, DIMENSION(:,:) ::   z_qsr_m   ! Mean solar heat flux over all categories
220      REAL(wp), ALLOCATABLE, DIMENSION(:,:) ::   z_qns_m   ! Mean non solar heat flux over all categories
221      REAL(wp), ALLOCATABLE, DIMENSION(:,:) ::   z_evap_m  ! Mean sublimation over all categories
222      REAL(wp), ALLOCATABLE, DIMENSION(:,:) ::   z_dqn_m   ! Mean d(qns)/dT over all categories
223      REAL(wp), ALLOCATABLE, DIMENSION(:,:) ::   z_devap_m ! Mean d(evap)/dT over all categories
224      REAL(wp), ALLOCATABLE, DIMENSION(:,:) ::   zalb_m    ! Mean albedo over all categories
225      REAL(wp), ALLOCATABLE, DIMENSION(:,:) ::   ztem_m    ! Mean temperature over all categories
226      !!----------------------------------------------------------------------
227      !
228      WHERE ( at_i (:,:) > 0._wp )   ; z1_at_i(:,:) = 1._wp / at_i (:,:)
229      ELSEWHERE                      ; z1_at_i(:,:) = 0._wp
230      END WHERE
231     
[10534]232      SELECT CASE( k_flxdist )       !==  averaged on all ice categories  ==!
[8586]233      !
234      CASE( 0 , 1 )
235         !
236         ALLOCATE( z_qns_m(jpi,jpj), z_qsr_m(jpi,jpj), z_dqn_m(jpi,jpj), z_evap_m(jpi,jpj), z_devap_m(jpi,jpj) ) 
237         !
238         z_qns_m  (:,:) = SUM( a_i(:,:,:) * pqns_ice  (:,:,:) , dim=3 ) * z1_at_i(:,:)
239         z_qsr_m  (:,:) = SUM( a_i(:,:,:) * pqsr_ice  (:,:,:) , dim=3 ) * z1_at_i(:,:)
240         z_dqn_m  (:,:) = SUM( a_i(:,:,:) * pdqn_ice  (:,:,:) , dim=3 ) * z1_at_i(:,:)
241         z_evap_m (:,:) = SUM( a_i(:,:,:) * pevap_ice (:,:,:) , dim=3 ) * z1_at_i(:,:)
242         z_devap_m(:,:) = SUM( a_i(:,:,:) * pdevap_ice(:,:,:) , dim=3 ) * z1_at_i(:,:)
243         DO jl = 1, jpl
244            pqns_ice  (:,:,jl) = z_qns_m (:,:)
245            pqsr_ice  (:,:,jl) = z_qsr_m (:,:)
246            pdqn_ice  (:,:,jl) = z_dqn_m  (:,:)
247            pevap_ice (:,:,jl) = z_evap_m(:,:)
248            pdevap_ice(:,:,jl) = z_devap_m(:,:)
249         END DO
250         !
251         DEALLOCATE( z_qns_m, z_qsr_m, z_dqn_m, z_evap_m, z_devap_m ) 
252         !
253      END SELECT
254      !
[10534]255      SELECT CASE( k_flxdist )       !==  redistribution on all ice categories  ==!
[8586]256      !
257      CASE( 1 , 2 )
258         !
259         ALLOCATE( zalb_m(jpi,jpj), ztem_m(jpi,jpj) ) 
260         !
261         zalb_m(:,:) = SUM( a_i(:,:,:) * palb_ice(:,:,:) , dim=3 ) * z1_at_i(:,:)
262         ztem_m(:,:) = SUM( a_i(:,:,:) * ptn_ice (:,:,:) , dim=3 ) * z1_at_i(:,:)
263         DO jl = 1, jpl
264            pqns_ice (:,:,jl) = pqns_ice (:,:,jl) + pdqn_ice  (:,:,jl) * ( ptn_ice(:,:,jl) - ztem_m(:,:) )
265            pevap_ice(:,:,jl) = pevap_ice(:,:,jl) + pdevap_ice(:,:,jl) * ( ptn_ice(:,:,jl) - ztem_m(:,:) )
266            pqsr_ice (:,:,jl) = pqsr_ice (:,:,jl) * ( 1._wp - palb_ice(:,:,jl) ) / ( 1._wp - zalb_m(:,:) )
267         END DO
268         !
269         DEALLOCATE( zalb_m, ztem_m ) 
270         !
271      END SELECT
272      !
273   END SUBROUTINE ice_flx_dist
274
[9169]275
[10535]276   SUBROUTINE ice_sbc_init
[8586]277      !!-------------------------------------------------------------------
[10535]278      !!                  ***  ROUTINE ice_sbc_init  ***
[8586]279      !!
[9169]280      !! ** Purpose :   Physical constants and parameters linked to the ice dynamics
281      !!     
[10535]282      !! ** Method  :   Read the namsbc namelist and check the ice-dynamic
[9169]283      !!              parameter values called at the first timestep (nit000)
[8586]284      !!
[10535]285      !! ** input   :   Namelist namsbc
[8586]286      !!-------------------------------------------------------------------
[9169]287      INTEGER ::   ios, ioptio   ! Local integer
[8586]288      !!
[10535]289      NAMELIST/namsbc/ rn_cio, rn_blow_s, nn_flxdist, ln_cndflx, ln_cndemulate
[8586]290      !!-------------------------------------------------------------------
291      !
[10535]292      REWIND( numnam_ice_ref )         ! Namelist namsbc in reference namelist : Ice dynamics
293      READ  ( numnam_ice_ref, namsbc, IOSTAT = ios, ERR = 901)
[11536]294901   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namsbc in reference namelist' )
[10535]295      REWIND( numnam_ice_cfg )         ! Namelist namsbc in configuration namelist : Ice dynamics
296      READ  ( numnam_ice_cfg, namsbc, IOSTAT = ios, ERR = 902 )
[11536]297902   IF( ios >  0 )   CALL ctl_nam ( ios , 'namsbc in configuration namelist' )
[10535]298      IF(lwm) WRITE( numoni, namsbc )
[8586]299      !
300      IF(lwp) THEN                     ! control print
301         WRITE(numout,*)
[10535]302         WRITE(numout,*) 'ice_sbc_init: ice parameters for ice dynamics '
[9169]303         WRITE(numout,*) '~~~~~~~~~~~~~~~~'
[10535]304         WRITE(numout,*) '   Namelist namsbc:'
[10534]305         WRITE(numout,*) '      drag coefficient for oceanic stress              rn_cio        = ', rn_cio
306         WRITE(numout,*) '      coefficient for ice-lead partition of snowfall   rn_blow_s     = ', rn_blow_s
307         WRITE(numout,*) '      Multicategory heat flux formulation              nn_flxdist    = ', nn_flxdist
308         WRITE(numout,*) '      Use conduction flux as surface condition         ln_cndflx     = ', ln_cndflx
309         WRITE(numout,*) '         emulate conduction flux                       ln_cndemulate = ', ln_cndemulate
[8586]310      ENDIF
311      !
312      IF(lwp) WRITE(numout,*)
[9570]313      SELECT CASE( nn_flxdist )         ! SI3 Multi-category heat flux formulation
[8586]314      CASE( -1  )
[9570]315         IF(lwp) WRITE(numout,*) '   SI3: use per-category fluxes (nn_flxdist = -1) '
[8586]316      CASE(  0  )
[9570]317         IF(lwp) WRITE(numout,*) '   SI3: use average per-category fluxes (nn_flxdist = 0) '
[8586]318      CASE(  1  )
[9570]319         IF(lwp) WRITE(numout,*) '   SI3: use average then redistribute per-category fluxes (nn_flxdist = 1) '
320         IF( ln_cpl )         CALL ctl_stop( 'ice_thd_init: the chosen nn_flxdist for SI3 in coupled mode must be /=1' )
[8586]321      CASE(  2  )
[9570]322         IF(lwp) WRITE(numout,*) '   SI3: Redistribute a single flux over categories (nn_flxdist = 2) '
323         IF( .NOT. ln_cpl )   CALL ctl_stop( 'ice_thd_init: the chosen nn_flxdist for SI3 in forced mode must be /=2' )
[8586]324      CASE DEFAULT
[9570]325         CALL ctl_stop( 'ice_thd_init: SI3 option, nn_flxdist, should be between -1 and 2' )
[8586]326      END SELECT
327      !
[10535]328   END SUBROUTINE ice_sbc_init
[8586]329
330#else
331   !!----------------------------------------------------------------------
[9570]332   !!   Default option :         Empty module         NO SI3 sea-ice model
[8586]333   !!----------------------------------------------------------------------
334#endif
335
336   !!======================================================================
[10535]337END MODULE icesbc
Note: See TracBrowser for help on using the repository browser.