Changeset 2785
- Timestamp:
- Aug 3, 2022, 5:07:41 PM (2 years ago)
- Location:
- trunk
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ICOSA_LMDZ/src/phystd/interface_icosa_lmdz.f90
r2556 r2785 37 37 INTEGER,SAVE :: nbp_phys_glo 38 38 39 CHARACTER(len=30),SAVE,ALLOCATABLE :: tname(:) ! tracer names40 39 REAL,SAVE :: pday ! number of ellapsed sols since Ls=0 41 40 REAL,SAVE :: ptime ! "universal time" as fraction of sol (e.g. 0.5 for noon) … … 204 203 205 204 206 ! INTEGER :: nqo, nbtr207 205 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 214 207 TYPE(t_field),POINTER,SAVE :: f_ind_cell_glo(:) 215 208 216 209 INTEGER :: iflag_phys 217 210 INTEGER :: nq 211 character(len=500) :: tracline ! to read traceur.def file 218 212 219 213 !! to get starting date … … 285 279 CALL getin('type_trac',type_trac) 286 280 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 302 284 IF (is_mpi_root) THEN 303 285 !$OMP MASTER 304 286 OPEN(unit=42,file="traceur.def",form="formatted",status="old",iostat=ierr) 305 287 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') 307 302 IF (nq /= nqtot) THEN 308 303 WRITE(*,*) "Error: number of tracers in tracer.def should match nqtot!" 309 304 WRITE(*,*) " will just use nqtot=",nqtot," tracers" 310 305 ENDIF 311 DO i=1,nqtot312 READ(42,*) tname(i)313 ENDDO314 306 CLOSE(42) 315 ENDIF 307 ENDIF !ierr==0 (1st one) 316 308 !$OMP END MASTER 317 309 !$OMP BARRIER 318 310 ENDIF ! of (is_mpi_root) 319 311 320 DO i=1,nqtot 321 CALL bcast(tname(i)) 322 ENDDO 312 323 313 324 314 ! CALL init_infotrac_phy(nqtot,nqo,nbtr,tname,ttext,type_trac,& … … 627 617 !$OMP BARRIER 628 618 CALL physiq(klon_omp, llm, nqtot, & 629 tname, &630 619 debut, lafin, & 631 620 pday, ptime, dtphy, & -
trunk/LMDZ.GENERIC/README
r2784 r2785 1729 1729 - remove top level obsolete "patch_large_domains" directory 1730 1730 - remove unused "watercaptag" field in the physics. 1731 1732 == 03/08/2022 == LT + EM 1733 Further seperation between dynamics and physics concerning tracers: 1734 Tracer names are extracted from traceur.def via initracer.F90 and no 1735 longer transfered from the dynamics to the physics -
trunk/LMDZ.GENERIC/libf/dynphy_lonlat/phystd/callphysiq_mod.F90
r1576 r2785 70 70 llm, & ! nlayer 71 71 nqtot, & ! nq 72 tname, & ! nametrac73 72 debut_split, & ! firstcall 74 73 lafin_split, & ! lastcall -
trunk/LMDZ.GENERIC/libf/dynphy_lonlat/phystd/newstart.F
r2354 r2785 285 285 ! Initialize global tracer indexes (stored in tracer.h) 286 286 ! ... this has to be done before phyetat0 287 call initracer(ngridmx,nqtot,tname) 287 ! and requires that "datadir" be correctly initialized 288 call getin_p("datadir",datadir) 289 call initracer(ngridmx,nqtot) 288 290 289 291 ! Initialize dimphy module (klon,klev,..) -
trunk/LMDZ.GENERIC/libf/dynphy_lonlat/phystd/start2archive.F
r2354 r2785 236 236 237 237 ! Initialize tracer names, indexes and properties 238 CALL initracer(ngridmx,nqtot ,tname)238 CALL initracer(ngridmx,nqtot) 239 239 240 240 CALL phyetat0(.true.,ngridmx,llm,fichnom,0,Lmodif,nsoilmx,nqtot, -
trunk/LMDZ.GENERIC/libf/phystd/dyn1d/kcm1d.F90
r2635 r2785 210 210 endif 211 211 212 call initracer(1,nq ,nametrac)212 call initracer(1,nq) 213 213 214 214 endif -
trunk/LMDZ.GENERIC/libf/phystd/dyn1d/rcm1d.F
r2784 r2785 693 693 & form="formatted",iostat=ierr) 694 694 if (ierr .eq. 0) then 695 read(91,*) ,qsurf(iq)695 read(91,*)qsurf(iq) 696 696 do ilayer=1,nlayer 697 697 read(91,*)q(ilayer,iq) … … 929 929 #ifndef MESOSCALE 930 930 if(tracer.and.photochem) then 931 call initracer(1,nq ,tname)931 call initracer(1,nq) 932 932 allocate(nametmp(nq)) 933 933 nametmp(1:nq)=tname(1:nq) … … 1005 1005 1006 1006 CALL physiq (1,llm,nq, 1007 . tname,1008 1007 , firstcall,lastcall, 1009 1008 , day,time,dtphys, -
trunk/LMDZ.GENERIC/libf/phystd/initracer.F90
r2784 r2785 1 SUBROUTINE initracer(ngrid,nq ,nametrac)1 SUBROUTINE initracer(ngrid,nq) 2 2 3 3 use surfdat_h, ONLY: dryness … … 24 24 ! Ehouarn Millour (oct. 2008) identify tracers by their names 25 25 ! Y Jaziri & J. Vatant d'Ollone (2020) : Modern traceur.def 26 ! L Teinturier (2022): Tracer names are now read here instead of 27 ! inside interfaces 26 28 !======================================================================= 27 29 28 30 integer,intent(in) :: ngrid,nq 29 character(len=30),intent(in) :: nametrac(nq) ! name of the tracer from dynamics30 31 31 32 character(len=500) :: tracline ! to read traceur.def lines 32 33 ! character(len=30) :: txt ! to store some text 34 integer :: blank !to store the index of 1st blank when reading tracers names 33 35 integer iq,ig,count,ierr 34 36 … … 158 160 159 161 160 ! Initialization: copy tracer names from dynamics 161 do iq=1,nq 162 noms(iq)=nametrac(iq) 163 write(*,*)"initracer: iq=",iq,"noms(iq)=",trim(noms(iq)) 162 ! Initialization: Read tracers names from traceur.def 163 do iq=1,nq 164 if (is_master) read(407,'(A)') tracline 165 call bcast(tracline) 166 blank = index(tracline,' ') ! Find position of 1st blank in tracline 167 noms(iq) = tracline(1:blank) !ensure that in Modern-trac case, noms is actually the name and not all properties 164 168 enddo 165 166 169 167 170 ! Identify tracers by their names: (and set corresponding values of mmol) … … 442 445 endif 443 446 444 ! Get data of tracers 447 ! Get data of tracers. Need to rewind traceur.def first 448 if (is_master) then 449 rewind(407) 450 do 451 read(407,'(A)') tracline 452 if (index(tracline,"#") .ne. 1) then 453 exit 454 endif 455 enddo 456 endif 445 457 do iq=1,nqtot 446 458 if (is_master) read(407,'(A)') tracline -
trunk/LMDZ.GENERIC/libf/phystd/physiq_mod.F90
r2784 r2785 6 6 7 7 subroutine physiq(ngrid,nlayer,nq, & 8 nametrac, &9 8 firstcall,lastcall, & 10 9 pday,ptime,ptimestep, & … … 151 150 ! nlayer Number of vertical layers. 152 151 ! nq Number of advected fields. 153 ! nametrac Name of corresponding advected fields.154 152 ! 155 153 ! firstcall True at the first call. … … 221 219 integer,intent(in) :: nlayer ! Number of atmospheric layers. 222 220 integer,intent(in) :: nq ! Number of tracers. 223 character*30,intent(in) :: nametrac(nq) ! Names of the tracers taken from dynamics.224 221 225 222 logical,intent(in) :: firstcall ! Signals first call to physics. … … 508 505 IF (.NOT.ALLOCATED(noms)) ALLOCATE(noms(nq)) ! (because noms is an argument of physdem1 whether or not tracer is on) 509 506 if (tracer) then 510 call initracer(ngrid,nq ,nametrac)507 call initracer(ngrid,nq) 511 508 if(photochem) then 512 509 call ini_conc_mod(ngrid,nlayer) -
trunk/LMDZ.GENERIC/libf/phystd/tracer_h.F90
r2725 r2785 7 7 integer, save :: nesp ! number of species in the chemistry 8 8 integer, save :: ngt ! number of generic tracers 9 !$OMP THREADPRIVATE(nqtot,nesp )9 !$OMP THREADPRIVATE(nqtot,nesp,ngt) 10 10 11 11 logical :: moderntracdef=.false. ! Standard or modern traceur.def … … 41 41 !$OMP THREADPRIVATE(is_recomb,is_recomb_qset,is_recomb_qotf) 42 42 integer, save, allocatable :: is_condensable(:) ! 1 if tracer is generic, else 0 (added LT) 43 !$OMP THREADPRIVATE(is_condensable) !also added by LT 43 44 44 45 ! Lists of constants for condensable tracers … … 50 51 integer, save, allocatable :: constants_RLVTT_generic(:) ! Latent heat of vaporization (J/kg) 51 52 integer, save, allocatable :: constants_metallicity_coeff(:) ! Coefficient to take into account the metallicity 53 !$OMP THREADPRIVATE(constants_mass,constants_delta_vapH,constants_Tref) 54 !$OMP THREADPRIVATE(constants_Pref,constants_epsi_generic) 55 !$OMP THREADPRIVATE(constants_RLVTT_generic,constants_metallicity_coeff) 52 56 53 !$OMP THREADPRIVATE(is_condensable) !also added by LT54 57 ! tracer indexes: these are initialized in initracer and should be 0 if the 55 58 ! corresponding tracer does not exist
Note: See TracChangeset
for help on using the changeset viewer.