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.
iceforcing.F90 in NEMO/trunk/src/ICE – NEMO

source: NEMO/trunk/src/ICE/iceforcing.F90 @ 10425

Last change on this file since 10425 was 10425, checked in by smasson, 5 years ago

trunk: merge back dev_r10164_HPC09_ESIWACE_PREP_MERGE@10424 into the trunk

  • Property svn:keywords set to Id
File size: 16.9 KB
RevLine 
[8586]1MODULE iceforcing
2   !!======================================================================
3   !!                       ***  MODULE  iceforcing  ***
4   !! Sea-Ice :   air-ice forcing fields
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
29
30   IMPLICIT NONE
31   PRIVATE
32
33   PUBLIC ice_forcing_tau   ! called by icestp.F90
34   PUBLIC ice_forcing_flx   ! called by icestp.F90
35   PUBLIC ice_forcing_init  ! called by icestp.F90
36
37   !! * Substitutions
38#  include "vectopt_loop_substitute.h90"
39   !!----------------------------------------------------------------------
[10068]40   !! NEMO/ICE 4.0 , NEMO Consortium (2018)
[10069]41   !! $Id$
[10068]42   !! Software governed by the CeCILL license (see ./LICENSE)
[8586]43   !!----------------------------------------------------------------------
44CONTAINS
45
46   SUBROUTINE ice_forcing_tau( kt, ksbc, utau_ice, vtau_ice )
47      !!-------------------------------------------------------------------
48      !!                  ***  ROUTINE ice_forcing_tau  ***
49      !!
50      !! ** Purpose : provide surface boundary condition for sea ice (momentum)
51      !!
52      !! ** Action  : It provides the following fields:
53      !!              utau_ice, vtau_ice : surface ice stress (U- & V-points) [N/m2]
54      !!-------------------------------------------------------------------
[9169]55      INTEGER                     , INTENT(in   ) ::   kt                   ! ocean time step
56      INTEGER                     , INTENT(in   ) ::   ksbc                 ! type of sbc flux
57      REAL(wp), DIMENSION(jpi,jpj), INTENT(  out) ::   utau_ice, vtau_ice   ! air-ice stress   [N/m2]
[8586]58      !!
59      INTEGER  ::   ji, jj                 ! dummy loop index
60      REAL(wp), DIMENSION(jpi,jpj) ::   zutau_ice, zvtau_ice 
61      !!-------------------------------------------------------------------
[9169]62      !
[9124]63      IF( ln_timing )   CALL timing_start('ice_forcing')
[9169]64      !
[8586]65      IF( kt == nit000 .AND. lwp ) THEN
66         WRITE(numout,*)
67         WRITE(numout,*)'ice_forcing_tau: Surface boundary condition for sea ice (momentum)'
68         WRITE(numout,*)'~~~~~~~~~~~~~~~'
69      ENDIF
[9169]70      !
[8586]71      SELECT CASE( ksbc )
72         CASE( jp_usr     )   ;    CALL usrdef_sbc_ice_tau( kt )                 ! user defined formulation
[8920]73         CASE( jp_blk     )   ;    CALL blk_ice_tau                              ! Bulk         formulation
74         CASE( jp_purecpl )   ;    CALL sbc_cpl_ice_tau( utau_ice , vtau_ice )   ! Coupled      formulation
[8586]75      END SELECT
[9169]76      !
[8586]77      IF( ln_mixcpl) THEN                                                        ! Case of a mixed Bulk/Coupled formulation
78                                   CALL sbc_cpl_ice_tau( zutau_ice , zvtau_ice )
79         DO jj = 2, jpjm1
80            DO ji = 2, jpim1
81               utau_ice(ji,jj) = utau_ice(ji,jj) * xcplmask(ji,jj,0) + zutau_ice(ji,jj) * ( 1. - xcplmask(ji,jj,0) )
82               vtau_ice(ji,jj) = vtau_ice(ji,jj) * xcplmask(ji,jj,0) + zvtau_ice(ji,jj) * ( 1. - xcplmask(ji,jj,0) )
83            END DO
84         END DO
[10425]85         CALL lbc_lnk_multi( 'iceforcing', utau_ice, 'U', -1., vtau_ice, 'V', -1. )
[8586]86      ENDIF
[9169]87      !
[9124]88      IF( ln_timing )   CALL timing_stop('ice_forcing')
[8586]89      !
90   END SUBROUTINE ice_forcing_tau
91
92   
93   SUBROUTINE ice_forcing_flx( kt, ksbc )
94      !!-------------------------------------------------------------------
95      !!                  ***  ROUTINE ice_forcing_flx  ***
96      !!
97      !! ** Purpose : provide surface boundary condition for sea ice (flux)
98      !!
99      !! ** Action  : It provides the following fields used in sea ice model:
100      !!                emp_oce , emp_ice                        = E-P over ocean and sea ice                    [Kg/m2/s]
101      !!                sprecip                                  = solid precipitation                           [Kg/m2/s]
102      !!                evap_ice                                 = sublimation                                   [Kg/m2/s]
103      !!                qsr_tot , qns_tot                        = solar & non solar heat flux (total)           [W/m2]
104      !!                qsr_ice , qns_ice                        = solar & non solar heat flux over ice          [W/m2]
105      !!                dqns_ice                                 = non solar  heat sensistivity                  [W/m2]
106      !!                qemp_oce, qemp_ice, qprec_ice, qevap_ice = sensible heat (associated with evap & precip) [W/m2]
107      !!            + some fields that are not used outside this module:
108      !!                qla_ice                                  = latent heat flux over ice                     [W/m2]
109      !!                dqla_ice                                 = latent heat sensistivity                      [W/m2]
110      !!                tprecip                                  = total  precipitation                          [Kg/m2/s]
111      !!                alb_ice                                  = albedo above sea ice
112      !!-------------------------------------------------------------------
113      INTEGER, INTENT(in) ::   kt     ! ocean time step
114      INTEGER, INTENT(in) ::   ksbc   ! flux formulation (user defined, bulk or Pure Coupled)
115      !
116      INTEGER  ::   ji, jj, jl                                ! dummy loop index
117      REAL(wp), DIMENSION(jpi,jpj,jpl) ::   zalb_os, zalb_cs  ! ice albedo under overcast/clear sky
118      REAL(wp), DIMENSION(jpi,jpj)     ::   zalb              ! 2D workspace
119      !!--------------------------------------------------------------------
120      !
[9124]121      IF( ln_timing )   CALL timing_start('ice_forcing_flx')
[8586]122
123      IF( kt == nit000 .AND. lwp ) THEN
124         WRITE(numout,*)
125         WRITE(numout,*)'ice_forcing_flx: Surface boundary condition for sea ice (flux)'
126         WRITE(numout,*)'~~~~~~~~~~~~~~~'
127      ENDIF
128
129      ! --- cloud-sky and overcast-sky ice albedos --- !
[8637]130      CALL ice_alb( t_su, h_i, h_s, ln_pnd_alb, a_ip_frac, h_ip, zalb_cs, zalb_os )
[8586]131
132      ! albedo depends on cloud fraction because of non-linear spectral effects
133!!gm cldf_ice is a real, DOCTOR naming rule: start with cd means CHARACTER passed in argument !
134      alb_ice(:,:,:) = ( 1. - cldf_ice ) * zalb_cs(:,:,:) + cldf_ice * zalb_os(:,:,:)
135      !
[8920]136      !
137      SELECT CASE( ksbc )   !== fluxes over sea ice ==!
138      !
139      CASE( jp_usr )              !--- user defined formulation
[8962]140                                  CALL usrdef_sbc_ice_flx( kt, h_s, h_i )
[8920]141      CASE( jp_blk )              !--- bulk formulation
142                                  CALL blk_ice_flx    ( t_su, h_s, h_i, alb_ice )    !
[8906]143         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]144         IF( nn_flxdist /= -1 )   CALL ice_flx_dist   ( t_su, alb_ice, qns_ice, qsr_ice, dqns_ice, evap_ice, devap_ice, nn_flxdist )
145         SELECT CASE( nice_jules )
146         CASE( np_jules_ACTIVE )  !    compute conduction flux and surface temperature (as in Jules surface module)
[9076]147                                  CALL blk_ice_qcn    ( nn_virtual_itd, t_su, t_bo, h_s, h_i )
[8920]148         END SELECT
149      CASE ( jp_purecpl )         !--- coupled formulation
[8906]150                                  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]151         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]152      END SELECT
153
[8920]154      !--- output ice albedo and surface albedo ---!
155      IF( iom_use('icealb') ) THEN
[8586]156         WHERE( at_i_b <= epsi06 )   ;   zalb(:,:) = rn_alb_oce
157         ELSEWHERE                   ;   zalb(:,:) = SUM( alb_ice * a_i_b, dim=3 ) / at_i_b
158         END WHERE
[8889]159         CALL iom_put( "icealb" , zalb(:,:) )
[8586]160      ENDIF
[8920]161      IF( iom_use('albedo') ) THEN
[8586]162         zalb(:,:) = SUM( alb_ice * a_i_b, dim=3 ) + rn_alb_oce * ( 1._wp - at_i_b )
163         CALL iom_put( "albedo" , zalb(:,:) )
164      ENDIF
165      !
[9124]166      IF( ln_timing )   CALL timing_stop('ice_forcing_flx')
[8586]167      !
168   END SUBROUTINE ice_forcing_flx
169
170
171   SUBROUTINE ice_flx_dist( ptn_ice, palb_ice, pqns_ice, pqsr_ice, pdqn_ice, pevap_ice, pdevap_ice, k_iceflx )
172      !!-------------------------------------------------------------------
173      !!                  ***  ROUTINE ice_flx_dist  ***
174      !!
175      !! ** Purpose :   update the ice surface boundary condition by averaging
176      !!              and/or redistributing fluxes on ice categories
177      !!
178      !! ** Method  :   average then redistribute
179      !!
180      !! ** Action  :   depends on k_iceflx
181      !!                = -1  Do nothing (needs N(cat) fluxes)
182      !!                =  0  Average N(cat) fluxes then apply the average over the N(cat) ice
183      !!                =  1  Average N(cat) fluxes then redistribute over the N(cat) ice
184      !!                                                 using T-ice and albedo sensitivity
185      !!                =  2  Redistribute a single flux over categories
186      !!-------------------------------------------------------------------
187      INTEGER                   , INTENT(in   ) ::   k_iceflx   ! redistributor
188      REAL(wp), DIMENSION(:,:,:), INTENT(in   ) ::   ptn_ice    ! ice surface temperature
189      REAL(wp), DIMENSION(:,:,:), INTENT(in   ) ::   palb_ice   ! ice albedo
190      REAL(wp), DIMENSION(:,:,:), INTENT(inout) ::   pqns_ice   ! non solar flux
191      REAL(wp), DIMENSION(:,:,:), INTENT(inout) ::   pqsr_ice   ! net solar flux
192      REAL(wp), DIMENSION(:,:,:), INTENT(inout) ::   pdqn_ice   ! non solar flux sensitivity
193      REAL(wp), DIMENSION(:,:,:), INTENT(inout) ::   pevap_ice  ! sublimation
194      REAL(wp), DIMENSION(:,:,:), INTENT(inout) ::   pdevap_ice ! sublimation sensitivity
195      !
196      INTEGER  ::   jl      ! dummy loop index
197      !
198      REAL(wp), DIMENSION(jpi,jpj) ::   z1_at_i   ! inverse of concentration
199      !
200      REAL(wp), ALLOCATABLE, DIMENSION(:,:) ::   z_qsr_m   ! Mean solar heat flux over all categories
201      REAL(wp), ALLOCATABLE, DIMENSION(:,:) ::   z_qns_m   ! Mean non solar heat flux over all categories
202      REAL(wp), ALLOCATABLE, DIMENSION(:,:) ::   z_evap_m  ! Mean sublimation over all categories
203      REAL(wp), ALLOCATABLE, DIMENSION(:,:) ::   z_dqn_m   ! Mean d(qns)/dT over all categories
204      REAL(wp), ALLOCATABLE, DIMENSION(:,:) ::   z_devap_m ! Mean d(evap)/dT over all categories
205      REAL(wp), ALLOCATABLE, DIMENSION(:,:) ::   zalb_m    ! Mean albedo over all categories
206      REAL(wp), ALLOCATABLE, DIMENSION(:,:) ::   ztem_m    ! Mean temperature over all categories
207      !!----------------------------------------------------------------------
208      !
209      WHERE ( at_i (:,:) > 0._wp )   ; z1_at_i(:,:) = 1._wp / at_i (:,:)
210      ELSEWHERE                      ; z1_at_i(:,:) = 0._wp
211      END WHERE
212     
213      SELECT CASE( k_iceflx )       !==  averaged on all ice categories  ==!
214      !
215      CASE( 0 , 1 )
216         !
217         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) ) 
218         !
219         z_qns_m  (:,:) = SUM( a_i(:,:,:) * pqns_ice  (:,:,:) , dim=3 ) * z1_at_i(:,:)
220         z_qsr_m  (:,:) = SUM( a_i(:,:,:) * pqsr_ice  (:,:,:) , dim=3 ) * z1_at_i(:,:)
221         z_dqn_m  (:,:) = SUM( a_i(:,:,:) * pdqn_ice  (:,:,:) , dim=3 ) * z1_at_i(:,:)
222         z_evap_m (:,:) = SUM( a_i(:,:,:) * pevap_ice (:,:,:) , dim=3 ) * z1_at_i(:,:)
223         z_devap_m(:,:) = SUM( a_i(:,:,:) * pdevap_ice(:,:,:) , dim=3 ) * z1_at_i(:,:)
224         DO jl = 1, jpl
225            pqns_ice  (:,:,jl) = z_qns_m (:,:)
226            pqsr_ice  (:,:,jl) = z_qsr_m (:,:)
227            pdqn_ice  (:,:,jl) = z_dqn_m  (:,:)
228            pevap_ice (:,:,jl) = z_evap_m(:,:)
229            pdevap_ice(:,:,jl) = z_devap_m(:,:)
230         END DO
231         !
232         DEALLOCATE( z_qns_m, z_qsr_m, z_dqn_m, z_evap_m, z_devap_m ) 
233         !
234      END SELECT
235      !
236      SELECT CASE( k_iceflx )       !==  redistribution on all ice categories  ==!
237      !
238      CASE( 1 , 2 )
239         !
240         ALLOCATE( zalb_m(jpi,jpj), ztem_m(jpi,jpj) ) 
241         !
242         zalb_m(:,:) = SUM( a_i(:,:,:) * palb_ice(:,:,:) , dim=3 ) * z1_at_i(:,:)
243         ztem_m(:,:) = SUM( a_i(:,:,:) * ptn_ice (:,:,:) , dim=3 ) * z1_at_i(:,:)
244         DO jl = 1, jpl
245            pqns_ice (:,:,jl) = pqns_ice (:,:,jl) + pdqn_ice  (:,:,jl) * ( ptn_ice(:,:,jl) - ztem_m(:,:) )
246            pevap_ice(:,:,jl) = pevap_ice(:,:,jl) + pdevap_ice(:,:,jl) * ( ptn_ice(:,:,jl) - ztem_m(:,:) )
247            pqsr_ice (:,:,jl) = pqsr_ice (:,:,jl) * ( 1._wp - palb_ice(:,:,jl) ) / ( 1._wp - zalb_m(:,:) )
248         END DO
249         !
250         DEALLOCATE( zalb_m, ztem_m ) 
251         !
252      END SELECT
253      !
254   END SUBROUTINE ice_flx_dist
255
[9169]256
[8586]257   SUBROUTINE ice_forcing_init
258      !!-------------------------------------------------------------------
259      !!                  ***  ROUTINE ice_forcing_init  ***
260      !!
[9169]261      !! ** Purpose :   Physical constants and parameters linked to the ice dynamics
262      !!     
263      !! ** Method  :   Read the namforcing namelist and check the ice-dynamic
264      !!              parameter values called at the first timestep (nit000)
[8586]265      !!
266      !! ** input   :   Namelist namforcing
267      !!-------------------------------------------------------------------
[9169]268      INTEGER ::   ios, ioptio   ! Local integer
[8586]269      !!
[8889]270      NAMELIST/namforcing/ rn_cio, rn_blow_s, nn_flxdist, nice_jules
[8586]271      !!-------------------------------------------------------------------
272      !
273      REWIND( numnam_ice_ref )         ! Namelist namforcing in reference namelist : Ice dynamics
274      READ  ( numnam_ice_ref, namforcing, IOSTAT = ios, ERR = 901)
[9169]275901   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namforcing in reference namelist', lwp )
[8586]276      REWIND( numnam_ice_cfg )         ! Namelist namforcing in configuration namelist : Ice dynamics
277      READ  ( numnam_ice_cfg, namforcing, IOSTAT = ios, ERR = 902 )
[9169]278902   IF( ios >  0 )   CALL ctl_nam ( ios , 'namforcing in configuration namelist', lwp )
279      IF(lwm) WRITE( numoni, namforcing )
[8586]280      !
281      IF(lwp) THEN                     ! control print
282         WRITE(numout,*)
283         WRITE(numout,*) 'ice_forcing_init: ice parameters for ice dynamics '
[9169]284         WRITE(numout,*) '~~~~~~~~~~~~~~~~'
[8586]285         WRITE(numout,*) '   Namelist namforcing:'
[8813]286         WRITE(numout,*) '      drag coefficient for oceanic stress              rn_cio     = ', rn_cio
287         WRITE(numout,*) '      coefficient for ice-lead partition of snowfall   rn_blow_s  = ', rn_blow_s
[8889]288         WRITE(numout,*) '      Multicategory heat flux formulation              nn_flxdist = ', nn_flxdist
[8813]289         WRITE(numout,*) '      Jules coupling (0=no, 1=emulated, 2=active)      nice_jules = ', nice_jules
[8586]290      ENDIF
291      !
292      IF(lwp) WRITE(numout,*)
[9570]293      SELECT CASE( nn_flxdist )         ! SI3 Multi-category heat flux formulation
[8586]294      CASE( -1  )
[9570]295         IF(lwp) WRITE(numout,*) '   SI3: use per-category fluxes (nn_flxdist = -1) '
[8586]296      CASE(  0  )
[9570]297         IF(lwp) WRITE(numout,*) '   SI3: use average per-category fluxes (nn_flxdist = 0) '
[8586]298      CASE(  1  )
[9570]299         IF(lwp) WRITE(numout,*) '   SI3: use average then redistribute per-category fluxes (nn_flxdist = 1) '
300         IF( ln_cpl )         CALL ctl_stop( 'ice_thd_init: the chosen nn_flxdist for SI3 in coupled mode must be /=1' )
[8586]301      CASE(  2  )
[9570]302         IF(lwp) WRITE(numout,*) '   SI3: Redistribute a single flux over categories (nn_flxdist = 2) '
303         IF( .NOT. ln_cpl )   CALL ctl_stop( 'ice_thd_init: the chosen nn_flxdist for SI3 in forced mode must be /=2' )
[8586]304      CASE DEFAULT
[9570]305         CALL ctl_stop( 'ice_thd_init: SI3 option, nn_flxdist, should be between -1 and 2' )
[8586]306      END SELECT
307      !
308   END SUBROUTINE ice_forcing_init
309
310#else
311   !!----------------------------------------------------------------------
[9570]312   !!   Default option :         Empty module         NO SI3 sea-ice model
[8586]313   !!----------------------------------------------------------------------
314#endif
315
316   !!======================================================================
317END MODULE iceforcing
Note: See TracBrowser for help on using the repository browser.