wake Subroutine

public subroutine wake(klon, klev, znatsurf, p, ph, pi, dtime, tb0, qb0, omgb, dtdwn, dqdwn, amdwn, amup, dta, dqa, wgen, sigd_con, Cin, deltatw, deltaqw, sigmaw, asigmaw, wdens, awdens, dth, hw, wape, fip, gfl, dtls, dqls, ktopw, omgbdth, dp_omgb, tx, qx, dtke, dqke, omg, dp_deltomg, wkspread, cstar, d_deltat_gw, d_deltatw2, d_deltaqw2, d_sigmaw2, d_asigmaw2, d_wdens2, d_awdens2)

Uses

wdens(:) = wdens_ref jyg

DO k = 1, klev DO i = 1, klon ppi(i, k) = pi(i, k) deltatw0(i, k) = deltatw(i, k) deltaqw0(i, k) = deltaqw(i, k) tb(i, k) = tb0(i, k) qb(i, k) = qb0(i, k) dtls(i, k) = 0. dqls(i, k) = 0. d_deltat_gw(i, k) = 0. d_tb(i, k) = 0. d_qb(i, k) = 0. d_deltatw(i, k) = 0. d_deltaqw(i, k) = 0. ! IM 060508 beg d_deltatw2(i, k) = 0. d_deltaqw2(i, k) = 0. ! IM 060508 end END DO END DO DO i = 1, klon sigmaw_in(i) = sigmaw(i) END DO jyg wdens(:) = wdens(:) + wgen(:)dtime d_wdens2(:) = wgen(:)dtime ELSE wdens_targ = max(wdens(i),wdensmin) (wdens(i) < wdensthreshold) wdens_targ = min(max(awdens(i),wdensmin),wdens(i)) jyg print'("wake_pkupper APPEL ",7i6)',0,int(ptop/100.),int(ptop1/100.),int(pupper/100.),ktop,ktop1,kupper

  sigmaw(i) = amax1(sigmad, sigd_con(i))

(wape(i)<0.) (wape(i)<0.) (iflag_wk_pop_dyn == 3)

wk_nsub = 10 dtimesub = dtime/wk_nsub


Bug : computing gfl and rad_wk before changing sigmaw This bug exists only for iflag_wk_pop_dyn=0. Otherwise, gfl and rad_wk are computed within wake_popdyn




Fix : computing gfl and rad_wk after changing sigmaw


--------------------------------------------------------


state variables tendencies


state variables tendencies


--------------------------------------------------------

! nrlmd ! nrlmd LJYF dp_deltomg(i, 1) = omgtop(i)/(ptop(i)-ph(i,1)) print *,'omg(igout,k) ', (k,omg(igout,k),k=1,klev)

! nrlmd IF (prt_level>=10) THEN detr(i, k) = 0.

        entr(i, k) = detr(i, k) + gfl(i)*cstar(i) + &
          sigmaw(i)*(1.-sigmaw(i))*dp_deltomg(i, k)

jyg

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! sigmaw !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! wdens !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! awdens !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! awdens again for iflag_wk_pop_dyn >= 2!!!!!!

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! asigmaw for iflag_wk_pop_dyn = 3!!!!!!

         sigmaw_targ = min(max(asigmaw(i),sigmad),sigmaw(i))

print'("wake_pkupper APPEL ",7i6)',isubstep,int(ptop/100.),int(ptop1/100.),int(pupper/100.),ktop,ktop1,kupper

! nrlmd ! nrlmd ! nrlmd ! nrlmd ! nrlmd ! nrlmd ! nrlmd sigmaw(i) = max(sigmad, sigd_con(i)) jyg print ,'wake, hw0(i), dthmin(i) ', hw0(i), dthmin(i) print ,'wake, 2.sum_dth(i)/(hw0(i)dthmin(i)) ', & 2.sum_dth(i)/(hw0(i)dthmin(i)) print ,'wake, sum_half_dth(i), sum_dth(i) ', & sum_half_dth(i), sum_dth(i) print ,'wake, rej 1' print ,'wake, rej 2' print ,'wake, rej 3' sigmaw(i) = amax1(sigmad, sigd_con(i)) jyg .NOT. ok_qx_qw(i) .OR. (wdens(i) < 2.*wdensmin) jyg jyg IF (((wape(i)>=wape2(i)) .AND. (wape2(i)<=wapecut)) .OR. (ktopw(i)<=2) .OR. & jyg .NOT. ok_qx_qw(i)) THEN jyg IF (((wape(i)>=wape2(i)) .AND. (wape2(i)<=wapecut)) .OR. (ktopw(i)<=2) .OR. & jyg .NOT. ok_qx_qw(i)) THEN jyg Outside subroutine "Wake" hw, wdens sigmaw and asigmaw are zero when there are no wakes hw(i) = hwmin !jyg sigmaw(i) = sigmad !jyg sigmaw(i) = 0. !jyg d_sigmaw2(i) = d_sigmaw2(i) + sigmaw_targ - sigmaw(i) d_sigmaw2(i) = d_sigmaw2(i) + sigmaw_targ - sigmaw(i) awdens(i) = 0. wdens(i) = 0. d_wdens2(i) = wdens_targ - wdens(i) jyg: bug fix : the d_adens_bnd2 computation must be before the update of awdens. d_awdens2(i) = wdens_targ - awdens(i) IF (iflag_wk_pop_dyn == 2) THEN d_adens_bnd2(i) = d_adens_bnd2(i) + wdens_targ - awdens(i) ENDIF ! (iflag_wk_pop_dyn == 2) IF (ok_qx_qw(i) .AND. k<=kupper(i)) THEN jyg jyg

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: klon
integer, intent(in) :: klev
integer, intent(in), DIMENSION (klon) :: znatsurf
real, intent(in), DIMENSION (klon, klev) :: p
real, intent(in), DIMENSION (klon, klev+1) :: ph
real, intent(in), DIMENSION (klon, klev) :: pi
real, intent(in) :: dtime
real, intent(in), DIMENSION (klon, klev) :: tb0
real, intent(in), DIMENSION (klon, klev) :: qb0
real, intent(in), DIMENSION (klon, klev) :: omgb
real, intent(in), DIMENSION (klon, klev) :: dtdwn
real, intent(in), DIMENSION (klon, klev) :: dqdwn
real, intent(in), DIMENSION (klon, klev) :: amdwn
real, intent(in), DIMENSION (klon, klev) :: amup
real, intent(in), DIMENSION (klon, klev) :: dta
real, intent(in), DIMENSION (klon, klev) :: dqa
real, intent(in), DIMENSION (klon) :: wgen
real, intent(in), DIMENSION (klon) :: sigd_con
real, intent(in), DIMENSION (klon) :: Cin
real, intent(inout), DIMENSION (klon, klev) :: deltatw
real, intent(inout), DIMENSION (klon, klev) :: deltaqw
real, intent(inout), DIMENSION (klon) :: sigmaw
real, intent(inout), DIMENSION (klon) :: asigmaw
real, intent(inout), DIMENSION (klon) :: wdens
real, intent(inout), DIMENSION (klon) :: awdens
real, intent(out), DIMENSION (klon, klev) :: dth
real, intent(out), DIMENSION (klon) :: hw
real, intent(out), DIMENSION (klon) :: wape
real, intent(out), DIMENSION (klon) :: fip
real, intent(out), DIMENSION (klon) :: gfl
real, intent(out), DIMENSION (klon, klev) :: dtls
real, intent(out), DIMENSION (klon, klev) :: dqls
integer, intent(out), DIMENSION (klon) :: ktopw
real, intent(out), DIMENSION (klon, klev) :: omgbdth
real, intent(out), DIMENSION (klon, klev) :: dp_omgb
real, intent(out), DIMENSION (klon, klev) :: tx
real, intent(out), DIMENSION (klon, klev) :: qx
real, intent(out), DIMENSION (klon, klev) :: dtke
real, intent(out), DIMENSION (klon, klev) :: dqke
real, intent(out), DIMENSION (klon, klev) :: omg
real, intent(out), DIMENSION (klon, klev) :: dp_deltomg
real, intent(out), DIMENSION (klon, klev) :: wkspread
real, intent(out), DIMENSION (klon) :: cstar
real, intent(out), DIMENSION (klon, klev) :: d_deltat_gw
real, intent(out), DIMENSION (klon, klev) :: d_deltatw2
real, intent(out), DIMENSION (klon, klev) :: d_deltaqw2
real, intent(out), DIMENSION (klon) :: d_sigmaw2
real, intent(out), DIMENSION (klon) :: d_asigmaw2
real, intent(out), DIMENSION (klon) :: d_wdens2
real, intent(out), DIMENSION (klon) :: d_awdens2

Calls

proc~~wake~~CallsGraph proc~wake wake proc~wake_pkupper wake_pkupper proc~wake->proc~wake_pkupper proc~wake_vec_modulation wake_vec_modulation proc~wake->proc~wake_vec_modulation proc~iophys_ecrit iophys_ecrit proc~wake->proc~iophys_ecrit proc~wake_popdyn_2 wake_popdyn_2 proc~wake->proc~wake_popdyn_2 amax1 amax1 proc~wake->amax1 proc~wake_popdyn_1 wake_popdyn_1 proc~wake->proc~wake_popdyn_1 proc~wake_popdyn_3 wake_popdyn_3 proc~wake->proc~wake_popdyn_3 proc~wake_pkupper->amax1 amin1 amin1 proc~wake_pkupper->amin1 interface~grid1dto2d_glo grid1dTo2d_glo proc~iophys_ecrit->interface~grid1dto2d_glo proc~iotd_ecrit iotd_ecrit proc~iophys_ecrit->proc~iotd_ecrit interface~gather gather proc~iophys_ecrit->interface~gather proc~wake_popdyn_3->proc~iophys_ecrit proc~grid1dto2d_glo_i grid1dTo2d_glo_i interface~grid1dto2d_glo->proc~grid1dto2d_glo_i proc~grid1dto2d_glo_l3 grid1dTo2d_glo_l3 interface~grid1dto2d_glo->proc~grid1dto2d_glo_l3 proc~grid1dto2d_glo_r3 grid1dTo2d_glo_r3 interface~grid1dto2d_glo->proc~grid1dto2d_glo_r3 proc~grid1dto2d_glo_l2 grid1dTo2d_glo_l2 interface~grid1dto2d_glo->proc~grid1dto2d_glo_l2 proc~grid1dto2d_glo_i3 grid1dTo2d_glo_i3 interface~grid1dto2d_glo->proc~grid1dto2d_glo_i3 proc~grid1dto2d_glo_i2 grid1dTo2d_glo_i2 interface~grid1dto2d_glo->proc~grid1dto2d_glo_i2 proc~grid1dto2d_glo_l grid1dTo2d_glo_l interface~grid1dto2d_glo->proc~grid1dto2d_glo_l proc~grid1dto2d_glo_i1 grid1dTo2d_glo_i1 interface~grid1dto2d_glo->proc~grid1dto2d_glo_i1 proc~grid1dto2d_glo_r2 grid1dTo2d_glo_r2 interface~grid1dto2d_glo->proc~grid1dto2d_glo_r2 proc~grid1dto2d_glo_r1 grid1dTo2d_glo_r1 interface~grid1dto2d_glo->proc~grid1dto2d_glo_r1 proc~grid1dto2d_glo_l1 grid1dTo2d_glo_l1 interface~grid1dto2d_glo->proc~grid1dto2d_glo_l1 proc~grid1dto2d_glo_r grid1dTo2d_glo_r interface~grid1dto2d_glo->proc~grid1dto2d_glo_r nf90_redef nf90_redef proc~iotd_ecrit->nf90_redef nf90_def_var nf90_def_var proc~iotd_ecrit->nf90_def_var nf90_enddef nf90_enddef proc~iotd_ecrit->nf90_enddef nf90_sync nf90_sync proc~iotd_ecrit->nf90_sync nf90_put_var nf90_put_var proc~iotd_ecrit->nf90_put_var nf90_inq_varid nf90_inq_varid proc~iotd_ecrit->nf90_inq_varid proc~gather_l gather_l interface~gather->proc~gather_l proc~gather_i gather_i interface~gather->proc~gather_i proc~gather_i3 gather_i3 interface~gather->proc~gather_i3 proc~gather_r1 gather_r1 interface~gather->proc~gather_r1 proc~gather_l3 gather_l3 interface~gather->proc~gather_l3 proc~gather_r3 gather_r3 interface~gather->proc~gather_r3 proc~gather_r gather_r interface~gather->proc~gather_r proc~gather_r2 gather_r2 interface~gather->proc~gather_r2 proc~gather_i1 gather_i1 interface~gather->proc~gather_i1 proc~gather_l2 gather_l2 interface~gather->proc~gather_l2 proc~gather_i2 gather_i2 interface~gather->proc~gather_i2 proc~gather_l1 gather_l1 interface~gather->proc~gather_l1 interface~gather_omp gather_omp proc~gather_l->interface~gather_omp interface~gather_mpi gather_mpi proc~gather_l->interface~gather_mpi proc~gather_i->interface~gather_omp proc~gather_i->interface~gather_mpi proc~gather_i3->interface~gather_omp proc~gather_i3->interface~gather_mpi proc~gather_r1->interface~gather_omp proc~gather_r1->interface~gather_mpi proc~gather_l3->interface~gather_omp proc~gather_l3->interface~gather_mpi proc~gather_r3->interface~gather_omp proc~gather_r3->interface~gather_mpi proc~gather_r->interface~gather_omp proc~gather_r->interface~gather_mpi proc~gather_r2->interface~gather_omp proc~gather_r2->interface~gather_mpi proc~gather_i1->interface~gather_omp proc~gather_i1->interface~gather_mpi proc~gather_l2->interface~gather_omp proc~gather_l2->interface~gather_mpi proc~gather_i2->interface~gather_omp proc~gather_i2->interface~gather_mpi proc~gather_l1->interface~gather_omp proc~gather_l1->interface~gather_mpi proc~gather_mpi_i3 gather_mpi_i3 interface~gather_mpi->proc~gather_mpi_i3 proc~gather_mpi_r3 gather_mpi_r3 interface~gather_mpi->proc~gather_mpi_r3 proc~gather_mpi_l3 gather_mpi_l3 interface~gather_mpi->proc~gather_mpi_l3 proc~gather_mpi_i gather_mpi_i interface~gather_mpi->proc~gather_mpi_i proc~gather_mpi_i2 gather_mpi_i2 interface~gather_mpi->proc~gather_mpi_i2 proc~gather_mpi_l1 gather_mpi_l1 interface~gather_mpi->proc~gather_mpi_l1 proc~gather_mpi_l gather_mpi_l interface~gather_mpi->proc~gather_mpi_l proc~gather_mpi_l2 gather_mpi_l2 interface~gather_mpi->proc~gather_mpi_l2 proc~gather_mpi_r gather_mpi_r interface~gather_mpi->proc~gather_mpi_r proc~gather_mpi_i1 gather_mpi_i1 interface~gather_mpi->proc~gather_mpi_i1 proc~gather_mpi_r2 gather_mpi_r2 interface~gather_mpi->proc~gather_mpi_r2 proc~gather_mpi_r1 gather_mpi_r1 interface~gather_mpi->proc~gather_mpi_r1 proc~gather_mpi_igen gather_mpi_igen proc~gather_mpi_i3->proc~gather_mpi_igen proc~gather_mpi_rgen gather_mpi_rgen proc~gather_mpi_r3->proc~gather_mpi_rgen proc~gather_mpi_lgen gather_mpi_lgen proc~gather_mpi_l3->proc~gather_mpi_lgen proc~gather_mpi_i->proc~gather_mpi_igen proc~gather_mpi_i2->proc~gather_mpi_igen proc~gather_mpi_l1->proc~gather_mpi_lgen proc~gather_mpi_l->proc~gather_mpi_lgen proc~gather_mpi_l2->proc~gather_mpi_lgen proc~gather_mpi_r->proc~gather_mpi_rgen proc~gather_mpi_i1->proc~gather_mpi_igen proc~gather_mpi_r2->proc~gather_mpi_rgen proc~gather_mpi_r1->proc~gather_mpi_rgen proc~mpi_gatherv MPI_GATHERV proc~gather_mpi_igen->proc~mpi_gatherv proc~gather_mpi_rgen->proc~mpi_gatherv proc~gather_mpi_lgen->proc~mpi_gatherv proc~lmdz_mpi_wrapper_abort lmdz_mpi_wrapper_abort proc~mpi_gatherv->proc~lmdz_mpi_wrapper_abort

Called by

proc~~wake~~CalledByGraph proc~wake wake proc~calwake calwake proc~calwake->proc~wake proc~calwake~2 calwake proc~calwake~2->proc~wake proc~physiq physiq proc~physiq->proc~calwake proc~physiq~2 physiq proc~physiq~2->proc~calwake~2 proc~old_lmdz1d old_lmdz1d proc~old_lmdz1d->proc~physiq proc~call_physiq call_physiq proc~call_physiq->proc~physiq proc~call_physiq~2 call_physiq proc~call_physiq~2->proc~physiq proc~scm scm proc~scm->proc~physiq program~lmdz1d lmdz1d program~lmdz1d->proc~old_lmdz1d program~lmdz1d->proc~scm proc~calfis calfis proc~calfis->proc~call_physiq proc~leapfrog leapfrog proc~leapfrog->proc~calfis program~gcm~2 gcm program~gcm~2->proc~leapfrog

Contents