Changeset 15505
 Timestamp:
 20211115T11:03:27+01:00 (6 months ago)
 Location:
 NEMO/branches/UKMO/NEMO_4.0.4_CO9_packagemixlyr/src/OCE
 Files:

 2 edited
Legend:
 Unmodified
 Added
 Removed

NEMO/branches/UKMO/NEMO_4.0.4_CO9_packagemixlyr/src/OCE/SBC/cpl_oasis3.F90
r14075 r15505 27 27 #if defined key_oasis3 28 28 USE mod_oasis ! OASIS3MCT module 29 #endif 30 #if defined key_iomput && defined key_xios25 31 USE xios, ONLY:xios_oasis_enddef 29 32 #endif 30 33 USE par_oce ! ocean parameters … … 310 313 IF( agrif_fixed() == Agrif_Nb_Fine_Grids() ) THEN 311 314 #endif 315 ! 316 #if defined key_iomput && defined key_xios25 317 !needed for XIOS 2.5 318 CALL xios_oasis_enddef() 319 #endif 320 ! 312 321 CALL oasis_enddef(nerror) 313 322 IF( nerror /= OASIS_Ok ) CALL oasis_abort ( ncomp_id, 'cpl_define', 'Failure in oasis_enddef') 
NEMO/branches/UKMO/NEMO_4.0.4_CO9_packagemixlyr/src/OCE/ZDF/zdfmxl.F90
r14078 r15505 28 28 PUBLIC zdf_mxl ! called by zdfphy.F90 29 29 30 INTEGER , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: nmln !: number of level in the mixed layer (used by LDF, ZDF, TRD, TOP) 31 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: hmld !: mixing layer depth (turbocline) [m] (used by TOP) 32 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: hmlp !: mixed layer depth (rho=rho0+zdcrit) [m] (used by LDF) 33 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: hmlpt !: depth of the last Tpoint inside the mixed layer [m] (used by LDF) 34 REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:,:) :: hmld_zint !: verticallyinterpolated mixed layer depth [m] 35 REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:,:) :: htc_mld ! Heat content of hmld_zint 36 LOGICAL, PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: ll_found ! Is T_b to be found by interpolation ? 30 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: hmld_tref !: mixed layer depth at tpoints  temperature criterion [m] 31 INTEGER , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: nmln !: number of level in the mixed layer (used by TOP) 32 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: hmld !: mixing layer depth (turbocline) [m] 33 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: hmlp !: mixed layer depth (rho=rho0+zdcrit) [m] 34 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: hmlpt !: depth of the last Tpoint inside the mixed layer [m] 35 REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:,:,:) :: hmld_zint !: verticallyinterpolated mixed layer depth [m] 36 REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:,:,:) :: htc_mld ! Heat content of hmld_zint 37 LOGICAL, PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: ll_found ! Is T_b to be found by interpolation ? 37 38 LOGICAL, PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: ll_belowml ! Flag points below mixed layer when ll_found=F 38 39 … … 47 48 END TYPE MXL_ZINT 48 49 50 !Used for 25h mean 51 LOGICAL, PRIVATE :: mld_25h_init = .TRUE. !Logical used to initalise 25h 52 !outputs. Necessary, because we need to 53 !initalise the mld_25h on the zeroth 54 !timestep (i.e in the nemogcm_init call) 55 LOGICAL, PRIVATE :: mld_25h_write = .FALSE. !Logical confirm 25h calculating/processing 56 INTEGER, SAVE :: i_cnt_25h ! Counter for 25 hour means 57 INTEGER, PRIVATE :: nn_mld_diag = 0 ! number of diagnostics 58 INTEGER, PRIVATE, PARAMETER :: MAX_DIAG = 5 ! maximum number of diagnostics 59 LOGICAL, PRIVATE, DIMENSION(MAX_DIAG) :: cmld_zint, cmld_mld 60 61 REAL(wp),SAVE, ALLOCATABLE, DIMENSION(:,:,:) :: hmld_zint_25h 62 49 63 !! 50 64 !! NEMO/OCE 4.0 , NEMO Consortium (2018) … … 60 74 zdf_mxl_alloc = 0 ! set to zero if no array to be allocated 61 75 IF( .NOT. ALLOCATED( nmln ) ) THEN 62 ALLOCATE( nmln(jpi,jpj), hmld(jpi,jpj), hmlp(jpi,jpj), hmlpt(jpi,jpj), hmld_zint(jpi,jpj), & 63 & htc_mld(jpi,jpj), ll_found(jpi,jpj), ll_belowml(jpi,jpj,jpk), STAT= zdf_mxl_alloc ) 76 ALLOCATE( nmln(jpi,jpj), hmld(jpi,jpj), hmlp(jpi,jpj), hmlpt(jpi,jpj), hmld_zint(jpi,jpj, MAX_DIAG), & 77 htc_mld(jpi,jpj,MAX_DIAG), ll_found(jpi,jpj), ll_belowml(jpi,jpj,jpk), STAT= zdf_mxl_alloc ) 78 ! 79 ALLOCATE(hmld_tref(jpi,jpj)) 64 80 ! 65 81 CALL mpp_sum ( 'zdfmxl', zdf_mxl_alloc ) … … 179 195 !! 180 196 181 TYPE(MXL_ZINT), INTENT(in) :: sf197 TYPE(MXL_ZINT), DIMENSION(MAX_DIAG), INTENT(in) :: sf 182 198 183 199 ! Diagnostic criteria … … 202 218 REAL, DIMENSION(jpi,jpj) :: zdelta_T ! difference critereon 203 219 REAL, DIMENSION(jpi,jpj) :: zRHO1, zRHO2 ! Densities 204 INTEGER :: ji, jj, jk 220 INTEGER :: ji, jj, jk, jn ! loop counter 205 221 206 222 !! 207 223 ! 208 224 ! Unpack structure 209 nn_mld_type = sf%mld_type 210 rn_zref = sf%zref 211 rn_dT_crit = sf%dT_crit 212 rn_iso_frac = sf%iso_frac 213 214 ! Set the mixed layer depth criterion at each grid point 215 IF( nn_mld_type == 0 ) THEN 216 zdelta_T(:,:) = rn_dT_crit 217 zT(:,:,:) = rhop(:,:,:) 218 ELSE IF( nn_mld_type == 1 ) THEN 219 ppzdep(:,:)=0.0 220 call eos ( tsn(:,:,1,:), ppzdep(:,:), zRHO1(:,:) ) 225 DO jn=1, nn_mld_diag 226 IF( cmld_zint(jn) .OR. cmld_mld(jn) ) THEN 227 nn_mld_type = sf(jn)%mld_type 228 rn_zref = sf(jn)%zref 229 rn_dT_crit = sf(jn)%dT_crit 230 rn_iso_frac = sf(jn)%iso_frac 231 232 ! Set the mixed layer depth criterion at each grid point 233 IF( nn_mld_type == 0 ) THEN 234 zdelta_T(:,:) = rn_dT_crit 235 zT(:,:,:) = rhop(:,:,:) 236 ELSE IF( nn_mld_type == 1 ) THEN 237 ppzdep(:,:)=0.0 238 call eos ( tsn(:,:,1,:), ppzdep(:,:), zRHO1(:,:) ) 221 239 ! Use zT temporarily as a copy of tsn with rn_dT_crit added to SST 222 240 ! [assumes number of tracers less than number of vertical levels] 223 zT(:,:,1:jpts)=tsn(:,:,1,1:jpts)224 zT(:,:,jp_tem)=zT(:,:,1)+rn_dT_crit225 CALL eos( zT(:,:,1:jpts), ppzdep(:,:), zRHO2(:,:) )226 zdelta_T(:,:) = abs( zRHO1(:,:)  zRHO2(:,:) ) * rau0227 ! RHO from eos (2d version) doesn't calculate north or east halo:228 CALL lbc_lnk( 'zdfmxl', zdelta_T, 'T', 1. )229 zT(:,:,:) = rhop(:,:,:)230 ELSE231 zdelta_T(:,:) = rn_dT_crit232 zT(:,:,:) = tsn(:,:,:,jp_tem)233 END IF234 235 ! Calculate the gradient of zT and absolute difference for use later236 DO jk = 1 ,jpk2237 zdTdz(:,:,jk) = ( zT(:,:,jk+1)  zT(:,:,jk) ) / e3w_n(:,:,jk+1)238 zmoddT(:,:,jk) = abs( zT(:,:,jk+1)  zT(:,:,jk) )239 END DO240 241 ! Find density/temperature at the reference level (Kara et al use 10m).242 ! ik_ref is the index of the box centre immediately above or at the reference level243 ! Find rn_zref in the array of model level depths and find the ref244 ! density/temperature by linear interpolation.245 DO jk = jpkm1, 2, 1246 WHERE ( gdept_n(:,:,jk) > rn_zref )247 ik_ref(:,:) = jk  1248 zT_ref(:,:) = zT(:,:,jk1) + zdTdz(:,:,jk1) * ( rn_zref  gdept_n(:,:,jk1) )249 END WHERE250 END DO251 252 ! If the first grid box centre is below the reference level then use the253 ! top model level to get zT_ref254 WHERE ( gdept_n(:,:,1) > rn_zref )255 zT_ref = zT(:,:,1)256 ik_ref = 1257 END WHERE258 259 ! The number of active tracer levels is 1 less than the number of active w levels260 ikmt(:,:) = mbkt(:,:)  1261 262 ! Initialize / reset263 ll_found(:,:) = .false.264 265 IF ( rn_iso_frac  zepsilon > 0. ) THEN266 ! Search for a uniform density/temperature region where adjacent levels267 ! differ by less than rn_iso_frac * deltaT.268 ! ik_iso is the index of the last level in the uniform layer269 ! ll_found indicates whether the mixed layer depth can be found by interpolation270 ik_iso(:,:) = ik_ref(:,:)271 DO jj = 1, nlcj272 DO ji = 1, nlci241 zT(:,:,1:jpts)=tsn(:,:,1,1:jpts) 242 zT(:,:,jp_tem)=zT(:,:,1)+rn_dT_crit 243 CALL eos( zT(:,:,1:jpts), ppzdep(:,:), zRHO2(:,:) ) 244 zdelta_T(:,:) = abs( zRHO1(:,:)  zRHO2(:,:) ) * rau0 245 ! RHO from eos (2d version) doesn't calculate north or east halo: 246 CALL lbc_lnk( 'zdfmxl', zdelta_T, 'T', 1. ) 247 zT(:,:,:) = rhop(:,:,:) 248 ELSE 249 zdelta_T(:,:) = rn_dT_crit 250 zT(:,:,:) = tsn(:,:,:,jp_tem) 251 END IF 252 253 ! Calculate the gradient of zT and absolute difference for use later 254 DO jk = 1 ,jpk2 255 zdTdz(:,:,jk) = ( zT(:,:,jk+1)  zT(:,:,jk) ) / e3w_n(:,:,jk+1) 256 zmoddT(:,:,jk) = abs( zT(:,:,jk+1)  zT(:,:,jk) ) 257 END DO 258 259 ! Find density/temperature at the reference level (Kara et al use 10m). 260 ! ik_ref is the index of the box centre immediately above or at the reference level 261 ! Find rn_zref in the array of model level depths and find the ref 262 ! density/temperature by linear interpolation. 263 DO jk = jpkm1, 2, 1 264 WHERE ( gdept_n(:,:,jk) > rn_zref ) 265 ik_ref(:,:) = jk  1 266 zT_ref(:,:) = zT(:,:,jk1) + zdTdz(:,:,jk1) * ( rn_zref  gdept_n(:,:,jk1) ) 267 END WHERE 268 END DO 269 270 ! If the first grid box centre is below the reference level then use the 271 ! top model level to get zT_ref 272 WHERE ( gdept_n(:,:,1) > rn_zref ) 273 zT_ref = zT(:,:,1) 274 ik_ref = 1 275 END WHERE 276 277 ! The number of active tracer levels is 1 less than the number of active w levels 278 ikmt(:,:) = mbkt(:,:)  1 279 280 ! Initialize / reset 281 ll_found(:,:) = .false. 282 283 IF ( rn_iso_frac  zepsilon > 0. ) THEN 284 ! Search for a uniform density/temperature region where adjacent levels 285 ! differ by less than rn_iso_frac * deltaT. 286 ! ik_iso is the index of the last level in the uniform layer 287 ! ll_found indicates whether the mixed layer depth can be found by interpolation 288 ik_iso(:,:) = ik_ref(:,:) 289 DO jj = 1, nlcj 290 DO ji = 1, nlci 273 291 !CDIR NOVECTOR 274 DO jk = ik_ref(ji,jj), ikmt(ji,jj)1 275 IF ( zmoddT(ji,jj,jk) > ( rn_iso_frac * zdelta_T(ji,jj) ) ) THEN 276 ik_iso(ji,jj) = jk 277 ll_found(ji,jj) = ( zmoddT(ji,jj,jk) > zdelta_T(ji,jj) ) 278 EXIT 279 END IF 292 DO jk = ik_ref(ji,jj), ikmt(ji,jj)1 293 IF ( zmoddT(ji,jj,jk) > ( rn_iso_frac * zdelta_T(ji,jj) ) ) THEN 294 ik_iso(ji,jj) = jk 295 ll_found(ji,jj) = ( zmoddT(ji,jj,jk) > zdelta_T(ji,jj) ) 296 EXIT 297 END IF 298 END DO 299 END DO 300 END DO 301 302 ! Use linear interpolation to find depth of mixed layer base where possible 303 hmld_zint(:,:,jn) = rn_zref 304 DO jj = 1, jpj 305 DO ji = 1, jpi 306 IF (ll_found(ji,jj) .and. tmask(ji,jj,1) == 1.0) THEN 307 zdz = abs( zdelta_T(ji,jj) / zdTdz(ji,jj,ik_iso(ji,jj)) ) 308 hmld_zint(ji,jj,jn) = gdept_n(ji,jj,ik_iso(ji,jj)) + zdz 309 END IF 310 END DO 311 END DO 312 END IF 313 314 ! If ll_found = .false. then calculate MLD using difference of zdelta_T 315 ! from the reference density/temperature 316 317 ! Prevent this section from working on land points 318 WHERE ( tmask(:,:,1) /= 1.0 ) 319 ll_found = .true. 320 END WHERE 321 322 DO jk=1, jpk 323 ll_belowml(:,:,jk) = abs( zT(:,:,jk)  zT_ref(:,:) ) >= zdelta_T(:,:) 324 END DO 325 326 ! Set default value where interpolation cannot be used (ll_found=false) 327 DO jj = 1, jpj 328 DO ji = 1, jpi 329 IF ( .not. ll_found(ji,jj) ) hmld_zint(ji,jj,jn) = gdept_n(ji,jj,ikmt(ji,jj)) 280 330 END DO 281 331 END DO 282 END DO 283 284 ! Use linear interpolation to find depth of mixed layer base where possible 285 hmld_zint(:,:) = rn_zref 286 DO jj = 1, jpj 287 DO ji = 1, jpi 288 IF (ll_found(ji,jj) .and. tmask(ji,jj,1) == 1.0) THEN 289 zdz = abs( zdelta_T(ji,jj) / zdTdz(ji,jj,ik_iso(ji,jj)) ) 290 hmld_zint(ji,jj) = gdept_n(ji,jj,ik_iso(ji,jj)) + zdz 291 END IF 332 333 DO jj = 1, jpj 334 DO ji = 1, jpi 335 !CDIR NOVECTOR 336 DO jk = ik_ref(ji,jj)+1, ikmt(ji,jj) 337 IF ( ll_found(ji,jj) ) EXIT 338 IF ( ll_belowml(ji,jj,jk) ) THEN 339 zT_b = zT_ref(ji,jj) + zdelta_T(ji,jj) * SIGN(1.0, zdTdz(ji,jj,jk1) ) 340 zdT = zT_b  zT(ji,jj,jk1) 341 zdz = zdT / zdTdz(ji,jj,jk1) 342 hmld_zint(ji,jj,jn) = gdept_n(ji,jj,jk1) + zdz 343 EXIT 344 END IF 345 END DO 346 END DO 292 347 END DO 293 END DO 294 END IF 295 296 ! If ll_found = .false. then calculate MLD using difference of zdelta_T 297 ! from the reference density/temperature 298 299 ! Prevent this section from working on land points 300 WHERE ( tmask(:,:,1) /= 1.0 ) 301 ll_found = .true. 302 END WHERE 303 304 DO jk=1, jpk 305 ll_belowml(:,:,jk) = abs( zT(:,:,jk)  zT_ref(:,:) ) >= zdelta_T(:,:) 306 END DO 307 308 ! Set default value where interpolation cannot be used (ll_found=false) 309 DO jj = 1, jpj 310 DO ji = 1, jpi 311 IF ( .not. ll_found(ji,jj) ) hmld_zint(ji,jj) = gdept_n(ji,jj,ikmt(ji,jj)) 312 END DO 313 END DO 314 315 DO jj = 1, jpj 316 DO ji = 1, jpi 317 !CDIR NOVECTOR 318 DO jk = ik_ref(ji,jj)+1, ikmt(ji,jj) 319 IF ( ll_found(ji,jj) ) EXIT 320 IF ( ll_belowml(ji,jj,jk) ) THEN 321 zT_b = zT_ref(ji,jj) + zdelta_T(ji,jj) * SIGN(1.0, zdTdz(ji,jj,jk1) ) 322 zdT = zT_b  zT(ji,jj,jk1) 323 zdz = zdT / zdTdz(ji,jj,jk1) 324 hmld_zint(ji,jj) = gdept_n(ji,jj,jk1) + zdz 325 EXIT 326 END IF 327 END DO 328 END DO 329 END DO 330 331 hmld_zint(:,:) = hmld_zint(:,:)*tmask(:,:,1) 348 349 hmld_zint(:,:,jn) = hmld_zint(:,:,jn)*tmask(:,:,1) 350 END IF 351 END DO 332 352 ! 333 353 END SUBROUTINE zdf_mxl_zint_mld … … 344 364 INTEGER, INTENT(in) :: kt ! ocean timestep index 345 365 346 INTEGER :: ji, jj, jk 366 INTEGER :: ji, jj, jk, jn 347 367 INTEGER :: ikmax 348 368 REAL(wp) :: zc, zcoef … … 360 380 ENDIF 361 381 362 ! Find last whole model T level above the MLD 363 ilevel(:,:) = 0 364 zthick_0(:,:) = 0._wp 365 366 DO jk = 1, jpkm1 367 DO jj = 1, jpj 368 DO ji = 1, jpi 369 zthick_0(ji,jj) = zthick_0(ji,jj) + e3t_n(ji,jj,jk) 370 IF( zthick_0(ji,jj) < hmld_zint(ji,jj) ) ilevel(ji,jj) = jk 382 DO jn=1, nn_mld_diag 383 IF( cmld_mld(jn) ) THEN 384 ! Find last whole model T level above the MLD 385 ilevel(:,:) = 0 386 zthick_0(:,:) = 0._wp 387 388 DO jk = 1, jpkm1 389 DO jj = 1, jpj 390 DO ji = 1, jpi 391 zthick_0(ji,jj) = zthick_0(ji,jj) + e3t_n(ji,jj,jk) 392 IF( zthick_0(ji,jj) < hmld_zint(ji,jj,jn) ) ilevel(ji,jj) = jk 393 END DO 394 END DO 395 WRITE(numout,*) 'zthick_0(jk =',jk,') =',zthick_0(2,2) 396 WRITE(numout,*) 'gdepw_n(jk+1 =',jk+1,') =',gdepw_n(2,2,jk+1) 371 397 END DO 372 END DO 373 WRITE(numout,*) 'zthick_0(jk =',jk,') =',zthick_0(2,2) 374 WRITE(numout,*) 'gdepw_n(jk+1 =',jk+1,') =',gdepw_n(2,2,jk+1) 398 399 ! Surface boundary condition 400 IF( ln_linssh ) THEN ; zthick(:,:) = sshn(:,:) ; htc_mld(:,:,jn) = tsn(:,:,1,jp_tem) * sshn(:,:) * tmask(:,:,1) 401 ELSE ; zthick(:,:) = 0._wp ; htc_mld(:,:,jn) = 0._wp 402 ENDIF 403 404 ! Deepest whole T level above the MLD 405 ikmax = MIN( MAXVAL( ilevel(:,:) ), jpkm1 ) 406 407 ! Integration down to last whole model T level 408 DO jk = 1, ikmax 409 DO jj = 1, jpj 410 DO ji = 1, jpi 411 zc = e3t_n(ji,jj,jk) * REAL( MIN( MAX( 0, ilevel(ji,jj)  jk + 1 ) , 1 ) ) ! 0 below ilevel 412 zthick(ji,jj) = zthick(ji,jj) + zc 413 htc_mld(ji,jj,jn) = htc_mld(ji,jj,jn) + zc * tsn(ji,jj,jk,jp_tem) * tmask(ji,jj,jk) 414 END DO 415 END DO 416 END DO 417 418 ! Subsequent partial T level 419 zthick(:,:) = hmld_zint(:,:,jn)  zthick(:,:) ! remaining thickness to reach MLD 420 421 DO jj = 1, jpj 422 DO ji = 1, jpi 423 htc_mld(ji,jj,jn) = htc_mld(ji,jj,jn) + tsn(ji,jj,ilevel(ji,jj)+1,jp_tem) & 424 & * MIN( e3t_n(ji,jj,ilevel(ji,jj)+1), zthick(ji,jj) ) * tmask(ji,jj,ilevel(ji,jj)+1) 425 END DO 426 END DO 427 428 WRITE(numout,*) 'htc_mld(after) =',htc_mld(2,2,jn) 429 430 ! Convert to heat content 431 zcoef = rau0 * rcp 432 htc_mld(:,:,jn) = zcoef * htc_mld(:,:,jn) 433 END IF 375 434 END DO 376 377 ! Surface boundary condition378 IF( ln_linssh ) THEN ; zthick(:,:) = sshn(:,:) ; htc_mld(:,:) = tsn(:,:,1,jp_tem) * sshn(:,:) * tmask(:,:,1)379 ELSE ; zthick(:,:) = 0._wp ; htc_mld(:,:) = 0._wp380 ENDIF381 382 ! Deepest whole T level above the MLD383 ikmax = MIN( MAXVAL( ilevel(:,:) ), jpkm1 )384 385 ! Integration down to last whole model T level386 DO jk = 1, ikmax387 DO jj = 1, jpj388 DO ji = 1, jpi389 zc = e3t_n(ji,jj,jk) * REAL( MIN( MAX( 0, ilevel(ji,jj)  jk + 1 ) , 1 ) ) ! 0 below ilevel390 zthick(ji,jj) = zthick(ji,jj) + zc391 htc_mld(ji,jj) = htc_mld(ji,jj) + zc * tsn(ji,jj,jk,jp_tem) * tmask(ji,jj,jk)392 END DO393 END DO394 END DO395 396 ! Subsequent partial T level397 zthick(:,:) = hmld_zint(:,:)  zthick(:,:) ! remaining thickness to reach MLD398 399 DO jj = 1, jpj400 DO ji = 1, jpi401 htc_mld(ji,jj) = htc_mld(ji,jj) + tsn(ji,jj,ilevel(ji,jj)+1,jp_tem) &402 & * MIN( e3t_n(ji,jj,ilevel(ji,jj)+1), zthick(ji,jj) ) * tmask(ji,jj,ilevel(ji,jj)+1)403 END DO404 END DO405 406 WRITE(numout,*) 'htc_mld(after) =',htc_mld(2,2)407 408 ! Convert to heat content409 zcoef = rau0 * rcp410 htc_mld(:,:) = zcoef * htc_mld(:,:)411 435 412 436 END SUBROUTINE zdf_mxl_zint_htc … … 426 450 INTEGER :: jn 427 451 428 INTEGER :: nn_mld_diag = 0 ! number of diagnostics429 430 452 CHARACTER(len=1) :: cmld 431 432 TYPE(MXL_ZINT) :: sn_mld1, sn_mld2, sn_mld3, sn_mld4, sn_mld5 433 TYPE(MXL_ZINT), SAVE, DIMENSION(5) :: mld_diags 434 435 NAMELIST/namzdf_mldzint/ nn_mld_diag, sn_mld1, sn_mld2, sn_mld3, sn_mld4, sn_mld5 453 TYPE(MXL_ZINT), SAVE, DIMENSION(MAX_DIAG) :: mld_diags 454 455 NAMELIST/namzdf_mldzint/ nn_mld_diag, mld_diags 436 456 437 457 !! … … 447 467 IF(lwm) WRITE ( numond, namzdf_mldzint ) 448 468 449 IF( nn_mld_diag > 5 ) CALL ctl_stop( 'STOP', 'zdf_mxl_ini: Specify no more than 5 MLD definitions' )450 451 mld_diags(1) = sn_mld1 452 mld_diags(2) = sn_mld2453 mld_diags(3) = sn_mld3454 mld_diags(4) = sn_mld4455 mld_diags(5) = sn_mld5456 457 IF( lwp .AND. (nn_mld_diag > 0) ) THEN458 WRITE(numout,*) '=============== Verticallyinterpolated mixed layer ================'459 WRITE(numout,*) '(Diagnostic number, nn_mld_type, rn_zref, rn_dT_crit, rn_iso_frac)' 469 WRITE(cmld,'(I1)') MAX_DIAG 470 IF( nn_mld_diag > MAX_DIAG ) CALL ctl_stop( 'STOP', 'zdf_mxl_ini: Specify no more than ', 'cmld', ' MLD definitions' ) 471 472 cmld_zint=.false. 473 cmld_mld=.false. 474 IF( nn_mld_diag > 0 ) THEN 475 IF( lwp ) THEN 476 WRITE(numout,*) '=============== Verticallyinterpolated mixed layer ================' 477 WRITE(numout,*) '(Diagnostic number, nn_mld_type, rn_zref, rn_dT_crit, rn_iso_frac)' 478 END IF 479 460 480 DO jn = 1, nn_mld_diag 461 WRITE(numout,*) 'MLD criterion',jn,':' 462 WRITE(numout,*) ' nn_mld_type =', mld_diags(jn)%mld_type 463 WRITE(numout,*) ' rn_zref =' , mld_diags(jn)%zref 464 WRITE(numout,*) ' rn_dT_crit =' , mld_diags(jn)%dT_crit 465 WRITE(numout,*) ' rn_iso_frac =', mld_diags(jn)%iso_frac 481 ! Check if the diagnostics is being written to the output 482 WRITE(cmld,'(I1)') jn 483 IF( iom_use( "mldzint_"//cmld ) ) cmld_zint(jn)=.true. 484 IF( iom_use( "mldhtc_"//cmld ) ) cmld_mld(jn) =.true. 485 486 IF( lwp ) THEN 487 WRITE(numout,*) 'MLD criterion',jn,':' 488 WRITE(numout,*) ' nn_mld_type =', mld_diags(jn)%mld_type 489 WRITE(numout,*) ' rn_zref =' , mld_diags(jn)%zref 490 WRITE(numout,*) ' rn_dT_crit =' , mld_diags(jn)%dT_crit 491 WRITE(numout,*) ' rn_iso_frac =', mld_diags(jn)%iso_frac 492 END IF 466 493 END DO 467 494 WRITE(numout,*) '====================================================================' … … 470 497 471 498 IF( nn_mld_diag > 0 ) THEN 499 CALL zdf_mxl_zint_mld( mld_diags ) 500 CALL zdf_mxl_zint_htc( kt ) 501 472 502 DO jn = 1, nn_mld_diag 473 503 WRITE(cmld,'(I1)') jn 474 IF( iom_use( "mldzint_"//cmld ) .OR. iom_use( "mldhtc_"//cmld ) ) THEN 475 CALL zdf_mxl_zint_mld( mld_diags(jn) ) 476 477 IF( iom_use( "mldzint_"//cmld ) ) THEN 478 CALL iom_put( "mldzint_"//cmld, hmld_zint(:,:) ) 479 ENDIF 480 481 IF( iom_use( "mldhtc_"//cmld ) ) THEN 482 CALL zdf_mxl_zint_htc( kt ) 483 CALL iom_put( "mldhtc_"//cmld , htc_mld(:,:) ) 484 ENDIF 504 IF( cmld_zint(jn) ) THEN 505 CALL iom_put( "mldzint_"//cmld, hmld_zint(:,:,jn) ) 506 ENDIF 507 508 IF( cmld_mld(jn) ) THEN 509 CALL iom_put( "mldhtc_"//cmld , htc_mld(:,:,jn) ) 485 510 ENDIF 486 511 END DO
Note: See TracChangeset
for help on using the changeset viewer.