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

source: NEMO/branches/2019/UKMO_MERGE_2019/src/OCE/ISF/isfcavmlt.F90 @ 12068

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

2019/UKMO_MERGE_2019 : Merging in changes from ENHANCE-02_ISF_nemo.

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