Ignore:
Timestamp:
May 19, 2014, 10:22:08 AM (11 years ago)
Author:
emillour
Message:

Generic model:
Some cleanup on the no tracer case for the 1D model rcm1d.
EM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.GENERIC/libf/phystd/rcm1d.F

    r1216 r1267  
    249249            allocate(dqdyn(nlayermx,nq))
    250250          else
    251             allocate(tname(1)) ! tname(1) is used below, even if nq=0
     251            write(*,*) "rcm1d: Error. You set tracer=.true."
     252            write(*,*) "       but # of tracers in traceur.def is ",nq
     253            stop
    252254          endif
    253255       
     
    273275           endif
    274276         enddo
    275          !if (i_co2_ice==0) then
    276          !  write(*,*) "rcm1d: error, we need a 'co2_ice' tracer"
    277          !  write(*,*) "   (add one to traceur.def)"
    278          !  stop
    279          !endif
    280277        else
    281278          write(*,*) 'Cannot find required file "traceur.def"'
     
    286283        close(90)
    287284
    288       else
    289        nq=nqtot
    290        if (nq>0) then
    291             allocate(tname(nq))
    292             allocate(q(nlayermx,nq))
    293             allocate(qsurf(nq))
    294             allocate(dq(nlayermx,nq))
    295             allocate(dqdyn(nlayermx,nq))
    296         else
    297             allocate(tname(1)) ! tname(1) is used below, even if nq=0
    298         endif
     285      else ! of if (tracer)
     286        nqtot=0
     287        nq=0
     288        ! still, make allocations for 1 dummy tracer
     289        allocate(tname(1))
     290        allocate(qsurf(1))
     291        allocate(q(nlayermx,1))
     292        allocate(dq(nlayermx,1))
     293     
    299294       ! Check that tracer boolean is compliant with number of tracers
    300295       ! -- otherwise there is an error (and more generally we have to be consistent)
    301        if (.not.tracer .and. nq .ge. 1) then
     296       if (nq .ge. 1) then
    302297          write(*,*) "------------------------------"
    303298          write(*,*) "rcm1d: You set tracer=.false."
    304           write(*,*) " But compiled with 1 tracer or more"
     299          write(*,*) " But set number of tracers to ",nq
    305300          write(*,*) " > If you want tracers, set tracer=.true."
    306           write(*,*) " > If you do not want tracers, compile with -t 0"
    307301          write(*,*) "------------------------------"
    308302          stop
    309303       endif
    310        ! we still need to set (dummy) tracer names for physdem1
    311         do iq=1,nq
    312           write(str7,'(a1,i2.2)')'q',iq
    313           tname(iq)=str7
    314         enddo
    315         ! actually, we'll need at least one "co2_ice" tracer
    316         ! (for surface CO2 ice)
    317         i_co2_ice=1
    318         tname(i_co2_ice)="co2_ice"
    319304      endif ! of if (tracer)
    320305
Note: See TracChangeset for help on using the changeset viewer.