Ignore:
Timestamp:
Nov 30, 2016, 1:28:41 PM (8 years ago)
Author:
Laurent Fairhead
Message:

Merged trunk changes r2664:2719 into testing branch

Location:
LMDZ5/branches/testing
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • LMDZ5/branches/testing

  • LMDZ5/branches/testing/libf/phylmd/dyn1d/1D_interp_cases.h

    r2594 r2720  
    118118! vertical interpolation:
    119119      CALL interp_dice_vertical(play,nlev_dice,nt_dice,plev_dice        &
    120      &         ,th_dice,qv_dice,u_dice,v_dice,o3_dice                   &
     120     &         ,t_dice,qv_dice,u_dice,v_dice,o3_dice                   &
    121121     &         ,ht_profd,hq_profd,hu_profd,hv_profd,w_profd,omega_profd &
    122      &         ,th_mod,qv_mod,u_mod,v_mod,o3_mod                        &
     122     &         ,t_mod,qv_mod,u_mod,v_mod,o3_mod                        &
    123123     &         ,ht_mod,hq_mod,hu_mod,hv_mod,w_mod,omega_mod,mxcalc)
    124124!     do l = 1, llm
     
    192192      endif ! forcing_dice
    193193!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
     194! Interpolation gabls4 forcing
     195!---------------------------------------------------------------------
     196      if (forcing_gabls4 ) then
     197
     198       if (prt_level.ge.1) then
     199        print*,'#### ITAP,day,day1,(day-day1)*86400,(day-day1)*86400/dt_gabls4=',&
     200     &    day,day1,(day-day1)*86400.,(day-day1)*86400/dt_gabls4
     201       endif
     202
     203! time interpolation:
     204      CALL interp_gabls4_time(daytime,day1,annee_ref                                     &
     205     &             ,year_ini_gabls4,day_ju_ini_gabls4,nt_gabls4,dt_gabls4,nlev_gabls4  &
     206     &             ,ug_gabls4,vg_gabls4,ht_gabls4,hq_gabls4,tg_gabls4                            &
     207     &             ,ug_profg,vg_profg,ht_profg,hq_profg,tg_profg)
     208
     209        if (type_ts_forcing.eq.1) ts_cur = tg_prof ! SST used in read_tsurf1d
     210
     211! vertical interpolation:
     212! on re-utilise le programme interp_dice_vertical: les transformations sur
     213! plev_gabls4,th_gabls4,qv_gabls4,u_gabls4,v_gabls4 ne sont pas prises en compte.
     214! seules celles sur ht_profg,hq_profg,ug_profg,vg_profg sont prises en compte.
     215
     216      CALL interp_dice_vertical(play,nlev_gabls4,nt_gabls4,plev_gabls4         &
     217!    &         ,t_gabls4,qv_gabls4,u_gabls4,v_gabls4,poub            &
     218     &         ,poub,poub,poub,poub,poub                             &
     219     &         ,ht_profg,hq_profg,ug_profg,vg_profg,poub,poub        &
     220     &         ,t_mod,qv_mod,u_mod,v_mod,o3_mod                      &
     221     &         ,ht_mod,hq_mod,ug_mod,vg_mod,w_mod,omega_mod,mxcalc)
     222
     223      do l = 1, llm
     224       ug(l)= ug_mod(l)
     225       vg(l)= vg_mod(l)
     226       d_th_adv(l)=ht_mod(l)
     227       d_q_adv(l,1)=hq_mod(l)
     228      enddo
     229
     230      endif ! forcing_gabls4
     231!---------------------------------------------------------------------
     232
    194233!---------------------------------------------------------------------
    195234!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
     
    766805      enddo
    767806
     807! Faut-il multiplier par -1 ? (MPL 20160713)
     808      IF(ok_flux_surf) THEN
     809       fsens=sens_prof_cas
     810       flat=lat_prof_cas
     811      ENDIF
     812!
     813      IF (ok_prescr_ust) THEN
     814       ust=ustar_prof_cas
     815       print *,'ust=',ust
     816      ENDIF
    768817      endif ! forcing_case
    769818
    770819
    771820!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    772 
     821!---------------------------------------------------------------------
     822! Interpolation forcing standard case
     823!---------------------------------------------------------------------
     824      if (forcing_case2) then
     825
     826        print*,                                                             &
     827     & '#### ITAP,day,day1,(day-day1)*86400,(day-day1)*86400/pdt_cas=',     &
     828     &    daytime,day1,(daytime-day1)*86400.,                               &
     829     &    (daytime-day1)*86400/pdt_cas
     830
     831! time interpolation:
     832        CALL interp2_case_time(daytime,day1,annee_ref                                       &
     833!    &       ,year_ini_cas,day_ju_ini_cas,nt_cas,pdt_cas,nlev_cas                           &
     834     &       ,nt_cas,nlev_cas                                                               &
     835     &       ,ts_cas,ps_cas,plev_cas,t_cas,th_cas,thv_cas,thl_cas,qv_cas,ql_cas,qi_cas      &
     836     &       ,u_cas,v_cas,ug_cas,vg_cas,vitw_cas,omega_cas,du_cas,hu_cas,vu_cas             &
     837     &       ,dv_cas,hv_cas,vv_cas,dt_cas,ht_cas,vt_cas,dtrad_cas                           &
     838     &       ,dq_cas,hq_cas,vq_cas,dth_cas,hth_cas,vth_cas,lat_cas,sens_cas,ustar_cas       &
     839     &       ,uw_cas,vw_cas,q1_cas,q2_cas,tke_cas                                           &
     840!
     841     &       ,ts_prof_cas,plev_prof_cas,t_prof_cas,theta_prof_cas,thv_prof_cas  &
     842     &       ,thl_prof_cas,qv_prof_cas,ql_prof_cas,qi_prof_cas                              &
     843     &       ,u_prof_cas,v_prof_cas,ug_prof_cas,vg_prof_cas,vitw_prof_cas,omega_prof_cas    &
     844     &       ,du_prof_cas,hu_prof_cas,vu_prof_cas                                           &
     845     &       ,dv_prof_cas,hv_prof_cas,vv_prof_cas,dt_prof_cas,ht_prof_cas,vt_prof_cas       &
     846     &       ,dtrad_prof_cas,dq_prof_cas,hq_prof_cas,vq_prof_cas                            &
     847     &       ,dth_prof_cas,hth_prof_cas,vth_prof_cas,lat_prof_cas                           &
     848     &       ,sens_prof_cas,ustar_prof_cas,uw_prof_cas,vw_prof_cas,q1_prof_cas,q2_prof_cas,tke_prof_cas)
     849
     850             ts_cur = ts_prof_cas
     851!            psurf=plev_prof_cas(1)
     852             psurf=ps_prof_cas
     853
     854! vertical interpolation:
     855      CALL interp2_case_vertical(play,nlev_cas,plev_prof_cas                                              &
     856     &         ,t_prof_cas,theta_prof_cas,thv_prof_cas,thl_prof_cas                                          &
     857     &         ,qv_prof_cas,ql_prof_cas,qi_prof_cas,u_prof_cas,v_prof_cas                                 &
     858     &         ,ug_prof_cas,vg_prof_cas,vitw_prof_cas,omega_prof_cas                                      &
     859     &         ,du_prof_cas,hu_prof_cas,vu_prof_cas,dv_prof_cas,hv_prof_cas,vv_prof_cas                   &
     860     &         ,dt_prof_cas,ht_prof_cas,vt_prof_cas,dtrad_prof_cas,dq_prof_cas,hq_prof_cas,vq_prof_cas    &
     861     &         ,dth_prof_cas,hth_prof_cas,vth_prof_cas                                                    &
     862!
     863     &         ,t_mod_cas,theta_mod_cas,thv_mod_cas,thl_mod_cas,qv_mod_cas,ql_mod_cas,qi_mod_cas          &
     864     &         ,u_mod_cas,v_mod_cas,ug_mod_cas,vg_mod_cas,w_mod_cas,omega_mod_cas                         &
     865     &         ,du_mod_cas,hu_mod_cas,vu_mod_cas,dv_mod_cas,hv_mod_cas,vv_mod_cas                         &
     866     &         ,dt_mod_cas,ht_mod_cas,vt_mod_cas,dtrad_mod_cas,dq_mod_cas,hq_mod_cas,vq_mod_cas           &
     867     &         ,dth_mod_cas,hth_mod_cas,vth_mod_cas,mxcalc)
     868
     869
     870      DO l=1,llm
     871      teta(l)=temp(l)*(100000./play(l))**(rd/rcpd)
     872      ENDDO
     873!calcul de l'advection verticale a partir du omega
     874!Calcul des gradients verticaux
     875!initialisation
     876      d_t_z(:)=0.
     877      d_th_z(:)=0.
     878      d_q_z(:)=0.
     879      d_t_dyn_z(:)=0.
     880      d_th_dyn_z(:)=0.
     881      d_q_dyn_z(:)=0.
     882      DO l=2,llm-1
     883       d_t_z(l)=(temp(l+1)-temp(l-1))/(play(l+1)-play(l-1))
     884       d_th_z(l)=(teta(l+1)-teta(l-1))/(play(l+1)-play(l-1))
     885       d_q_z(l)=(q(l+1,1)-q(l-1,1))/(play(l+1)-play(l-1))
     886      ENDDO
     887      d_t_z(1)=d_t_z(2)
     888      d_th_z(1)=d_th_z(2)
     889      d_q_z(1)=d_q_z(2)
     890      d_t_z(llm)=d_t_z(llm-1)
     891      d_th_z(llm)=d_th_z(llm-1)
     892      d_q_z(llm)=d_q_z(llm-1)
     893
     894!Calcul de l advection verticale
     895      d_t_dyn_z(:)=w_mod_cas(:)*d_t_z(:)
     896      d_th_dyn_z(:)=w_mod_cas(:)*d_th_z(:)
     897      d_q_dyn_z(:)=w_mod_cas(:)*d_q_z(:)
     898
     899!wind nudging
     900      if (nudging_u.gt.0.) then
     901        do l=1,llm
     902           u(l)=u(l)+timestep*(u_mod_cas(l)-u(l))/(nudge_u)
     903        enddo
     904      else
     905        do l=1,llm
     906        ug(l) = u_mod_cas(l)
     907        enddo
     908      endif
     909
     910      if (nudging_v.gt.0.) then
     911        do l=1,llm
     912           v(l)=v(l)+timestep*(v_mod_cas(l)-v(l))/(nudge_v)
     913        enddo
     914      else
     915        do l=1,llm
     916        vg(l) = v_mod_cas(l)
     917        enddo
     918      endif
     919
     920      if (nudging_w.gt.0.) then
     921        do l=1,llm
     922           w(l)=w(l)+timestep*(w_mod_cas(l)-w(l))/(nudge_w)
     923        enddo
     924      else
     925        do l=1,llm
     926        w(l) = w_mod_cas(l)
     927        enddo
     928      endif
     929
     930!nudging of q and temp
     931      if (nudging_t.gt.0.) then
     932        do l=1,llm
     933           temp(l)=temp(l)+timestep*(t_mod_cas(l)-temp(l))/(nudge_t)
     934        enddo
     935      endif
     936      if (nudging_q.gt.0.) then
     937        do l=1,llm
     938           q(l,1)=q(l,1)+timestep*(q_mod_cas(l)-q(l,1))/(nudge_q)
     939        enddo
     940      endif
     941
     942      do l = 1, llm
     943       omega(l) = w_mod_cas(l)
     944       omega2(l)= omega(l)/rg*airefi ! flxmass_w calcule comme ds physiq
     945       alpha = rd*temp(l)*(1.+(rv/rd-1.)*q(l,1))/play(l)
     946
     947!calcul advection
     948!       if ((tend_u.eq.1).and.(tend_w.eq.0)) then
     949!          d_u_adv(l)=du_mod_cas(l)
     950!       else if ((tend_u.eq.1).and.(tend_w.eq.1)) then
     951!          d_u_adv(l)=hu_mod_cas(l)-d_u_dyn_z(l)
     952!       endif
     953!
     954!       if ((tend_v.eq.1).and.(tend_w.eq.0)) then
     955!          d_v_adv(l)=dv_mod_cas(l)
     956!       else if ((tend_v.eq.1).and.(tend_w.eq.1)) then
     957!          d_v_adv(l)=hv_mod_cas(l)-d_v_dyn_z(l)
     958!       endif
     959!
     960!-----------------------------------------------------
     961        if (tadv.eq.1 .or. tadvh.eq.1) then
     962           d_t_adv(l)=alpha*omega(l)/rcpd-dt_mod_cas(l)
     963        else if (tadvv.eq.1) then
     964! ATTENTION d_t_dyn_z pas calcule (voir twpice)
     965           d_t_adv(l)=alpha*omega(l)/rcpd-ht_mod_cas(l)-d_t_dyn_z(l)
     966        endif
     967        print *,'interp_case d_t_dyn_z=',d_t_dyn_z(l),d_q_dyn_z(l)
     968
     969! Verifier le signe !!
     970        if (thadv.eq.1 .or. thadvh.eq.1) then
     971           d_th_adv(l)=dth_mod_cas(l)
     972           print *,'dthadv=',d_th_adv(l)*86400.
     973        else if (thadvv.eq.1) then
     974           d_th_adv(l)=hth_mod_cas(l)-d_th_dyn_z(l)
     975        endif
     976 
     977! Verifier le signe !!
     978        if ((qadv.eq.1).and.(forc_w.eq.0)) then
     979           d_q_adv(l,1)=dq_mod_cas(l)
     980        else if ((qadvh.eq.1).and.(forc_w.eq.1)) then
     981           d_q_adv(l,1)=hq_mod_cas(l)-d_q_dyn_z(l)
     982        endif
     983         
     984        if (trad.eq.1) then
     985           tend_rayo=1
     986           dt_cooling(l) = dtrad_mod_cas(l)
     987!          print *,'dt_cooling=',dt_cooling(l)
     988        else
     989           dt_cooling(l) = 0.0
     990        endif
     991      enddo
     992
     993! Faut-il multiplier par -1 ? (MPL 20160713)
     994      IF(ok_flux_surf) THEN
     995       fsens=-1.*sens_prof_cas
     996       flat=-1.*lat_prof_cas
     997       print *,'1D_interp: sens,flat',fsens,flat
     998      ENDIF
     999!
     1000      IF (ok_prescr_ust) THEN
     1001       ust=ustar_prof_cas
     1002       print *,'ust=',ust
     1003      ENDIF
     1004      endif ! forcing_case2
     1005!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
     1006
Note: See TracChangeset for help on using the changeset viewer.