- Timestamp:
- 2021-02-21T17:04:44+01:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
NEMO/branches/NERC/dev_r11078_OSMOSIS_IMMERSE_Nurser_4.0/src/OCE/ZDF/zdfosm.F90
r14520 r14521 118 118 LOGICAL :: ln_convmix = .true. ! Convective instability mixing 119 119 REAL(wp) :: rn_difconv = 1._wp ! diffusivity when unstable below BL (m2/s) 120 121 #ifdef key_osm_debug 122 INTEGER :: nn_idb = 297, nn_jdb = 193, nn_kdb = 35, nn_narea_db = 109 123 INTEGER :: iloc_db, jloc_db 124 #endif 125 ! 120 126 121 127 ! OSMOSIS mixed layer eddy parametrization constants … … 394 400 zdiffut(:,:,:) = 0._wp ; zviscos(:,:,:) = 0._wp ; ghamt(:,:,:) = 0._wp 395 401 ghams(:,:,:) = 0._wp ; ghamu(:,:,:) = 0._wp ; ghamv(:,:,:) = 0._wp 402 403 404 #ifdef key_osm_debug 405 IF(narea==nn_narea_db)THEN 406 iloc_db=mi0(nn_idb); jloc_db=mj0(nn_jdb) 407 408 WRITE(narea+100,*) 409 WRITE(narea+100,'(a,i7)')'timestep=',kt 410 WRITE(narea+100,'(3(a,i7))')'narea=',narea,' nn_idb',nn_idb,' nn_jdb=',nn_jdb 411 WRITE(narea+100,'(4(a,i7))')'iloc_db=',iloc_db,' jloc_db',jloc_db,' jpi=',jpi,' jpj=',jpj 412 ji=iloc_db; jj=jloc_db 413 WRITE(narea+100,'(a,i7,5(a,g10.2))')'mbkt=',mbkt(ji,jj),' ht_n',ht_n(ji,jj),& 414 &' hu_n-',hu_n(ji-1,jj),' hu_n+',hu_n(ji,jj), ' hv_n-',hv_n(ji,jj-1),' hv_n+',hv_n(ji,jj) 415 WRITE(narea+100,*) 416 FLUSH(narea+100) 417 END IF 418 #endif 396 419 397 420 ! hbl = MAX(hbl,epsln) … … 440 463 zcos_wind(ji,jj) = -zuw0(ji,jj) / ( zustar(ji,jj) * zustar(ji,jj) ) 441 464 zsin_wind(ji,jj) = -zvw0(ji,jj) / ( zustar(ji,jj) * zustar(ji,jj) ) 465 #ifdef key_osm_debug 466 IF(narea==nn_narea_db.and.ji==iloc_db.and.jj==jloc_db)THEN 467 WRITE(narea+100,'(4(3(a,g11.3),/), 2(a,g11.3),/)') & 468 & 'after calculating fluxes: hbl=', hbl(ji,jj),' zthermal=',zthermal, ' zbeta=', zbeta,& 469 & ' zrad0=', zrad0(ji,jj),' zradh=', zradh(ji,jj), ' zradav=', zradav(ji,jj), & 470 & ' zwth0=', zwth0(ji,jj), ' zwthav=', zwthav(ji,jj), ' zws0=', zws0(ji,jj), & 471 & ' zwb0=', zwb0(ji,jj), ' zwb0tot=', zwb0tot(ji,jj), ' zwb0tot_in hbl=', zwb0tot(ji,jj) + grav * zthermal * zradh(ji,jj),& 472 & ' zwbav=', zwbav(ji,jj) 473 FLUSH(narea+100) 474 END IF 475 #endif 442 476 END DO 443 477 END DO … … 484 518 END DO 485 519 END SELECT 520 #ifdef key_osm_debug 521 IF(narea==nn_narea_db)THEN 522 WRITE(narea+100,'(2(a,g11.3))') & 523 & 'Before reduction: zustke=', zustke(iloc_db,jloc_db),' dstokes =',dstokes(iloc_db,jloc_db) 524 FLUSH(narea+100) 525 END IF 526 #endif 486 527 487 528 IF (ln_zdfosm_ice_shelter) THEN … … 571 612 zhol(ji,jj) = -hbl(ji,jj) * 2.0 * zwbav(ji,jj)/ (zvstr(ji,jj)**3 + epsln ) 572 613 ENDIF 614 #ifdef key_osm_debug 615 IF(narea==nn_narea_db.and.ji==iloc_db.and.jj==jloc_db)THEN 616 WRITE(narea+100,'(2(a,g11.3),/,3(a,g11.3),/,2(a,g11.3),/)') & 617 & 'After reduction: zustke=', zustke(ji,jj), ' dstokes=', dstokes(ji,jj), & 618 & ' zustar =', zustar(ji,jj), ' zwstrl=', zwstrl(ji,jj), ' zwstrc=', zwstrc(ji,jj),& 619 & ' zhol=', zhol(ji,jj), ' zla=', zla(ji,jj) 620 FLUSH(narea+100) 621 END IF 622 #endif 573 623 END DO 574 624 END DO … … 605 655 END DO 606 656 END DO 607 ! Averages over well-mixed and boundary layer 657 #ifdef key_osm_debug 658 IF(narea==nn_narea_db) THEN 659 ji=iloc_db; jj=jloc_db 660 WRITE(narea+100,'(2(a,g11.3),/,3(a,g11.3),/,2(a,i7),/)') & 661 & 'Before updating hbl: hbl=', hbl(ji,jj), ' dh=', dh(ji,jj), & 662 &' zhbl =',zhbl(ji,jj) , ' zhml=', zhml(ji,jj), ' zdh=', zdh(ji,jj),& 663 &' imld=', imld(ji,jj), ' ibld=', ibld(ji,jj) 664 665 WRITE(narea+100,'(a,g11.3,a,2g11.3)') 'Physics: ssh ',sshn(ji,jj),' T S surface=',tsn(ji,jj,1,jp_tem),tsn(ji,jj,1,jp_sal) 666 jl = imld(ji,jj) - 1; jm = MIN(ibld(ji,jj) + 2, mbkt(ji,jj) ) 667 WRITE(narea+100,'(a,*(g11.3))') ' T[imld-1..ibld+2] =', ( tsn(ji,jj,jk,jp_tem), jk=jl,jm ) 668 WRITE(narea+100,'(a,*(g11.3))') ' S[imld-1..ibld+2] =', ( tsn(ji,jj,jk,jp_sal), jk=jl,jm ) 669 WRITE(narea+100,'(a,*(g11.3))') ' U+[imld-1..ibld+2] =', ( un(ji,jj,jk), jk=jl,jm ) 670 WRITE(narea+100,'(a,*(g11.3))') ' U-[imld-1..ibld+2] =', ( un(ji-1,jj,jk), jk=jl,jm ) 671 WRITE(narea+100,'(a,*(g11.3))') ' V+[imld-1..ibld+2] =', ( vn(ji,jj,jk), jk=jl,jm ) 672 WRITE(narea+100,'(a,*(g11.3))') ' V-[imld-1..ibld+2] =', ( vn(ji,jj-1,jk), jk=jl,jm ) 673 WRITE(narea+100,'(a,*(g11.3))') ' W[imld-1..ibld+2] =', ( wn(ji,jj-1,jk), jk=jl,jm ) 674 WRITE(narea+100,*) 675 FLUSH(narea+100) 676 END IF 677 #endif 678 679 ! Averages over well-mixed and boundary layer, note BL averages use jp_ext=2 everywhere 608 680 jp_ext(:,:) = 2 609 681 CALL zdf_osm_vertical_average(ibld, jp_ext, zt_bl, zs_bl, zb_bl, zu_bl, zv_bl, zdt_bl, zds_bl, zdb_bl, zdu_bl, zdv_bl) 610 682 ! jp_ext(:,:) = ibld(:,:) - imld(:,:) + 1 611 683 CALL zdf_osm_vertical_average(imld-1, ibld-imld+1, zt_ml, zs_ml, zb_ml, zu_ml, zv_ml, zdt_ml, zds_ml, zdb_ml, zdu_ml, zdv_ml) 684 #ifdef key_osm_debug 685 IF(narea==nn_narea_db) THEN 686 ji=iloc_db; jj=jloc_db 687 WRITE(narea+100,'(4(3(a,g11.3),/), 2(4(a,g11.3),/))') & 688 & 'After averaging, with old hbl (& jp_ext==2), hml: zt_bl=', zt_bl(ji,jj),& 689 & ' zs_bl=', zs_bl(ji,jj), ' zb_bl=', zb_bl(ji,jj),& 690 & 'zdt_bl=', zdt_bl(ji,jj), ' zds_bl=', zds_bl(ji,jj), ' zdb_bl=', zdb_bl(ji,jj),& 691 & 'zt_ml=', zt_ml(ji,jj), ' zs_ml=', zs_ml(ji,jj), ' zb_ml=', zb_ml(ji,jj),& 692 & 'zdt_ml=', zdt_ml(ji,jj), ' zds_ml=', zds_ml(ji,jj), ' zdb_ml=', zdb_ml(ji,jj),& 693 & 'zu_bl =', zu_bl(ji,jj) , ' zv_bl=', zv_bl(ji,jj), ' zdu_bl=', zdu_bl(ji,jj), ' zdv_bl=', zdv_bl(ji,jj),& 694 & 'zu_ml =', zu_ml(ji,jj) , ' zv_ml=', zv_ml(ji,jj), ' zdu_ml=', zdu_ml(ji,jj), ' zdv_ml=', zdv_ml(ji,jj) 695 FLUSH(narea+100) 696 END IF 697 #endif 612 698 ! Velocity components in frame aligned with surface stress. 613 699 CALL zdf_osm_velocity_rotation( zcos_wind, zsin_wind, zu_ml, zv_ml, zdu_ml, zdv_ml ) 614 700 CALL zdf_osm_velocity_rotation( zcos_wind, zsin_wind, zu_bl, zv_bl, zdu_bl, zdv_bl ) 701 #ifdef key_osm_debug 702 IF(narea==nn_narea_db) THEN 703 ji=iloc_db; jj=jloc_db 704 WRITE(narea+100,'(a,/, 2(4(a,g11.3),/))') & 705 & 'After rotation, with old hbl (& jp_ext==2), hml:', & 706 & 'zu_bl =', zu_bl(ji,jj) , ' zv_bl=', zv_bl(ji,jj), ' zdu_bl=', zdu_bl(ji,jj), ' zdv_bl=', zdv_bl(ji,jj),& 707 & 'zu_ml =', zu_ml(ji,jj) , ' zv_ml=', zv_ml(ji,jj), ' zdu_ml=', zdu_ml(ji,jj), ' zdv_ml=', zdv_ml(ji,jj) 708 FLUSH(narea+100) 709 END IF 710 #endif 711 615 712 ! Determine the state of the OSBL, stable/unstable, shear/no shear 616 713 CALL zdf_osm_osbl_state( lconv, lshear, j_ddh, zwb_ent, zwb_min, zshear ) 617 714 715 #ifdef key_osm_debug 716 IF(narea==nn_narea_db) THEN 717 ji=iloc_db; jj=jloc_db 718 WRITE(narea+100,'(2(a,l7),a, i7,/,3(a,g11.3),/)') & 719 & 'After zdf_osm_osbl_state: lconv=', lconv(ji,jj), ' lshear=', lshear(ji,jj), ' j_ddh=', j_ddh(ji,jj),& 720 & 'zwb_ent=', zwb_ent(ji,jj), ' zwb_min=', zwb_min(ji,jj), ' zshear=', zshear(ji,jj) 721 FLUSH(narea+100) 722 END IF 723 #endif 618 724 IF ( ln_osm_mle ) THEN 619 725 ! Fox-Kemper Scheme … … 634 740 END DO 635 741 END DO 742 #ifdef key_osm_debug 743 IF(narea==nn_narea_db) THEN 744 ji=iloc_db; jj=jloc_db 745 WRITE(narea+100,'(2(a,g11.3), a, i7,/,2(3(a,g11.3),/),4(a,g11.3),/)') & 746 & 'Before updating hmle: hmle =',hmle(ji,jj) , ' zhmle=', zhmle(ji,jj), ' mld_prof=', mld_prof(ji,jj), & 747 & 'averaging over hmle: zt_mle=', zt_mle(ji,jj), ' zs_mle=', zs_mle(ji,jj), ' zb_mle=', zb_mle(ji,jj),& 748 & 'zdt_mle=', zdt_mle(ji,jj), ' zds_mle=', zds_mle(ji,jj), ' zdb_mle=', zdb_mle(ji,jj),& 749 & 'zu_mle =', zu_mle(ji,jj), ' zv_mle=', zv_mle(ji,jj), ' zdu_mle=', zdu_mle(ji,jj), ' zdv_mle=', zdv_mle(ji,jj) 750 FLUSH(narea+100) 751 END IF 752 #endif 636 753 637 754 !! Calculate fairly-well-mixed depth zmld & its index mld_prof + lateral zmld-averaged gradients … … 643 760 !! recalculate hmle, zmle, zvel_mle, zdiff_mle & redefine mld_proc to be index for new hmle 644 761 CALL zdf_osm_mle_parameters( zmld, mld_prof, hmle, zhmle, zvel_mle, zdiff_mle ) 762 #ifdef key_osm_debug 763 IF(narea==nn_narea_db) THEN 764 ji=iloc_db; jj=jloc_db 765 WRITE(narea+100,'(a,g11.3,a,i7,/, 2(4(a,g11.3),/),2(a,g11.3),/,2(3(a,g11.3),/),a,i7,2(a,g11.3),/,3(a,g11.3),/,/)') & 766 & 'Before updating hmle: zmld =',zmld(ji,jj),' mld_prof=', mld_prof(ji,jj), & 767 & 'zdtdx+=', zdtdx(ji,jj),' zdtdx-=', zdtdx(ji-1,jj),' zdsdx+=', zdsdx(ji,jj),' zdsdx-=',zdsdx(ji-1,jj), & 768 & 'zdtdy+=', zdtdy(ji,jj),' zdtdy-=', zdtdy(ji,jj-1),' zdsdy+=', zdsdy(ji,jj),' zdsdy-=',zdsdy(ji,jj-1), & 769 & 'dbdx_mle+=', dbdx_mle(ji,jj),' dbdx_mle-=', dbdx_mle(ji-1,jj),& 770 & 'dbdy_mle+=', dbdy_mle(ji,jj),' dbdy_mle-=',dbdy_mle(ji,jj-1),' zdbds_mle=',zdbds_mle(ji,jj), & 771 & 'zdtdz_mle_ext=', zdtdz_mle_ext(ji,jj), ' zdsdz_mle_ext=', zdsdz_mle_ext(ji,jj), & 772 & ' zdbdz_mle_ext=', zdbdz_mle_ext(ji,jj), & 773 & 'After updating hmle: mld_prof=', mld_prof(ji,jj),' hmle=', hmle(ji,jj), ' zhmle=', zhmle(ji,jj),& 774 & 'zvel_mle =', zvel_mle(ji,jj), ' zdiff_mle=', zdiff_mle(ji,jj), ' zwb_fk=', zwb_fk(ji,jj) 775 FLUSH(narea+100) 776 END IF 777 #endif 645 778 ELSE ! ln_osm_mle 646 779 ! FK not selected, Boundary Layer only. … … 676 809 END DO 677 810 END DO 811 #ifdef key_osm_debug 812 IF(narea==nn_narea_db) THEN 813 ji=iloc_db; jj=jloc_db 814 WRITE(narea+100,'(4(a,l7),a,i7,/, 3(a,g11.3),/)') & 815 & 'BL logical descriptors: lconv =',lconv(ji,jj),' lpyc=', lpyc(ji,jj),' lflux=', lflux(ji,jj),' lmle=', lmle(ji,jj),& 816 & ' jp_ext=', jp_ext(ji,jj), & 817 & 'sub-BL strat: zdtdz_bl_ext=', zdtdz_bl_ext(ji,jj),' zdsdz_bl_ext=', zdsdz_bl_ext(ji,jj),' zdbdz_bl_ext=', zdbdz_bl_ext(ji,jj) 818 FLUSH(narea+100) 819 END IF 820 #endif 678 821 679 822 ! Recalculate bl averages using jp_ext & ml averages .... note no rotation of u & v here.. … … 681 824 ! jp_ext = ibld-imld+1 682 825 CALL zdf_osm_vertical_average(imld-1, ibld-imld+1, zt_ml, zs_ml, zb_ml, zu_ml, zv_ml, zdt_ml, zds_ml, zdb_ml, zdu_ml, zdv_ml) 826 #ifdef key_osm_debug 827 IF(narea==nn_narea_db) THEN 828 ji=iloc_db; jj=jloc_db 829 WRITE(narea+100,'(4(3(a,g11.3),/), 2(4(a,g11.3),/))') & 830 & 'After averaging, with old hbl (&correct jp_ext), hml: zt_bl=', zt_bl(ji,jj),& 831 & ' zs_bl=', zs_bl(ji,jj), ' zb_bl=', zb_bl(ji,jj),& 832 & 'zdt_bl=', zdt_bl(ji,jj), ' zds_bl=', zds_bl(ji,jj), ' zdb_bl=', zdb_bl(ji,jj),& 833 & 'zt_ml=', zt_ml(ji,jj), ' zs_ml=', zs_ml(ji,jj), ' zb_ml=', zb_ml(ji,jj),& 834 & 'zdt_ml=', zdt_ml(ji,jj), ' zds_ml=', zds_ml(ji,jj), ' zdb_ml=', zdb_ml(ji,jj),& 835 & 'zu_bl =', zu_bl(ji,jj) , ' zv_bl=', zv_bl(ji,jj), ' zdu_bl=', zdu_bl(ji,jj), ' zdv_bl=', zdv_bl(ji,jj),& 836 & 'zu_ml =', zu_ml(ji,jj) , ' zv_ml=', zv_ml(ji,jj), ' zdu_ml=', zdu_ml(ji,jj), ' zdv_ml=', zdv_ml(ji,jj) 837 FLUSH(narea+100) 838 END IF 839 #endif 840 683 841 684 842 ! Rate of change of hbl … … 692 850 lpyc(ji,jj) = .FALSE. 693 851 ENDIF 852 #ifdef key_osm_debug 853 IF(narea==nn_narea_db.and.ji==iloc_db.and.jj==jloc_db)THEN 854 WRITE(narea+100,'(2(a,g11.3),/,2(a,g11.3))')'after zdf_osm_calculate_dhdt: zhbl_t=',zhbl_t(ji,jj), 'hbl=', hbl(ji,jj),& 855 & 'delta hbl from dzdhdt', zdhdt(ji,jj)*rn_rdt,' delta hbl from w ', wn(ji,jj,ibld(ji,jj))*rn_rdt 856 FLUSH(narea+100) 857 END IF 858 #endif 694 859 END DO 695 860 END DO … … 736 901 ! rotate mean currents and changes onto wind align co-ordinates 737 902 ! 903 #ifdef key_osm_debug 904 IF(narea==nn_narea_db) THEN 905 ji=iloc_db; jj=jloc_db 906 WRITE(narea+100,'(4(3(a,g11.3),/), 2(4(a,g11.3),/))') & 907 & 'After averaging, with new hbl (&correct jp_ext), hml: zt_bl=', zt_bl(ji,jj),& 908 & ' zs_bl=', zs_bl(ji,jj), ' zb_bl=', zb_bl(ji,jj),& 909 & 'zdt_bl=', zdt_bl(ji,jj), ' zds_bl=', zds_bl(ji,jj), ' zdb_bl=', zdb_bl(ji,jj),& 910 & 'zt_ml=', zt_ml(ji,jj), ' zs_ml=', zs_ml(ji,jj), ' zb_ml=', zb_ml(ji,jj),& 911 & 'zdt_ml=', zdt_ml(ji,jj), ' zds_ml=', zds_ml(ji,jj), ' zdb_ml=', zdb_ml(ji,jj),& 912 & 'zu_bl =', zu_bl(ji,jj) , ' zv_bl=', zv_bl(ji,jj), ' zdu_bl=', zdu_bl(ji,jj), ' zdv_bl=', zdv_bl(ji,jj),& 913 & 'zu_ml =', zu_ml(ji,jj) , ' zv_ml=', zv_ml(ji,jj), ' zdu_ml=', zdu_ml(ji,jj), ' zdv_ml=', zdv_ml(ji,jj) 914 FLUSH(narea+100) 915 END IF 916 #endif 738 917 CALL zdf_osm_velocity_rotation( zcos_wind, zsin_wind, zu_ml, zv_ml, zdu_ml, zdv_ml ) 739 918 CALL zdf_osm_velocity_rotation( zcos_wind, zsin_wind, zu_bl, zv_bl, zdu_bl, zdv_bl ) 919 #ifdef key_osm_debug 920 IF(narea==nn_narea_db) THEN 921 ji=iloc_db; jj=jloc_db 922 WRITE(narea+100,'(a,/, 2(4(a,g11.3),/))') & 923 & 'After rotation, with new hbl (& correct jp_ext), hml:', & 924 & 'zu_bl =', zu_bl(ji,jj) , ' zv_bl=', zv_bl(ji,jj), ' zdu_bl=', zdu_bl(ji,jj), ' zdv_bl=', zdv_bl(ji,jj),& 925 & 'zu_ml =', zu_ml(ji,jj) , ' zv_ml=', zv_ml(ji,jj), ' zdu_ml=', zdu_ml(ji,jj), ' zdv_ml=', zdv_ml(ji,jj) 926 FLUSH(narea+100) 927 END IF 928 #endif 740 929 !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 741 930 ! Pycnocline gradients for scalars and velocity … … 745 934 CALL zdf_osm_pycnocline_scalar_profiles( zdtdz_pyc, zdsdz_pyc, zdbdz_pyc, zalpha_pyc ) 746 935 CALL zdf_osm_pycnocline_shear_profiles( zdudz_pyc, zdvdz_pyc ) 936 #ifdef key_osm_debug 937 IF(narea==nn_narea_db) THEN 938 ji=iloc_db; jj=jloc_db 939 jl = imld(ji,jj) - 1; jm = MIN(ibld(ji,jj) + 2, mbkt(ji,jj) ) 940 WRITE(narea+100,'(a,l7,/,3(a,g11.3),/)') & 941 & 'After pycnocline profiles BL lpyc=', lpyc(ji,jj),& 942 & 'sub-BL strat: zdtdz_bl_ext=', zdtdz_bl_ext(ji,jj),' zdsdz_bl_ext=', zdsdz_bl_ext(ji,jj),' zdbdz_bl_ext=', zdbdz_bl_ext(ji,jj), & 943 & 'Pycnocline: zalpha_pyc=', zalpha_pyc(ji,jj) 944 WRITE(narea+100,'(a,*(g11.3))') ' zdtdz_pyc[imld-1..ibld+2] =', ( zdtdz_pyc(ji,jj,jk), jk=jl,jm ) 945 WRITE(narea+100,'(a,*(g11.3))') ' zdsdz_pyc[imld-1..ibld+2] =', ( zdsdz_pyc(ji,jj,jk), jk=jl,jm ) 946 WRITE(narea+100,'(a,*(g11.3))') ' zdbdz_pyc[imld-1..ibld+2] =', ( zdbdz_pyc(ji,jj,jk), jk=jl,jm ) 947 WRITE(narea+100,'(a,*(g11.3))') ' zdudz_pyc[imld-1..ibld+2] =', ( zdudz_pyc(ji,jj,jk), jk=jl,jm ) 948 WRITE(narea+100,'(a,*(g11.3))') ' zdvdz_pyc[imld-1..ibld+2] =', ( zdvdz_pyc(ji,jj,jk), jk=jl,jm ) 949 WRITE(narea+100,*) 950 FLUSH(narea+100) 951 END IF 952 #endif 747 953 !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 748 954 ! Eddy viscosity/diffusivity and non-gradient terms in the flux-gradient relationship 749 955 !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 750 956 CALL zdf_osm_diffusivity_viscosity( zdiffut, zviscos ) 957 #ifdef key_osm_debug 958 IF(narea==nn_narea_db) THEN 959 ji=iloc_db; jj=jloc_db 960 jl = imld(ji,jj) - 1; jm = MIN(ibld(ji,jj) + 2, mbkt(ji,jj) ) 961 WRITE(narea+100,'(a,*(g11.3))') ' zdiffut[imld-1..ibld+2] =', ( zdiffut(ji,jj,jk), jk=jl,jm ) 962 WRITE(narea+100,'(a,*(g11.3))') ' zviscos[imld-1..ibld+2] =', ( zviscos(ji,jj,jk), jk=jl,jm ) 963 WRITE(narea+100,*) 964 FLUSH(narea+100) 965 END IF 966 #endif 751 967 752 968 ! … … 785 1001 END DO 786 1002 ENDIF ! endif for check on lconv 787 788 1003 END DO ! end of ji loop 789 1004 END DO ! end of jj loop … … 825 1040 END DO ! ji loop 826 1041 END DO ! jj loo 1042 #ifdef key_osm_debug 1043 IF(narea==nn_narea_db) THEN 1044 ji=iloc_db; jj=jloc_db 1045 jl = imld(ji,jj) - 1; jm = MIN(ibld(ji,jj) + 2, mbkt(ji,jj) ) 1046 WRITE(narea+100,'(a,g11.3)')'Stokes contrib to ghamt/s: zsc_wth_1=',zsc_wth_1(ji,jj), ' zsc_ws_1=',zsc_ws_1(ji,jj) 1047 WRITE(narea+100,'(a,*(g11.3))') ' ghamt[imld-1..ibld+2] =', ( ghamt(ji,jj,jk), jk=jl,jm ) 1048 WRITE(narea+100,'(a,*(g11.3))') ' ghams[imld-1..ibld+2] =', ( ghams(ji,jj,jk), jk=jl,jm ) 1049 IF( lconv(ji,jj) ) THEN 1050 WRITE(narea+100,'(3(a,g11.3))')'Stokes contrib to ghamu/v: zsc_uw_1=',zsc_uw_1(ji,jj), ' zsc_vw_1=',zsc_vw_1(ji,jj), & 1051 &' zsc_uw_2=',zsc_uw_2(ji,jj) 1052 ELSE 1053 WRITE(narea+100,'(2(a,g11.3))')'Stokes contrib to ghamu/v: zsc_uw_1=',zsc_uw_1(ji,jj), ' zsc_vw_1=',zsc_vw_1(ji,jj) 1054 END IF 1055 WRITE(narea+100,'(a,*(g11.3))') ' ghamu[imld-1..ibld+2] =', ( ghamu(ji,jj,jk), jk=jl,jm ) 1056 WRITE(narea+100,'(a,*(g11.3))') ' ghamv[imld-1..ibld+2] =', ( ghamv(ji,jj,jk), jk=jl,jm ) 1057 FLUSH(narea+100) 1058 END IF 1059 #endif 827 1060 828 1061 ! Buoyancy term in flux-gradient relationship [note : includes ROI ratio (X0.3) and pressure (X0.5)] … … 954 1187 END DO ! ji loop 955 1188 END DO ! jj loop 1189 1190 #ifdef key_osm_debug 1191 IF(narea==nn_narea_db) THEN 1192 ji=iloc_db; jj=jloc_db 1193 jl = imld(ji,jj) - 1; jm = MIN(ibld(ji,jj) + 2, mbkt(ji,jj) ) 1194 WRITE(narea+100,'(2(a,g11.3))')'Stokes + buoy + pyc contribs to ghamt/s: zsc_wth_1=',zsc_wth_1(ji,jj), ' zsc_ws_1=',zsc_ws_1(ji,jj) 1195 WRITE(narea+100,'(a,*(g11.3))') ' ghamt[imld-1..ibld+2] =', ( ghamt(ji,jj,jk), jk=jl,jm ) 1196 WRITE(narea+100,'(a,*(g11.3))') ' ghams[imld-1..ibld+2] =', ( ghams(ji,jj,jk), jk=jl,jm ) 1197 IF( lconv(ji,jj) ) THEN 1198 WRITE(narea+100,'(3(a,g11.3))')'Stokes + buoy + pyc contribs to ghamu/v: zsc_uw_1=',zsc_uw_1(ji,jj), ' zsc_vw_1=',zsc_vw_1(ji,jj), & 1199 &' zsc_uw_2=',zsc_uw_2(ji,jj) 1200 ELSE 1201 WRITE(narea+100,'(2(a,g11.3))')'Stokes + buoy + pyc contribs to ghamu/v: zsc_uw_1=',zsc_uw_1(ji,jj), ' zsc_vw_1=',zsc_vw_1(ji,jj) 1202 END IF 1203 WRITE(narea+100,'(a,*(g11.3))') ' ghamu[imld-1..ibld+2] =', ( ghamu(ji,jj,jk), jk=jl,jm ) 1204 WRITE(narea+100,'(a,*(g11.3))') ' ghamv[imld-1..ibld+2] =', ( ghamv(ji,jj,jk), jk=jl,jm ) 1205 FLUSH(narea+100) 1206 END IF 1207 #endif 956 1208 957 1209 IF(ln_dia_osm) THEN … … 1404 1656 zdifml_sc(ji,jj) = rn_dif_ml * zhml(ji,jj) * zvel_sc_ml 1405 1657 zvisml_sc(ji,jj) = rn_vis_ml * zdifml_sc(ji,jj) 1406 1658 #ifdef key_osm_debug 1659 IF(narea==nn_narea_db.and.ji==iloc_db.and.jj==jloc_db)THEN 1660 WRITE(narea+100,'(2(a,g11.3))')'Start of 1st major loop of osm_diffusivity_viscositys, lconv=T: zdifml_sc=',zdifml_sc(ji,jj),' zvisml_sc=',zvisml_sc(ji,jj) 1661 WRITE(narea+100,'(3(a,g11.3))')'zvel_sc_pyc=',zvel_sc_pyc,' zvel_sc_ml=',zvel_sc_ml,' zstab_fac=',zstab_fac 1662 FLUSH(narea+100) 1663 END IF 1664 #endif 1407 1665 IF ( lpyc(ji,jj) ) THEN 1408 1666 zdifpyc_n_sc(ji,jj) = rn_dif_pyc * zvel_sc_ml * zdh(ji,jj) 1409 1667 zvispyc_n_sc(ji,jj) = 0.09 * zvel_sc_pyc * ( 1.0 - zhbl(ji,jj) / zdh(ji,jj) )**2 * ( 0.005 * ( zu_ml(ji,jj)-zu_bl(ji,jj) )**2 + 0.0075 * ( zv_ml(ji,jj)-zv_bl(ji,jj) )**2 ) / zdh(ji,jj) 1668 zvispyc_n_sc(ji,jj) = rn_vis_pyc * zvel_sc_ml * zdh(ji,jj) + zvispyc_n_sc(ji,jj) * zstab_fac 1669 #ifdef key_osm_debug 1670 IF(narea==nn_narea_db.and.ji==iloc_db.and.jj==jloc_db)THEN 1671 WRITE(narea+100,'(2(a,g11.3))')' lpyc=lconv=T, variables w/o shear contributions: zdifpyc_n_sc',zdifpyc_n_sc(ji,jj) ,' zvispyc_n_sc=',zvispyc_n_sc(ji,jj) 1672 FLUSH(narea+100) 1673 END IF 1674 #endif 1410 1675 IF ( lshear(ji,jj) .AND. j_ddh(ji,jj) /= 2 ) THEN 1411 1676 zdifpyc_n_sc(ji,jj) = zdifpyc_n_sc(ji,jj) + rn_vispyc_shr * ( zshear(ji,jj) * zhbl(ji,jj) )**pthird * zhbl(ji,jj) 1412 ENDIF1413 1414 zdifpyc_s_sc(ji,jj) = zwb_ent(ji,jj) + 0.0025 * zvel_sc_pyc * ( zhbl(ji,jj) / zdh(ji,jj) - 1.0 ) * ( zb_ml(ji,jj) - zb_bl(ji,jj) )1415 zdifpyc_s_sc(ji,jj) = 0.09 * zdifpyc_s_sc(ji,jj) * zstab_fac1416 zdifpyc_s_sc(ji,jj) = MAX( zdifpyc_s_sc(ji,jj), -0.5 * zdifpyc_n_sc(ji,jj) )1417 1418 zvispyc_n_sc(ji,jj) = 0.09 * zvel_sc_pyc * ( 1.0 - zhbl(ji,jj) / zdh(ji,jj) )**2 * ( 0.005 * ( zu_ml(ji,jj)-zu_bl(ji,jj) )**2 + 0.0075 * ( zv_ml(ji,jj)-zv_bl(ji,jj) )**2 ) / zdh(ji,jj)1419 zvispyc_n_sc(ji,jj) = rn_vis_pyc * zvel_sc_ml * zdh(ji,jj) + zvispyc_n_sc(ji,jj) * zstab_fac1420 IF ( lshear(ji,jj) .AND. j_ddh(ji,jj) /= 2 ) THEN1421 1677 zvispyc_n_sc(ji,jj) = zvispyc_n_sc(ji,jj) + rn_vispyc_shr * ( zshear(ji,jj) * zhbl(ji,jj ) )**pthird * zhbl(ji,jj) 1422 1678 ENDIF 1423 1679 #ifdef key_osm_debug 1680 IF(narea==nn_narea_db.and.ji==iloc_db.and.jj==jloc_db)THEN 1681 WRITE(narea+100,'(2(a,g11.3))')' lpyc=lconv=T, variables w shear contributions: zdifpyc_n_sc',zdifpyc_n_sc(ji,jj) ,' zvispyc_n_sc=',zvispyc_n_sc(ji,jj) 1682 FLUSH(narea+100) 1683 END IF 1684 #endif 1685 zdifpyc_s_sc(ji,jj) = zwb_ent(ji,jj) + 0.0025 * zvel_sc_pyc * ( zhbl(ji,jj) / zdh(ji,jj) - 1.0 ) * ( zb_ml(ji,jj) - zb_bl(ji,jj) ) 1424 1686 zvispyc_s_sc(ji,jj) = 0.09 * ( zwb_min(ji,jj) + 0.0025 * zvel_sc_pyc * ( zhbl(ji,jj) / zdh(ji,jj) - 1.0 ) * ( zb_ml(ji,jj) - zb_bl(ji,jj) ) ) 1687 #ifdef key_osm_debug 1688 IF(narea==nn_narea_db.and.ji==iloc_db.and.jj==jloc_db)THEN 1689 WRITE(narea+100,'(2(a,g11.3))')' 1st shot at: zdifpyc_s_sc',zdifpyc_s_sc(ji,jj) ,' zvispyc_s_sc=',zvispyc_s_sc(ji,jj) 1690 FLUSH(narea+100) 1691 END IF 1692 #endif 1693 zdifpyc_s_sc(ji,jj) = 0.09 * zdifpyc_s_sc(ji,jj) * zstab_fac 1425 1694 zvispyc_s_sc(ji,jj) = zvispyc_s_sc(ji,jj) * zstab_fac 1695 #ifdef key_osm_debug 1696 IF(narea==nn_narea_db.and.ji==iloc_db.and.jj==jloc_db)THEN 1697 WRITE(narea+100,'(2(a,g11.3))')' 2nd shot at: zdifpyc_s_sc',zdifpyc_s_sc(ji,jj) ,' zvispyc_s_sc=',zvispyc_s_sc(ji,jj) 1698 FLUSH(narea+100) 1699 END IF 1700 #endif 1701 1702 zdifpyc_s_sc(ji,jj) = MAX( zdifpyc_s_sc(ji,jj), -0.5 * zdifpyc_n_sc(ji,jj) ) 1426 1703 zvispyc_s_sc(ji,jj) = MAX( zvispyc_s_sc(ji,jj), -0.5 * zvispyc_n_sc(ji,jj) ) 1704 #ifdef key_osm_debug 1705 IF(narea==nn_narea_db.and.ji==iloc_db.and.jj==jloc_db)THEN 1706 WRITE(narea+100,'(2(a,g11.3))')' Final zdifpyc_s_sc',zdifpyc_s_sc(ji,jj) ,' zvispyc_s_sc=',zvispyc_s_sc(ji,jj) 1707 FLUSH(narea+100) 1708 END IF 1709 #endif 1427 1710 1428 1711 zbeta_d_sc(ji,jj) = 1.0 - ( ( zdifpyc_n_sc(ji,jj) + 1.4 * zdifpyc_s_sc(ji,jj) ) / ( zdifml_sc(ji,jj) + epsln ) )**p2third … … 1432 1715 zbeta_v_sc(ji,jj) = 1.0 1433 1716 ENDIF 1434 ELSE 1717 #ifdef key_osm_debug 1718 IF(narea==nn_narea_db.and.ji==iloc_db.and.jj==jloc_db)THEN 1719 WRITE(narea+100,'(2(a,g11.3))')'lconv=T: zbeta_d_sc',zbeta_d_sc(ji,jj) ,' zbeta_v_sc=',zbeta_v_sc(ji,jj) 1720 FLUSH(narea+100) 1721 END IF 1722 #endif 1723 ELSE ! conv, stable 1435 1724 zdifml_sc(ji,jj) = zvstr(ji,jj) * zhbl(ji,jj) * MAX( EXP ( -( zhol(ji,jj) / 0.6_wp )**2 ), 0.2_wp) 1436 1725 zvisml_sc(ji,jj) = zvstr(ji,jj) * zhbl(ji,jj) * MAX( EXP ( -( zhol(ji,jj) / 0.6_wp )**2 ), 0.2_wp) 1726 #ifdef key_osm_debug 1727 IF(narea==nn_narea_db.and.ji==iloc_db.and.jj==jloc_db)THEN 1728 WRITE(narea+100,'(a,g11.3)')'End of 1st major loop of osm_diffusivity_viscositys, lconv=F: zdifml_sc=',zdifml_sc(ji,jj),' zvisml_sc=',zvisml_sc(ji,jj) 1729 FLUSH(narea+100) 1730 END IF 1731 #endif 1437 1732 END IF 1733 1438 1734 END DO 1439 1735 END DO … … 1553 1849 1554 1850 zshear(:,:) = 0._wp 1851 #ifdef key_osm_debug 1852 IF(narea==nn_narea_db) THEN 1853 ji=iloc_db; jj=jloc_db 1854 WRITE(narea+100,'(a,g11.3)') & 1855 & 'zdf_osm_osbl_state start: zekman=', zekman(ji,jj) 1856 FLUSH(narea+100) 1857 END IF 1858 #endif 1555 1859 j_ddh(:,:) = 1 1556 1860 … … 1570 1874 ENDIF 1571 1875 zshear(ji,jj) = za_shr * zekman(ji,jj) * ( MAX( zustar(ji,jj)**2 * zdu_ml(ji,jj) / zhbl(ji,jj), 0._wp ) + zb_shr * MAX( -ff_t(ji,jj) * zustke(ji,jj) * dstokes(ji,jj) * zdv_ml(ji,jj) / zhbl(ji,jj), 0._wp ) ) 1876 #ifdef key_osm_debug 1877 ! IF(narea==nn_narea_db)THEN 1878 ! WRITE(narea+100,'(2(a,i10.4))')'ji',ji,'jj',jj 1879 ! WRITE(narea+100,'(2(a,i10.4))')'iloc_db',iloc_db,'jloc_db',jloc_db 1880 ! WRITE(narea+100,'(2(a,i10.4))')'iloc_db+',mi0(nn_idb),'jloc_db+',mj0(nn_jdb) 1881 ! FLUSH(narea+100) 1882 ! END IF 1883 IF(narea==nn_narea_db.and.ji==iloc_db.and.jj==jloc_db)THEN 1884 WRITE(narea+100,'(a,g11.3)')'zdf_osm_osbl_state 1st zshear: zshear=',zshear(ji,jj) 1885 WRITE(narea+100,'(2(a,g11.3))')'zdf_osm_osbl_state 1st zshear: zri_b=',zri_b(ji,jj),' zri_p=',zri_p(ji,jj) 1886 FLUSH(narea+100) 1887 END IF 1888 #endif 1572 1889 ! Stability Dependence 1573 1890 zshear(ji,jj) = zshear(ji,jj) * EXP( -0.75 * MAX(0._wp,( zri_b(ji,jj) - zri_c ) / zri_c ) ) 1891 #ifdef key_osm_debug 1892 IF(narea==nn_narea_db.and.ji==iloc_db.and.jj==jloc_db)THEN 1893 WRITE(narea+100,'(a,g11.3)')'zdf_osm_osbl_state 1st zshear: zshear inc ri part=',zshear(ji,jj) 1894 FLUSH(narea+100) 1895 END IF 1896 #endif 1897 1574 1898 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 1575 1899 ! Test ensures j_ddh=0 is not selected. Change to zri_p<27 when ! … … 1627 1951 & - zrf_langmuir * zalpha_lc * zwstrl(ji,jj)**3 ) / zhml(ji,jj) 1628 1952 ! 1953 #ifdef key_osm_debug 1954 IF(narea==nn_narea_db.and.ji==iloc_db.and.jj==jloc_db)THEN 1955 WRITE(narea+100,'(a,g11.3)')'zdf_osm_osbl_state conv+shear0/lang: zwb_ent=',zwb_ent(ji,jj) 1956 FLUSH(narea+100) 1957 END IF 1958 #endif 1629 1959 ENDIF 1630 1960 END DO ! ji loop … … 1639 1969 ! Unstable OSBL 1640 1970 zwb_shr = -za_wb_s * zri_b(ji,jj) * zshear(ji,jj) 1971 #ifdef key_osm_debug 1972 IF(narea==nn_narea_db.and.ji==iloc_db.and.jj==jloc_db)THEN 1973 WRITE(narea+100,'(a,g11.3)')'zdf_osm_osbl_state 1st zwb_shr: zwb_shr=',zwb_shr 1974 FLUSH(narea+100) 1975 END IF 1976 #endif 1641 1977 IF ( j_ddh(ji,jj) == 0 ) THEN 1642 1978 … … 1649 1985 ! zwb_shr = zwb_shr - 0.25 * MAX ( zshear_u, 0._wp) * ( 1.0 - MIN( zri_p(ji,jj) / rn_ri_p_thresh, 1._wp )**2 ) 1650 1986 ! zwb_shr = MAX( zwb_shr, -0.25 * zshear_u ) 1987 #ifdef key_osm_debug 1988 IF(narea==nn_narea_db.and.ji==iloc_db.and.jj==jloc_db)THEN 1989 WRITE(narea+100,'(3(a,g11.3))')'zdf_osm_osbl_state j_ddh(ji,jj) == 0:zwb_shr=',zwb_shr, & 1990 & ' zshear=',zshear(ji,jj),' zshear_u=', zshear_u 1991 FLUSH(narea+100) 1992 END IF 1993 #endif 1651 1994 1652 1995 ENDIF … … 1661 2004 zwb_min(ji,jj) = zwb_ent(ji,jj) + zdh(ji,jj) / zhbl(ji,jj) * 2._wp * zwbav(ji,jj) 1662 2005 ENDIF ! lconv 2006 #ifdef key_osm_debug 2007 IF(narea==nn_narea_db.and.ji==iloc_db.and.jj==jloc_db)THEN 2008 WRITE(narea+100,'(3(a,g11.3))')'end of zdf_osm_osbl_state:zwb_ent=',zwb_ent(ji,jj), & 2009 & ' zwb_min=',zwb_min(ji,jj), ' zwb0tot=', zwb0tot(ji,jj), ' zwbav= ', zwbav(ji,jj) 2010 FLUSH(narea+100) 2011 END IF 2012 #endif 1663 2013 END DO ! ji 1664 2014 END DO ! jj … … 1820 2170 ENDIF 1821 2171 ENDIF 2172 #ifdef key_osm_debug 2173 IF(narea==nn_narea_db.and.ji==iloc_db.and.jj==jloc_db)THEN 2174 WRITE(narea+100,'(4(a,g11.3))')'start of zdf_osm_osbl_state_fk: zwb_fk=',zwb_fk(ji,jj), & 2175 & ' znd_param=',znd_param(ji,jj), ' zpe_mle_ref=', zpe_mle_ref, ' zpe_mle_layer=', zpe_mle_layer 2176 FLUSH(narea+100) 2177 END IF 2178 #endif 1822 2179 END DO 1823 2180 END DO … … 1871 2228 lmle(ji,jj) = .FALSE. 1872 2229 ENDIF ! lconv 2230 #ifdef key_osm_debug 2231 IF(narea==nn_narea_db.and.ji==iloc_db.and.jj==jloc_db)THEN 2232 WRITE(narea+100,'(3(a,g11.3),/,4(a,l2))')'end of zdf_osm_osbl_state_fk:zwb_ent=',zwb_ent(ji,jj), & 2233 & ' zhmle=',zhmle(ji,jj), ' zhbl=', zhbl(ji,jj), & 2234 & ' lpyc= ', lpyc(ji,jj), ' lflux= ', lflux(ji,jj), ' lmle= ', lmle(ji,jj), ' lconv= ', lconv(ji,jj) 2235 FLUSH(narea+100) 2236 END IF 2237 #endif 1873 2238 END DO 1874 2239 END DO … … 1957 2322 ENDIF 1958 2323 END DO 2324 #ifdef key_osm_debug 2325 IF(narea==nn_narea_db.and.ji==iloc_db.and.jj==jloc_db)THEN 2326 WRITE(narea+100,'(a,/,3(a,g11.3),/,2(a,g11.3),/)')'end of zdf_osm_pycnocline_scalar_profiles:lconv=lpyc=T',& 2327 & 'zzeta_m=', zzeta_m, ' zalpha=', zalpha(ji,jj), ' ztmp=', ztmp,& 2328 & ' zbgrad=', zbgrad, ' zgamma_b_nd=', zgamma_b_nd 2329 FLUSH(narea+100) 2330 END IF 2331 #endif 1959 2332 ENDIF ! if no pycnocline pycnocline gradients set to zero 1960 2333 ELSE … … 1986 2359 END DO 1987 2360 ENDIF ! IF (zhol >=0.5) 2361 #ifdef key_osm_debug 2362 IF(narea==nn_narea_db.and.ji==iloc_db.and.jj==jloc_db)THEN 2363 WRITE(narea+100,'(3(a,g11.3))')'end of zdf_osm_pycnocline_scalar_profiles:lconv=F ztgrad=',& 2364 & ztgrad, ' zsgrad=', zsgrad, ' zbgrad=', zbgrad 2365 FLUSH(narea+100) 2366 END IF 2367 #endif 1988 2368 ENDIF ! IF (zdb_bl> 0.) 1989 2369 ENDIF ! IF (zdhdt >= 0) zdhdt < 0 not considered since pycnocline profile is zero and profile arrays are intialized to zero … … 2100 2480 zpsi = zalpha_b * MAX ( zpsi, 0._wp ) 2101 2481 zdhdt(ji,jj) = -( zwb_ent(ji,jj) + 2.0 * zwb_fk_b(ji,jj) ) / ( zvel_max + MAX(zdb_bl(ji,jj), 1.0e-15) ) + zpsi / ( zvel_max + MAX( zdb_bl(ji,jj), 1.e-15 ) ) 2482 #ifdef key_osm_debug 2483 IF(narea==nn_narea_db.and.ji==iloc_db.and.jj==jloc_db)THEN 2484 WRITE(narea+100,'(a,g11.3)')'Inside 1st major loop of zdf_osm_calculate_dhdt, OSBL is deepening, entrainment > restratification: zdhdt=',zdhdt(ji,jj) 2485 WRITE(narea+100,'(3(a,g11.3))') ' zpsi=',zpsi, ' zgamma_b_nd=', zgamma_b_nd, ' zdh=', zdh(ji,jj) 2486 FLUSH(narea+100) 2487 END IF 2488 #endif 2102 2489 IF ( j_ddh(ji,jj) == 1 ) THEN 2103 2490 IF ( ( zwstrc(ji,jj) / zvstr(ji,jj) )**3 <= 0.5 ) THEN … … 2108 2495 ! Relaxation to dh_ref = zari * hbl 2109 2496 zddhdt = -a_ddh_2 * ( 1.0 - zdh(ji,jj) / ( zari * zhbl(ji,jj) ) ) * zwb_ent(ji,jj) / zdb_bl(ji,jj) 2497 #ifdef key_osm_debug 2498 IF(narea==nn_narea_db.and.ji==iloc_db.and.jj==jloc_db)THEN 2499 WRITE(narea+100,'(a,g11.3)')'Inside 1st major loop of zdf_osm_calculate_dhdt,j_ddh(ji,jj) == 1: zari=',zari 2500 FLUSH(narea+100) 2501 END IF 2502 #endif 2110 2503 2111 2504 ELSE IF ( j_ddh(ji,jj) == 0 ) THEN … … 2198 2591 ENDIF ! lconv 2199 2592 ENDIF ! lshear 2593 #ifdef key_osm_debug 2594 IF(narea==nn_narea_db.and.ji==iloc_db.and.jj==jloc_db)THEN 2595 WRITE(narea+100,'(4(a,g11.3))')'end of 1st major loop of zdf_osm_calculate_dhdt: zdhdt=',zdhdt(ji,jj), & 2596 & ' zpert=', zpert, ' zddhdt=', zddhdt, ' zvel_max=', zvel_max 2597 2598 IF ( ln_osm_mle ) THEN 2599 WRITE(narea+100,'(3(a,g11.3),/)') 'zvel_mle=',zvel_mle(ji,jj), ' zwb_fk_b=', zwb_fk_b(ji,jj), & 2600 & ' zwb_ent + 2*zwb_fk_b =', zwb_ent(ji,jj) + 2.0 * zwb_fk_b(ji,jj) 2601 FLUSH(narea+100) 2602 END IF 2603 END IF 2604 #endif 2200 2605 END DO 2201 2606 END DO … … 2224 2629 DO jj = 2, jpjm1 2225 2630 DO ji = 2, jpim1 2631 #ifdef key_osm_debug 2632 IF(narea==nn_narea_db.and.ji==iloc_db.and.jj==jloc_db)THEN 2633 WRITE(narea+100,'(2(a,i7))')'start of zdf_osm_timestep_hbl: old ibld=',imld(ji,jj),' trial ibld=', ibld(ji,jj) 2634 FLUSH(narea+100) 2635 END IF 2636 #endif 2226 2637 IF ( ibld(ji,jj) - imld(ji,jj) > 1 ) THEN 2227 2638 ! … … 2245 2656 2246 2657 ENDIF 2658 #ifdef key_osm_debug 2659 IF(narea==nn_narea_db.and.ji==iloc_db.and.jj==jloc_db)THEN 2660 WRITE(narea+100,'(a,g11.3)')'In zdf_osm_timestep_hbl, ibld - imld > 1, lconv=T: zvel_max=',zvel_max 2661 FLUSH(narea+100) 2662 END IF 2663 #endif 2247 2664 2248 2665 DO jk = imld(ji,jj), ibld(ji,jj) … … 2268 2685 ENDIF 2269 2686 IF ( zhbl_s >= gdepw_n(ji,jj,jm+1) ) jm = jm + 1 2687 #ifdef key_osm_debug 2688 IF(narea==nn_narea_db.and.ji==iloc_db.and.jj==jloc_db)THEN 2689 WRITE(narea+100,'(2(a,i7))')' jk=',jk,' jm=', jm 2690 WRITE(narea+100,'(2(a,g11.3),a,l7)')'zdb=',zdb,' zhbl_s=', zhbl_s,' lpyc=',lpyc(ji,jj) 2691 FLUSH(narea+100) 2692 END IF 2693 #endif 2270 2694 END DO 2271 2695 hbl(ji,jj) = zhbl_s … … 2273 2697 ELSE 2274 2698 ! stable 2699 #ifdef key_osm_debug 2700 IF(narea==nn_narea_db.and.ji==iloc_db.and.jj==jloc_db)THEN 2701 WRITE(narea+100,'(a)')'In zdf_osm_timestep_hbl, ibld - imld > 1, lconv=F' 2702 FLUSH(narea+100) 2703 END IF 2704 #endif 2275 2705 DO jk = imld(ji,jj), ibld(ji,jj) 2276 2706 zdb = MAX( & … … 2293 2723 ENDIF 2294 2724 IF ( zhbl_s >= gdepw_n(ji,jj,jm) ) jm = jm + 1 2725 #ifdef key_osm_debug 2726 IF(narea==nn_narea_db.and.ji==iloc_db.and.jj==jloc_db)THEN 2727 WRITE(narea+100,'(2(a,i7))')' jk=',jk,' jm=', jm 2728 WRITE(narea+100,'(4(a,g11.3),a,l7)')'zdb=',zdb,' zhol',zhol(ji,jj),' zdhdt',zdhdt(ji,jj),' zhbl_s=', zhbl_s,' lpyc=',lpyc(ji,jj) 2729 FLUSH(narea+100) 2730 END IF 2731 #endif 2295 2732 END DO 2296 2733 ENDIF ! IF ( lconv ) … … 2302 2739 ENDIF 2303 2740 zhbl(ji,jj) = gdepw_n(ji,jj,ibld(ji,jj)) 2741 #ifdef key_osm_debug 2742 IF(narea==nn_narea_db.and.ji==iloc_db.and.jj==jloc_db)THEN 2743 WRITE(narea+100,'(2(a,g11.3),a,i7,/)')'end of zdf_osm_timestep_hbl: hbl=', hbl(ji,jj),' zhbl=', zhbl(ji,jj),' ibld=', ibld(ji,jj) 2744 FLUSH(narea+100) 2745 END IF 2746 #endif 2304 2747 END DO 2305 2748 END DO … … 2447 2890 zhml(ji,jj) = gdepw_n(ji,jj,imld(ji,jj)) 2448 2891 zdh(ji,jj) = zhbl(ji,jj) - zhml(ji,jj) 2892 #ifdef key_osm_debug 2893 IF(narea==nn_narea_db.and.ji==iloc_db.and.jj==jloc_db)THEN 2894 WRITE(narea+100,'(4(a,g11.3),2(a,i7),/,5(a,g11.3),/)') 'end of zdf_osm_pycnocline_thickness:hml=',hml(ji,jj), & 2895 & ' zhml=',zhml(ji,jj),' zdh=', zdh(ji,jj), ' dh=', dh(ji,jj), ' imld=', imld(ji,jj), ' inhml=', inhml, & 2896 & 'zvel_max=', zvel_max, ' ztau=', ztau,' zdh_ref=', zdh_ref, ' zar=', zari, ' zddhdt=', zddhdt 2897 FLUSH(narea+100) 2898 END IF 2899 #endif 2900 2449 2901 END DO 2450 2902 END DO … … 2659 3111 REAL z1_t2 2660 3112 !! 3113 #ifdef key_osm_debug 3114 NAMELIST/namzdf_osm/ ln_use_osm_la, rn_osm_la, rn_osm_dstokes, nn_ave & 3115 & ,nn_osm_wave, ln_dia_osm, rn_osm_hbl0, rn_zdfosm_adjust_sd & 3116 & ,ln_kpprimix, rn_riinfty, rn_difri, ln_convmix, rn_difconv, nn_osm_wave & 3117 & ,nn_osm_SD_reduce, ln_osm_mle, rn_osm_hblfrac, rn_osm_bl_thresh, ln_zdfosm_ice_shelter & 3118 & ,nn_idb, nn_jdb, nn_kdb, nn_narea_db 3119 #else 2661 3120 NAMELIST/namzdf_osm/ ln_use_osm_la, rn_osm_la, rn_osm_dstokes, nn_ave & 2662 3121 & ,nn_osm_wave, ln_dia_osm, rn_osm_hbl0, rn_zdfosm_adjust_sd & 2663 3122 & ,ln_kpprimix, rn_riinfty, rn_difri, ln_convmix, rn_difconv, nn_osm_wave & 2664 3123 & ,nn_osm_SD_reduce, ln_osm_mle, rn_osm_hblfrac, rn_osm_bl_thresh, ln_zdfosm_ice_shelter 3124 #endif 2665 3125 ! Namelist for Fox-Kemper parametrization. 2666 3126 NAMELIST/namosm_mle/ nn_osm_mle, rn_osm_mle_ce, rn_osm_mle_lf, rn_osm_mle_time, rn_osm_mle_lat,& … … 2718 3178 WRITE(numout,*) ' Use large mixing below BL when unstable ln_convmix = ', ln_convmix 2719 3179 WRITE(numout,*) ' diffusivity when unstable below BL (m2/s) rn_difconv = ', rn_difconv 3180 #ifdef key_osm_debug 3181 WRITE(numout,*) 'nn_idb', nn_idb, 'nn_jdb', nn_jdb, 'nn_kdb', nn_kdb, 'nn_narea_db', nn_narea_db 3182 3183 iloc_db = mi0(nn_idb) 3184 jloc_db = mj0(nn_jdb) 3185 WRITE(numout,*) 'iloc_db ', iloc_db , 'jloc_db', jloc_db 3186 #endif 2720 3187 ENDIF 2721 3188
Note: See TracChangeset
for help on using the changeset viewer.