Changeset 1036 for trunk/LMDZ.MARS/libf/dyn3d
- Timestamp:
- Sep 11, 2013, 2:34:44 PM (11 years ago)
- Location:
- trunk/LMDZ.MARS/libf/dyn3d
- Files:
-
- 1 added
- 5 deleted
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.MARS/libf/dyn3d/calfis.F
r697 r1036 82 82 REAL pteta(iip1,jjp1,llm) 83 83 REAL pmasse(iip1,jjp1,llm) 84 REAL pq(iip1,jjp1,llm,nq mx)84 REAL pq(iip1,jjp1,llm,nq) 85 85 REAL pphis(iip1,jjp1) 86 86 REAL pphi(iip1,jjp1,llm) … … 89 89 REAL pducov(iip1,jjp1,llm) 90 90 REAL pdteta(iip1,jjp1,llm) 91 REAL pdq(iip1,jjp1,llm,nq mx)91 REAL pdq(iip1,jjp1,llm,nq) 92 92 c 93 93 REAL pw(iip1,jjp1,llm) … … 100 100 REAL pdufi(iip1,jjp1,llm) 101 101 REAL pdhfi(iip1,jjp1,llm) 102 REAL pdqfi(iip1,jjp1,llm,nq mx)102 REAL pdqfi(iip1,jjp1,llm,nq) 103 103 REAL pdpsfi(iip1,jjp1) 104 104 logical tracer … … 113 113 c 114 114 REAL zufi(ngridmx,llm), zvfi(ngridmx,llm) 115 REAL ztfi(ngridmx,llm),zqfi(ngridmx,llm,nq mx)115 REAL ztfi(ngridmx,llm),zqfi(ngridmx,llm,nq) 116 116 c 117 117 REAL zvervel(ngridmx,llm) 118 118 c 119 119 REAL zdufi(ngridmx,llm),zdvfi(ngridmx,llm) 120 REAL zdtfi(ngridmx,llm),zdqfi(ngridmx,llm,nq mx)120 REAL zdtfi(ngridmx,llm),zdqfi(ngridmx,llm,nq) 121 121 REAL zdpsrf(ngridmx) 122 122 c … … 185 185 airefi(ngridmx)=airefi(ngridmx)*iim 186 186 187 CALL inifis(ngridmx,llm, day_ini,daysec,dtphys,187 CALL inifis(ngridmx,llm,nq,day_ini,daysec,dtphys, 188 188 . latfi,lonfi,airefi,rad,g,r,cpp) 189 189 ENDIF … … 275 275 c 43.bis Taceurs (en kg/kg) 276 276 c -------------------------- 277 DO iq=1,nq mx277 DO iq=1,nq 278 278 DO l=1,llm 279 279 zqfi(1,l,iq) = pq(1,1,l,iq) … … 466 466 c --------------------- 467 467 468 DO iq=1,nq mx468 DO iq=1,nq 469 469 DO l=1,llm 470 470 DO i=1,iip1 -
trunk/LMDZ.MARS/libf/dyn3d/dynetat0.F
r999 r1036 3 3 4 4 use netcdf 5 use infotrac, only: tnom 5 6 6 7 IMPLICIT NONE … … 37 38 #include "serre.h" 38 39 #include "logic.h" 39 #include "advtrac.h"40 !#include "advtrac.h" 40 41 #include "control.h" 41 42 … … 380 381 ! WRITE(str3(2:3),'(i2.2)') iq 381 382 ! ierr = NF_INQ_VARID (nid, str3, nvarid) 382 ! NB: tracers are now read in using their name ('tnom' from advtrac.h)383 ! NB: tracers are now read in using their name ('tnom' from infotrac) 383 384 ! write(*,*) " loading tracer:",trim(tnom(iq)) 384 385 ierr=nf90_inq_varid(nid,tnom(iq),nvarid) … … 404 405 c case when new tracer are added in addition to old ones 405 406 write(*,*)'tracers 1 to ', nqold,'were already present' 406 write(*,*)'tracers ', nqold+1,' to ', nq mx,'are new'407 write(*,*)'tracers ', nqold+1,' to ', nq,'are new' 407 408 ! yes=' ' 408 409 ! do while ((yes.ne.'y').and.(yes.ne.'n')) 409 410 ! write(*,*) 'Would you like to reindex tracer # 1 ->',nqold 410 ! write(*,*) 'to #',nq mx-nqold+1,'->', nqmx,' (y or n) ?'411 ! write(*,*) 'to #',nq-nqold+1,'->', nq,' (y or n) ?' 411 412 ! read(*,fmt='(a)') yes 412 413 ! end do … … 416 417 ! do j=1,jjp1 417 418 ! do i=1,iip1 418 ! do iq=nq mx,nqmx-nqold+1,-1419 ! q(i,j,l,iq)=q(i,j,l,iq-nq mx+nqold)419 ! do iq=nq,nq-nqold+1,-1 420 ! q(i,j,l,iq)=q(i,j,l,iq-nq+nqold) 420 421 ! end do 421 ! do iq=nq mx-nqold,1,-1422 ! do iq=nq-nqold,1,-1 422 423 ! q(i,j,l,iq)= 0. 423 424 ! end do -
trunk/LMDZ.MARS/libf/dyn3d/dynredem.F
r999 r1036 1 1 SUBROUTINE dynredem0(fichnom,idayref,anneeref,phis,nq) 2 use infotrac, only: tnom 2 3 IMPLICIT NONE 3 4 c======================================================================= … … 17 18 #include "description.h" 18 19 #include "serre.h" 19 #include "advtrac.h"20 !#include "advtrac.h" 20 21 c Arguments: 21 22 c ---------- … … 963 964 SUBROUTINE dynredem1(fichnom,time, 964 965 . vcov,ucov,teta,q,nq,masse,ps) 966 use infotrac, only: nqtot, tnom 965 967 IMPLICIT NONE 966 968 c================================================================= … … 973 975 #include "comvert.h" 974 976 #include "comgeom.h" 975 #include"advtrac.h"977 !#include"advtrac.h" 976 978 977 979 INTEGER nq, l … … 979 981 REAL teta(ip1jmp1,llm) 980 982 REAL ps(ip1jmp1),masse(ip1jmp1,llm) 981 REAL q(iip1,jjp1,llm,nq mx)983 REAL q(iip1,jjp1,llm,nqtot) 982 984 REAL q3d(iip1,jjp1,llm) !temporary variable 983 985 CHARACTER*(*) fichnom -
trunk/LMDZ.MARS/libf/dyn3d/gcm.F
r999 r1036 1 1 PROGRAM gcm 2 2 3 use infotrac, only: iniadvtrac, nqtot, iadv 3 4 IMPLICIT NONE 4 5 … … 48 49 #include "tracstoke.h" 49 50 #include "sponge.h" 50 #include"advtrac.h"51 !#include"advtrac.h" 51 52 52 53 INTEGER*4 iday ! jour julien … … 57 58 REAL vcov(ip1jm,llm),ucov(ip1jmp1,llm) ! vents covariants 58 59 real, dimension(ip1jmp1,llm) :: teta ! temperature potentielle 59 REAL q(ip1jmp1,llm,nqmx)! champs advectes60 REAL,allocatable :: q(:,:,:) ! champs advectes 60 61 REAL ps(ip1jmp1) ! pression au sol 61 62 REAL pext(ip1jmp1) ! pression extensive … … 80 81 c tendances dynamiques 81 82 REAL dv(ip1jm,llm),du(ip1jmp1,llm) 82 REAL dteta(ip1jmp1,llm),dq(ip1jmp1,llm,nqmx),dp(ip1jmp1) 83 REAL dteta(ip1jmp1,llm),dp(ip1jmp1) 84 REAL,ALLOCATABLE :: dq(:,:,:) 83 85 84 86 c tendances de la dissipation … … 88 90 c tendances physiques 89 91 REAL dvfi(ip1jm,llm),dufi(ip1jmp1,llm) 90 REAL dhfi(ip1jmp1,llm),dqfi(ip1jmp1,llm,nqmx),dpfi(ip1jmp1) 92 REAL dhfi(ip1jmp1,llm),dpfi(ip1jmp1) 93 REAL,ALLOCATABLE :: dqfi(:,:,:) 91 94 92 95 c variables pour le fichier histoire … … 95 98 REAL tppn(iim),tpps(iim),tpn,tps 96 99 c 97 ! INTEGER iadv(nqmx) ! indice schema de transport pour le traceur iq98 100 99 101 INTEGER itau,itaufinp1,iav … … 124 126 LOGICAL tracer 125 127 data tracer/.true./ 126 INTEGER nq128 ! INTEGER nq 127 129 128 130 C Calendrier … … 142 144 143 145 c----------------------------------------------------------------------- 144 c Initialize tracers using iniadvtrac (Ehouarn, oct 2008)145 146 CALL defrun_new( 99, .TRUE. ) 146 147 147 CALL iniadvtrac(nq,numvanle) 148 149 CALL dynetat0("start.nc",nqmx,vcov,ucov, 148 ! Initialize tracers 149 call iniadvtrac(nqtot,numvanle) 150 ! Allocation de la tableau q : champs advectes 151 allocate(q(ip1jmp1,llm,nqtot)) 152 allocate(dq(ip1jmp1,llm,nqtot)) 153 allocate(dqfi(ip1jmp1,llm,nqtot)) 154 155 CALL dynetat0("start.nc",nqtot,vcov,ucov, 150 156 . teta,q,masse,ps,phis,time_0) 151 157 … … 245 251 . 'c''est a dire du jour',i7,3x,'au jour',i7//) 246 252 247 CALL dynredem0("restart.nc",day_ini,anne_ini,phis,nq mx)253 CALL dynredem0("restart.nc",day_ini,anne_ini,phis,nqtot) 248 254 249 255 ecripar = .TRUE. … … 253 259 254 260 c Quelques initialisations pour les traceurs 255 call initial0(ijp1llm*nqmx,dq)261 dq(:,:,:)=0 256 262 c istdyn=day_step/4 ! stockage toutes les 6h=1jour/4 257 263 c istphy=istdyn/iphysiq … … 348 354 IF( forward. OR . leapf ) THEN 349 355 350 DO iq = 1, nq mx356 DO iq = 1, nqtot 351 357 c 352 358 IF ( iadv(iq).EQ.1.OR.iadv(iq).EQ.2 ) THEN 353 359 CALL traceur( iq,iadv,q,teta,pk,w, pbaru, pbarv, dq ) 354 360 355 ELSE IF( iq.EQ. nq mx) THEN361 ELSE IF( iq.EQ. nqtot ) THEN 356 362 c 357 363 iapp_tracvl = 5 … … 361 367 c 362 368 363 CALL vanleer(numvanle,iapp_tracvl,nq mx,q,pbaru,pbarv,369 CALL vanleer(numvanle,iapp_tracvl,nqtot,q,pbaru,pbarv, 364 370 * p, masse, dq, iadv(1), teta, pk ) 365 371 … … 422 428 ENDIF 423 429 c 424 CALL calfis( nq mx, lafin ,rdayvrai,rday_ecri,time ,430 CALL calfis( nqtot, lafin ,rdayvrai,rday_ecri,time , 425 431 $ ucov,vcov,teta,q,masse,ps,p,pk,phis,phi , 426 432 $ du,dv,dteta,dq,w, dufi,dvfi,dhfi,dqfi,dpfi,tracer) … … 429 435 c ajout des tendances physiques: 430 436 c ------------------------------ 431 CALL addfi( nq mx, dtphys, leapf, forward ,437 CALL addfi( nqtot, dtphys, leapf, forward , 432 438 $ ucov, vcov, teta , q ,ps , masse, 433 439 $ dufi, dvfi, dhfi , dqfi ,dpfi ) … … 540 546 c iav=0 541 547 c ENDIF 542 c CALL writedynav(histaveid, nq mx, itau,vcov ,548 c CALL writedynav(histaveid, nqtot, itau,vcov , 543 549 c , ucov,teta,pk,phi,q,masse,ps,phis) 544 550 c ENDIF … … 556 562 . ' date=',REAL(itau)/REAL(day_step) 557 563 CALL dynredem1("restart.nc",REAL(itau)/REAL(day_step), 558 . vcov,ucov,teta,q,nq mx,masse,ps)564 . vcov,ucov,teta,q,nqtot,masse,ps) 559 565 560 566 CLOSE(99) … … 625 631 iav=0 626 632 ENDIF 627 c CALL writedynav(histaveid, nq mx, itau,vcov ,633 c CALL writedynav(histaveid, nqtot, itau,vcov , 628 634 c , ucov,teta,pk,phi,q,masse,ps,phis) 629 635 … … 636 642 CALL dynredem1("restart.nc", 637 643 . REAL(itau)/REAL(day_step), 638 . vcov,ucov,teta,q,nq mx,masse,ps)644 . vcov,ucov,teta,q,nqtot,masse,ps) 639 645 640 646 forward = .TRUE. -
trunk/LMDZ.MARS/libf/dyn3d/lect_start_archive.F
r999 r1036 1 SUBROUTINE lect_start_archive( date,tsurf,tsoil,emis,q2,1 SUBROUTINE lect_start_archive(nqtot,date,tsurf,tsoil,emis,q2, 2 2 & t,ucov,vcov,ps,co2ice,h,phisold_newgrid, 3 3 & q,qsurf,surfith,nid) … … 16 16 c 17 17 c======================================================================= 18 18 use infotrac, only: tnom 19 19 implicit none 20 20 … … 38 38 #include "netcdf.inc" 39 39 !#include "tracer.h" 40 #include"advtrac.h"40 !#include"advtrac.h" 41 41 c======================================================================= 42 42 c Declarations … … 49 49 c et autres: 50 50 c---------- 51 INTEGER lnblnk 52 EXTERNAL lnblnk 51 integer,intent(in) :: nqtot ! number of advected tracers 53 52 54 53 c Variables pour les lectures des fichiers "ini" … … 85 84 REAL vcov(iip1,jjm,llm),ucov(iip1,jjp1,llm) ! vents covariants 86 85 REAL h(iip1,jjp1,llm),ps(iip1,jjp1) 87 REAL q(iip1,jjp1,llm,nq mx),qtot(iip1,jjp1,llm)86 REAL q(iip1,jjp1,llm,nqtot),qtot(iip1,jjp1,llm) 88 87 89 88 c autre variables dynamique nouvelle grille … … 103 102 REAL co2ice(ngridmx) ! CO2 ice layer 104 103 REAL emis(ngridmx) 105 REAL q2(ngridmx,nlayermx+1),qsurf(ngridmx,nq mx)104 REAL q2(ngridmx,nlayermx+1),qsurf(ngridmx,nqtot) 106 105 c REAL phisfi(ngridmx) 107 106 … … 130 129 real inertiedatS(iip1,jjp1,nsoilmx) 131 130 real co2iceS(iip1,jjp1),emisS(iip1,jjp1) 132 REAL q2S(iip1,jjp1,llm+1),qsurfS(iip1,jjp1,nq mx)131 REAL q2S(iip1,jjp1,llm+1),qsurfS(iip1,jjp1,nqtot) 133 132 134 133 real ptotal, co2icetotal … … 193 192 ! check if tracers follow old naming convention (q01, q02, q03, ...) 194 193 counter=0 195 do iq=1,nq mx194 do iq=1,nqtot 196 195 txt= " " 197 196 write(txt,'(a1,i2.2)')'q',iq … … 205 204 endif 206 205 enddo 207 if (counter.eq.nq mx) then206 if (counter.eq.nqtot) then 208 207 write(*,*) "lect_start_archive: tracers seem to follow old ", 209 208 & "naming convention (q01, q02,...)" … … 318 317 allocate(psold(imold+1,jmold+1)) 319 318 allocate(phisold(imold+1,jmold+1)) 320 allocate(qold(imold+1,jmold+1,lmold,nq mx))319 allocate(qold(imold+1,jmold+1,lmold,nqtot)) 321 320 allocate(co2iceold(imold+1,jmold+1)) 322 321 allocate(tsurfold(imold+1,jmold+1)) … … 331 330 allocate(surfithold(imold+1,jmold+1)) 332 331 allocate(mlayerold(nsoilold)) 333 allocate(qsurfold(imold+1,jmold+1,nq mx))332 allocate(qsurfold(imold+1,jmold+1,nqtot)) 334 333 335 334 allocate(var (imold+1,jmold+1,llm)) … … 748 747 c ------------------------------------------- 749 748 ! Surface tracers: 750 qsurfold(1:imold+1,1:jmold+1,1:nq mx)=0751 752 DO iq=1,nq mx749 qsurfold(1:imold+1,1:jmold+1,1:nqtot)=0 750 751 DO iq=1,nqtot 753 752 IF (oldtracernames) THEN 754 753 txt=" " … … 787 786 ENDIF 788 787 789 ENDDO ! of DO iq=1,nq mx788 ENDDO ! of DO iq=1,nqtot 790 789 791 790 !----------------------------------------------------------------------- … … 936 935 c ------------------------------------------- 937 936 ! Tracers: 938 qold(1:imold+1,1:jmold+1,1:lmold,1:nq mx)=0939 940 DO iq=1,nq mx937 qold(1:imold+1,1:jmold+1,1:lmold,1:nqtot)=0 938 939 DO iq=1,nqtot 941 940 IF (oldtracernames) THEN 942 941 txt=" " … … 966 965 ENDIF 967 966 968 ENDDO ! of DO iq=1,nq mx967 ENDDO ! of DO iq=1,nqtot 969 968 970 969 … … 1273 1272 1274 1273 c traceurs surface 1275 do iq = 1, nq mx1274 do iq = 1, nqtot 1276 1275 call interp_horiz(qsurfold(1,1,iq) ,qsurfs(1,1,iq), 1277 1276 & imold,jmold,iim,jjm,1, … … 1279 1278 enddo 1280 1279 1281 call gr_dyn_fi (nq mx,iim+1,jjm+1,ngridmx,qsurfs,qsurf)1280 call gr_dyn_fi (nqtot,iim+1,jjm+1,ngridmx,qsurfs,qsurf) 1282 1281 1283 1282 c traceurs 3D 1284 do iq = 1, nq mx1283 do iq = 1, nqtot 1285 1284 call interp_vert(qold(1,1,1,iq),var,lmold,llm, 1286 1285 & apsold,bpsold,aps,bps,psold,(imold+1)*(jmold+1)) … … 1322 1321 1323 1322 c Periodicite : 1324 do iq = 1, nq mx1323 do iq = 1, nqtot 1325 1324 do l=1, llm 1326 1325 do j = 1, jjp1 -
trunk/LMDZ.MARS/libf/dyn3d/newstart.F
r999 r1036 16 16 17 17 ! to use 'getin' 18 USE ioipsl_getincom 19 18 use ioipsl_getincom, only: getin 19 use infotrac, only: iniadvtrac, nqtot, tnom 20 use tracer_mod, only: noms, igcm_h2o_vap, igcm_h2o_ice 20 21 implicit none 21 22 … … 41 42 #include "serre.h" 42 43 #include "netcdf.inc" 43 #include"advtrac.h"44 #include"tracer.h"44 !#include"advtrac.h" 45 !#include"tracer.h" 45 46 #include "datafile.h" 46 47 c======================================================================= … … 72 73 REAL vcov(iip1,jjm,llm),ucov(iip1,jjp1,llm) ! vents covariants 73 74 REAL phis(iip1,jjp1) 74 REAL q(iip1,jjp1,llm,nqmx) ! champs advectes75 REAL,ALLOCATABLE :: q(:,:,:,:) ! champs advectes 75 76 76 77 c autre variables dynamique nouvelle grille … … 98 99 REAL co2ice(ngridmx) ! CO2 ice layer 99 100 REAL emis(ngridmx) ! surface emissivity 100 REAL qsurf(ngridmx,nqmx)101 REAL,ALLOCATABLE :: qsurf(:,:) 101 102 REAL q2(ngridmx,nlayermx+1) 102 103 ! REAL rnaturfi(ngridmx) … … 179 180 pa= 20 ! for Mars, instead of 500 (Earth) 180 181 182 ! Load tracer number and names: 183 call iniadvtrac(nqtot,numvanle) 184 ! allocate arrays 185 allocate(q(iip1,jjp1,llm,nqtot)) 186 allocate(qsurf(ngridmx,nqtot)) 187 181 188 c======================================================================= 182 189 c Choice of the start file(s) to use … … 323 330 c INITIALISATIONS DIVERSES 324 331 c======================================================================= 325 ! Load tracer names:326 call iniadvtrac(nq,numvanle)327 332 328 333 day_step=180 !?! Note: day_step is a common in "control.h" … … 357 362 ! (for instance initracer needs to know about some flags, and/or 358 363 ! 'datafile' path may be changed by user) 359 call inifis(ngridmx,llm, day_ini,daysec,dtphys,364 call inifis(ngridmx,llm,nqtot,day_ini,daysec,dtphys, 360 365 & latfi,lonfi,airefi,rad,g,r,cpp) 361 366 … … 399 404 400 405 write(*,*) 'Reading file START_ARCHIVE' 401 CALL lect_start_archive( date,tsurf,tsoil,emis,q2,406 CALL lect_start_archive(nqtot,date,tsurf,tsoil,emis,q2, 402 407 . t,ucov,vcov,ps,co2ice,teta,phisold_newgrid,q,qsurf, 403 408 & surfith,nid) … … 415 420 write(*,*) 'Reading file START' 416 421 fichnom = 'start.nc' 417 CALL dynetat0(fichnom,nq mx,vcov,ucov,teta,q,masse,422 CALL dynetat0(fichnom,nqtot,vcov,ucov,teta,q,masse, 418 423 . ps,phis,time) 419 424 420 425 write(*,*) 'Reading file STARTFI' 421 426 fichnom = 'startfi.nc' 422 CALL phyetat0 (fichnom,tab0,Lmodif,nsoilmx,nq mx,427 CALL phyetat0 (fichnom,tab0,Lmodif,nsoilmx,nqtot, 423 428 . day_ini,time, 424 429 . tsurf,tsoil,emis,q2,qsurf,co2ice) … … 448 453 ! rename them 449 454 count=0 450 do iq=1,nq mx455 do iq=1,nqtot 451 456 txt=" " 452 457 write(txt,'(a1,i2.2)') 'q',iq … … 454 459 count=count+1 455 460 endif 456 enddo ! of do iq=1,nq mx461 enddo ! of do iq=1,nqtot 457 462 458 463 ! initialize tracer names noms(:) and indexes (igcm_co2, igcm_h2o_vap, ...) 459 call initracer( qsurf,co2ice)464 call initracer(ngridmx,nqtot,qsurf,co2ice) 460 465 461 if (count.eq.nq mx) then466 if (count.eq.nqtot) then 462 467 write(*,*) 'Newstart: updating tracer names' 463 468 ! copy noms(:) to tnom(:) to have matching tracer names in physics 464 469 ! and dynamics 465 tnom(1:nq mx)=noms(1:nqmx)470 tnom(1:nqtot)=noms(1:nqtot) 466 471 endif 467 472 … … 693 698 if (yes.eq.'y') then 694 699 write(*,*) 'OK : conservation of tracer total mass' 695 DO iq =1, nq mx700 DO iq =1, nqtot 696 701 DO l=1,llm 697 702 DO j=1,jjp1 … … 712 717 do while (yes.eq.'y') 713 718 write(*,*) 'Which tracer name do you want to change ?' 714 do iq=1,nq mx719 do iq=1,nqtot 715 720 write(*,'(i3,a3,a20)')iq,' : ',trim(tnom(iq)) 716 721 enddo 717 722 write(*,'(a35,i3)') 718 & '(enter tracer number; between 1 and ',nq mx723 & '(enter tracer number; between 1 and ',nqtot 719 724 write(*,*)' or any other value to quit this option)' 720 725 read(*,*) iq 721 if ((iq.ge.1).and.(iq.le.nq mx)) then726 if ((iq.ge.1).and.(iq.le.nqtot)) then 722 727 write(*,*)'Change tracer name ',trim(tnom(iq)),' to ?' 723 728 read(*,*) txt … … 728 733 ! inapropiate value of iq; quit this option 729 734 yes='n' 730 endif ! of if ((iq.ge.1).and.(iq.le.nq mx))735 endif ! of if ((iq.ge.1).and.(iq.le.nqtot)) 731 736 enddo ! of do while (yes.ne.'y') 732 737 … … 736 741 c mise a 0 des q (traceurs) 737 742 write(*,*) 'Tracers set to 0 (1.E-30 in fact)' 738 DO iq =1, nq mx743 DO iq =1, nqtot 739 744 DO l=1,llm 740 745 DO j=1,jjp1 … … 747 752 748 753 c set surface tracers to zero 749 DO iq =1, nq mx754 DO iq =1, nqtot 750 755 DO ig=1,ngridmx 751 756 qsurf(ig,iq)=0. … … 757 762 else if (trim(modif) .eq. 'q=x') then 758 763 write(*,*) 'Which tracer do you want to modify ?' 759 do iq=1,nq mx764 do iq=1,nqtot 760 765 write(*,*)iq,' : ',trim(tnom(iq)) 761 766 enddo 762 write(*,*) '(choose between 1 and ',nq mx,')'767 write(*,*) '(choose between 1 and ',nqtot,')' 763 768 read(*,*) iq 764 if ((iq.lt.1).or.(iq.gt.nq mx)) then769 if ((iq.lt.1).or.(iq.gt.nqtot)) then 765 770 ! wrong value for iq, go back to menu 766 771 write(*,*) "wrong input value:",iq … … 793 798 write(*,*) "followed by 2nd, etc. up to top of atmosphere)" 794 799 write(*,*) 'Which tracer do you want to set?' 795 do iq=1,nq mx800 do iq=1,nqtot 796 801 write(*,*)iq,' : ',trim(tnom(iq)) 797 802 enddo 798 write(*,*) '(choose between 1 and ',nq mx,')'803 write(*,*) '(choose between 1 and ',nqtot,')' 799 804 read(*,*) iq 800 if ((iq.lt.1).or.(iq.gt.nq mx)) then805 if ((iq.lt.1).or.(iq.gt.nqtot)) then 801 806 ! wrong value for iq, go back to menu 802 807 write(*,*) "wrong input value:",iq … … 853 858 endif 854 859 855 call inichim_newstart( q, qsurf, ps, flagh2o, flagthermo)860 call inichim_newstart(nq, q, qsurf, ps, flagh2o, flagthermo) 856 861 857 862 ! We want to have the very same value at lon -180 and lon 180 858 863 do l = 1,llm 859 864 do j = 1,jjp1 860 do iq = 1,nq mx865 do iq = 1,nqtot 861 866 q(iip1,j,l,iq) = q(1,j,l,iq) 862 867 end do … … 892 897 do l = 1,llm 893 898 do j = 1,jjp1 894 do iq = 1,nq mx899 do iq = 1,nqtot 895 900 q(iip1,j,l,iq) = q(1,j,l,iq) 896 901 end do … … 1460 1465 c $ phi,conser,du,dv,dteta,dp,w, pbaru,pbarv, day_ini ) 1461 1466 1462 CALL dynredem0("restart.nc",day_ini,anneeref,phis,nq mx)1467 CALL dynredem0("restart.nc",day_ini,anneeref,phis,nqtot) 1463 1468 CALL dynredem1("restart.nc",hour_ini,vcov,ucov,teta,q, 1464 . nq mx,masse,ps)1469 . nqtot,masse,ps) 1465 1470 C 1466 1471 C Ecriture etat initial physique 1467 1472 C 1468 1473 1469 call physdem0("restartfi.nc",lonfi,latfi,nsoilmx,nq mx,1474 call physdem0("restartfi.nc",lonfi,latfi,nsoilmx,nqtot, 1470 1475 . dtphys,real(day_ini),0.0, 1471 1476 . airefi,albfi,ithfi,zmea,zstd,zsig,zgam,zthe) 1472 call physdem1("restartfi.nc",nsoilmx,nq mx,1477 call physdem1("restartfi.nc",nsoilmx,nqtot, 1473 1478 . dtphys,hour_ini, 1474 1479 . tsurf,tsoil,co2ice,emis,q2,qsurf) -
trunk/LMDZ.MARS/libf/dyn3d/paramet.h
r38 r1036 3 3 4 4 INTEGER iip1,iip2,iip3,jjp1,llmp1,llmp2,llmm1 5 INTEGER kftd,ip1jm,ip1jmp1,ip1jmi1,ijp1llm5 INTEGER ip1jm,ip1jmp1,ip1jmi1,ijp1llm 6 6 INTEGER ijmllm,mvar 7 7 INTEGER jcfil,jcfllm … … 10 10 PARAMETER( jjp1=jjm+1-1/jjm) 11 11 PARAMETER( llmp1 = llm+1, llmp2 = llm+2, llmm1 = llm-1 ) 12 PARAMETER( kftd = iim/2 -ndm )13 12 PARAMETER( ip1jm = iip1*jjm, ip1jmp1= iip1*jjp1 ) 14 13 PARAMETER( ip1jmi1= ip1jm - iip1 ) -
trunk/LMDZ.MARS/libf/dyn3d/start2archive.F
r999 r1036 19 19 c======================================================================= 20 20 21 use infotrac, only: iniadvtrac, nqtot, tnom 21 22 implicit none 22 23 … … 35 36 #include "dimphys.h" 36 37 #include "comsoil.h" 37 #include"advtrac.h"38 !#include"advtrac.h" 38 39 #include "netcdf.inc" 39 40 … … 46 47 REAL vcov(ip1jm,llm),ucov(ip1jmp1,llm) ! vents covariants 47 48 REAL teta(ip1jmp1,llm) ! temperature potentielle 48 REAL q(ip1jmp1,llm,nqmx)! champs advectes49 REAL,ALLOCATABLE :: q(:,:,:) ! champs advectes 49 50 REAL pks(ip1jmp1) ! exner (f pour filtre) 50 51 REAL pk(ip1jmp1,llm) … … 61 62 REAL tsoil(ngridmx,nsoilmx) ! Soil temperature 62 63 REAL co2ice(ngridmx) ! CO2 ice layer 63 REAL q2(ngridmx,nlayermx+1),qsurf(ngridmx,nqmx) 64 REAL q2(ngridmx,nlayermx+1) 65 REAL,ALLOCATABLE :: qsurf(:,:) 64 66 REAL emis(ngridmx) 65 67 INTEGER start,length … … 75 77 REAL ithS(ip1jmp1,nsoilmx) ! Soil Thermal Inertia 76 78 REAL co2iceS(ip1jmp1) 77 REAL q2S(ip1jmp1,llm+1),qsurfS(ip1jmp1,nqmx) 79 REAL q2S(ip1jmp1,llm+1) 80 REAL,ALLOCATABLE :: qsurfS(:,:) 78 81 REAL emisS(ip1jmp1) 79 82 … … 116 119 c Lecture des donnees 117 120 c======================================================================= 118 ! Load tracer names: 119 call iniadvtrac(nq,numvanle) 121 ! Load tracer number and names: 122 call iniadvtrac(nqtot,numvanle) 123 124 ! allocate arrays: 125 allocate(q(ip1jmp1,llm,nqtot)) 126 allocate(qsurf(ngridmx,nqtot)) 127 allocate(qsurfS(ip1jmp1,nqtot)) 120 128 121 129 fichnom = 'start.nc' 122 CALL dynetat0(fichnom,nq mx,vcov,ucov,teta,q,masse,130 CALL dynetat0(fichnom,nqtot,vcov,ucov,teta,q,masse, 123 131 . ps,phis,timedyn) 124 132 … … 127 135 Lmodif=0 128 136 129 CALL phyetat0 (fichnom,0,Lmodif,nsoilmx,nq mx,day_ini_fi,timefi,137 CALL phyetat0 (fichnom,0,Lmodif,nsoilmx,nqtot,day_ini_fi,timefi, 130 138 . tsurf,tsoil,emis,q2,qsurf,co2ice) 131 139 … … 233 241 call gr_fi_dyn(1,ngridmx,iip1,jjp1,emis,emisS) 234 242 call gr_fi_dyn(llm+1,ngridmx,iip1,jjp1,q2,q2S) 235 call gr_fi_dyn(nq mx,ngridmx,iip1,jjp1,qsurf,qsurfS)243 call gr_fi_dyn(nqtot,ngridmx,iip1,jjp1,qsurf,qsurfS) 236 244 237 245 c======================================================================= … … 334 342 335 343 c----------------------------------------------------------------------- 336 c Ecriture du champs q ( q[1,nq mx] )337 c----------------------------------------------------------------------- 338 do iq=1,nq mx344 c Ecriture du champs q ( q[1,nqtot] ) 345 c----------------------------------------------------------------------- 346 do iq=1,nqtot 339 347 c write(str2,'(i2.2)') iq 340 348 c call write_archive(nid,ntime,'q'//str2,'tracer','kg/kg', … … 344 352 end do 345 353 c----------------------------------------------------------------------- 346 c Ecriture du champs qsurf ( qsurf[1,nq mx] )347 c----------------------------------------------------------------------- 348 do iq=1,nq mx354 c Ecriture du champs qsurf ( qsurf[1,nqtot] ) 355 c----------------------------------------------------------------------- 356 do iq=1,nqtot 349 357 c write(str2,'(i2.2)') iq 350 358 c call write_archive(nid,ntime,'qsurf'//str2,'Tracer on surface', -
trunk/LMDZ.MARS/libf/dyn3d/test_period.F
r1005 r1036 6 6 c teta, q , p et phis .......... 7 7 c 8 c IMPLICIT NONE 8 use infotrac,only: nqtot 9 IMPLICIT NONE 9 10 c 10 11 #include "dimensions.h" … … 14 15 c 15 16 REAL ucov(ip1jmp1,llm), vcov(ip1jm,llm), teta(ip1jmp1,llm) , 16 , q(ip1jmp1,llm,nq mx), p(ip1jmp1,llmp1), phis(ip1jmp1)17 , q(ip1jmp1,llm,nqtot), p(ip1jmp1,llmp1), phis(ip1jmp1) 17 18 c 18 19 c ..... Variables locales ..... … … 56 57 57 58 c 58 DO nq =1, nq mx59 DO nq =1, nqtot 59 60 DO l =1, llm 60 61 DO ij = 1, ip1jmp1, iip1
Note: See TracChangeset
for help on using the changeset viewer.