iceini_2.F90 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. MODULE 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. IMPLICIT NONE
  35. PRIVATE
  36. PUBLIC ice_init_2 ! called by sbcice_lim_2.F90
  37. !!----------------------------------------------------------------------
  38. !! NEMO/LIM2 4.0 , UCL - NEMO Consortium (2011)
  39. !! $Id$
  40. !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
  41. !!----------------------------------------------------------------------
  42. CONTAINS
  43. SUBROUTINE ice_init_2
  44. !!----------------------------------------------------------------------
  45. !! *** ROUTINE ice_init_2 ***
  46. !!
  47. !! ** purpose : initialisation of LIM-2 domain and variables
  48. !!----------------------------------------------------------------------
  49. INTEGER :: ierr
  50. !!----------------------------------------------------------------------
  51. !
  52. IF(lwp) THEN
  53. WRITE(numout,*)
  54. WRITE(numout,*) 'ice_init_2 : LIM-2 sea-ice - initialization'
  55. WRITE(numout,*) '~~~~~~~~~~~ '
  56. ENDIF
  57. !
  58. ! ! Allocate the ice arrays
  59. ierr = ice_alloc_2 () ! ice variables
  60. ierr = ierr + dom_ice_alloc_2() ! domain
  61. ierr = ierr + sbc_ice_alloc () ! surface forcing
  62. ierr = ierr + thd_ice_alloc_2() ! thermodynamics
  63. IF( lk_mpp ) CALL mpp_sum( ierr )
  64. IF( ierr /= 0 ) CALL ctl_stop( 'STOP', 'ice_init_2 : unable to allocate ice arrays' )
  65. ! ! adequation jpk versus ice/snow layers
  66. IF( jpl > jpk .OR. jplayersp1 > jpk ) CALL ctl_stop( 'STOP', &
  67. & 'ice_init: the 3rd dimension of workspace arrays is too small.', &
  68. & 'use more ocean levels or less ice layers/categories.' )
  69. ! ! Open the reference and configuration namelist files and namelist output file
  70. CALL ctl_opn( numnam_ice_ref, 'namelist_ice_ref', 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp )
  71. CALL ctl_opn( numnam_ice_cfg, 'namelist_ice_cfg', 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp )
  72. IF(lwm) CALL ctl_opn( numoni, 'output.namelist.ice', 'UNKNOWN', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp, 1 )
  73. ! ! Open the namelist file
  74. !
  75. CALL ice_run_2 ! read in namelist some run parameters
  76. !
  77. rdt_ice = nn_fsbc * rdttra(1) ! sea-ice time step
  78. numit = nit000 - 1
  79. !
  80. CALL lim_msh_2 ! ice mesh initialization
  81. !
  82. ! ! Initial sea-ice state
  83. IF( .NOT.ln_rstart ) THEN ; CALL lim_istate_2 ! start from rest: sea-ice deduced from sst
  84. ELSE ; CALL lim_rst_read_2 ! start from a restart file
  85. ENDIF
  86. !
  87. IF( .NOT.lk_mpp ) CALL lim_dia_init_2 ! online diagnostics in mono proc only
  88. !
  89. tn_ice(:,:,1) = sist(:,:) ! ice temperature known by the ocean
  90. fr_i (:,:) = 1.0 - frld(:,:) ! sea-ice fraction known by the ocean
  91. !
  92. CALL lim_sbc_init_2 ! ice surface boundary condition
  93. !
  94. IF( lk_lim2_vp ) THEN ; IF(lwp) WRITE(numout,*) ' VP rheology - B-grid case'
  95. ELSE ; IF(lwp) WRITE(numout,*) ' EVP rheology - C-grid case'
  96. ENDIF
  97. !
  98. END SUBROUTINE ice_init_2
  99. SUBROUTINE ice_run_2
  100. !!-------------------------------------------------------------------
  101. !! *** ROUTINE ice_run_2 ***
  102. !!
  103. !! ** Purpose : Definition some run parameter for ice model
  104. !!
  105. !! ** Method : Read the namicerun namelist and check the parameter
  106. !! values called at the first timestep (nit000)
  107. !!
  108. !! ** input : Namelist namicerun
  109. !!-------------------------------------------------------------------
  110. NAMELIST/namicerun/ cn_icerst_in, cn_icerst_indir, cn_icerst_out, cn_icerst_outdir, &
  111. ln_limdyn, ln_limdmp, acrit, hsndif, hicdif
  112. INTEGER :: ios ! Local integer output status for namelist read
  113. !!-------------------------------------------------------------------
  114. !
  115. REWIND( numnam_ice_ref ) ! Namelist namicerun in reference namelist : Parameters for ice
  116. READ ( numnam_ice_ref, namicerun, IOSTAT = ios, ERR = 901)
  117. 901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namicerun in reference namelist', lwp )
  118. REWIND( numnam_ice_cfg ) ! Namelist namicerun in configuration namelist : Parameters for ice
  119. READ ( numnam_ice_cfg, namicerun, IOSTAT = ios, ERR = 902 )
  120. 902 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namicerun in configuration namelist', lwp )
  121. IF(lwm) WRITE ( numoni, namicerun )
  122. !
  123. IF(lwp) THEN ! control print
  124. WRITE(numout,*)
  125. WRITE(numout,*) 'ice_run : ice share parameters for dynamics/advection/thermo of sea-ice'
  126. WRITE(numout,*) ' ~~~~~~'
  127. WRITE(numout,*) ' switch for ice dynamics (1) or not (0) ln_limdyn = ', ln_limdyn
  128. WRITE(numout,*) ' Ice damping ln_limdmp = ', ln_limdmp
  129. WRITE(numout,*) ' minimum fraction for leads in the NH (SH) acrit(1/2) = ', acrit(:)
  130. WRITE(numout,*) ' computation of temp. in snow (=0) or not (=9999) hsndif = ', hsndif
  131. WRITE(numout,*) ' computation of temp. in ice (=0) or not (=9999) hicdif = ', hicdif
  132. ENDIF
  133. !
  134. END SUBROUTINE ice_run_2
  135. #else
  136. !!----------------------------------------------------------------------
  137. !! Default option : Empty module NO LIM 2.0 sea-ice model
  138. !!----------------------------------------------------------------------
  139. CONTAINS
  140. SUBROUTINE ice_init_2 ! Empty routine
  141. END SUBROUTINE ice_init_2
  142. #endif
  143. !!======================================================================
  144. END MODULE iceini_2