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.
isfcavmlt.F90 in NEMO/branches/2019/ENHANCE-02_ISF_nemo/src/OCE/ISF – NEMO

source: NEMO/branches/2019/ENHANCE-02_ISF_nemo/src/OCE/ISF/isfcavmlt.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

File size: 16.8 KB
RevLine 
[11395]1MODULE isfcavmlt
2   !!======================================================================
[11541]3   !!                       ***  MODULE  isfcavmlt  ***
[11395]4   !! ice shelf module :  update surface ocean boundary condition under ice
5   !!                   shelf
6   !!======================================================================
7   !! History :  4.0  !  2019-09  (P. Mathiot) Original code
8   !!----------------------------------------------------------------------
9
10   !!----------------------------------------------------------------------
[11541]11   !!   isfcav_mlt    : update surface ocean boundary condition under ice shelf
[11395]12   !!----------------------------------------------------------------------
13
[11852]14   USE isf                      ! ice shelf
15   USE isftbl , ONLY: isf_tbl   ! ice shelf depth average
16   USE isfutils,ONLY: debug     ! debug subroutine
17
18   USE dom_oce                            ! ocean space and time domain
19   USE oce    , ONLY: tsn                 ! ocean dynamics and tracers
20   USE phycst , ONLY: rcp, rau0, rau0_rcp ! physical constants
21   USE eosbn2 , ONLY: eos_fzp             ! equation of state
22
23   USE in_out_manager              ! I/O manager
24   USE iom        , ONLY: iom_put  ! I/O library
25   USE fldread    , ONLY: fld_read !
26   USE lib_fortran, ONLY: glob_sum !
27   USE lib_mpp    , ONLY: ctl_stop !
28
[11395]29   IMPLICIT NONE
30   PRIVATE
31
32   PUBLIC   isfcav_mlt
33
34   !!----------------------------------------------------------------------
35   !! NEMO/OCE 4.0 , NEMO Consortium (2018)
36   !! $Id: sbcisf.F90 10536 2019-01-16 19:21:09Z mathiot $
37   !! Software governed by the CeCILL license (see ./LICENSE)
38   !!----------------------------------------------------------------------
39CONTAINS
40
41! -------------------------------------------------------------------------------------------------------
42! -------------------------------- PUBLIC SUBROUTINE ----------------------------------------------------
43! -------------------------------------------------------------------------------------------------------
44
[11403]45   SUBROUTINE isfcav_mlt(kt, pgt, pgs , pttbl, pstbl, &
46      &                           pqhc, pqoce, pqfwf  )
[11395]47      !!----------------------------------------------------------------------
48      !!
[11541]49      !!                          ***  ROUTINE isfcav_mlt  ***
50      !!
[11494]51      !! ** Purpose    : compute or read ice shelf fwf/heat fluxes in the ice shelf cavity
[11403]52      !!
[11395]53      !!---------------------------------------------------------------------
54      !!-------------------------- OUT -------------------------------------
[11403]55      REAL(wp), DIMENSION(jpi,jpj), INTENT(  out) :: pqhc, pqoce, pqfwf  ! heat and fwf fluxes
[11395]56      !!-------------------------- IN  -------------------------------------
57      INTEGER, INTENT(in) :: kt
58      REAL(wp), DIMENSION(jpi,jpj), INTENT(in   ) :: pgt  , pgs    ! gamma t and gamma s
59      REAL(wp), DIMENSION(jpi,jpj), INTENT(in   ) :: pttbl, pstbl  ! top boundary layer tracer
60      !!---------------------------------------------------------------------
61      !!---------------------------------------------------------------------
62      !
63      ! compute latent heat and melt (2d)
64      SELECT CASE ( cn_isfcav_mlt )
65      CASE ( 'spe' )   ! ice shelf melt specified (read input file, and heat fluxes derived from
[11425]66         CALL isfcav_mlt_spe( kt, pstbl,               &
[11403]67            &                  pqhc, pqoce, pqfwf  )
[11395]68      CASE ( '2eq' )   !  ISOMIP  formulation (2 equations) for volume flux (Hunter et al., 2006)
[11425]69         CALL isfcav_mlt_2eq( pgt, pttbl, pstbl,       &
[11403]70            &                  pqhc , pqoce, pqfwf )
[11395]71      CASE ( '3eq' )   ! ISOMIP+ formulation (3 equations) for volume flux (Asay-Davis et al., 2015)
[11425]72         CALL isfcav_mlt_3eq( pgt, pgs , pttbl, pstbl, &
[11403]73            &                  pqhc, pqoce, pqfwf  )
[11395]74      CASE ( 'oasis' ) ! fwf pass trough oasis
[11425]75         CALL isfcav_mlt_oasis( kt, pstbl,              &
[11403]76            &                   pqhc, pqoce, pqfwf  )
[11395]77      CASE DEFAULT
78         CALL ctl_stop('STOP', 'unknown isf melt formulation : cn_isfcav (should not see this)')
79      END SELECT
80      !
[11844]81      IF (ln_isfdebug) THEN
82         CALL debug( 'isfcav_mlt:', pqhc (:,:) )
83         CALL debug( 'isfcav_mlt:', pqoce(:,:) )
84         CALL debug( 'isfcav_mlt:', pqfwf(:,:) )
85      END IF
86      !
[11395]87   END SUBROUTINE isfcav_mlt
88
89! -------------------------------------------------------------------------------------------------------
90! -------------------------------- PRIVATE SUBROUTINE ---------------------------------------------------
91! -------------------------------------------------------------------------------------------------------
92
[11541]93   SUBROUTINE isfcav_mlt_spe(kt, pstbl,          &  ! <<== in
[11403]94      &                      pqhc , pqoce, pqfwf )  ! ==>> out
[11395]95      !!----------------------------------------------------------------------
[11541]96      !!
97      !!                          ***  ROUTINE isfcav_mlt_spe  ***
98      !!
[11403]99      !! ** Purpose    : - read ice shelf melt from forcing file
100      !!                 - compute ocea-ice heat flux (assuming it is equal to latent heat)
101      !!                 - compute heat content flux
[11395]102      !!---------------------------------------------------------------------
103      !!-------------------------- OUT -------------------------------------
[11403]104      REAL(wp), DIMENSION(jpi,jpj), INTENT(  out) :: pqhc, pqoce, pqfwf  ! heat content, latent heat and fwf fluxes
[11395]105      !!-------------------------- IN  -------------------------------------
[11403]106      INTEGER                     , INTENT(in   ) :: kt                  ! current time step
107      REAL(wp), DIMENSION(jpi,jpj), INTENT(in   ) :: pstbl               ! salinity in tbl
[11395]108      !!--------------------------------------------------------------------
[11403]109      REAL(wp), DIMENSION(jpi,jpj) :: ztfrz                              ! tbl freezing temperature
[11395]110      !!--------------------------------------------------------------------
111      !
112      ! Calculate freezing temperature
113      CALL eos_fzp( pstbl(:,:), ztfrz(:,:), risfdep(:,:) )
114      !
115      ! read input file
[11852]116      CALL fld_read ( kt, 1, sf_isfcav_fwf )
[11395]117      !
118      ! define fwf and qoce
119      ! ocean heat flux is assume to be equal to the latent heat
[11403]120      pqfwf(:,:) = - sf_isfcav_fwf(1)%fnow(:,:,1)      ! fwf                ( >0 out)
121      pqoce(:,:) = - pqfwf(:,:) * rLfusisf             ! ocean heat flux    ( >0 out)
122      pqhc (:,:) =   pqfwf(:,:) * ztfrz(:,:) * rcp     ! heat content flux  ( >0 out)
[11395]123      !
[11425]124   END SUBROUTINE isfcav_mlt_spe
[11395]125
[11541]126   SUBROUTINE isfcav_mlt_2eq(pgt , pttbl, pstbl, &  ! <<== in
127      &                      pqhc, pqoce, pqfwf  )  ! ==>> out
[11395]128      !!----------------------------------------------------------------------
[11541]129      !!
130      !!                          ***  ROUTINE isfcav_mlt_spe  ***
131      !!
[11403]132      !! ** Purpose    : Compute ice shelf fwf/heqt fluxes using ISOMIP formulation (Hunter et al., 2006)
[11395]133      !!
[11403]134      !! ** Method     : The ice shelf melt latent heat is defined as being equal to the ocean/ice heat flux.
135      !!                 From this we can derived the fwf, ocean/ice heat flux and the heat content flux as being :
136      !!                   qfwf  = Gammat * Rau0 * Cp * ( Tw - Tfrz ) / Lf
137      !!                   qhoce = qlat
138      !!                   qhc   = qfwf * Cp * Tfrz
139      !!
140      !! ** Reference  : Hunter,  J.  R.:  Specification  for  test  models  of  ice  shelf  cavities, 
141      !!                 Tech.  Rep.  June,  Antarctic  Climate  &  Ecosystems  Cooperative  Research  Centre,  available  at: 
142      !!                 http://staff.acecrc.org.au/~bkgalton/ISOMIP/test_cavities.pdf (last access: 21 July 2016), 2006.
[11395]143      !!---------------------------------------------------------------------
144      !!-------------------------- OUT -------------------------------------
[11403]145      REAL(wp), DIMENSION(jpi,jpj), INTENT(  out) :: pqhc, pqoce, pqfwf  ! hean content, ocean-ice heat and fwf fluxes
[11395]146      !!-------------------------- IN  -------------------------------------
147      REAL(wp), DIMENSION(jpi,jpj), INTENT(in   ) :: pgt           ! temperature exchange coeficient
148      REAL(wp), DIMENSION(jpi,jpj), INTENT(in   ) :: pttbl, pstbl  ! temperature and salinity in top boundary layer
149      !!--------------------------------------------------------------------
150      REAL(wp), DIMENSION(jpi,jpj) :: ztfrz         ! freezing temperature
[11403]151      REAL(wp), DIMENSION(jpi,jpj) :: zthd          ! thermal driving
[11395]152      !!--------------------------------------------------------------------
153      !
154      ! Calculate freezing temperature
155      CALL eos_fzp( pstbl(:,:), ztfrz(:,:), risfdep(:,:) )
156      !
[11403]157      ! thermal driving
[11488]158      zthd (:,:) = ( pttbl(:,:) - ztfrz(:,:) ) * mskisf_cav(:,:)
[11403]159      !
[11395]160      ! compute ocean-ice heat flux and then derive fwf assuming that ocean heat flux equal latent heat
[11541]161      pqfwf(:,:) = - pgt(:,:) * rau0_rcp * zthd(:,:) / rLfusisf    ! fresh water flux  ( > 0 out )
[11403]162      pqoce(:,:) = - pqfwf(:,:) * rLfusisf                         ! ocea-ice flux     ( > 0 out )
163      pqhc (:,:) =   pqfwf(:,:) * ztfrz(:,:) * rcp                 ! heat content flux ( > 0 out )
[11395]164      !
165      ! output thermal driving
[11403]166      CALL iom_put('isfthermald_cav', zthd )
[11395]167      !
[11425]168   END SUBROUTINE isfcav_mlt_2eq
[11395]169
[11541]170   SUBROUTINE isfcav_mlt_3eq(pgt, pgs , pttbl, pstbl, &  ! <<== in
171      &                           pqhc, pqoce, pqfwf  )  ! ==>> out
[11395]172      !!----------------------------------------------------------------------
[11541]173      !!
174      !!                          ***  ROUTINE isfcav_mlt_3eq  ***
175      !!
[11403]176      !! ** Purpose    : Compute ice shelf fwf/heqt fluxes using the 3 equation formulation
[11395]177      !!
[11403]178      !! ** Method     : The melt rate is determined considering the heat balance, the salt balance
179      !!                 at the phase change interface and a linearisation of the equation of state.
180      !!
181      !! ** Reference  : - Holland, D. M. and Jenkins, A.,
182      !!                   Modeling Thermodynamic Ice-Ocean Interactions at the Base of an Ice Shelf,
183      !!                   J. Phys. Oceanogr., 29, 1999.
184      !!                 - Asay-Davis, X. S., Cornford, S. L., Durand, G., Galton-Fenzi, B. K., Gladstone,
185      !!                   R. M., Gudmundsson, G. H., Hattermann, T., Holland, D. M., Holland, D., Holland,
186      !!                   P. R., Martin, D. F., Mathiot, P., Pattyn, F., and Seroussi, H.:
187      !!                   Experimental design for three interrelated marine ice sheet and ocean model intercomparison projects:
188      !!                   MISMIP v. 3 (MISMIP +), ISOMIP v. 2 (ISOMIP +) and MISOMIP v. 1 (MISOMIP1),
189      !!                   Geosci. Model Dev., 9, 2471-2497, https://doi.org/10.5194/gmd-9-2471-2016, 2016.
[11395]190      !!---------------------------------------------------------------------
191      !!-------------------------- OUT -------------------------------------
[11403]192      REAL(wp), DIMENSION(jpi,jpj), INTENT(  out) :: pqhc, pqoce, pqfwf  ! latent heat and fwf fluxes
[11395]193      !!-------------------------- IN  -------------------------------------
[11403]194      REAL(wp), DIMENSION(jpi,jpj), INTENT(in   ) :: pgt  , pgs          ! heat/salt exchange coeficient
195      REAL(wp), DIMENSION(jpi,jpj), INTENT(in   ) :: pttbl, pstbl        ! mean temperature and salinity in top boundary layer
[11395]196      !!--------------------------------------------------------------------
[11403]197      REAL(wp) :: zeps1,zeps2,zeps3,zeps4,zeps6,zeps7       ! dummy local scalar for quadratic equation resolution
198      REAL(wp) :: zaqe,zbqe,zcqe,zaqer,zdis,zsfrz,zcfac     ! dummy local scalar for quadratic equation resolution
[11395]199      REAL(wp) :: zeps = 1.e-20
[11403]200      REAL(wp), DIMENSION(jpi,jpj) :: ztfrz         ! freezing point
201      REAL(wp), DIMENSION(jpi,jpj) :: zqcon         ! conductive flux through the ice shelf
202      REAL(wp), DIMENSION(jpi,jpj) :: zthd          ! thermal driving
[11395]203      !
204      INTEGER  ::   ji, jj     ! dummy loop indices
205      !!--------------------------------------------------------------------
206      !
207      ! compute upward heat flux zhtflx and upward water flux zwflx
[11403]208      ! Resolution of a 3d equation from equation 24, 25 and 26 (note conduction through the ice has been added to Eq 24)
[11395]209      DO jj = 1, jpj
210         DO ji = 1, jpi
211            !
212            ! compute coeficient to solve the 2nd order equation
[11494]213            zeps1 = rau0_rcp * pgt(ji,jj)
214            zeps2 = rLfusisf * rau0 * pgs(ji,jj)
215            zeps3 = rhoisf * rcpisf * rkappa / MAX(risfdep(ji,jj),zeps)
216            zeps4 = risf_lamb2 + risf_lamb3 * risfdep(ji,jj)
217            zeps6 = zeps4 - pttbl(ji,jj)
218            zeps7 = zeps4 - rtsurf
[11395]219            !
220            ! solve the 2nd order equation to find zsfrz
221            zaqe  = risf_lamb1 * (zeps1 + zeps3)
[11494]222            zaqer = 0.5_wp / MIN(zaqe,-zeps)
223            zbqe  = zeps1 * zeps6 + zeps3 * zeps7 - zeps2
224            zcqe  = zeps2 * pstbl(ji,jj)
225            zdis  = zbqe * zbqe - 4.0_wp * zaqe * zcqe               
[11395]226            !
227            ! Presumably zdis can never be negative because gammas is very small compared to gammat
[11494]228            zsfrz=(-zbqe - SQRT(zdis)) * zaqer
229            IF ( zsfrz < 0.0_wp ) zsfrz=(-zbqe + SQRT(zdis)) * zaqer  ! check this if this if is needed
[11395]230            !
231            ! compute t freeze (eq. 25)
232            ztfrz(ji,jj) = zeps4 + risf_lamb1 * zsfrz
233            !
[11403]234            ! thermal driving
[11488]235            zthd(ji,jj) = ( pttbl(ji,jj) - ztfrz(ji,jj) )
[11403]236            !
[11395]237            ! compute the upward water and heat flux (eq. 24 and eq. 26)
[11403]238            pqfwf(ji,jj) = rau0     * pgs(ji,jj) * ( zsfrz - pstbl(ji,jj) ) / MAX(zsfrz,zeps) ! fresh water flux    (> 0 out)
239            pqoce(ji,jj) = rau0_rcp * pgt(ji,jj) * zthd (ji,jj)                               ! ocean-ice heat flux (> 0 out)
240            pqhc (ji,jj) = rcp      * pqfwf(ji,jj) * ztfrz(ji,jj)                             ! heat content   flux (> 0 out)
[11395]241            !
[11488]242            zqcon(ji,jj) = zeps3 * ( ztfrz(ji,jj) - rtsurf )
[11403]243            !
[11395]244         END DO
245      END DO
246      !
247      ! output conductive heat flux through the ice
[11488]248      CALL iom_put('qconisf', zqcon(:,:) * mskisf_cav(:,:) )
[11395]249      !
250      ! output thermal driving
[11488]251      CALL iom_put('isfthermald_cav', zthd(:,:) * mskisf_cav(:,:) )
[11395]252      !
[11425]253   END SUBROUTINE isfcav_mlt_3eq
[11395]254
[11541]255   SUBROUTINE isfcav_mlt_oasis(kt, pstbl,          &  ! <<== in
[11403]256      &                        pqhc , pqoce, pqfwf )  ! ==>> out
257      !!----------------------------------------------------------------------
[11541]258      !!                          ***  ROUTINE isfcav_mlt_oasis  ***
[11403]259      !!
260      !! ** Purpose    : scale the fwf read from input file by the total amount received by the sbccpl interface
261      !!
262      !! ** Purpose    : - read ice shelf melt from forcing file => pattern
263      !!                 - total amount of fwf is given by sbccpl (fwfisf_cpl)
264      !!                 - scale fwf and compute heat fluxes
265      !!
266      !!---------------------------------------------------------------------
267      !!-------------------------- OUT -------------------------------------
268      REAL(wp), DIMENSION(jpi,jpj), INTENT(  out) :: pqhc, pqoce, pqfwf  ! heat content, latent heat and fwf fluxes
269      !!-------------------------- IN  -------------------------------------
270      INTEGER                     , INTENT(in   ) :: kt                  ! current time step
271      REAL(wp), DIMENSION(jpi,jpj), INTENT(in   ) :: pstbl               ! salinity in tbl
272      !!--------------------------------------------------------------------
[11423]273      REAL(wp)                     :: zfwf_fld, zfwf_oasis               ! total fwf in the forcing fields (pattern) and from the oasis interface (amount)
[11403]274      REAL(wp), DIMENSION(jpi,jpj) :: ztfrz                              ! tbl freezing temperature
275      REAL(wp), DIMENSION(jpi,jpj) :: zfwf                               ! 2d fwf map after scaling
276      !!--------------------------------------------------------------------
277      !
278      ! Calculate freezing temperature
279      CALL eos_fzp( pstbl(:,:), ztfrz(:,:), risfdep(:,:) )
280      !
281      ! read input file
[11852]282      CALL fld_read ( kt, 1, sf_isfcav_fwf )
[11403]283      !
284      ! ice shelf 2d map
285      zfwf(:,:) = - sf_isfcav_fwf(1)%fnow(:,:,1)
286      !
287      ! compute glob sum from input file
[11425]288      ! (PM) should consider delay sum as in fwb (1 time step offset if I well understood)
289      zfwf_fld = glob_sum('isfcav_mlt', e1e2t(:,:) * zfwf(:,:))
[11403]290      !
291      ! compute glob sum from atm->oce ice shelf fwf
[11425]292      ! (PM) should consider delay sum as in fwb (1 time step offset if I well understood)
293      zfwf_oasis = glob_sum('isfcav_mlt', e1e2t(:,:) * fwfisf_oasis(:,:))
[11403]294      !
295      ! scale fwf
[11423]296      zfwf(:,:) = zfwf(:,:) * zfwf_oasis / zfwf_fld
[11403]297      !
298      ! define fwf and qoce
299      ! ocean heat flux is assume to be equal to the latent heat
300      pqfwf(:,:) =   zfwf(:,:)                         ! fwf                ( >0 out)
301      pqoce(:,:) = - pqfwf(:,:) * rLfusisf             ! ocean heat flux    ( >0 out)
302      pqhc (:,:) =   pqfwf(:,:) * ztfrz(:,:) * rcp     ! heat content flux  ( >0 out)
303      !
[11425]304   END SUBROUTINE isfcav_mlt_oasis
[11403]305
[11395]306END MODULE isfcavmlt
Note: See TracBrowser for help on using the repository browser.