Changeset 9181 for branches/UKMO
- Timestamp:
- 2018-01-04T15:38:10+01:00 (6 years ago)
- Location:
- branches/UKMO/AMM15_v3_6_STABLE_package/NEMOGCM/NEMO/OPA_SRC
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/UKMO/AMM15_v3_6_STABLE_package/NEMOGCM/NEMO/OPA_SRC/ASM/asminc.F90
r9180 r9181 40 40 #endif 41 41 USE sbc_oce ! Surface boundary condition variables. 42 USE zdfmxl, ONLY : & 43 & hmld_tref, & 44 #if defined key_karaml 45 & hmld_kara, & 46 & ln_kara, & 47 #endif 48 & hmld, & 49 & hmlp, & 50 & hmlpt 51 #if defined key_bdy 52 USE bdy_oce, ONLY: bdytmask 53 #endif 42 54 43 55 IMPLICIT NONE … … 90 102 REAL(wp), DIMENSION(:,:), ALLOCATABLE :: seaice_bkginc ! Increment to the background sea ice conc 91 103 104 INTEGER :: mld_choice = 4 !: choice of mld criteria to use for physics assimilation 105 !: 1) hmld - Turbocline/mixing depth [W points] 106 !: 2) hmlp - Density criterion (0.01 kg/m^3 change from 10m) [W points] 107 !: 3) hmld_kara - Kara MLD [Interpolated] 108 !: 4) hmld_tref - Temperature criterion (0.2 K change from surface) [T points] 109 110 92 111 !! * Substitutions 93 112 # include "domzgr_substitute.h90" … … 121 140 INTEGER :: iitiaustr_date ! Date YYYYMMDD of IAU interval start time step 122 141 INTEGER :: iitiaufin_date ! Date YYYYMMDD of IAU interval final time step 142 INTEGER :: isurfstat ! Local integer for status of reading surft variable 123 143 INTEGER :: iitavgbkg_date ! Date YYYYMMDD of end of assim bkg averaging period 124 144 ! … … 130 150 REAL(wp) :: zdate_inc ! Time axis in increments file 131 151 ! 152 REAL(wp), ALLOCATABLE, DIMENSION(:,:) :: & 153 & t_bkginc_2d ! file for reading in 2D 154 ! ! temperature increments 155 REAL(wp), ALLOCATABLE, DIMENSION(:,:) :: & 156 & z_mld ! Mixed layer depth 157 132 158 REAL(wp), POINTER, DIMENSION(:,:) :: hdiv ! 2D workspace 159 ! 160 LOGICAL :: lk_surft ! Logical: T => Increments file contains surft variable 161 ! so only apply surft increments. 133 162 !! 134 163 NAMELIST/nam_asminc/ ln_bkgwri, ln_avgbkg, & … … 136 165 & ln_asmdin, ln_asmiau, & 137 166 & nitbkg, nitdin, nitiaustr, nitiaufin, niaufn, & 138 & ln_salfix, salfixmin, nn_divdmp, nitavgbkg 167 & ln_salfix, salfixmin, nn_divdmp, nitavgbkg, mld_choice 139 168 !!---------------------------------------------------------------------- 140 169 … … 193 222 WRITE(numout,*) ' Logical switch for ensuring that the sa > salfixmin ln_salfix = ', ln_salfix 194 223 WRITE(numout,*) ' Minimum salinity after applying the increments salfixmin = ', salfixmin 224 WRITE(numout,*) ' Choice of MLD for physics assimilation mld_choice = ', mld_choice 195 225 ENDIF 196 226 … … 358 388 !-------------------------------------------------------------------- 359 389 360 ALLOCATE( t_bkginc(jpi,jpj,jpk) ) 361 ALLOCATE( s_bkginc(jpi,jpj,jpk) ) 362 ALLOCATE( u_bkginc(jpi,jpj,jpk) ) 363 ALLOCATE( v_bkginc(jpi,jpj,jpk) ) 364 ALLOCATE( ssh_bkginc(jpi,jpj) ) 365 ALLOCATE( seaice_bkginc(jpi,jpj)) 390 IF ( ln_trainc ) THEN 391 ALLOCATE( t_bkginc(jpi,jpj,jpk) ) 392 ALLOCATE( s_bkginc(jpi,jpj,jpk) ) 393 t_bkginc(:,:,:) = 0.0 394 s_bkginc(:,:,:) = 0.0 395 ENDIF 396 IF ( ln_dyninc ) THEN 397 ALLOCATE( u_bkginc(jpi,jpj,jpk) ) 398 ALLOCATE( v_bkginc(jpi,jpj,jpk) ) 399 u_bkginc(:,:,:) = 0.0 400 v_bkginc(:,:,:) = 0.0 401 ENDIF 402 IF ( ln_sshinc ) THEN 403 ALLOCATE( ssh_bkginc(jpi,jpj) ) 404 ssh_bkginc(:,:) = 0.0 405 ENDIF 406 IF ( ln_seaiceinc ) THEN 407 ALLOCATE( seaice_bkginc(jpi,jpj)) 408 seaice_bkginc(:,:) = 0.0 409 ENDIF 366 410 #if defined key_asminc 367 411 ALLOCATE( ssh_iau(jpi,jpj) ) 368 #endif369 t_bkginc(:,:,:) = 0.0370 s_bkginc(:,:,:) = 0.0371 u_bkginc(:,:,:) = 0.0372 v_bkginc(:,:,:) = 0.0373 ssh_bkginc(:,:) = 0.0374 seaice_bkginc(:,:) = 0.0375 #if defined key_asminc376 412 ssh_iau(:,:) = 0.0 377 413 #endif … … 409 445 410 446 IF ( ln_trainc ) THEN 411 CALL iom_get( inum, jpdom_autoglo, 'bckint', t_bkginc, 1 ) 412 CALL iom_get( inum, jpdom_autoglo, 'bckins', s_bkginc, 1 ) 413 ! Apply the masks 414 t_bkginc(:,:,:) = t_bkginc(:,:,:) * tmask(:,:,:) 415 s_bkginc(:,:,:) = s_bkginc(:,:,:) * tmask(:,:,:) 416 ! Set missing increments to 0.0 rather than 1e+20 417 ! to allow for differences in masks 418 WHERE( ABS( t_bkginc(:,:,:) ) > 1.0e+10 ) t_bkginc(:,:,:) = 0.0 419 WHERE( ABS( s_bkginc(:,:,:) ) > 1.0e+10 ) s_bkginc(:,:,:) = 0.0 447 448 !Test if the increments file contains the surft variable. 449 isurfstat = iom_varid( inum, 'bckinsurft', ldstop = .FALSE. ) 450 IF ( isurfstat == -1 ) THEN 451 lk_surft = .FALSE. 452 ELSE 453 lk_surft = .TRUE. 454 CALL ctl_warn( ' Applying 2D temperature increment to bottom of ML: ', & 455 & ' bckinsurft found in increments file.' ) 456 ENDIF 457 458 IF (lk_surft) THEN 459 460 ALLOCATE(z_mld(jpi,jpj)) 461 SELECT CASE(mld_choice) 462 CASE(1) 463 z_mld = hmld 464 CASE(2) 465 z_mld = hmlp 466 CASE(3) 467 #if defined key_karaml 468 IF ( ln_kara ) THEN 469 z_mld = hmld_kara 470 ELSE 471 CALL ctl_stop("Kara mixed layer not calculated as ln_kara=.false.") 472 ENDIF 473 #else 474 CALL ctl_stop("Kara mixed layer not defined in current version of NEMO") ! JW: Safety feature, should be removed 475 ! once the Kara mixed layer is available 476 #endif 477 CASE(4) 478 z_mld = hmld_tref 479 END SELECT 480 481 ALLOCATE( t_bkginc_2d(jpi,jpj) ) 482 CALL iom_get( inum, jpdom_autoglo, 'bckinsurft', t_bkginc_2d, 1) 483 #if defined key_bdy 484 DO jk = 1,jpkm1 485 WHERE( z_mld(:,:) > fsdepw(:,:,jk) ) 486 t_bkginc(:,:,jk) = t_bkginc_2d(:,:) * 0.5 * & 487 & ( 1 + cos( (fsdept(:,:,jk)/z_mld(:,:) ) * rpi ) ) 488 489 t_bkginc(:,:,jk) = t_bkginc(:,:,jk) * bdytmask(:,:) 490 ELSEWHERE 491 t_bkginc(:,:,jk) = 0. 492 ENDWHERE 493 ENDDO 494 #else 495 t_bkginc(:,:,:) = 0. 496 #endif 497 s_bkginc(:,:,:) = 0. 498 499 DEALLOCATE(z_mld, t_bkginc_2d) 500 501 ELSE 502 503 CALL iom_get( inum, jpdom_autoglo, 'bckint', t_bkginc, 1 ) 504 CALL iom_get( inum, jpdom_autoglo, 'bckins', s_bkginc, 1 ) 505 ! Apply the masks 506 t_bkginc(:,:,:) = t_bkginc(:,:,:) * tmask(:,:,:) 507 s_bkginc(:,:,:) = s_bkginc(:,:,:) * tmask(:,:,:) 508 ! Set missing increments to 0.0 rather than 1e+20 509 ! to allow for differences in masks 510 WHERE( ABS( t_bkginc(:,:,:) ) > 1.0e+10 ) t_bkginc(:,:,:) = 0.0 511 WHERE( ABS( s_bkginc(:,:,:) ) > 1.0e+10 ) s_bkginc(:,:,:) = 0.0 512 513 ENDIF 514 420 515 ENDIF 421 516 -
branches/UKMO/AMM15_v3_6_STABLE_package/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfmxl.F90
r8393 r9181 27 27 PRIVATE 28 28 29 PUBLIC zdf_mxl_tref ! called by asminc.F90 29 30 PUBLIC zdf_mxl ! called by step.F90 30 31 32 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: hmld_tref !: mixed layer depth at t-points - temperature criterion [m] 31 33 INTEGER , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: nmln !: number of level in the mixed layer (used by TOP) 32 34 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: hmld !: mixing layer depth (turbocline) [m] … … 78 80 & ll_found(jpi,jpj), ll_belowml(jpi,jpj,jpk), STAT= zdf_mxl_alloc ) 79 81 ! 82 ALLOCATE(hmld_tref(jpi,jpj)) 80 83 IF( lk_mpp ) CALL mpp_sum ( zdf_mxl_alloc ) 81 84 IF( zdf_mxl_alloc /= 0 ) CALL ctl_warn('zdf_mxl_alloc: failed to allocate arrays.') … … 84 87 END FUNCTION zdf_mxl_alloc 85 88 89 90 SUBROUTINE zdf_mxl_tref() 91 !!---------------------------------------------------------------------- 92 !! *** ROUTINE zdf_mxl_tref *** 93 !! 94 !! ** Purpose : Compute the mixed layer depth with temperature criteria. 95 !! 96 !! ** Method : The temperature-defined mixed layer depth is required 97 !! when assimilating SST in a 2D analysis. 98 !! 99 !! ** Action : hmld_tref 100 !!---------------------------------------------------------------------- 101 ! 102 INTEGER :: ji, jj, jk ! dummy loop indices 103 REAL(wp) :: t_ref ! Reference temperature 104 REAL(wp) :: temp_c = 0.2 ! temperature criterion for mixed layer depth 105 !!---------------------------------------------------------------------- 106 ! 107 ! Initialise array 108 IF( zdf_mxl_alloc() /= 0 ) CALL ctl_stop( 'STOP', 'zdf_mxl_tref : unable to allocate arrays' ) 109 110 !For the AMM model assimiation uses a temperature based mixed layer depth 111 !This is defined here 112 DO jj = 1, jpj 113 DO ji = 1, jpi 114 hmld_tref(ji,jj)=fsdept(ji,jj,1 ) 115 IF(ssmask(ji,jj) > 0.)THEN 116 t_ref=tsn(ji,jj,1,jp_tem) 117 DO jk=2,jpk 118 IF(ssmask(ji,jj)==0.)THEN 119 hmld_tref(ji,jj)=fsdept(ji,jj,jk ) 120 EXIT 121 ELSEIF( ABS(tsn(ji,jj,jk,jp_tem)-t_ref) < temp_c)THEN 122 hmld_tref(ji,jj)=fsdept(ji,jj,jk ) 123 ELSE 124 EXIT 125 ENDIF 126 ENDDO 127 ENDIF 128 ENDDO 129 ENDDO 130 131 END SUBROUTINE zdf_mxl_tref 86 132 87 133 SUBROUTINE zdf_mxl( kt ) -
branches/UKMO/AMM15_v3_6_STABLE_package/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90
r8561 r9181 480 480 481 481 ! ! Assimilation increments 482 IF( lk_asminc ) CALL asm_inc_init ! Initialize assimilation increments 482 IF( lk_asminc ) THEN 483 #if defined key_shelf 484 CALL zdf_mxl_tref() ! Initialization of hmld_tref 485 #endif 486 CALL asm_inc_init ! Initialize assimilation increments 487 ENDIF 488 483 489 IF(lwp) WRITE(numout,*) 'Euler time step switch is ', neuler 484 490 CALL dia_tmb_init ! TMB outputs
Note: See TracChangeset
for help on using the changeset viewer.