Ignore:
Timestamp:
Jan 30, 2015, 2:57:13 PM (10 years ago)
Author:
Laurent Fairhead
Message:

Merged trunk changes -r2158:2186 into testing branch.

Location:
LMDZ5/branches/testing
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • LMDZ5/branches/testing

  • LMDZ5/branches/testing/libf/phylmd/lmdz1d.F90

    r2160 r2187  
    138138!
    139139!---------------------------------------------------------------------
     140!  Declarations related to nudging
     141!---------------------------------------------------------------------
     142     integer :: nudge_max
     143     parameter (nudge_max=9)
     144     integer :: inudge_RHT=1
     145     integer :: inudge_UV=2
     146     logical :: nudge(nudge_max)
     147     real :: t_targ(llm)
     148     real :: rh_targ(llm)
     149     real :: u_targ(llm)
     150     real :: v_targ(llm)
     151!
     152!---------------------------------------------------------------------
    140153!  Declarations related to vertical discretization:
    141154!---------------------------------------------------------------------
     
    156169      real :: du_phys(llm),dv_phys(llm),dt_phys(llm)
    157170      real :: dt_dyn(llm)
    158       real :: dt_cooling(llm),d_th_adv(llm)
     171      real :: dt_cooling(llm),d_th_adv(llm),d_t_nudge(llm)
     172      real :: d_u_nudge(llm),d_v_nudge(llm)
    159173      real :: alpha
    160174      real :: ttt
     
    164178      REAL, ALLOCATABLE, DIMENSION(:,:):: dq_dyn
    165179      REAL, ALLOCATABLE, DIMENSION(:,:):: d_q_adv
    166 !     REAL, ALLOCATABLE, DIMENSION(:):: d_th_adv
     180      REAL, ALLOCATABLE, DIMENSION(:,:):: d_q_nudge
     181!      REAL, ALLOCATABLE, DIMENSION(:):: d_th_adv
    167182
    168183!---------------------------------------------------------------------
     
    211226!---------------------------------------------------------------------
    212227      integer :: k,l,i,it=1,mxcalc
     228      integer jcode
    213229      integer jjmp1
    214230      parameter (jjmp1=jjm+1-1/jjm)
     
    330346        if (forcing_toga.or.forcing_sandu.or.forcing_astex .or. forcing_dice)                 &
    331347     &    type_ts_forcing = 1
    332 
     348!
     349! Initialization of the logical switch for nudging
     350     jcode = iflag_nudge
     351     do i = 1,nudge_max
     352       nudge(i) = mod(jcode,10) .ge. 1
     353       jcode = jcode/10
     354     enddo
    333355!---------------------------------------------------------------------
    334356!  Definition of the run
     
    444466      allocate(dq_dyn(llm,nqtot))
    445467      allocate(d_q_adv(llm,nqtot))
    446 !     allocate(d_th_adv(llm))
     468      allocate(d_q_nudge(llm,nqtot))
     469!      allocate(d_th_adv(llm))
    447470
    448471!
     
    751774         open(97,file='div_slab.dat',STATUS='OLD')
    752775       endif
     776!
     777!---------------------------------------------------------------------
     778!    Initialize target profile for RHT nudging if needed
     779!---------------------------------------------------------------------
     780      if (nudge(inudge_RHT)) then
     781        call nudge_RHT_init(plev,play,temp,q(:,1),t_targ,rh_targ)
     782      endif
     783      if (nudge(inudge_UV)) then
     784        call nudge_UV_init(plev,play,u,v,u_targ,v_targ)
     785      endif
     786!
    753787!=====================================================================
    754788! START OF THE TEMPORAL LOOP :
     
    876910!!     : -fcoriolis*(u(1:mxcalc)-ug(1:mxcalc))
    877911!
     912!!!!!!!!!!!!!!!!!!!!!!!!
     913!  Nudging
     914!!!!!!!!!!!!!!!!!!!!!!!!
     915      d_t_nudge(:) = 0.
     916      d_q_nudge(:,:) = 0.
     917      d_u_nudge(:) = 0.
     918      d_v_nudge(:) = 0.
     919      if (nudge(inudge_RHT)) then
     920        call nudge_RHT(timestep,plev,play,t_targ,rh_targ,temp,q(:,1),     &
     921    &                  d_t_nudge,d_q_nudge(:,1))
     922      endif
     923      if (nudge(inudge_UV)) then
     924        call nudge_UV(timestep,plev,play,u_targ,v_targ,u,v,     &
     925    &                  d_u_nudge,d_v_nudge)
     926      endif
     927!
    878928!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    879929!         call  writefield_phy('dv_age' ,dv_age,llm)
     
    893943        u(1:mxcalc)=u(1:mxcalc) + timestep*(                                &
    894944     &              du_phys(1:mxcalc)                                       &
    895      &             +du_age(1:mxcalc) )           
     945     &             +du_age(1:mxcalc)                                        &
     946     &             +d_u_nudge(1:mxcalc) )           
    896947        v(1:mxcalc)=v(1:mxcalc) + timestep*(                                 &
    897948     &              dv_phys(1:mxcalc)                                       &
    898      &             +dv_age(1:mxcalc) )
     949     &             +dv_age(1:mxcalc)                                        &
     950     &             +d_v_nudge(1:mxcalc) )
    899951        q(1:mxcalc,:)=q(1:mxcalc,:)+timestep*(                              &
    900952     &                dq(1:mxcalc,:)                                        &
    901      &               +d_q_adv(1:mxcalc,:) )
     953     &               +d_q_adv(1:mxcalc,:)                                   &
     954     &               +d_q_nudge(1:mxcalc,:) )
    902955
    903956        if (prt_level.ge.1) then
     
    913966     &              dt_phys(1:mxcalc)                                       &
    914967     &             +d_th_adv(1:mxcalc)                                      &
     968     &             +d_t_nudge(1:mxcalc)                                      &
    915969     &             +dt_cooling(1:mxcalc))  ! Taux de chauffage ou refroid.
    916970
Note: See TracChangeset for help on using the changeset viewer.