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/trunk/src/OCE/ISF – NEMO

source: NEMO/trunk/src/OCE/ISF/isfstp.F90 @ 13546

Last change on this file since 13546 was 13237, checked in by smasson, 4 years ago

trunk: Mid-year merge, merge back KERNEL-06_techene_e3

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