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.
isfstp.F90 in NEMO/branches/2020/dev_r12377_KERNEL-06_techene_e3/src/OCE/ISF – NEMO

source: NEMO/branches/2020/dev_r12377_KERNEL-06_techene_e3/src/OCE/ISF/isfstp.F90 @ 12625

Last change on this file since 12625 was 12625, checked in by techene, 4 years ago

all: change #include domzgr_substitute.h90 position

  • Property svn:keywords set to Id
File size: 15.2 KB
Line 
1MODULE isfstp
2   !!======================================================================
3   !!                       ***  MODULE  isfstp  ***
4   !! Surface module :  compute iceshelf load, melt and heat flux
5   !!======================================================================
6   !! History :  3.2  !  2011-02  (C.Harris  ) Original code isf cav
7   !!            X.X  !  2006-02  (C. Wang   ) Original code bg03
8   !!            3.4  !  2013-03  (P. Mathiot) Merging + parametrization
9   !!            4.1  !  2019-09  (P. Mathiot) Split param/explicit ice shelf and re-organisation
10   !!----------------------------------------------------------------------
11
12   !!----------------------------------------------------------------------
13   !!   isfstp       : compute iceshelf melt and heat flux
14   !!----------------------------------------------------------------------
15   !
16   USE isf_oce                                      ! isf variables
17   USE isfload, ONLY: isf_load                      ! ice shelf load
18   USE isftbl , ONLY: isf_tbl_lvl                   ! ice shelf boundary layer
19   USE isfpar , ONLY: isf_par, isf_par_init         ! ice shelf parametrisation
20   USE isfcav , ONLY: isf_cav, isf_cav_init         ! ice shelf cavity
21   USE isfcpl , ONLY: isfcpl_rst_write, isfcpl_init ! isf variables
22
23   USE dom_oce                                          ! ocean space and time domain
24   USE domvvl,  ONLY: ln_vvl_zstar                      ! zstar logical
25   USE zdfdrg,  ONLY: r_Cdmin_top, r_ke0_top            ! vertical physics: top/bottom drag coef.
26   !
27   USE lib_mpp, ONLY: ctl_stop, ctl_nam
28   USE fldread, ONLY: FLD, FLD_N
29   USE in_out_manager ! I/O manager
30   USE timing
31
32   IMPLICIT NONE
33
34   PRIVATE
35
36   PUBLIC   isf_stp, isf_init, isf_nam  ! routine called in sbcmod and divhor
37
38   !! * Substitutions
39#  include "domzgr_substitute.h90"
40   !!----------------------------------------------------------------------
41   !! NEMO/OCE 4.0 , NEMO Consortium (2018)
42   !! $Id$
43   !! Software governed by the CeCILL license (see ./LICENSE)
44   !!----------------------------------------------------------------------
45
46CONTAINS
47 
48  SUBROUTINE isf_stp( kt, Kmm )
49      !!---------------------------------------------------------------------
50      !!                  ***  ROUTINE isf_stp  ***
51      !!
52      !! ** Purpose : compute total heat flux and total fwf due to ice shelf melt
53      !!
54      !! ** Method  : For each case (parametrisation or explicity cavity) :
55      !!              - define the before fields
56      !!              - compute top boundary layer properties
57      !!                (in case of parametrisation, this is the
58      !!                 depth range model array used to compute mean far fields properties)
59      !!              - compute fluxes
60      !!              - write restart variables
61      !!
62      !!----------------------------------------------------------------------
63      INTEGER, INTENT(in) ::   kt   ! ocean time step
64      INTEGER, INTENT(in) ::   Kmm  ! ocean time level index
65      !!----------------------------------------------------------------------
66      INTEGER :: jk                               ! loop index
67      REAL(wp), DIMENSION(jpi,jpj,jpk) :: ze3t    ! e3t
68      !!---------------------------------------------------------------------
69      !
70      IF( ln_timing )   CALL timing_start('isf')
71      !
72      !=======================================================================
73      ! 1.: compute melt and associated heat fluxes in the ice shelf cavities
74      !=======================================================================
75      !
76      IF ( ln_isfcav_mlt ) THEN
77         !
78         ! 1.1: before time step
79         IF ( kt /= nit000 ) THEN
80            risf_cav_tsc_b (:,:,:) = risf_cav_tsc (:,:,:)
81            fwfisf_cav_b(:,:)      = fwfisf_cav(:,:)
82         END IF
83         !
84         ! 1.2: compute misfkb, rhisf_tbl, rfrac (deepest level, thickness, fraction of deepest cell affected by tbl)
85         rhisf_tbl_cav(:,:) = rn_htbl * mskisf_cav(:,:)
86         DO jk = 1, jpk
87            ze3t(:,:,jk) = e3t(:,:,jk,Kmm)
88         END DO
89         CALL isf_tbl_lvl(ht, ze3t, misfkt_cav, misfkb_cav, rhisf_tbl_cav, rfrac_tbl_cav)
90         !
91         ! 1.3: compute ice shelf melt
92         CALL isf_cav( kt, Kmm, risf_cav_tsc, fwfisf_cav)
93         !
94      END IF
95      !
96      !=================================================================================
97      ! 2.: compute melt and associated heat fluxes for not resolved ice shelf cavities
98      !=================================================================================
99      !
100      IF ( ln_isfpar_mlt ) THEN
101         !
102         ! 2.1: before time step
103         IF ( kt /= nit000 ) THEN
104            risf_par_tsc_b(:,:,:) = risf_par_tsc(:,:,:)
105            fwfisf_par_b  (:,:)   = fwfisf_par  (:,:)
106         END IF
107         !
108         ! 2.2: compute misfkb, rhisf_tbl, rfrac (deepest level, thickness, fraction of deepest cell affected by tbl)
109         ! by simplicity, we assume the top level where param applied do not change with time (done in init part)
110         rhisf_tbl_par(:,:) = rhisf0_tbl_par(:,:)
111         DO jk = 1, jpk
112            ze3t(:,:,jk) = e3t(:,:,jk,Kmm)
113         END DO
114         CALL isf_tbl_lvl(ht, ze3t, misfkt_par, misfkb_par, rhisf_tbl_par, rfrac_tbl_par)
115         !
116         ! 2.3: compute ice shelf melt
117         CALL isf_par( kt, Kmm, risf_par_tsc, fwfisf_par)
118         !
119      END IF
120      !
121      !==================================================================================
122      ! 3.: output specific restart variable in case of coupling with an ice sheet model
123      !==================================================================================
124      !
125      IF ( ln_isfcpl .AND. lrst_oce ) CALL isfcpl_rst_write(kt, Kmm)
126      !
127      IF( ln_timing )   CALL timing_stop('isf')
128      !
129   END SUBROUTINE isf_stp
130
131   SUBROUTINE isf_init(Kbb, Kmm, Kaa)
132      !!---------------------------------------------------------------------
133      !!                  ***  ROUTINE isfstp_init  ***
134      !!
135      !! ** Purpose :   Initialisation of the ice shelf public variables
136      !!
137      !! ** Method  :   Read the namisf namelist, check option compatibility and set derived parameters
138      !!
139      !! ** Action  : - read namisf parameters
140      !!              - allocate memory
141      !!              - output print
142      !!              - ckeck option compatibility
143      !!              - call cav/param/isfcpl init routine
144      !!----------------------------------------------------------------------
145      INTEGER, INTENT(in) :: Kbb, Kmm, Kaa      ! ocean time level indices
146      !
147      ! constrain: l_isfoasis need to be known
148      !
149      ! Read namelist
150      CALL isf_nam()
151      !
152      ! Allocate public array
153      CALL isf_alloc()
154      !
155      ! check option compatibility
156      CALL isf_ctl()
157      !
158      ! compute ice shelf load
159      IF ( ln_isfcav ) CALL isf_load( Kmm, risfload )
160      !
161      ! terminate routine now if no ice shelf melt formulation specify
162      IF ( ln_isf ) THEN
163         !
164         !---------------------------------------------------------------------------------------------------------------------
165         ! initialisation melt in the cavity
166         IF ( ln_isfcav_mlt ) CALL isf_cav_init()
167         !
168         !---------------------------------------------------------------------------------------------------------------------
169         ! initialisation parametrised melt
170         IF ( ln_isfpar_mlt ) CALL isf_par_init()
171         !
172         !---------------------------------------------------------------------------------------------------------------------
173         ! initialisation ice sheet coupling
174         IF( ln_isfcpl ) CALL isfcpl_init(Kbb, Kmm, Kaa)
175         !
176      END IF
177         
178  END SUBROUTINE isf_init
179
180  SUBROUTINE isf_ctl()
181      !!---------------------------------------------------------------------
182      !!                  ***  ROUTINE isf_ctl  ***
183      !!
184      !! ** Purpose :   output print and option compatibility check
185      !!
186      !!----------------------------------------------------------------------
187      IF (lwp) THEN
188         WRITE(numout,*)
189         WRITE(numout,*) 'isf_init : ice shelf initialisation'
190         WRITE(numout,*) '~~~~~~~~~~~~'
191         WRITE(numout,*) '   Namelist namisf :'
192         !
193         WRITE(numout,*) '   ice shelf cavity (open or parametrised)  ln_isf = ', ln_isf
194         WRITE(numout,*)
195         !
196         IF ( ln_isf ) THEN
197            WRITE(numout,*) '      Add debug print in isf module           ln_isfdebug     = ', ln_isfdebug
198            WRITE(numout,*)
199            WRITE(numout,*) '      melt inside the cavity                  ln_isfcav_mlt   = ', ln_isfcav_mlt
200            IF ( ln_isfcav_mlt) THEN
201               WRITE(numout,*) '         melt formulation                         cn_isfcav_mlt= ', TRIM(cn_isfcav_mlt)
202               WRITE(numout,*) '         thickness of the top boundary layer      rn_htbl      = ', rn_htbl
203               WRITE(numout,*) '         gamma formulation                        cn_gammablk  = ', TRIM(cn_gammablk) 
204               IF ( TRIM(cn_gammablk) .NE. 'spe' ) THEN
205                  WRITE(numout,*) '         gammat coefficient                       rn_gammat0   = ', rn_gammat0 
206                  WRITE(numout,*) '         gammas coefficient                       rn_gammas0   = ', rn_gammas0 
207                  WRITE(numout,*) '         top background ke used (from namdrg_top) rn_ke0       = ', r_ke0_top
208                  WRITE(numout,*) '         top drag coef.    used (from namdrg_top) rn_Cd0       = ', r_Cdmin_top
209               END IF
210            END IF
211            WRITE(numout,*) ''
212            !
213            WRITE(numout,*) '      ice shelf melt parametrisation          ln_isfpar_mlt   = ', ln_isfpar_mlt
214            IF ( ln_isfpar_mlt ) THEN
215               WRITE(numout,*) '         isf parametrisation formulation         cn_isfpar_mlt   = ', TRIM(cn_isfpar_mlt)
216            END IF
217            WRITE(numout,*) ''
218            !
219            WRITE(numout,*) '      Coupling to an ice sheet model          ln_isfcpl       = ', ln_isfcpl
220            IF ( ln_isfcpl ) THEN
221               WRITE(numout,*) '         conservation activated ln_isfcpl_cons     = ', ln_isfcpl_cons
222               WRITE(numout,*) '         number of call of the extrapolation loop  = ', nn_drown
223            ENDIF
224            WRITE(numout,*) ''
225            !
226         ELSE
227            !
228            IF ( ln_isfcav ) THEN
229               WRITE(numout,*) ''
230               WRITE(numout,*) '   W A R N I N G: ice shelf cavities are open BUT no melt will be computed or read from file !'
231               WRITE(numout,*) ''
232            END IF
233            !
234         END IF
235
236         IF (ln_isfcav) THEN
237            WRITE(numout,*) '      Ice shelf load method                   cn_isfload        = ', TRIM(cn_isfload)
238            WRITE(numout,*) '         Temperature used to compute the ice shelf load            = ', rn_isfload_T
239            WRITE(numout,*) '         Salinity    used to compute the ice shelf load            = ', rn_isfload_S
240         END IF
241         WRITE(numout,*) ''
242         FLUSH(numout)
243
244      END IF
245      !
246
247      !---------------------------------------------------------------------------------------------------------------------
248      ! sanity check  ! issue ln_isfcav not yet known as well as l_isfoasis  => move this call in isf_stp ?
249      ! melt in the cavity without cavity
250      IF ( ln_isfcav_mlt .AND. (.NOT. ln_isfcav) ) &
251          &   CALL ctl_stop('ice shelf melt in the cavity activated (ln_isfcav_mlt) but no cavity detected in domcfg (ln_isfcav), STOP' )
252      !
253      ! ice sheet coupling without cavity
254      IF ( ln_isfcpl .AND. (.NOT. ln_isfcav) ) &
255         &   CALL ctl_stop('coupling with an ice sheet model detected (ln_isfcpl) but no cavity detected in domcfg (ln_isfcav), STOP' )
256      !
257      IF ( ln_isfcpl .AND. ln_isfcpl_cons .AND. ln_linssh ) &
258         &   CALL ctl_stop( 'The coupling between NEMO and an ice sheet model with the conservation option does not work with the linssh option' )
259      !
260      IF ( l_isfoasis .AND. .NOT. ln_isf ) CALL ctl_stop( ' OASIS send ice shelf fluxes to NEMO but NEMO does not have the isf module activated' )
261      !
262      IF ( l_isfoasis .AND. ln_isf ) THEN
263         !
264         CALL ctl_stop( 'namelist combination ln_cpl and ln_isf not tested' )
265         !
266         ! NEMO coupled to ATMO model with isf cavity need oasis method for melt computation
267         IF ( ln_isfcav_mlt .AND. TRIM(cn_isfcav_mlt) /= 'oasis' ) CALL ctl_stop( 'cn_isfcav_mlt = oasis is the only option availble if fwf send by oasis' )
268         IF ( ln_isfpar_mlt .AND. TRIM(cn_isfpar_mlt) /= 'oasis' ) CALL ctl_stop( 'cn_isfpar_mlt = oasis is the only option availble if fwf send by oasis' )
269         !
270         ! oasis melt computation not tested (coded but not tested)
271         IF ( ln_isfcav_mlt .OR. ln_isfpar_mlt ) THEN
272            IF ( TRIM(cn_isfcav_mlt) == 'oasis' ) CALL ctl_stop( 'cn_isfcav_mlt = oasis not tested' )
273            IF ( TRIM(cn_isfpar_mlt) == 'oasis' ) CALL ctl_stop( 'cn_isfpar_mlt = oasis not tested' )
274         END IF
275         !
276         ! oasis melt computation with cavity open and cavity parametrised (not coded)
277         IF ( ln_isfcav_mlt .AND. ln_isfpar_mlt ) THEN
278            IF ( TRIM(cn_isfpar_mlt) == 'oasis' .AND. TRIM(cn_isfcav_mlt) == 'oasis' ) CALL ctl_stop( 'cn_isfpar_mlt = oasis and cn_isfcav_mlt = oasis not coded' )
279         END IF
280         !
281         ! compatibility ice shelf and vvl
282         IF( .NOT. ln_vvl_zstar .AND. ln_isf ) CALL ctl_stop( 'Only vvl_zstar has been tested with ice shelf cavity' )
283         !
284      END IF
285   END SUBROUTINE isf_ctl
286   !
287   SUBROUTINE isf_nam
288      !!---------------------------------------------------------------------
289      !!                  ***  ROUTINE isf_nam  ***
290      !!
291      !! ** Purpose :   Read ice shelf namelist cfg and ref
292      !!
293      !!----------------------------------------------------------------------
294      INTEGER               :: ios                  ! Local integer output status for namelist read
295      !!----------------------------------------------------------------------
296      NAMELIST/namisf/ ln_isf        ,                                                           & 
297         &             cn_gammablk   , rn_gammat0    , rn_gammas0    , rn_htbl, sn_isfcav_fwf,   &
298         &             ln_isfcav_mlt , cn_isfcav_mlt , sn_isfcav_fwf ,                           &
299         &             ln_isfpar_mlt , cn_isfpar_mlt , sn_isfpar_fwf ,                           &
300         &             sn_isfpar_zmin, sn_isfpar_zmax, sn_isfpar_Leff,                           &
301         &             ln_isfcpl     , nn_drown      , ln_isfcpl_cons, ln_isfdebug,              &
302         &             cn_isfload    , rn_isfload_T  , rn_isfload_S  , cn_isfdir
303      !!----------------------------------------------------------------------
304      !
305      READ  ( numnam_ref, namisf, IOSTAT = ios, ERR = 901)
306901   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namisf in reference namelist' )
307      !
308      READ  ( numnam_cfg, namisf, IOSTAT = ios, ERR = 902 )
309902   IF( ios >  0 )   CALL ctl_nam ( ios , 'namisf in configuration namelist' )
310      IF(lwm) WRITE ( numond, namisf )
311
312   END SUBROUTINE isf_nam
313   !!
314   !!======================================================================
315END MODULE isfstp
Note: See TracBrowser for help on using the repository browser.