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.
iceini_2.F90 in trunk/NEMOGCM/NEMO/LIM_SRC_2 – NEMO

source: trunk/NEMOGCM/NEMO/LIM_SRC_2/iceini_2.F90 @ 4696

Last change on this file since 4696 was 4624, checked in by acc, 10 years ago

#1305. Fix slow start-up problems on some systems by introducing and using lwm logical to restrict output of merged namelists to the first (or only) processor. lwm is true only on the first processor regardless of ln_ctl. Small changes to all flavours of nemogcm.F90 are also required to write namctl and namcfg after the call to mynode which now opens output.namelist.dyn and writes nammpp.

  • Property svn:keywords set to Id
File size: 8.0 KB
Line 
1MODULE iceini_2
2   !!======================================================================
3   !!                       ***  MODULE iceini   ***
4   !!   Sea-ice model : LIM 2.0 Sea ice model Initialization
5   !!======================================================================
6   !! History :  1.0  ! 2002-08  (G. Madec)  F90: Free form and modules
7   !!            2.0  ! 2003-08  (C. Ethe)  add ice_run
8   !!            3.3  ! 2009-05  (G. Garric, C. Bricaud) addition of the lim2_evp case
9   !!            4.0  ! 2011-02  (G. Madec) dynamical allocation
10   !!----------------------------------------------------------------------
11#if defined key_lim2
12   !!----------------------------------------------------------------------
13   !!   'key_lim2' :                                  LIM 2.0 sea-ice model
14   !!----------------------------------------------------------------------
15   !!   ice_init_2    : sea-ice model initialization
16   !!   ice_run_2     : Definition some run parameter for ice model
17   !!----------------------------------------------------------------------
18   USE phycst         ! physical constants
19   USE dom_oce        ! ocean domain
20   USE sbc_oce        ! surface boundary condition: ocean
21   USE sbc_ice        ! LIM2 surface boundary condition
22   USE dom_ice_2      ! LIM2 ice domain
23   USE par_ice_2      ! LIM2 parameters
24   USE thd_ice_2      ! LIM2 thermodynamical variables
25   USE ice_2          ! LIM2 ice variable
26   USE limmsh_2       ! LIM2 mesh
27   USE limistate_2    ! LIM2 initial state
28   USE limrst_2       ! LIM2 restart
29   USE limsbc_2       ! LIM2 surface boundary condition
30   USE limdia_2
31   USE in_out_manager ! I/O manager
32   USE lib_mpp        ! MPP library
33   USE lib_fortran    ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined) 
34
35   IMPLICIT NONE
36   PRIVATE
37
38   PUBLIC   ice_init_2               ! called by sbcice_lim_2.F90
39
40   !!----------------------------------------------------------------------
41   !! NEMO/LIM2 4.0 , UCL - NEMO Consortium (2011)
42   !! $Id$
43   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
44   !!----------------------------------------------------------------------
45CONTAINS
46
47   SUBROUTINE ice_init_2
48      !!----------------------------------------------------------------------
49      !!                  ***  ROUTINE ice_init_2  ***
50      !!
51      !! ** purpose :   initialisation of LIM-2 domain and variables 
52      !!----------------------------------------------------------------------
53      INTEGER :: ierr
54      !!----------------------------------------------------------------------
55      !
56      IF(lwp) THEN
57         WRITE(numout,*)
58         WRITE(numout,*) 'ice_init_2 : LIM-2 sea-ice - initialization'
59         WRITE(numout,*) '~~~~~~~~~~~   '
60      ENDIF
61      !                               
62      ! When Diurnal cycle, core bulk and LIM2  are activated,
63      ! a daily mean qsr is computed for tracer/biogeochemistery model                                 !
64      IF( ltrcdm2dc )THEN  ; ltrcdm2dc_ice = .TRUE.
65      ELSE                 ; ltrcdm2dc_ice = .FALSE.
66      ENDIF
67      !                                ! Allocate the ice arrays
68      ierr =        ice_alloc_2    ()       ! ice variables
69      ierr = ierr + dom_ice_alloc_2()       ! domain
70      ierr = ierr + sbc_ice_alloc  ()       ! surface forcing
71      ierr = ierr + thd_ice_alloc_2()       ! thermodynamics
72
73      IF( lk_mpp    )   CALL mpp_sum( ierr )
74      IF( ierr /= 0 )   CALL ctl_stop( 'STOP', 'ice_init_2 : unable to allocate ice arrays' )
75
76      !                                ! adequation jpk versus ice/snow layers
77      IF( jpl > jpk  .OR.  jplayersp1 > jpk  )   CALL ctl_stop( 'STOP',           &
78         &     'ice_init: the 3rd dimension of workspace arrays is too small.',   &
79         &     'use more ocean levels or less ice layers/categories.' )
80
81      !                                ! Open the reference and configuration namelist files and namelist output file
82      CALL ctl_opn( numnam_ice_ref, 'namelist_ice_ref',    'OLD',     'FORMATTED', 'SEQUENTIAL', -1, numout, lwp ) 
83      CALL ctl_opn( numnam_ice_cfg, 'namelist_ice_cfg',    'OLD',     'FORMATTED', 'SEQUENTIAL', -1, numout, lwp )
84      IF(lwm) CALL ctl_opn( numoni, 'output.namelist.ice', 'UNKNOWN', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp, 1 )
85
86      !                                ! Open the namelist file
87      !   
88      CALL ice_run_2                   ! read in namelist some run parameters
89      !         
90      rdt_ice = nn_fsbc * rdttra(1)    ! sea-ice time step
91      numit   = nit000 - 1
92      !
93      CALL lim_msh_2                   ! ice mesh initialization
94      !
95      !                                ! Initial sea-ice state
96      IF( .NOT.ln_rstart ) THEN   ;   CALL lim_istate_2     ! start from rest: sea-ice deduced from sst
97      ELSE                        ;   CALL lim_rst_read_2   ! start from a restart file
98      ENDIF
99      !
100      IF( .NOT.lk_mpp )               CALL lim_dia_init_2  ! online diagnostics in mono proc only
101      !
102      tn_ice(:,:,1) = sist(:,:)        ! ice temperature  known by the ocean
103      fr_i  (:,:)   = 1.0 - frld(:,:)  ! sea-ice fraction known by the ocean
104      !
105      CALL lim_sbc_init_2              ! ice surface boundary condition   
106      !
107      IF( lk_lim2_vp )   THEN   ;   IF(lwp) WRITE(numout,*) '                VP  rheology - B-grid case'
108      ELSE                      ;   IF(lwp) WRITE(numout,*) '                EVP rheology - C-grid case'
109      ENDIF
110      !
111   END SUBROUTINE ice_init_2
112
113
114   SUBROUTINE ice_run_2
115      !!-------------------------------------------------------------------
116      !!                  ***  ROUTINE ice_run_2 ***
117      !!                 
118      !! ** Purpose :   Definition some run parameter for ice model
119      !!
120      !! ** Method  :   Read the namicerun namelist and check the parameter
121      !!       values called at the first timestep (nit000)
122      !!
123      !! ** input   :   Namelist namicerun
124      !!-------------------------------------------------------------------
125      NAMELIST/namicerun/ cn_icerst_in, cn_icerst_out, ln_limdyn, ln_limdmp, acrit, hsndif, hicdif
126      INTEGER  ::   ios                 ! Local integer output status for namelist read
127      !!-------------------------------------------------------------------
128      !                   
129      REWIND( numnam_ice_ref )              ! Namelist namicerun in reference namelist : Parameters for ice
130      READ  ( numnam_ice_ref, namicerun, IOSTAT = ios, ERR = 901)
131901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namicerun in reference namelist', lwp )
132
133      REWIND( numnam_ice_cfg )              ! Namelist namicerun in configuration namelist : Parameters for ice
134      READ  ( numnam_ice_cfg, namicerun, IOSTAT = ios, ERR = 902 )
135902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namicerun in configuration namelist', lwp )
136      IF(lwm) WRITE ( numoni, namicerun )
137      !
138      IF(lwp) THEN                              ! control print
139         WRITE(numout,*)
140         WRITE(numout,*) 'ice_run : ice share parameters for dynamics/advection/thermo of sea-ice'
141         WRITE(numout,*) ' ~~~~~~'
142         WRITE(numout,*) '   switch for ice dynamics (1) or not (0)      ln_limdyn   = ', ln_limdyn
143         WRITE(numout,*) '   Ice damping                                 ln_limdmp   = ', ln_limdmp
144         WRITE(numout,*) '   minimum fraction for leads in the NH (SH)  acrit(1/2)   = ', acrit(:)
145         WRITE(numout,*) '   computation of temp. in snow (=0) or not (=9999) hsndif = ', hsndif
146         WRITE(numout,*) '   computation of temp. in ice  (=0) or not (=9999) hicdif = ', hicdif
147      ENDIF
148      !
149   END SUBROUTINE ice_run_2
150
151#else
152   !!----------------------------------------------------------------------
153   !!   Default option :        Empty module       NO LIM 2.0 sea-ice model
154   !!----------------------------------------------------------------------
155CONTAINS
156   SUBROUTINE ice_init_2      ! Empty routine
157   END SUBROUTINE ice_init_2
158#endif
159
160   !!======================================================================
161END MODULE iceini_2
Note: See TracBrowser for help on using the repository browser.