Ignore:
Timestamp:
Jun 17, 2022, 4:24:49 PM (2 years ago)
Author:
lguez
Message:

Sync latest trunk changes to branch LMDZ-ECRAD.

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

Legend:

Unmodified
Added
Removed
  • LMDZ6/branches/LMDZ-ECRAD

  • LMDZ6/branches/LMDZ-ECRAD/libf/dyn3dmem/iniacademic_loc.F90

    r3435 r4171  
    55
    66  USE filtreg_mod, ONLY: inifilr
     7  USE infotrac,    ONLY: nqtot, niso, tnat, alpha_ideal, iqIsoPha, tracers
     8  USE control_mod, ONLY: day_step,planet_type
    79  use exner_hyb_m, only: exner_hyb
    810  use exner_milieu_m, only: exner_milieu
    9   USE infotrac, ONLY: nqtot,niso_possibles,ok_isotopes,iqpere,ok_iso_verif,tnat,alpha_ideal, &
    10         & iqiso,phase_num,iso_indnum,iso_num,zone_num
    11   USE control_mod, ONLY: day_step,planet_type
    1211  USE parallel_lmdz, ONLY: ijb_u, ije_u, ijb_v, ije_v
    1312#ifdef CPP_IOIPSL
     
    2322  USE temps_mod, ONLY: annee_ref, day_ini, day_ref
    2423  USE ener_mod, ONLY: etot0,ptot0,ztot0,stot0,ang0
    25 
     24  USE readTracFiles_mod, ONLY: addPhase
    2625
    2726  !   Author:    Frederic Hourdin      original: 15/01/93
     
    6766  real tetastrat ! potential temperature in the stratosphere, in K
    6867  real tetajl(jjp1,llm)
    69   INTEGER i,j,l,lsup,ij
     68  INTEGER i,j,l,lsup,ij, iq, iName, iPhase, iqParent
    7069
    7170  REAL teta0,ttp,delt_y,delt_z,eps ! Constantes pour profil de T
     
    7372  LOGICAL ok_geost             ! Initialisation vent geost. ou nul
    7473  LOGICAL ok_pv                ! Polar Vortex
    75   REAL phi_pv,dphi_pv,gam_pv   ! Constantes pour polar vortex
     74  REAL phi_pv,dphi_pv,gam_pv,tetanoise   ! Constantes pour polar vortex
    7675
    7776  real zz,ran1
     
    112111  ztot0      = 0.
    113112  stot0      = 0.
    114   ang0       = 0.     
     113  ang0       = 0.
    115114
    116115  if (llm == 1) then
     
    122121  CALL inigeom
    123122  CALL inifilr
     123
     124  ! Initialize pressure and mass field if read_start=.false.
     125  IF (.NOT. read_start) THEN
     126    ! allocate global fields:
     127!    allocate(vcov_glo(ip1jm,llm))
     128    allocate(ucov_glo(ip1jmp1,llm))
     129    allocate(teta_glo(ip1jmp1,llm))
     130    allocate(ps_glo(ip1jmp1))
     131    allocate(masse_glo(ip1jmp1,llm))
     132    allocate(phis_glo(ip1jmp1))
     133
     134     ! surface pressure
     135     if (iflag_phys>2) then
     136        ! specific value for CMIP5 aqua/terra planets
     137        ! "Specify the initial dry mass to be equivalent to
     138        !  a global mean surface pressure (101325 minus 245) Pa."
     139        ps_glo(:)=101080. 
     140     else
     141        ! use reference surface pressure
     142        ps_glo(:)=preff
     143     endif
     144
     145     ! ground geopotential
     146     phis_glo(:)=0.
     147     CALL pression ( ip1jmp1, ap, bp, ps_glo, p       )
     148     if (pressure_exner) then
     149       CALL exner_hyb( ip1jmp1, ps_glo, p, pks, pk )
     150     else
     151       call exner_milieu(ip1jmp1,ps_glo,p,pks,pk)
     152     endif
     153     CALL massdair(p,masse_glo)
     154  ENDIF
    124155
    125156  if (llm == 1) then
     
    172203     gam_pv=4.              ! -dT/dz vortex (in K/km)
    173204     CALL getin('gam_pv',gam_pv)
     205     tetanoise=0.005
     206     CALL getin('tetanoise',tetanoise)
    174207
    175208     ! 2. Initialize fields towards which to relax
     
    224257     ! 3. Initialize fields (if necessary)
    225258     IF (.NOT. read_start) THEN
    226        ! allocate global fields:
    227 !       allocate(vcov_glo(ip1jm,llm))
    228        allocate(ucov_glo(ip1jmp1,llm))
    229        allocate(teta_glo(ip1jmp1,llm))
    230        allocate(ps_glo(ip1jmp1))
    231        allocate(masse_glo(ip1jmp1,llm))
    232        allocate(phis_glo(ip1jmp1))
    233 
    234         ! surface pressure
    235         if (iflag_phys>2) then
    236            ! specific value for CMIP5 aqua/terra planets
    237            ! "Specify the initial dry mass to be equivalent to
    238            !  a global mean surface pressure (101325 minus 245) Pa."
    239            ps_glo(:)=101080. 
    240         else
    241            ! use reference surface pressure
    242            ps_glo(:)=preff
    243         endif
    244        
    245         ! ground geopotential
    246         phis_glo(:)=0.
    247 
    248         CALL pression ( ip1jmp1, ap, bp, ps_glo, p       )
    249         if (pressure_exner) then
    250           CALL exner_hyb( ip1jmp1, ps_glo, p, pks, pk )
    251         else
    252           call exner_milieu(ip1jmp1,ps_glo,p,pks,pk)
    253         endif
    254         CALL massdair(p,masse_glo)
    255 
    256259        ! bulk initialization of temperature
    257         teta_glo(:,:)=tetarappel(:,:)
    258 
     260        IF (iflag_phys>10000) THEN
     261        ! Particular case to impose a constant temperature T0=0.01*iflag_phys
     262           teta_glo(:,:)= 0.01*iflag_phys/(pk(:,:)/cpp)
     263        ELSE
     264           teta_glo(:,:)=tetarappel(:,:)
     265        ENDIF
    259266        ! geopotential
    260267        CALL geopot(ip1jmp1,teta_glo,pk,pks,phis_glo,phi)
     
    271278        if (planet_type=="earth") then
    272279           ! Earth: first two tracers will be water
    273 
    274            do i=1,nqtot
    275               if (i == 1) q(ijb_u:ije_u,:,i)=1.e-10
    276               if (i == 2) q(ijb_u:ije_u,:,i)=1.e-15
    277               if (i.gt.2) q(ijb_u:ije_u,:,i)=0.
     280           do iq=1,nqtot
     281              q(ijb_u:ije_u,:,iq)=0.
     282              IF(tracers(iq)%name == addPhase('H2O', 'g')) q(ijb_u:ije_u,:,iq)=1.e-10
     283              IF(tracers(iq)%name == addPhase('H2O', 'l')) q(ijb_u:ije_u,:,iq)=1.e-15
    278284
    279285              ! CRisi: init des isotopes
    280286              ! distill de Rayleigh très simplifiée
    281               if (ok_isotopes) then
    282                 if ((iso_num(i).gt.0).and.(zone_num(i).eq.0)) then         
    283                    q(ijb_u:ije_u,:,i)=q(ijb_u:ije_u,:,iqpere(i))       &
    284       &                  *tnat(iso_num(i))                             &
    285       &                  *(q(ijb_u:ije_u,:,iqpere(i))/30.e-3)                              &
    286      &                   **(alpha_ideal(iso_num(i))-1)
    287                 endif               
    288                 if ((iso_num(i).gt.0).and.(zone_num(i).eq.1)) then
    289                   q(ijb_u:ije_u,:,i)=q(ijb_u:ije_u,:,iqiso(iso_indnum(i),phase_num(i)))
    290                 endif
    291               endif !if (ok_isotopes) then
    292 
     287              iName    = tracers(iq)%iso_iName
     288              if (niso <= 0 .OR. iName <= 0) CYCLE
     289              iPhase   = tracers(iq)%iso_iPhase
     290              iqParent = tracers(iq)%iqParent
     291              IF(tracers(iq)%iso_iZone == 0) THEN
     292                 q(ijb_u:ije_u,:,iq) = q(ijb_u:ije_u,:,iqParent)*tnat(iName) &
     293                                     *(q(ijb_u:ije_u,:,iqParent)/30.e-3)**(alpha_ideal(iName)-1.)
     294              ELSE
     295                 q(ijb_u:ije_u,:,iq) = q(ijb_u:ije_u,:,iqIsoPha(iName,iPhase))
     296              END IF
    293297           enddo
    294298        else
     
    296300        endif ! of if (planet_type=="earth")
    297301
    298         if (ok_iso_verif) then
    299            call check_isotopes(q,ijb_u,ije_u,'iniacademic_loc')
    300         endif !if (ok_iso_verif) then
     302        call check_isotopes(q,ijb_u,ije_u,'iniacademic_loc')
    301303
    302304        ! add random perturbation to temperature
     
    306308        do l=1,llm
    307309           do ij=iip2,ip1jm
    308               teta_glo(ij,l)=teta_glo(ij,l)*(1.+0.005*ran1(idum))
     310              teta_glo(ij,l)=teta_glo(ij,l)*(1.+tetanoise*ran1(idum))
    309311           enddo
    310312        enddo
Note: See TracChangeset for help on using the changeset viewer.