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

source: NEMO/branches/2019/dev_r11943_MERGE_2019/src/OCE/ISF/isfstp.F90 @ 12150

Last change on this file since 12150 was 12150, checked in by davestorkey, 4 years ago

2019/dev_r11943_MERGE_2019: Merge in UKMO_MERGE_2019.

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