Ignore:
Timestamp:
Jan 29, 2018, 11:41:36 PM (7 years ago)
Author:
jvatant
Message:

+ Generalize the use of nkim parameter in comchem_h instead
of having x=44 hardcoded everywhere in the code.
If ever one day we have nkim!=44 it will be useful !
+ Also add the other parameters for the chem. in comchem_h
+ Some rearrangment in physiq_mod of chemistry variables

-> especially less unsane "nq-nmicro" -> nkim instead.

+ In calchim, preliminary modifs to adapt to the new managment
of i/o chemistry implemented in last commits.
--JVO

Location:
trunk/LMDZ.TITAN/libf/dynphy_lonlat/phytitan
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.TITAN/libf/dynphy_lonlat/phytitan/lect_start_archive.F

    r1898 r1903  
    55
    66!      USE surfdat_h
    7       USE comchem_h, only : cnames
     7      USE comchem_h, only : cnames, nkim
    88      USE comchem_newstart_h
    99      USE comsoil_h, ONLY: nsoilmx, layer, mlayer, volcapa, inertiedat
     
    305305     
    306306      allocate(preskimold(nlaykimold))
    307       allocate(ykim_upS(44,iip1,jjp1,nlaykimold))
    308       allocate(ykim_upoldS(44,imold+1,jmold+1,nlaykimold))
    309       allocate(ykim_up_oldv(44,ngrid,nlaykimold))
     307      allocate(ykim_upS(nkim,iip1,jjp1,nlaykimold))
     308      allocate(ykim_upoldS(nkim,imold+1,jmold+1,nlaykimold))
     309      allocate(ykim_up_oldv(nkim,ngrid,nlaykimold))
    310310
    311311      allocate(var (imold+1,jmold+1,llm))
     
    879879                   
    880880          ! Then read all the others by their name if needed
    881           DO iq=2,44
     881          DO iq=2,nkim
    882882            ierr=NF_INQ_VARID(nid,trim(cnames(iq))//"_up",nvarid)
    883883            IF (ierr .NE. NF_NOERR) THEN
     
    12481248
    12491249      ! Do the horizontal interpolation
    1250       DO i=1,44
     1250      DO i=1,nkim
    12511251        call interp_horiz(ykim_upoldS(i,:,:,:),ykim_upS(i,:,:,:),
    12521252     &                  imold,jmold,iim,jjm,nlaykimold,
  • trunk/LMDZ.TITAN/libf/dynphy_lonlat/phytitan/newstart.F

    r1898 r1903  
    1717     &                              is_master
    1818      use infotrac, only: infotrac_init, nqtot, tname
    19       USE comchem_h, ONLY: nlaykim_up, ykim_up
     19      USE comchem_h, ONLY: nkim, nlaykim_up, ykim_up
    2020      USE comchem_newstart_h
    2121      USE comsoil_h, ONLY: nsoilmx, layer, mlayer, inertiedat
     
    10911091           
    10921092          IF (.NOT.allocated(ykim_up)) THEN
    1093             ALLOCATE(ykim_up(44,ngridmx,nlaykim_up))
     1093            ALLOCATE(ykim_up(nkim,ngridmx,nlaykim_up))
    10941094          ENDIF
    10951095         
     
    11001100
    11011101            WRITE(*,*) " Warning, nlaykimold=", nlaykimold
    1102             WRITE(*,*) ' which implies that a vertical regrid on upper
     1102            WRITE(*,*) '  which implies that a vertical regrid on upper
    11031103     &chemistry fields will be performed. If the ceiling is lowered I
    1104      & will also adjust GCM uppermost layers chem. tracers.'
     1104     &will also adjust GCM uppermost layers chem. tracers.'
    11051105            WRITE(*,*)
    11061106         
  • trunk/LMDZ.TITAN/libf/dynphy_lonlat/phytitan/start2archive.F

    r1899 r1903  
    2121      use infotrac, only: infotrac_init, nqtot, tname
    2222      USE comsoil_h
    23       USE comchem_h, only : cnames, nlaykim_up, preskim, ykim_up
     23      USE comchem_h, only : cnames, nkim, nlaykim_up, preskim, ykim_up
    2424!      USE comgeomfi_h, ONLY: lati, long, area
    2525!      use control_mod
     
    234234     . I presume they're all here as you can't do uncomplete chemistry!"
    235235     
    236         ALLOCATE(ykim_up(44,ngridmx,nlaykim_up))
    237         ALLOCATE(ykim_upS(44,ip1jmp1,nlaykim_up))
     236        ALLOCATE(ykim_up(nkim,ngridmx,nlaykim_up))
     237        ALLOCATE(ykim_upS(nkim,ip1jmp1,nlaykim_up))
    238238       
    239239        kim=.TRUE.
     
    358358c qsurf --> qsurfS
    359359c tankCH4 --> tankCH4S
    360 c ykim_up --> ykim_upS ( 44 upper chemistry fields )
     360c ykim_up --> ykim_upS ( nkim=44 upper chemistry fields )
    361361c
    362362c-----------------------------------------------------------------------
     
    372372
    373373      IF (kim) THEN ! NB : fields are in comchem_startarch_h
    374          DO iq=1,44
     374         DO iq=1,nkim
    375375           call gr_fi_dyn(nlaykim_up,ngridmx,iip1,jjp1,ykim_up(iq,:,:),
    376376     &                                                 ykim_upS(iq,:,:))
     
    523523c-----------------------------------------------------------------
    524524c Ecriture des champs upper_chemistry
    525 c NB : We assume a given order of the 44 chemistry tracers !
    526 c ( H=1, H2=2 ..., C4N2=44) -> hardcoded in comchem_h.
     525c NB : We assume a given order of the nkim=44 chemistry tracers !
     526c ( H=1, H2=2 ..., C4N2=nkim=44) -> hardcoded in comchem_h.
    527527c-----------------------------------------------------------------
    528528
    529529      IF (kim) THEN
    530         DO iq=1,44
     530        DO iq=1,nkim
    531531          call write_archive(nid,ntime,trim(cnames(iq))//'_up',
    532532     .                trim(cnames(iq))//' in upper atmosphere',
  • trunk/LMDZ.TITAN/libf/dynphy_lonlat/phytitan/vert_regrid_kim.F90

    r1900 r1903  
    1616  ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    1717
    18   USE comchem_h, ONLY: cnames, nlaykim_up, preskim, ykim_up
     18  USE comchem_h, ONLY: nkim, nlaykim_up, preskim, ykim_up
    1919  USE comchem_newstart_h
    2020  USE tracer_h
     
    6464    lowered = .TRUE.
    6565
    66     ALLOCATE(avg_qtop(44,ngridmx))
     66    ALLOCATE(avg_qtop(nkim,ngridmx))
    6767
    68     DO ichem=1,44
     68    DO ichem=1,nkim
    6969      avg_qtop(ichem,:)=0.0
    7070      DO ilon=1,iim
     
    111111
    112112      IF ( preskim(ln) .GT. preskimold(1) ) THEN
    113           DO ichem=1,44
     113          DO ichem=1,nkim
    114114            coef = ( preskim(ln)-aps(llm) ) / ( preskimold(1)-aps(llm) )
    115115            ykim_up(ichem,:,ln) = (1.0-coef)*avg_qtop(ichem,:) + coef*ykim_up_oldv(ichem,:,1)
     
    145145      coef = ( aps(ilay) - preskim(1) ) / ( aps(isup) - preskim(1) )
    146146
    147       DO ichem=1,44
     147      DO ichem=1,nkim
    148148
    149149        ! We need to convert ykim_up on phys grid to q on dyn grid
     
    174174
    175175          ENDDO ! do ilat=2,jjm
    176       ENDDO ! do ichem=1,44
     176      ENDDO ! do ichem=1,nkim
    177177    ENDDO ! do ilay=1,llm
    178178
Note: See TracChangeset for help on using the changeset viewer.