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

File:
1 edited

Legend:

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

    r1903 r1904  
    7777      ENDDO
    7878      ! mass -> molar mixing ratio to be comparable to ykim_up later
    79       avg_qtop(ichem,:)=avg_qtop(ichem,:)*rat_mmol(chimi_indx(ichem))
     79      avg_qtop(ichem,:)=avg_qtop(ichem,:)/rat_mmol(chimi_indx(ichem))
    8080    ENDDO
     81
     82  avg_qtop(:,:) = avg_qtop(:,:) / real(iim)
    8183
    8284  ENDIF
     
    150152        ! so we deal with mono-gridpoints for North and South Poles   
    151153
    152         q(:,1,ilay,chimi_indx(ichem)) = (1.0-coef)*ykim_up(ichem,1,1)/rat_mmol(chimi_indx(ichem)) &
     154        q(:,1,ilay,chimi_indx(ichem)) = (1.0-coef)*ykim_up(ichem,1,1)*rat_mmol(chimi_indx(ichem)) &
    153155                                      + coef*q(:,1,isup,chimi_indx(ichem))
    154         q(:,jjm+1,ilay,chimi_indx(ichem)) = (1.0-coef)*ykim_up(ichem,ngridmx,1)/rat_mmol(chimi_indx(ichem)) &
     156        q(:,jjm+1,ilay,chimi_indx(ichem)) = (1.0-coef)*ykim_up(ichem,ngridmx,1)*rat_mmol(chimi_indx(ichem)) &
    155157                                          + coef*q(:,jjm+1,isup,chimi_indx(ichem))
    156158
     
    161163            DO ilon=2,iim
    162164              ! ykim_up and q are shifted one to the other on longitudinal grid
    163               ykimlon = 0.5*(ykim_up(ichem,ng0+ilon-1,1)+ykim_up(ichem,ng0+ilon,1)) / rat_mmol(chimi_indx(ichem))
     165              ykimlon = 0.5*(ykim_up(ichem,ng0+ilon-1,1)+ykim_up(ichem,ng0+ilon,1)) * rat_mmol(chimi_indx(ichem))
    164166
    165167              q(ilon,ilat,ilay,chimi_indx(ichem)) = (1.0-coef)*ykimlon + coef*q(ilon,ilat,isup,chimi_indx(ichem))
     
    168170            ! Periodicity on longitude at 180 and -180
    169171
    170             ykimlon = 0.5*(ykim_up(ichem,ng0+1,1)+ykim_up(ichem,ng0+iim,1)) / rat_mmol(chimi_indx(ichem))
     172            ykimlon = 0.5*(ykim_up(ichem,ng0+1,1)+ykim_up(ichem,ng0+iim,1)) * rat_mmol(chimi_indx(ichem))
    171173
    172174            q(1,ilat,ilay,chimi_indx(ichem)) = (1.0-coef)*ykimlon + coef*q(1,ilat,isup,chimi_indx(ichem))
Note: See TracChangeset for help on using the changeset viewer.