Ignore:
Timestamp:
Sep 19, 2023, 3:46:23 PM (14 months ago)
Author:
jyg
Message:

Bug fix in lmdz_wake.F90 and associated flag ok_bug_gfl

File:
1 edited

Legend:

Unmodified
Added
Removed
  • LMDZ6/trunk/libf/phylmd/lmdz_wake.F90

    r4588 r4695  
    3131  USE lmdz_wake_ini , ONLY : stark, wdens_ref, coefgw, alpk, wk_pupper
    3232  USE lmdz_wake_ini , ONLY : crep_upper, crep_sol, tau_cv, rzero, aa0, flag_wk_check_trgl
     33  USE lmdz_wake_ini , ONLY : ok_bug_gfl
    3334  USE lmdz_wake_ini , ONLY : iflag_wk_act, iflag_wk_check_trgl, iflag_wk_pop_dyn, wdensmin
    3435  USE lmdz_wake_ini , ONLY : sigmad, hwmin, wapecut, cstart, sigmaw_max, dens_rate, epsilon_loc
     
    942943    END DO
    943944
     945    IF (ok_bug_gfl) THEN
     946!!--------------------------------------------------------
     947!!Bug : computing gfl and rad_wk before changing sigmaw
     948!!--------------------------------------------------------
     949      DO i = 1, klon
     950        IF (wk_adv(i)) THEN
     951          gfl(i) = 2.*sqrt(3.14*wdens(i)*sigmaw(i))
     952          rad_wk(i) = sqrt(sigmaw(i)/(3.14*wdens(i)))
     953        END IF
     954      END DO
     955    ENDIF   ! (ok_bug_gfl)
     956
    944957    DO i = 1, klon
    945958      IF (wk_adv(i)) THEN
    946         gfl(i) = 2.*sqrt(3.14*wdens(i)*sigmaw(i))
    947         rad_wk(i) = sqrt(sigmaw(i)/(3.14*wdens(i)))
    948 !jyg<
    949 !!        sigmaw(i) = amin1(sigmaw(i), sigmaw_max)
    950959        sigmaw_targ = min(sigmaw(i), sigmaw_max)
    951960        d_sig_bnd2(i) = d_sig_bnd2(i) + sigmaw_targ - sigmaw(i)
    952961        d_sigmaw2(i) = d_sigmaw2(i) + sigmaw_targ - sigmaw(i)
    953 !  print *,'XXXX3 d_sigmaw2(i), sigmaw(i) ', d_sigmaw2(i), sigmaw(i)
    954962        sigmaw(i) = sigmaw_targ
    955 !>jyg
    956       END IF
    957     END DO
     963      END IF
     964    END DO
     965
     966    IF (.NOT.ok_bug_gfl) THEN
     967!!--------------------------------------------------------
     968!!Fix : computing gfl and rad_wk after changing sigmaw
     969!!--------------------------------------------------------
     970      DO i = 1, klon
     971        IF (wk_adv(i)) THEN
     972          gfl(i) = 2.*sqrt(3.14*wdens(i)*sigmaw(i))
     973          rad_wk(i) = sqrt(sigmaw(i)/(3.14*wdens(i)))
     974        END IF
     975      END DO
     976    ENDIF   ! (.NOT.ok_bug_gfl)
    958977
    959978    IF (iflag_wk_pop_dyn == 1) THEN
Note: See TracChangeset for help on using the changeset viewer.