[11403] | 1 | MODULE isfstp |
---|
[4666] | 2 | !!====================================================================== |
---|
[11403] | 3 | !! *** MODULE isfstp *** |
---|
[13364] | 4 | !! Ice Shelves : compute iceshelf load, melt and heat flux |
---|
[4666] | 5 | !!====================================================================== |
---|
[9019] | 6 | !! History : 3.2 ! 2011-02 (C.Harris ) Original code isf cav |
---|
| 7 | !! X.X ! 2006-02 (C. Wang ) Original code bg03 |
---|
| 8 | !! 3.4 ! 2013-03 (P. Mathiot) Merging + parametrization |
---|
[11395] | 9 | !! 4.1 ! 2019-09 (P. Mathiot) Split param/explicit ice shelf and re-organisation |
---|
[4666] | 10 | !!---------------------------------------------------------------------- |
---|
| 11 | |
---|
| 12 | !!---------------------------------------------------------------------- |
---|
[11403] | 13 | !! isfstp : compute iceshelf melt and heat flux |
---|
[4666] | 14 | !!---------------------------------------------------------------------- |
---|
[12077] | 15 | USE isf_oce ! isf variables |
---|
[11852] | 16 | USE isfload, ONLY: isf_load ! ice shelf load |
---|
| 17 | USE isftbl , ONLY: isf_tbl_lvl ! ice shelf boundary layer |
---|
| 18 | USE isfpar , ONLY: isf_par, isf_par_init ! ice shelf parametrisation |
---|
| 19 | USE isfcav , ONLY: isf_cav, isf_cav_init ! ice shelf cavity |
---|
| 20 | USE isfcpl , ONLY: isfcpl_rst_write, isfcpl_init ! isf variables |
---|
[4666] | 21 | |
---|
[13237] | 22 | USE dom_oce ! ocean space and time domain |
---|
| 23 | USE oce , ONLY: ssh ! sea surface height |
---|
[11852] | 24 | USE domvvl, ONLY: ln_vvl_zstar ! zstar logical |
---|
| 25 | USE zdfdrg, ONLY: r_Cdmin_top, r_ke0_top ! vertical physics: top/bottom drag coef. |
---|
| 26 | ! |
---|
| 27 | USE lib_mpp, ONLY: ctl_stop, ctl_nam |
---|
[11931] | 28 | USE fldread, ONLY: FLD, FLD_N |
---|
[11852] | 29 | USE in_out_manager ! I/O manager |
---|
[11876] | 30 | USE timing |
---|
[11852] | 31 | |
---|
[4666] | 32 | IMPLICIT NONE |
---|
| 33 | PRIVATE |
---|
| 34 | |
---|
[11553] | 35 | PUBLIC isf_stp, isf_init, isf_nam ! routine called in sbcmod and divhor |
---|
[4666] | 36 | |
---|
[13237] | 37 | !! * Substitutions |
---|
| 38 | # include "domzgr_substitute.h90" |
---|
[4666] | 39 | !!---------------------------------------------------------------------- |
---|
[9598] | 40 | !! NEMO/OCE 4.0 , NEMO Consortium (2018) |
---|
[5215] | 41 | !! $Id$ |
---|
[10068] | 42 | !! Software governed by the CeCILL license (see ./LICENSE) |
---|
[4666] | 43 | !!---------------------------------------------------------------------- |
---|
| 44 | CONTAINS |
---|
| 45 | |
---|
[13364] | 46 | SUBROUTINE isf_stp( kt, Kmm ) |
---|
[5836] | 47 | !!--------------------------------------------------------------------- |
---|
[11403] | 48 | !! *** ROUTINE isf_stp *** |
---|
[6140] | 49 | !! |
---|
[11403] | 50 | !! ** Purpose : compute total heat flux and total fwf due to ice shelf melt |
---|
[6140] | 51 | !! |
---|
[11403] | 52 | !! ** Method : For each case (parametrisation or explicity cavity) : |
---|
| 53 | !! - define the before fields |
---|
| 54 | !! - compute top boundary layer properties |
---|
| 55 | !! (in case of parametrisation, this is the |
---|
| 56 | !! depth range model array used to compute mean far fields properties) |
---|
| 57 | !! - compute fluxes |
---|
| 58 | !! - write restart variables |
---|
[6140] | 59 | !!---------------------------------------------------------------------- |
---|
[13364] | 60 | INTEGER, INTENT(in) :: kt ! ocean time step |
---|
| 61 | INTEGER, INTENT(in) :: Kmm ! ocean time level index |
---|
| 62 | ! |
---|
| 63 | INTEGER :: jk ! loop index |
---|
| 64 | #if defined key_qco |
---|
| 65 | REAL(wp), DIMENSION(jpi,jpj,jpk) :: ze3t ! 3D workspace |
---|
| 66 | #endif |
---|
[4666] | 67 | !!--------------------------------------------------------------------- |
---|
| 68 | ! |
---|
[11876] | 69 | IF( ln_timing ) CALL timing_start('isf') |
---|
| 70 | ! |
---|
[11931] | 71 | !======================================================================= |
---|
| 72 | ! 1.: compute melt and associated heat fluxes in the ice shelf cavities |
---|
| 73 | !======================================================================= |
---|
| 74 | ! |
---|
[11395] | 75 | IF ( ln_isfcav_mlt ) THEN |
---|
[9019] | 76 | ! |
---|
[11931] | 77 | ! 1.1: before time step |
---|
[11395] | 78 | IF ( kt /= nit000 ) THEN |
---|
| 79 | risf_cav_tsc_b (:,:,:) = risf_cav_tsc (:,:,:) |
---|
| 80 | fwfisf_cav_b(:,:) = fwfisf_cav(:,:) |
---|
| 81 | END IF |
---|
[7788] | 82 | ! |
---|
[11931] | 83 | ! 1.2: compute misfkb, rhisf_tbl, rfrac (deepest level, thickness, fraction of deepest cell affected by tbl) |
---|
[11541] | 84 | rhisf_tbl_cav(:,:) = rn_htbl * mskisf_cav(:,:) |
---|
[13364] | 85 | #if defined key_qco |
---|
[13237] | 86 | DO jk = 1, jpk |
---|
| 87 | ze3t(:,:,jk) = e3t(:,:,jk,Kmm) |
---|
| 88 | END DO |
---|
[13364] | 89 | CALL isf_tbl_lvl( ht(:,:), ze3t, misfkt_cav, misfkb_cav, rhisf_tbl_cav, rfrac_tbl_cav ) |
---|
| 90 | #else |
---|
| 91 | CALL isf_tbl_lvl( ht(:,:), e3t, misfkt_cav, misfkb_cav, rhisf_tbl_cav, rfrac_tbl_cav ) |
---|
| 92 | #endif |
---|
[11395] | 93 | ! |
---|
[11931] | 94 | ! 1.3: compute ice shelf melt |
---|
[13364] | 95 | CALL isf_cav( kt, Kmm, risf_cav_tsc, fwfisf_cav ) |
---|
[11395] | 96 | ! |
---|
| 97 | END IF |
---|
[9019] | 98 | ! |
---|
[11931] | 99 | !================================================================================= |
---|
| 100 | ! 2.: compute melt and associated heat fluxes for not resolved ice shelf cavities |
---|
| 101 | !================================================================================= |
---|
| 102 | ! |
---|
[11395] | 103 | IF ( ln_isfpar_mlt ) THEN |
---|
[4666] | 104 | ! |
---|
[11931] | 105 | ! 2.1: before time step |
---|
[11395] | 106 | IF ( kt /= nit000 ) THEN |
---|
[11423] | 107 | risf_par_tsc_b(:,:,:) = risf_par_tsc(:,:,:) |
---|
| 108 | fwfisf_par_b (:,:) = fwfisf_par (:,:) |
---|
[11395] | 109 | END IF |
---|
[4666] | 110 | ! |
---|
[11931] | 111 | ! 2.2: compute misfkb, rhisf_tbl, rfrac (deepest level, thickness, fraction of deepest cell affected by tbl) |
---|
| 112 | ! by simplicity, we assume the top level where param applied do not change with time (done in init part) |
---|
[11541] | 113 | rhisf_tbl_par(:,:) = rhisf0_tbl_par(:,:) |
---|
[13364] | 114 | #if defined key_qco |
---|
[13237] | 115 | DO jk = 1, jpk |
---|
| 116 | ze3t(:,:,jk) = e3t(:,:,jk,Kmm) |
---|
| 117 | END DO |
---|
[13364] | 118 | CALL isf_tbl_lvl( ht(:,:), ze3t, misfkt_par, misfkb_par, rhisf_tbl_par, rfrac_tbl_par ) |
---|
| 119 | #else |
---|
| 120 | CALL isf_tbl_lvl( ht(:,:), e3t, misfkt_par, misfkb_par, rhisf_tbl_par, rfrac_tbl_par ) |
---|
| 121 | #endif |
---|
[11395] | 122 | ! |
---|
[11931] | 123 | ! 2.3: compute ice shelf melt |
---|
[13364] | 124 | CALL isf_par( kt, Kmm, risf_par_tsc, fwfisf_par ) |
---|
[11395] | 125 | ! |
---|
| 126 | END IF |
---|
| 127 | ! |
---|
[11931] | 128 | !================================================================================== |
---|
| 129 | ! 3.: output specific restart variable in case of coupling with an ice sheet model |
---|
| 130 | !================================================================================== |
---|
| 131 | ! |
---|
[12068] | 132 | IF ( ln_isfcpl .AND. lrst_oce ) CALL isfcpl_rst_write(kt, Kmm) |
---|
[11852] | 133 | ! |
---|
[11876] | 134 | IF( ln_timing ) CALL timing_stop('isf') |
---|
| 135 | ! |
---|
[11403] | 136 | END SUBROUTINE isf_stp |
---|
[4666] | 137 | |
---|
[13364] | 138 | |
---|
| 139 | SUBROUTINE isf_init( Kbb, Kmm, Kaa ) |
---|
[6140] | 140 | !!--------------------------------------------------------------------- |
---|
[11403] | 141 | !! *** ROUTINE isfstp_init *** |
---|
[6140] | 142 | !! |
---|
[11403] | 143 | !! ** Purpose : Initialisation of the ice shelf public variables |
---|
[6140] | 144 | !! |
---|
[11823] | 145 | !! ** Method : Read the namisf namelist, check option compatibility and set derived parameters |
---|
[11395] | 146 | !! |
---|
[11823] | 147 | !! ** Action : - read namisf parameters |
---|
[11403] | 148 | !! - allocate memory |
---|
[11823] | 149 | !! - output print |
---|
| 150 | !! - ckeck option compatibility |
---|
| 151 | !! - call cav/param/isfcpl init routine |
---|
[5836] | 152 | !!---------------------------------------------------------------------- |
---|
[13364] | 153 | INTEGER, INTENT(in) :: Kbb, Kmm, Kaa ! ocean time level indices |
---|
| 154 | !!---------------------------------------------------------------------- |
---|
[11403] | 155 | ! |
---|
[11553] | 156 | ! constrain: l_isfoasis need to be known |
---|
| 157 | ! |
---|
[13364] | 158 | CALL isf_nam() ! Read namelist |
---|
[11553] | 159 | ! |
---|
[13364] | 160 | CALL isf_alloc() ! Allocate public array |
---|
[11403] | 161 | ! |
---|
[13364] | 162 | CALL isf_ctl() ! check option compatibility |
---|
[11403] | 163 | ! |
---|
[13364] | 164 | IF( ln_isfcav ) CALL isf_load( Kmm, risfload ) ! compute ice shelf load |
---|
[11403] | 165 | ! |
---|
[11553] | 166 | ! terminate routine now if no ice shelf melt formulation specify |
---|
[13364] | 167 | IF( ln_isf ) THEN |
---|
[11553] | 168 | ! |
---|
[13364] | 169 | IF( ln_isfcav_mlt ) CALL isf_cav_init() ! initialisation melt in the cavity |
---|
[11553] | 170 | ! |
---|
[13364] | 171 | IF( ln_isfpar_mlt ) CALL isf_par_init() ! initialisation parametrised melt |
---|
[11553] | 172 | ! |
---|
[13364] | 173 | IF( ln_isfcpl ) CALL isfcpl_init( Kbb, Kmm, Kaa ) ! initialisation ice sheet coupling |
---|
[11852] | 174 | ! |
---|
[11553] | 175 | END IF |
---|
| 176 | |
---|
| 177 | END SUBROUTINE isf_init |
---|
| 178 | |
---|
[13364] | 179 | |
---|
[11823] | 180 | SUBROUTINE isf_ctl() |
---|
| 181 | !!--------------------------------------------------------------------- |
---|
| 182 | !! *** ROUTINE isf_ctl *** |
---|
| 183 | !! |
---|
| 184 | !! ** Purpose : output print and option compatibility check |
---|
| 185 | !! |
---|
| 186 | !!---------------------------------------------------------------------- |
---|
[11423] | 187 | IF (lwp) THEN |
---|
| 188 | WRITE(numout,*) |
---|
| 189 | WRITE(numout,*) 'isf_init : ice shelf initialisation' |
---|
| 190 | WRITE(numout,*) '~~~~~~~~~~~~' |
---|
| 191 | WRITE(numout,*) ' Namelist namisf :' |
---|
| 192 | ! |
---|
[11489] | 193 | WRITE(numout,*) ' ice shelf cavity (open or parametrised) ln_isf = ', ln_isf |
---|
[11553] | 194 | WRITE(numout,*) |
---|
[11489] | 195 | ! |
---|
| 196 | IF ( ln_isf ) THEN |
---|
[11876] | 197 | WRITE(numout,*) ' Add debug print in isf module ln_isfdebug = ', ln_isfdebug |
---|
| 198 | WRITE(numout,*) |
---|
[11489] | 199 | WRITE(numout,*) ' melt inside the cavity ln_isfcav_mlt = ', ln_isfcav_mlt |
---|
[11541] | 200 | IF ( ln_isfcav_mlt) THEN |
---|
[12077] | 201 | WRITE(numout,*) ' melt formulation cn_isfcav_mlt= ', TRIM(cn_isfcav_mlt) |
---|
| 202 | WRITE(numout,*) ' thickness of the top boundary layer rn_htbl = ', rn_htbl |
---|
| 203 | WRITE(numout,*) ' gamma formulation cn_gammablk = ', TRIM(cn_gammablk) |
---|
[11489] | 204 | IF ( TRIM(cn_gammablk) .NE. 'spe' ) THEN |
---|
[12077] | 205 | WRITE(numout,*) ' gammat coefficient rn_gammat0 = ', rn_gammat0 |
---|
| 206 | WRITE(numout,*) ' gammas coefficient rn_gammas0 = ', rn_gammas0 |
---|
| 207 | WRITE(numout,*) ' top background ke used (from namdrg_top) rn_ke0 = ', r_ke0_top |
---|
| 208 | WRITE(numout,*) ' top drag coef. used (from namdrg_top) rn_Cd0 = ', r_Cdmin_top |
---|
[11489] | 209 | END IF |
---|
[11423] | 210 | END IF |
---|
[11489] | 211 | WRITE(numout,*) '' |
---|
| 212 | ! |
---|
[11553] | 213 | WRITE(numout,*) ' ice shelf melt parametrisation ln_isfpar_mlt = ', ln_isfpar_mlt |
---|
[11489] | 214 | IF ( ln_isfpar_mlt ) THEN |
---|
| 215 | WRITE(numout,*) ' isf parametrisation formulation cn_isfpar_mlt = ', TRIM(cn_isfpar_mlt) |
---|
| 216 | END IF |
---|
| 217 | WRITE(numout,*) '' |
---|
| 218 | ! |
---|
[11553] | 219 | WRITE(numout,*) ' Coupling to an ice sheet model ln_isfcpl = ', ln_isfcpl |
---|
[11541] | 220 | IF ( ln_isfcpl ) THEN |
---|
[11553] | 221 | WRITE(numout,*) ' conservation activated ln_isfcpl_cons = ', ln_isfcpl_cons |
---|
| 222 | WRITE(numout,*) ' number of call of the extrapolation loop = ', nn_drown |
---|
[11541] | 223 | ENDIF |
---|
| 224 | WRITE(numout,*) '' |
---|
| 225 | ! |
---|
[11489] | 226 | ELSE |
---|
[11876] | 227 | ! |
---|
[11489] | 228 | IF ( ln_isfcav ) THEN |
---|
| 229 | WRITE(numout,*) '' |
---|
| 230 | WRITE(numout,*) ' W A R N I N G: ice shelf cavities are open BUT no melt will be computed or read from file !' |
---|
| 231 | WRITE(numout,*) '' |
---|
| 232 | END IF |
---|
[11876] | 233 | ! |
---|
[6140] | 234 | END IF |
---|
[11489] | 235 | |
---|
[12077] | 236 | IF (ln_isfcav) THEN |
---|
| 237 | WRITE(numout,*) ' Ice shelf load method cn_isfload = ', TRIM(cn_isfload) |
---|
| 238 | WRITE(numout,*) ' Temperature used to compute the ice shelf load = ', rn_isfload_T |
---|
| 239 | WRITE(numout,*) ' Salinity used to compute the ice shelf load = ', rn_isfload_S |
---|
| 240 | END IF |
---|
[11521] | 241 | WRITE(numout,*) '' |
---|
[12077] | 242 | FLUSH(numout) |
---|
[11521] | 243 | |
---|
[11489] | 244 | END IF |
---|
| 245 | ! |
---|
[11553] | 246 | |
---|
[11489] | 247 | !--------------------------------------------------------------------------------------------------------------------- |
---|
[11553] | 248 | ! sanity check ! issue ln_isfcav not yet known as well as l_isfoasis => move this call in isf_stp ? |
---|
[11403] | 249 | ! melt in the cavity without cavity |
---|
[11876] | 250 | IF ( ln_isfcav_mlt .AND. (.NOT. ln_isfcav) ) & |
---|
[11553] | 251 | & CALL ctl_stop('ice shelf melt in the cavity activated (ln_isfcav_mlt) but no cavity detected in domcfg (ln_isfcav), STOP' ) |
---|
[6140] | 252 | ! |
---|
[11489] | 253 | ! ice sheet coupling without cavity |
---|
| 254 | IF ( ln_isfcpl .AND. (.NOT. ln_isfcav) ) & |
---|
| 255 | & CALL ctl_stop('coupling with an ice sheet model detected (ln_isfcpl) but no cavity detected in domcfg (ln_isfcav), STOP' ) |
---|
| 256 | ! |
---|
[11423] | 257 | IF ( ln_isfcpl .AND. ln_isfcpl_cons .AND. ln_linssh ) & |
---|
| 258 | & CALL ctl_stop( 'The coupling between NEMO and an ice sheet model with the conservation option does not work with the linssh option' ) |
---|
| 259 | ! |
---|
[11553] | 260 | IF ( l_isfoasis .AND. .NOT. ln_isf ) CALL ctl_stop( ' OASIS send ice shelf fluxes to NEMO but NEMO does not have the isf module activated' ) |
---|
| 261 | ! |
---|
| 262 | IF ( l_isfoasis .AND. ln_isf ) THEN |
---|
[11403] | 263 | ! |
---|
[12242] | 264 | CALL ctl_stop( 'namelist combination ln_cpl and ln_isf not tested' ) |
---|
[11403] | 265 | ! |
---|
| 266 | ! NEMO coupled to ATMO model with isf cavity need oasis method for melt computation |
---|
[11423] | 267 | IF ( ln_isfcav_mlt .AND. TRIM(cn_isfcav_mlt) /= 'oasis' ) CALL ctl_stop( 'cn_isfcav_mlt = oasis is the only option availble if fwf send by oasis' ) |
---|
| 268 | IF ( ln_isfpar_mlt .AND. TRIM(cn_isfpar_mlt) /= 'oasis' ) CALL ctl_stop( 'cn_isfpar_mlt = oasis is the only option availble if fwf send by oasis' ) |
---|
[11403] | 269 | ! |
---|
| 270 | ! oasis melt computation not tested (coded but not tested) |
---|
| 271 | IF ( ln_isfcav_mlt .OR. ln_isfpar_mlt ) THEN |
---|
| 272 | IF ( TRIM(cn_isfcav_mlt) == 'oasis' ) CALL ctl_stop( 'cn_isfcav_mlt = oasis not tested' ) |
---|
| 273 | IF ( TRIM(cn_isfpar_mlt) == 'oasis' ) CALL ctl_stop( 'cn_isfpar_mlt = oasis not tested' ) |
---|
| 274 | END IF |
---|
| 275 | ! |
---|
| 276 | ! oasis melt computation with cavity open and cavity parametrised (not coded) |
---|
| 277 | IF ( ln_isfcav_mlt .AND. ln_isfpar_mlt ) THEN |
---|
| 278 | IF ( TRIM(cn_isfpar_mlt) == 'oasis' .AND. TRIM(cn_isfcav_mlt) == 'oasis' ) CALL ctl_stop( 'cn_isfpar_mlt = oasis and cn_isfcav_mlt = oasis not coded' ) |
---|
| 279 | END IF |
---|
[11553] | 280 | ! |
---|
[11823] | 281 | ! compatibility ice shelf and vvl |
---|
| 282 | IF( .NOT. ln_vvl_zstar .AND. ln_isf ) CALL ctl_stop( 'Only vvl_zstar has been tested with ice shelf cavity' ) |
---|
| 283 | ! |
---|
[11403] | 284 | END IF |
---|
[11553] | 285 | END SUBROUTINE isf_ctl |
---|
[13364] | 286 | |
---|
| 287 | |
---|
[11553] | 288 | SUBROUTINE isf_nam |
---|
| 289 | !!--------------------------------------------------------------------- |
---|
| 290 | !! *** ROUTINE isf_nam *** |
---|
| 291 | !! |
---|
| 292 | !! ** Purpose : Read ice shelf namelist cfg and ref |
---|
| 293 | !! |
---|
| 294 | !!---------------------------------------------------------------------- |
---|
| 295 | INTEGER :: ios ! Local integer output status for namelist read |
---|
| 296 | !!---------------------------------------------------------------------- |
---|
[12077] | 297 | NAMELIST/namisf/ ln_isf , & |
---|
| 298 | & cn_gammablk , rn_gammat0 , rn_gammas0 , rn_htbl, sn_isfcav_fwf, & |
---|
| 299 | & ln_isfcav_mlt , cn_isfcav_mlt , sn_isfcav_fwf , & |
---|
| 300 | & ln_isfpar_mlt , cn_isfpar_mlt , sn_isfpar_fwf , & |
---|
| 301 | & sn_isfpar_zmin, sn_isfpar_zmax, sn_isfpar_Leff, & |
---|
| 302 | & ln_isfcpl , nn_drown , ln_isfcpl_cons, ln_isfdebug, & |
---|
| 303 | & cn_isfload , rn_isfload_T , rn_isfload_S , cn_isfdir |
---|
[11553] | 304 | !!---------------------------------------------------------------------- |
---|
[9019] | 305 | ! |
---|
[11553] | 306 | READ ( numnam_ref, namisf, IOSTAT = ios, ERR = 901) |
---|
[12068] | 307 | 901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namisf in reference namelist' ) |
---|
[11553] | 308 | ! |
---|
| 309 | READ ( numnam_cfg, namisf, IOSTAT = ios, ERR = 902 ) |
---|
[12068] | 310 | 902 IF( ios > 0 ) CALL ctl_nam ( ios , 'namisf in configuration namelist' ) |
---|
[11553] | 311 | IF(lwm) WRITE ( numond, namisf ) |
---|
| 312 | |
---|
| 313 | END SUBROUTINE isf_nam |
---|
| 314 | !! |
---|
[6140] | 315 | !!====================================================================== |
---|
[11403] | 316 | END MODULE isfstp |
---|