Ignore:
Timestamp:
Feb 25, 2018, 7:44:55 PM (7 years ago)
Author:
jvatant
Message:

Fixed 2 critical bugs.
+ One about rat_mmol (* instead of /)
+ One about zonal means (or not) arrays sent in chemistry and mufi
In any case zonal means seems to be responsible for crashes of chem and mufi !
Stop using them until further informations (for mufi, no problem, full 3D is quick)
--JVO

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

Legend:

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

    r1902 r1904  
    103103      do i=1,nices
    104104        m3i(:,nices) = pq(ilon,:,6+i) * int2ext(:)
    105         gazs(:,i)    = pq(ilon,:,ices_indx(i)) * rat_mmol(ices_indx(i)) ! For gazs we work on the full tracer array !!
     105        gazs(:,i)    = pq(ilon,:,ices_indx(i)) / rat_mmol(ices_indx(i)) ! For gazs we work on the full tracer array !!
    106106        ! We use the molar mass ratio from GCM in case there is discrepancy with the mm one
    107107      enddo
     
    147147      do i=1,nices
    148148        zdq(ilon,:,6+i) = dm3i(:,nices) / int2ext(:)
    149         zdq(ilon,:,ices_indx(i)) = dgazs(:,i)  / rat_mmol(ices_indx(i)) ! For gazs we work on the full tracer array !!
     149        zdq(ilon,:,ices_indx(i)) = dgazs(:,i) * rat_mmol(ices_indx(i)) ! For gazs we work on the full tracer array !!
    150150        ! We use the molar mass ratio from GCM in case there is discrepancy with the mm one
    151151      enddo
  • trunk/LMDZ.TITAN/libf/phytitan/physiq_mod.F90

    r1903 r1904  
    3838      use logic_mod, only: moyzon_ch, moyzon_mu
    3939      use moyzon_mod, only: tmoy, playmoy, zphibar, zphisbar, zplevbar, &
    40                             zplaybar, zzlevbar, zzlaybar, ztfibar
     40                            zplaybar, zzlevbar, zzlaybar, ztfibar, zqfibar
    4141      use callkeys_mod
    4242      use vertical_layers_mod, only: presnivs, pseudoalt
     
    624624                          ptimestep,pday+nday,time_phys,cell_area,          &
    625625                          albedo_bareground,inertiedat,zmea,zstd,zsig,zgam,zthe)
    626          
    627             ! Sanity check for microphysics - useless in 1D
    628             if ( ((.not.moyzon_mu).and.(callmufi)) ) then
    629                print *, "moyzon_mu=",moyzon_mu," and callmufi=",callmufi
    630                print *, "Please activate zonal mean to run microphysics (for now) !"
    631                stop
    632             endif
    633 
    634             ! Sanity check for chemistry - useless in 1D
    635             if ( (.not.moyzon_ch) .and. (callchim) ) then
    636                print *, "moyzon_ch=",moyzon_ch," and callchim=",callchim
    637                print *, "Please activate zonal mean to run chemistry !"
    638                stop
    639             endif
    640 
    641         endif ! of ngrid.ne.1
     626         endif
    642627         
    643628         ! XIOS outputs
     
    731716      if (moyzon_ch .or. moyzon_mu) then
    732717         
     718         print *, "------------------------------ </CRITICAL ALERT> -------------------------------"
     719         print *, "WARNING : YOU ARE USING ZONAL MEANS THAT SEEM TO LEAD TO CRASHES (-infinity) ..."
     720         print *, "------------------------------ <CRITICAL ALERT/> -------------------------------"
     721
    733722         zzlaybar(1,:)=(zphibar(1,:)+zphisbar(1))/g
    734723         ! SI ON TIENT COMPTE DE LA VARIATION DE G AVEC L'ALTITUDE:
     
    10781067         if (callchim) then
    10791068
    1080             do iq = 1,nkim
    1081                ychim(:,:,iq) = pq(:,:,iq+nmicro) * rat_mmol(iq+nmicro) ! convert to molar fraction
    1082             enddo
     1069            ! Convert to molar fraction
     1070            if (moyzon_ch) then
     1071              do iq = 1,nkim
     1072                 ychim(:,:,iq) = zqfibar(:,:,iq+nmicro) / rat_mmol(iq+nmicro)
     1073              enddo
     1074            else
     1075              do iq = 1,nkim
     1076                 ychim(:,:,iq) = pq(:,:,iq+nmicro) / rat_mmol(iq+nmicro)
     1077              enddo
     1078            endif
    10831079
    10841080            ! Condensation tendency after the transport
     
    10991095               print *, "We enter in the chemistry ..."
    11001096
    1101                if (ngrid.eq.1) then ! We obviously don't have access to (and don't need) zonal means in 1D
    1102                  call calchim(ngrid,ychim,declin,zls,ctimestep, &
    1103                            pt,pplay,pplev,zzlay,zzlev,dycchi)
    1104                else
    1105                  call calchim(ngrid,ychim,declin,zls,ctimestep, &
    1106                            ztfibar,zplaybar,zplevbar,zzlaybar,zzlevbar,dycchi)
     1097               if (moyzon_ch.and.(ngrid.ne.1)) then ! 2D zonally averaged chemistry !! SEEMS TO CRASH DON'T USE IT !!
     1098                 call calchim(ngrid,ychim,declin,zls,ctimestep,ztfibar,zphibar, &
     1099                              zplaybar,zplevbar,zzlaybar,zzlevbar,dycchi)
     1100               else ! 3D chemistry (or 1D run)
     1101                 call calchim(ngrid,ychim,declin,zls,ctimestep,pt,pphi, &
     1102                              pplay,pplev,zzlay,zzlev,dycchi)
    11071103               endif
    11081104
     
    11151111            ! We convert tendencies to mass mixing ratio
    11161112            do iq=1,nkim
    1117                zdqchi(:,:,iq+nmicro)  = dycchi(:,:,iq)  / rat_mmol(iq+nmicro)
    1118                zdqcond(:,:,iq+nmicro) = dyccond(:,:,iq+nmicro) / rat_mmol(iq+nmicro)
     1113               zdqchi(:,:,iq+nmicro)  = dycchi(:,:,iq) * rat_mmol(iq+nmicro)
     1114               zdqcond(:,:,iq+nmicro) = dyccond(:,:,iq+nmicro) * rat_mmol(iq+nmicro)
    11191115            enddo
    11201116
     
    11311127         if (callmufi) then
    11321128#ifdef USE_QTEST
    1133                if (ngrid.eq.1) then ! We obviously don't have access to (and don't need) zonal means in 1D
    1134                   call calmufi(ptimestep,pplev,zzlev,pplay,zzlay,pt,tpq,zdqmufi)
    1135                else
    1136                   call calmufi(ptimestep,zplevbar,zzlevbar,zplaybar,zzlaybar,ztfibar,tpq,zdqmufi)
    1137                endif
    1138                tpq(:,:,:) = tpq(:,:,:) + zdqmufi(1:ngrid,1:nlayer,1:nq)*ptimestep ! only manipulation of tpq->*ptimesep here
     1129               call calmufi(ptimestep,pplev,zzlev,pplay,zzlay,pt,tpq,zdqmufi)
     1130               tpq(:,:,:) = tpq(:,:,:) + zdqmufi(:,:,:)*ptimestep ! only manipulation of tpq->*ptimesep here
    11391131#else
    11401132            ! Inside this routine we will split 2D->1D, intensive->extensive and separate different types of tracers
    11411133            ! Should be put in phytrac
    11421134
    1143                if (ngrid.eq.1) then ! We obviously don't have access to (and don't need) zonal means in 1D
     1135               if (moyzon_mu.and.(ngrid.ne.1)) then ! 2D zonally averaged microphysics !! SEEMS TO CRASH DON'T USE IT !!
     1136                  call calmufi(ptimestep,zplevbar,zzlevbar,zplaybar,zzlaybar,ztfibar,zqfibar,zdqmufi)
     1137               else ! 3D microphysics (or 1D run)
    11441138                  call calmufi(ptimestep,pplev,zzlev,pplay,zzlay,pt,pq,zdqmufi)
    1145                else
    1146                   call calmufi(ptimestep,zplevbar,zzlevbar,zplaybar,zzlaybar,ztfibar,pq,zdqmufi)
    11471139               endif
    11481140
Note: See TracChangeset for help on using the changeset viewer.