Changeset 4013 for LMDZ6/branches/Ocean_skin/libf/dyn3d_common
- Timestamp:
- Nov 19, 2021, 4:58:59 PM (3 years ago)
- Location:
- LMDZ6/branches/Ocean_skin
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ6/branches/Ocean_skin
- Property svn:mergeinfo changed
-
LMDZ6/branches/Ocean_skin/libf/dyn3d_common/infotrac.F90
r3811 r4013 12 12 INTEGER, SAVE :: nbtr 13 13 14 ! CRisi: nb traceurs pères= directement advectés par l'air 14 ! CRisi: on retranche les isotopes des traceurs habituels 15 ! On fait un tableaux d'indices des traceurs qui passeront dans phytrac 16 INTEGER, SAVE :: nqtottr 17 INTEGER, ALLOCATABLE, DIMENSION(:), SAVE :: itr_indice 18 19 ! CRisi: nb traceurs peres= directement advectes par l'air 15 20 INTEGER, SAVE :: nqperes 16 21 22 ! ThL: nb traceurs INCA 23 INTEGER, SAVE :: nqINCA 24 25 ! ThL: nb traceurs CO2 26 INTEGER, SAVE :: nqCO2 27 17 28 ! Name variables 18 CHARACTER(len=20), ALLOCATABLE, DIMENSION(:), SAVE :: tname ! tracer short name for restart and diagnostics 19 CHARACTER(len=23), ALLOCATABLE, DIMENSION(:), SAVE :: ttext ! tracer long name for diagnostics 29 INTEGER,PARAMETER :: tname_lenmax=128 30 CHARACTER(len=tname_lenmax), ALLOCATABLE, DIMENSION(:), SAVE :: tname ! tracer short name for restart and diagnostics 31 CHARACTER(len=tname_lenmax+3), ALLOCATABLE, DIMENSION(:), SAVE :: ttext ! tracer long name for diagnostics 20 32 21 33 ! iadv : index of trasport schema for each tracer … … 28 40 ! CRisi: tableaux de fils 29 41 INTEGER, ALLOCATABLE, DIMENSION(:), SAVE :: nqfils 30 INTEGER, ALLOCATABLE, DIMENSION(:), SAVE :: nqdesc ! nombres de fils + nombre de tous les petits fils sur toutes les g énérations42 INTEGER, ALLOCATABLE, DIMENSION(:), SAVE :: nqdesc ! nombres de fils + nombre de tous les petits fils sur toutes les generations 31 43 INTEGER, SAVE :: nqdesc_tot 32 44 INTEGER, ALLOCATABLE, DIMENSION(:,:), SAVE :: iqfils … … 42 54 CHARACTER(len=4),SAVE :: type_trac 43 55 CHARACTER(len=8),DIMENSION(:),ALLOCATABLE, SAVE :: solsym 44 56 45 57 ! CRisi: cas particulier des isotopes 46 58 LOGICAL,SAVE :: ok_isotopes,ok_iso_verif,ok_isotrac,ok_init_iso … … 50 62 LOGICAL, DIMENSION(niso_possibles),SAVE :: use_iso 51 63 INTEGER, ALLOCATABLE, DIMENSION(:,:), SAVE :: iqiso ! donne indice iq en fn de (ixt,phase) 52 INTEGER, ALLOCATABLE, DIMENSION(:), SAVE :: iso_num ! donne num éro iso entre 1 et niso_possibles en fn de nqtot53 INTEGER, ALLOCATABLE, DIMENSION(:), SAVE :: iso_indnum ! donne num éro iso entre 1 et niso effectif en fn de nqtot54 INTEGER, ALLOCATABLE, DIMENSION(:), SAVE :: zone_num ! donne num éro de la zone de tracage en fn de nqtot55 INTEGER, ALLOCATABLE, DIMENSION(:), SAVE :: phase_num ! donne num éro de la zone de tracage en fn de nqtot56 INTEGER, DIMENSION(niso_possibles), SAVE :: indnum_fn_num ! donne indice entre entre 1 et niso en fonction du num éro d isotope entre 1 et niso_possibles57 INTEGER, ALLOCATABLE, DIMENSION(:,:), SAVE :: index_trac ! num éro ixt en fn izone, indnum entre 1 et niso64 INTEGER, ALLOCATABLE, DIMENSION(:), SAVE :: iso_num ! donne numero iso entre 1 et niso_possibles en fn de nqtot 65 INTEGER, ALLOCATABLE, DIMENSION(:), SAVE :: iso_indnum ! donne numero iso entre 1 et niso effectif en fn de nqtot 66 INTEGER, ALLOCATABLE, DIMENSION(:), SAVE :: zone_num ! donne numero de la zone de tracage en fn de nqtot 67 INTEGER, ALLOCATABLE, DIMENSION(:), SAVE :: phase_num ! donne numero de la zone de tracage en fn de nqtot 68 INTEGER, DIMENSION(niso_possibles), SAVE :: indnum_fn_num ! donne indice entre entre 1 et niso en fonction du numero d isotope entre 1 et niso_possibles 69 INTEGER, ALLOCATABLE, DIMENSION(:,:), SAVE :: index_trac ! numero ixt en fn izone, indnum entre 1 et niso 58 70 INTEGER,SAVE :: niso,ntraceurs_zone,ntraciso 59 71 … … 103 115 INTEGER, ALLOCATABLE, DIMENSION(:) :: vadv_inca ! index of vertical trasport schema 104 116 105 CHARACTER(len=15), ALLOCATABLE, DIMENSION(:) :: tnom_0 ! tracer short name 106 CHARACTER(len=15), ALLOCATABLE, DIMENSION(:) :: tnom_transp ! transporting fluid short name: CRisi 117 INTEGER, ALLOCATABLE, DIMENSION(:) :: conv_flg_inca 118 INTEGER, ALLOCATABLE, DIMENSION(:) :: pbl_flg_inca 119 CHARACTER(len=8), ALLOCATABLE, DIMENSION(:) :: solsym_inca 120 121 CHARACTER(len=tname_lenmax), ALLOCATABLE, DIMENSION(:) :: tnom_0 ! tracer short name 122 CHARACTER(len=tname_lenmax), ALLOCATABLE, DIMENSION(:) :: tnom_transp ! transporting fluid short name: CRisi 107 123 CHARACTER(len=3), DIMENSION(30) :: descrq 108 124 CHARACTER(len=1), DIMENSION(3) :: txts 109 125 CHARACTER(len=2), DIMENSION(9) :: txtp 110 CHARACTER(len= 23) :: str1,str2126 CHARACTER(len=tname_lenmax) :: str1,str2 111 127 112 128 INTEGER :: nqtrue ! number of tracers read from tracer.def, without higer order of moment 113 INTEGER :: iq, new_iq, iiq, jq, ierr 129 INTEGER :: iq, new_iq, iiq, jq, ierr,itr 114 130 INTEGER :: ifils,ipere,generation ! CRisi 115 131 LOGICAL :: continu,nouveau_traceurdef 116 132 INTEGER :: IOstatus ! gestion de la retrocompatibilite de traceur.def 117 CHARACTER(len= 15) :: tchaine133 CHARACTER(len=2*tname_lenmax+1) :: tchaine 118 134 119 135 character(len=*),parameter :: modname="infotrac_init" 136 120 137 !----------------------------------------------------------------------- 121 138 ! Initialization : … … 138 155 ! Coherence test between parameter type_trac, config_inca and preprocessing keys 139 156 IF (type_trac=='inca') THEN 140 WRITE(lunout,*) 'You have cho osen to couple with INCA chemestry model : type_trac=', &157 WRITE(lunout,*) 'You have chosen to couple with INCA chemistry model : type_trac=', & 141 158 type_trac,' config_inca=',config_inca 142 159 IF (config_inca/='aero' .AND. config_inca/='aeNP' .AND. config_inca/='chem') THEN 143 160 WRITE(lunout,*) 'Incoherence between type_trac and config_inca. Model stops. Modify run.def' 144 161 CALL abort_gcm('infotrac_init','Incoherence between type_trac and config_inca',1) 145 END 162 ENDIF 146 163 #ifndef INCA 147 164 WRITE(lunout,*) 'To run this option you must add cpp key INCA and compile with INCA code' … … 149 166 #endif 150 167 ELSE IF (type_trac=='repr') THEN 151 WRITE(lunout,*) 'You have cho osen to couple with REPROBUS chemestry model : type_trac=', type_trac168 WRITE(lunout,*) 'You have chosen to couple with REPROBUS chemestry model : type_trac=', type_trac 152 169 #ifndef REPROBUS 153 170 WRITE(lunout,*) 'To run this option you must add cpp key REPROBUS and compile with REPRPBUS code' … … 164 181 ELSE IF (type_trac == 'lmdz') THEN 165 182 WRITE(lunout,*) 'Tracers are treated in LMDZ only : type_trac=', type_trac 183 ELSE IF (type_trac == 'inco') THEN ! ThL 184 WRITE(lunout,*) 'Using jointly INCA and CO2 cycle: type_trac =', type_trac 185 IF (config_inca/='aero' .AND. config_inca/='aeNP' .AND. config_inca/='chem') THEN 186 WRITE(lunout,*) 'Incoherence between type_trac and config_inca. Model stops. Modify run.def' 187 CALL abort_gcm('infotrac_init','Incoherence between type_trac and config_inca',1) 188 ENDIF 189 #ifndef INCA 190 WRITE(lunout,*) 'To run this option you must add cpp key INCA and compilewith INCA code' 191 CALL abort_gcm('infotrac_init','You must compile with cpp key INCA',1) 192 #endif 166 193 ELSE 167 194 WRITE(lunout,*) 'type_trac=',type_trac,' not possible. Model stops' 168 195 CALL abort_gcm('infotrac_init','bad parameter',1) 169 END 196 ENDIF 170 197 171 198 ! Test if config_inca is other then none for run without INCA 172 IF (type_trac/='inca' .AND. config_inca/='none') THEN199 IF (type_trac/='inca' .AND. type_trac/='inco' .AND. config_inca/='none') THEN 173 200 WRITE(lunout,*) 'config_inca will now be changed to none as you do not couple with INCA model' 174 201 config_inca='none' 175 END 202 ENDIF 176 203 177 204 !----------------------------------------------------------------------- … … 182 209 !----------------------------------------------------------------------- 183 210 IF (type_trac == 'lmdz' .OR. type_trac == 'repr' .OR. type_trac == 'coag' .OR. type_trac == 'co2i') THEN 211 IF (type_trac=='co2i') THEN 212 nqCO2 = 1 213 ELSE 214 nqCO2 = 0 215 ENDIF 184 216 OPEN(90,file='traceur.def',form='formatted',status='old', iostat=ierr) 185 217 IF(ierr.EQ.0) THEN … … 188 220 write(lunout,*) 'nqtrue=',nqtrue 189 221 ELSE 190 WRITE(lunout,*) trim(modname),': Problem in opening traceur.def' 191 WRITE(lunout,*) trim(modname),': WARNING using defaut values' 192 IF (planet_type=='earth') THEN 193 nqtrue=4 ! Default value for Earth 194 ELSE 195 nqtrue=1 ! Default value for other planets 196 ENDIF 222 WRITE(lunout,*) trim(modname),': Failed opening traceur.def' 223 CALL abort_gcm(modname,"file traceur.def not found!",1) 197 224 ENDIF 198 225 !jyg< … … 206 233 !! endif 207 234 !>jyg 208 ELSE ! type_trac=inca 235 ELSE ! type_trac=inca or inco 236 IF (type_trac=='inco') THEN 237 nqCO2 = 1 238 ELSE 239 nqCO2 = 0 240 ENDIF 209 241 !jyg< 210 242 ! The traceur.def file is used to define the number "nqo" of water phases … … 215 247 READ(90,*) nqo 216 248 ELSE 217 WRITE(lunout,*) trim(modname),': Using default value for nqo'218 nqo=2249 WRITE(lunout,*) trim(modname),': Failed opening traceur.def' 250 CALL abort_gcm(modname,"file traceur.def not found!",1) 219 251 ENDIF 220 252 IF (nqo /= 2 .AND. nqo /= 3 ) THEN 221 WRITE(lunout,*) trim(modname),': nqo=',nqo, ' is not allowded. Only 2 or 3 water phases allowed' 253 IF (nqo == 4 .AND. type_trac=='inco') THEN ! ThL 254 WRITE(lunout,*) trim(modname),': you are coupling with INCA, and also using CO2i.' 255 nqo = 3 ! A ameliorier... je force 3 traceurs eau... ThL 256 WRITE(lunout,*) trim(modname),': nqo = ',nqo 257 ELSE 258 WRITE(lunout,*) trim(modname),': nqo=',nqo, ' is not allowed. Only 2 or 3 water phases allowed' 222 259 CALL abort_gcm('infotrac_init','Bad number of water phases',1) 223 END IF 260 ENDIF 261 ENDIF 224 262 ! nbtr has been read from INCA by init_const_lmdz() in gcm.F 225 263 #ifdef INCA 226 CALL Init_chem_inca_trac(nbtr) 227 #endif 264 CALL Init_chem_inca_trac(nqINCA) 265 #else 266 nqINCA=0 267 #endif 268 nbtr=nqINCA+nqCO2 228 269 nqtrue=nbtr+nqo 229 230 ALLOCATE(hadv_inca(nbtr), vadv_inca(nbtr)) 231 232 ENDIF ! type_trac 270 WRITE(lunout,*) trim(modname),': nqo = ',nqo 271 WRITE(lunout,*) trim(modname),': nbtr = ',nbtr 272 WRITE(lunout,*) trim(modname),': nqtrue = ',nqtrue 273 WRITE(lunout,*) trim(modname),': nqCO2 = ',nqCO2 274 WRITE(lunout,*) trim(modname),': nqINCA = ',nqINCA 275 ALLOCATE(hadv_inca(nqINCA), vadv_inca(nqINCA), conv_flg_inca(nqINCA), pbl_flg_inca(nqINCA), solsym_inca(nqINCA)) 276 ENDIF ! type_trac 'inca' ou 'inco' 233 277 !>jyg 234 278 235 279 IF ((planet_type=="earth").and.(nqtrue < 2)) THEN 236 WRITE(lunout,*) trim(modname),': nqtrue=',nqtrue, ' is not allow ded. 2 tracers is the minimum'280 WRITE(lunout,*) trim(modname),': nqtrue=',nqtrue, ' is not allowed. 2 tracers is the minimum' 237 281 CALL abort_gcm('infotrac_init','Not enough tracers',1) 238 END 282 ENDIF 239 283 240 284 !jyg< 241 ! Transfert number of tracers to Reprobus242 !! IF (type_trac == 'repr') THEN243 !!#ifdef REPROBUS244 !! CALL Init_chem_rep_trac(nbtr)245 !!#endif246 !! END IF247 !>jyg248 285 249 286 ! … … 252 289 ALLOCATE(tnom_0(nqtrue), hadv(nqtrue), vadv(nqtrue),tnom_transp(nqtrue)) 253 290 254 !255 !jyg<256 !! ALLOCATE(conv_flg(nbtr), pbl_flg(nbtr), solsym(nbtr))257 !! conv_flg(:) = 1 ! convection activated for all tracers258 !! pbl_flg(:) = 1 ! boundary layer activated for all tracers259 !>jyg260 291 261 292 !----------------------------------------------------------------------- … … 271 302 ! iadv = 13 schema Frederic Hourdin II 272 303 ! iadv = 16 schema PPM Monotone(Collela & Woodward 1984) 273 ! iadv = 17 schema PPM Semi Monotone (overshoots autoris és)274 ! iadv = 18 schema PPM Positif Defini (overshoots undershoots autoris és)304 ! iadv = 17 schema PPM Semi Monotone (overshoots autorises) 305 ! iadv = 18 schema PPM Positif Defini (overshoots undershoots autorises) 275 306 ! iadv = 20 schema Slopes 276 307 ! iadv = 30 schema Prather … … 286 317 !--------------------------------------------------------------------- 287 318 IF (type_trac == 'lmdz' .OR. type_trac == 'repr' .OR. type_trac == 'coag' .OR. type_trac == 'co2i') THEN 288 IF(ierr.EQ.0) THEN 319 289 320 ! Continue to read tracer.def 290 321 DO iq=1,nqtrue … … 319 350 write(lunout,*) 'C''est la nouvelle version de traceur.def' 320 351 tnom_0(iq)=tchaine(1:iiq-1) 321 tnom_transp(iq)=tchaine(iiq+1: 15)352 tnom_transp(iq)=tchaine(iiq+1:) 322 353 else 323 354 write(lunout,*) 'C''est l''ancienne version de traceur.def' … … 329 360 write(lunout,*) 'tnom_transp(iq)=<',trim(tnom_transp(iq)),'>' 330 361 331 END DO !DO iq=1,nqtrue 362 ENDDO!DO iq=1,nqtrue 363 332 364 CLOSE(90) 333 365 334 ELSE ! Without tracer.def, set default values335 if (planet_type=="earth") then336 ! for Earth, default is to have 4 tracers337 hadv(1) = 14338 vadv(1) = 14339 tnom_0(1) = 'H2Ov'340 tnom_transp(1) = 'air'341 hadv(2) = 10342 vadv(2) = 10343 tnom_0(2) = 'H2Ol'344 tnom_transp(2) = 'air'345 hadv(3) = 10346 vadv(3) = 10347 tnom_0(3) = 'RN'348 tnom_transp(3) = 'air'349 hadv(4) = 10350 vadv(4) = 10351 tnom_0(4) = 'PB'352 tnom_transp(4) = 'air'353 else ! default for other planets354 hadv(1) = 10355 vadv(1) = 10356 tnom_0(1) = 'dummy'357 tnom_transp(1) = 'dummy'358 endif ! of if (planet_type=="earth")359 END IF360 361 366 WRITE(lunout,*) trim(modname),': Valeur de traceur.def :' 362 WRITE(lunout,*) trim(modname),': nombre de traceurs ',nqtrue367 WRITE(lunout,*) trim(modname),': nombre total de traceurs ',nqtrue 363 368 DO iq=1,nqtrue 364 WRITE(lunout,*) hadv(iq),vadv(iq), tnom_0(iq),tnom_transp(iq)369 WRITE(lunout,*) hadv(iq),vadv(iq),' ',trim(tnom_0(iq)),' ',trim(tnom_transp(iq)) 365 370 END DO 366 371 … … 418 423 #endif 419 424 420 ENDIF ! (type_trac == 'lmdz' .OR. type_trac == 'repr' .OR. type_trac = 'coag' )425 ENDIF ! (type_trac == 'lmdz' .OR. type_trac == 'repr' .OR. type_trac = 'coag' .OR. type_trac = 'co2i') 421 426 !jyg< 422 427 ! 428 423 429 ! Transfert number of tracers to Reprobus 424 430 IF (type_trac == 'repr') THEN … … 426 432 CALL Init_chem_rep_trac(nbtr,nqo,tnom_0) 427 433 #endif 428 END 434 ENDIF 429 435 ! 430 436 ! Allocate variables depending on nbtr … … 433 439 conv_flg(:) = 1 ! convection activated for all tracers 434 440 pbl_flg(:) = 1 ! boundary layer activated for all tracers 435 ! 436 !! ELSE ! type_trac=inca : config_inca='aero' ou 'chem' 437 ! 438 IF (type_trac == 'inca') THEN ! config_inca='aero' ou 'chem' 441 442 IF (type_trac == 'inca' .OR. type_trac == 'inco') THEN ! config_inca='aero' ou 'chem' 439 443 !>jyg 440 444 ! le module de chimie fournit les noms des traceurs 441 445 ! et les schemas d'advection associes. excepte pour ceux lus 442 446 ! dans traceur.def 443 IF (ierr .eq. 0) then 444 DO iq=1,nqo 447 448 DO iq=1,nqo+nqCO2 445 449 446 450 write(*,*) 'infotrac 237: iq=',iq … … 459 463 nouveau_traceurdef=.false. 460 464 iiq=1 465 461 466 do while (continu) 462 467 if (tchaine(iiq:iiq).eq.' ') then … … 469 474 endif 470 475 enddo 476 471 477 write(*,*) 'iiq,nouveau_traceurdef=',iiq,nouveau_traceurdef 478 472 479 if (nouveau_traceurdef) then 473 480 write(lunout,*) 'C''est la nouvelle version de traceur.def' 474 481 tnom_0(iq)=tchaine(1:iiq-1) 475 tnom_transp(iq)=tchaine(iiq+1: 15)482 tnom_transp(iq)=tchaine(iiq+1:) 476 483 else 477 484 write(lunout,*) 'C''est l''ancienne version de traceur.def' … … 480 487 tnom_transp(iq) = 'air' 481 488 endif 489 482 490 write(lunout,*) 'tnom_0(iq)=<',trim(tnom_0(iq)),'>' 483 491 write(lunout,*) 'tnom_transp(iq)=<',trim(tnom_transp(iq)),'>' 484 492 485 END DO !DO iq=1,nqtrue493 ENDDO !DO iq=1,nqo 486 494 CLOSE(90) 487 ELSE !! if traceur.def doesn't exist 488 tnom_0(1)='H2Ov' 489 tnom_transp(1) = 'air' 490 tnom_0(2)='H2Ol' 491 tnom_transp(2) = 'air' 492 hadv(1) = 10 493 hadv(2) = 10 494 vadv(1) = 10 495 vadv(2) = 10 496 ENDIF 495 497 496 498 497 #ifdef INCA … … 500 499 hadv_inca, & 501 500 vadv_inca, & 502 conv_flg, & 503 pbl_flg, & 504 solsym) 501 conv_flg_inca, & 502 pbl_flg_inca, & 503 solsym_inca) 504 505 conv_flg(1+nqCO2:nbtr) = conv_flg_inca 506 pbl_flg(1+nqCO2:nbtr) = pbl_flg_inca 507 solsym(1+nqCO2:nbtr) = solsym_inca 508 509 IF (type_trac == 'inco') THEN 510 conv_flg(1:nqCO2) = 1 511 pbl_flg(1:nqCO2) = 1 512 solsym(1:nqCO2) = 'CO2' 513 ENDIF 505 514 #endif 506 515 507 508 516 !jyg< 509 DO iq = nqo+ 1, nqtrue510 hadv(iq) = hadv_inca(iq-nqo )511 vadv(iq) = vadv_inca(iq-nqo )512 tnom_0(iq)=solsym (iq-nqo)517 DO iq = nqo+nqCO2+1, nqtrue 518 hadv(iq) = hadv_inca(iq-nqo-nqCO2) 519 vadv(iq) = vadv_inca(iq-nqo-nqCO2) 520 tnom_0(iq)=solsym_inca(iq-nqo-nqCO2) 513 521 tnom_transp(iq) = 'air' 514 522 END DO 515 523 516 END IF ! (type_trac == 'inca')524 ENDIF ! (type_trac == 'inca' or 'inco') 517 525 518 526 !----------------------------------------------------------------------- … … 534 542 WRITE(lunout,*) trim(modname),': This choice of advection schema is not available',iq,hadv(iq),vadv(iq) 535 543 CALL abort_gcm('infotrac_init','Bad choice of advection schema - 1',1) 536 END 544 ENDIF 537 545 END DO 538 546 … … 550 558 ! The true number of tracers is also the total number 551 559 nqtot = nqtrue 552 END 560 ENDIF 553 561 554 562 ! … … 576 584 577 585 CALL abort_gcm('infotrac_init','Bad choice of advection schema - 2',1) 578 END 586 ENDIF 579 587 580 588 str1=tnom_0(iq) … … 584 592 ELSE 585 593 ttext(new_iq)=trim(tnom_0(iq))//descrq(iadv(new_iq)) 586 END 594 ENDIF 587 595 588 596 ! schemas tenant compte des moments d'ordre superieur … … 602 610 tname(new_iq)=trim(str1)//txtp(jq) 603 611 END DO 604 END 612 ENDIF 605 613 END DO 606 614 … … 621 629 WRITE(lunout,*) trim(modname),': Information stored in infotrac :' 622 630 WRITE(lunout,*) trim(modname),': iadv niadv tname ttext :' 631 623 632 DO iq=1,nqtot 624 WRITE(lunout,*) iadv(iq),niadv(iq),& 625 ' ',trim(tname(iq)),' ',trim(ttext(iq)) 633 WRITE(lunout,*) iadv(iq),niadv(iq), ' ',trim(tname(iq)),' ',trim(ttext(iq)) 626 634 END DO 627 635 … … 637 645 WRITE(lunout,*)trim(modname),'STOP : The option iadv=',iadv(iq),' is not tested in this version of LMDZ' 638 646 CALL abort_gcm('infotrac_init','In this version iadv=14 is only permitted for water vapour!',1) 639 END 647 ENDIF 640 648 END DO 641 649 642 650 643 ! CRisi: quels sont les traceurs fils et les traceurs p ères.644 ! initialiser tous les tableaux d'indices li és aux traceurs familiaux645 ! + v érifier que tous les pères sont écrits en premières positions651 ! CRisi: quels sont les traceurs fils et les traceurs peres. 652 ! initialiser tous les tableaux d'indices lies aux traceurs familiaux 653 ! + verifier que tous les peres sont ecrits en premieres positions 646 654 ALLOCATE(nqfils(nqtot),nqdesc(nqtot)) 647 655 ALLOCATE(iqfils(nqtot,nqtot)) … … 655 663 DO iq=1,nqtot 656 664 if (tnom_transp(iq) == 'air') then 657 ! ceci est un traceur p ère665 ! ceci est un traceur pere 658 666 WRITE(lunout,*) 'Le traceur',iq,', appele ',trim(tnom_0(iq)),', est un pere' 659 667 nqperes=nqperes+1 660 668 iqpere(iq)=0 661 669 else !if (tnom_transp(iq) == 'air') then 662 ! ceci est un fils. Qui est son p ère?670 ! ceci est un fils. Qui est son pere? 663 671 WRITE(lunout,*) 'Le traceur',iq,', appele ',trim(tnom_0(iq)),', est un fils' 664 672 continu=.true. … … 666 674 do while (continu) 667 675 if (tnom_transp(iq) == tnom_0(ipere)) then 668 ! Son p ère est ipere676 ! Son pere est ipere 669 677 WRITE(lunout,*) 'Le traceur',iq,'appele ', & 670 678 & trim(tnom_0(iq)),' est le fils de ',ipere,'appele ',trim(tnom_0(ipere)) 679 if (iq.eq.ipere) then 680 CALL abort_gcm('infotrac_init','Un fils est son propre pere',1) 681 endif 671 682 nqfils(ipere)=nqfils(ipere)+1 672 683 iqfils(nqfils(ipere),ipere)=iq … … 689 700 WRITE(lunout,*) 'iqfils=',iqfils 690 701 691 ! Calculer le nombre de descendants àpartir de iqfils et de nbfils702 ! Calculer le nombre de descendants a partir de iqfils et de nbfils 692 703 DO iq=1,nqtot 693 704 generation=0 … … 712 723 WRITE(lunout,*) 'nqdesc_tot=',nqdesc_tot 713 724 714 ! Interdire autres sch émas que 10 pour les traceurs fils, et autres schémas715 ! que 10 et 14 si des p ères ont des fils725 ! Interdire autres schemas que 10 pour les traceurs fils, et autres schemas 726 ! que 10 et 14 si des peres ont des fils 716 727 do iq=1,nqtot 717 728 if (iqpere(iq).gt.0) then 718 ! ce traceur a un p ère qui n'est pas l'air719 ! Seul le sch éma 10 est autorisé729 ! ce traceur a un pere qui n'est pas l'air 730 ! Seul le schema 10 est autorise 720 731 if (iadv(iq)/=10) then 721 732 WRITE(lunout,*)trim(modname),' STOP : The option iadv=',iadv(iq),' is not implemented for sons' 722 733 CALL abort_gcm('infotrac_init','Sons should be advected by scheme 10',1) 723 734 endif 724 ! Le traceur p ère ne peut être advecté que par schéma 10 ou 14:735 ! Le traceur pere ne peut etre advecte que par schema 10 ou 14: 725 736 IF (iadv(iqpere(iq))/=10 .AND. iadv(iqpere(iq))/=14) THEN 726 737 WRITE(lunout,*)trim(modname),' STOP : The option iadv=',iadv(iq),' is not implemented for fathers' … … 730 741 enddo !do iq=1,nqtot 731 742 732 WRITE(lunout,*) 'infotrac init fin' 743 733 744 734 745 ! detecter quels sont les traceurs isotopiques parmi des traceurs 735 746 call infotrac_isoinit(tnom_0,nqtrue) 736 747 748 ! if (ntraciso.gt.0) then 749 ! le 18 sep 2020: on enleve la condition ntraciso.gt.0 car nqtottr doit etre 750 ! connu meme si il n'y a pas d'isotopes! 751 write(lunout,*) 'infotrac 702: nbtr,ntraciso=',nbtr,ntraciso 752 ! retrancher les traceurs isotopiques de la liste des traceurs qui passent dans 753 ! phytrac 754 nbtr=nbtr-nqo*ntraciso 755 756 ! faire un tableau d'indice des traceurs qui passeront dans phytrac 757 nqtottr=nqtot-nqo*(1+ntraciso) 758 write(lunout,*) 'infotrac 704: nqtottr,nqtot,nqo=',nqtottr,nqtot,nqo 759 ! Rq: nqtottr n'est pas forcement egal a nbtr dans le cas ou new_iq /= nqtrue 760 ALLOCATE (itr_indice(nqtottr)) 761 itr_indice(:)=0 762 itr=0 763 do iq=nqo+1, nqtot 764 if (iso_num(iq).eq.0) then 765 itr=itr+1 766 write(*,*) 'itr=',itr 767 itr_indice(itr)=iq 768 endif !if (iso_num(iq).eq.0) then 769 enddo 770 if (itr.ne.nqtottr) then 771 CALL abort_gcm('infotrac_init','pb dans le calcul de nqtottr',1) 772 endif 773 write(lunout,*) 'itr_indice=',itr_indice 774 ! endif !if (ntraciso.gt.0) then 775 737 776 !----------------------------------------------------------------------- 738 777 ! Finalize : … … 740 779 DEALLOCATE(tnom_0, hadv, vadv,tnom_transp) 741 780 781 WRITE(lunout,*) 'infotrac init fin' 742 782 743 783 END SUBROUTINE infotrac_init … … 754 794 755 795 ! inputs 756 INTEGER nqtrue757 CHARACTER(len= 15)tnom_0(nqtrue)796 INTEGER,INTENT(IN) :: nqtrue 797 CHARACTER(len=*),INTENT(IN) :: tnom_0(nqtrue) 758 798 759 799 ! locals … … 762 802 INTEGER, ALLOCATABLE,DIMENSION(:) :: nb_isoind 763 803 INTEGER :: ntraceurs_zone_prec,iq,phase,ixt,iiso,izone 764 CHARACTER(len= 19) :: tnom_trac804 CHARACTER(len=tname_lenmax) :: tnom_trac 765 805 INCLUDE "iniprint.h" 766 806 … … 838 878 839 879 if (nb_iso(ixt,1).eq.1) then 840 ! on v érifie que toutes les phases ont le même nombre de880 ! on verifie que toutes les phases ont le meme nombre de 841 881 ! traceurs 842 882 do phase=2,nqo … … 851 891 ntraceurs_zone=nb_traciso(ixt,1) 852 892 853 ! on v érifie que toutes les phases ont le même nombre de893 ! on verifie que toutes les phases ont le meme nombre de 854 894 ! traceurs 855 895 do phase=2,nqo … … 860 900 endif 861 901 enddo !do phase=2,nqo 862 ! on v érifie que tous les isotopes ont le même nombre de902 ! on verifie que tous les isotopes ont le meme nombre de 863 903 ! traceurs 864 904 if (ntraceurs_zone_prec.gt.0) then
Note: See TracChangeset
for help on using the changeset viewer.