Changeset 1146 for LMDZ4/trunk/libf/dyn3d/leapfrog.F
- Timestamp:
- Apr 9, 2009, 12:11:35 PM (15 years ago)
- Location:
- LMDZ4/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ4/trunk
-
Property
svn:mergeinfo
set to
/LMDZ4/branches/LMDZ4-dev merged eligible
-
Property
svn:mergeinfo
set to
-
LMDZ4/trunk/libf/dyn3d/leapfrog.F
r1060 r1146 2 2 c 3 3 c 4 SUBROUTINE leapfrog(ucov,vcov,teta,ps,masse,phis, nq,q,clesphy0,4 SUBROUTINE leapfrog(ucov,vcov,teta,ps,masse,phis,q,clesphy0, 5 5 & time_0) 6 6 7 7 8 8 cIM : pour sortir les param. du modele dans un fis. netcdf 110106 9 USE IOIPSL 9 #ifdef CPP_IOIPSL 10 use IOIPSL 11 #endif 12 USE infotrac 10 13 11 14 IMPLICIT NONE … … 56 59 #include "com_io_dyn.h" 57 60 #include "iniprint.h" 58 #include "advtrac.h"59 c#include "tracstoke.h"60 61 61 #include "academic.h" 62 62 63 63 ! FH 2008/05/09 On elimine toutes les clefs physiques dans la dynamique 64 64 ! #include "clesphys.h" 65 66 integer nq67 65 68 66 INTEGER longcles … … 76 74 REAL vcov(ip1jm,llm),ucov(ip1jmp1,llm) ! vents covariants 77 75 REAL teta(ip1jmp1,llm) ! temperature potentielle 78 REAL q(ip1jmp1,llm,nq mx) ! champs advectes76 REAL q(ip1jmp1,llm,nqtot) ! champs advectes 79 77 REAL ps(ip1jmp1) ! pression au sol 80 78 REAL p (ip1jmp1,llmp1 ) ! pression aux interfac.des couches … … 97 95 c tendances dynamiques 98 96 REAL dv(ip1jm,llm),du(ip1jmp1,llm) 99 REAL dteta(ip1jmp1,llm),dq(ip1jmp1,llm,nq mx),dp(ip1jmp1)97 REAL dteta(ip1jmp1,llm),dq(ip1jmp1,llm,nqtot),dp(ip1jmp1) 100 98 101 99 c tendances de la dissipation … … 105 103 c tendances physiques 106 104 REAL dvfi(ip1jm,llm),dufi(ip1jmp1,llm) 107 REAL dtetafi(ip1jmp1,llm),dqfi(ip1jmp1,llm,nq mx),dpfi(ip1jmp1)105 REAL dtetafi(ip1jmp1,llm),dqfi(ip1jmp1,llm,nqtot),dpfi(ip1jmp1) 108 106 109 107 c variables pour le fichier histoire … … 165 163 166 164 character*80 dynhist_file, dynhistave_file 167 character *20modname165 character(len=20) :: modname 168 166 character*80 abort_message 169 167 … … 182 180 PARAMETER (testita = 9) 183 181 184 logical , parameter :: flag_verif = . false.182 logical , parameter :: flag_verif = .true. 185 183 186 184 … … 190 188 itaufin = nday*day_step 191 189 itaufinp1 = itaufin +1 192 190 modname="leapfrog" 191 193 192 194 193 itau = 0 … … 220 219 call guide(itau,ucov,vcov,teta,q,masse,ps) 221 220 else 222 IF(prt_level>9)WRITE( *,*)'attention on ne guide pas les',223 . ' 6 dernieres heures'221 IF(prt_level>9)WRITE(lunout,*)'leapfrog: attention on ne ', 222 . 'guide pas les 6 dernieres heures' 224 223 endif 225 224 #endif … … 230 229 c ENDIF 231 230 c 231 232 ! Save fields obtained at previous time step as '...m1' 232 233 CALL SCOPY( ijmllm ,vcov , 1, vcovm1 , 1 ) 233 234 CALL SCOPY( ijp1llm,ucov , 1, ucovm1 , 1 ) … … 245 246 CALL filtreg ( finvmaold ,jjp1, llm, -2,2, .TRUE., 1 ) 246 247 247 call minmax(ijp1llm,q(:,:,3),zqmin,zqmax) 248 ! Ehouarn: what is this for? zqmin & zqmax are not used anyway ... 249 ! call minmax(ijp1llm,q(:,:,3),zqmin,zqmax) 248 250 249 251 2 CONTINUE … … 305 307 306 308 307 ENDIF 308 c 309 ENDIF 309 ENDIF ! of IF (offline) 310 c 311 ENDIF ! of IF( forward. OR . leapf ) 310 312 311 313 … … 353 355 c ----------------------------------------------------- 354 356 355 #ifdef CPP_PHYS356 357 c+jld 357 358 358 359 c Diagnostique de conservation de l'énergie : initialisation 359 IF (ip_ebil_dyn.ge.1 ) THEN360 IF (ip_ebil_dyn.ge.1 ) THEN 360 361 ztit='bil dyn' 361 CALL diagedyn(ztit,2,1,1,dtphys 362 e , ucov , vcov , ps, p ,pk , teta , q(:,:,1), q(:,:,2)) 363 ENDIF 362 ! Ehouarn: be careful, diagedyn is Earth-specific (includes ../phylmd/..)! 363 IF (planet_type.eq."earth") THEN 364 CALL diagedyn(ztit,2,1,1,dtphys 365 & , ucov , vcov , ps, p ,pk , teta , q(:,:,1), q(:,:,2)) 366 ENDIF 367 ENDIF ! of IF (ip_ebil_dyn.ge.1 ) 364 368 c-jld 369 #ifdef CPP_IOIPSL 365 370 cIM : pour sortir les param. du modele dans un fis. netcdf 110106 366 IF (first) THEN367 first=.false.371 IF (first) THEN 372 first=.false. 368 373 #include "ini_paramLMDZ_dyn.h" 369 ENDIF374 ENDIF 370 375 c 371 376 #include "write_paramLMDZ_dyn.h" 372 377 c 373 374 CALL calfis( nq, lafin ,rdayvrai,time , 378 #endif 379 ! #endif of #ifdef CPP_IOIPSL 380 CALL calfis( lafin ,rdayvrai,time , 375 381 $ ucov,vcov,teta,q,masse,ps,p,pk,phis,phi , 376 382 $ du,dv,dteta,dq, … … 378 384 $ clesphy0, dufi,dvfi,dtetafi,dqfi,dpfi ) 379 385 380 IF (ok_strato) THEN381 CALL top_bound( vcov,ucov,teta, dufi,dvfi,dtetafi)382 ENDIF386 IF (ok_strato) THEN 387 CALL top_bound( vcov,ucov,teta, dufi,dvfi,dtetafi) 388 ENDIF 383 389 384 390 c ajout des tendances physiques: 385 391 c ------------------------------ 386 CALL addfi( nqmx,dtphys, leapf, forward ,392 CALL addfi( dtphys, leapf, forward , 387 393 $ ucov, vcov, teta , q ,ps , 388 394 $ dufi, dvfi, dtetafi , dqfi ,dpfi ) 389 395 c 390 396 c Diagnostique de conservation de l'énergie : difference 391 IF (ip_ebil_dyn.ge.1 ) THEN397 IF (ip_ebil_dyn.ge.1 ) THEN 392 398 ztit='bil phys' 393 CALL diagedyn(ztit,2,1,1,dtphys 394 e , ucov , vcov , ps, p ,pk , teta , q(:,:,1), q(:,:,2)) 395 ENDIF 396 #endif 399 IF (planet_type.eq."earth") THEN 400 CALL diagedyn(ztit,2,1,1,dtphys 401 & , ucov , vcov , ps, p ,pk , teta , q(:,:,1), q(:,:,2)) 402 ENDIF 403 ENDIF ! of IF (ip_ebil_dyn.ge.1 ) 404 397 405 ENDIF ! of IF( apphys ) 398 406 399 IF(iflag_phys.EQ.2) THEN ! "Newtonian physics" case407 IF(iflag_phys.EQ.2) THEN ! "Newtonian" case 400 408 c Calcul academique de la physique = Rappel Newtonien + friction 401 409 c -------------------------------------------------------------- … … 475 483 476 484 477 END IF 485 END IF ! of IF(apdiss) 478 486 479 487 c ajout debug … … 509 517 IF( itau. EQ. itaufinp1 ) then 510 518 if (flag_verif) then 511 write( 79,*) 'ucov',ucov512 write(8 0,*) 'vcov',vcov513 write(8 1,*) 'teta',teta514 write(8 2,*) 'ps',ps515 write(8 3,*) 'q',q519 write(80,*) 'ucov',ucov 520 write(81,*) 'vcov',vcov 521 write(82,*) 'teta',teta 522 write(83,*) 'ps',ps 523 write(84,*) 'q',q 516 524 WRITE(85,*) 'q1 = ',q(:,:,1) 517 525 WRITE(86,*) 'q3 = ',q(:,:,3) 526 write(90) ucov 527 write(91) vcov 528 write(92) teta 529 write(93) ps 530 write(94) q 518 531 endif 519 532 … … 532 545 iav=0 533 546 ENDIF 547 548 IF (ok_dynzon) THEN 534 549 #ifdef CPP_IOIPSL 535 CALL writedynav(histaveid, nqmx, itau,vcov , 536 , ucov,teta,pk,phi,q,masse,ps,phis) 537 call bilan_dyn (2,dtvr*iperiod,dtvr*day_step*periodav, 538 , ps,masse,pk,pbaru,pbarv,teta,phi,ucov,vcov,q) 539 #endif 550 CALL writedynav(histaveid, itau,vcov , 551 , ucov,teta,pk,phi,q,masse,ps,phis) 552 CALL bilan_dyn (2,dtvr*iperiod,dtvr*day_step*periodav, 553 , ps,masse,pk,pbaru,pbarv,teta,phi,ucov,vcov,q) 554 #endif 555 END IF 540 556 541 557 ENDIF … … 548 564 c IF( MOD(itau,iecri*day_step).EQ.0) THEN 549 565 550 551 CALL geopot ( ip1jmp1, teta , pk , pks, phis , phi)552 unat=0.553 do l=1,llm554 unat(iip2:ip1jm,l)=ucov(iip2:ip1jm,l)/cu(iip2:ip1jm)555 vnat(:,l)=vcov(:,l)/cv(:)556 enddo566 nbetat = nbetatdem 567 CALL geopot(ip1jmp1,teta,pk,pks,phis,phi) 568 unat=0. 569 do l=1,llm 570 unat(iip2:ip1jm,l)=ucov(iip2:ip1jm,l)/cu(iip2:ip1jm) 571 vnat(:,l)=vcov(:,l)/cv(:) 572 enddo 557 573 #ifdef CPP_IOIPSL 558 c CALL writehist(histid,histvid, nqmx,itau,vcov, 559 c s ucov,teta,phi,q,masse,ps,phis) 560 #else 574 c CALL writehist(histid,histvid,itau,vcov, 575 c & ucov,teta,phi,q,masse,ps,phis) 576 #endif 577 ! For some Grads outputs of fields 578 if (output_grads_dyn) then 561 579 #include "write_grads_dyn.h" 562 #endif 563 564 565 ENDIF 580 endif 581 582 ENDIF ! of IF(MOD(itau,iecri).EQ.0) 566 583 567 584 IF(itau.EQ.itaufin) THEN 568 585 569 586 570 #ifdef CPP_IOIPSL 571 CALL dynredem1("restart.nc",0.0, 572 , vcov,ucov,teta,q,nqmx,masse,ps) 573 #endif 587 if (planet_type.eq."earth") then 588 #ifdef CPP_EARTH 589 ! Write an Earth-format restart file 590 CALL dynredem1("restart.nc",0.0, 591 & vcov,ucov,teta,q,masse,ps) 592 #endif 593 endif ! of if (planet_type.eq."earth") 574 594 575 595 CLOSE(99) 576 ENDIF 596 ENDIF ! of IF (itau.EQ.itaufin) 577 597 578 598 c----------------------------------------------------------------------- … … 596 616 leapf = .TRUE. 597 617 dt = 2.*dtvr 598 GO TO 2 599 END IF 618 GO TO 2 619 END IF ! of IF (forward) 600 620 ELSE 601 621 … … 605 625 dt = 2.*dtvr 606 626 GO TO 2 607 END IF 608 609 ELSE 627 END IF ! of IF (MOD(itau,iperiod).EQ.0) 628 ! ELSEIF (MOD(itau-1,iperiod).EQ.0) 629 630 ELSE ! of IF (.not.purmats) 610 631 611 632 c ........................................................ … … 630 651 GO TO 2 631 652 632 ELSE 633 634 IF(MOD(itau,iperiod).EQ.0 .OR. itau.EQ.itaufin) THEN653 ELSE ! of IF(forward) 654 655 IF(MOD(itau,iperiod).EQ.0 .OR. itau.EQ.itaufin) THEN 635 656 IF(itau.EQ.itaufin) THEN 636 657 iav=1 … … 638 659 iav=0 639 660 ENDIF 661 662 IF (ok_dynzon) THEN 640 663 #ifdef CPP_IOIPSL 641 CALL writedynav(histaveid, nqmx, itau,vcov , 642 , ucov,teta,pk,phi,q,masse,ps,phis) 643 call bilan_dyn (2,dtvr*iperiod,dtvr*day_step*periodav, 644 , ps,masse,pk,pbaru,pbarv,teta,phi,ucov,vcov,q) 645 #endif 646 647 ENDIF 648 649 IF(MOD(itau,iecri ).EQ.0) THEN 664 CALL writedynav(histaveid, itau,vcov , 665 , ucov,teta,pk,phi,q,masse,ps,phis) 666 CALL bilan_dyn (2,dtvr*iperiod,dtvr*day_step*periodav, 667 , ps,masse,pk,pbaru,pbarv,teta,phi,ucov,vcov,q) 668 #endif 669 END IF 670 671 ENDIF ! of IF(MOD(itau,iperiod).EQ.0 .OR. itau.EQ.itaufin) 672 673 IF(MOD(itau,iecri ).EQ.0) THEN 650 674 c IF(MOD(itau,iecri*day_step).EQ.0) THEN 651 652 CALL geopot ( ip1jmp1, teta , pk , pks, phis , phi)653 unat=0.654 do l=1,llm655 unat(iip2:ip1jm,l)=ucov(iip2:ip1jm,l)/cu(iip2:ip1jm)656 vnat(:,l)=vcov(:,l)/cv(:)657 enddo675 nbetat = nbetatdem 676 CALL geopot(ip1jmp1,teta,pk,pks,phis,phi) 677 unat=0. 678 do l=1,llm 679 unat(iip2:ip1jm,l)=ucov(iip2:ip1jm,l)/cu(iip2:ip1jm) 680 vnat(:,l)=vcov(:,l)/cv(:) 681 enddo 658 682 #ifdef CPP_IOIPSL 659 c CALL writehist( histid, histvid, nqmx, itau,vcov , 660 c , ucov,teta,phi,q,masse,ps,phis) 661 #else 683 c CALL writehist( histid, histvid, itau,vcov , 684 c & ucov,teta,phi,q,masse,ps,phis) 685 #endif 686 ! For some Grads outputs 687 if (output_grads_dyn) then 662 688 #include "write_grads_dyn.h" 663 #endif 664 665 666 ENDIF 667 668 #ifdef CPP_IOIPSL 669 IF(itau.EQ.itaufin) 670 . CALL dynredem1("restart.nc",0.0, 671 . vcov,ucov,teta,q,nqmx,masse,ps) 672 #endif 673 674 forward = .TRUE. 675 GO TO 1 676 677 ENDIF 678 679 END IF 689 endif 690 691 ENDIF ! of IF(MOD(itau,iecri ).EQ.0) 692 693 IF(itau.EQ.itaufin) THEN 694 if (planet_type.eq."earth") then 695 #ifdef CPP_EARTH 696 CALL dynredem1("restart.nc",0.0, 697 & vcov,ucov,teta,q,masse,ps) 698 #endif 699 endif ! of if (planet_type.eq."earth") 700 ENDIF ! of IF(itau.EQ.itaufin) 701 702 forward = .TRUE. 703 GO TO 1 704 705 ENDIF ! of IF (forward) 706 707 END IF ! of IF(.not.purmats) 680 708 681 709 STOP
Note: See TracChangeset
for help on using the changeset viewer.