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.
limistate_2.F90 in branches/2016/dev_r6519_HPC_4/NEMOGCM/NEMO/LIM_SRC_2 – NEMO

source: branches/2016/dev_r6519_HPC_4/NEMOGCM/NEMO/LIM_SRC_2/limistate_2.F90 @ 7037

Last change on this file since 7037 was 7037, checked in by mocavero, 8 years ago

ORCA2_LIM_PISCES hybrid version update

  • Property svn:keywords set to Id
File size: 10.6 KB
Line 
1MODULE limistate_2
2   !!======================================================================
3   !!                     ***  MODULE  limistate_2  ***
4   !!              Initialisation of diagnostics ice variables
5   !!======================================================================
6   !! History :   1.0  !  01-04  (C. Ethe, G. Madec)  Original code
7   !!             2.0  !  03-08  (G. Madec)  add lim_istate_init
8   !!                  !  04-04  (S. Theetten) initialization from a file
9   !!                  !  06-07  (S. Masson)  IOM to read the restart
10   !!                  !  07-10  (G. Madec)  surface module
11   !!--------------------------------------------------------------------
12#if defined key_lim2
13   !!----------------------------------------------------------------------
14   !!   'key_lim2' :                                  LIM 2.0 sea-ice model
15   !!----------------------------------------------------------------------
16   !!   lim_istate_2      :  Initialisation of diagnostics ice variables
17   !!   lim_istate_init_2 :  initialization of ice state and namelist read
18   !!----------------------------------------------------------------------
19   USE phycst
20   USE par_ice_2       ! ice parameters
21   USE dom_ice_2
22   USE eosbn2          ! equation of state
23   USE lbclnk
24   USE oce
25   USE ice_2
26   USE iom
27   USE in_out_manager
28   USE lib_fortran     ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined) 
29
30   IMPLICIT NONE
31   PRIVATE
32
33   PUBLIC lim_istate_2      ! routine called by lim_init_2.F90
34
35   !                        !! **  namelist (namiceini) **
36   LOGICAL  ::   ln_limini   ! Ice initialization state
37   REAL(wp) ::   ttest       ! threshold water temperature for initial sea ice
38   REAL(wp) ::   hninn       ! initial snow thickness in the north
39   REAL(wp) ::   hginn       ! initial ice thickness in the north
40   REAL(wp) ::   alinn       ! initial leads area in the north
41   REAL(wp) ::   hnins       ! initial snow thickness in the south
42   REAL(wp) ::   hgins       ! initial ice thickness in the south
43   REAL(wp) ::   alins       ! initial leads area in the south
44   
45   REAL(wp) ::   zero      = 0.e0     ! constant value = 0
46   REAL(wp) ::   zone      = 1.e0     ! constant value = 1
47   !!----------------------------------------------------------------------
48   !! NEMO/LIM2 3.3 , UCL - NEMO Consortium (2010)
49   !! $Id$
50   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
51   !!----------------------------------------------------------------------
52CONTAINS
53
54   SUBROUTINE lim_istate_2
55      !!-------------------------------------------------------------------
56      !!                    ***  ROUTINE lim_istate_2  ***
57      !!
58      !! ** Purpose :   defined the sea-ice initial state
59      !!
60      !! ** Method  :   restart from a state defined in a binary file
61      !!                or from arbitrary sea-ice conditions
62      !!--------------------------------------------------------------------
63      INTEGER  ::   ji, jj, jk                ! dummy loop indices
64      REAL(wp) ::   zidto                     ! temporary scalar
65      !--------------------------------------------------------------------
66 
67      CALL lim_istate_init_2     !  reading the initials parameters of the ice
68
69      IF( .NOT. ln_limini ) THEN 
70         
71         CALL eos_fzp( tsn(:,:,1,jp_sal), tfu(:,:) )       ! freezing/melting point of sea water [Celcius]
72!$OMP PARALLEL
73!$OMP WORKSHARE
74         tfu(:,:) = tfu(:,:) *  tmask(:,:,1)
75!$OMP END WORKSHARE
76
77!$OMP DO schedule(static) private(jj, ji)
78         DO jj = 1, jpj
79            DO ji = 1, jpi
80               !                     ! ice if sst <= t-freez + ttest
81               IF( tsn(ji,jj,1,jp_tem)  - tfu(ji,jj) >= ttest ) THEN   ;   zidto = 0.e0      ! no ice
82               ELSE                                                    ;   zidto = 1.e0      !    ice
83               ENDIF
84               !
85               IF( fcor(ji,jj) >= 0.e0 ) THEN     !--  Northern hemisphere.
86                  hicif(ji,jj)   = zidto * hginn
87                  frld(ji,jj)    = zidto * alinn + ( 1.0 - zidto ) * 1.0
88                  hsnif(ji,jj)   = zidto * hninn
89               ELSE                               !---  Southern hemisphere.
90                  hicif(ji,jj)   = zidto * hgins
91                  frld(ji,jj)    = zidto * alins + ( 1.0 - zidto ) * 1.0
92                  hsnif(ji,jj)   = zidto * hnins
93               ENDIF
94            END DO
95         END DO
96
97!$OMP WORKSHARE
98         tfu(:,:) = tfu(:,:) + rt0       ! ftu converted from Celsius to Kelvin (rt0 over land)
99         
100         sist  (:,:)   = tfu(:,:)
101         tbif  (:,:,1) = tfu(:,:)
102         tbif  (:,:,2) = tfu(:,:)
103         tbif  (:,:,3) = tfu(:,:)
104!$OMP END WORKSHARE
105
106!$OMP END PARALLEL
107      ENDIF
108     
109!$OMP PARALLEL WORKSHARE
110      fsbbq (:,:)   = 0.e0
111      qstoif(:,:)   = 0.e0
112      u_ice (:,:)   = 0.e0
113      v_ice (:,:)   = 0.e0
114
115      !---  Moments for advection.             
116
117      sxice (:,:)  = 0.e0   ;   sxsn (:,:)  = 0.e0   ;   sxa  (:,:)  = 0.e0
118      syice (:,:)  = 0.e0   ;   sysn (:,:)  = 0.e0   ;   sya  (:,:)  = 0.e0
119      sxxice(:,:)  = 0.e0   ;   sxxsn(:,:)  = 0.e0   ;   sxxa (:,:)  = 0.e0
120      syyice(:,:)  = 0.e0   ;   syysn(:,:)  = 0.e0   ;   syya (:,:)  = 0.e0
121      sxyice(:,:)  = 0.e0   ;   sxysn(:,:)  = 0.e0   ;   sxya (:,:)  = 0.e0
122
123      sxc0  (:,:)  = 0.e0   ;   sxc1 (:,:)  = 0.e0   ;   sxc2 (:,:)  = 0.e0
124      syc0  (:,:)  = 0.e0   ;   syc1 (:,:)  = 0.e0   ;   syc2 (:,:)  = 0.e0
125      sxxc0 (:,:)  = 0.e0   ;   sxxc1(:,:)  = 0.e0   ;   sxxc2(:,:)  = 0.e0
126      syyc0 (:,:)  = 0.e0   ;   syyc1(:,:)  = 0.e0   ;   syyc2(:,:)  = 0.e0
127      sxyc0 (:,:)  = 0.e0   ;   sxyc1(:,:)  = 0.e0   ;   sxyc2(:,:)  = 0.e0
128
129      sxst  (:,:)  = 0.e0
130      syst  (:,:)  = 0.e0
131      sxxst (:,:)  = 0.e0
132      syyst (:,:)  = 0.e0
133      sxyst (:,:)  = 0.e0
134#if ! defined key_lim2_vp
135      stress1_i (:,:) = 0._wp                          ! EVP rheology
136      stress2_i (:,:) = 0._wp
137      stress12_i(:,:) = 0._wp
138#endif
139!$OMP END PARALLEL WORKSHARE
140
141      !-- lateral boundary conditions
142      CALL lbc_lnk( hicif, 'T', 1. )
143      CALL lbc_lnk( frld , 'T', 1. )
144
145      ! C A U T I O N  frld = 1 over land and lbc_lnk put zero along
146      ! *************  closed boundaries herefore we force to one over land
147!$OMP PARALLEL WORKSHARE
148      frld(:,:) = tms(:,:) * frld(:,:) + ( 1. - tms(:,:) )   
149!$OMP END PARALLEL WORKSHARE
150
151      CALL lbc_lnk( hsnif, 'T', 1. )
152      CALL lbc_lnk( sist , 'T', 1. , pval = rt0 )      ! set rt0 on closed boundary (required by bulk formulation)
153      DO jk = 1, jplayersp1
154         CALL lbc_lnk(tbif(:,:,jk), 'T', 1. )
155      END DO
156      CALL lbc_lnk( fsbbq  , 'T', 1. )
157      CALL lbc_lnk( qstoif , 'T', 1. )
158
159   END SUBROUTINE lim_istate_2
160
161   
162   SUBROUTINE lim_istate_init_2
163      !!-------------------------------------------------------------------
164      !!                   ***  ROUTINE lim_istate_init_2  ***
165      !!       
166      !! ** Purpose :   Definition of initial state of the ice
167      !!
168      !! ** Method  :   Read the namiceini namelist and check the parameter
169      !!       values called at the first timestep (nit000)
170      !!
171      !! ** input   :   Namelist namiceini
172      !!-------------------------------------------------------------------
173      INTEGER :: inum_ice
174      INTEGER :: ji,jj
175      INTEGER :: ios                 ! Local integer output status for namelist read
176
177      NAMELIST/namiceini/ ln_limini, ttest, hninn, hginn, alinn, &
178         &                hnins, hgins, alins
179      !!-------------------------------------------------------------------
180                   
181      REWIND( numnam_ice_ref )              ! Namelist namiceini in reference namelist : Ice initial state
182      READ  ( numnam_ice_ref, namiceini, IOSTAT = ios, ERR = 901)
183901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namiceini in reference namelist', lwp )
184
185      REWIND( numnam_ice_cfg )              ! Namelist namiceini in configuration namelist : Ice initial state
186      READ  ( numnam_ice_cfg, namiceini, IOSTAT = ios, ERR = 902 )
187902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namiceini in configuration namelist', lwp )
188      IF(lwm) WRITE ( numoni, namiceini )
189      !
190      IF(lwp) THEN
191         WRITE(numout,*)
192         WRITE(numout,*) 'lim_istate_init_2 : ice parameters inititialisation '
193         WRITE(numout,*) '~~~~~~~~~~~~~~~~~'
194         WRITE(numout,*) '         threshold water temp. for initial sea-ice    ttest      = ', ttest
195         WRITE(numout,*) '         initial snow thickness in the north          hninn      = ', hninn
196         WRITE(numout,*) '         initial ice thickness in the north           hginn      = ', hginn 
197         WRITE(numout,*) '         initial leads area in the north              alinn      = ', alinn           
198         WRITE(numout,*) '         initial snow thickness in the south          hnins      = ', hnins 
199         WRITE(numout,*) '         initial ice thickness in the south           hgins      = ', hgins
200         WRITE(numout,*) '         initial leads area in the south              alins      = ', alins
201         WRITE(numout,*) '         Ice state initialization using input file    ln_limini  = ', ln_limini
202      ENDIF
203
204      IF( ln_limini ) THEN                      ! Ice initialization using input file
205         !
206         CALL iom_open( 'Ice_initialization.nc', inum_ice )
207         !
208         IF( inum_ice > 0 ) THEN
209            IF(lwp) WRITE(numout,*)
210            IF(lwp) WRITE(numout,*) '                  ice state initialization with : Ice_initialization.nc'
211           
212            CALL iom_get( inum_ice, jpdom_data, 'hicif', hicif )     
213            CALL iom_get( inum_ice, jpdom_data, 'hsnif', hsnif )     
214            CALL iom_get( inum_ice, jpdom_data, 'frld' , frld  )     
215            CALL iom_get( inum_ice, jpdom_data, 'ts'   , sist  )
216            CALL iom_get( inum_ice, jpdom_unknown, 'tbif', tbif(1:nlci,1:nlcj,:),   &
217                 &        kstart = (/ mig(1),mjg(1),1 /), kcount = (/ nlci,nlcj,jplayersp1 /) )
218            ! put some values in the extra-halo...
219            DO jj = nlcj+1, jpj   ;   tbif(1:nlci,jj,:) = tbif(1:nlci,nlej,:)   ;   END DO
220            DO ji = nlci+1, jpi   ;   tbif(ji    ,: ,:) = tbif(nlei  ,:   ,:)   ;   END DO
221
222            CALL iom_close( inum_ice)
223            !
224         ENDIF
225      ENDIF
226      !     
227   END SUBROUTINE lim_istate_init_2
228
229#else
230   !!----------------------------------------------------------------------
231   !!   Default option :         Empty module      NO LIM 2.0 sea-ice model
232   !!----------------------------------------------------------------------
233CONTAINS
234   SUBROUTINE lim_istate_2        ! Empty routine
235   END SUBROUTINE lim_istate_2
236#endif
237
238   !!======================================================================
239END MODULE limistate_2
Note: See TracBrowser for help on using the repository browser.