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

Last change on this file since 11876 was 11876, checked in by mathiot, 4 years ago

ENHANCE-02_ISF_nemo: add timing in the main isf routine + various bug fixes + cosmetic changes

File size: 17.2 KB
Line 
1MODULE isfcavmlt
2   !!======================================================================
3   !!                       ***  MODULE  isfcavmlt  ***
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   !!----------------------------------------------------------------------
11   !!   isfcav_mlt    : update surface ocean boundary condition under ice shelf
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 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
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
45   SUBROUTINE isfcav_mlt(kt, pgt, pgs , pttbl, pstbl, &
46      &                           pqhc, pqoce, pqfwf  )
47      !!----------------------------------------------------------------------
48      !!
49      !!                          ***  ROUTINE isfcav_mlt  ***
50      !!
51      !! ** Purpose    : compute or read ice shelf fwf/heat fluxes in the ice shelf cavity
52      !!
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      !
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         CALL debug( 'isfcav_mlt:', pqhc (:,:) )
83         CALL debug( 'isfcav_mlt:', pqoce(:,:) )
84         CALL debug( 'isfcav_mlt:', pqfwf(:,:) )
85      END IF
86      !
87   END SUBROUTINE isfcav_mlt
88
89! -------------------------------------------------------------------------------------------------------
90! -------------------------------- PRIVATE SUBROUTINE ---------------------------------------------------
91! -------------------------------------------------------------------------------------------------------
92
93   SUBROUTINE isfcav_mlt_spe(kt, pstbl,          &  ! <<== in
94      &                      pqhc , pqoce, pqfwf )  ! ==>> out
95      !!----------------------------------------------------------------------
96      !!
97      !!                          ***  ROUTINE isfcav_mlt_spe  ***
98      !!
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
102      !!---------------------------------------------------------------------
103      !!-------------------------- OUT -------------------------------------
104      REAL(wp), DIMENSION(jpi,jpj), INTENT(  out) :: pqhc, pqoce, pqfwf  ! heat content, latent heat and fwf fluxes
105      !!-------------------------- IN  -------------------------------------
106      INTEGER                     , INTENT(in   ) :: kt                  ! current time step
107      REAL(wp), DIMENSION(jpi,jpj), INTENT(in   ) :: pstbl               ! salinity in tbl
108      !!--------------------------------------------------------------------
109      REAL(wp), DIMENSION(jpi,jpj) :: ztfrz                              ! tbl freezing temperature
110      !!--------------------------------------------------------------------
111      !
112      ! Calculate freezing temperature
113      CALL eos_fzp( pstbl(:,:), ztfrz(:,:), risfdep(:,:) )
114      !
115      ! read input file
116      CALL fld_read ( kt, 1, sf_isfcav_fwf )
117      !
118      ! define fwf and qoce
119      ! ocean heat flux is assume to be equal to the latent heat
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)
123      !
124      ! output freezing point at the interface
125      CALL iom_put('isftfrz_cav', ztfrz )
126      !
127   END SUBROUTINE isfcav_mlt_spe
128
129   SUBROUTINE isfcav_mlt_2eq(pgt , pttbl, pstbl, &  ! <<== in
130      &                      pqhc, pqoce, pqfwf  )  ! ==>> out
131      !!----------------------------------------------------------------------
132      !!
133      !!                          ***  ROUTINE isfcav_mlt_spe  ***
134      !!
135      !! ** Purpose    : Compute ice shelf fwf/heqt fluxes using ISOMIP formulation (Hunter et al., 2006)
136      !!
137      !! ** Method     : The ice shelf melt latent heat is defined as being equal to the ocean/ice heat flux.
138      !!                 From this we can derived the fwf, ocean/ice heat flux and the heat content flux as being :
139      !!                   qfwf  = Gammat * Rau0 * Cp * ( Tw - Tfrz ) / Lf
140      !!                   qhoce = qlat
141      !!                   qhc   = qfwf * Cp * Tfrz
142      !!
143      !! ** Reference  : Hunter,  J.  R.:  Specification  for  test  models  of  ice  shelf  cavities, 
144      !!                 Tech.  Rep.  June,  Antarctic  Climate  &  Ecosystems  Cooperative  Research  Centre,  available  at: 
145      !!                 http://staff.acecrc.org.au/~bkgalton/ISOMIP/test_cavities.pdf (last access: 21 July 2016), 2006.
146      !!---------------------------------------------------------------------
147      !!-------------------------- OUT -------------------------------------
148      REAL(wp), DIMENSION(jpi,jpj), INTENT(  out) :: pqhc, pqoce, pqfwf  ! hean content, ocean-ice heat and fwf fluxes
149      !!-------------------------- IN  -------------------------------------
150      REAL(wp), DIMENSION(jpi,jpj), INTENT(in   ) :: pgt           ! temperature exchange coeficient
151      REAL(wp), DIMENSION(jpi,jpj), INTENT(in   ) :: pttbl, pstbl  ! temperature and salinity in top boundary layer
152      !!--------------------------------------------------------------------
153      REAL(wp), DIMENSION(jpi,jpj) :: ztfrz         ! freezing temperature
154      REAL(wp), DIMENSION(jpi,jpj) :: zthd          ! thermal driving
155      !!--------------------------------------------------------------------
156      !
157      ! Calculate freezing temperature
158      CALL eos_fzp( pstbl(:,:), ztfrz(:,:), risfdep(:,:) )
159      !
160      ! thermal driving
161      zthd (:,:) = ( pttbl(:,:) - ztfrz(:,:) ) * mskisf_cav(:,:)
162      !
163      ! compute ocean-ice heat flux and then derive fwf assuming that ocean heat flux equal latent heat
164      pqfwf(:,:) = - pgt(:,:) * rau0_rcp * zthd(:,:) / rLfusisf    ! fresh water flux  ( > 0 out )
165      pqoce(:,:) = - pqfwf(:,:) * rLfusisf                         ! ocea-ice flux     ( > 0 out )
166      pqhc (:,:) =   pqfwf(:,:) * ztfrz(:,:) * rcp                 ! heat content flux ( > 0 out )
167      !
168      ! output thermal driving and freezinpoint at the ice shelf interface
169      CALL iom_put('isfthermald_cav', zthd )
170      CALL iom_put('isftfrz_cav'    , ztfrz )
171      !
172   END SUBROUTINE isfcav_mlt_2eq
173
174   SUBROUTINE isfcav_mlt_3eq(pgt, pgs , pttbl, pstbl, &  ! <<== in
175      &                           pqhc, pqoce, pqfwf  )  ! ==>> out
176      !!----------------------------------------------------------------------
177      !!
178      !!                          ***  ROUTINE isfcav_mlt_3eq  ***
179      !!
180      !! ** Purpose    : Compute ice shelf fwf/heqt fluxes using the 3 equation formulation
181      !!
182      !! ** Method     : The melt rate is determined considering the heat balance, the salt balance
183      !!                 at the phase change interface and a linearisation of the equation of state.
184      !!
185      !! ** Reference  : - Holland, D. M. and Jenkins, A.,
186      !!                   Modeling Thermodynamic Ice-Ocean Interactions at the Base of an Ice Shelf,
187      !!                   J. Phys. Oceanogr., 29, 1999.
188      !!                 - Asay-Davis, X. S., Cornford, S. L., Durand, G., Galton-Fenzi, B. K., Gladstone,
189      !!                   R. M., Gudmundsson, G. H., Hattermann, T., Holland, D. M., Holland, D., Holland,
190      !!                   P. R., Martin, D. F., Mathiot, P., Pattyn, F., and Seroussi, H.:
191      !!                   Experimental design for three interrelated marine ice sheet and ocean model intercomparison projects:
192      !!                   MISMIP v. 3 (MISMIP +), ISOMIP v. 2 (ISOMIP +) and MISOMIP v. 1 (MISOMIP1),
193      !!                   Geosci. Model Dev., 9, 2471-2497, https://doi.org/10.5194/gmd-9-2471-2016, 2016.
194      !!---------------------------------------------------------------------
195      !!-------------------------- OUT -------------------------------------
196      REAL(wp), DIMENSION(jpi,jpj), INTENT(  out) :: pqhc, pqoce, pqfwf  ! latent heat and fwf fluxes
197      !!-------------------------- IN  -------------------------------------
198      REAL(wp), DIMENSION(jpi,jpj), INTENT(in   ) :: pgt  , pgs          ! heat/salt exchange coeficient
199      REAL(wp), DIMENSION(jpi,jpj), INTENT(in   ) :: pttbl, pstbl        ! mean temperature and salinity in top boundary layer
200      !!--------------------------------------------------------------------
201      REAL(wp) :: zeps1,zeps2,zeps3,zeps4,zeps6,zeps7       ! dummy local scalar for quadratic equation resolution
202      REAL(wp) :: zaqe,zbqe,zcqe,zaqer,zdis,zsfrz,zcfac     ! dummy local scalar for quadratic equation resolution
203      REAL(wp) :: zeps = 1.e-20
204      REAL(wp), DIMENSION(jpi,jpj) :: ztfrz         ! freezing point
205      REAL(wp), DIMENSION(jpi,jpj) :: zqcon         ! conductive flux through the ice shelf
206      REAL(wp), DIMENSION(jpi,jpj) :: zthd          ! thermal driving
207      !
208      INTEGER  ::   ji, jj     ! dummy loop indices
209      !!--------------------------------------------------------------------
210      !
211      ! compute upward heat flux zhtflx and upward water flux zwflx
212      ! Resolution of a 3d equation from equation 24, 25 and 26 (note conduction through the ice has been added to Eq 24)
213      DO jj = 1, jpj
214         DO ji = 1, jpi
215            !
216            ! compute coeficient to solve the 2nd order equation
217            zeps1 = rau0_rcp * pgt(ji,jj)
218            zeps2 = rLfusisf * rau0 * 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) = rau0     * pgs(ji,jj) * ( zsfrz - pstbl(ji,jj) ) / MAX(zsfrz,zeps) ! fresh water flux    (> 0 out)
243            pqoce(ji,jj) = rau0_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 DO
249      END DO
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
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 out)
306      pqoce(:,:) = - pqfwf(:,:) * rLfusisf             ! ocean heat flux    ( >0 out)
307      pqhc (:,:) =   pqfwf(:,:) * ztfrz(:,:) * rcp     ! heat content flux  ( >0 out)
308      !
309      CALL iom_put('isftfrz_cav', ztfrz * mskisf_cav(:,:) )
310   END SUBROUTINE isfcav_mlt_oasis
311
312END MODULE isfcavmlt
Note: See TracBrowser for help on using the repository browser.