Changeset 4056 for LMDZ6/trunk/libf/dyn3d_common
- Timestamp:
- Jan 12, 2022, 10:54:09 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ6/trunk/libf/dyn3d_common/infotrac.F90
r4052 r4056 14 14 INTEGER, SAVE :: nbtr 15 15 16 ! CRisi: on retranche les isotopes des traceurs habituels 17 ! On fait un tableaux d'indices des traceurs qui passeront dans phytrac 16 ! Nombre de traceurs passes a phytrac 18 17 INTEGER, SAVE :: nqtottr 19 INTEGER, ALLOCATABLE, DIMENSION(:), SAVE :: itr_indice20 21 ! CRisi: nb traceurs peres= directement advectes par l'air22 INTEGER, SAVE :: nqperes23 24 ! ThL: nb traceurs INCA25 INTEGER, SAVE :: nqINCA26 18 27 19 ! ThL: nb traceurs CO2 … … 31 23 TYPE(trac_type), TARGET, SAVE, ALLOCATABLE :: tracers(:) !=== TRACERS DESCRIPTORS VECTOR 32 24 TYPE(isot_type), TARGET, SAVE, ALLOCATABLE :: isotopes(:) !=== ISOTOPES PARAMETERS VECTOR 33 34 ! niadv : vector keeping the coorspondance between all tracers(nqtot) treated in the35 ! dynamic part of the code and the tracers (nbtr+2) used in the physics part of the code.36 INTEGER, ALLOCATABLE, DIMENSION(:), SAVE :: niadv ! equivalent dyn / physique37 25 38 26 REAL :: qperemin,masseqmin,ratiomin ! MVals et CRisi … … 59 47 INTEGER,SAVE :: niso,ntraceurs_zone,ntraciso 60 48 61 #ifdef CPP_StratAer62 !--CK/OB for stratospheric aerosols63 INTEGER, SAVE :: nbtr_bin64 INTEGER, SAVE :: nbtr_sulgas65 INTEGER, SAVE :: id_OCS_strat66 INTEGER, SAVE :: id_SO2_strat67 INTEGER, SAVE :: id_H2SO4_strat68 INTEGER, SAVE :: id_BIN01_strat69 INTEGER, SAVE :: id_TEST_strat70 #endif71 72 49 CONTAINS 73 50 … … 120 97 LOGICAL :: continu,nouveau_traceurdef 121 98 INTEGER :: IOstatus ! gestion de la retrocompatibilite de traceur.def 122 CHARACTER(len=maxlen) :: tchaine 99 CHARACTER(len=maxlen) :: tchaine, msg1 123 100 INTEGER, ALLOCATABLE :: iqfils(:,:) 101 INTEGER :: nqINCA 124 102 125 103 character(len=*),parameter :: modname="infotrac_init" … … 142 120 descrq(30)='PRA' 143 121 144 145 ! Coherence test between parameter type_trac, config_inca and preprocessing keys 146 IF (type_trac=='inca') THEN 147 WRITE(lunout,*) 'You have chosen to couple with INCA chemistry model : type_trac=', & 148 type_trac,' config_inca=',config_inca 149 IF (config_inca/='aero' .AND. config_inca/='aeNP' .AND. config_inca/='chem') THEN 150 WRITE(lunout,*) 'Incoherence between type_trac and config_inca. Model stops. Modify run.def' 151 CALL abort_gcm('infotrac_init','Incoherence between type_trac and config_inca',1) 152 ENDIF 122 !--- MESSAGE ABOUT THE CHOSEN CONFIGURATION 123 WRITE(lunout,*)'type_trac='//TRIM(type_trac) 124 msg1 = 'For type_trac = "'//TRIM(type_trac)//'":' 125 SELECT CASE(type_trac) 126 CASE('inca'); WRITE(lunout,*)TRIM(msg1)//' coupling with INCA chemistry model, config_inca='//config_inca 127 CASE('inco'); WRITE(lunout,*)TRIM(msg1)//' coupling jointly with INCA and CO2 cycle' 128 CASE('repr'); WRITE(lunout,*)TRIM(msg1)//' coupling with REPROBUS chemistry model' 129 CASE('co2i'); WRITE(lunout,*)TRIM(msg1)//' you have chosen to run with CO2 cycle' 130 CASE('coag'); WRITE(lunout,*)TRIM(msg1)//' tracers are treated for COAGULATION tests' 131 CASE('lmdz'); WRITE(lunout,*)TRIM(msg1)//' tracers are treated in LMDZ only' 132 CASE DEFAULT 133 CALL abort_gcm(modname,'type_trac='//TRIM(type_trac)//' not possible yet.',1) 134 END SELECT 135 136 !--- COHERENCE TEST BETWEEN "type_trac", "config_inca" AND PREPROCESSING KEYS 137 SELECT CASE(type_trac) 138 CASE('inca','inco'); IF(ALL(['aero', 'aeNP', 'chem']/=config_inca)) & 139 CALL abort_gcm(modname, 'Incoherence between type_trac and config_inca. Please modify "run.def"',1) 153 140 #ifndef INCA 154 WRITE(lunout,*) 'To run this option you must add cpp key INCA and compile with INCA code' 155 CALL abort_gcm('infotrac_init','You must compile with cpp key INCA',1) 141 CALL abort_gcm(modname, 'You must add cpp key INCA and compile with INCA code',1) 156 142 #endif 157 ELSE IF (type_trac=='repr') THEN 158 WRITE(lunout,*) 'You have chosen to couple with REPROBUS chemestry model : type_trac=', type_trac 143 CASE('repr') 159 144 #ifndef REPROBUS 160 WRITE(lunout,*) 'To run this option you must add cpp key REPROBUS and compile with REPRPBUS code' 161 CALL abort_gcm('infotrac_init','You must compile with cpp key REPROBUS',1) 145 CALL abort_gcm(modname, 'You must add cpp key REPROBUS and compile with REPROBUS code',1) 162 146 #endif 163 ELSE IF (type_trac == 'co2i') THEN 164 WRITE(lunout,*) 'You have chosen to run with CO2 cycle: type_trac=', type_trac 165 ELSE IF (type_trac == 'coag') THEN 166 WRITE(lunout,*) 'Tracers are treated for COAGULATION tests : type_trac=', type_trac 147 CASE('coag') 167 148 #ifndef CPP_StratAer 168 WRITE(lunout,*) 'To run this option you must add cpp key StratAer and compile with StratAer code' 169 CALL abort_gcm('infotrac_init','You must compile with cpp key StratAer',1) 149 CALL abort_gcm(modname, 'You must add cpp key StratAer and compile with StratAer code',1) 170 150 #endif 171 ELSE IF (type_trac == 'lmdz') THEN 172 WRITE(lunout,*) 'Tracers are treated in LMDZ only : type_trac=', type_trac 173 ELSE IF (type_trac == 'inco') THEN ! ThL 174 WRITE(lunout,*) 'Using jointly INCA and CO2 cycle: type_trac =', type_trac 175 IF (config_inca/='aero' .AND. config_inca/='aeNP' .AND. config_inca/='chem') THEN 176 WRITE(lunout,*) 'Incoherence between type_trac and config_inca. Model stops. Modify run.def' 177 CALL abort_gcm('infotrac_init','Incoherence between type_trac and config_inca',1) 178 ENDIF 179 #ifndef INCA 180 WRITE(lunout,*) 'To run this option you must add cpp key INCA and compilewith INCA code' 181 CALL abort_gcm('infotrac_init','You must compile with cpp key INCA',1) 182 #endif 183 ELSE 184 WRITE(lunout,*) 'type_trac=',type_trac,' not possible. Model stops' 185 CALL abort_gcm('infotrac_init','bad parameter',1) 186 ENDIF 187 188 ! Test if config_inca is other then none for run without INCA 189 IF (type_trac/='inca' .AND. type_trac/='inco' .AND. config_inca/='none') THEN 190 WRITE(lunout,*) 'config_inca will now be changed to none as you do not couple with INCA model' 191 config_inca='none' 192 ENDIF 151 END SELECT 152 153 !--- Disable "config_inca" option for a run without INCA if it differs from "none" 154 IF (ALL(['inca', 'inco', 'none'] /= config_inca)) THEN 155 WRITE(lunout,*)'setting config_inca="none" as you do not couple with INCA model' 156 config_inca = 'none' 157 END IF 193 158 194 159 !----------------------------------------------------------------------- … … 198 163 ! 199 164 !----------------------------------------------------------------------- 200 IF (type_trac == 'lmdz' .OR. type_trac == 'repr' .OR. type_trac == 'coag' .OR. type_trac == 'co2i') THEN 201 IF (type_trac=='co2i') THEN 202 nqCO2 = 1 203 ELSE 204 nqCO2 = 0 205 ENDIF 206 OPEN(90,file='traceur.def',form='formatted',status='old', iostat=ierr) 207 IF(ierr.EQ.0) THEN 208 WRITE(lunout,*) trim(modname),': Open traceur.def : ok' 209 READ(90,*) nqtrue 210 write(lunout,*) 'nqtrue=',nqtrue 211 ELSE 212 WRITE(lunout,*) trim(modname),': Failed opening traceur.def' 213 CALL abort_gcm(modname,"file traceur.def not found!",1) 214 ENDIF 215 !jyg< 216 !! if ( planet_type=='earth') then 217 !! ! For Earth, water vapour & liquid tracers are not in the physics 218 !! nbtr=nqtrue-2 219 !! else 220 !! ! Other planets (for now); we have the same number of tracers 221 !! ! in the dynamics than in the physics 222 !! nbtr=nqtrue 223 !! endif 224 !>jyg 225 ELSE ! type_trac=inca or inco 226 IF (type_trac=='inco') THEN 227 nqCO2 = 1 228 ELSE 229 nqCO2 = 0 230 ENDIF 231 !jyg< 232 ! The traceur.def file is used to define the number "nqo" of water phases 233 ! present in the simulation. Default : nqo = 2. 234 OPEN(90,file='traceur.def',form='formatted',status='old', iostat=ierr) 235 IF(ierr.EQ.0) THEN 236 WRITE(lunout,*) trim(modname),': Open traceur.def : ok' 237 READ(90,*) nqo 238 ELSE 239 WRITE(lunout,*) trim(modname),': Failed opening traceur.def' 240 CALL abort_gcm(modname,"file traceur.def not found!",1) 241 ENDIF 242 IF (nqo /= 2 .AND. nqo /= 3 ) THEN 243 IF (nqo == 4 .AND. type_trac=='inco') THEN ! ThL 244 WRITE(lunout,*) trim(modname),': you are coupling with INCA, and also using CO2i.' 245 nqo = 3 ! A ameliorier... je force 3 traceurs eau... ThL 246 WRITE(lunout,*) trim(modname),': nqo = ',nqo 247 ELSE 248 WRITE(lunout,*) trim(modname),': nqo=',nqo, ' is not allowed. Only 2 or 3 water phases allowed' 249 CALL abort_gcm('infotrac_init','Bad number of water phases',1) 250 ENDIF 251 ENDIF 252 ! nbtr has been read from INCA by init_const_lmdz() in gcm.F 165 OPEN(90,file='traceur.def',form='formatted',status='old', iostat=ierr) 166 IF(ierr.EQ.0) THEN 167 WRITE(lunout,*) trim(modname),': Open traceur.def : ok' 168 ELSE 169 WRITE(lunout,*) trim(modname),': Failed opening traceur.def' 170 CALL abort_gcm(modname,"file traceur.def not found!",1) 171 ENDIF 172 nqCO2 = 0; IF(type_trac == 'inco') nqCO2 = 1 173 SELECT CASE(type_trac) 174 CASE('lmdz','repr','coag','co2i'); READ(90,*) nqtrue 175 CASE('inca','inco'); READ(90,*) nqo 176 ! The traceur.def file is used to define the number "nqo" of water phases 177 ! present in the simulation. Default : nqo = 2. 178 IF (nqo == 4 .AND. type_trac=='inco') nqo = 3 179 IF(ALL([2,3] /= nqo)) THEN 180 WRITE(lunout,*) trim(modname),': nqo=',nqo, ' is not allowed. Only 2 or 3 water phases allowed' 181 CALL abort_gcm('infotrac_init','Bad number of water phases',1) 182 END IF 183 ! nbtr has been read from INCA by init_const_lmdz() in gcm.F 253 184 #ifdef INCA 254 CALL Init_chem_inca_trac(nqINCA)185 CALL Init_chem_inca_trac(nqINCA) 255 186 #else 256 nqINCA=0187 nqINCA=0 257 188 #endif 258 nbtr=nqINCA+nqCO2259 nqtrue=nbtr+nqo260 WRITE(lunout,*) trim(modname),': nqo= ',nqo261 WRITE(lunout,*) trim(modname),': nbtr= ',nbtr262 WRITE(lunout,*) trim(modname),': nqtrue = ',nqtrue263 WRITE(lunout,*) trim(modname),': nqCO2 = ',nqCO2264 WRITE(lunout,*) trim(modname),': nqINCA = ',nqINCA265 ALLOCATE(hadv_inca(nqINCA), vadv_inca(nqINCA), conv_flg_inca(nqINCA), pbl_flg_inca(nqINCA), solsym_inca(nqINCA))266 END IF ! type_trac 'inca' ou 'inco'189 nbtr=nqINCA+nqCO2 190 nqtrue=nbtr+nqo 191 WRITE(lunout,*) trim(modname),': nqo = ',nqo 192 WRITE(lunout,*) trim(modname),': nbtr = ',nbtr 193 WRITE(lunout,*) trim(modname),': nqtrue = ',nqtrue 194 WRITE(lunout,*) trim(modname),': nqCO2 = ',nqCO2 195 WRITE(lunout,*) trim(modname),': nqINCA = ',nqINCA 196 ALLOCATE(hadv_inca(nqINCA), vadv_inca(nqINCA), conv_flg_inca(nqINCA), pbl_flg_inca(nqINCA), solsym_inca(nqINCA)) 197 END SELECT 267 198 !>jyg 268 199 … … 306 237 ! Get choice of advection schema from file tracer.def or from INCA 307 238 !--------------------------------------------------------------------- 308 IF (type_trac == 'lmdz' .OR. type_trac == 'repr' .OR. type_trac == 'coag' .OR. type_trac == 'co2i') THEN 309 310 ! Continue to read tracer.def 311 DO iq=1,nqtrue 312 313 write(*,*) 'infotrac 237: iq=',iq 314 ! CRisi: ajout du nom du fluide transporteur 315 ! mais rester retro compatible 316 READ(90,'(I2,X,I2,X,A)',IOSTAT=IOstatus) hadv(iq),vadv(iq),tchaine 317 write(lunout,*) 'iq,hadv(iq),vadv(iq)=',iq,hadv(iq),vadv(iq) 318 write(lunout,*) 'tchaine=',trim(tchaine) 319 write(*,*) 'infotrac 238: IOstatus=',IOstatus 320 if (IOstatus.ne.0) then 321 CALL abort_gcm('infotrac_init','Pb dans la lecture de traceur.def',1) 322 endif 323 ! Y-a-t-il 1 ou 2 noms de traceurs? -> On regarde s'il y a un 324 ! espace ou pas au milieu de la chaine. 325 continu=.true. 326 nouveau_traceurdef=.false. 327 iiq=1 328 do while (continu) 329 if (tchaine(iiq:iiq).eq.' ') then 330 nouveau_traceurdef=.true. 331 continu=.false. 332 else if (iiq.lt.LEN_TRIM(tchaine)) then 333 iiq=iiq+1 334 else 335 continu=.false. 336 endif 337 enddo 338 write(*,*) 'iiq,nouveau_traceurdef=',iiq,nouveau_traceurdef 339 if (nouveau_traceurdef) then 340 write(lunout,*) 'C''est la nouvelle version de traceur.def' 341 tnom_0(iq)=TRIM(tchaine(1:iiq-1)) 342 tnom_transp(iq)=TRIM(tchaine(iiq+1:)) 343 else 344 write(lunout,*) 'C''est l''ancienne version de traceur.def' 345 write(lunout,*) 'On suppose que les traceurs sont tous d''air' 346 tnom_0(iq)=tchaine 347 tnom_transp(iq) = 'air' 348 endif 349 write(lunout,*) 'tnom_0(iq)=<',trim(tnom_0(iq)),'>' 350 write(lunout,*) 'tnom_transp(iq)=<',trim(tnom_transp(iq)),'>' 351 352 ENDDO!DO iq=1,nqtrue 353 354 CLOSE(90) 239 IF (ANY(['lmdz', 'repr', 'coag', 'co2i'] == type_trac)) THEN 240 241 ! Continue to read tracer.def 242 DO iq=1,nqtrue 243 244 write(*,*) 'infotrac 237: iq=',iq 245 ! CRisi: ajout du nom du fluide transporteur 246 ! mais rester retro compatible 247 READ(90,'(I2,X,I2,X,A)',IOSTAT=IOstatus) hadv(iq),vadv(iq),tchaine 248 write(lunout,*) 'iq,hadv(iq),vadv(iq)=',iq,hadv(iq),vadv(iq) 249 write(lunout,*) 'tchaine=',trim(tchaine) 250 write(*,*) 'infotrac 238: IOstatus=',IOstatus 251 if (IOstatus.ne.0) CALL abort_gcm('infotrac_init','Pb dans la lecture de traceur.def',1) 252 ! Y-a-t-il 1 ou 2 noms de traceurs separes par un espace ? 253 iiq = INDEX(tchaine(1:LEN_TRIM(tchaine)),' ') 254 nouveau_traceurdef=iiq/=0 255 write(*,*) 'iiq,nouveau_traceurdef=',iiq,nouveau_traceurdef 256 if (nouveau_traceurdef) then 257 IF(iq==1) write(lunout,*) "Nouvelle version de traceur.def" 258 tnom_0 (iq) = tchaine(1:iiq-1) 259 tnom_transp(iq) = tchaine(iiq+1:) 260 else 261 IF(iq==1) write(lunout,*) "Nouvelle version de traceur.def: traceurs d'air uniquement" 262 tnom_0 (iq) = tchaine 263 tnom_transp(iq) = 'air' 264 endif 265 write(lunout,*) 'tnom_0(iq)=<',trim(tnom_0(iq)),'>' 266 write(lunout,*) 'tnom_transp(iq)=<',trim(tnom_transp(iq)),'>' 267 ENDDO!DO iq=1,nqtrue 268 269 CLOSE(90) 355 270 356 271 WRITE(lunout,*) trim(modname),': Valeur de traceur.def :' … … 362 277 IF ( planet_type=='earth') THEN 363 278 !CR: nombre de traceurs de l eau 364 IF (tnom_0(3) == 'H2Oi') THEN 365 nqo=3 366 ELSE 367 nqo=2 368 ENDIF 279 nqo=2; IF (tnom_0(3) == 'H2Oi') nqo=3 369 280 ! For Earth, water vapour & liquid tracers are not in the physics 370 281 nbtr=nqtrue-nqo … … 375 286 ENDIF 376 287 377 #ifdef CPP_StratAer 378 IF (type_trac == 'coag') THEN 379 nbtr_bin=0 380 nbtr_sulgas=0 381 DO iq=1,nqtrue 382 IF (tnom_0(iq)(1:3)=='BIN') THEN !check if tracer name contains 'BIN' 383 nbtr_bin=nbtr_bin+1 384 ENDIF 385 IF (tnom_0(iq)(1:3)=='GAS') THEN !check if tracer name contains 'GAS' 386 nbtr_sulgas=nbtr_sulgas+1 387 ENDIF 388 ENDDO 389 print*,'nbtr_bin=',nbtr_bin 390 print*,'nbtr_sulgas=',nbtr_sulgas 391 DO iq=1,nqtrue 392 IF (tnom_0(iq)=='GASOCS') THEN 393 id_OCS_strat=iq-nqo 394 ENDIF 395 IF (tnom_0(iq)=='GASSO2') THEN 396 id_SO2_strat=iq-nqo 397 ENDIF 398 IF (tnom_0(iq)=='GASH2SO4') THEN 399 id_H2SO4_strat=iq-nqo 400 ENDIF 401 IF (tnom_0(iq)=='BIN01') THEN 402 id_BIN01_strat=iq-nqo 403 ENDIF 404 IF (tnom_0(iq)=='GASTEST') THEN 405 id_TEST_strat=iq-nqo 406 ENDIF 407 ENDDO 408 print*,'id_OCS_strat =',id_OCS_strat 409 print*,'id_SO2_strat =',id_SO2_strat 410 print*,'id_H2SO4_strat=',id_H2SO4_strat 411 print*,'id_BIN01_strat=',id_BIN01_strat 412 ENDIF 288 ENDIF 289 !jyg< 290 ! 291 292 ! Transfert number of tracers to Reprobus 293 #ifdef REPROBUS 294 IF (type_trac == 'repr') CALL Init_chem_rep_trac(nbtr,nqo,tnom_0) 413 295 #endif 414 415 ENDIF ! (type_trac == 'lmdz' .OR. type_trac == 'repr' .OR. type_trac = 'coag' .OR. type_trac = 'co2i')416 !jyg<417 !418 419 ! Transfert number of tracers to Reprobus420 IF (type_trac == 'repr') THEN421 #ifdef REPROBUS422 CALL Init_chem_rep_trac(nbtr,nqo,tnom_0)423 #endif424 ENDIF425 296 ! 426 297 ! Allocate variables depending on nbtr … … 432 303 IF (type_trac == 'inca' .OR. type_trac == 'inco') THEN ! config_inca='aero' ou 'chem' 433 304 !>jyg 434 ! le module de chimie fournit les noms des traceurs 435 ! et les schemas d'advection associes. excepte pour ceux lus 436 ! dans traceur.def 437 438 DO iq=1,nqo+nqCO2 439 440 write(*,*) 'infotrac 237: iq=',iq 441 ! CRisi: ajout du nom du fluide transporteur 442 ! mais rester retro compatible 443 READ(90,'(I2,X,I2,X,A)',IOSTAT=IOstatus) hadv(iq),vadv(iq),tchaine 444 write(lunout,*) 'iq,hadv(iq),vadv(iq)=',iq,hadv(iq),vadv(iq) 445 write(lunout,*) 'tchaine=',trim(tchaine) 446 write(*,*) 'infotrac 238: IOstatus=',IOstatus 447 if (IOstatus.ne.0) then 448 CALL abort_gcm('infotrac_init','Pb dans la lecture de traceur.def',1) 449 endif 450 ! Y-a-t-il 1 ou 2 noms de traceurs? -> On regarde s'il y a un 451 ! espace ou pas au milieu de la chaine. 452 continu=.true. 453 nouveau_traceurdef=.false. 454 iiq=1 455 456 do while (continu) 457 if (tchaine(iiq:iiq).eq.' ') then 458 nouveau_traceurdef=.true. 459 continu=.false. 460 else if (iiq.lt.LEN_TRIM(tchaine)) then 461 iiq=iiq+1 462 else 463 continu=.false. 464 endif 465 enddo 466 467 write(*,*) 'iiq,nouveau_traceurdef=',iiq,nouveau_traceurdef 468 469 if (nouveau_traceurdef) then 470 write(lunout,*) 'C''est la nouvelle version de traceur.def' 471 tnom_0(iq)=tchaine(1:iiq-1) 472 tnom_transp(iq)=tchaine(iiq+1:) 473 else 474 write(lunout,*) 'C''est l''ancienne version de traceur.def' 475 write(lunout,*) 'On suppose que les traceurs sont tous d''air' 476 tnom_0(iq)=tchaine 477 tnom_transp(iq) = 'air' 478 endif 479 480 write(lunout,*) 'tnom_0(iq)=<',trim(tnom_0(iq)),'>' 481 write(lunout,*) 'tnom_transp(iq)=<',trim(tnom_transp(iq)),'>' 482 483 ENDDO !DO iq=1,nqo 484 CLOSE(90) 485 486 305 ! le module de chimie fournit les noms des traceurs et les schemas d'advection associes. 306 ! excepte pour ceux lus dans traceur.def 307 487 308 #ifdef INCA 488 CALL init_transport( & 489 hadv_inca, & 490 vadv_inca, & 491 conv_flg_inca, & 492 pbl_flg_inca, & 493 solsym_inca) 494 495 conv_flg(1+nqCO2:nbtr) = conv_flg_inca 496 pbl_flg(1+nqCO2:nbtr) = pbl_flg_inca 497 solsym(1+nqCO2:nbtr) = solsym_inca 498 499 IF (type_trac == 'inco') THEN 500 conv_flg(1:nqCO2) = 1 501 pbl_flg(1:nqCO2) = 1 502 solsym(1:nqCO2) = 'CO2' 503 ENDIF 309 CALL init_transport(hadv_inca, vadv_inca, conv_flg_inca, pbl_flg_inca, solsym_inca) 310 ! DC passive CO2 tracer is at index 1: H2O was removed ; nqCO2/=0 in "inco" case only 311 conv_flg(1:nqCO2) = 1; conv_flg(1+nqCO2:nbtr) = conv_flg_inca 312 pbl_flg(1:nqCO2) = 1; pbl_flg(1+nqCO2:nbtr) = pbl_flg_inca 313 solsym(1:nqCO2) = 'CO2'; solsym(1+nqCO2:nbtr) = solsym_inca 504 314 #endif 505 315 506 !jyg< 507 DO iq = nqo+nqCO2+1, nqtrue 508 hadv(iq) = hadv_inca(iq-nqo-nqCO2) 509 vadv(iq) = vadv_inca(iq-nqo-nqCO2) 510 tnom_0(iq)=solsym_inca(iq-nqo-nqCO2) 511 tnom_transp(iq) = 'air' 316 itr = 0 317 DO iq = 1, nqtot 318 IF(iq > nqo+nqCO2) THEN 319 itr = itr+1 320 hadv (iq) = hadv_inca (itr) 321 vadv (iq) = vadv_inca (itr) 322 tnom_0(iq) = solsym_inca(itr) 323 tnom_transp(iq) = 'air' 324 CYCLE 325 END IF 326 write(*,*) 'infotrac 237: iq=',iq 327 ! CRisi: ajout du nom du fluide transporteur en restant retro-compatible 328 READ(90,'(I2,X,I2,X,A)',IOSTAT=IOstatus) hadv(iq),vadv(iq),tchaine 329 write(lunout,*) 'iq,hadv(iq),vadv(iq)=',iq,hadv(iq),vadv(iq) 330 write(lunout,*) 'tchaine=',trim(tchaine) 331 write(*,*) 'infotrac 238: IOstatus=',IOstatus 332 if (IOstatus.ne.0) CALL abort_gcm('infotrac_init','Pb dans la lecture de traceur.def',1) 333 ! Y-a-t-il 1 ou 2 noms de traceurs separes par un espace ? 334 iiq = INDEX(tchaine(1:LEN_TRIM(tchaine)),' ') 335 nouveau_traceurdef=iiq/=0 336 write(*,*) 'iiq,nouveau_traceurdef=',iiq,nouveau_traceurdef 337 if (nouveau_traceurdef) then 338 IF(iq==1) write(lunout,*) "Nouvelle version de traceur.def" 339 tnom_0 (iq) = tchaine(1:iiq-1) 340 tnom_transp(iq) = tchaine(iiq+1:) 341 else 342 IF(iq==1) write(lunout,*) "Nouvelle version de traceur.def: traceurs d'air uniquement" 343 tnom_0 (iq) = tchaine 344 tnom_transp(iq) = 'air' 345 endif 346 write(lunout,*) 'tnom_0(iq)=<',trim(tnom_0(iq)),'>' 347 write(lunout,*) 'tnom_transp(iq)=<',trim(tnom_transp(iq)),'>' 512 348 END DO 513 349 CLOSE(90) 514 350 ENDIF ! (type_trac == 'inca' or 'inco') 515 351 … … 554 390 ! 555 391 ALLOCATE(tracers(nqtot)) 556 ALLOCATE(niadv(nqtot))557 392 558 393 !----------------------------------------------------------------------- … … 604 439 END DO 605 440 606 ! 607 ! Find vector keeping the correspodence between true and total tracers 608 ! 609 niadv(:)=0 610 iiq=0 441 WRITE(lunout,*) trim(modname),': Information stored in infotrac :' 442 WRITE(lunout,*) trim(modname),': iadv name long_name :' 443 611 444 DO iq=1,nqtot 612 IF(tracers(iq)%iadv.GE.0) THEN 613 ! True tracer 614 iiq=iiq+1 615 niadv(iiq)=iq 616 ENDIF 617 END DO 618 619 620 WRITE(lunout,*) trim(modname),': Information stored in infotrac :' 621 WRITE(lunout,*) trim(modname),': iadv niadv name long_name :' 622 623 DO iq=1,nqtot 624 WRITE(lunout,*) tracers(iq)%iadv,niadv(iq), ' ',trim(tracers(iq)%name),' ',trim(tracers(iq)%longName) 445 WRITE(lunout,*) tracers(iq)%iadv,' ',trim(tracers(iq)%name),' ',trim(tracers(iq)%longName) 625 446 END DO 626 447 … … 645 466 ! + verifier que tous les peres sont ecrits en premieres positions 646 467 ALLOCATE(iqfils(nqtot,nqtot)) 647 nqperes=0648 468 iqfils(:,:)=0 649 469 tracers(:)%iqParent=0 … … 652 472 ! ceci est un traceur pere 653 473 WRITE(lunout,*) 'Le traceur',iq,', appele ',trim(tnom_0(iq)),', est un pere' 654 nqperes=nqperes+1655 474 tracers(iq)%iqParent=0 656 475 else !if (tnom_transp(iq) == 'air') then … … 682 501 endif !if (tnom_transp(iq) == 'air') then 683 502 enddo !DO iq=1,nqtot 684 WRITE(lunout,*) 'infotrac: nq peres=',nqperes503 WRITE(lunout,*) 'infotrac: nqGen0=',COUNT(tracers(:)%parent == 'air') 685 504 WRITE(lunout,*) 'nqChilds=',tracers(:)%nqChilds 686 505 WRITE(lunout,*) 'iqParent=',tracers(:)%iqParent … … 738 557 tracers(:)%isH2Ofamily = [(tracers(iq)%gen0Name(1:3) == 'H2O', iq=1, nqtot)] 739 558 740 741 559 ! detecter quels sont les traceurs isotopiques parmi des traceurs 742 560 call infotrac_isoinit(tnom_0,nqtrue) … … 754 572 write(lunout,*) 'infotrac 704: nqtottr,nqtot,nqo=',nqtottr,nqtot,nqo 755 573 ! Rq: nqtottr n'est pas forcement egal a nbtr dans le cas ou new_iq /= nqtrue 756 ALLOCATE (itr_indice(nqtottr)) 757 itr_indice(:)=0 758 itr=0 759 do iq=nqo+1, nqtot 760 if (tracers(iq)%iso_iName.eq.0) then 761 itr=itr+1 762 write(*,*) 'itr=',itr 763 itr_indice(itr)=iq 764 endif !if (tracers(iq)%iso_iName.eq.0) then 765 enddo 766 if (itr.ne.nqtottr) then 574 if (COUNT(tracers(:)%iso_iName == 0) /= nqtottr) & 767 575 CALL abort_gcm('infotrac_init','pb dans le calcul de nqtottr',1) 768 endif769 write(lunout,*) 'itr_indice=',itr_indice770 576 ! endif !if (ntraciso.gt.0) then 771 577
Note: See TracChangeset
for help on using the changeset viewer.