653 |
integer i, ki, mr |
integer i, ki, mr |
654 |
_KPP_RL c1, c0 |
_KPP_RL c1, c0 |
655 |
|
|
656 |
|
#ifdef ALLOW_KPP_VERTICALLY_SMOOTH |
657 |
|
CADJ INIT kpp_ri_tape_mr = common, 1 |
658 |
|
#endif |
659 |
|
|
660 |
c constants |
c constants |
661 |
c1 = 1.0 |
c1 = 1.0 |
662 |
c0 = 0.0 |
c0 = 0.0 |
666 |
c use diffus(*,*,1) as temporary storage of Ri to be smoothed |
c use diffus(*,*,1) as temporary storage of Ri to be smoothed |
667 |
c use diffus(*,*,2) as temporary storage for Brunt-Vaisala squared |
c use diffus(*,*,2) as temporary storage for Brunt-Vaisala squared |
668 |
c set values at bottom and below to nearest value above bottom |
c set values at bottom and below to nearest value above bottom |
669 |
|
#ifdef ALLOW_AUTODIFF_TAMC |
670 |
|
C break data flow dependence on diffus |
671 |
|
diffus(1,1,1) = 0.0 |
672 |
|
#endif |
673 |
|
|
674 |
do ki = 1, Nr |
do ki = 1, Nr |
675 |
do i = 1, imt |
do i = 1, imt |
689 |
|
|
690 |
c----------------------------------------------------------------------- |
c----------------------------------------------------------------------- |
691 |
c vertically smooth Ri |
c vertically smooth Ri |
692 |
|
#ifdef ALLOW_KPP_VERTICALLY_SMOOTH |
693 |
do mr = 1, num_v_smooth_Ri |
do mr = 1, num_v_smooth_Ri |
694 |
|
|
695 |
CADJ store diffus(:,:,1) = comlev1_kpp_sm |
CADJ store diffus(:,:,1) = kpp_ri_tape_mr |
696 |
CADJ & , key = ikey, shape = (/ (sNx+2*OLx)*(sNy+2*OLy),Nr+2 /) |
CADJ & , key=mr, shape=(/ (sNx+2*OLx)*(sNy+2*OLy),Nr+2 /) |
697 |
|
|
698 |
call z121 ( |
call z121 ( |
699 |
U diffus(1,0,1)) |
U diffus(1,0,1)) |
700 |
end do |
end do |
701 |
|
#endif |
|
CADJ store diffus = comlev1_kpp |
|
|
CADJ & , key = ikey, shape = (/ (sNx+2*OLx)*(sNy+2*OLy),Nr+2,3 /) |
|
702 |
|
|
703 |
c----------------------------------------------------------------------- |
c----------------------------------------------------------------------- |
704 |
c after smoothing loop |
c after smoothing loop |