Ignore:
Timestamp:
Jan 24, 2018, 10:24:24 PM (7 years ago)
Author:
jvatant
Message:

Making Titan's hazy again - part II
+ Major updates of J.Burgalat YAMMS library and optical coupling, including :
++ Added the routines for haze optics inside YAMMS
++ Calling rad. transf. with interactive haze is plugged
in but should stay unactive as long as the microphysics is
in test phase : cf "uncoupl_optic_haze" flag : true for now !
++ Also some sanity checks for negative tendencies and
some others upkeep of YAMMS model
+ Also added a temporary CPP key USE_QTEST in physiq_mod
that enables to have microphysical tendencies separated
from dynamics for debugging and test phases
-- JVO and JB

Location:
trunk/LMDZ.TITAN/libf/phytitan
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.TITAN/libf/phytitan/callcorrk.F90

    r1822 r1897  
    4545      INTEGER,INTENT(IN) :: ngrid                  ! Number of atmospheric columns.
    4646      INTEGER,INTENT(IN) :: nlayer                 ! Number of atmospheric layers.
    47       REAL,INTENT(IN) :: pq(ngrid,nlayer,nq)       ! Tracers (kg/kg_of_air).
     47      REAL,INTENT(IN) :: pq(ngrid,nlayer,nq)       ! Tracers (X/m2).
    4848      INTEGER,INTENT(IN) :: nq                     ! Number of tracers.
    4949      REAL,INTENT(IN) :: qsurf(ngrid,nq)           ! Tracers on surface (kg.m-2).
     
    298298            endif
    299299           
    300             call optcv(pq,plevrad,tmid,pmid,                       &
     300            call optcv(pq(ig,:,1:nmicro),nlayer,plevrad,tmid,pmid,        &
    301301                 dtauv,tauv,taucumv,wbarv,cosbv,tauray,taugsurf)
    302302
     
    340340!-----------------------------------------------------------------------
    341341
    342          call optci(pq,plevrad,tlevrad,tmid,pmid,                   &
     342         call optci(pq(ig,:,1:nmicro),nlayer,plevrad,tlevrad,tmid,pmid,    &
    343343              dtaui,taucumi,cosbi,wbari,taugsurfi)
    344344
  • trunk/LMDZ.TITAN/libf/phytitan/callkeys_mod.F90

    r1822 r1897  
    1212      logical,save :: callgasvis,continuum,graybody
    1313!$OMP THREADPRIVATE(callgasvis,continuum,graybody)
    14       logical,save :: strictboundcorrk                                     
     14      logical,save :: strictboundcorrk
    1515!$OMP THREADPRIVATE(strictboundcorrk)
     16      logical,save :: uncoupl_optic_haze
     17!$OMP THREADPRIVATE(uncoupl_optic_haze)
     18
    1619      logical,save :: callchim, callmufi, callclouds
    1720!$OMP THREADPRIVATE(callchim,callmufi,callclouds)
     
    4548!$OMP THREADPRIVATE(iddist,iradia,startype)
    4649     
    47       real,save :: df_mufi, rm_mufi, rho_aer_mufi
    4850      real,save :: p_prod, tx_prod, rc_prod
    4951      real,save :: air_rad
    50 !$OMP THREADPRIVATE(df_mufi, rm_mufi, rho_aer_mufi,p_prod,tx_prod,rc_prod,air_rad)
    51 
     52!$OMP THREADPRIVATE(p_prod,tx_prod,rc_prod,air_rad)
     53     
    5254      real,save :: szangle
    5355!$OMP THREADPRIVATE(szangle)
  • trunk/LMDZ.TITAN/libf/phytitan/calmufi.F90

    r1819 r1897  
     1
     2
    13SUBROUTINE calmufi(plev, zlev, play, zlay, temp, pq, zdq)
    24  !! Interface subroutine to YAMMS model for Titan LMDZ GCM.
    35  !!
    4   !! The subroutine computes the microphysics processes for a single vertical column.
     6  !! The subroutine computes the microphysics processes for a si:le vertical column.
    57  !!
    68  !! - All input vectors are assumed to be defined from GROUND to TOP of the atmosphere.
     
    5254
    5355  INTEGER :: ilon, i,nices
    54 
    5556  INTEGER :: nlon,nlay
    5657
     
    8990    ! Convert tracers to extensive ( except for gazs where we work with molar mass ratio )
    9091    ! We suppose a given order of tracers !
    91     int2ext(:) = ( plev(ilon,1:nlay) - plev(ilon,2:nlay+1) ) / g
    92 
     92    int2ext(:) = ( plev(ilon,1:nlay)-plev(ilon,2:nlay+1) ) / g
    9393    m0as(:) = pq(ilon,:,1) * int2ext(:)
    9494    m3as(:) = pq(ilon,:,2) * int2ext(:)
     
    9797   
    9898    if (callclouds) then ! if call clouds
    99       dm0n(:) = pq(ilon,:,5) * int2ext(:)
    100       dm3n(:) = pq(ilon,:,6) * int2ext(:)
     99      m0n(:) = pq(ilon,:,5) * int2ext(:)
     100      m3n(:) = pq(ilon,:,6) * int2ext(:)
    101101      do i=1,nices
    102         dm3i(:,nices) = pq(ilon,:,6+i) * int2ext(:)
    103         dgazs(:,i)    = pq(ilon,:,ices_indx(i)) * rat_mmol(ices_indx(i)) ! For gazs we work on the full tracer array !!
     102        m3i(:,nices) = pq(ilon,:,6+i) * int2ext(:)
     103        gazs(:,i)    = pq(ilon,:,ices_indx(i)) * rat_mmol(ices_indx(i)) ! For gazs we work on the full tracer array !!
    104104        ! We use the molar mass ratio from GCM in case there is discrepancy with the mm one
    105105      enddo
    106106    endif
    107 
    108107
    109108    ! Initialize YAMMS atmospheric column
     
    135134    ! Convert tracers back to intensives ( except for gazs where we work with molar mass ratio )
    136135    ! We suppose a given order of tracers !
    137 
     136 
    138137    zdq(ilon,:,1) = dm0as(:) / int2ext(:)
    139138    zdq(ilon,:,2) = dm3as(:) / int2ext(:)
     
    150149      enddo
    151150    endif
    152 
    153151  END DO ! loop on ilon
    154152
  • trunk/LMDZ.TITAN/libf/phytitan/inifis_mod.F90

    r1896 r1897  
    377377     endif
    378378
    379      write(*,*) "Fractal dimension ?"
    380      df_mufi=2.0 ! default value
    381      call getin_p("df_mufi",df_mufi)
    382      write(*,*)" df_mufi = ",df_mufi
    383 
    384      write(*,*) "Monomer radius (m) ?"
    385      rm_mufi=6.66e-08 ! default value
    386      call getin_p("rm_mufi",rm_mufi)
    387      write(*,*)" rm_mufi = ",rm_mufi
    388 
    389      write(*,*) "Aerosol density (kg.m-3)?"
    390      rho_aer_mufi=1.e3 ! default value
    391      call getin_p("rho_aer_mufi",rho_aer_mufi)
    392      write(*,*)" rho_aer_mufi = ",rho_aer_mufi
     379     write(*,*) "Disable the coupling of microphysics within rad. transf. ?"
     380     write(*,*) "If disabled we will assume a planetwide vert. profile of extinction ..."
     381     uncoupl_optic_haze=.true. ! default value - true as long as the microphysics is bugged
     382     call getin_p("uncoupl_optic_haze",uncoupl_optic_haze)
     383     write(*,*)" uncoupl_optic_haze = ",uncoupl_optic_haze
    393384
    394385     write(*,*) "Pressure level of aer. production (Pa) ?"
  • trunk/LMDZ.TITAN/libf/phytitan/inimufi.F90

    r1795 r1897  
    22
    33  use mmp_gcm
    4   use callkeys_mod, only : callclouds, df_mufi, &
    5         rm_mufi, rho_aer_mufi, p_prod, tx_prod, rc_prod, air_rad
     4  use callkeys_mod, only : callclouds, p_prod, tx_prod, rc_prod, air_rad
    65  use tracer_h
    76  use comcstfi_mod, only : g, rad, mugaz
     
    4241  logical :: err
    4342
     43  ! PATCH : YAMMS now allows to enable/disable effective g computations:
     44  !  In the library it defaults to .true., in the GCM we do not want it !
     45  mm_use_effg = .false.
    4446
    4547  !----------------------------------------------------
     
    4749  ! ---------------------------------------------------
    4850
    49    call mmp_initialize(ptimestep,df_mufi,rm_mufi,rho_aer_mufi,p_prod,tx_prod,rc_prod, &
     51   call mmp_initialize(ptimestep,p_prod,tx_prod,rc_prod, &
    5052        rad,g,air_rad,mugaz,callclouds,config_mufi)
    5153
  • trunk/LMDZ.TITAN/libf/phytitan/optci.F90

    r1822 r1897  
    1 subroutine optci(PQ,PLEV,TLEV,TMID,PMID,      &
     1subroutine optci(PQO,NLAY,PLEV,TLEV,TMID,PMID,      &
    22     DTAUI,TAUCUMI,COSBI,WBARI,TAUGSURF)
    33
     
    66  use gases_h
    77  use comcstfi_mod, only: g, r
    8   use callkeys_mod, only: continuum,graybody
     8  use callkeys_mod, only: continuum,graybody,callclouds,callmufi, uncoupl_optic_haze
     9  use tracer_h, only : nmicro,nice
     10  use MMP_OPTICS
     11
    912  implicit none
    1013
     
    3437  ! Input/Output
    3538  !==========================================================
    36   REAL*8, INTENT(IN)  :: PQ ! Tracers (kg/kg_of_air).
     39  REAL*8, INTENT(IN)  :: PQO(nlay,nmicro) ! Tracers (X/m2).
     40  INTEGER, INTENT(IN) :: NLAY             ! Number of pressure layers (for pqo)
    3741  REAL*8, INTENT(IN)  :: PLEV(L_LEVELS), TLEV(L_LEVELS)
    3842  REAL*8, INTENT(IN)  :: TMID(L_LEVELS), PMID(L_LEVELS)
     
    8690  integer interm
    8791
     92  real*8 m0as,m3as,m0af,m3af
     93  real*8 ext_s,sca_s,ssa_s,asf_s
     94  real*8 ext_f,sca_f,ssa_f,asf_f
     95  logical,save :: firstcall=.true.
     96  !$OMP THREADPRIVATE(firstcall)
     97
    8898  !! AS: to save time in computing continuum (see bilinearbig)
    8999  IF (.not.ALLOCATED(indi)) THEN
     
    127137        ilay = k / 2 ! int. arithmetic => gives the gcm layer index
    128138       
    129         !================= Titan customisation ========================================
    130         call disr_haze(dz(k),plev(k),wnoi(nw),dhaze_T(k,nw),SSA_T(k,nw),ASF_T(k,nw))
    131         ! =============================================================================
     139        ! Optical coupling of YAMMS is plugged but inactivated for now
     140        ! as long as the microphysics only isn't fully debugged -- JVO 01/18
     141        IF (callmufi .AND. (.NOT. uncoupl_optic_haze)) THEN
     142          m0as = pqo(ilay,1)
     143          m3as = pqo(ilay,2)
     144          m0af = pqo(ilay,3)
     145          m3af = pqo(ilay,4)
     146
     147          IF (.NOT.mmp_sph_optics_ir(m0as,m3as,nw,ext_s,sca_s,ssa_s,asf_s)) &
     148          CALL abort_gcm("optcv", "Fatal error in mmp_sph_optics_ir", 12)
     149          IF (.NOT.mmp_fra_optics_ir(m0af,m3af,nw,ext_f,sca_f,ssa_f,asf_f)) &
     150          CALL abort_gcm("optcv", "Fatal error in mmp_fra_optics_ir", 12)
     151          dhaze_T(k,nw) = ext_s+ext_f
     152          SSA_T(k,nw)   = (sca_s+sca_f)/dhaze_T(k,nw)
     153          ASF_T(k,nw)   = (asf_s*sca_s + asf_f*sca_f) /(sca_s+sca_f)
     154          IF (callclouds.and.firstcall) &
     155            WRITE(*,*) 'WARNING: In optci, optical properties &
     156                       &calculations are not implemented yet'
     157        ELSE
     158          ! Call fixed vertical haze profile of extinction - same for all columns
     159          call disr_haze(dz(k),plev(k),wnoi(nw),dhaze_T(k,nw),SSA_T(k,nw),ASF_T(k,nw))
     160        ENDIF
    132161
    133162        DCONT = 0.0d0 ! continuum absorption
     
    401430! ============================================================================== 
    402431
     432  if(firstcall) firstcall = .false.
     433
    403434  return
    404435
  • trunk/LMDZ.TITAN/libf/phytitan/optcv.F90

    r1826 r1897  
    1 SUBROUTINE OPTCV(PQ,PLEV,TMID,PMID,  &
     1SUBROUTINE OPTCV(PQO,NLAY,PLEV,TMID,PMID,  &
    22     DTAUV,TAUV,TAUCUMV,WBARV,COSBV,TAURAY,TAUGSURF)
    33
     
    66  use gases_h
    77  use comcstfi_mod, only: g, r
    8   use callkeys_mod, only: continuum,graybody,callgasvis
     8  use callkeys_mod, only: continuum,graybody,callgasvis,callclouds,callmufi,uncoupl_optic_haze
     9  use tracer_h, only: nmicro,nice
     10  use MMP_OPTICS
    911
    1012  implicit none
     
    4143  ! Input/Output
    4244  !==========================================================
    43   REAL*8, INTENT(IN)  :: PQ ! Tracers (kg/kg_of_air).
     45  REAL*8, INTENT(IN)  :: PQO(nlay,nmicro) ! Tracers (X/m2).
     46  INTEGER, INTENT(IN) :: NLAY             ! Number of pressure layers (for pqo)
    4447  REAL*8, INTENT(IN)  :: PLEV(L_LEVELS)
    4548  REAL*8, INTENT(IN)  :: TMID(L_LEVELS), PMID(L_LEVELS)
     
    97100  integer interm
    98101
     102  real*8 m0as,m3as,m0af,m3af
     103  real*8 ext_s,sca_s,ssa_s,asf_s
     104  real*8 ext_f,sca_f,ssa_f,asf_f
     105  logical,save :: firstcall=.true.
     106  !$OMP THREADPRIVATE(firstcall)
     107
     108
    99109  !! AS: to save time in computing continuum (see bilinearbig)
    100110  IF (.not.ALLOCATED(indv)) THEN
     
    149159
    150160     do NW=1,L_NSPECTV
    151 
    152         !================= Titan customisation ========================================
    153         call disr_haze(dz(k),plev(k),wnov(nw),dhaze_T(k,nw),SSA_T(k,nw),ASF_T(k,nw))
    154         ! =============================================================================
     161     
     162        ! Optical coupling of YAMMS is plugged but inactivated (if false) for now
     163        ! as long as the microphysics only isn't fully debugged -- JVO 01/18
     164        IF (callmufi .AND. (.NOT. uncoupl_optic_haze)) THEN
     165          m0as = pqo(ilay,1)
     166          m3as = pqo(ilay,2)
     167          m0af = pqo(ilay,3)
     168          m3af = pqo(ilay,4)
     169
     170          IF (.NOT.mmp_sph_optics_vis(m0as,m3as,nw,ext_s,sca_s,ssa_s,asf_s)) &
     171          CALL abort_gcm("optcv", "Fatal error in mmp_sph_optics_vis", 12)
     172          IF (.NOT.mmp_fra_optics_vis(m0af,m3af,nw,ext_f,sca_f,ssa_f,asf_f)) &
     173          CALL abort_gcm("optcv", "Fatal error in mmp_fra_optics_vis", 12)
     174          dhaze_T(k,nw) = ext_s+ext_f
     175          SSA_T(k,nw)   = (sca_s+sca_f)/dhaze_T(k,nw)
     176          ASF_T(k,nw)   = (asf_s*sca_s + asf_f*sca_f) /(sca_s+sca_f)
     177          IF (callclouds.and.firstcall) &
     178            WRITE(*,*) 'WARNING: In optcv, optical properties &
     179                       &calculations are not implemented yet'
     180        ELSE
     181          ! Call fixed vertical haze profile of extinction - same for all columns
     182          call disr_haze(dz(k),plev(k),wnov(nw),dhaze_T(k,nw),SSA_T(k,nw),ASF_T(k,nw))
     183        ENDIF
    155184         
    156185        DRAYAER = TRAY(K,NW)
     
    355384! ============================================================================== 
    356385
     386  if(firstcall) firstcall = .false.
    357387
    358388  return
  • trunk/LMDZ.TITAN/libf/phytitan/physiq_mod.F90

    r1896 r1897  
     1#define USE_QTEST
     2
    13      module physiq_mod
    24     
     
    4648      use wxios, only: wxios_context_init, xios_context_finalize
    4749#endif
     50      use MMP_OPTICS
    4851      implicit none
    4952
     
    150153!                + clean of all too-generic (ocean, water, co2 ...) routines
    151154!                + Titan's chemistry
     155!           Microphysical moment model - J.Burgalat / J.Vatant d'Ollone (2017-2018)
    152156!============================================================================================
    153157
     
    383387!$OMP THREADPRIVATE(tankCH4)
    384388
     389      ! -----******----- FOR MUPHYS OPTICS -----******-----
     390      integer :: i,j
     391      real :: pqo(ngrid,nlayer,nq)   ! Tracers for the optics (X/m2).
     392      real :: i2e(nlayer)            ! int 2 ext factor
     393      ! -----******----- END FOR MUPHYS OPTICS -----******-----
     394
     395      real,save,dimension(:,:,:), allocatable :: tpq ! Tracers for decoupled microphysical tests ( temporary in 01/18 )
     396!$OMP THREADPRIVATE(tpq)
     397
     398
    385399!-----------------------------------------------------------------------------
    386400    ! Interface to calmufi
    387401    !   --> needed in order to pass assumed-shape arrays. Otherwise we must put calmufi in a module
    388     !       (to have an explicit generated by the compiler).
     402    !       (to have an explicit interface generated by the compiler).
    389403    !   Or one can put calmufi in MMP_GCM module (in muphytitan).
    390404    INTERFACE
     
    410424! --------------------------------
    411425      if (firstcall) then
     426        allocate(tpq(ngrid,nlayer,nq))
     427        tpq(:,:,:) = pq(:,:,:)
    412428
    413429        ! Initialisation of nmicro as well as tracers names, indexes ...
     
    518534
    519535           call inimufi(nq,ptimestep)
     536           
     537           ! Optical coupling of YAMMS is plugged but inactivated for now
     538           ! as long as the microphysics only isn't fully debugged -- JVO 01/18
     539           IF (.NOT.uncoupl_optic_haze) call mmp_initialize_optics("/path/to/mmp_optic_table.nc")
    520540
    521541         ENDIF
     
    820840               call call_profilgases(nlayer)
    821841
     842               ! Convert (microphysical) tracers for optics: X.kg-1 --> X.m-2_
     843               ! NOTE: it should be moved somewhere else: calmufi performs the same kind of
     844               ! computations... waste of time...
     845               DO i = 1, ngrid
     846                 i2e(:) = ( pplev(i,1:nlayer)-pplev(i,2:nlayer+1) ) / g
     847                 pqo(i,:,:) = 0.0
     848                 DO j=1,nmicro-nice
     849                   pqo(i,:,j) = pq(i,:,j)*i2e(:)
     850                 ENDDO
     851               ENDDO
     852
     853
    822854               ! standard callcorrk
    823                call callcorrk(ngrid,nlayer,pq,nq,qsurf,                           &
     855               call callcorrk(ngrid,nlayer,pqo,nq,qsurf,                          &
    824856                              albedo,albedo_equivalent,emis,mu0,pplev,pplay,pt,   &
    825857                              tsurf,fract,dist_star,                              &
     
    11081140 
    11091141         if (callmufi) then
    1110 
     1142#ifdef USE_QTEST
     1143               if (ngrid.eq.1) then ! We obviously don't have access to (and don't need) zonal means in 1D
     1144                  call calmufi(pplev,zzlev,pplay,zzlay,pt,tpq,zdqmufi)
     1145               else
     1146                  call calmufi(zplevbar,zzlevbar,zplaybar,zzlaybar,ztfibar,tpq,zdqmufi)
     1147               endif
     1148               tpq(:,:,:) = tpq(:,:,:) + zdqmufi(1:ngrid,1:nlayer,1:nq)*ptimestep
     1149#else
    11111150            ! Inside this routine we will split 2D->1D, intensive->extensive and separate different types of tracers
    11121151            ! Should be put in phytrac
     
    11191158
    11201159            pdq(1:ngrid,1:nlayer,1:nq) = pdq(1:ngrid,1:nlayer,1:nq) + zdqmufi(1:ngrid,1:nlayer,1:nq)   
    1121 
     1160#endif
    11221161         endif ! end of 'callmufi'
    11231162     
     
    13401379
    13411380
    1342 !-----------------------------------
    1343 !        Saving statistics :
    1344 !-----------------------------------
    1345 
    1346 !    Note :("stats" stores and accumulates 8 key variables in file "stats.nc"
    1347 !           which can later be used to make the statistic files of the run:
    1348 !           "stats")          only possible in 3D runs !!!
    1349 
    1350          
    1351       if (callstats) then
    1352 
    1353          call wstats(ngrid,"ps","Surface pressure","Pa",2,ps)
    1354          call wstats(ngrid,"tsurf","Surface temperature","K",2,tsurf)
    1355          call wstats(ngrid,"fluxsurf_lw",                               &
    1356                      "Thermal IR radiative flux to surface","W.m-2",2,  &
    1357                      fluxsurf_lw)
    1358          call wstats(ngrid,"fluxtop_lw",                                &
    1359                      "Thermal IR radiative flux to space","W.m-2",2,    &
    1360                      fluxtop_lw)
    1361                      
    1362 !            call wstats(ngrid,"fluxsurf_sw",                               &
    1363 !                        "Solar radiative flux to surface","W.m-2",2,       &
    1364 !                         fluxsurf_sw_tot)                     
    1365 !            call wstats(ngrid,"fluxtop_sw",                                &
    1366 !                        "Solar radiative flux to space","W.m-2",2,         &
    1367 !                        fluxtop_sw_tot)
    1368 
    1369 
    1370          call wstats(ngrid,"ISR","incoming stellar rad.","W m-2",2,fluxtop_dn)
    1371          call wstats(ngrid,"ASR","absorbed stellar rad.","W m-2",2,fluxabs_sw)
    1372          call wstats(ngrid,"OLR","outgoing longwave rad.","W m-2",2,fluxtop_lw)
    1373          !call wstats(ngrid,"ALB","Surface albedo"," ",2,albedo_equivalent)
    1374          !call wstats(ngrid,"ALB_1st","First Band Surface albedo"," ",2,albedo(:,1))
    1375          call wstats(ngrid,"p","Pressure","Pa",3,pplay)
    1376          call wstats(ngrid,"temp","Atmospheric temperature","K",3,zt)
    1377          call wstats(ngrid,"u","Zonal (East-West) wind","m.s-1",3,zu)
    1378          call wstats(ngrid,"v","Meridional (North-South) wind","m.s-1",3,zv)
    1379          call wstats(ngrid,"w","Vertical (down-up) wind","m.s-1",3,pw)
    1380          call wstats(ngrid,"q2","Boundary layer eddy kinetic energy","m2.s-2",3,q2)
    1381 
    1382          if (tracer) then
    1383             do iq=1,nq
    1384                call wstats(ngrid,noms(iq),noms(iq),'kg/kg',3,zq(1,1,iq))
    1385                call wstats(ngrid,trim(noms(iq))//'_surf',trim(noms(iq))//'_surf',  &
    1386                            'kg m^-2',2,qsurf(1,iq) )
    1387                          
    1388 !              call wstats(ngrid,trim(noms(iq))//'_reff',                          &
    1389 !                          trim(noms(iq))//'_reff',                                   &
    1390 !                          'm',3,reffrad(1,1,iq))
    1391 
    1392             end do
    1393 
    1394          endif ! end of 'tracer'
    1395 
    1396          if(lastcall) then
    1397             write (*,*) "Writing stats..."
    1398             call mkstats(ierr)
    1399          endif
    1400          
    1401       endif ! end of 'callstats'
    1402 
    1403 
    14041381!-----------------------------------------------------------------------------------------------------
    14051382!           OUTPUT in netcdf file "DIAGFI.NC", containing any variable for diagnostic
     
    14751452        ! Temporary inclusions for winds diagnostics.
    14761453        call writediagfi(ngrid,"zdudif","Turbdiff tend. zon. wind","m s-2",3,zdudif)
    1477         call writediagfi(ngrid,"zdudyn","Dyn. tend. zon. wind","m s-2",3,zdudyn)
     1454        call writediagfi(ngrid,"zdudyn","Dyn. tend. zon. wind","m s-2",3,zdudyn)
    14781455
    14791456        ! Temporary inclusions for heating diagnostics.
     
    14911468
    14921469         if (callmufi) then ! For now we assume an given order for tracers !
     1470#ifdef USE_QTEST
     1471            ! Microphysical tracers passed through dyn+phys(except mufi)
     1472            call writediagfi(ngrid,"mu_m0as_dp","Dynphys only spherical mode 0th order moment",'kg/kg',3,zq(:,:,1))
     1473            call writediagfi(ngrid,"mu_m3as_dp","Dynphys only spherical mode 3rd order moment",'kg/kg',3,zq(:,:,2))
     1474            call writediagfi(ngrid,"mu_m0af_dp","Dynphys only fractal mode 0th order moment",'kg/kg',3,zq(:,:,3))
     1475            call writediagfi(ngrid,"mu_m3af_dp","Dynphys only fractal mode 3rd order moment",'kg/kg',3,zq(:,:,4))
     1476            ! Microphysical tracers passed through mufi only
     1477            call writediagfi(ngrid,"mu_m0as_mo","Mufi only spherical mode 0th order moment",'kg/kg',3,tpq(:,:,1))
     1478            call writediagfi(ngrid,"mu_m3as_mo","Mufi only spherical mode 3rd order moment",'kg/kg',3,tpq(:,:,2))
     1479            call writediagfi(ngrid,"mu_m0af_mo","Mufi only fractal mode 0th order moment",'kg/kg',3,tpq(:,:,3))
     1480            call writediagfi(ngrid,"mu_m3af_mo","Mufi only fractal mode 3rd order moment",'kg/kg',3,tpq(:,:,4))
     1481#else
    14931482            call writediagfi(ngrid,"mu_m0as","Spherical mode 0th order moment",'kg/kg',3,zq(:,:,1))
    14941483            call writediagfi(ngrid,"mu_m3as","Spherical mode 3rd order moment",'kg/kg',3,zq(:,:,2))
    14951484            call writediagfi(ngrid,"mu_m0af","Fractal mode 0th order moment",'kg/kg',3,zq(:,:,3))
    14961485            call writediagfi(ngrid,"mu_m3af","Fractal mode 3rd order moment",'kg/kg',3,zq(:,:,4))
     1486#endif
    14971487         endif ! end of 'callmufi'
    14981488
  • trunk/LMDZ.TITAN/libf/phytitan/setspi.F90

    r1822 r1897  
    138138      end do
    139139!     note M=L_NSPECTI+1 after loop due to Fortran bizarreness
     140!        --> No fortran bizarreness here... incrementation is performed at the end of the loop...
     141!        --> then when M reached L_NSPECTI, we initialiaze the last element of each array and
     142!            ... increment one last time M... tadaaaa, mystery solved !
     143!            The same logic is applied on for loop in C !
    140144
    141145!=======================================================================
Note: See TracChangeset for help on using the changeset viewer.