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 @ 8534

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

changes in style - part6 - pure cosmetics

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