[11395] | 1 | MODULE isfcav |
---|
| 2 | !!====================================================================== |
---|
[11541] | 3 | !! *** MODULE isfcav *** |
---|
| 4 | !! Ice shelf cavity module : update ice shelf melting under ice |
---|
| 5 | !! shelf |
---|
[11395] | 6 | !!====================================================================== |
---|
| 7 | !! History : 3.2 ! 2011-02 (C.Harris ) Original code isf cav |
---|
| 8 | !! 3.4 ! 2013-03 (P. Mathiot) Merging + parametrization |
---|
[11541] | 9 | !! 4.1 ! 2019-09 (P. Mathiot) Split ice shelf cavity and ice shelf parametrisation |
---|
[11395] | 10 | !!---------------------------------------------------------------------- |
---|
| 11 | |
---|
| 12 | !!---------------------------------------------------------------------- |
---|
[11541] | 13 | !! isf_cav : update ice shelf melting under ice shelf |
---|
[11395] | 14 | !!---------------------------------------------------------------------- |
---|
[12077] | 15 | USE isf_oce ! ice shelf public variables |
---|
[11395] | 16 | ! |
---|
[11852] | 17 | USE isfrst , ONLY: isfrst_write, isfrst_read ! ice shelf restart read/write subroutine |
---|
| 18 | USE isfutils , ONLY: debug ! ice shelf debug subroutine |
---|
| 19 | USE isftbl , ONLY: isf_tbl ! ice shelf top boundary layer properties subroutine |
---|
| 20 | USE isfcavmlt, ONLY: isfcav_mlt ! ice shelf melt formulation subroutine |
---|
| 21 | USE isfcavgam, ONLY: isfcav_gammats ! ice shelf melt exchange coeficient subroutine |
---|
| 22 | USE isfdiags , ONLY: isf_diags_flx ! ice shelf diags subroutine |
---|
| 23 | ! |
---|
[12343] | 24 | USE oce , ONLY: ts ! ocean tracers |
---|
| 25 | USE par_oce , ONLY: jpi,jpj ! ocean space and time domain |
---|
[12489] | 26 | USE phycst , ONLY: grav,rho0,rho0_rcp,r1_rho0_rcp ! physical constants |
---|
[12343] | 27 | USE eosbn2 , ONLY: ln_teos10 ! use ln_teos10 or not |
---|
[11852] | 28 | ! |
---|
[11395] | 29 | USE in_out_manager ! I/O manager |
---|
| 30 | USE iom ! I/O library |
---|
| 31 | USE fldread ! read input field at current time step |
---|
[11541] | 32 | USE lbclnk ! lbclnk |
---|
[11395] | 33 | |
---|
| 34 | IMPLICIT NONE |
---|
| 35 | |
---|
| 36 | PRIVATE |
---|
| 37 | |
---|
| 38 | PUBLIC isf_cav, isf_cav_init ! routine called in isfmlt |
---|
| 39 | |
---|
| 40 | !!---------------------------------------------------------------------- |
---|
| 41 | !! NEMO/OCE 4.0 , NEMO Consortium (2018) |
---|
| 42 | !! $Id: sbcisf.F90 10536 2019-01-16 19:21:09Z mathiot $ |
---|
| 43 | !! Software governed by the CeCILL license (see ./LICENSE) |
---|
| 44 | !!---------------------------------------------------------------------- |
---|
| 45 | CONTAINS |
---|
| 46 | |
---|
[12068] | 47 | SUBROUTINE isf_cav( kt, Kmm, ptsc, pqfwf ) |
---|
[11395] | 48 | !!--------------------------------------------------------------------- |
---|
[11541] | 49 | !! *** ROUTINE isf_cav *** |
---|
[11395] | 50 | !! |
---|
| 51 | !! ** Purpose : handle surface boundary condition under ice shelf |
---|
| 52 | !! |
---|
[11541] | 53 | !! ** Method : based on Mathiot et al. (2017) |
---|
[11395] | 54 | !! |
---|
[11541] | 55 | !! ** Action : - compute geometry of the Losch top bournary layer (see Losch et al. 2008) |
---|
| 56 | !! - depending on the chooses option |
---|
| 57 | !! - compute temperature/salt in the tbl |
---|
| 58 | !! - compute exchange coeficient |
---|
| 59 | !! - compute heat and fwf fluxes |
---|
| 60 | !! - output |
---|
[11395] | 61 | !!--------------------------------------------------------------------- |
---|
| 62 | !!-------------------------- OUT -------------------------------------- |
---|
[11852] | 63 | REAL(wp), DIMENSION(jpi,jpj) , INTENT(inout) :: pqfwf ! ice shelf melt (>0 out) |
---|
| 64 | REAL(wp), DIMENSION(jpi,jpj,jpts), INTENT(inout) :: ptsc ! T & S ice shelf cavity contents |
---|
[11395] | 65 | !!-------------------------- IN -------------------------------------- |
---|
[12068] | 66 | INTEGER, INTENT(in) :: Kmm ! ocean time level index |
---|
[11395] | 67 | INTEGER, INTENT(in) :: kt ! ocean time step |
---|
| 68 | !!--------------------------------------------------------------------- |
---|
| 69 | LOGICAL :: lit |
---|
| 70 | INTEGER :: nit |
---|
| 71 | REAL(wp) :: zerr |
---|
[11852] | 72 | REAL(wp), DIMENSION(jpi,jpj) :: zqlat, zqoce, zqhc, zqh ! heat fluxes |
---|
| 73 | REAL(wp), DIMENSION(jpi,jpj) :: zqoce_b ! |
---|
| 74 | REAL(wp), DIMENSION(jpi,jpj) :: zgammat, zgammas ! exchange coeficient |
---|
| 75 | REAL(wp), DIMENSION(jpi,jpj) :: zttbl, zstbl ! temp. and sal. in top boundary layer |
---|
[11395] | 76 | !!--------------------------------------------------------------------- |
---|
| 77 | ! |
---|
| 78 | ! compute T/S/U/V for the top boundary layer |
---|
[12068] | 79 | CALL isf_tbl(Kmm, ts(:,:,:,jp_tem,Kmm), zttbl(:,:),'T', misfkt_cav, rhisf_tbl_cav, misfkb_cav, rfrac_tbl_cav ) |
---|
| 80 | CALL isf_tbl(Kmm, ts(:,:,:,jp_sal,Kmm), zstbl(:,:),'T', misfkt_cav, rhisf_tbl_cav, misfkb_cav, rfrac_tbl_cav ) |
---|
[11395] | 81 | ! |
---|
| 82 | ! output T/S/U/V for the top boundary layer |
---|
[11521] | 83 | CALL iom_put('ttbl_cav',zttbl(:,:) * mskisf_cav(:,:)) |
---|
| 84 | CALL iom_put('stbl' ,zstbl(:,:) * mskisf_cav(:,:)) |
---|
[11395] | 85 | ! |
---|
| 86 | ! initialisation |
---|
[12489] | 87 | IF (TRIM(cn_gammablk) == 'vel_stab' ) zqoce_b (:,:) = ptsc(:,:,jp_tem) * rho0_rcp ! last time step total heat fluxes (to speed up convergence) |
---|
[11395] | 88 | ! |
---|
| 89 | ! compute ice shelf melting |
---|
| 90 | nit = 1 ; lit = .TRUE. |
---|
| 91 | DO WHILE ( lit ) ! maybe just a constant number of iteration as in blk_core is fine |
---|
| 92 | ! |
---|
[11931] | 93 | ! compute gammat everywhere (2d) |
---|
[11395] | 94 | ! useless if melt specified |
---|
| 95 | IF ( TRIM(cn_isfcav_mlt) .NE. 'spe' ) THEN |
---|
[12068] | 96 | CALL isfcav_gammats( Kmm, zttbl, zstbl, zqoce , pqfwf, & |
---|
| 97 | & zgammat, zgammas ) |
---|
[11395] | 98 | END IF |
---|
| 99 | ! |
---|
| 100 | ! compute tfrz, latent heat and melt (2d) |
---|
| 101 | CALL isfcav_mlt(kt, zgammat, zgammas, zttbl, zstbl, & |
---|
| 102 | & zqhc , zqoce, pqfwf ) |
---|
| 103 | ! |
---|
[11931] | 104 | ! define if we need to iterate |
---|
[11395] | 105 | SELECT CASE ( cn_gammablk ) |
---|
[12077] | 106 | CASE ( 'spe','vel' ) |
---|
[11395] | 107 | ! no convergence needed |
---|
| 108 | lit = .FALSE. |
---|
[12077] | 109 | CASE ( 'vel_stab' ) |
---|
[11395] | 110 | ! compute error between 2 iterations |
---|
| 111 | zerr = MAXVAL(ABS(zqoce(:,:) - zqoce_b(:,:))) |
---|
| 112 | ! |
---|
| 113 | ! define if iteration needed |
---|
| 114 | IF (nit >= 100) THEN ! too much iteration |
---|
[12077] | 115 | CALL ctl_stop( 'STOP', 'isf_cav: vel_stab gamma formulation had too many iterations ...' ) |
---|
[11395] | 116 | ELSE IF ( zerr <= 0.01_wp ) THEN ! convergence is achieve |
---|
| 117 | lit = .FALSE. |
---|
| 118 | ELSE ! converge is not yet achieve |
---|
| 119 | nit = nit + 1 |
---|
| 120 | zqoce_b(:,:) = zqoce(:,:) |
---|
| 121 | END IF |
---|
| 122 | END SELECT |
---|
[11541] | 123 | ! |
---|
[11395] | 124 | END DO |
---|
| 125 | ! |
---|
[11931] | 126 | ! compute heat and water flux ( > 0 out ) |
---|
[11395] | 127 | pqfwf(:,:) = pqfwf(:,:) * mskisf_cav(:,:) |
---|
| 128 | zqoce(:,:) = zqoce(:,:) * mskisf_cav(:,:) |
---|
| 129 | zqhc (:,:) = zqhc(:,:) * mskisf_cav(:,:) |
---|
| 130 | ! |
---|
[11931] | 131 | ! compute heat content flux ( > 0 out ) |
---|
| 132 | zqlat(:,:) = - pqfwf(:,:) * rLfusisf ! 2d latent heat flux (W/m2) |
---|
[11395] | 133 | ! |
---|
| 134 | ! total heat flux ( >0 out ) |
---|
| 135 | zqh(:,:) = ( zqhc (:,:) + zqoce(:,:) ) |
---|
| 136 | ! |
---|
| 137 | ! lbclnk on melt |
---|
[13226] | 138 | CALL lbc_lnk_multi( 'isfmlt', zqh, 'T', 1.0_wp, pqfwf, 'T', 1.0_wp) |
---|
[11395] | 139 | ! |
---|
| 140 | ! output fluxes |
---|
[12068] | 141 | CALL isf_diags_flx( Kmm, misfkt_cav, misfkb_cav, rhisf_tbl_cav, rfrac_tbl_cav, 'cav', pqfwf, zqoce, zqlat, zqhc) |
---|
[11395] | 142 | ! |
---|
| 143 | ! set temperature content |
---|
[12489] | 144 | ptsc(:,:,jp_tem) = - zqh(:,:) * r1_rho0_rcp |
---|
[11395] | 145 | ! |
---|
[11852] | 146 | ! write restart variables (qoceisf, qhcisf, fwfisf for now and before) |
---|
| 147 | IF (lrst_oce) CALL isfrst_write(kt, 'cav', ptsc, pqfwf) |
---|
| 148 | ! |
---|
[11844] | 149 | IF ( ln_isfdebug ) THEN |
---|
| 150 | CALL debug('isf_cav: ptsc T',ptsc(:,:,1)) |
---|
| 151 | CALL debug('isf_cav: ptsc S',ptsc(:,:,2)) |
---|
| 152 | CALL debug('isf_cav: pqfwf fwf',pqfwf(:,:)) |
---|
| 153 | END IF |
---|
| 154 | ! |
---|
[11395] | 155 | END SUBROUTINE isf_cav |
---|
| 156 | |
---|
| 157 | SUBROUTINE isf_cav_init |
---|
| 158 | !!--------------------------------------------------------------------- |
---|
[11541] | 159 | !! *** ROUTINE isf_cav_init *** |
---|
[11395] | 160 | !! |
---|
[11541] | 161 | !! ** Purpose : initialisation of variable needed to compute melt under an ice shelf |
---|
[11395] | 162 | !! |
---|
| 163 | !!---------------------------------------------------------------------- |
---|
| 164 | INTEGER :: ierr |
---|
| 165 | !!--------------------------------------------------------------------- |
---|
[11931] | 166 | ! |
---|
| 167 | !============== |
---|
[11852] | 168 | ! 0: allocation |
---|
[11931] | 169 | !============== |
---|
[11852] | 170 | ! |
---|
[11395] | 171 | CALL isf_alloc_cav() |
---|
| 172 | ! |
---|
[11931] | 173 | !================== |
---|
[11852] | 174 | ! 1: initialisation |
---|
[11931] | 175 | !================== |
---|
[11852] | 176 | ! |
---|
| 177 | ! top and bottom level of the 'top boundary layer' |
---|
[11495] | 178 | misfkt_cav(:,:) = mikt(:,:) ; misfkb_cav(:,:) = 1 |
---|
[11852] | 179 | ! |
---|
| 180 | ! thickness of 'tbl' and fraction of bottom cell affected by 'tbl' |
---|
[11495] | 181 | rhisf_tbl_cav(:,:) = 0.0_wp ; rfrac_tbl_cav(:,:) = 0.0_wp |
---|
[11395] | 182 | ! |
---|
[11852] | 183 | ! cavity mask |
---|
| 184 | mskisf_cav(:,:) = (1._wp - tmask(:,:,1)) * ssmask(:,:) |
---|
| 185 | ! |
---|
[11931] | 186 | !================ |
---|
[11852] | 187 | ! 2: read restart |
---|
[11931] | 188 | !================ |
---|
[11852] | 189 | ! |
---|
| 190 | ! read cav variable from restart |
---|
| 191 | IF ( ln_rstart ) CALL isfrst_read('cav', risf_cav_tsc, fwfisf_cav, risf_cav_tsc_b, fwfisf_cav_b) |
---|
| 192 | ! |
---|
[11931] | 193 | !========================================== |
---|
[11852] | 194 | ! 3: specific allocation and initialisation (depending of scheme choice) |
---|
[11931] | 195 | !========================================== |
---|
[11852] | 196 | ! |
---|
[11395] | 197 | SELECT CASE ( TRIM(cn_isfcav_mlt) ) |
---|
| 198 | CASE( 'spe' ) |
---|
| 199 | |
---|
| 200 | ALLOCATE( sf_isfcav_fwf(1), STAT=ierr ) |
---|
| 201 | ALLOCATE( sf_isfcav_fwf(1)%fnow(jpi,jpj,1), sf_isfcav_fwf(1)%fdta(jpi,jpj,1,2) ) |
---|
[11423] | 202 | CALL fld_fill( sf_isfcav_fwf, (/ sn_isfcav_fwf /), cn_isfdir, 'isf_cav_init', 'read fresh water flux isf data', 'namisf' ) |
---|
[11395] | 203 | |
---|
| 204 | IF(lwp) WRITE(numout,*) |
---|
| 205 | IF(lwp) WRITE(numout,*) ' ==>> The ice shelf melt inside the cavity is read from forcing files' |
---|
| 206 | |
---|
| 207 | CASE( '2eq' ) |
---|
| 208 | IF(lwp) WRITE(numout,*) |
---|
| 209 | IF(lwp) WRITE(numout,*) ' ==>> The original ISOMIP melt formulation is used to compute melt under the ice shelves' |
---|
| 210 | |
---|
| 211 | CASE( '3eq' ) |
---|
| 212 | ! coeficient for linearisation of potential tfreez |
---|
| 213 | ! Crude approximation for pressure (but commonly used) |
---|
[12077] | 214 | IF ( ln_teos10 ) THEN ! linearisation from Jourdain et al. (2017) |
---|
[11395] | 215 | risf_lamb1 =-0.0564_wp |
---|
| 216 | risf_lamb2 = 0.0773_wp |
---|
[12489] | 217 | risf_lamb3 =-7.8633e-8 * grav * rho0 |
---|
[11395] | 218 | ELSE ! linearisation from table 4 (Asay-Davis et al., 2015) |
---|
| 219 | risf_lamb1 =-0.0573_wp |
---|
| 220 | risf_lamb2 = 0.0832_wp |
---|
[12489] | 221 | risf_lamb3 =-7.5300e-8 * grav * rho0 |
---|
[11395] | 222 | ENDIF |
---|
| 223 | |
---|
| 224 | IF(lwp) WRITE(numout,*) |
---|
| 225 | IF(lwp) WRITE(numout,*) ' ==>> The 3 equations melt formulation is used to compute melt under the ice shelves' |
---|
| 226 | |
---|
| 227 | CASE DEFAULT |
---|
| 228 | CALL ctl_stop(' cn_isfcav_mlt method unknown (spe, 2eq, 3eq), check namelist') |
---|
| 229 | END SELECT |
---|
| 230 | ! |
---|
| 231 | END SUBROUTINE isf_cav_init |
---|
| 232 | |
---|
| 233 | END MODULE isfcav |
---|