!--------------------------------------------------------------------- ! Interpolation forcing in time and onto model levels !--------------------------------------------------------------------- if (forcing_GCSSold) then call get_uvd(it,timestep,fich_gcssold_ctl,fich_gcssold_dat, & & ht_gcssold,hq_gcssold,hw_gcssold, & & hu_gcssold,hv_gcssold, & & hthturb_gcssold,hqturb_gcssold,Ts_gcssold, & & imp_fcg_gcssold,ts_fcg_gcssold, & & Tp_fcg_gcssold,Turb_fcg_gcssold) if (prt_level.ge.1) then print *,' get_uvd -> hqturb_gcssold ',it,hqturb_gcssold endif ! large-scale forcing : !!! tsurf = ts_gcssold do l = 1, llm ! u(l) = hu_gcssold(l) ! on prescrit le vent ! v(l) = hv_gcssold(l) ! on prescrit le vent ! omega(l) = hw_gcssold(l) ! rho(l) = play(l)/(rd*temp(l)*(1.+(rv/rd-1.)*q(l,1))) ! omega2(l)=-rho(l)*omega(l) omega(l) = hw_gcssold(l) omega2(l)= omega(l)/rg*airefi ! flxmass_w calcule comme ds physiq alpha = rd*temp(l)*(1.+(rv/rd-1.)*q(l,1))/play(l) d_th_adv(l) = ht_gcssold(l) d_q_adv(l,1) = hq_gcssold(l) dt_cooling(l) = 0.0 enddo endif ! forcing_GCSSold !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !--------------------------------------------------------------------- ! Interpolation Toga forcing !--------------------------------------------------------------------- if (forcing_toga) then if (prt_level.ge.1) then print*, & & '#### ITAP,day,day1,(day-day1)*86400,(day-day1)*86400/dt_toga=', & & day,day1,(day-day1)*86400.,(day-day1)*86400/dt_toga endif ! time interpolation: CALL interp_toga_time(daytime,day1,annee_ref & & ,year_ini_toga,day_ju_ini_toga,nt_toga,dt_toga & & ,nlev_toga,ts_toga,plev_toga,t_toga,q_toga,u_toga & & ,v_toga,w_toga,ht_toga,vt_toga,hq_toga,vq_toga & & ,ts_prof,plev_prof,t_prof,q_prof,u_prof,v_prof,w_prof & & ,ht_prof,vt_prof,hq_prof,vq_prof) if (type_ts_forcing.eq.1) ts_cur = ts_prof ! SST used in read_tsurf1d ! vertical interpolation: CALL interp_toga_vertical(play,nlev_toga,plev_prof & & ,t_prof,q_prof,u_prof,v_prof,w_prof & & ,ht_prof,vt_prof,hq_prof,vq_prof & & ,t_mod,q_mod,u_mod,v_mod,w_mod & & ,ht_mod,vt_mod,hq_mod,vq_mod,mxcalc) ! large-scale forcing : tsurf = ts_prof do l = 1, llm u(l) = u_mod(l) ! sb: on prescrit le vent v(l) = v_mod(l) ! sb: on prescrit le vent ! omega(l) = w_prof(l) ! rho(l) = play(l)/(rd*temp(l)*(1.+(rv/rd-1.)*q(l,1))) ! omega2(l)=-rho(l)*omega(l) omega(l) = w_mod(l) omega2(l)= omega(l)/rg*airefi ! flxmass_w calcule comme ds physiq alpha = rd*temp(l)*(1.+(rv/rd-1.)*q(l,1))/play(l) d_th_adv(l) = alpha*omega(l)/rcpd-(ht_mod(l)+vt_mod(l)) d_q_adv(l,1) = -(hq_mod(l)+vq_mod(l)) dt_cooling(l) = 0.0 enddo endif ! forcing_toga !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !--------------------------------------------------------------------- ! Interpolation forcing TWPice !--------------------------------------------------------------------- if (forcing_twpice) then print*, & & '#### ITAP,day,day1,(day-day1)*86400,(day-day1)*86400/dt_twpi=', & & daytime,day1,(daytime-day1)*86400., & & (daytime-day1)*86400/dt_twpi ! time interpolation: CALL interp_toga_time(daytime,day1,annee_ref & & ,year_ini_twpi,day_ju_ini_twpi,nt_twpi,dt_twpi,nlev_twpi & & ,ts_twpi,plev_twpi,t_twpi,q_twpi,u_twpi,v_twpi,w_twpi & & ,ht_twpi,vt_twpi,hq_twpi,vq_twpi & & ,ts_proftwp,plev_proftwp,t_proftwp,q_proftwp,u_proftwp & & ,v_proftwp,w_proftwp & & ,ht_proftwp,vt_proftwp,hq_proftwp,vq_proftwp) ! vertical interpolation: CALL interp_toga_vertical(play,nlev_twpi,plev_proftwp & & ,t_proftwp,q_proftwp,u_proftwp,v_proftwp,w_proftwp & & ,ht_proftwp,vt_proftwp,hq_proftwp,vq_proftwp & & ,t_mod,q_mod,u_mod,v_mod,w_mod & & ,ht_mod,vt_mod,hq_mod,vq_mod,mxcalc) !calcul de l'advection verticale a partir du omega !Calcul des gradients verticaux !initialisation d_t_z(:)=0. d_q_z(:)=0. d_t_dyn_z(:)=0. d_q_dyn_z(:)=0. DO l=2,llm-1 d_t_z(l)=(temp(l+1)-temp(l-1))/(play(l+1)-play(l-1)) d_q_z(l)=(q(l+1,1)-q(l-1,1))/(play(l+1)-play(l-1)) ENDDO d_t_z(1)=d_t_z(2) d_q_z(1)=d_q_z(2) d_t_z(llm)=d_t_z(llm-1) d_q_z(llm)=d_q_z(llm-1) !Calcul de l advection verticale d_t_dyn_z(:)=w_mod(:)*d_t_z(:) d_q_dyn_z(:)=w_mod(:)*d_q_z(:) !wind nudging above 500m with a 2h time scale do l=1,llm if (nudge_wind) then ! if (phi(l).gt.5000.) then if (phi(l).gt.0.) then u(l)=u(l)+timestep*(u_mod(l)-u(l))/(2.*3600.) v(l)=v(l)+timestep*(v_mod(l)-v(l))/(2.*3600.) endif else u(l) = u_mod(l) v(l) = v_mod(l) endif enddo !CR:nudging of q and theta with a 6h time scale above 15km if (nudge_thermo) then do l=1,llm zz(l)=phi(l)/9.8 if ((zz(l).le.16000.).and.(zz(l).gt.15000.)) then zfact=(zz(l)-15000.)/1000. q(l,1)=q(l,1)+timestep*(q_mod(l)-q(l,1))/(6.*3600.)*zfact temp(l)=temp(l)+timestep*(t_mod(l)-temp(l))/(6.*3600.)*zfact else if (zz(l).gt.16000.) then q(l,1)=q(l,1)+timestep*(q_mod(l)-q(l,1))/(6.*3600.) temp(l)=temp(l)+timestep*(t_mod(l)-temp(l))/(6.*3600.) endif enddo endif do l = 1, llm omega(l) = w_mod(l) omega2(l)= omega(l)/rg*airefi ! flxmass_w calcule comme ds physiq alpha = rd*temp(l)*(1.+(rv/rd-1.)*q(l,1))/play(l) !calcul de l'advection totale if (cptadvw) then d_th_adv(l) = alpha*omega(l)/rcpd+ht_mod(l)-d_t_dyn_z(l) ! print*,'temp vert adv',l,ht_mod(l),vt_mod(l),-d_t_dyn_z(l) d_q_adv(l,1) = hq_mod(l)-d_q_dyn_z(l) ! print*,'q vert adv',l,hq_mod(l),vq_mod(l),-d_q_dyn_z(l) else d_th_adv(l) = alpha*omega(l)/rcpd+(ht_mod(l)+vt_mod(l)) d_q_adv(l,1) = (hq_mod(l)+vq_mod(l)) endif dt_cooling(l) = 0.0 enddo endif ! forcing_twpice !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !--------------------------------------------------------------------- ! Interpolation forcing AMMA !--------------------------------------------------------------------- if (forcing_amma) then print*, & & '#### ITAP,day,day1,(day-day1)*86400,(day-day1)*86400/dt_amma=', & & daytime,day1,(daytime-day1)*86400., & & (daytime-day1)*86400/dt_amma ! time interpolation using TOGA interpolation routine CALL interp_amma_time(daytime,day1,annee_ref & & ,year_ini_amma,day_ju_ini_amma,nt_amma,dt_amma,nlev_amma & & ,vitw_amma,ht_amma,hq_amma,lat_amma,sens_amma & & ,vitw_profamma,ht_profamma,hq_profamma,lat_profamma & & ,sens_profamma) print*,'apres interpolation temporelle AMMA' do k=1,nlev_amma th_profamma(k)=0. q_profamma(k)=0. u_profamma(k)=0. v_profamma(k)=0. vt_profamma(k)=0. vq_profamma(k)=0. enddo ! vertical interpolation using TOGA interpolation routine: ! write(*,*)'avant interp vert', t_proftwp CALL interp_toga_vertical(play,nlev_amma,plev_amma & & ,th_profamma,q_profamma,u_profamma,v_profamma & & ,vitw_profamma & & ,ht_profamma,vt_profamma,hq_profamma,vq_profamma & & ,t_mod,q_mod,u_mod,v_mod,w_mod & & ,ht_mod,vt_mod,hq_mod,vq_mod,mxcalc) write(*,*) 'Profil initial forcing AMMA interpole' !calcul de l'advection verticale a partir du omega !Calcul des gradients verticaux !initialisation do l=1,llm d_t_z(l)=0. d_q_z(l)=0. enddo DO l=2,llm-1 d_t_z(l)=(temp(l+1)-temp(l-1))/(play(l+1)-play(l-1)) d_q_z(l)=(q(l+1,1)-q(l-1,1))/(play(l+1)-play(l-1)) ENDDO d_t_z(1)=d_t_z(2) d_q_z(1)=d_q_z(2) d_t_z(llm)=d_t_z(llm-1) d_q_z(llm)=d_q_z(llm-1) do l = 1, llm rho(l) = play(l)/(rd*temp(l)*(1.+(rv/rd-1.)*q(l,1))) omega(l) = w_mod(l)*(-rg*rho(l)) omega2(l)= omega(l)/rg*airefi ! flxmass_w calcule comme ds physiq alpha = rd*temp(l)*(1.+(rv/rd-1.)*q(l,1))/play(l) !calcul de l'advection totale ! d_th_adv(l) = alpha*omega(l)/rcpd+ht_mod(l)-omega(l)*d_t_z(l) !attention: on impose dth d_th_adv(l) = alpha*omega(l)/rcpd+ & & ht_mod(l)*(play(l)/pzero)**rkappa-omega(l)*d_t_z(l) ! d_th_adv(l) = 0. ! print*,'temp vert adv',l,ht_mod(l),vt_mod(l),-d_t_dyn_z(l) d_q_adv(l,1) = hq_mod(l)-omega(l)*d_q_z(l) ! d_q_adv(l,1) = 0. ! print*,'q vert adv',l,hq_mod(l),vq_mod(l),-d_q_dyn_z(l) dt_cooling(l) = 0.0 enddo ! ok_flux_surf=.false. fsens=-1.*sens_profamma flat=-1.*lat_profamma endif ! forcing_amma !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !--------------------------------------------------------------------- ! Interpolation forcing Rico !--------------------------------------------------------------------- if (forcing_rico) then ! call lstendH(llm,omega,dt_dyn,dq_dyn,du_dyn, dv_dyn, ! : q,temp,u,v,play) call lstendH(llm,nqtot,omega,dt_dyn,dq_dyn,q,temp,u,v,play) do l=1,llm d_th_adv(l) = (dth_rico(l) + dt_dyn(l)) d_q_adv(l,1) = (dqh_rico(l) + dq_dyn(l,1)) d_q_adv(l,2) = 0. enddo endif ! forcing_rico !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !--------------------------------------------------------------------- ! Interpolation forcing Arm_cu !--------------------------------------------------------------------- if (forcing_armcu) then print*, & & '#### ITAP,day,day1,(day-day1)*86400,(day-day1)*86400/dt_armcu=', & & day,day1,(day-day1)*86400.,(day-day1)*86400/dt_armcu ! time interpolation: ! ATTENTION, cet appel ne convient pas pour TOGA !! ! revoir 1DUTILS.h et les arguments CALL interp_armcu_time(daytime,day1,annee_ref & & ,year_ini_armcu,day_ju_ini_armcu,nt_armcu,dt_armcu & & ,nlev_armcu,sens_armcu,flat_armcu,adv_theta_armcu & & ,rad_theta_armcu,adv_qt_armcu,sens_prof,flat_prof & & ,adv_theta_prof,rad_theta_prof,adv_qt_prof) ! vertical interpolation: ! No vertical interpolation if nlev imposed to 19 or 40 ! For this case, fluxes are imposed fsens=-1*sens_prof flat=-1*flat_prof ! Advective forcings are given in K or g/kg ... BY HOUR do l = 1, llm ug(l)= u_mod(l) vg(l)= v_mod(l) IF((phi(l)/RG).LT.1000) THEN d_th_adv(l) = (adv_theta_prof + rad_theta_prof)/3600. d_q_adv(l,1) = adv_qt_prof/1000./3600. d_q_adv(l,2) = 0.0 ! print *,'INF1000: phi dth dq1 dq2', ! : phi(l)/RG,d_th_adv(l),d_q_adv(l,1),d_q_adv(l,2) ELSEIF ((phi(l)/RG).GE.1000.AND.(phi(l)/RG).lt.3000) THEN fact=((phi(l)/RG)-1000.)/2000. fact=1-fact d_th_adv(l) = (adv_theta_prof + rad_theta_prof)*fact/3600. d_q_adv(l,1) = adv_qt_prof*fact/1000./3600. d_q_adv(l,2) = 0.0 ! print *,'SUP1000: phi fact dth dq1 dq2', ! : phi(l)/RG,fact,d_th_adv(l),d_q_adv(l,1),d_q_adv(l,2) ELSE d_th_adv(l) = 0.0 d_q_adv(l,1) = 0.0 d_q_adv(l,2) = 0.0 ! print *,'SUP3000: phi dth dq1 dq2', ! : phi(l)/RG,d_th_adv(l),d_q_adv(l,1),d_q_adv(l,2) ENDIF dt_cooling(l) = 0.0 ! print *,'Interp armcu: phi dth dq1 dq2', ! : l,phi(l),d_th_adv(l),d_q_adv(l,1),d_q_adv(l,2) enddo endif ! forcing_armcu !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !--------------------------------------------------------------------- ! Interpolation forcing in time and onto model levels !--------------------------------------------------------------------- if (forcing_sandu) then print*, & & '#### ITAP,day,day1,(day-day1)*86400,(day-day1)*86400/dt_sandu=', & & day,day1,(day-day1)*86400.,(day-day1)*86400/dt_sandu ! time interpolation: ! ATTENTION, cet appel ne convient pas pour TOGA !! ! revoir 1DUTILS.h et les arguments CALL interp_sandu_time(daytime,day1,annee_ref & & ,year_ini_sandu,day_ju_ini_sandu,nt_sandu,dt_sandu & & ,nlev_sandu & & ,ts_sandu,ts_prof) if (type_ts_forcing.eq.1) ts_cur = ts_prof ! SST used in read_tsurf1d ! vertical interpolation: CALL interp_sandu_vertical(play,nlev_sandu,plev_profs & & ,t_profs,thl_profs,q_profs,u_profs,v_profs,w_profs & & ,omega_profs,o3mmr_profs & & ,t_mod,thl_mod,q_mod,u_mod,v_mod,w_mod & & ,omega_mod,o3mmr_mod,mxcalc) !calcul de l'advection verticale !Calcul des gradients verticaux !initialisation d_t_z(:)=0. d_q_z(:)=0. d_t_dyn_z(:)=0. d_q_dyn_z(:)=0. ! schema centre ! DO l=2,llm-1 ! d_t_z(l)=(temp(l+1)-temp(l-1)) ! & /(play(l+1)-play(l-1)) ! d_q_z(l)=(q(l+1,1)-q(l-1,1)) ! & /(play(l+1)-play(l-1)) ! schema amont DO l=2,llm-1 d_t_z(l)=(temp(l+1)-temp(l))/(play(l+1)-play(l)) d_q_z(l)=(q(l+1,1)-q(l,1))/(play(l+1)-play(l)) ! print *,'l temp2 temp0 play2 play0 omega_mod', ! & temp(l+1),temp(l-1),play(l+1),play(l-1),omega_mod(l) ENDDO d_t_z(1)=d_t_z(2) d_q_z(1)=d_q_z(2) d_t_z(llm)=d_t_z(llm-1) d_q_z(llm)=d_q_z(llm-1) ! calcul de l advection verticale ! Confusion w (m/s) et omega (Pa/s) !! d_t_dyn_z(:)=omega_mod(:)*d_t_z(:) d_q_dyn_z(:)=omega_mod(:)*d_q_z(:) ! do l=1,llm ! print *,'d_t_dyn omega_mod d_t_z d_q_dyn d_q_z', ! :l,d_t_dyn_z(l),omega_mod(l),d_t_z(l),d_q_dyn_z(l),d_q_z(l) ! enddo ! large-scale forcing : pour le cas Sandu ces forcages sont la SST ! et une divergence constante -> profil de omega tsurf = ts_prof write(*,*) 'SST suivante: ',tsurf do l = 1, llm omega(l) = omega_mod(l) omega2(l)= omega(l)/rg*airefi ! flxmass_w calcule comme ds physiq alpha = rd*temp(l)*(1.+(rv/rd-1.)*q(l,1))/play(l) ! ! d_th_adv(l) = 0.0 ! d_q_adv(l,1) = 0.0 !CR:test advection=0 !calcul de l'advection verticale d_th_adv(l) = alpha*omega(l)/rcpd-d_t_dyn_z(l) ! print*,'temp adv',l,-d_t_dyn_z(l) d_q_adv(l,1) = -d_q_dyn_z(l) ! print*,'q adv',l,-d_q_dyn_z(l) dt_cooling(l) = 0.0 enddo endif ! forcing_sandu !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !--------------------------------------------------------------------- ! Interpolation forcing in time and onto model levels !--------------------------------------------------------------------- if (forcing_astex) then print*, & & '#### ITAP,day,day1,(day-day1)*86400,(day-day1)*86400/dt_astex=', & & day,day1,(day-day1)*86400.,(day-day1)*86400/dt_astex ! time interpolation: ! ATTENTION, cet appel ne convient pas pour TOGA !! ! revoir 1DUTILS.h et les arguments CALL interp_astex_time(daytime,day1,annee_ref & & ,year_ini_astex,day_ju_ini_astex,nt_astex,dt_astex & & ,nlev_astex,div_astex,ts_astex,ug_astex,vg_astex & & ,ufa_astex,vfa_astex,div_prof,ts_prof,ug_prof,vg_prof & & ,ufa_prof,vfa_prof) if (type_ts_forcing.eq.1) ts_cur = ts_prof ! SST used in read_tsurf1d ! vertical interpolation: CALL interp_astex_vertical(play,nlev_astex,plev_profa & & ,t_profa,thl_profa,qv_profa,ql_profa,qt_profa & & ,u_profa,v_profa,w_profa,tke_profa,o3mmr_profa & & ,t_mod,thl_mod,qv_mod,ql_mod,qt_mod,u_mod,v_mod,w_mod & & ,tke_mod,o3mmr_mod,mxcalc) !calcul de l'advection verticale !Calcul des gradients verticaux !initialisation d_t_z(:)=0. d_q_z(:)=0. d_t_dyn_z(:)=0. d_q_dyn_z(:)=0. ! schema centre ! DO l=2,llm-1 ! d_t_z(l)=(temp(l+1)-temp(l-1)) ! & /(play(l+1)-play(l-1)) ! d_q_z(l)=(q(l+1,1)-q(l-1,1)) ! & /(play(l+1)-play(l-1)) ! schema amont DO l=2,llm-1 d_t_z(l)=(temp(l+1)-temp(l))/(play(l+1)-play(l)) d_q_z(l)=(q(l+1,1)-q(l,1))/(play(l+1)-play(l)) ! print *,'l temp2 temp0 play2 play0 omega_mod', ! & temp(l+1),temp(l-1),play(l+1),play(l-1),omega_mod(l) ENDDO d_t_z(1)=d_t_z(2) d_q_z(1)=d_q_z(2) d_t_z(llm)=d_t_z(llm-1) d_q_z(llm)=d_q_z(llm-1) ! calcul de l advection verticale ! Confusion w (m/s) et omega (Pa/s) !! d_t_dyn_z(:)=w_mod(:)*d_t_z(:) d_q_dyn_z(:)=w_mod(:)*d_q_z(:) ! do l=1,llm ! print *,'d_t_dyn omega_mod d_t_z d_q_dyn d_q_z', ! :l,d_t_dyn_z(l),omega_mod(l),d_t_z(l),d_q_dyn_z(l),d_q_z(l) ! enddo ! large-scale forcing : pour le cas Astex ces forcages sont la SST ! la divergence,ug,vg,ufa,vfa tsurf = ts_prof write(*,*) 'SST suivante: ',tsurf do l = 1, llm omega(l) = w_mod(l) omega2(l)= omega(l)/rg*airefi ! flxmass_w calcule comme ds physiq alpha = rd*temp(l)*(1.+(rv/rd-1.)*q(l,1))/play(l) ! ! d_th_adv(l) = 0.0 ! d_q_adv(l,1) = 0.0 !CR:test advection=0 !calcul de l'advection verticale d_th_adv(l) = alpha*omega(l)/rcpd-d_t_dyn_z(l) ! print*,'temp adv',l,-d_t_dyn_z(l) d_q_adv(l,1) = -d_q_dyn_z(l) ! print*,'q adv',l,-d_q_dyn_z(l) dt_cooling(l) = 0.0 enddo endif ! forcing_astex !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!