Ignore:
Timestamp:
Feb 4, 2022, 3:23:49 PM (3 years ago)
Author:
acozic
Message:

modification to run with INCA :
1- modify deallocate for an array use after
2- change definition for allocate component for each tracer
3- modify definition of isInPhysics (H2O in INCA need to be in Physic)
4- modify test to check calcul of nqttotr

File:
1 edited

Legend:

Unmodified
Added
Removed
  • LMDZ6/trunk/libf/dyn3d_common/infotrac.F90

    r4073 r4077  
    311311       pbl_flg = [(  1,        ic=1, nqCO2), pbl_flg_inca]
    312312       solsym  = [('CO2     ', ic=1, nqCO2), solsym_inca]
    313       DEALLOCATE(conv_flg_inca, pbl_flg_inca,solsym_inca)
     313      DEALLOCATE(conv_flg_inca, pbl_flg_inca)
    314314#endif
    315315   ELSE
     
    356356      CALL msg('tnom_transp(iq)=<'//TRIM(tnom_transp(iq))//'>', modname)
    357357   END DO
     358   DEALLOCATE(solsym_inca)
    358359
    359360   CLOSE(90)
     
    378379   tracers(:)%phase     = 'g'
    379380   tracers(:)%component = type_trac
     381
     382
    380383   DO iq = 1, nqtrue
    381       IF(lINCA) tracers(iq)%component = 'lmdz'
    382       ip = strIdx([('H2O'//old_phases(ix:ix), ix=1, nphases)], strHead(tracers(iq)%name,'_'))
     384      ip = strIdx([(addPhase('H2O',old_phases(ix:ix),''), ix=1, nphases)], strHead(tracers(iq)%name,'_',.TRUE.))
    383385      IF(ip == 0) CYCLE
    384386      tracers(iq)%phase = known_phases(ip:ip)
     387      tracers(iq)%component = 'lmdz'
    385388   END DO
    386389   IF(lINCA) tracers(1+nqo:nqCO2+nqo)%component = 'co2i'
     
    517520      t1%iadv       = iad
    518521      t1%isAdvected = iad >= 0
    519       t1%isInPhysics= delPhase(t1%gen0Name) /= 'H2O'  !=== TO BE COMPLETED WITH OTHER EXCEPTIONS: CO2i, SURSATURATED CLOUDS...
     522      t1%isInPhysics= .not. (delPhase(t1%gen0Name) == 'H2O' .and. t1%component=='lmdz')  !=== TO BE COMPLETED WITH OTHER EXCEPTIONS: CO2i, SURSATURATED CLOUDS...
    520523      ttr(iq)       = t1
    521524
     
    577580   CALL msg('704: nqtottr, nqtot, nqo = '//strStack(int2str([nqtottr, nqtot, nqo])), modname)
    578581   ! Rq: nqtottr n'est pas forcement egal a nbtr dans le cas ou nmom/=0
    579    IF(COUNT(tracers%iso_iName == 0 .AND. delPhase(tracers(:)%name)/='H2O') /= nqtottr) &
     582   IF(COUNT(tracers%iso_iName == 0) - COUNT(delPhase(tracers(:)%name) == 'H2O' .AND. tracers(:)%component=='lmdz') /= nqtottr) &
    580583      CALL abort_gcm('infotrac_init', 'pb dans le calcul de nqtottr', 1)
    581584
     
    668671      iqfils(tracers(ipere)%nqChilds,ipere) = iq
    669672   END DO
     673
    670674   CALL msg('nqGen0   = '//int2str(COUNT(tracers(:)%parent == 'air')), modname)
    671675   CALL msg('nqChilds = '//strStack(int2str(tracers(:)%nqChilds)),     modname)
    672676   CALL msg('iqParent = '//strStack(int2str(tracers(:)%iqParent)),     modname)
    673677   CALL msg('iqChilds = '//strStack(int2str(PACK(iqfils,MASK=.TRUE.))),modname)
     678
    674679
    675680   !=== SET FIELDS %iGeneration, %iqDescen, %nqDescen
     
    694699   CALL msg('nqDescen_tot = ' //TRIM(int2str(SUM(tracers(:)%nqDescen))), modname)
    695700   CALL msg('iqChilds = '//strStack(int2str(PACK(iqfils, MASK=.TRUE.))), modname)
     701
    696702
    697703END SUBROUTINE infotrac_setHeredity
Note: See TracChangeset for help on using the changeset viewer.