- Timestamp:
- 2016-04-07T18:21:30+02:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/UKMO/dev_r5518_GC3p0_package/NEMOGCM/NEMO/OPA_SRC/ZDF/zdftke.F90
r6440 r6448 83 83 INTEGER :: nn_htau ! type of tke profile of penetration (=0/1) 84 84 REAL(wp) :: rn_efr ! fraction of TKE surface value which penetrates in the ocean 85 REAL(wp) :: rn_c ! fraction of TKE added within the mixed layer by nn_etau 85 86 LOGICAL :: ln_lc ! Langmuir cells (LC) as a source term of TKE or not 86 87 REAL(wp) :: rn_lc ! coef to compute vertical velocity of Langmuir cells … … 88 89 REAL(wp) :: ri_cri ! critic Richardson number (deduced from rn_ediff and rn_ediss values) 89 90 REAL(wp) :: rmxl_min ! minimum mixing length value (deduced from rn_ediff and rn_emin values) [m] 91 REAL(wp) :: rhtau ! coefficient to relate MLD to htau when nn_htau == 2 90 92 REAL(wp) :: rhftau_add = 1.e-3_wp ! add offset applied to HF part of taum (nn_etau=3) 91 93 REAL(wp) :: rhftau_scl = 1.0_wp ! scale factor applied to HF part of taum (nn_etau=3) 92 94 95 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: e_niw !: TKE budget- near-inertial waves term 93 96 REAL(wp) , ALLOCATABLE, SAVE, DIMENSION(:,:) :: htau ! depth of tke penetration (nn_htau) 97 REAL(wp) , ALLOCATABLE, SAVE, DIMENSION(:,:) :: efr ! surface boundary condition for nn_etau = 4 94 98 REAL(wp) , ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: dissl ! now mixing lenght of dissipation 95 99 #if defined key_c1d … … 118 122 & e_pdl(jpi,jpj,jpk) , e_ric(jpi,jpj,jpk) , & 119 123 #endif 120 & htau (jpi,jpj) , dissl(jpi,jpj,jpk) , STAT= zdf_tke_alloc ) 124 & htau (jpi,jpj) , dissl(jpi,jpj,jpk) , & 125 & efr (jpi,jpj) , e_niw(jpi,jpj,jpk) , & 126 & STAT= zdf_tke_alloc ) 121 127 ! 122 128 IF( lk_mpp ) CALL mpp_sum ( zdf_tke_alloc ) … … 428 434 END DO 429 435 436 ! ! Save TKE prior to nn_etau addition 437 e_niw(:,:,:) = en(:,:,:) 438 ! 430 439 ! !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 431 440 ! ! TKE due to surface and internal wave breaking 432 441 ! !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 442 IF( nn_htau == 2 ) THEN !* mixed-layer depth dependant length scale 443 DO jj = 2, jpjm1 444 DO ji = fs_2, fs_jpim1 ! vector opt. 445 htau(ji,jj) = rhtau * hmlp(ji,jj) 446 END DO 447 END DO 448 ENDIF 449 #if defined key_iomput 450 ! 451 CALL iom_put( "htau", htau(:,:) ) ! Check htau (even if constant in time) 452 #endif 453 ! 433 454 IF( nn_etau == 1 ) THEN !* penetration below the mixed layer (rn_efr fraction) 434 455 DO jk = 2, jpkm1 … … 465 486 END DO 466 487 END DO 488 ELSEIF( nn_etau == 4 ) THEN !* column integral independant of htau (rn_efr must be scaled up) 489 IF( nn_htau == 2 ) THEN ! efr dependant on time-varying htau 490 DO jj = 2, jpjm1 491 DO ji = fs_2, fs_jpim1 ! vector opt. 492 efr(ji,jj) = rn_efr / ( htau(ji,jj) * ( 1._wp - EXP( -bathy(ji,jj) / htau(ji,jj) ) ) ) 493 END DO 494 END DO 495 ENDIF 496 DO jk = 2, jpkm1 497 DO jj = 2, jpjm1 498 DO ji = fs_2, fs_jpim1 ! vector opt. 499 en(ji,jj,jk) = en(ji,jj,jk) + efr(ji,jj) * en(ji,jj,1) * EXP( -fsdepw(ji,jj,jk) / htau(ji,jj) ) & 500 & * ( 1._wp - fr_i(ji,jj) ) * tmask(ji,jj,jk) 501 END DO 502 END DO 503 END DO 467 504 ENDIF 468 505 CALL lbc_lnk( en, 'W', 1. ) ! Lateral boundary conditions (sign unchanged) 506 ! 507 DO jk = 2, jpkm1 ! TKE budget: near-inertial waves term 508 DO jj = 2, jpjm1 509 DO ji = fs_2, fs_jpim1 ! vector opt. 510 e_niw(ji,jj,jk) = en(ji,jj,jk) - e_niw(ji,jj,jk) 511 END DO 512 END DO 513 END DO 514 ! 515 CALL lbc_lnk( e_niw, 'W', 1. ) 469 516 ! 470 517 CALL wrk_dealloc( jpi,jpj, imlc ) ! integer … … 730 777 & rn_emin0, rn_bshear, nn_mxl , ln_mxl0 , & 731 778 & rn_mxl0 , nn_pdl , ln_lc , rn_lc , & 732 & nn_etau , nn_htau , rn_efr 733 !!---------------------------------------------------------------------- 734 ! 779 & nn_etau , nn_htau , rn_efr , rn_c 780 !!---------------------------------------------------------------------- 781 ! 782 ! NB. Default values of namelist parameters should be set in the reference namelist 783 ! but setting this one here because we aren't set up to use the reference namelist 784 ! properly yet. 785 rn_c = 0.8_wp 786 735 787 REWIND( numnam_ref ) ! Namelist namzdf_tke in reference namelist : Turbulent Kinetic Energy 736 788 READ ( numnam_ref, namzdf_tke, IOSTAT = ios, ERR = 901) … … 776 828 WRITE(numout,*) ' flag for computation of exp. tke profile nn_htau = ', nn_htau 777 829 WRITE(numout,*) ' fraction of en which pene. the thermocline rn_efr = ', rn_efr 830 WRITE(numout,*) ' fraction of TKE added within the mixed layer by nn_etau rn_c = ', rn_c 778 831 WRITE(numout,*) 779 832 WRITE(numout,*) ' critical Richardson nb with your parameters ri_cri = ', ri_cri … … 786 839 IF( nn_mxl < 0 .OR. nn_mxl > 3 ) CALL ctl_stop( 'bad flag: nn_mxl is 0, 1 or 2 ' ) 787 840 IF( nn_pdl < 0 .OR. nn_pdl > 1 ) CALL ctl_stop( 'bad flag: nn_pdl is 0 or 1 ' ) 788 IF( nn_htau < 0 .OR. nn_htau > 1 ) CALL ctl_stop( 'bad flag: nn_htau is 0, 1 or 2' )841 IF( nn_htau < 0 .OR. nn_htau > 5 ) CALL ctl_stop( 'bad flag: nn_htau is 0 to 5 ' ) 789 842 IF( nn_etau == 3 .AND. .NOT. ln_cpl ) CALL ctl_stop( 'nn_etau == 3 : HF taum only known in coupled mode' ) 790 843 … … 794 847 ENDIF 795 848 796 IF( nn_etau == 2 ) THEN 797 ierr = zdf_mxl_alloc() 798 nmln(:,:) = nlb10 ! Initialization of nmln 799 ENDIF 849 IF( nn_etau == 2 .OR. ( nn_etau /= 0 .AND. nn_htau == 2 ) ) CALL zdf_mxl( nit000 - 1 ) ! Initialization of nmln and hmlp 800 850 801 851 ! !* depth of penetration of surface tke 802 852 IF( nn_etau /= 0 ) THEN 853 htau(:,:) = 0._wp 803 854 SELECT CASE( nn_htau ) ! Choice of the depth of penetration 804 855 CASE( 0 ) ! constant depth penetration (here 10 meters) … … 806 857 CASE( 1 ) ! F(latitude) : 0.5m to 30m poleward of 40 degrees 807 858 htau(:,:) = MAX( 0.5_wp, MIN( 30._wp, 45._wp* ABS( SIN( rpi/180._wp * gphit(:,:) ) ) ) ) 859 CASE( 2 ) ! fraction of depth-integrated TKE within mixed-layer 860 rhtau = -1._wp / LOG( 1._wp - rn_c ) 861 CASE( 3 ) ! F(latitude) : 0.5m to 15m poleward of 20 degrees 862 htau(:,:) = MAX( 0.5_wp, MIN( 15._wp, 45._wp* ABS( SIN( rpi/180._wp * gphit(:,:) ) ) ) ) 863 CASE( 4 ) ! F(latitude) : 0.5m to 10m/30m poleward of 13/40 degrees north/south 864 DO jj = 2, jpjm1 865 DO ji = fs_2, fs_jpim1 ! vector opt. 866 IF( gphit(ji,jj) <= 0._wp ) THEN 867 htau(ji,jj) = MAX( 0.5_wp, MIN( 30._wp, 45._wp* ABS( SIN( rpi/180._wp * gphit(ji,jj) ) ) ) ) 868 ELSE 869 htau(ji,jj) = MAX( 0.5_wp, MIN( 10._wp, 45._wp* ABS( SIN( rpi/180._wp * gphit(ji,jj) ) ) ) ) 870 ENDIF 871 END DO 872 END DO 873 CASE ( 5 ) ! F(latitude) : 0.5m to 10m poleward of 13 degrees north/south, 874 DO jj = 2, jpjm1 ! 10m to 30m between 30/45 degrees south 875 DO ji = fs_2, fs_jpim1 ! vector opt. 876 IF( gphit(ji,jj) <= -30._wp ) THEN 877 htau(ji,jj) = MAX( 10._wp, MIN( 30._wp, 55._wp* ABS( SIN( rpi/120._wp * ( gphit(ji,jj) + 23._wp ) ) ) ) ) 878 ELSE 879 htau(ji,jj) = MAX( 0.5_wp, MIN( 10._wp, 45._wp* ABS( SIN( rpi/180._wp * gphit(ji,jj) ) ) ) ) 880 ENDIF 881 END DO 882 END DO 808 883 END SELECT 884 ! 885 IF( nn_etau == 4 .AND. nn_htau /= 2 ) THEN ! efr dependant on constant htau 886 DO jj = 2, jpjm1 887 DO ji = fs_2, fs_jpim1 ! vector opt. 888 efr(ji,jj) = rn_efr / ( htau(ji,jj) * ( 1._wp - EXP( -bathy(ji,jj) / htau(ji,jj) ) ) ) 889 END DO 890 END DO 891 ENDIF 809 892 ENDIF 810 893 ! !* set vertical eddy coef. to the background value
Note: See TracChangeset
for help on using the changeset viewer.