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/2019/ENHANCE-02_ISF_nemo/src/OCE/ISF – NEMO

source: NEMO/branches/2019/ENHANCE-02_ISF_nemo/src/OCE/ISF/isfstp.F90 @ 11987

Last change on this file since 11987 was 11987, checked in by mathiot, 4 years ago

ENHANCE-02_ISF_nemo: changes needed after Dave's review

  • Property svn:keywords set to Id
File size: 14.4 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, ONLY: ht_n, e3t_n, ln_isfcav, ln_linssh ! 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   !!----------------------------------------------------------------------
39   !! NEMO/OCE 4.0 , NEMO Consortium (2018)
40   !! $Id$
41   !! Software governed by the CeCILL license (see ./LICENSE)
42   !!----------------------------------------------------------------------
43CONTAINS
44 
45  SUBROUTINE isf_stp( kt )
46      !!---------------------------------------------------------------------
47      !!                  ***  ROUTINE isf_stp  ***
48      !!
49      !! ** Purpose : compute total heat flux and total fwf due to ice shelf melt
50      !!
51      !! ** Method  : For each case (parametrisation or explicity cavity) :
52      !!              - define the before fields
53      !!              - compute top boundary layer properties
54      !!                (in case of parametrisation, this is the
55      !!                 depth range model array used to compute mean far fields properties)
56      !!              - compute fluxes
57      !!              - write restart variables
58      !!
59      !!----------------------------------------------------------------------
60      INTEGER, INTENT(in) ::   kt   ! ocean time step
61      !!---------------------------------------------------------------------
62      !
63      IF( ln_timing )   CALL timing_start('isf')
64      !
65      !=======================================================================
66      ! 1.: compute melt and associated heat fluxes in the ice shelf cavities
67      !=======================================================================
68      !
69      IF ( ln_isfcav_mlt ) THEN
70         !
71         ! 1.1: before time step
72         IF ( kt /= nit000 ) THEN
73            risf_cav_tsc_b (:,:,:) = risf_cav_tsc (:,:,:)
74            fwfisf_cav_b(:,:)      = fwfisf_cav(:,:)
75         END IF
76         !
77         ! 1.2: compute misfkb, rhisf_tbl, rfrac (deepest level, thickness, fraction of deepest cell affected by tbl)
78         rhisf_tbl_cav(:,:) = rn_htbl * mskisf_cav(:,:)
79         CALL isf_tbl_lvl(ht_n, e3t_n, misfkt_cav, misfkb_cav, rhisf_tbl_cav, rfrac_tbl_cav)
80         !
81         ! 1.3: compute ice shelf melt
82         CALL isf_cav( kt, risf_cav_tsc, fwfisf_cav)
83         !
84      END IF
85      !
86      !=================================================================================
87      ! 2.: compute melt and associated heat fluxes for not resolved ice shelf cavities
88      !=================================================================================
89      !
90      IF ( ln_isfpar_mlt ) THEN
91         !
92         ! 2.1: before time step
93         IF ( kt /= nit000 ) THEN
94            risf_par_tsc_b(:,:,:) = risf_par_tsc(:,:,:)
95            fwfisf_par_b  (:,:)   = fwfisf_par  (:,:)
96         END IF
97         !
98         ! 2.2: compute misfkb, rhisf_tbl, rfrac (deepest level, thickness, fraction of deepest cell affected by tbl)
99         ! by simplicity, we assume the top level where param applied do not change with time (done in init part)
100         rhisf_tbl_par(:,:) = rhisf0_tbl_par(:,:)
101         CALL isf_tbl_lvl(ht_n, e3t_n, misfkt_par, misfkb_par, rhisf_tbl_par, rfrac_tbl_par)
102         !
103         ! 2.3: compute ice shelf melt
104         CALL isf_par( kt, risf_par_tsc, fwfisf_par)
105         !
106      END IF
107      !
108      !==================================================================================
109      ! 3.: output specific restart variable in case of coupling with an ice sheet model
110      !==================================================================================
111      !
112      IF ( ln_isfcpl .AND. lrst_oce ) CALL isfcpl_rst_write(kt)
113      !
114      IF( ln_timing )   CALL timing_stop('isf')
115      !
116   END SUBROUTINE isf_stp
117
118   SUBROUTINE isf_init
119      !!---------------------------------------------------------------------
120      !!                  ***  ROUTINE isfstp_init  ***
121      !!
122      !! ** Purpose :   Initialisation of the ice shelf public variables
123      !!
124      !! ** Method  :   Read the namisf namelist, check option compatibility and set derived parameters
125      !!
126      !! ** Action  : - read namisf parameters
127      !!              - allocate memory
128      !!              - output print
129      !!              - ckeck option compatibility
130      !!              - call cav/param/isfcpl init routine
131      !!----------------------------------------------------------------------
132      !
133      ! constrain: l_isfoasis need to be known
134      !
135      ! Read namelist
136      CALL isf_nam()
137      !
138      ! Allocate public array
139      CALL isf_alloc()
140      !
141      ! check option compatibility
142      CALL isf_ctl()
143      !
144      ! compute ice shelf load
145      IF ( ln_isfcav ) CALL isf_load( risfload )
146      !
147      ! terminate routine now if no ice shelf melt formulation specify
148      IF ( ln_isf ) THEN
149         !
150         !---------------------------------------------------------------------------------------------------------------------
151         ! initialisation melt in the cavity
152         IF ( ln_isfcav_mlt ) CALL isf_cav_init()
153         !
154         !---------------------------------------------------------------------------------------------------------------------
155         ! initialisation parametrised melt
156         IF ( ln_isfpar_mlt ) CALL isf_par_init()
157         !
158         !---------------------------------------------------------------------------------------------------------------------
159         ! initialisation ice sheet coupling
160         IF ( ln_isfcpl ) CALL isfcpl_init()
161         !
162      END IF
163         
164  END SUBROUTINE isf_init
165
166  SUBROUTINE isf_ctl()
167      !!---------------------------------------------------------------------
168      !!                  ***  ROUTINE isf_ctl  ***
169      !!
170      !! ** Purpose :   output print and option compatibility check
171      !!
172      !!----------------------------------------------------------------------
173      IF (lwp) THEN
174         WRITE(numout,*)
175         WRITE(numout,*) 'isf_init : ice shelf initialisation'
176         WRITE(numout,*) '~~~~~~~~~~~~'
177         WRITE(numout,*) '   Namelist namisf :'
178         !
179         WRITE(numout,*) '   ice shelf cavity (open or parametrised)  ln_isf = ', ln_isf
180         WRITE(numout,*)
181         !
182         IF ( ln_isf ) THEN
183            WRITE(numout,*) '      Add debug print in isf module           ln_isfdebug     = ', ln_isfdebug
184            WRITE(numout,*)
185            WRITE(numout,*) '      melt inside the cavity                  ln_isfcav_mlt   = ', ln_isfcav_mlt
186            IF ( ln_isfcav_mlt) THEN
187               WRITE(numout,*) '         melt formulation                         cn_isfcav_mlt= ', TRIM(cn_isfcav_mlt)
188               WRITE(numout,*) '         thickness of the top boundary layer      rn_htbl      = ', rn_htbl
189               WRITE(numout,*) '         gamma formulation                        cn_gammablk  = ', TRIM(cn_gammablk) 
190               IF ( TRIM(cn_gammablk) .NE. 'spe' ) THEN
191                  WRITE(numout,*) '         gammat coefficient                       rn_gammat0   = ', rn_gammat0 
192                  WRITE(numout,*) '         gammas coefficient                       rn_gammas0   = ', rn_gammas0 
193                  WRITE(numout,*) '         top background ke used (from namdrg_top) rn_ke0       = ', r_ke0_top
194                  WRITE(numout,*) '         top drag coef.    used (from namdrg_top) rn_Cd0       = ', r_Cdmin_top
195               END IF
196            END IF
197            WRITE(numout,*) ''
198            !
199            WRITE(numout,*) '      ice shelf melt parametrisation          ln_isfpar_mlt   = ', ln_isfpar_mlt
200            IF ( ln_isfpar_mlt ) THEN
201               WRITE(numout,*) '         isf parametrisation formulation         cn_isfpar_mlt   = ', TRIM(cn_isfpar_mlt)
202            END IF
203            WRITE(numout,*) ''
204            !
205            WRITE(numout,*) '      Coupling to an ice sheet model          ln_isfcpl       = ', ln_isfcpl
206            IF ( ln_isfcpl ) THEN
207               WRITE(numout,*) '         conservation activated ln_isfcpl_cons     = ', ln_isfcpl_cons
208               WRITE(numout,*) '         number of call of the extrapolation loop  = ', nn_drown
209            ENDIF
210            WRITE(numout,*) ''
211            !
212         ELSE
213            !
214            IF ( ln_isfcav ) THEN
215               WRITE(numout,*) ''
216               WRITE(numout,*) '   W A R N I N G: ice shelf cavities are open BUT no melt will be computed or read from file !'
217               WRITE(numout,*) ''
218            END IF
219            !
220         END IF
221
222         IF (ln_isfcav) WRITE(numout,*) '      Ice shelf load method                   cn_isfload        = ', TRIM(cn_isfload)
223         WRITE(numout,*) ''
224         FLUSH(numout)
225
226      END IF
227      !
228
229      !---------------------------------------------------------------------------------------------------------------------
230      ! sanity check  ! issue ln_isfcav not yet known as well as l_isfoasis  => move this call in isf_stp ?
231      ! melt in the cavity without cavity
232      IF ( ln_isfcav_mlt .AND. (.NOT. ln_isfcav) ) &
233          &   CALL ctl_stop('ice shelf melt in the cavity activated (ln_isfcav_mlt) but no cavity detected in domcfg (ln_isfcav), STOP' )
234      !
235      ! ice sheet coupling without cavity
236      IF ( ln_isfcpl .AND. (.NOT. ln_isfcav) ) &
237         &   CALL ctl_stop('coupling with an ice sheet model detected (ln_isfcpl) but no cavity detected in domcfg (ln_isfcav), STOP' )
238      !
239      IF ( ln_isfcpl .AND. ln_isfcpl_cons .AND. ln_linssh ) &
240         &   CALL ctl_stop( 'The coupling between NEMO and an ice sheet model with the conservation option does not work with the linssh option' )
241      !
242      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' )
243      !
244      IF ( l_isfoasis .AND. ln_isf ) THEN
245         !
246         CALL ctl_stop( ' ln_ctl and ice shelf not tested' )
247         !
248         ! NEMO coupled to ATMO model with isf cavity need oasis method for melt computation
249         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' )
250         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' )
251         !
252         ! oasis melt computation not tested (coded but not tested)
253         IF ( ln_isfcav_mlt .OR. ln_isfpar_mlt ) THEN
254            IF ( TRIM(cn_isfcav_mlt) == 'oasis' ) CALL ctl_stop( 'cn_isfcav_mlt = oasis not tested' )
255            IF ( TRIM(cn_isfpar_mlt) == 'oasis' ) CALL ctl_stop( 'cn_isfpar_mlt = oasis not tested' )
256         END IF
257         !
258         ! oasis melt computation with cavity open and cavity parametrised (not coded)
259         IF ( ln_isfcav_mlt .AND. ln_isfpar_mlt ) THEN
260            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' )
261         END IF
262         !
263         ! compatibility ice shelf and vvl
264         IF( .NOT. ln_vvl_zstar .AND. ln_isf ) CALL ctl_stop( 'Only vvl_zstar has been tested with ice shelf cavity' )
265         !
266      END IF
267   END SUBROUTINE isf_ctl
268   !
269   SUBROUTINE isf_nam
270      !!---------------------------------------------------------------------
271      !!                  ***  ROUTINE isf_nam  ***
272      !!
273      !! ** Purpose :   Read ice shelf namelist cfg and ref
274      !!
275      !!----------------------------------------------------------------------
276      INTEGER               :: ios                  ! Local integer output status for namelist read
277      !!----------------------------------------------------------------------
278      NAMELIST/namisf/ ln_isf       ,                                                                               & 
279         &             ln_isfcav_mlt, cn_isfcav_mlt, cn_gammablk, rn_gammat0, rn_gammas0, rn_htbl, sn_isfcav_fwf,   &
280         &             ln_isfpar_mlt, cn_isfpar_mlt, sn_isfpar_fwf, sn_isfpar_zmin, sn_isfpar_zmax, sn_isfpar_Leff, &
281         &             ln_isfcpl    , nn_drown, ln_isfcpl_cons, ln_isfdebug,                                        &
282         &             cn_isfload   , cn_isfdir
283      !!----------------------------------------------------------------------
284      !
285      REWIND( numnam_ref )              ! Namelist namsbc_rnf in reference namelist : Runoffs
286      READ  ( numnam_ref, namisf, IOSTAT = ios, ERR = 901)
287901   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namisf in reference namelist', lwp )
288      !
289      REWIND( numnam_cfg )              ! Namelist namsbc_rnf in configuration namelist : Runoffs
290      READ  ( numnam_cfg, namisf, IOSTAT = ios, ERR = 902 )
291902   IF( ios >  0 )   CALL ctl_nam ( ios , 'namisf in configuration namelist', lwp )
292      IF(lwm) WRITE ( numond, namisf )
293
294   END SUBROUTINE isf_nam
295   !!
296   !!======================================================================
297END MODULE isfstp
Note: See TracBrowser for help on using the repository browser.