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

source: NEMO/trunk/src/OCE/ISF/isfcavmlt.F90 @ 14995

Last change on this file since 14995 was 14995, checked in by mathiot, 3 years ago

ticket #2669 : merge ticket2669_isf_fluxes into trunk

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