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.
icethd_sal.F90 in branches/2017/dev_r8183_ICEMODEL/NEMOGCM/NEMO/LIM_SRC_3 – NEMO

source: branches/2017/dev_r8183_ICEMODEL/NEMOGCM/NEMO/LIM_SRC_3/icethd_sal.F90 @ 8498

Last change on this file since 8498 was 8498, checked in by clem, 7 years ago

changes in style - part2 -

File size: 8.1 KB
Line 
1MODULE icethd_sal
2   !!======================================================================
3   !!                       ***  MODULE icethd_sal ***
4   !! LIM-3 sea-ice :  computation of salinity variations in the ice
5   !!======================================================================
6   !! History :   -   ! 2003-05 (M. Vancoppenolle) UCL-ASTR first coding for LIM3-1D
7   !!            3.0  ! 2005-12 (M. Vancoppenolle) adapted to the 3-D version
8   !!            4.0  ! 2011-02 (G. Madec) dynamical allocation
9   !!---------------------------------------------------------------------
10#if defined key_lim3
11   !!----------------------------------------------------------------------
12   !!   'key_lim3'                                      LIM-3 sea-ice model
13   !!----------------------------------------------------------------------
14   !!   ice_thd_sal   : salinity variations in the ice
15   !!----------------------------------------------------------------------
16   USE par_oce        ! ocean parameters
17   USE phycst         ! physical constants (ocean directory)
18   USE ice            ! LIM variables
19   USE ice1D          ! LIM thermodynamics
20   USE icevar         ! LIM variables
21   !
22   USE in_out_manager ! I/O manager
23   USE lib_mpp        ! MPP library
24   USE lib_fortran    ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined) 
25
26   IMPLICIT NONE
27   PRIVATE
28
29   PUBLIC   ice_thd_sal        ! called by icethd module
30   PUBLIC   ice_thd_sal_init   ! called by ice_init
31
32   !!----------------------------------------------------------------------
33   !! NEMO/ICE 4.0 , NEMO Consortium (2017)
34   !! $Id: icethd_sal.F90 8420 2017-08-08 12:18:46Z clem $
35   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
36   !!----------------------------------------------------------------------
37CONTAINS
38
39   SUBROUTINE ice_thd_sal
40      !!-------------------------------------------------------------------
41      !!                ***  ROUTINE ice_thd_sal  ***   
42      !!   
43      !! ** Purpose :   computes new salinities in the ice
44      !!
45      !! ** Method  :  3 possibilities
46      !!               -> nn_icesal = 1 -> Sice = cst    [ice salinity constant in both time & space]
47      !!               -> nn_icesal = 2 -> Sice = S(z,t) [Vancoppenolle et al. 2005]
48      !!               -> nn_icesal = 3 -> Sice = S(z)   [multiyear ice]
49      !!---------------------------------------------------------------------
50      INTEGER  ::   ji, jk                       ! dummy loop indices
51      REAL(wp) ::   iflush, igravdr              ! local scalars
52      REAL(wp) ::   zs_sni, zsm_i_gd, zsm_i_fl, zsm_i_si, zsm_i_bg   ! local scalars
53      !!---------------------------------------------------------------------
54
55      SELECT CASE ( nn_icesal )
56      !
57      !              !---------------------------------------------!
58      CASE( 2 )      !  time varying salinity with linear profile  !
59      !              !---------------------------------------------!
60         DO ji = 1, nidx
61
62            !---------------------------------------------------------
63            !  Update ice salinity from snow-ice and bottom growth
64            !---------------------------------------------------------
65            zs_sni   = sss_1d(ji) * ( rhoic - rhosn ) * r1_rhoic   ! Salinity of snow ice
66            rswitch  = MAX( 0._wp , SIGN( 1._wp , ht_i_1d(ji) - epsi20 ) )
67            zsm_i_si = ( zs_sni      - sm_i_1d(ji) ) *             dh_snowice(ji)  / MAX( ht_i_1d(ji), epsi20 ) * rswitch ! snow-ice   
68            zsm_i_bg = ( s_i_new(ji) - sm_i_1d(ji) ) * MAX( 0._wp, dh_i_bott(ji) ) / MAX( ht_i_1d(ji), epsi20 ) * rswitch ! bottom growth
69
70            ! Update salinity (nb: salt flux already included in icethd_dh)
71            sm_i_1d(ji) = sm_i_1d(ji) + zsm_i_bg + zsm_i_si
72
73            IF( ln_limdS ) THEN
74               !---------------------------------------------------------
75               !  Update ice salinity from brine drainage and flushing
76               !---------------------------------------------------------
77               iflush   = MAX( 0._wp , SIGN( 1._wp , t_su_1d(ji) - rt0         ) )  ! =1 if summer
78               igravdr  = MAX( 0._wp , SIGN( 1._wp , t_bo_1d(ji) - t_su_1d(ji) ) )  ! =1 if t_su < t_bo
79               zsm_i_gd = - igravdr * MAX( sm_i_1d(ji) - rn_sal_gd , 0._wp ) / rn_time_gd * rdt_ice  ! gravity drainage
80               zsm_i_fl = - iflush  * MAX( sm_i_1d(ji) - rn_sal_fl , 0._wp ) / rn_time_fl * rdt_ice  ! flushing
81               
82               ! Update salinity   
83               sm_i_1d(ji) = sm_i_1d(ji) + zsm_i_fl + zsm_i_gd
84               
85               ! Salt flux
86               sfx_bri_1d(ji) = sfx_bri_1d(ji) - rhoic * a_i_1d(ji) * ht_i_1d(ji) * ( zsm_i_fl + zsm_i_gd ) * r1_rdtice
87            ENDIF
88         END DO
89
90         ! Salinity profile
91         CALL ice_var_salprof1d
92         !
93      !                 !---------------------------------------------!
94      CASE( 3 )         ! constant salinity with a fix profile        ! (Schwarzacher (1959) multiyear salinity profile(mean = 2.30)
95      !                 !---------------------------------------------!
96         CALL ice_var_salprof1d
97      !
98   END SELECT
99   !
100   END SUBROUTINE ice_thd_sal
101
102
103   SUBROUTINE ice_thd_sal_init
104      !!-------------------------------------------------------------------
105      !!                  ***  ROUTINE ice_thd_sal_init  ***
106      !!
107      !! ** Purpose :   initialization of ice salinity parameters
108      !!
109      !! ** Method  :   Read the namicesal namelist and check the parameter
110      !!              values called at the first timestep (nit000)
111      !!
112      !! ** input   :   Namelist namicesal
113      !!-------------------------------------------------------------------
114      INTEGER  ::   ios                 ! Local integer output status for namelist read
115      !!
116      NAMELIST/namicesal/ ln_limdS , nn_icesal , rn_icesal, rn_sal_gd, rn_time_gd,   &
117         &                rn_sal_fl, rn_time_fl, rn_simax , rn_simin 
118      !!-------------------------------------------------------------------
119      !
120      REWIND( numnam_ice_ref )              ! Namelist namicesal in reference namelist : Ice salinity
121      READ  ( numnam_ice_ref, namicesal, IOSTAT = ios, ERR = 901)
122901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namicesal in reference namelist', lwp )
123      !
124      REWIND( numnam_ice_cfg )              ! Namelist namicesal in configuration namelist : Ice salinity
125      READ  ( numnam_ice_cfg, namicesal, IOSTAT = ios, ERR = 902 )
126902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namicesal in configuration namelist', lwp )
127      IF(lwm) WRITE ( numoni, namicesal )
128      !
129      IF(lwp) THEN                           ! control print
130         WRITE(numout,*)
131         WRITE(numout,*) 'ice_thd_sal_init : Ice parameters for salinity '
132         WRITE(numout,*) '~~~~~~~~~~~~~~~~'
133         WRITE(numout,*) '   activate gravity drainage and flushing (T) or not (F)   ln_limdS   = ', ln_limdS
134         WRITE(numout,*) '   switch for salinity                                     nn_icesal  = ', nn_icesal
135         WRITE(numout,*) '   bulk salinity value if nn_icesal = 1                    rn_icesal  = ', rn_icesal
136         WRITE(numout,*) '   restoring salinity for gravity drainage                 rn_sal_gd  = ', rn_sal_gd
137         WRITE(numout,*) '   restoring time for for gravity drainage                 rn_time_gd = ', rn_time_gd
138         WRITE(numout,*) '   restoring salinity for flushing                         rn_sal_fl  = ', rn_sal_fl
139         WRITE(numout,*) '   restoring time for flushing                             rn_time_fl = ', rn_time_fl
140         WRITE(numout,*) '   Maximum tolerated ice salinity                          rn_simax   = ', rn_simax
141         WRITE(numout,*) '   Minimum tolerated ice salinity                          rn_simin   = ', rn_simin
142      ENDIF
143      !
144   END SUBROUTINE ice_thd_sal_init
145
146#else
147   !!----------------------------------------------------------------------
148   !!   Default option         Dummy Module          No LIM-3 sea-ice model
149   !!----------------------------------------------------------------------
150#endif
151
152   !!======================================================================
153END MODULE icethd_sal
Note: See TracBrowser for help on using the repository browser.