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 @ 15055

Last change on this file since 15055 was 15053, checked in by clem, 3 years ago

nn_hls=2: solve a number of floating points because some arrays are not defined on the first halo. Looks like this is not the end.

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