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 @ 11852

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

ENHANCE-02_ISF_nemo: fix WED025 restartability, finish removing useless USE, remove useless lbc_lnk

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