2 ! 
$Id: 1D_read_forc_cases.h 2332 2015-07-21 15:40:58Z fhourdin $
 
    4 !----------------------------------------------------------------------
 
    5 ! forcing_les = .T. : Impose a constant cooling 
 
    6 ! forcing_radconv = .T. : Pure radiative-convective equilibrium:
 
    7 !----------------------------------------------------------------------
 
   13       if (forcing_les .or. forcing_radconv                                      &
 
   14      &    .or. forcing_GCSSold .or. forcing_fire) then
 
   16       if (forcing_fire) then
 
   17 !----------------------------------------------------------------------
 
   18 !read fire forcings from fire.nc
 
   19 !----------------------------------------------------------------------
 
   25       write(*,*) 'Forcing FIRE lu'
 
   26       kmax=120            ! nombre 
de niveaux dans les profils et forcages
 
   28 !----------------------------------------------------------------------
 
   29 ! Read profiles from files: prof.inp.001 and lscale.inp.001
 
   30 ! (repris 
de readlesfiles)
 
   31 !----------------------------------------------------------------------
 
   37      &           thlpcar,qprof,nq1,nq2)
 
   40 ! compute altitudes of 
play levels.
 
   41       zlay(1) =zsurf +  
rd*tsurf*(psurf-
play(1))/(
rg*psurf)
 
   43         zlay(l) = zlay(l-1)+
rd*tsurf*(psurf-
play(1))/(
rg*psurf)
 
   46 !----------------------------------------------------------------------
 
   47 ! Interpolation of the profiles given on the input file to
 
   49 !----------------------------------------------------------------------
 
   50       zlay(1) = zsurf +  
rd*tsurf*(psurf-
play(1))/(
rg*psurf)
 
   52         ! Above the max altutide of the input file
 
   54         if (zlay(l)<height(kmax)) mxcalc=l
 
   56         frac = (height(kmax)-zlay(l))/(height (kmax)-height(kmax-1))
 
   57         ttt =tttprof(kmax)-frac*(tttprof(kmax)-tttprof(kmax-1))
 
   58        if ((forcing_GCSSold .AND. tp_ini_GCSSold) .OR. forcing_fire)then ! pot. temp. in initial profile
 
   65           print *,' temp,
teta ',l,temp(l),teta(l)
 
   66         q(l,1)  = qtprof(kmax)-frac*( qtprof(kmax)- qtprof(kmax-1))
 
   67         u(l)    =  uprof(kmax)-frac*(  uprof(kmax)-  uprof(kmax-1))
 
   68         v(l)    =  vprof(kmax)-frac*(  vprof(kmax)-  vprof(kmax-1))
 
   69         ug(l)   = ugprof(kmax)-frac*( ugprof(kmax)- ugprof(kmax-1))
 
   70         vg(l)   = vgprof(kmax)-frac*( vgprof(kmax)- vgprof(kmax-1))
 
   71         IF (nq2>0) 
q(l,nq1:nq2)=qprof(kmax,nq1:nq2)                         &
 
   72      &               -frac*(qprof(kmax,nq1:nq2)-qprof(kmax-1,nq1:nq2))
 
   73         omega(l)=   wfls(kmax)-frac*(   wfls(kmax)-   wfls(kmax-1))
 
   75         dq_dyn(l,1) = dqtdtls(kmax)-frac*(dqtdtls(kmax)-dqtdtls(kmax-1))
 
   76         dt_cooling(l)=thlpcar(kmax)-frac*(thlpcar(kmax)-thlpcar(kmax-1))
 
   78           frac = (height(k)-zlay(l))/(height(k)-height(k-1))
 
   79           if(l==1) print*,'k, height, tttprof',k,height(k),tttprof(k)
 
   80           if(zlay(l)>height(k-1).and.zlay(l)<height(k)) then
 
   81             ttt =tttprof(k)-frac*(tttprof(k)-tttprof(k-1))
 
   82        if ((forcing_GCSSold .AND. tp_ini_GCSSold) .OR. forcing_fire)then ! pot. temp. in initial profile
 
   89           print *,' temp,teta ',l,temp(l),teta(l)
 
   90             q(l,1)  = qtprof(k)-frac*( qtprof(k)- qtprof(k-1))
 
   91             u(l)    =  uprof(k)-frac*(  uprof(k)-  uprof(k-1))
 
   92             v(l)    =  vprof(k)-frac*(  vprof(k)-  vprof(k-1))
 
   93             ug(l)   = ugprof(k)-frac*( ugprof(k)- ugprof(k-1))
 
   94             vg(l)   = vgprof(k)-frac*( vgprof(k)- vgprof(k-1))
 
   95             IF (nq2>0) 
q(l,nq1:nq2)=qprof(k,nq1:nq2)                        &
 
   96      &                   -frac*(qprof(k,nq1:nq2)-qprof(k-1,nq1:nq2))
 
   97             omega(l)=   wfls(k)-frac*(   wfls(k)-   wfls(k-1))
 
   98             dq_dyn(l,1)=dqtdtls(k)-frac*(dqtdtls(k)-dqtdtls(k-1))
 
   99             dt_cooling(l)=thlpcar(k)-frac*(thlpcar(k)-thlpcar(k-1))
 
  100           elseif(zlay(l)<height(1)) then ! profils uniformes pour z<height(1)
 
  102        if ((forcing_GCSSold .AND. tp_ini_GCSSold) .OR. forcing_fire)then ! pot. temp. in initial profile
 
  115             IF (nq2>0) 
q(l,nq1:nq2)=qprof(1,nq1:nq2)
 
  116             dq_dyn(l,1)  =dqtdtls(1)
 
  117             dt_cooling(l)=thlpcar(1)
 
  121         temp(l)=max(min(temp(l),350.),150.)
 
  122         rho(l)  = 
play(l)/(
rd*temp(l)*(1.+(
rv/
rd-1.)*
q(l,1)))
 
  124           zlay(l+1) = zlay(l) + (
play(l)-
play(l+1))/(
rg*rho(l))
 
  126         omega2(l)=-rho(l)*
omega(l)
 
  129         if(zlay(l-1)>height(kmax)) then
 
  134         if(
q(l,1)<0.) 
q(l,1)=0.0
 
  138       endif ! forcing_les .or. forcing_GCSSold .or. forcing_fire
 
  139 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
  140 !---------------------------------------------------------------------
 
  141 ! Forcing for GCSSold:
 
  142 !---------------------------------------------------------------------
 
  143       if (forcing_GCSSold) then
 
  153        print *,' get_uvd2 -> hqturb_gcssold ',hqturb_gcssold
 
  154       endif ! forcing_GCSSold
 
  155 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
  156 !---------------------------------------------------------------------
 
  158 !---------------------------------------------------------------------
 
  159       if (forcing_rico) then
 
  162       fich_rico = 'rico.txt'
 
  163        call read_rico(fich_rico,nlev_rico,ps_rico,play                      &
 
  164      &             ,ts_rico,t_rico,q_rico,u_rico,v_rico,w_rico              &
 
  165      &             ,dth_rico,dqh_rico)
 
  166         print*, ' on a lu et prepare RICO'
 
  169        print *, airefi, ' airefi '
 
  171        rho(l)  = play(l)/(
rd*t_rico(l)*(1.+(
rv/
rd-1.)*q_rico(l)))
 
  179        omega(l) = -w_rico(l)*
rg 
  180        omega2(l) = omega(l)/
rg*airefi
 
  183 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
  184 !---------------------------------------------------------------------
 
  185 ! Forcing from TOGA-COARE experiment (Ciesielski et al. 2002) :
 
  186 !---------------------------------------------------------------------
 
  188       if (forcing_toga) then
 
  190 ! read TOGA-COARE 
forcing (native vertical grid, 
nt_toga timesteps):
 
  191       fich_toga = './d_toga/ifa_toga_coare_v21_dime.txt'
 
  196        write(*,*) 'Forcing TOGA lu'
 
  199       write(*,*) 'AVT 1ere INTERPOLATION: 
day,
day1 = ',day,day1
 
  200       CALL interp_toga_time(daytime,day1,
annee_ref                          &
 
  202      &             ,nlev_toga,ts_toga,plev_toga,t_toga,q_toga,u_toga        &
 
  203      &             ,v_toga,w_toga,ht_toga,vt_toga,hq_toga,vq_toga           &
 
  208       CALL interp_toga_vertical(play,nlev_toga,plev_prof                    &
 
  209      &         ,t_prof,q_prof,u_prof,v_prof,w_prof                          &
 
  210      &         ,ht_prof,vt_prof,hq_prof,vq_prof                             &
 
  211      &         ,t_mod,q_mod,
u_mod,v_mod,w_mod                               &
 
  212      &         ,ht_mod,vt_mod,hq_mod,vq_mod,mxcalc)
 
  213        write(*,*) 'Profil initial 
forcing TOGA interpole'
 
  215 ! initial and boundary conditions :
 
  217       write(*,*) 'SST initiale: ',tsurf
 
  225        omega2(l)=omega(l)/
rg*airefi ! flxmass_w calcule comme ds 
physiq 
  226 !?       rho(l)  = play(l)/(
rd*temp(l)*(1.+(
rv/
rd-1.)*
q(l,1)))
 
  227 !?       omega2(l)=-rho(l)*omega(l)
 
  229        d_th_adv(l) = 
alpha*omega(l)/
rcpd-(ht_mod(l)+vt_mod(l))
 
  230        d_q_adv(l,1) = -(hq_mod(l)+vq_mod(l))
 
  235 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
  236 !---------------------------------------------------------------------
 
  237 ! Forcing from TWPICE experiment (Shaocheng et al. 2010) :
 
  238 !---------------------------------------------------------------------
 
  240       if (forcing_twpice) then
 
  241 !read TWP-ICE forcings
 
  242      fich_twpice='d_twpi/twp180iopsndgvarana_v2.1_C3.c1.20060117.000000.cdf'
 
  243       call read_twpice(fich_twpice,nlev_twpi,nt_twpi                        &
 
  244      &     ,ts_twpi,plev_twpi,t_twpi,q_twpi,u_twpi,v_twpi,w_twpi            &
 
  245      &     ,ht_twpi,vt_twpi,hq_twpi,vq_twpi)
 
  247       write(*,*) 'Forcing TWP-ICE lu'
 
  249          write(*,*) 'AVT 1ere INTERPOLATION: day,day1 = ',daytime,day1   
 
  250       CALL interp_toga_time(daytime,day1,annee_ref                          &
 
  251      &          ,year_ini_twpi,day_ju_ini_twpi,nt_twpi,dt_twpi,nlev_twpi    &
 
  252      &             ,ts_twpi,plev_twpi,t_twpi,q_twpi,u_twpi,v_twpi,w_twpi    &
 
  253      &             ,ht_twpi,vt_twpi,hq_twpi,vq_twpi                         &
 
  254      &             ,ts_proftwp,plev_proftwp,t_proftwp,q_proftwp             &
 
  255      &             ,u_proftwp,v_proftwp,w_proftwp                           &
 
  256      &             ,ht_proftwp,vt_proftwp,hq_proftwp,vq_proftwp)
 
  259 !      write(*,*)'avant interp vert', t_proftwp
 
  260       CALL interp_toga_vertical(play,nlev_twpi,plev_proftwp                 &
 
  261      &         ,t_proftwp,q_proftwp,u_proftwp,v_proftwp,w_proftwp           &
 
  262      &         ,ht_proftwp,vt_proftwp,hq_proftwp,vq_proftwp                 &
 
  263      &         ,t_mod,q_mod,u_mod,v_mod,w_mod                               &
 
  264      &         ,ht_mod,vt_mod,hq_mod,vq_mod,mxcalc)
 
  265 !       write(*,*) 'Profil initial 
forcing TWP-ICE interpole',t_mod
 
  267 ! initial and boundary conditions :
 
  269       write(*,*) 'SST initiale: ',tsurf
 
  277        omega2(l)=omega(l)/
rg*airefi ! flxmass_w calcule comme ds 
physiq 
  280 !on applique le forcage total au premier pas 
de temps
 
  281 !attention: signe different 
de toga
 
  282        d_th_adv(l) = 
alpha*omega(l)/
rcpd+(ht_mod(l)+vt_mod(l))
 
  283        d_q_adv(l,1) = (hq_mod(l)+vq_mod(l))
 
  287       endif !forcing_twpice
 
  289 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
  290 !---------------------------------------------------------------------
 
  291 ! Forcing from AMMA experiment (Couvreux et al. 2010) :
 
  292 !---------------------------------------------------------------------
 
  294       if (forcing_amma) then
 
  298       write(*,*) 'Forcing AMMA lu'
 
  316 !      write(*,*)'avant interp vert', t_proftwp
 
  320      &         ,t_mod,q_mod,u_mod,v_mod,w_mod                               &
 
  321      &         ,ht_mod,vt_mod,hq_mod,vq_mod,mxcalc)
 
  322 !       write(*,*) 'Profil initial 
forcing TWP-ICE interpole',t_mod
 
  324 ! initial and boundary conditions :
 
  326       write(*,*) 'SST initiale mxcalc: ',tsurf,mxcalc
 
  328 ! Ligne 
du dessous ?? decommenter si on lit 
theta au lieu 
de temp
 
  329 !      temp(l) = t_mod(l)*(play(l)/pzero)**
rkappa  
  333 !      print *,'read_forc: l,temp,
q=',l,temp(l),q(l,1)
 
  336        rho(l)  = play(l)/(
rd*temp(l)*(1.+(
rv/
rd-1.)*q(l,1)))
 
  337        omega(l) = w_mod(l)*(-
rg*rho(l))
 
  338        omega2(l)=omega(l)/
rg*airefi ! flxmass_w calcule comme ds 
physiq 
  341 !on applique le forcage total au premier pas 
de temps
 
  342 !attention: signe different 
de toga
 
  343        d_th_adv(l) = 
alpha*omega(l)/
rcpd+ht_mod(l)
 
  345 !       d_th_adv(l) = ht_mod(l)
 
  350        write(*,*) 'Prof initeforcing AMMA interpole temp39',temp(39)
 
  360 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
  361 !---------------------------------------------------------------------
 
  362 ! Forcing from DICE experiment (see file DICE_protocol_vn2-3.pdf)
 
  363 !---------------------------------------------------------------------
 
  365       if (forcing_dice) then
 
  367       fich_dice='dice_driver.nc'
 
  369      &     ,zz_dice,plev_dice,th_dice,qv_dice,u_dice,v_dice,o3_dice &
 
  374       write(*,*) 'Forcing DICE lu'
 
  378          th_dicei(k)=th_dice(k)
 
  379          qv_dicei(k)=qv_dice(k)
 
  382          o3_dicei(k)=o3_dice(k)
 
  383          ht_dicei(k)=ht_dice(k,1)
 
  384          hq_dicei(k)=hq_dice(k,1)
 
  385          hu_dicei(k)=hu_dice(k,1)
 
  386          hv_dicei(k)=hv_dice(k,1)
 
  387          w_dicei(k)=w_dice(k,1)
 
  388          omega_dicei(k)=omega_dice(k,1)
 
  394 !      write(*,*)'avant interp vert', t_proftwp
 
  396 !     CALL interp_dice_time(daytime,day1,annee_ref
 
  398 !    i             ,nlev_dice,shf_dice,lhf_dice,lwup_dice,swup_dice
 
  399 !    i             ,tg_dice,ustar_dice,psurf_dice,ug_dice,vg_dice
 
  400 !    i             ,ht_dice,hq_dice,hu_dice,hv_dice,w_dice,omega_dice
 
  406       CALL interp_dice_vertical(play,nlev_dice,nt_dice,plev_dice       &
 
  407      &         ,th_dicei,qv_dicei,u_dicei,v_dicei,o3_dicei             &
 
  408      &         ,ht_dicei,hq_dicei,hu_dicei,hv_dicei,w_dicei,omega_dicei&
 
  409      &         ,th_mod,qv_mod,u_mod,v_mod,o3_mod                       &
 
  410      &         ,ht_mod,hq_mod,hu_mod,hv_mod,w_mod,
omega_mod,mxcalc)
 
  412 ! Pour tester les advections horizontales 
de T et Q, on 
met w_mod et omega_mod ?? 
zero (MPL 20131108)
 
  416 !       write(*,*) 'Profil initial 
forcing DICE interpole',t_mod
 
  417 ! Les forcages DICE sont donnes /jour et non /seconde !
 
  418       ht_mod(:)=ht_mod(:)/86400.
 
  419       hq_mod(:)=hq_mod(:)/86400.
 
  420       hu_mod(:)=hu_mod(:)/86400.
 
  421       hv_mod(:)=hv_mod(:)/86400.
 
  423 ! initial and boundary conditions :
 
  424       write(*,*) 'SST initiale mxcalc: ',tsurf,mxcalc
 
  426 ! Ligne 
du dessous ?? decommenter si on lit 
theta au lieu 
de temp
 
  427        temp(l) = th_mod(l)*(play(l)/pzero)**
rkappa  
  431 !      print *,'read_forc: l,temp,q=',l,temp(l),q(l,1)
 
  436        rho(l)  = play(l)/(
rd*temp(l)*(1.+(
rv/
rd-1.)*q(l,1)))
 
  437 !      omega(l) = w_mod(l)*(-
rg*rho(l))
 
  438        omega(l) = omega_mod(l)
 
  439        omega2(l)=omega(l)/
rg*airefi ! flxmass_w calcule comme ds 
physiq 
  442 !on applique le forcage total au premier pas 
de temps
 
  443 !attention: signe different 
de toga
 
  444        d_th_adv(l) = 
alpha*omega(l)/
rcpd+ht_mod(l)
 
  446 !       d_th_adv(l) = ht_mod(l)
 
  451        write(*,*) 'Profil initial 
forcing DICE interpole temp39',temp(39)
 
  455       fsens=-1.*shf_dice(1)
 
  457 ! Le 
cas Dice doit etre force avec 
ustar mais on peut simplifier en forcant par 
 
  458 ! le coefficient 
de trainee en surface cd**2=
ustar*vent(k=1)
 
  464       IF (tsurf .LE. 0.) THEN
 
  469       sollw_in = (0.7*
RSIGMA*temp(1)**4)-lwup_dice(1)
 
  470       PRINT *,'1D_READ_FORC : 
solsw, 
sollw',solsw_in,sollw_in
 
  473 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
  474 !---------------------------------------------------------------------
 
  475 ! Forcing from Arm_Cu case                   
 
  476 ! For this case, ifa_armcu.txt contains sensible, latent 
heat fluxes
 
  477 ! large scale advective 
forcing,radiative forcing 
 
  478 ! and advective tendency of 
theta and qt to be applied 
 
  479 !---------------------------------------------------------------------
 
  481       if (forcing_armcu) then
 
  482 ! read armcu forcing :
 
  483        write(*,*) 'Avant lecture Forcing Arm_Cu'
 
  484       fich_armcu = './ifa_armcu.txt'
 
  485       CALL read_armcu(fich_armcu,nlev_armcu,nt_armcu,                       &
 
  486      & sens_armcu,flat_armcu,adv_theta_armcu,                               &
 
  487      & rad_theta_armcu,adv_qt_armcu)
 
  488        write(*,*) 'Forcing Arm_Cu lu'
 
  490 !----------------------------------------------------------------------
 
  491 ! Read profiles from file: prof.inp.19 or prof.inp.40 
 
  492 ! For this case, profiles are given for two vertical resolution
 
  495 ! Comment from: http:
 
  496 ! Note that the initial profiles contain no 
liquid water! 
 
  497 ! (
so potential temperature can be interpreted as 
liquid water 
 
  498 ! potential temperature and water vapor as total water)
 
  499 ! profiles are given 
at full levels
 
  500 !----------------------------------------------------------------------
 
  502       call readprofile_armcu(nlev_max,kmax,height,play_mod,u_mod,           &
 
  503      &           v_mod,theta_mod,t_mod,qv_mod,rv_mod,
ap,
bp)
 
  506       write(*,*) 'AVT 1ere INTERPOLATION: day,day1 = ',day,day1
 
  508       print *,'Avant interp_armcu_time'
 
  509       print *,'daytime=',daytime
 
  511       print *,'annee_ref=',annee_ref
 
  512       print *,'year_ini_armcu=',year_ini_armcu
 
  513       print *,'day_ju_ini_armcu=',day_ju_ini_armcu
 
  514       print *,'nt_armcu=',nt_armcu
 
  515       print *,'dt_armcu=',dt_armcu
 
  516       print *,'nlev_armcu=',nlev_armcu
 
  517       CALL interp_armcu_time(daytime,day1,annee_ref                         &
 
  518      &            ,year_ini_armcu,day_ju_ini_armcu,nt_armcu,dt_armcu        &
 
  519      &            ,nlev_armcu,sens_armcu,flat_armcu,adv_theta_armcu         &
 
  520      &            ,rad_theta_armcu,adv_qt_armcu,sens_prof,flat_prof         &
 
  521      &            ,adv_theta_prof,rad_theta_prof,adv_qt_prof)
 
  522        write(*,*) 'Forcages interpoles dans temps'
 
  525 ! The vertical grid stops 
at 4000m 
# 600hPa 
  528 ! initial and boundary conditions :
 
  530 ! tsurf read in 
lmdz1d.def
 
  531       write(*,*) 
'Tsurf initiale: ',tsurf
 
  533        play(l)=play_mod(l)*100.
 
  538        q(l,1) = qv_mod(l)/1000.
 
  539 ! No 
liquid water in the initial profil
 
  545 ! Advective forcings are given in K or 
g/kg ... per HOUR
 
  546 !      
IF(height(l).LT.1000) THEN
 
  547 !        d_th_adv(l) = (adv_theta_prof + rad_theta_prof)/3600.
 
  548 !        
d_q_adv(l,1) = adv_qt_prof/1000./3600.
 
  550 !      ELSEIF (height(l).GE.1000.AND.height(l).LT.3000) THEN
 
  551 !        d_th_adv(l) = (adv_theta_prof + rad_theta_prof)*
 
  552 !    :               (1-(height(l)-1000.)/2000.)
 
  553 !        d_th_adv(l) = d_th_adv(l)/3600.
 
  554 !        
d_q_adv(l,1) = adv_qt_prof*(1-(height(l)-1000.)/2000.)
 
  563 ! 
plev at half levels is given in proh.inp.19 or proh.inp.40 files
 
  564       plev(1)= ap(llm+1)+
bp(llm+1)*psurf
 
  566       plev(l+1) = ap(llm-l+1)+
bp(llm-l+1)*psurf
 
  567       print *,'Read_forc: l height play 
plev zlay temp',                    &
 
  568      &   l,height(l),play(l),
plev(l),zlay(l),temp(l)
 
  570 ! For this case, fluxes are 
imposed 
  574       endif ! forcing_armcu
 
  575 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
  576 !---------------------------------------------------------------------
 
  577 ! Forcing from transition case of Irina Sandu                  
 
  578 !---------------------------------------------------------------------
 
  580       if (forcing_sandu) then
 
  581        write(*,*) 'Avant lecture Forcing SANDU'
 
  583 ! read sanduref forcing :
 
  584       fich_sandu = './ifa_sanduref.txt'
 
  585       CALL read_sandu(fich_sandu,nlev_sandu,nt_sandu,ts_sandu)
 
  587        write(*,*) 'Forcing SANDU lu'
 
  589 !----------------------------------------------------------------------
 
  590 ! Read profiles from file: prof.inp.001 
 
  591 !----------------------------------------------------------------------
 
  593       call readprofile_sandu(nlev_max,kmax,height,plev_profs,t_profs,       &
 
  594      &           thl_profs,q_profs,u_profs,v_profs,                         &
 
  595      &           w_profs,omega_profs,o3mmr_profs)
 
  598       write(*,*) 'AVT 1ere INTERPOLATION: day,day1 = ',day,day1
 
  599 ! ATTENTION, cet appel ne convient pas pour le 
cas SANDU !!
 
  600 ! revoir 1DUTILS.h et les arguments
 
  602       print *,'Avant interp_sandu_time'
 
  603       print *,'daytime=',daytime
 
  605       print *,'annee_ref=',annee_ref
 
  606       print *,'year_ini_sandu=',year_ini_sandu
 
  607       print *,'day_ju_ini_sandu=',day_ju_ini_sandu
 
  608       print *,'nt_sandu=',nt_sandu
 
  609       print *,'dt_sandu=',dt_sandu
 
  610       print *,'nlev_sandu=',nlev_sandu
 
  611       CALL interp_sandu_time(daytime,day1,annee_ref                         &
 
  612      &             ,year_ini_sandu,day_ju_ini_sandu,nt_sandu,dt_sandu       &
 
  617       print *,'Avant interp_vertical: nlev_sandu=',nlev_sandu
 
  618       CALL interp_sandu_vertical(play,nlev_sandu,plev_profs                 &
 
  619      &         ,t_profs,thl_profs,q_profs,u_profs,v_profs,w_profs           &
 
  620      &         ,omega_profs,o3mmr_profs                                     &
 
  621      &         ,t_mod,thl_mod,q_mod,u_mod,v_mod,w_mod                       &
 
  622      &         ,omega_mod,o3mmr_mod,mxcalc)
 
  623        write(*,*) 'Profil initial forcing SANDU interpole'
 
  625 ! initial and boundary conditions :
 
  627       write(*,*) 'SST initiale: ',tsurf
 
  636        omega(l) = omega_mod(l)
 
  637        omega2(l)=omega(l)/
rg*airefi ! flxmass_w calcule comme ds 
physiq 
  638 !?       rho(l)  = play(l)/(
rd*temp(l)*(1.+(
rv/
rd-1.)*q(l,1)))
 
  639 !?       omega2(l)=-rho(l)*omega(l)
 
  641 !      d_th_adv(l) = 
alpha*omega(l)/
rcpd+vt_mod(l)
 
  648       endif ! forcing_sandu
 
  649 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
  650 !---------------------------------------------------------------------
 
  651 ! Forcing from Astex case
 
  652 !---------------------------------------------------------------------
 
  654       if (forcing_astex) then
 
  655        write(*,*) 'Avant lecture Forcing Astex'
 
  657 ! read astex forcing :
 
  658       fich_astex = './ifa_astex.txt'
 
  659       CALL read_astex(fich_astex,nlev_astex,nt_astex,div_astex,ts_astex,    &
 
  660      &  ug_astex,vg_astex,ufa_astex,vfa_astex)
 
  662        write(*,*) 'Forcing Astex lu'
 
  664 !----------------------------------------------------------------------
 
  665 ! Read profiles from file: prof.inp.001
 
  666 !----------------------------------------------------------------------
 
  668       call readprofile_astex(nlev_max,kmax,height,plev_profa,t_profa,       &
 
  669      &           thl_profa,qv_profa,ql_profa,qt_profa,u_profa,v_profa,      &
 
  670      &           w_profa,tke_profa,o3mmr_profa)
 
  673       write(*,*) 'AVT 1ere INTERPOLATION: day,day1 = ',day,day1
 
  674 ! ATTENTION, cet appel ne convient pas pour le 
cas SANDU !!
 
  675 ! revoir 1DUTILS.h et les arguments
 
  677       print *,'Avant interp_astex_time'
 
  678       print *,'daytime=',daytime
 
  680       print *,'annee_ref=',annee_ref
 
  681       print *,'year_ini_astex=',year_ini_astex
 
  682       print *,'day_ju_ini_astex=',day_ju_ini_astex
 
  683       print *,'nt_astex=',nt_astex
 
  684       print *,'dt_astex=',dt_astex
 
  685       print *,'nlev_astex=',nlev_astex
 
  686       CALL interp_astex_time(daytime,day1,annee_ref                         &
 
  687      &             ,year_ini_astex,day_ju_ini_astex,nt_astex,dt_astex       &
 
  688      &             ,nlev_astex,div_astex,ts_astex,ug_astex,vg_astex         &
 
  689      &             ,ufa_astex,vfa_astex,div_prof,ts_prof,ug_prof,vg_prof    &
 
  690      &             ,ufa_prof,vfa_prof)
 
  693       print *,'Avant interp_vertical: nlev_astex=',nlev_astex
 
  694       CALL interp_astex_vertical(play,nlev_astex,plev_profa                 &
 
  695      &         ,t_profa,thl_profa,qv_profa,ql_profa,qt_profa                &
 
  696      &         ,u_profa,v_profa,w_profa,tke_profa,o3mmr_profa               &
 
  697      &         ,t_mod,thl_mod,qv_mod,ql_mod,qt_mod,u_mod,v_mod,w_mod        &
 
  698      &         ,tke_mod,o3mmr_mod,mxcalc)
 
  699        write(*,*) 'Profil initial forcing Astex interpole'
 
  701 ! initial and boundary conditions :
 
  703       write(*,*) 'SST initiale: ',tsurf
 
  713 !      omega2(l)=omega(l)/
rg*airefi ! flxmass_w calcule comme ds 
physiq 
  714 !      rho(l)  = play(l)/(
rd*temp(l)*(1.+(
rv/
rd-1.)*q(l,1)))
 
  715 !      omega2(l)=-rho(l)*omega(l)
 
  717 !      d_th_adv(l) = 
alpha*omega(l)/
rcpd+vt_mod(l)
 
  724       endif ! forcing_astex
 
  725 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
  726 !---------------------------------------------------------------------
 
  727 ! Forcing from standard case :
 
  728 !---------------------------------------------------------------------
 
  730       if (forcing_case) then
 
  732          write(*,*),'avant call read_1D_cas'
 
  734          write(*,*) 'Forcing read'
 
  737          write(*,*) 'AVT 1ere INTERPOLATION: day,day1 = ',daytime,day1   
 
  753 !      write(*,*)'avant interp vert', t_prof
 
  754       CALL interp_case_vertical(play,nlev_cas,plev_prof_cas            &
 
  755      &         ,t_prof_cas,q_prof_cas,u_prof_cas,v_prof_cas,ug_prof_cas,vg_prof_cas,vitw_prof_cas    &
 
  756      &         ,du_prof_cas,hu_prof_cas,vu_prof_cas,dv_prof_cas,hv_prof_cas,vv_prof_cas           &
 
  757      &         ,dt_prof_cas,ht_prof_cas,vt_prof_cas,dtrad_prof_cas,dq_prof_cas,hq_prof_cas,vq_prof_cas           &
 
  758      &         ,t_mod_cas,q_mod_cas,u_mod_cas,v_mod_cas,ug_mod_cas,vg_mod_cas,w_mod_cas           &
 
  759      &         ,du_mod_cas,hu_mod_cas,vu_mod_cas,dv_mod_cas,hv_mod_cas,vv_mod_cas               &
 
  760      &         ,dt_mod_cas,ht_mod_cas,vt_mod_cas,dtrad_mod_cas,dq_mod_cas,hq_mod_cas,vq_mod_cas,mxcalc)
 
  761 !       write(*,*) 'Profil initial forcing case interpole',t_mod
 
  763 ! initial and boundary conditions :
 
  764 !      tsurf = ts_prof_cas
 
  766       psurf=plev_prof_cas(1)
 
  767       write(*,*) 'SST initiale: ',tsurf
 
  769        temp(l) = t_mod_cas(l)
 
  770        q(l,1) = q_mod_cas(l)
 
  774        omega(l) = w_mod_cas(l)
 
  775        omega2(l)=omega(l)/
rg*airefi ! flxmass_w calcule comme ds 
physiq 
  778 !on applique le forcage total au premier pas 
de temps
 
  779 !attention: signe different 
de toga
 
  780        d_th_adv(l) = 
alpha*omega(l)/
rcpd+(ht_mod_cas(l)+vt_mod_cas(l))
 
  781        d_q_adv(l,1) = (hq_mod_cas(l)+vq_mod_cas(l))
 
  783        d_u_adv(l) = (hu_mod_cas(l)+vu_mod_cas(l))
 
  784        d_u_adv(l) = (hv_mod_cas(l)+vv_mod_cas(l))
 
  792        IF (ok_prescr_ust) THEN
 
  798 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
!$Id Turb_fcg_gcssold get_uvd hqturb_gcssold endif!large scale llm day day1 day day1 *dt_toga endif!time annee_ref dt_toga u_toga vq_toga w_prof vq_prof llm day day1 day day1 *dt_dice endif!time annee_ref dt_dice swup_dice vg_dice w_dice
 
real, dimension(:), allocatable u_prof_cas
 
!$Id Turb_fcg_gcssold if(prt_level.ge.1) then print *
 
real, dimension(:), allocatable q_ammai
 
real, dimension(:), allocatable v_prof_cas
 
!$Id Turb_fcg_gcssold get_uvd hqturb_gcssold endif!large scale llm day day1 day day1 *dt_toga endif!time annee_ref dt_toga u_toga vq_toga w_prof vq_prof llm day day1 day day1 *dt_dice endif!time annee_ref dt_dice swup_dice vg_dice omega_dice lhf_prof
 
real, dimension(:), allocatable ug_prof_cas
 
real, dimension(:), allocatable t_prof_cas
 
real, dimension(:), allocatable vw_prof_cas
 
!$Id Turb_fcg_gcssold get_uvd hqturb_gcssold endif!large scale llm day day1 day day1 *dt_toga endif!time annee_ref dt_toga u_toga vq_toga w_prof vq_prof llm day day1 day day1 *dt_dice endif!time annee_ref dt_dice swup_dice vg_dice omega_dice tg_prof vg_profd hv_profd
 
real, dimension(:), allocatable u_amma
 
!$Id Turb_fcg_gcssold get_uvd hqturb_gcssold endif!large scale llm day day1 day day1 *dt_toga endif!time annee_ref dt_toga u_toga vq_toga w_prof vq_prof llm day day1 day day1 *dt_dice endif!time annee_ref dt_dice swup_dice vg_dice omega_dice tg_prof vg_profd ht_profd
 
!$Id Turb_fcg_gcssold get_uvd hqturb_gcssold endif!large scale llm day day1 day day1 *dt_toga endif!time annee_ref dt_toga u_toga vq_toga w_prof vq_prof llm day day1 day day1 *dt_dice endif!time annee_ref dt_dice swup_dice ustar_dice
 
real, dimension(:,:,:), pointer, save q
 
!$Id mode_top_bound COMMON comconstr g
 
real, dimension(:,:), allocatable, save heat
 
!$Id Turb_fcg_gcssold get_uvd hqturb_gcssold endif!large scale llm day day1 day day1 *dt_toga endif!time annee_ref dt_toga u_toga vq_toga u_prof
 
!$Id nt_fire e12prof dqtdxls dqtdtls
 
!$Id Turb_fcg_gcssold get_uvd hqturb_gcssold endif!large scale llm day day1 day day1 *dt_toga endif!time annee_ref dt_toga u_toga vq_toga w_prof vq_prof llm day day1 day day1 *dt_dice endif!time annee_ref dt_dice swup_dice ug_dice
 
real, dimension(:,:), allocatable vv_cas
 
!$Id Turb_fcg_gcssold get_uvd hqturb_gcssold endif!large scale llm day1
 
c c $Id c c calculs statistiques distribution nuage ftion du regime dynamique c c Ce calcul doit etre fait a partir de valeurs mensuelles CALL nbregdyn DO kmaxm1 DO l
 
!$Id Turb_fcg_gcssold get_uvd hqturb_gcssold endif!large scale llm day day1 day day1 *dt_toga endif!time annee_ref dt_toga u_toga vq_toga plev_prof
 
real(kind=real8), save so
 
real, dimension(:), allocatable uw_prof_cas
 
!$Id Turb_fcg_gcssold get_uvd hqturb_gcssold endif!large scale llm day day1 day day1 *dt_toga endif!time annee_ref dt_toga u_toga w_toga
 
*****************************COPYRIGHT ****************************c British Crown the Met Office!All rights reserved!Redistribution and use in source and binary with or without are permitted provided that the!following conditions are met
 
!$Id nt_fire e12prof wfls
 
!$Id Turb_fcg_gcssold get_uvd hqturb_gcssold endif!large scale llm day day1 day day1 *dt_toga endif!time annee_ref dt_toga u_toga vq_toga w_prof vt_prof
 
real, dimension(:,:), allocatable q1_cas
 
!$Id Turb_fcg_gcssold get_uvd hqturb_gcssold endif!large scale llm day day1 day day1 *dt_toga endif!time annee_ref dt_toga u_toga vq_toga v_prof
 
real, dimension(:,:), allocatable dv_cas
 
!$Id Turb_fcg_gcssold get_uvd hqturb_gcssold endif!large scale llm day day1 day day1 *dt_toga endif!time annee_ref dt_toga u_toga vq_toga w_prof vq_prof llm day day1 day day1 *dt_dice endif!time annee_ref dt_dice swup_dice vg_dice ht_dice
 
!$Id Turb_fcg_gcssold get_uvd hqturb_gcssold endif!large scale llm day day1 day day1 *dt_toga endif!time annee_ref dt_toga u_toga vq_toga w_prof vq_prof llm day day1 day day1 *dt_dice endif!time annee_ref dt_dice swup_dice vg_dice omega_dice tg_prof vg_profd w_profd omega_profd!do llm!print llm l llm
 
do llm!au dessus on relaxe vers profil init!on fait l hypothese que dans ce il n y a plus d eau liq au dessus!donc la relaxation en thetal et qt devient relaxation en tempe et qv l dq1 relax d_q_adv(l, 1)!print *
 
real, dimension(:), allocatable ts_cas
 
integer::year_ini_cas!initial year of the case integer::mth_ini_cas!initial month of the case integer::day_deb!initial day of the case real::heure_ini_cas!start time of the case real::pdt_cas!forcing_frequency real::day_ju_ini_cas!julian day of initial day of the case common date_cas year_ini_cas
 
real, dimension(:), allocatable vu_prof_cas
 
!$Id Turb_fcg_gcssold get_uvd hqturb_gcssold endif!large scale forcing
 
c c $Id c c calculs statistiques distribution nuage ftion du regime dynamique c c Ce calcul doit etre fait a partir de valeurs mensuelles CALL nbregdyn DO k
 
real, dimension(:,:), allocatable v_cas
 
!$Id Turb_fcg_gcssold get_uvd hqturb_gcssold endif!large scale llm day day1 day day1 *dt_toga endif!time annee_ref dt_toga u_toga vq_toga q_prof
 
!$Id Turb_fcg_gcssold get_uvd hqturb_gcssold endif!large scale llm day day1 day day1 *dt_toga endif!time annee_ref dt_toga u_toga vq_toga w_prof ht_prof
 
!$Id Turb_fcg_gcssold get_uvd hqturb_gcssold endif!large scale llm day day1 day day1 *dt_toga endif!time annee_ref dt_toga u_toga vq_toga w_prof vq_prof llm day day1 day day1 *dt_dice endif!time annee_ref dt_dice swup_dice vg_dice omega_dice tg_prof vg_profd w_profd omega_profd!do llm!print llm l llm!print llm l omega_mod
 
!$Id klon initialisation mois suivants day_rain itap ENDIF!Calcul fin de nday_rain calcul nday_rain itap DO i
 
real, dimension(:,:), allocatable u_cas
 
real, dimension(:), allocatable, save sollw
 
!$Id Turb_fcg_gcssold get_uvd hqturb_gcssold endif!large scale llm day day1 day day1 *dt_toga endif!time annee_ref dt_toga u_toga vq_toga t_prof
 
!$Id Turb_fcg_gcssold get_uvd hqturb_gcssold endif!large scale llm day day1 day day1 *dt_toga endif!time annee_ref dt_toga u_toga vq_toga w_prof vq_prof llm day day1 day day1 *dt_dice endif!time annee_ref dt_dice swup_dice vg_dice omega_dice lwup_prof
 
real, dimension(:), allocatable sens_amma
 
!surface temperature imposed
 
real, dimension(:,:), allocatable vw_cas
 
real, dimension(:,:), allocatable dt_cas
 
real, dimension(:,:), pointer, save w
 
!$Id Turb_fcg_gcssold get_uvd hqturb_gcssold endif!large scale llm day day1 day day1 *dt_toga endif!time annee_ref dt_toga u_toga vq_toga w_prof vq_prof llm day day1 day day1 *dt_dice endif!time annee_ref dt_dice swup_dice vg_dice hu_dice
 
!$Id Turb_fcg_gcssold get_uvd hqturb_gcssold endif!large scale llm day day1 day day1 *dt_toga endif!time annee_ref dt_toga u_toga vq_toga w_prof vq_prof llm day day1 day day1 *dt_dice endif!time annee_ref dt_dice swup_dice vg_dice omega_dice tg_prof vg_profd hq_profd
 
!$Id Turb_fcg_gcssold get_uvd it
 
real, dimension(:,:), pointer, save teta
 
real, dimension(:), allocatable th_ammai
 
subroutine interp_case_time(day, day1, annee_ref
 
real, dimension(:,:), allocatable du_cas
 
!$Id klon IF(pctsrf(i, is_ter).GT.0.) THEN paire_ter(i)
 
real, dimension(:,:), allocatable q_cas
 
!$Id itapm1 ENDIF!IM on interpole les champs sur les niveaux STD de pression!IM a chaque pas de temps de la physique c!positionnement de l argument logique a false c!pour ne pas recalculer deux fois la meme chose!c!a cet effet un appel a plevel_new a ete deplace c!a la fin de la serie d appels c!la boucle DO nlevSTD a ete internalisee c!dans d ou la creation de cette routine c c!CALL false
 
!$Id Turb_fcg_gcssold get_uvd hqturb_gcssold endif!large scale llm day day1 day day1 *dt_toga endif!time annee_ref dt_toga t_toga
 
real, dimension(:,:), allocatable hq_amma
 
!$Id RNAVO!A1 Astronomical constants REAL ROMEGA!A1 bis Constantes concernant l orbite de la R_incl!A1 Geoide REAL R1SA!A1 Radiation!REAL RI0 REAL RSIGMA!A1 Thermodynamic gas phase REAL RCVV REAL RETV Thermodynamic liquid
 
real, dimension(:,:), allocatable vu_cas
 
real, dimension(:), allocatable vq_ammai
 
!$Id Turb_fcg_gcssold get_uvd hqturb_gcssold endif!large scale llm day day1 day day1 *dt_toga endif!time annee_ref dt_toga u_toga vq_toga w_prof vq_prof llm day day1 day day1 *dt_dice endif!time annee_ref dt_dice lhf_dice
 
!$Id Turb_fcg_gcssold get_uvd hqturb_gcssold endif!large scale llm day day1 day day1 *dt_toga endif!time annee_ref dt_toga u_toga vq_toga w_prof vq_prof llm day day1 day day1 *dt_dice endif!time annee_ref dt_dice swup_dice vg_dice omega_dice tg_prof ug_profd
 
real, dimension(:), allocatable plev_prof_cas
 
real, dimension(:), allocatable lat_cas
 
real, dimension(:,:), allocatable vitw_cas
 
real, dimension(:), allocatable v_ammai
 
real, dimension(:,:), allocatable hq_cas
 
!$Id Turb_fcg_gcssold get_uvd hqturb_gcssold endif!large scale llm day day1 day day1 *dt_toga endif!time annee_ref day_ju_ini_toga
 
subroutine physiq(nlon, nlev, debut, lafin, jD_cur, jH_cur, pdtphys, paprs, pplay, pphi, pphis, presnivs, u, v, rot, t, qx, flxmass_w, d_u, d_v, d_t, d_qx, d_ps, dudyn)
 
real, dimension(:), allocatable plev_amma
 
real, dimension(:,:), allocatable t_cas
 
!$Id Turb_fcg_gcssold get_uvd hqturb_gcssold endif!large scale llm day day1 day day1 *dt_toga endif!time annee_ref dt_toga u_toga vq_toga w_prof vq_prof llm day day1 day day1 *dt_dice endif!time annee_ref dt_dice swup_dice vg_dice omega_dice tg_prof ustar_prof
 
real, dimension(:,:), allocatable vitw_amma
 
real, dimension(:,:), allocatable ht_amma
 
real, dimension(:,:), allocatable vg_cas
 
real, dimension(:), allocatable q1_prof_cas
 
!$Id Turb_fcg_gcssold get_uvd hqturb_gcssold endif!large scale llm day day1 day day1 *dt_toga endif!time annee_ref dt_toga u_toga vq_toga w_prof vq_prof llm day day1 day day1 *dt_dice endif!time annee_ref dt_dice swup_dice vg_dice omega_dice swup_prof
 
real, dimension(:), allocatable u_ammai
 
real, dimension(:), allocatable ustar_cas
 
real, dimension(:), allocatable q_amma
 
!$Id Turb_fcg_gcssold get_uvd hqturb_gcssold endif!large scale llm &&& day
 
real, dimension(:), allocatable, save solsw
 
!$Id Turb_fcg_gcssold get_uvd hqturb_gcssold endif!large scale llm day day1 day day1 *dt_toga endif!time annee_ref dt_toga u_toga vq_toga w_prof vq_prof llm day day1 day day1 *dt_dice endif!time annee_ref dt_dice swup_dice vg_dice omega_dice tg_prof psurf_prof
 
real, dimension(:,:), allocatable ht_cas
 
!$Id Turb_fcg_gcssold get_uvd hqturb_gcssold endif!large scale llm day day1 day day1 *dt_toga endif!time annee_ref nt_toga
 
!$Id Turb_fcg_gcssold get_uvd hqturb_gcssold endif!large scale llm day day1 day day1 *dt_toga endif!time annee_ref dt_toga u_toga vq_toga w_prof hq_prof
 
!$Id RNAVO!A1 Astronomical constants REAL ROMEGA!A1 bis Constantes concernant l orbite de la R_incl!A1 Geoide REAL R1SA!A1 Radiation!REAL RSIGMA
 
real, dimension(:,:), allocatable uw_cas
 
!$Id Turb_fcg_gcssold get_uvd hqturb_gcssold endif!large scale llm day day1 day day1 *dt_toga endif!time annee_ref year_ini_toga
 
!$Id Turb_fcg_gcssold get_uvd hqturb_gcssold endif!large scale llm day day1 day day1 *dt_toga endif!time annee_ref dt_toga u_toga vq_toga w_prof vq_prof llm day day1 day day1 *dt_dice endif!time annee_ref dt_dice swup_dice psurf_dice
 
real, dimension(:,:), allocatable vq_cas
 
!$Id Turb_fcg_gcssold get_uvd hqturb_gcssold endif!large scale llm day day1 day day1 *dt_toga endif!time annee_ref dt_toga u_toga vq_toga w_prof vq_prof llm day day1 day day1 *dt_dice endif!time annee_ref dt_dice swup_dice vg_dice omega_dice tg_prof vg_profd w_profd omega_profd!do llm!print llm l omega_profd
 
!$Id Turb_fcg_gcssold get_uvd hqturb_gcssold endif!large scale llm day day1 day day1 *dt_toga endif!time annee_ref dt_toga u_toga vq_toga w_prof vq_prof llm u(l)
 
real, dimension(:), allocatable vq_prof_cas
 
real, dimension(:), allocatable vt_prof_cas
 
!$Id Turb_fcg_gcssold get_uvd hqturb_gcssold endif!large scale llm day day1 day day1 *dt_toga endif!time annee_ref dt_toga u_toga vq_toga ts_prof
 
!$Id Turb_fcg_gcssold get_uvd hqturb_gcssold endif!large scale llm day day1 day day1 *dt_toga endif!time annee_ref dt_toga ts_toga
 
!$Id Turb_fcg_gcssold get_uvd hqturb_gcssold endif!large scale llm day day1 day day1 *dt_toga endif!time annee_ref dt_toga u_toga vq_toga w_prof vq_prof llm day day1 day day1 *dt_dice endif!time annee_ref dt_dice shf_dice
 
real, dimension(:), allocatable, save ap
 
real, dimension(:,:), allocatable vt_cas
 
real, dimension(:,:), allocatable hu_cas
 
!$Id Turb_fcg_gcssold get_uvd hqturb_gcssold endif!large scale llm day day1 day day1 *dt_toga endif!time annee_ref dt_toga u_toga vt_toga
 
real, dimension(:,:), allocatable q2_cas
 
real, dimension(:), allocatable hq_prof_cas
 
!$Id nt_fire e12prof dqtdxls dqtdyls
 
subroutine cdrag(knon, nsrf, speed, t1, q1, zgeop1, psol, tsurf, qsurf, z0m, z0h, pcfm, pcfh, zri, pref)
 
!$Id!Parameters for nlm real spfac!IM cf epmax real ptcrit real omtrain real dttrig real alpha real delta real betad COMMON cv30param nlm spfac &!IM cf ptcrit omtrain dttrig alpha
 
real, dimension(:), allocatable q2_prof_cas
 
real, dimension(:,:), allocatable, save ustar
 
real, dimension(:), allocatable hq_ammai
 
!$Id nt_fire e12prof ugprof
 
!$Id Turb_fcg_gcssold get_uvd hqturb_gcssold endif!large scale llm day day1 day day1 *dt_toga endif!time annee_ref dt_toga u_toga vq_toga w_prof vq_prof llm day day1 day day1 *dt_dice endif!time annee_ref dt_dice swup_dice vg_dice omega_dice shf_prof
 
!$Id Turb_fcg_gcssold get_uvd hqturb_gcssold endif!large scale llm day day1 day day1 *dt_toga endif!time annee_ref dt_toga u_toga vq_toga w_prof vq_prof llm day day1 day day1 *dt_dice endif!time annee_ref dt_dice swup_dice tg_dice
 
!$Id Turb_fcg_gcssold get_uvd hqturb_gcssold endif!large scale llm day day1 day day1 *dt_toga endif!time annee_ref dt_toga u_toga vq_toga w_prof vq_prof llm day day1 day day1 *dt_dice endif!time annee_ref year_ini_dice
 
real, dimension(:), allocatable v_amma
 
!$Id Turb_fcg_gcssold get_uvd hqturb_gcssold endif!large scale llm day day1 day day1 *dt_toga endif!time annee_ref dt_toga u_toga ht_toga
 
real, dimension(:), allocatable dtrad_prof_cas
 
real, dimension(:), allocatable q_prof_cas
 
real, dimension(:,:), pointer, save du
 
!$Id Turb_fcg_gcssold get_uvd hqturb_gcssold endif!large scale llm day day1 day day1 *dt_toga endif!time annee_ref dt_toga plev_toga
 
real, dimension(:), allocatable vitw_ammai
 
!$Id Turb_fcg_gcssold get_uvd hqturb_gcssold endif!large scale llm day day1 day day1 *dt_toga endif!time annee_ref dt_toga q_toga
 
real, dimension(:), allocatable lat_amma
 
real, dimension(:), allocatable ht_prof_cas
 
!$Id Turb_fcg_gcssold get_uvd hqturb_gcssold endif!large scale llm day day1 day day1 *dt_toga endif!time annee_ref dt_toga nlev_toga
 
real(kind=8), dimension(8, 3), parameter at
 
subroutine writefield_phy(name, Field, ll)
 
real, dimension(:), allocatable du_prof_cas
 
real, dimension(:), allocatable vitw_prof_cas
 
do llm!au dessus on relaxe vers profil init!on fait l hypothese que dans ce il n y a plus d eau liq au dessus!donc la relaxation en thetal et qt devient relaxation en tempe et qv u_mod(l)!if(l.ge.llm700) then relax_q(l
 
real, dimension(:), allocatable vt_ammai
 
!$Id Turb_fcg!implicit none!ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc!cette routine permet d obtenir hq et ainsi de!pouvoir calculer la convergence et le cisaillement dans la physiq!cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc INTEGER klev REAL in CHARACTER file_fordat COMMON com1_phys_gcss play
 
real, dimension(:), allocatable dt_prof_cas
 
!$Id nt_fire e12prof vgprof
 
!$Id Turb_fcg_gcssold get_uvd hqturb_gcssold endif!large scale llm day day1 day day1 *dt_toga endif!time annee_ref dt_toga u_toga vq_toga w_prof vq_prof llm day day1 day day1 *dt_dice endif!time annee_ref dt_dice swup_dice vg_dice hv_dice
 
real, dimension(:), allocatable th_amma
 
integer::year_ini_cas!initial year of the case integer::mth_ini_cas!initial month of the case integer::day_deb!initial day of the case real::heure_ini_cas!start time of the case real::pdt_cas!forcing_frequency real::day_ju_ini_cas!julian day of initial day of the case common date_cas pdt_cas
 
real, dimension(:), allocatable ht_ammai
 
real, dimension(:), allocatable hu_prof_cas
 
real, dimension(:), allocatable dv_prof_cas
 
!$Id Turb_fcg_gcssold get_uvd hqturb_gcssold endif!large scale llm day day1 day day1 *dt_toga endif!time annee_ref dt_toga u_toga hq_toga
 
!$Id Turb_fcg_gcssold get_uvd hqturb_gcssold endif!large scale llm day day1 day day1 *dt_toga endif!time annee_ref dt_toga u_toga vq_toga w_prof vq_prof llm day day1 day day1 *dt_dice endif!time annee_ref dt_dice nlev_dice
 
real, dimension(:,:), allocatable hv_cas
 
real, dimension(:,:), allocatable plev_cas
 
real, dimension(:), allocatable, save bp
 
real, dimension(:,:), allocatable, save omega
 
real, dimension(:), allocatable sens_cas
 
!$Id Turb_fcg_gcssold get_uvd hqturb_gcssold endif!large scale llm day day1 day day1 *dt_toga endif!time annee_ref dt_toga u_toga vq_toga w_prof vq_prof llm day day1 day day1 *dt_dice endif!time annee_ref dt_dice swup_dice vg_dice hq_dice
 
real, dimension(:,:), allocatable, save theta
 
real, dimension(:), pointer, save plev
 
!$Id Turb_fcg_gcssold get_uvd hqturb_gcssold endif!large scale llm day day1 day day1 *dt_toga endif!time annee_ref dt_toga u_toga vq_toga w_prof vq_prof llm day day1 day day1 *dt_dice endif!time annee_ref dt_dice lwup_dice
 
real, dimension(:), allocatable dq_prof_cas
 
real, dimension(:,:), allocatable dq_cas
 
real, dimension(:), allocatable vg_prof_cas
 
!$Id Turb_fcg_gcssold get_uvd hqturb_gcssold endif!large scale llm day day1 day day1 *dt_toga endif!time annee_ref dt_toga u_toga v_toga
 
do llm!au dessus on relaxe vers profil init!on fait l hypothese que dans ce cas
 
real, dimension(:), allocatable, save presnivs
 
real, dimension(:,:), allocatable dtrad_cas
 
!$Id Turb_fcg_gcssold get_uvd hqturb_gcssold endif!large scale llm day day1 day day1 *dt_toga endif!time annee_ref dt_toga u_toga vq_toga w_prof vq_prof llm day day1 day day1 *dt_dice endif!time annee_ref nt_dice
 
!$Id Turb_fcg_gcssold get_uvd hqturb_gcssold endif!large scale llm day day1 day day1 *dt_toga endif!time annee_ref dt_toga u_toga vq_toga w_prof vq_prof llm day day1 day day1 *dt_dice endif!time annee_ref day_ju_ini_dice
 
!$Id Turb_fcg_gcssold get_uvd hqturb_gcssold endif!large scale llm day day1 day day1 *dt_toga endif!time annee_ref dt_toga u_toga vq_toga w_prof vq_prof llm day day1 day day1 *dt_dice endif!time annee_ref dt_dice swup_dice vg_dice omega_dice tg_prof vg_profd hu_profd
 
subroutine pbl_surface(dtime,date0,itap,jour,debut,lafin,rlon,rlat,rugoro,rmu0,zsig,lwdown_m,pphi,cldt,rain_f,snow_f,solsw_m,sollw_m,gustiness,t,q,u,v,
 
real, dimension(:), allocatable vv_prof_cas
 
real, dimension(:), allocatable hv_prof_cas
 
real, dimension(:,:), allocatable ug_cas