Changeset 3870 for LMDZ6/trunk/libf/dyn3d_common
- Timestamp:
- Apr 8, 2021, 10:58:58 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ6/trunk/libf/dyn3d_common/infotrac.F90
r3869 r3870 15 15 INTEGER, SAVE :: nqperes 16 16 17 ! ThL: nb traceurs spécifiques àINCA17 ! ThL: nb traceurs INCA 18 18 INTEGER, SAVE :: nqINCA 19 20 ! ThL: nb traceurs CO2 21 INTEGER, SAVE :: nqCO2 19 22 20 23 ! Name variables … … 45 48 CHARACTER(len=4),SAVE :: type_trac 46 49 CHARACTER(len=8),DIMENSION(:),ALLOCATABLE, SAVE :: solsym 47 50 48 51 ! CRisi: cas particulier des isotopes 49 52 LOGICAL,SAVE :: ok_isotopes,ok_iso_verif,ok_isotrac,ok_init_iso … … 107 110 INTEGER, ALLOCATABLE, DIMENSION(:) :: vadv_inca ! index of vertical trasport schema 108 111 112 INTEGER, ALLOCATABLE, DIMENSION(:) :: conv_flg_inca 113 INTEGER, ALLOCATABLE, DIMENSION(:) :: pbl_flg_inca 114 CHARACTER(len=8), ALLOCATABLE, DIMENSION(:) :: solsym_inca 115 109 116 CHARACTER(len=15), ALLOCATABLE, DIMENSION(:) :: tnom_0 ! tracer short name 110 117 CHARACTER(len=15), ALLOCATABLE, DIMENSION(:) :: tnom_transp ! transporting fluid short name: CRisi … … 123 130 character(len=*),parameter :: modname="infotrac_init" 124 131 125 INTEGER :: nqexcl ! ThL. Nb de traceurs dans traceur.def. Egal à nqtrue,126 ! sauf pour 'inca' = nqtrue-nbtr, et 'inco' = 4.127 132 !----------------------------------------------------------------------- 128 133 ! Initialization : … … 199 204 !----------------------------------------------------------------------- 200 205 IF (type_trac == 'lmdz' .OR. type_trac == 'repr' .OR. type_trac == 'coag' .OR. type_trac == 'co2i') THEN 206 IF (type_trac=='co2i') THEN ! ModThL 207 nqCO2 = 1 208 ELSE 209 nqCO2 = 0 210 ENDIF 201 211 OPEN(90,file='traceur.def',form='formatted',status='old', iostat=ierr) 202 212 IF(ierr.EQ.0) THEN … … 213 223 ENDIF 214 224 ENDIF 215 nqexcl=nqtrue216 225 !jyg< 217 226 !! if ( planet_type=='earth') then … … 224 233 !! endif 225 234 !>jyg 226 ELSE ! type_trac=inca (or inco ThL) 235 ELSE ! type_trac=inca or inco 236 IF (type_trac=='inco') THEN ! ModThL 237 nqCO2 = 1 238 ELSE 239 nqCO2 = 0 240 ENDIF 227 241 !jyg< 228 242 ! The traceur.def file is used to define the number "nqo" of water phases … … 248 262 ! nbtr has been read from INCA by init_const_lmdz() in gcm.F 249 263 #ifdef INCA 250 CALL Init_chem_inca_trac(nbtr) 251 #endif 252 IF (type_trac=='inco') THEN ! Add ThL 253 nqexcl = nqo+1 ! Tracers excluding INCA's = water + CO2 in 'inco' case 254 ELSE 255 nqexcl = nqo ! Tracers excluding INCA's = water 256 ENDIF 257 nqtrue = nbtr + nqexcl ! Total nb of tracers = INCA's + traceur.def 258 IF (type_trac=='inco') THEN ! 259 nqINCA = nbtr ! nbtr = other tracers than H2O = INCA's + CO2i 260 nbtr = nqINCA + 1 ! 261 ELSEIF (type_trac=='inca') THEN ! 262 nqINCA = nbtr ! 263 ELSE ! 264 nqINCA = 0 ! 265 ENDIF ! 264 CALL Init_chem_inca_trac(nqINCA) 265 #else 266 nqINCA=0 267 #endif 268 nbtr=nqINCA+nqCO2 269 266 270 WRITE(lunout,*) trim(modname),': nqo = ',nqo 267 271 WRITE(lunout,*) trim(modname),': nbtr = ',nbtr 268 WRITE(lunout,*) trim(modname),': nqexcl = ',nqexcl269 272 WRITE(lunout,*) trim(modname),': nqtrue = ',nqtrue 270 WRITE(lunout,*) trim(modname),': nq INCA = ',nqINCA271 ALLOCATE(hadv_inca(nqINCA), vadv_inca(nqINCA) ) !ThL272 ENDIF ! type_trac 273 WRITE(lunout,*) trim(modname),': nqCO2 = ',nqCO2 274 ALLOCATE(hadv_inca(nqINCA), vadv_inca(nqINCA), conv_flg_inca(nqINCA), pbl_flg_inca(nqINCA), solsym_inca(nqINCA)) ! Mod ThL 275 ENDIF ! type_trac 'inca' ou 'inco' 273 276 !>jyg 274 277 … … 401 404 WRITE(lunout,*) trim(modname),': Valeur de traceur.def :' 402 405 WRITE(lunout,*) trim(modname),': nombre total de traceurs ',nqtrue 403 WRITE(lunout,*) trim(modname),': nombre de traceurs dans traceur.def ',nqexcl404 406 DO iq=1,nqtrue 405 407 WRITE(lunout,*) hadv(iq),vadv(iq),tnom_0(iq),tnom_transp(iq) … … 477 479 !! ELSE ! type_trac=inca : config_inca='aero' ou 'chem' 478 480 ! 479 IF (type_trac == 'inca' ) THEN ! config_inca='aero' ou 'chem'481 IF (type_trac == 'inca' .OR. type_trac == 'inco') THEN ! config_inca='aero' ou 'chem' 480 482 !>jyg 481 483 ! le module de chimie fournit les noms des traceurs … … 541 543 hadv_inca, & 542 544 vadv_inca, & 543 conv_flg, & 544 pbl_flg, & 545 solsym) 545 conv_flg_inca, & ! ModThL 546 pbl_flg_inca, & ! ModThL 547 solsym_inca) ! ModThL 548 conv_flg(1+nqCO2:nbtr) = conv_flg_inca ! ModThL 549 pbl_flg(1+nqCO2:nbtr) = pbl_flg_inca ! ModThL 550 solsym(1+nqCO2:nbtr) = solsym_inca ! ModThL 551 IF (type_trac == 'inco') THEN ! ModThL 552 conv_flg(1:nqCO2) = 1 ! ModThL 553 pbl_flg(1:nqCO2) = 1 ! ModThL 554 solsym(1:nqCO2) = 'CO2' ! ModThL 555 ENDIF ! ModThL 556 546 557 #endif 547 558 548 549 559 !jyg< 550 DO iq = nqo+ 1, nqtrue551 hadv(iq) = hadv_inca(iq-nqo )552 vadv(iq) = vadv_inca(iq-nqo )553 tnom_0(iq)=solsym(iq-nqo )560 DO iq = nqo+nqCO2+1, nqtrue ! ModThL 561 hadv(iq) = hadv_inca(iq-nqo-nqCO2) ! ModThL 562 vadv(iq) = vadv_inca(iq-nqo-nqCO2) ! ModThL 563 tnom_0(iq)=solsym(iq-nqo-nqCO2) ! ModThL 554 564 tnom_transp(iq) = 'air' 555 565 END DO 556 566 557 END IF ! (type_trac == 'inca') 558 559 !< add ThL case 'inco' 560 IF (type_trac == 'inco') THEN 561 ! le module de chimie fournit les noms des traceurs 562 ! et les schemas d'advection associes. excepte pour ceux lus 563 ! dans traceur.def 564 IF (ierr .eq. 0) then 565 DO iq=1,nqexcl 566 write(*,*) 'infotrac 237: iq=',iq 567 ! CRisi: ajout du nom du fluide transporteur 568 ! mais rester retro compatible 569 READ(90,'(I2,X,I2,X,A)',IOSTAT=IOstatus) hadv(iq),vadv(iq),tchaine 570 write(lunout,*) 'iq,hadv(iq),vadv(iq)=',iq,hadv(iq),vadv(iq) 571 write(lunout,*) 'tchaine=',trim(tchaine) 572 write(*,*) 'infotrac 238: IOstatus=',IOstatus 573 if (IOstatus.ne.0) then 574 CALL abort_gcm('infotrac_init','Pb dans la lecture de traceur.def',1) 575 endif 576 ! Y-a-t-il 1 ou 2 noms de traceurs? -> On regarde s'il y a un 577 ! espace ou pas au milieu de la chaine. 578 continu=.true. 579 nouveau_traceurdef=.false. 580 iiq=1 581 do while (continu) 582 if (tchaine(iiq:iiq).eq.' ') then 583 nouveau_traceurdef=.true. 584 continu=.false. 585 else if (iiq.lt.LEN_TRIM(tchaine)) then 586 iiq=iiq+1 587 else 588 continu=.false. 589 endif 590 enddo 591 write(*,*) 'iiq,nouveau_traceurdef=',iiq,nouveau_traceurdef 592 if (nouveau_traceurdef) then 593 write(lunout,*) 'C''est la nouvelle version de traceur.def' 594 tnom_0(iq)=tchaine(1:iiq-1) 595 tnom_transp(iq)=tchaine(iiq+1:15) 596 else 597 write(lunout,*) 'C''est l''ancienne version de traceur.def' 598 write(lunout,*) 'On suppose que les traceurs sont tous d''air' 599 tnom_0(iq)=tchaine 600 tnom_transp(iq) = 'air' 601 endif 602 write(lunout,*) 'tnom_0(iq)=<',trim(tnom_0(iq)),'>' 603 write(lunout,*) 'tnom_transp(iq)=<',trim(tnom_transp(iq)),'>' 604 END DO !DO iq=1,nqexcl 605 CLOSE(90) 606 ELSE !! if traceur.def doesn't exist 607 tnom_0(1)='H2Ov' 608 tnom_transp(1) = 'air' 609 tnom_0(2)='H2Ol' 610 tnom_transp(2) = 'air' 611 hadv(1) = 10 612 hadv(2) = 10 613 vadv(1) = 10 614 vadv(2) = 10 615 ENDIF 616 617 #ifdef INCA 618 CALL init_transport( & 619 hadv_inca, & 620 vadv_inca, & 621 conv_flg, & 622 pbl_flg, & 623 solsym) 624 #endif 625 626 DO iq = nqexcl+1, nqtrue 627 hadv(iq) = hadv_inca(iq-nqexcl) ! mod. Thl : nqexcl was nqo (in order to shift) 628 vadv(iq) = vadv_inca(iq-nqexcl) ! idem 629 tnom_0(iq)=solsym(iq-nqexcl) ! idem 630 tnom_transp(iq) = 'air' 631 END DO 632 633 END IF ! (type_trac == 'inco') 634 !> add ThL case 'inco' 567 END IF ! (type_trac == 'inca' or 'inco') 635 568 636 569 !-----------------------------------------------------------------------
Note: See TracChangeset
for help on using the changeset viewer.