Ignore:
Timestamp:
Jul 18, 2013, 10:20:28 AM (11 years ago)
Author:
Ehouarn Millour
Message:

Version testing basee sur la r1794


Testing release based on r1794

Location:
LMDZ5/branches/testing
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • LMDZ5/branches/testing

  • LMDZ5/branches/testing/libf/phy1d/lmdz1d.F

    r1750 r1795  
    66      use dimphy
    77      use surface_data, only : type_ocean,ok_veget
    8       use pbl_surface_mod, only : pbl_surface_init, pbl_surface_final
     8      use pbl_surface_mod, only : ftsoil, pbl_surface_init,
     9     $                            pbl_surface_final
    910      use fonte_neige_mod, only : fonte_neige_init, fonte_neige_final
    1011
    1112      use infotrac ! new
    1213      use control_mod
     14      USE indice_sol_mod
    1315
    1416      implicit none
     
    2022#include "clesphys.h"
    2123#include "dimsoil.h"
    22 #include "indicesol.h"
     24!#include "indicesol.h"
    2325
    2426#include "comvert.h"
    2527#include "compar1d.h"
    2628#include "flux_arp.h"
     29#include "tsoilnudge.h"
    2730#include "fcg_gcssold.h"
    2831!!!#include "fbforcing.h"
     
    8689
    8790        integer :: kmax = llm
    88         integer nlev_max
    89         parameter (nlev_max = 100)
     91        integer nlev_max,llm700
     92        parameter (nlev_max = 1000)
    9093        real timestep, frac, timeit
    9194        real height(nlev_max),tttprof(nlev_max),qtprof(nlev_max),
     
    98101c        integer :: forcing_type
    99102        logical :: forcing_les     = .false.
    100         logical :: forcing_armcu  = .false.
     103        logical :: forcing_armcu   = .false.
    101104        logical :: forcing_rico    = .false.
    102105        logical :: forcing_radconv = .false.
    103106        logical :: forcing_toga    = .false.
    104107        logical :: forcing_twpice  = .false.
     108        logical :: forcing_amma    = .false.
    105109        logical :: forcing_GCM2SCM = .false.
    106110        logical :: forcing_GCSSold = .false.
     111        logical :: forcing_sandu   = .false.
     112        logical :: forcing_astex   = .false.
     113        logical :: forcing_fire    = .false.
    107114        integer :: type_ts_forcing ! 0 = SST constant; 1 = SST read from a file
    108115!                                                            (cf read_tsurf1d.F)
    109116
    110117!vertical advection computation
    111         real d_t_z(llm), d_q_z(llm)
    112         real d_t_dyn_z(llm), d_q_dyn_z(llm)
    113         real zz(llm)
    114         real zfact
     118!       real d_t_z(llm), d_q_z(llm)
     119!       real d_t_dyn_z(llm), d_q_dyn_z(llm)
     120!       real zz(llm)
     121!       real zfact
    115122
    116123!flag forcings
     
    129136      real :: pzero=1.e5
    130137      real :: play (llm),zlay (llm),sig_s(llm),plev(llm+1)
    131       real :: playd(llm),zlayd(llm)
     138      real :: playd(llm),zlayd(llm),ap_amma(llm+1),bp_amma(llm+1),poub
    132139
    133140!---------------------------------------------------------------------
     
    137144      integer :: iq
    138145      real :: phi(llm)
    139       real :: teta(llm),temp(llm),u(llm),v(llm)
     146      real :: teta(llm),tetal(llm),temp(llm),u(llm),v(llm),w(llm)
     147      real :: rlat_rad(1),rlon_rad(1)
    140148      real :: omega(llm+1),omega2(llm),rho(llm+1)
    141149      real :: ug(llm),vg(llm),fcoriolis
     150      real :: sfdt, cfdt
    142151      real :: du_phys(llm),dv_phys(llm),dt_phys(llm)
    143152      real :: du_dyn(llm),dv_dyn(llm),dt_dyn(llm)
     
    194203!  Fichiers et d'autres variables
    195204!---------------------------------------------------------------------
    196       real ttt
     205      real ttt,bow,q1
    197206      integer :: ierr,k,l,i,it=1,mxcalc
    198207      integer jjmp1
     
    250259!             initial profiles from RICO files
    251260!             LS convergence imposed from RICO files
     261!forcing_type = 6 ==> forcing_amma = .true.
     262!             initial profiles from AMMA nc file
     263!             LS convergence, omega and surface fluxes imposed from AMMA file 
    252264!forcing_type = 40 ==> forcing_GCSSold = .true.
    253265!             initial profile from GCSS file
    254266!             LS convergence imposed from GCSS file
     267!forcing_type = 59 ==> forcing_sandu = .true.
     268!             initial profiles from sanduref file: see prof.inp.001
     269!             SST varying with time and divergence constante: see ifa_sanduref.txt file
     270!             Radiation has to be computed interactively
     271!forcing_type = 60 ==> forcing_astex = .true.
     272!             initial profiles from file: see prof.inp.001
     273!             SST,divergence,ug,vg,ufa,vfa varying with time : see ifa_astex.txt file
     274!             Radiation has to be computed interactively
    255275!forcing_type = 61 ==> forcing_armcu = .true.
    256 !             initial profile from arm_cu file
    257 !             LS convergence imposed from arm_cu file
     276!             initial profiles from file: see prof.inp.001
     277!             sensible and latent heat flux imposed: see ifa_arm_cu_1.txt
     278!             large scale advective forcing & radiative tendencies applied below 1000m: see ifa_arm_cu_2.txt
     279!             use geostrophic wind ug=10m/s vg=0m/s. Duration of the case 53100s
     280!             Radiation to be switched off
    258281!
    259282      if (forcing_type .eq.0) THEN
     
    269292      elseif (forcing_type .eq.5) THEN
    270293       forcing_rico = .true.
     294      elseif (forcing_type .eq.6) THEN
     295       forcing_amma = .true.
    271296      elseif (forcing_type .eq.40) THEN
    272297       forcing_GCSSold = .true.
     298      elseif (forcing_type .eq.59) THEN
     299       forcing_sandu   = .true.
     300      elseif (forcing_type .eq.60) THEN
     301       forcing_astex   = .true.
    273302      elseif (forcing_type .eq.61) THEN
    274303       forcing_armcu = .true.
     
    276305      else
    277306       write (*,*) 'ERROR : unknown forcing_type ', forcing_type
    278        stop 'Forcing_type should be 0,1,2,3 or 40'
     307       stop 'Forcing_type should be 0,1,2,3,4,5,6 or 40,59,60,61'
    279308      ENDIF
    280309      print*,"forcing type=",forcing_type
     
    286315
    287316        type_ts_forcing = 0
    288         if (forcing_toga) type_ts_forcing = 1
     317        if (forcing_toga .or. forcing_sandu .or. forcing_astex)
     318     :    type_ts_forcing = 1
    289319
    290320!---------------------------------------------------------------------
     
    325355c Special case for arm_cu which lasts less than one day : 53100s !! (MPL 20111026)
    326356      IF(forcing_type .EQ. 61) fnday=53100./86400.
     357c Special case for amma which lasts less than one day : 64800s !! (MPL 20120216)
     358      IF(forcing_type .EQ. 6) fnday=64800./86400.
    327359      annee_ref = anneeref
    328360      mois = 1
     
    334366      day_ini = day
    335367      day_end = day_ini + nday
     368
     369      IF (forcing_type .eq.2) THEN
    336370! Convert the initial date of Toga-Coare to Julian day
    337371      call ymds2ju
    338372     $ (year_ini_toga,mth_ini_toga,day_ini_toga,heure,day_ju_ini_toga)
    339373
     374      ELSEIF (forcing_type .eq.4) THEN
    340375! Convert the initial date of TWPICE to Julian day
    341376      call ymds2ju
    342377     $ (year_ini_twpi,mth_ini_twpi,day_ini_twpi,heure_ini_twpi
    343378     $ ,day_ju_ini_twpi)
    344 
    345 ! Convert the initial date of Arm_cu to Julian day
     379      ELSEIF (forcing_type .eq.6) THEN
     380! Convert the initial date of AMMA to Julian day
     381      call ymds2ju
     382     $ (year_ini_amma,mth_ini_amma,day_ini_amma,heure_ini_amma
     383     $ ,day_ju_ini_amma)
     384
     385      ELSEIF (forcing_type .eq.59) THEN
     386! Convert the initial date of Sandu case to Julian day
     387      call ymds2ju
     388     $   (year_ini_sandu,mth_ini_sandu,day_ini_sandu,
     389     $    time_ini*3600.,day_ju_ini_sandu)
     390
     391      ELSEIF (forcing_type .eq.60) THEN
     392! Convert the initial date of Astex case to Julian day
     393      call ymds2ju
     394     $   (year_ini_astex,mth_ini_astex,day_ini_astex,
     395     $    time_ini*3600.,day_ju_ini_astex)
     396
     397      ELSEIF (forcing_type .eq.61) THEN
     398
     399! Convert the initial date of Arm_cu case to Julian day
    346400      call ymds2ju
    347401     $ (year_ini_armcu,mth_ini_armcu,day_ini_armcu,heure_ini_armcu
    348402     $ ,day_ju_ini_armcu)
     403      ENDIF
    349404
    350405      daytime = day + time_ini/24. ! 1st day and initial time of the simulation
     
    418473!!      preff= 1.01325e5
    419474      preff = psurf
    420       call disvert(pa,preff,ap,bp,dpres,presnivs,nivsigs,nivsig)
     475      IF (ok_old_disvert) THEN
     476        call disvert0(pa,preff,ap,bp,dpres,presnivs,nivsigs,nivsig)
     477        print *,'On utilise disvert0'
     478      ELSE
     479        call disvert(pa,preff,ap,bp,dpres,presnivs,nivsigs,nivsig,
     480     :                 scaleheight)
     481        print *,'On utilise disvert'
     482c       Nouvelle version disvert permettant d imposer ap,bp (modif L.Guez) MPL 18092012
     483c       Dans ce cas, on lit ap,bp dans le fichier hybrid.txt
     484      ENDIF
    421485      sig_s=presnivs/preff
    422486      plev =ap+bp*psurf
     
    424488ccc      zlay=-rd*300.*log(play/psurf)/rg ! moved after reading profiles
    425489
     490      IF (forcing_type .eq. 59) THEN
     491! pour forcing_sandu, on cherche l'indice le plus proche de 700hpa#3000m
    426492      write(*,*) '***********************'
    427493      do l = 1, llm
    428494       write(*,*) 'l,play(l),presnivs(l): ',l,play(l),presnivs(l)
     495       if (trouve_700 .and. play(l).le.70000) then
     496         llm700=l
     497         print *,'llm700,play=',llm700,play(l)/100.
     498         trouve_700= .false.
     499       endif
    429500      enddo
    430501      write(*,*) '***********************'
     502      ENDIF
    431503
    432504c
     
    460532! rday: defini dans suphel.F (86400.)
    461533! day_ini: lu dans run.def (dayref)
    462 ! rlat,rlon lus dans lmdz1d.def
     534! rlat_rad,rlon-rad: transformes en radian de rlat,rlon lus dans lmdz1d.def (en degres)
    463535! airefi,zcufi,zcvfi initialises au debut de ce programme
    464536! rday,ra,rg,rd,rcpd declares dans YOMCST.h et calcules dans suphel.F
     
    470542      zcufi=airefi
    471543      zcvfi=airefi
     544!
     545      rlat_rad(:)=rlat(:)*rpi/180.
     546      rlon_rad(:)=rlon(:)*rpi/180.
    472547
    473548      call iniphysiq(ngrid,llm,rday,day_ini,timestep,
    474      .     rlat,rlon,airefi,zcufi,zcvfi,ra,rg,rd,rcpd,1)
     549     .     rlat_rad,rlon_rad,airefi,zcufi,zcvfi,ra,rg,rd,rcpd,(/1/))
    475550      print*,'apres iniphysiq'
    476551
     
    501576        agesno  = xagesno
    502577        tsoil(:,:,:)=tsurf
     578!------ AMMA 2e run avec modele sol et rayonnement actif (MPL 23052012)
     579!       tsoil(1,1,1)=299.18
     580!       tsoil(1,2,1)=300.08
     581!       tsoil(1,3,1)=301.88
     582!       tsoil(1,4,1)=305.48
     583!       tsoil(1,5,1)=308.00
     584!       tsoil(1,6,1)=308.00
     585!       tsoil(1,7,1)=308.00
     586!       tsoil(1,8,1)=308.00
     587!       tsoil(1,9,1)=308.00
     588!       tsoil(1,10,1)=308.00
     589!       tsoil(1,11,1)=308.00
     590!-----------------------------------------------------------------------
    503591        call pbl_surface_init(qsol, fder, snsrf, qsurfsrf,
    504592     &                                    evap, frugs, agesno, tsoil)
     
    734822       endif
    735823
    736        if (forcing_toga .or. forcing_GCSSold .or. forcing_twpice) then
     824       if (forcing_toga .or. forcing_GCSSold .or. forcing_twpice
     825     :    .or.forcing_amma) then
    737826         fcoriolis=0.0 ; ug=0. ; vg=0.
    738827       endif
     
    748837     : -fcoriolis*(u(1:mxcalc)-ug(1:mxcalc))
    749838
     839!!!!!!!!!!!!!!!!!!!!!!!!
     840! Geostrophic wind
     841!!!!!!!!!!!!!!!!!!!!!!!!
     842       sfdt = sin(0.5*fcoriolis*timestep)
     843       cfdt = cos(0.5*fcoriolis*timestep)
     844!
     845        du_age(1:mxcalc)= -2.*sfdt/timestep*
     846     :          (sfdt*(u(1:mxcalc)-ug(1:mxcalc)) -
     847     :           cfdt*(v(1:mxcalc)-vg(1:mxcalc))  )
     848!!     : fcoriolis*(v(1:mxcalc)-vg(1:mxcalc))
     849!
     850       dv_age(1:mxcalc)= -2.*sfdt/timestep*
     851     :          (cfdt*(u(1:mxcalc)-ug(1:mxcalc)) +
     852     :           sfdt*(v(1:mxcalc)-vg(1:mxcalc))  )
     853!!     : -fcoriolis*(u(1:mxcalc)-ug(1:mxcalc))
     854!
     855!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
     856!         call  writefield_phy('dv_age' ,dv_age,llm)
     857!         call  writefield_phy('du_age' ,du_age,llm)
     858!         call  writefield_phy('du_phys' ,du_phys,llm)
     859!         call  writefield_phy('u_tend' ,u,llm)
     860!         call  writefield_phy('u_g' ,ug,llm)
     861!
     862!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
     863!! Increment state variables
     864!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    750865        u(1:mxcalc)=u(1:mxcalc) + timestep*(
    751866     :              du_phys(1:mxcalc)
     
    773888
    774889        teta=temp*(pzero/play)**rkappa
     890!
     891!---------------------------------------------------------------------
     892!   Nudge soil temperature if requested
     893!---------------------------------------------------------------------
     894
     895      IF (nudge_tsoil) THEN
     896       ftsoil(1,isoil_nudge,:) = ftsoil(1,isoil_nudge,:)
     897     .  -timestep/tau_soil_nudge*(ftsoil(1,isoil_nudge,:)-Tsoil_nudge)
     898      ENDIF
    775899
    776900!---------------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.