Ignore:
Timestamp:
Feb 22, 2021, 12:44:07 PM (4 years ago)
Author:
dcugnet
Message:

Update the branch to the current trunk.

Location:
LMDZ6/branches/LMDZ-tracers
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • LMDZ6/branches/LMDZ-tracers

  • LMDZ6/branches/LMDZ-tracers/libf/phylmd/dyn1d/scm.F90

    r3693 r3851  
    7575      real :: zcufi    = 1.
    7676      real :: zcvfi    = 1.
    77 
    78 !-      real :: nat_surf
    79 !-      logical :: ok_flux_surf
    80 !-      real :: fsens
    81 !-      real :: flat
    82 !-      real :: tsurf
    83 !-      real :: rugos
    84 !-      real :: qsol(1:2)
    85 !-      real :: qsurf
    86 !-      real :: psurf
    87 !-      real :: zsurf
    88 !-      real :: albedo
    89 !-
    90 !-      real :: time     = 0.
    91 !-      real :: time_ini
    92 !-      real :: xlat
    93 !-      real :: xlon
    94 !-      real :: wtsurf
    95 !-      real :: wqsurf
    96 !-      real :: restart_runoff
    97 !-      real :: xagesno
    98 !-      real :: qsolinp
    99 !-      real :: zpicinp
    100 !-
    10177      real :: fnday
    10278      real :: day, daytime
     
    141117        logical :: forcing_case2   = .false.
    142118        logical :: forcing_SCM   = .false.
    143         integer :: type_ts_forcing ! 0 = SST constant; 1 = SST read from a file
    144 !                                                            (cf read_tsurf1d.F)
    145119
    146120!flag forcings
     
    148122        logical :: nudge_thermo=.false.
    149123        logical :: cptadvw=.true.
     124
     125
    150126!=====================================================================
    151127! DECLARATIONS FOR EACH CASE
     
    248224!
    249225      integer :: it_end ! iteration number of the last call
    250 !Al1
     226!Al1,plev,play,phi,phis,presnivs,
    251227      integer ecrit_slab_oc !1=ecrit,-1=lit,0=no file
    252228      data ecrit_slab_oc/-1/
     
    278254      d_v_age(:)=0.
    279255     
     256     
    280257! Initialization of Common turb_forcing
    281258       dtime_frcg = 0.
     
    290267! OPTIONS OF THE 1D SIMULATION (lmdz1d.def => unicol.def)
    291268!---------------------------------------------------------------------
    292 !Al1
    293269        call conf_unicol
    294270!Al1 moves this gcssold var from common fcg_gcssold to
     
    296272! --------------------------------------------------------------------
    297273        close(1)
    298 !Al1
    299274        write(*,*) 'lmdz1d.def lu => unicol.def'
    300275
     
    302277       year_ini_cas=1997
    303278       ! It is possible that those parameters are run twice.
    304 
    305279       ! A REVOIR : LIRE PEUT ETRE AN MOIS JOUR DIRECETEMENT
     280
     281
    306282       call getin('anneeref',year_ini_cas)
    307283       call getin('dayref',day_deb)
     
    309285       call getin('time_ini',heure_ini_cas)
    310286
    311         type_ts_forcing = 0
    312         IF (nat_surf==0) type_ts_forcing=1 ! SST forcee sur OCEAN
    313         print*,'NATURE DE LA SURFACE ',nat_surf
     287      print*,'NATURE DE LA SURFACE ',nat_surf
    314288!
    315289! Initialization of the logical switch for nudging
     290
    316291     jcode = iflag_nudge
    317292     do i = 1,nudge_max
     
    319294       jcode = jcode/10
    320295     enddo
    321 !---------------------------------------------------------------------
     296!-----------------------------------------------------------------------
    322297!  Definition of the run
    323 !---------------------------------------------------------------------
     298!-----------------------------------------------------------------------
    324299
    325300      call conf_gcm( 99, .TRUE. )
     
    343318      allocate( phy_flic(year_len)) ! Fraction de glace
    344319      phy_flic(:)=0.0
     320
     321
    345322!-----------------------------------------------------------------------
    346323!   Choix du calendrier
     
    373350!      Le numero du jour est dans "day". L heure est traitee separement.
    374351!      La date complete est dans "daytime" (l'unite est le jour).
     352
     353
    375354      if (nday>0) then
    376355         fnday=nday
     
    409388! Initialization of dimensions, geometry and initial state
    410389!---------------------------------------------------------------------
    411 !      call init_phys_lmdz(1,1,llm,1,(/1/)) ! job now done via iniphysiq
     390!     call init_phys_lmdz(1,1,llm,1,(/1/)) ! job now done via iniphysiq
    412391!     but we still need to initialize dimphy module (klon,klev,etc.)  here.
    413392      call init_dimphy1D(1,llm)
     
    433412!          (phys_state_var_init is called again in physiq)
    434413      read_climoz = 0
    435 !
     414      nsw=6
     415
    436416      call phys_state_var_init(read_climoz)
    437417
     
    446426!!! Feedback forcing values for Gateaux differentiation (al1)
    447427!!!=====================================================================
    448 !!! Surface Planck forcing bracketing call radiation
    449 !!      surf_Planck = 0.
    450 !!      surf_Conv   = 0.
    451 !!      write(*,*) 'Gateaux-dif Planck,Conv:',surf_Planck,surf_Conv
    452 !!! a mettre dans le lmdz1d.def ou autre
    453 !!
    454428!!
    455429      qsol = qsolinp
     
    469443      ENDIF
    470444      print*,'Flux sol ',fsens,flat
    471 !!      ok_flux_surf=.false.
    472 !!      fsens=-wtsurf*rcpd*rho(1)
    473 !!      flat=-wqsurf*rlvtt*rho(1)
    474 !!!!
    475445
    476446! Vertical discretization and pressure levels at half and mid levels:
     
    496466      plev =ap+bp*psurf
    497467      play = 0.5*(plev(1:llm)+plev(2:llm+1))
    498       zlay=-rd*300.*log(play/psurf)/rg ! moved after reading profiles
     468      zlay=-rd*300.*log(play/psurf)/rg ! moved after reading profiles.
    499469
    500470      IF (forcing_type .eq. 59) THEN
     
    527497      print*,'mxcalc=',mxcalc
    528498!     print*,'zlay=',zlay(mxcalc)
    529       print*,'play=',play(mxcalc)
    530 
    531 !Al1 pour SST forced, appell?? depuis ocean_forced_noice
    532       ts_cur = tsurf ! SST used in read_tsurf1d
     499!      print*,'play=',play(mxcalc)
     500
     501!! When surface temperature is forced
     502      tg= tsurf ! surface T used in read_tsurf1d
     503
     504
    533505!=====================================================================
    534506! Initialisation de la physique :
     
    546518! airefi,zcufi,zcvfi initialises au debut de ce programme
    547519! rday,ra,rg,rd,rcpd declares dans YOMCST.h et calcules dans suphel.F
     520
     521
    548522      day_step = float(nsplit_phys)*day_step/float(iphysiq)
    549523      write (*,*) 'Time step divided by nsplit_phys (=',nsplit_phys,')'
     
    563537     ! e.g. for cell boundaries, which are meaningless in 1D; so pad these
    564538     ! with '0.' when necessary
     539
    565540      call iniphysiq(iim,jjm,llm, &
    566541           1,comm_lmdz, &
     
    650625        zpic = zpicinp
    651626        ftsol=tsurf
    652         nsw=6 ! on met le nb de bandes SW=6, pour initialiser
    653               ! 6 albedo, mais on peut quand meme tourner avec
    654               ! moins. Seules les 2 ou 4 premiers seront lus
    655627        falb_dir=albedo
    656628        falb_dif=albedo
     
    664636        prw_ancien = 0.
    665637!jyg<
    666 !!        pbl_tke(:,:,:)=1.e-8
    667         pbl_tke(:,:,:)=0.
    668         pbl_tke(:,2,:)=1.e-2
    669         PRINT *, ' pbl_tke dans lmdz1d '
    670         if (prt_level .ge. 5) then
    671          DO nsrf = 1,4
    672            PRINT *,'pbl_tke(1,:,',nsrf,') ',pbl_tke(1,:,nsrf)
    673          ENDDO
    674         end if
    675 
     638! Etienne: comment those lines since now the TKE is inialized in 1D_read_forc_cases
     639!!      pbl_tke(:,:,:)=1.e-8
     640!        pbl_tke(:,:,:)=0.
     641!        pbl_tke(:,2,:)=1.e-2
    676642!>jyg
    677 
    678643        rain_fall=0.
    679644        snow_fall=0.
     
    715680        v_ancien(1,:)=v(:)
    716681 
    717 u10m=0.
    718 v10m=0.
    719 ale_wake=0.
    720 ale_bl_stat=0.
     682        u10m=0.
     683        v10m=0.
     684        ale_wake=0.
     685        ale_bl_stat=0.
    721686
    722687!------------------------------------------------------------------------
     
    738703! to be set at some arbitratry convenient values.
    739704!------------------------------------------------------------------------
    740 !Al1 =============== restart option ==========================
     705!Al1 =============== restart option ======================================
    741706        if (.not.restart) then
    742707          iflag_pbl = 5
     
    803768       print*,'plev,play,phi,phis,presnivs,u,v,temp,q,omega2'
    804769       print*,'temp(1),q(1,1),u(1),v(1),plev(1),phis :'
    805        print*,temp(1),q(1,1),u(1),v(1),plev(1),phis
     770       print*,temp(1),q(1,1),u(1),v(1),plev(1),phis(1)
    806771! raz for safety
    807772       do l=1,llm
     
    809774       enddo
    810775      endif
    811 !Al1 ================  end restart =================================
     776!======================  end restart =================================
    812777      IF (ecrit_slab_oc.eq.1) then
    813778         open(97,file='div_slab.dat',STATUS='UNKNOWN')
     
    820785       CALL iophys_ini
    821786#endif
     787
     788!=====================================================================
    822789! START OF THE TEMPORAL LOOP :
    823790!=====================================================================
    824791           
    825792      it_end = nint(fnday*day_step)
    826 !test JLD     it_end = 10
    827793      do while(it.le.it_end)
    828794
     
    832798         print*,'PAS DE TEMPS ',timestep
    833799       endif
    834 !Al1 demande de restartphy.nc
    835800       if (it.eq.it_end) lastcall=.True.
    836801
     
    844809!  Geopotential :
    845810!---------------------------------------------------------------------
    846 
     811!        phis(1)=zsurf*RG
     812!        phi(1)=phis(1)+RD*temp(1)*(plev(1)-play(1))/(.5*(plev(1)+play(1)))
    847813        phi(1)=RD*temp(1)*(plev(1)-play(1))/(.5*(plev(1)+play(1)))
     814
    848815        do l = 1, llm-1
    849816          phi(l+1)=phi(l)+RD*(temp(l)+temp(l+1))*                           &
    850817     &    (play(l)-play(l+1))/(play(l)+play(l+1))
    851818        enddo
     819
    852820
    853821!---------------------------------------------------------------------
     
    950918       sfdt = sin(0.5*fcoriolis*timestep)
    951919       cfdt = cos(0.5*fcoriolis*timestep)
    952 !       print *,'fcoriolis,sfdt,cfdt,timestep',fcoriolis,sfdt,cfdt,timestep
    953 !
     920
    954921        d_u_age(1:mxcalc)= -2.*sfdt/timestep*                                &
    955922     &          (sfdt*(u(1:mxcalc)-ug(1:mxcalc)) -                          &
     
    1030997        temp(1:mxcalc)=temp(1:mxcalc)+timestep*(                            &
    1031998     &              dt_phys(1:mxcalc)                                       &
    1032      &             +d_t_adv(1:mxcalc)                                      &
    1033      &             +d_t_nudge(1:mxcalc)                                      &
     999     &             +d_t_adv(1:mxcalc)                                       &
     1000     &             +d_t_nudge(1:mxcalc)                                     &
    10341001     &             +dt_cooling(1:mxcalc))  ! Taux de chauffage ou refroid.
    10351002
    10361003
    1037 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
     1004!=======================================================================
    10381005!! CONSERVE EN ATTENDANT QUE LE CAS EN QUESTION FONCTIONNE EN STD !!
    1039 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    1040 !     endif  ! forcing_sandu or forcing_astex
    1041 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
     1006!=======================================================================
    10421007
    10431008        teta=temp*(pzero/play)**rkappa
    1044 !
     1009
    10451010!---------------------------------------------------------------------
    10461011!   Nudge soil temperature if requested
     
    10801045
    10811046!  incremente day time
    1082 !        print*,'daytime bef',daytime,1./day_step
    10831047        daytime = daytime+1./day_step
    1084 !Al1dbg
    10851048        day = int(daytime+0.1/day_step)
    10861049!        time = max(daytime-day,0.0)
     
    10881051!cc        time = real(mod(it,day_step))/day_step
    10891052        time = time_ini/24.+real(mod(it,day_step))/day_step
    1090 !        print*,'daytime nxt time',daytime,time
    10911053        it=it+1
    10921054
    10931055      enddo
    10941056
    1095 !Al1
    10961057      if (ecrit_slab_oc.ne.-1) close(97)
    10971058
    10981059!Al1 Call to 1D equivalent of dynredem (an,mois,jour,heure ?)
    1099 ! -------------------------------------
     1060! ---------------------------------------------------------------------------
    11001061       call dyn1dredem("restart1dyn.nc",                                    &
    11011062     &              plev,play,phi,phis,presnivs,                            &
Note: See TracChangeset for help on using the changeset viewer.