- Timestamp:
- 2021-06-07T16:31:38+02:00 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
NEMO/branches/2021/dev_r14608_AGRIF_domcfg/src/OCE/TRA/tramle.F90
r14433 r14958 87 87 INTEGER , INTENT(in ) :: Kmm ! ocean time level index 88 88 CHARACTER(len=3) , INTENT(in ) :: cdtype ! =TRA or TRC (tracer indicator) 89 REAL(wp), DIMENSION(A2D(nn_hls),jpk), INTENT(inout) :: pu ! in : 3 ocean transport components 90 REAL(wp), DIMENSION(A2D(nn_hls),jpk), INTENT(inout) :: pv ! out: same 3 transport components 91 REAL(wp), DIMENSION(A2D(nn_hls),jpk), INTENT(inout) :: pw ! increased by the MLE induced transport 89 ! TEMP: [tiling] Can be A2D(nn_hls) after all lbc_lnks removed in the nn_hls = 2 case in tra_adv_fct 90 REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout) :: pu ! in : 3 ocean transport components 91 REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout) :: pv ! out: same 3 transport components 92 REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout) :: pw ! increased by the MLE induced transport 92 93 ! 93 94 INTEGER :: ji, jj, jk ! dummy loop indices … … 96 97 REAL(wp) :: zcvw, zmvw ! - - 97 98 INTEGER , DIMENSION(A2D(nn_hls)) :: inml_mle 98 REAL(wp), DIMENSION(A2D(nn_hls)) :: zpsim_u, zpsim_v, zmld, zbm, zhu, zhv, zn2, zLf_ MH99 REAL(wp), DIMENSION(A2D(nn_hls)) :: zpsim_u, zpsim_v, zmld, zbm, zhu, zhv, zn2, zLf_NH, zLf_MH 99 100 REAL(wp), DIMENSION(A2D(nn_hls),jpk) :: zpsi_uw, zpsi_vw 100 ! TEMP: [tiling] These changes not necessary if using XIOS (subdomain support)101 REAL(wp), DIMENSION(:,:), ALLOCATABLE, SAVE :: zLf_NH102 REAL(wp), DIMENSION(:,:,:), ALLOCATABLE, SAVE :: zpsiu_mle, zpsiv_mle103 101 !!---------------------------------------------------------------------- 104 102 ! … … 110 108 SELECT CASE( nn_mld_uv ) ! MLD at u- & v-pts 111 109 CASE ( 0 ) != min of the 2 neighbour MLDs 112 DO_2D( 1, 0, 1, 0)110 DO_2D( nn_hls, nn_hls-1, nn_hls, nn_hls-1 ) 113 111 zhu(ji,jj) = MIN( hmle(ji+1,jj), hmle(ji,jj) ) 114 112 zhv(ji,jj) = MIN( hmle(ji,jj+1), hmle(ji,jj) ) 115 113 END_2D 116 114 CASE ( 1 ) != average of the 2 neighbour MLDs 117 DO_2D( 1, 0, 1, 0)115 DO_2D( nn_hls, nn_hls-1, nn_hls, nn_hls-1 ) 118 116 zhu(ji,jj) = MAX( hmle(ji+1,jj), hmle(ji,jj) ) 119 117 zhv(ji,jj) = MAX( hmle(ji,jj+1), hmle(ji,jj) ) 120 118 END_2D 121 119 CASE ( 2 ) != max of the 2 neighbour MLDs 122 DO_2D( 1, 0, 1, 0)120 DO_2D( nn_hls, nn_hls-1, nn_hls, nn_hls-1 ) 123 121 zhu(ji,jj) = MAX( hmle(ji+1,jj), hmle(ji,jj) ) 124 122 zhv(ji,jj) = MAX( hmle(ji,jj+1), hmle(ji,jj) ) … … 126 124 END SELECT 127 125 IF( nn_mle == 0 ) THEN ! Fox-Kemper et al. 2010 formulation 128 DO_2D( 1, 0, 1, 0)126 DO_2D( nn_hls, nn_hls-1, nn_hls, nn_hls-1 ) 129 127 zpsim_u(ji,jj) = rn_ce * zhu(ji,jj) * zhu(ji,jj) * e2u(ji,jj) & 130 128 & * dbdx_mle(ji,jj) * MIN( 111.e3_wp , e1u(ji,jj) ) & … … 137 135 ! 138 136 ELSEIF( nn_mle == 1 ) THEN ! New formulation (Lf = 5km fo/ff with fo=Coriolis parameter at latitude rn_lat) 139 DO_2D( 1, 0, 1, 0)137 DO_2D( nn_hls, nn_hls-1, nn_hls, nn_hls-1 ) 140 138 zpsim_u(ji,jj) = rc_f * zhu(ji,jj) * zhu(ji,jj) * e2u(ji,jj) & 141 139 & * dbdx_mle(ji,jj) * MIN( 111.e3_wp , e1u(ji,jj) ) … … 149 147 ! !== MLD used for MLE ==! 150 148 ! ! compute from the 10m density to deal with the diurnal cycle 151 DO_2D( 1, 1, 1, 1)149 DO_2D( nn_hls, nn_hls, nn_hls, nn_hls ) 152 150 inml_mle(ji,jj) = mbkt(ji,jj) + 1 ! init. to number of ocean w-level (T-level + 1) 153 151 END_2D 154 152 IF ( nla10 > 0 ) THEN ! avoid case where first level is thicker than 10m 155 DO_3DS( 1, 1, 1, 1, jpkm1, nlb10, -1 ) ! from the bottom to nlb10 (10m)153 DO_3DS( nn_hls, nn_hls, nn_hls, nn_hls, jpkm1, nlb10, -1 ) ! from the bottom to nlb10 (10m) 156 154 IF( rhop(ji,jj,jk) > rhop(ji,jj,nla10) + rn_rho_c_mle ) inml_mle(ji,jj) = jk ! Mixed layer 157 155 END_3D … … 163 161 zbm (:,:) = 0._wp 164 162 zn2 (:,:) = 0._wp 165 DO_3D( 1, 1, 1, 1, 1, ikmax ) ! MLD and mean buoyancy and N2 over the mixed layer163 DO_3D( nn_hls, nn_hls, nn_hls, nn_hls, 1, ikmax ) ! MLD and mean buoyancy and N2 over the mixed layer 166 164 zc = e3t(ji,jj,jk,Kmm) * REAL( MIN( MAX( 0, inml_mle(ji,jj)-jk ) , 1 ) ) ! zc being 0 outside the ML t-points 167 165 zmld(ji,jj) = zmld(ji,jj) + zc … … 172 170 SELECT CASE( nn_mld_uv ) ! MLD at u- & v-pts 173 171 CASE ( 0 ) != min of the 2 neighbour MLDs 174 DO_2D( 1, 0, 1, 0)172 DO_2D( nn_hls, nn_hls-1, nn_hls, nn_hls-1 ) 175 173 zhu(ji,jj) = MIN( zmld(ji+1,jj), zmld(ji,jj) ) 176 174 zhv(ji,jj) = MIN( zmld(ji,jj+1), zmld(ji,jj) ) 177 175 END_2D 178 176 CASE ( 1 ) != average of the 2 neighbour MLDs 179 DO_2D( 1, 0, 1, 0)177 DO_2D( nn_hls, nn_hls-1, nn_hls, nn_hls-1 ) 180 178 zhu(ji,jj) = ( zmld(ji+1,jj) + zmld(ji,jj) ) * 0.5_wp 181 179 zhv(ji,jj) = ( zmld(ji,jj+1) + zmld(ji,jj) ) * 0.5_wp 182 180 END_2D 183 181 CASE ( 2 ) != max of the 2 neighbour MLDs 184 DO_2D( 1, 0, 1, 0)182 DO_2D( nn_hls, nn_hls-1, nn_hls, nn_hls-1 ) 185 183 zhu(ji,jj) = MAX( zmld(ji+1,jj), zmld(ji,jj) ) 186 184 zhv(ji,jj) = MAX( zmld(ji,jj+1), zmld(ji,jj) ) … … 188 186 END SELECT 189 187 ! ! convert density into buoyancy 190 DO_2D( 1, 1, 1, 1)188 DO_2D( nn_hls, nn_hls, nn_hls, nn_hls ) 191 189 zbm(ji,jj) = + grav * zbm(ji,jj) / MAX( e3t(ji,jj,1,Kmm), zmld(ji,jj) ) 192 190 END_2D … … 201 199 ! 202 200 IF( nn_mle == 0 ) THEN ! Fox-Kemper et al. 2010 formulation 203 DO_2D( 1, 0, 1, 0)201 DO_2D( nn_hls, nn_hls-1, nn_hls, nn_hls-1 ) 204 202 zpsim_u(ji,jj) = rn_ce * zhu(ji,jj) * zhu(ji,jj) * e2_e1u(ji,jj) & 205 203 & * ( zbm(ji+1,jj) - zbm(ji,jj) ) * MIN( 111.e3_wp , e1u(ji,jj) ) & … … 212 210 ! 213 211 ELSEIF( nn_mle == 1 ) THEN ! New formulation (Lf = 5km fo/ff with fo=Coriolis parameter at latitude rn_lat) 214 DO_2D( 1, 0, 1, 0)212 DO_2D( nn_hls, nn_hls-1, nn_hls, nn_hls-1 ) 215 213 zpsim_u(ji,jj) = rc_f * zhu(ji,jj) * zhu(ji,jj) * e2_e1u(ji,jj) & 216 214 & * ( zbm(ji+1,jj) - zbm(ji,jj) ) * MIN( 111.e3_wp , e1u(ji,jj) ) … … 222 220 ! 223 221 IF( nn_conv == 1 ) THEN ! No MLE in case of convection 224 DO_2D( 1, 0, 1, 0)222 DO_2D( nn_hls, nn_hls-1, nn_hls, nn_hls-1 ) 225 223 IF( MIN( zn2(ji,jj) , zn2(ji+1,jj) ) < 0._wp ) zpsim_u(ji,jj) = 0._wp 226 224 IF( MIN( zn2(ji,jj) , zn2(ji,jj+1) ) < 0._wp ) zpsim_v(ji,jj) = 0._wp … … 230 228 ENDIF ! end of ln_osm_mle conditional 231 229 ! !== structure function value at uw- and vw-points ==! 232 DO_2D( 1, 0, 1, 0)230 DO_2D( nn_hls, nn_hls-1, nn_hls, nn_hls-1 ) 233 231 zhu(ji,jj) = 1._wp / MAX(zhu(ji,jj), rsmall) ! hu --> 1/hu 234 232 zhv(ji,jj) = 1._wp / MAX(zhv(ji,jj), rsmall) … … 238 236 zpsi_vw(:,:,:) = 0._wp 239 237 ! 240 DO_3D( 1, 0, 1, 0, 2, ikmax ) ! start from 2 : surface value = 0 238 DO_3D( nn_hls, nn_hls-1, nn_hls, nn_hls-1, 2, ikmax ) ! start from 2 : surface value = 0 239 241 240 zcuw = 1._wp - ( gdepw(ji+1,jj,jk,Kmm) + gdepw(ji,jj,jk,Kmm) ) * zhu(ji,jj) 242 241 zcvw = 1._wp - ( gdepw(ji,jj+1,jk,Kmm) + gdepw(ji,jj,jk,Kmm) ) * zhv(ji,jj) … … 252 251 ! !== transport increased by the MLE induced transport ==! 253 252 DO jk = 1, ikmax 254 DO_2D ( 1, 0, 1, 0 ) ! CAUTION pu,pv must be defined at row/column i=1 / j=1253 DO_2D_OVR( nn_hls, nn_hls-1, nn_hls, nn_hls-1 ) 255 254 pu(ji,jj,jk) = pu(ji,jj,jk) + ( zpsi_uw(ji,jj,jk) - zpsi_uw(ji,jj,jk+1) ) 256 255 pv(ji,jj,jk) = pv(ji,jj,jk) + ( zpsi_vw(ji,jj,jk) - zpsi_vw(ji,jj,jk+1) ) 257 256 END_2D 258 DO_2D ( 0, 0, 0, 0)257 DO_2D_OVR( nn_hls-1, nn_hls-1, nn_hls-1, nn_hls-1 ) 259 258 pw(ji,jj,jk) = pw(ji,jj,jk) - ( zpsi_uw(ji,jj,jk) - zpsi_uw(ji-1,jj,jk) & 260 259 & + zpsi_vw(ji,jj,jk) - zpsi_vw(ji,jj-1,jk) ) * wmask(ji,jj,1) … … 262 261 END DO 263 262 264 ! TEMP: [tiling] These changes not necessary if using XIOS (subdomain support)265 263 IF( cdtype == 'TRA') THEN !== outputs ==! 266 IF( ntile == 0 .OR. ntile == 1 ) THEN ! Do only on the first tile267 ALLOCATE( zLf_NH(jpi,jpj), zpsiu_mle(jpi,jpj,jpk), zpsiv_mle(jpi,jpj,jpk) )268 zpsiu_mle(:,:,:) = 0._wp ; zpsiv_mle(:,:,:) = 0._wp269 ENDIF270 264 ! 271 265 IF (ln_osm_mle.and.ln_zdfosm) THEN … … 279 273 ENDIF 280 274 ! 275 CALL iom_put( "Lf_NHpf" , zLf_NH ) ! Lf = N H / f 276 ! 281 277 ! divide by cross distance to give streamfunction with dimensions m^2/s 282 278 DO_3D( 0, 0, 0, 0, 1, ikmax+1 ) 283 zpsi u_mle(ji,jj,jk) = zpsi_uw(ji,jj,jk) * r1_e2u(ji,jj)284 zpsi v_mle(ji,jj,jk) = zpsi_vw(ji,jj,jk) * r1_e1v(ji,jj)279 zpsi_uw(ji,jj,jk) = zpsi_uw(ji,jj,jk) * r1_e2u(ji,jj) 280 zpsi_vw(ji,jj,jk) = zpsi_vw(ji,jj,jk) * r1_e1v(ji,jj) 285 281 END_3D 286 287 IF( ntile == 0 .OR. ntile == nijtile ) THEN ! Do only on the last tile 288 CALL iom_put( "Lf_NHpf" , zLf_NH ) ! Lf = N H / f 289 CALL iom_put( "psiu_mle", zpsiu_mle ) ! i-mle streamfunction 290 CALL iom_put( "psiv_mle", zpsiv_mle ) ! j-mle streamfunction 291 DEALLOCATE( zLf_NH, zpsiu_mle, zpsiv_mle ) 292 ENDIF 282 CALL iom_put( "psiu_mle", zpsi_uw ) ! i-mle streamfunction 283 CALL iom_put( "psiv_mle", zpsi_vw ) ! j-mle streamfunction 293 284 ENDIF 294 285 !
Note: See TracChangeset
for help on using the changeset viewer.