Changeset 2785 for trunk/ICOSA_LMDZ


Ignore:
Timestamp:
Aug 3, 2022, 5:07:41 PM (2 years ago)
Author:
emillour
Message:

Generic PCM:
Further seperation between dynamics and physics concerning tracers:
Tracer names are extracted from traceur.def via initracer.F90 and no
longer transfered from the dynamics to the physics
LT+EM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ICOSA_LMDZ/src/phystd/interface_icosa_lmdz.f90

    r2556 r2785  
    3737  INTEGER,SAVE :: nbp_phys_glo
    3838 
    39   CHARACTER(len=30),SAVE,ALLOCATABLE :: tname(:) ! tracer names
    4039  REAL,SAVE :: pday ! number of ellapsed sols since Ls=0
    4140  REAL,SAVE :: ptime ! "universal time" as fraction of sol (e.g. 0.5 for noon)
     
    204203
    205204
    206 !  INTEGER                       :: nqo, nbtr
    207205  CHARACTER(len=4)              :: type_trac
    208 !  CHARACTER(len=20),ALLOCATABLE :: tname(:)    ! tracer short name for restart and diagnostics
    209 !  CHARACTER(len=23),ALLOCATABLE :: ttext(:)     ! tracer long name for diagnostics
    210 !  INTEGER,ALLOCATABLE           :: niadv(:)    ! equivalent dyn / physique
    211 !  INTEGER,ALLOCATABLE           :: conv_flg(:) ! conv_flg(it)=0 : convection desactivated for tracer number it
    212 !  INTEGER,ALLOCATABLE           :: pbl_flg(:)  ! pbl_flg(it)=0  : boundary layer diffusion desactivaded for tracer number it
    213 !  CHARACTER(len=8),ALLOCATABLE  :: solsym(:)  ! tracer name from inca
     206
    214207  TYPE(t_field),POINTER,SAVE    :: f_ind_cell_glo(:)
    215208 
    216209  INTEGER :: iflag_phys   
    217210  INTEGER :: nq
     211  character(len=500) :: tracline ! to read traceur.def file
    218212
    219213  !! to get starting date
     
    285279     CALL getin('type_trac',type_trac)
    286280
    287 ! init model for standard lmdz case
    288 !    nqo=2
    289 !    nbtr=2
    290 !$OMP MASTER
    291     ALLOCATE(tname(nqtot))
    292 !$OMP END MASTER
    293 !$OMP BARRIER
    294 !    ALLOCATE(ttext(nqtot))
    295 !    ALLOCATE(niadv(nqtot))
    296 !    ALLOCATE(conv_flg(nbtr))
    297 !    ALLOCATE(pbl_flg(nbtr))
    298 !    ALLOCATE(solsym(nbtr))
    299    
    300 
    301 ! read tname() from traceur.def file
     281   
     282! read nq from traceur.def file
     283! We allow to read the Modern-trac-V1 as well to get nqtot
    302284    IF (is_mpi_root) THEN
    303285!$OMP MASTER
    304286    OPEN(unit=42,file="traceur.def",form="formatted",status="old",iostat=ierr)
    305287    IF (ierr==0) THEN
    306       READ(42,*) nq ! should be the same as nqtot
     288      READ(42,*) tracline
     289      if (trim(tracline) .ne. '#ModernTrac-v1') then !checking if we're using Modern-Trac or not
     290        read(tracline,*) nq !should be equal to nqtot
     291      else
     292        do !loop on lines until we find uncommented lines
     293          read(42,'(A)',iostat=ierr) tracline
     294          if (ierr==0) then
     295            if (index(tracline,"#") .ne. 1) then ! Allow for arbitrary number of commented lines in header
     296              read(tracline,*) nq !should be equal to nqtot
     297              exit
     298            endif  !index(tracline,"#") .ne. 1
     299          endif !ierr=0
     300        enddo
     301      endif !(trim(tracline) .ne. '#ModernTrac-v1')
    307302      IF (nq /= nqtot) THEN
    308303        WRITE(*,*) "Error: number of tracers in tracer.def should match nqtot!"
    309304        WRITE(*,*) "       will just use nqtot=",nqtot," tracers"
    310305      ENDIF
    311       DO i=1,nqtot
    312         READ(42,*) tname(i)
    313       ENDDO
    314306      CLOSE(42)
    315     ENDIF
     307    ENDIF !ierr==0 (1st one)
    316308!$OMP END MASTER
    317309!$OMP BARRIER
    318310    ENDIF ! of (is_mpi_root)
    319311
    320     DO i=1,nqtot
    321       CALL bcast(tname(i))
    322     ENDDO
     312
    323313
    324314!    CALL init_infotrac_phy(nqtot,nqo,nbtr,tname,ttext,type_trac,&
     
    627617!$OMP BARRIER   
    628618    CALL physiq(klon_omp, llm, nqtot, &
    629                 tname, &
    630619                debut, lafin, &
    631620                pday, ptime, dtphy, &
Note: See TracChangeset for help on using the changeset viewer.