Changeset 3539
- Timestamp:
- Dec 9, 2024, 3:39:31 PM (6 months ago)
- Location:
- trunk/LMDZ.PLUTO/libf
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/LMDZ.PLUTO/libf/dynphy_lonlat/phypluto/leapfrog_nogcm.F ¶
r3422 r3539 38 38 IMPLICIT NONE 39 39 40 c ...... Version du 10/01/98 .......... 41 42 c avec coordonnees verticales hybrides 43 c avec nouveaux operat. dissipation * ( gradiv2,divgrad2,nxgraro2 ) 40 c ...... Version du 30/11/24 .......... 44 41 45 42 c======================================================================= 46 43 c 47 c Auteur: P. Le Van /L. Fairhead/F.Hourdin44 c Auteur: T. Bertrand, F. Forget, A. Falco 48 45 c ------- 49 46 c … … 51 48 c ------ 52 49 c 53 c GCM LMD nouvelle grille50 c GCM LMD sans dynamique, pour modele saisonnier de surface 54 51 c 55 52 c======================================================================= 56 c57 c ... Dans inigeom , nouveaux calculs pour les elongations cu , cv58 c et possibilite d'appeler une fonction f(y) a derivee tangente59 c hyperbolique a la place de la fonction a derivee sinusoidale.60 61 c ... Possibilite de choisir le shema pour l'advection de62 c q , en modifiant iadv dans traceur.def (10/02) .63 c64 c Pour Van-Leer + Vapeur d'eau saturee, iadv(1)=4. (F.Codron,10/99)65 c Pour Van-Leer iadv=1066 53 c 67 54 c----------------------------------------------------------------------- … … 76 63 #include "iniprint.h" 77 64 #include "academic.h" 78 79 ! FH 2008/05/09 On elimine toutes les clefs physiques dans la dynamique80 ! #include "clesphys.h"81 65 82 66 REAL,INTENT(IN) :: time_0 ! not used … … 103 87 REAL tsurpk(ip1jmp1,llm) ! cpp*T/pk 104 88 105 ! real zqmin,zqmax 106 107 108 ! ED18 nogcm 89 ! nogcm 109 90 REAL tau_ps 110 91 REAL tau_x … … 117 98 REAL tetamean 118 99 real globaverage2d 119 ! LOGICAL firstcall_globaverage2d120 121 100 122 101 c variables dynamiques intermediaire pour le transport … … 132 111 REAL dteta(ip1jmp1,llm),dq(ip1jmp1,llm,nqtot) 133 112 134 c tendances de la dissipation en */s135 REAL dvdis(ip1jm,llm),dudis(ip1jmp1,llm)136 REAL dtetadis(ip1jmp1,llm)137 138 c tendances de la couche superieure */s139 c REAL dvtop(ip1jm,llm)140 REAL dutop(ip1jmp1,llm)141 c REAL dtetatop(ip1jmp1,llm)142 c REAL dqtop(ip1jmp1,llm,nqtot),dptop(ip1jmp1)143 144 c TITAN : tendances due au forces de marees */s145 REAL dvtidal(ip1jm,llm),dutidal(ip1jmp1,llm)146 147 113 c tendances physiques */s 148 114 REAL dvfi(ip1jm,llm),dufi(ip1jmp1,llm) … … 159 125 160 126 REAL SSUM 161 ! REAL finvmaold(ip1jmp1,llm)162 127 163 128 cym LOGICAL lafin 164 129 LOGICAL :: lafin=.false. 165 130 INTEGER ij,iq,l 166 ! INTEGER ik167 168 ! real time_step, t_wrt, t_ops169 131 170 132 REAL rdaym_ini … … 179 141 save first 180 142 data first/.true./ 181 ! real dt_cum182 ! character*10 infile183 ! integer zan, tau0, thoriid184 ! integer nid_ctesGCM185 ! save nid_ctesGCM186 ! real degres187 ! real rlong(iip1), rlatg(jjp1)188 ! real zx_tmp_2d(iip1,jjp1)189 ! integer ndex2d(iip1*jjp1)190 143 logical ok_sync 191 144 parameter (ok_sync = .true.) … … 214 167 REAL vcont(ip1jm,llm),ucont(ip1jmp1,llm) 215 168 REAL vnat(ip1jm,llm),unat(ip1jmp1,llm) 216 ! REAL d_h_vcol, d_qt, d_qw, d_ql, d_ec217 169 CHARACTER*15 ztit 218 !IM INTEGER ip_ebil_dyn ! PRINT level for energy conserv. diag. 219 !IM SAVE ip_ebil_dyn 220 !IM DATA ip_ebil_dyn/0/ 221 c-jld 222 223 ! integer :: itau_w ! for write_paramLMDZ_dyn.h 224 225 ! character*80 dynhist_file, dynhistave_file 170 226 171 character(len=*),parameter :: modname="leapfrog" 227 172 character*80 abort_message … … 271 216 272 217 c INITIALISATIONS 273 dudis(:,:) =0.274 dvdis(:,:) =0.275 dtetadis(:,:)=0.276 dutop(:,:) =0.277 c dvtop(:,:) =0.278 c dtetatop(:,:)=0.279 c dqtop(:,:,:) =0.280 c dptop(:) =0.281 218 dufi(:,:) =0. 282 219 dvfi(:,:) =0. … … 330 267 write(*,*) "Fin Test PK" 331 268 c stop 269 332 270 c------------------ 333 271 c Preparing mixing of pressure and tracers in nogcm … … 337 275 c It is checked that globalaverage2d(Pi)=pmean 338 276 DO ij=1,ip1jmp1 339 kpd(ij) = exp(-phis(ij)/(r* 200.))277 kpd(ij) = exp(-phis(ij)/(r*38.)) 340 278 ENDDO 341 279 p00d=globaverage2d(kpd) ! mean pres at ref level 342 tau_ps = 1. ! constante de rappel for pressure (s) 343 tau_n2 = 1 ! constante de rappel for mix ratio qn2 (s) 344 tau_def = 1.E7 ! default constante de rappel for mix ratio qX (s) 280 tau_ps = tau_n2 ! constante de rappel for pressure (s) 281 tau_def = 1. ! default constante de rappel for mix ratio qX (s) 345 282 tau_teta = 1.E7 !constante de rappel for potentiel temperature 346 283 … … 368 305 c ----- 369 306 370 jD_cur = jD_ref + day_ini - day_ref + &307 jD_cur = jD_ref + day_ini - day_ref + 371 308 & (itau+1)/day_step 372 jH_cur = jH_ref + start_time + &309 jH_cur = jH_ref + start_time + 373 310 & mod(itau+1,day_step)/float(day_step) 374 311 jD_cur = jD_cur + int(jH_cur) 375 312 jH_cur = jH_cur - int(jH_cur) 376 377 c378 313 379 314 ! Save fields obtained at previous time step as '...m1' … … 407 342 c gestion des appels de la physique et des dissipations: 408 343 c ------------------------------------------------------ 409 c410 c ... P.Le Van ( 6/02/95 ) ....411 412 ! ED18: suppression des mentions de la variable apdiss dans le cas413 ! 'nogcm'414 344 415 345 apphys = .FALSE. 416 346 statcl = .FALSE. 417 347 conser = .FALSE. 418 419 348 420 349 IF( purmats ) THEN 421 350 ! Purely Matsuno time stepping 422 351 IF( MOD(itau,iconser) .EQ.0.AND. forward ) conser = .TRUE. 423 424 352 425 353 IF( MOD(itau,iphysiq ).EQ.0.AND..NOT.forward 426 354 s .and. physics ) apphys = .TRUE. 427 355 ELSE 428 ! Leapfrog/Matsuno time stepping 429 IF( MOD(itau ,iconser) .EQ. 0 ) conser = .TRUE. 430 431 432 IF( MOD(itau+1,iphysiq).EQ.0.AND.physics) apphys=.TRUE. 356 ! Leapfrog/Matsuno time stepping 357 IF( MOD(itau ,iconser) .EQ. 0 ) conser = .TRUE. 358 IF( MOD(itau+1,iphysiq).EQ.0.AND.physics) apphys=.TRUE. 433 359 END IF 434 435 ! Ehouarn: for Shallow Water case (ie: 1 vertical layer),436 ! supress dissipation step437 438 439 360 440 361 c----------------------------------------------------------------------- … … 442 363 c -------------------------------- 443 364 444 ! ED18: suppression de l'onglet pour le cas nogcm 445 446 447 dv(:,:) = 0. 448 du(:,:) = 0. 449 dteta(:,:) = 0. 450 dq(:,:,:) = 0. 451 452 453 454 c .P.Le Van (26/04/94 ajout de finvpold dans l'appel d'integrd) 455 c 365 dv(:,:) = 0. 366 du(:,:) = 0. 367 dteta(:,:) = 0. 368 dq(:,:,:) = 0. 369 456 370 c----------------------------------------------------------------------- 457 371 c calcul des tendances physiques: 458 372 c ------------------------------- 459 c ######## P.Le Van ( Modif le 6/02/95 ) ###########460 373 c 461 374 IF( purmats ) THEN … … 464 377 IF( itau+1. EQ. itaufin ) lafin = .TRUE. 465 378 ENDIF 466 c 467 c 379 468 380 IF( apphys ) THEN 469 c470 c ....... Ajout P.Le Van ( 17/04/96 ) ...........471 c472 381 473 382 CALL pression ( ip1jmp1, ap, bp, ps, p ) … … 481 390 CALL geopot ( ip1jmp1, teta , pk , pks, phis , phi ) 482 391 483 jD_cur = jD_ref + day_ini - day_ref + &392 jD_cur = jD_ref + day_ini - day_ref + 484 393 & (itau+1)/day_step 485 394 486 ! AS: we make jD_cur to be pday 487 jD_cur = int(day_ini + itau/day_step) 488 489 ! print*,'itau =',itau 490 ! print*,'day_step =',day_step 491 ! print*,'itau/day_step =',itau/day_step 492 493 494 jH_cur = jH_ref + start_time + & 395 ! AS: we make jD_cur to be pday 396 jD_cur = int(day_ini + itau/day_step) 397 398 jH_cur = jH_ref + start_time + 495 399 & mod(itau+1,day_step)/float(day_step) 496 jH_cur = jH_ref + start_time + &400 jH_cur = jH_ref + start_time + 497 401 & mod(itau,day_step)/float(day_step) 498 jD_cur = jD_cur + int(jH_cur) 499 jH_cur = jH_cur - int(jH_cur) 500 501 502 503 ! write(lunout,*)'itau, jD_cur = ', itau, jD_cur, jH_cur 504 ! call ju2ymds(jD_cur+jH_cur, an, mois, jour, secondes) 505 ! write(lunout,*)'current date = ',an, mois, jour, secondes 506 507 c rajout debug 508 c lafin = .true. 509 402 jD_cur = jD_cur + int(jH_cur) 403 jH_cur = jH_cur - int(jH_cur) 510 404 511 405 c Interface avec les routines de phylmd (phymars ... ) 512 406 c ----------------------------------------------------- 513 514 c+jld515 516 c Diagnostique de conservation de l'Energie : initialisation517 IF (ip_ebil_dyn.ge.1 ) THEN518 ztit='bil dyn'519 ! Ehouarn: be careful, diagedyn is Earth-specific!520 IF (planet_type.eq."earth") THEN521 CALL diagedyn(ztit,2,1,1,dtphys522 & , ucov , vcov , ps, p ,pk , teta , q(:,:,1), q(:,:,2))523 ENDIF524 ENDIF ! of IF (ip_ebil_dyn.ge.1 )525 c-jld526 #ifdef CPP_IOIPSL527 cIM decommenter les 6 lignes suivantes pour sortir quelques parametres dynamiques de LMDZ528 cIM uncomment next 6 lines to get some parameters for LMDZ dynamics529 c IF (first) THEN530 c first=.false.531 c#include "ini_paramLMDZ_dyn.h"532 c ENDIF533 c534 c#include "write_paramLMDZ_dyn.h"535 c536 #endif537 ! #endif of #ifdef CPP_IOIPSL538 539 c call WriteField('pfi',reshape(p,(/iip1,jmp1,llmp1/)))540 ! print*,'---------LEAPFROG---------------'541 ! print*,''542 ! print*,'> AVANT CALFIS'543 ! print*,''544 ! print*,'teta(3049,:) = ',teta(3049,:)545 ! print*,''546 ! print*,'dteta(3049,:) = ',dteta(3049,:)547 ! print*,''548 ! print*,'dtetafi(3049,:) = ',dtetafi(3049,:)549 ! print*,''550 407 551 408 CALL calfis( lafin , jD_cur, jH_cur, … … 555 412 $ dufi,dvfi,dtetafi,dqfi,dpfi ) 556 413 557 c call WriteField('dufi',reshape(dufi,(/iip1,jmp1,llm/)))558 c call WriteField('dvfi',reshape(dvfi,(/iip1,jjm,llm/)))559 c call WriteField('dtetafi',reshape(dtetafi,(/iip1,jmp1,llm/)))560 ! print*,'> APRES CALFIS (AVANT ADDFI)'561 ! print*,''562 ! print*,'teta(3049,:) = ',teta(3049,:)563 ! print*,''564 ! print*,'dteta(3049,:) = ',dteta(3049,:)565 ! print*,''566 ! print*,'dtetafi(3049,:) = ',dtetafi(3049,:)567 ! print*,''568 569 570 414 c ajout des tendances physiques 571 415 c ------------------------------ 572 416 573 417 CALL addfi( dtphys, leapf, forward , 574 418 $ ucov, vcov, teta , q ,ps , 575 419 $ dufi, dvfi, dtetafi , dqfi ,dpfi ) 576 420 577 ! print*,'> APRES ADDFI' 578 ! print*,'' 579 ! print*,'teta(3049,:) = ',teta(3049,:) 580 ! print*,'' 581 ! print*,'dteta(3049,:) = ',dteta(3049,:) 582 ! print*,'' 583 ! print*,'dtetafi(3049,:) = ',dtetafi(3049,:) 584 ! print*,'' 585 586 CALL pression (ip1jmp1,ap,bp,ps,p) 587 CALL massdair(p,masse) 421 CALL pression (ip1jmp1,ap,bp,ps,p) 422 CALL massdair(p,masse) 588 423 589 ! Mass of tracers in each mess (kg) before Horizontal mixing of pressure 590 c ------------------------------------------------------------------- 424 ! 1) Mass of tracers in each mess (kg) before Horizontal mixing of pressure 591 425 592 426 DO l=1, llm … … 596 430 ENDDO 597 431 598 c Horizontal mixing of pressure 599 c ------------------------------ 432 ! 2) Horizontal mixing of pressure 600 433 ! Rappel newtonien vers psmean 601 602 603 604 605 434 psmean= globaverage2d(ps) ! mean pressure 435 p0=psmean/p00d 436 DO ij=1,ip1jmp1 437 oldps(ij)=ps(ij) 438 ps(ij)=ps(ij) +(p0*kpd(ij) 606 439 & -ps(ij))*(1-exp(-dtphys/tau_ps)) 607 608 609 610 611 ! security check: test pressure negative612 440 ENDDO 441 442 write(72,*) 'psmean = ',psmean ! mean pressure redistributed 443 444 ! 3) Security check: test pressure negative 445 DO ij=1,ip1jmp1 613 446 IF (ps(ij).le.0.) then 614 447 !write(*,*) 'Negative pressure :' … … 617 450 !write(*,*) 'tau_ps = ',tau_ps 618 451 !STOP 619 ps(ij)= 0.0000001*kpd(ij)/p00d452 ps(ij)=1.e-6*kpd(ij)/p00d 620 453 ENDIF 621 ENDDO 622 !*********************** 623 ! Correction on teta due to surface pressure changes 624 DO l = 1,llm 625 DO ij = 1,ip1jmp1 626 teta(ij,l)= teta(ij,l)*(ps(ij)/oldps(ij))**kappa 627 ENDDO 628 ENDDO 629 !*********************** 630 631 632 633 ! ! update pressure and update p and pk 634 ! DO ij=1,ip1jmp1 635 ! ps(ij) = ps(ij) + dpfi(ij)*dtphys 454 ENDDO 455 456 ! ! 4) Correction on teta due to surface pressure changes 457 ! DO l = 1,llm 458 ! DO ij = 1,ip1jmp1 459 ! teta(ij,l)= teta(ij,l)*(ps(ij)/oldps(ij))**kappa 460 ! ENDDO 636 461 ! ENDDO 637 CALL pression (ip1jmp1,ap,bp,ps,p) 638 CALL massdair(p,masse) 639 if (pressure_exner) then 462 463 ! 5) Update pressure p and pk 464 CALL pression (ip1jmp1,ap,bp,ps,p) 465 CALL massdair(p,masse) 466 if (pressure_exner) then 640 467 CALL exner_hyb( ip1jmp1, ps, p, pks, pk, pkf ) 641 468 else 642 469 CALL exner_milieu( ip1jmp1, ps, p, pks, pk, pkf ) 643 endif 644 645 ! Update tracers after Horizontal mixing of pressure to ! conserve tracer mass 646 c ------------------------------------------------------------------- 470 endif 471 472 ! 6) Update tracers after Horizontal mixing of pressure to ! conserve tracer mass 647 473 DO l=1, llm 648 474 DO ij=1,ip1jmp1 … … 650 476 ENDDO 651 477 ENDDO 652 653 654 655 c Horizontal mixing of pressure 656 c ------------------------------ 657 ! Rappel newtonien vers psmean 658 psmean= globaverage2d(ps) ! mean pressure 659 ! ! increment q_n2 with physical tendancy 660 ! IF (igcm_n2.ne.0) then 661 ! DO l=1, llm 662 ! DO ij=1,ip1jmp1 663 ! q(ij,l,igcm_n2)=q(ij,l,igcm_n2)+ 664 ! & dqfi(ij,l,igcm_n2)*dtphys 665 ! ENDDO 666 ! ENDDO 667 ! ENDIF 668 669 c Mixing N2 vertically ! not used for pluto ? 670 c -------------------------- 671 ! if (igcm_n2.ne.0) then 672 ! DO ij=1,ip1jmp1 673 ! qmean_x_vert=0. 674 ! DO l=1, llm 675 ! qmean_x_vert= qmean_x_vert 676 ! & + q(ij,l,igcm_n2)*( p(ij,l) - p(ij,l+1)) 677 ! END DO 678 ! qmean_x_vert= qmean_x_vert/ps(ij) 679 ! DO l=1, llm 680 ! q(ij,l,igcm_n2)= qmean_x_vert 681 ! END DO 682 ! END DO 683 ! end if 684 685 686 687 c Horizontal mixing of pressure 688 c ------------------------------ 689 ! Rappel newtonien vers psmean 690 psmean= globaverage2d(ps) ! mean pressure 691 692 c Horizontal mixing tracers, and temperature (replace dynamics in nogcm) 693 c --------------------------------------------------------------------------------- 478 479 ! 7) Horizontal mixing tracers, and temperature (replace dynamics in nogcm) 480 psmean= globaverage2d(ps) ! mean pressure 694 481 695 482 ! Simulate redistribution by dynamics for qX … … 703 490 pqxmean=globaverage2d(pqx) 704 491 705 !Rappel newtonien vers qx_mean492 ! Rappel newtonien vers qx_mean 706 493 qmean_x= pqxmean / psmean 707 494 … … 728 515 END DO 729 516 730 ! TEMPORAIRE (ED) 731 !PRINT*,'psmean = ',psmean732 !PRINT*,'qmean_x = ',qmean_x733 !PRINT*,'pqxmean = ',pqxmean517 ! Diagnostics 518 ! PRINT*,'psmean = ',psmean 519 ! PRINT*,'qmean_x = ',qmean_x 520 ! PRINT*,'pqxmean = ',pqxmean 734 521 ! PRINT*,' q(50,1) = ',iq,q(50,1,iq) 735 522 ! PRINT*,' q(50,2) = ',iq,q(50,2,iq) … … 737 524 738 525 endif ! igcm_n2.ne.0 739 enddo 740 741 742 ! *****************************************s*************** 743 744 c Horizontal mixing of pressure 745 c ------------------------------ 746 ! Rappel newtonien vers psmean 747 psmean= globaverage2d(ps) ! mean pressure 748 749 750 c Mixing Temperature horizontally 751 c ------------------------------- 752 ! initialize variables that will be averaged 753 DO l=1,llm 754 DO ij=1,ip1jmp1 755 dp(ij,l) = p(ij,l) - p(ij,l+1) 756 tetadp(ij,l) = teta(ij,l)*dp(ij,l) 757 ENDDO 758 ENDDO 759 760 DO l=1,llm 761 tetadpmean = globaverage2d(tetadp(:,l)) 762 dpmean = globaverage2d(dp(:,l)) 763 tetamean = tetadpmean / dpmean 764 DO ij=1,ip1jmp1 765 teta(ij,l) = teta(ij,l) + (tetamean - teta(ij,l)) * 766 & (1 - exp(-dtphys/tau_teta)) 767 ENDDO 768 ENDDO 526 ENDDO 527 528 ! 8) Mixing Temperature horizontally 529 ! initialize variables that will be averaged 530 ! DO l=1,llm 531 ! DO ij=1,ip1jmp1 532 ! dp(ij,l) = p(ij,l) - p(ij,l+1) 533 ! tetadp(ij,l) = teta(ij,l)*dp(ij,l) 534 ! ENDDO 535 ! ENDDO 536 537 ! DO l=1,llm 538 ! tetadpmean = globaverage2d(tetadp(:,l)) 539 ! dpmean = globaverage2d(dp(:,l)) 540 ! tetamean = tetadpmean / dpmean 541 ! DO ij=1,ip1jmp1 542 ! teta(ij,l) = teta(ij,l) + (tetamean - teta(ij,l)) * 543 ! & (1 - exp(-dtphys/tau_teta)) 544 ! ENDDO 545 ! ENDDO 769 546 770 771 547 ENDIF ! of IF( apphys ) 772 548 … … 777 553 c ******************************************************************** 778 554 c ******************************************************************** 779 780 555 781 556 IF ( .NOT.purmats ) THEN … … 793 568 c ENDIF 794 569 ENDIF 795 796 570 797 571 IF( itau. EQ. itaufinp1 ) then … … 810 584 call abort_gcm(modname,abort_message,0) 811 585 ENDIF 586 812 587 c----------------------------------------------------------------------- 813 588 c ecriture du fichier histoire moyenne: … … 824 599 CALL geopot(ip1jmp1,teta,pk,pks,phis,phi) 825 600 826 IF (ok_dynzon) THEN827 #ifdef CPP_IOIPSL828 c les traceurs ne sont pas sortis, trop lourd.829 c Peut changer eventuellement si besoin.830 CALL bilan_dyn(dtvr*iperiod,dtvr*day_step*periodav,831 & ps,masse,pk,pbaru,pbarv,teta,phi,ucov,vcov,832 & du,dudis,dutop,dufi)833 #endif834 END IF835 601 IF (ok_dyn_ave) THEN 836 602 #ifdef CPP_IOIPSL … … 963 729 CALL geopot(ip1jmp1,teta,pk,pks,phis,phi) 964 730 965 IF (ok_dynzon) THEN966 #ifdef CPP_IOIPSL967 c les traceurs ne sont pas sortis, trop lourd.968 c Peut changer eventuellement si besoin.969 CALL bilan_dyn(dtvr*iperiod,dtvr*day_step*periodav,970 & ps,masse,pk,pbaru,pbarv,teta,phi,ucov,vcov,971 & du,dudis,dutop,dufi)972 #endif973 ENDIF974 731 IF (ok_dyn_ave) THEN 975 732 #ifdef CPP_IOIPSL -
TabularUnified trunk/LMDZ.PLUTO/libf/dynphy_lonlat/phypluto/newstart.F ¶
r3438 r3539 100 100 REAL tsurf(ngridmx) ! surface temperature 101 101 REAL,ALLOCATABLE :: tsoil(:,:) ! soil temperature 102 REAL,ALLOCATABLE :: inertiedat_simple(:,:) ! thermal inertia tmp for dynamico 102 103 REAL emis(ngridmx) ! surface emissivity 103 104 real emisread ! added by RW … … 235 236 call getin_p("nsoilmx",nsoilmx) 236 237 238 allocate(inertiedat_simple(ngridmx,nsoilmx)) 237 239 allocate(tsoil(ngridmx,nsoilmx)) 238 240 allocate(field_inputs(ngridmx,nsoilmx)) … … 379 381 CALL phyetat0(.true.,ngridmx,llm,fichnom,tab0,Lmodif,nsoilmx, 380 382 . nqtot,day_ini,time, 381 . tsurf,tsoil,emis,q2,qsurf ) !) ! temporary modif by RDW383 . tsurf,tsoil,emis,q2,qsurf,inertiedat_simple) !) ! temporary modif by RDW 382 384 383 385 ! copy albedo and soil thermal inertia on (local) physics grid … … 4013 4015 & llm, 4014 4016 & nqtot,dtphys,real(day_ini),0.0, 4015 & cell_area,albfi, ithfi,zmea,zstd,zsig,zgam,zthe)4017 & cell_area,albfi,zmea,zstd,zsig,zgam,zthe) 4016 4018 call physdem1("restartfi.nc",nsoilmx,ngridmx,llm,nqtot, 4017 4019 & dtphys,real(day_ini), 4018 & tsurf,tsoil, emis,q2,qsurf)4020 & tsurf,tsoil,ithfi,emis,q2,qsurf) 4019 4021 ! & cloudfrac,totalfrac,hice, 4020 4022 ! & rnat,pctsrf_sic,tslab,tsea_ice,sea_ice) -
TabularUnified trunk/LMDZ.PLUTO/libf/dynphy_lonlat/phypluto/nogcm.F90 ¶
r3412 r3539 1 1 ! 2 ! nogcm for Pluto, based on mars nogcm, 07/20243 ! Author: A. Falco 2 ! nogcm for Pluto, based on mars nogcm, 12/2024 3 ! Author: A. Falco, T. Bertrand 4 4 ! 5 5 ! … … 47 47 IMPLICIT NONE 48 48 49 ! ...... Version du 10/01/98 ..........50 51 ! avec coordonnees verticales hybrides52 ! avec nouveaux operat. dissipation * ( gradiv2,divgrad2,nxgraro2 )53 54 !=======================================================================55 !56 ! Auteur: P. Le Van /L. Fairhead/F.Hourdin57 ! -------58 !59 ! Objet:60 ! ------61 !62 ! GCM LMD nouvelle grille63 !64 !=======================================================================65 !66 ! ... Dans inigeom , nouveaux calculs pour les elongations cu , cv67 ! et possibilite d'appeler une fonction f(y) a derivee tangente68 ! hyperbolique a la place de la fonction a derivee sinusoidale.69 ! ... Possibilite de choisir le schema pour l'advection de70 ! q , en modifiant iadv dans traceur.def (MAF,10/02) .71 !72 ! Pour Van-Leer + Vapeur d'eau saturee, iadv(1)=4. (F.Codron,10/99)73 ! Pour Van-Leer iadv=1074 !75 49 !----------------------------------------------------------------------- 76 50 ! Declarations: … … 114 88 LOGICAL first 115 89 116 ! LOGICAL call_iniphys117 ! data call_iniphys/.true./118 119 !+jld variables test conservation energie120 ! REAL ecin(ip1jmp1,llm),ecin0(ip1jmp1,llm)121 ! Tendance de la temp. potentiel d (theta)/ d t due a la122 ! tansformation d'energie cinetique en energie thermique123 ! cree par la dissipation124 90 REAL dhecdt(ip1jmp1,llm) 125 ! REAL vcont(ip1jm,llm),ucont(ip1jmp1,llm)126 ! REAL d_h_vcol, d_qt, d_qw, d_ql, d_ec127 91 CHARACTER (len=15) :: ztit 128 !-jld129 92 130 93 … … 171 134 172 135 173 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!174 ! FH 2008/05/02175 ! A nettoyer. On ne veut qu'une ou deux routines d'interface176 ! dynamique -> physique pour l'initialisation177 !#ifdef CPP_PHYS178 ! CALL init_phys_lmdz(iim,jjp1,llm,1,(/(jjm-1)*iim+2/))179 !! call initcomgeomphy ! now done in iniphysiq180 !#endif181 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!182 136 ! 183 137 ! Initialisations pour Cp(T) Venus … … 194 148 call ioconf_calendar('360d') 195 149 write(lunout,*)'CALENDRIER CHOISI: Terrestre a 360 jours/an' 196 else if (calend == 'earth_365d') then 197 call ioconf_calendar('noleap') 198 write(lunout,*)'CALENDRIER CHOISI: Terrestre a 365 jours/an' 199 else if (calend == 'earth_366d') then 200 call ioconf_calendar('gregorian') 201 write(lunout,*)'CALENDRIER CHOISI: Terrestre bissextile' 202 else if (calend == 'titan') then 203 ! call ioconf_calendar('titan') 204 write(lunout,*)'CALENDRIER CHOISI: Titan' 205 abort_message = 'A FAIRE...' 206 call abort_gcm(modname,abort_message,1) 207 else if (calend == 'venus') then 208 ! call ioconf_calendar('venus') 209 write(lunout,*)'CALENDRIER CHOISI: Venus' 210 abort_message = 'A FAIRE...' 211 call abort_gcm(modname,abort_message,1) 212 else 213 abort_message = 'Mauvais choix de calendrier' 214 call abort_gcm(modname,abort_message,1) 215 endif 216 #endif 217 !----------------------------------------------------------------------- 218 ! 219 ! 150 endif 151 #endif 152 220 153 !------------------------------------ 221 154 ! Initialisation partie parallele 222 155 !------------------------------------ 223 156 224 !225 !226 157 !----------------------------------------------------------------------- 227 158 ! Initialisation des traceurs … … 257 188 endif 258 189 259 ! write(73,*) 'ucov',ucov260 ! write(74,*) 'vcov',vcov261 ! write(75,*) 'teta',teta262 ! write(76,*) 'ps',ps263 ! write(77,*) 'q',q264 265 190 endif ! of if (read_start) 266 191 … … 268 193 ! le cas echeant, creation d un etat initial 269 194 IF (prt_level > 9) WRITE(lunout,*) & 270 ' GCM: AVANT iniacademic AVANT AVANT AVANT AVANT'195 'NOGCM: AVANT iniacademic AVANT AVANT AVANT AVANT' 271 196 if (.not.read_start) then 272 197 CALL iniacademic(vcov,ucov,teta,q,masse,ps,phis,time_0) … … 330 255 ENDIF 331 256 332 ! if (annee_ref .ne. anneeref .or. day_ref .ne. dayref) then333 ! write(lunout,*)334 ! . 'GCM: Attention les dates initiales lues dans le fichier'335 ! write(lunout,*)336 ! . ' restart ne correspondent pas a celles lues dans '337 ! write(lunout,*)' gcm.def'338 ! write(lunout,*)' annee_ref=',annee_ref," anneeref=",anneeref339 ! write(lunout,*)' day_ref=',day_ref," dayref=",dayref340 ! if (raz_date .ne. 1) then341 ! write(lunout,*)342 ! . 'GCM: On garde les dates du fichier restart'343 ! else344 ! annee_ref = anneeref345 ! day_ref = dayref346 ! day_ini = dayref347 ! itau_dyn = 0348 ! itau_phy = 0349 ! time_0 = 0.350 ! write(lunout,*)351 ! . 'GCM: On reinitialise a la date lue dans gcm.def'352 ! endif353 ! ELSE354 ! raz_date = 0355 ! endif356 357 257 #ifdef CPP_IOIPSL 358 258 mois = 1 359 259 heure = 0. 360 ! Ce n'est defini pour l'instant que pour la Terre...361 if (planet_type.eq.'earth') then362 call ymds2ju(annee_ref, mois, day_ref, heure, jD_ref)363 jH_ref = jD_ref - int(jD_ref)364 jD_ref = int(jD_ref)365 366 call ioconf_startdate(INT(jD_ref), jH_ref)367 368 write(lunout,*)'DEBUG'369 write(lunout,*)'annee_ref, mois, day_ref, heure, jD_ref'370 write(lunout,*)annee_ref, mois, day_ref, heure, jD_ref371 call ju2ymds(jD_ref+jH_ref,an, mois, jour, heure)372 write(lunout,*)'jD_ref+jH_ref,an, mois, jour, heure'373 write(lunout,*)jD_ref+jH_ref,an, mois, jour, heure374 ! else if (planet_type.eq.'titan') then375 ! jD_ref=1 ! Only if we use old Titan starts (J.V.O 2016)376 else377 ! A voir pour Titan et Venus378 jD_ref=0379 jH_ref=0380 write(lunout,*)'A VOIR POUR VENUS ET TITAN: jD_ref, jH_ref'381 write(lunout,*)jD_ref,jH_ref382 endif ! planet_type383 260 #else 384 261 ! Ehouarn: we still need to define JD_ref and JH_ref … … 410 287 ! 411 288 !----------------------------------------------------------------------- 412 ! Initialisation de la dissipation :413 ! ----------------------------------414 415 !ED18 CALL inidissip( lstardis, nitergdiv, nitergrot, niterh , &416 ! tetagdiv, tetagrot , tetatemp, vert_prof_dissip)417 418 !-----------------------------------------------------------------------419 289 ! Initialisation des I/O : 420 290 ! ------------------------ … … 434 304 WRITE(lunout,'(a,i7,a,i7)') & 435 305 "run from day ",day_ini," to day",day_end 436 437 #ifdef CPP_IOIPSL438 ! Ce n'est defini pour l'instant que pour la Terre...439 if (planet_type.eq.'earth') then440 call ju2ymds(jD_ref + day_ini - day_ref, an, mois, jour, heure)441 write (lunout,301)jour, mois, an442 call ju2ymds(jD_ref + day_end - day_ref, an, mois, jour, heure)443 write (lunout,302)jour, mois, an444 else445 ! A voir pour Titan et Venus446 write(lunout,*)'A VOIR POUR VENUS/TITAN: separation en annees...'447 endif ! planet_type448 301 FORMAT('1'/,15x,'run du ', i2,'/',i2,'/',i4)449 302 FORMAT('1'/,15x,' au ', i2,'/',i2,'/',i4)450 #endif451 452 306 453 307 !----------------------------------------------------------------------- … … 467 321 468 322 469 if (planet_type=="mars") then 470 ! For Mars we transmit day_ini 471 CALL dynredem0("restart.nc", day_ini, phis) 472 else 473 CALL dynredem0("restart.nc", day_end, phis) 474 endif 323 ! Note that for Mars we transmit day_ini 324 CALL dynredem0("restart.nc", day_end, phis) 475 325 ecripar = .TRUE. 476 326 … … 503 353 istphy=istdyn/iphysiq 504 354 505 506 !507 355 !----------------------------------------------------------------------- 508 356 ! Integration temporelle du modele : 509 357 ! ---------------------------------- 510 358 511 ! write(78,*) 'ucov',ucov512 ! write(78,*) 'vcov',vcov513 ! write(78,*) 'teta',teta514 ! write(78,*) 'ps',ps515 ! write(78,*) 'q',q516 517 359 CALL leapfrog_nogcm(ucov,vcov,teta,ps,masse,phis,q,time_0) 518 360 -
TabularUnified trunk/LMDZ.PLUTO/libf/phypluto/callkeys_mod.F90 ¶
r3455 r3539 31 31 !$OMP THREADPRIVATE(newtonian,force_cpp,cpp_mugaz_mode,testradtimes,rayleigh) 32 32 logical,save :: stelbbody 33 logical,save :: nearn2cond34 33 logical,save :: tracer 35 34 logical,save :: mass_redistrib 36 !$OMP THREADPRIVATE(stelbbody, nearn2cond,tracer,mass_redistrib)35 !$OMP THREADPRIVATE(stelbbody,tracer,mass_redistrib) 37 36 logical,save :: varactive 38 37 logical,save :: varfixed … … 85 84 logical,save :: convergeps,conservn2,condensn2,no_n2frost 86 85 !$OMP THREADPRIVATE(convergeps,conservn2,condensn2,no_n2frost) 86 logical,save :: conservch4 87 !$OMP THREADPRIVATE(conservch4) 87 88 logical,save :: kmix_proffix 88 89 !$OMP THREADPRIVATE(kmix_proffix) -
TabularUnified trunk/LMDZ.PLUTO/libf/phypluto/ch4surf.F ¶
r3421 r3539 1 SUBROUTINE ch4surf(ngrid,nlayer,nq,ptimestep, tsurf,pdtsurf,2 & 1 SUBROUTINE ch4surf(ngrid,nlayer,nq,ptimestep,capcal,tsurf, 2 & pdtsurf,pplev,pdpsurf,pq,pdq,pqsurf,pdqsurf,pdqch4,pdqsch4) 3 3 4 4 use callkeys_mod, only: dayfrac, thresh_non2 … … 7 7 use comsaison_h, only: fract 8 8 use planete_mod, only: z0 9 use tracer_h, only: igcm_ch4_gas,igcm_ch4_ice,igcm_n2,mmol 9 use tracer_h, only: igcm_ch4_gas,igcm_ch4_ice,igcm_n2,mmol,lw_ch4 10 10 IMPLICIT NONE 11 11 … … 29 29 30 30 ! input : 31 REAL capcal(ngrid) ! surface heat capacity (J m-2 K-1) 31 32 REAL tsurf(ngrid) 32 33 REAL pplev(ngrid,nlayer+1) … … 62 63 cdrag=(vonk/log(alt/z00))**2 63 64 64 u= 6.! 665 v= 3.! 365 u=0.3 ! 6 66 v=0.4 ! 3 66 67 uv=sqrt(u**2+v**2) 67 68 … … 97 98 & mmol(igcm_n2)/mmol(igcm_ch4_gas)*100.-0.6)/0.3 98 99 gamm(ig)=max(gamm(ig),1.) 99 qsat(ig)=qsat(ig)*gamm(ig)100 !qsat(ig)=qsat(ig)*gamm(ig) 100 101 101 102 rho = zpsrf(ig) / (r * tsurf(ig) ) … … 125 126 !! Security to avoid large changes in temperatures due to 126 127 !latent heat 127 if ( pdqsch4(ig)*ptimestep.gt.0.25) then128 pdqsch4(ig)= 0.25/ptimestep128 if (lw_ch4*pdqsch4(ig)*ptimestep/capcal(ig).gt.1.) then 129 pdqsch4(ig)=1./(lw_ch4*ptimestep)*capcal(ig) 129 130 endif 130 if ( pdqsch4(ig)*ptimestep.lt.-0.25) then131 pdqsch4(ig)=- 0.25/ptimestep131 if (lw_ch4*pdqsch4(ig)*ptimestep/capcal(ig).lt.-1.) then 132 pdqsch4(ig)=-1./(lw_ch4*ptimestep)*capcal(ig) 132 133 endif 134 !if (pdqsch4(ig)*ptimestep.gt.0.25) then 135 ! pdqsch4(ig)=0.25/ptimestep 136 !endif 137 !if (pdqsch4(ig)*ptimestep.lt.-0.25) then 138 ! pdqsch4(ig)=-0.25/ptimestep 139 !endif 133 140 134 141 !! Atm tendency -
TabularUnified trunk/LMDZ.PLUTO/libf/phypluto/condense_n2.F90 ¶
r3477 r3539 13 13 USE callkeys_mod, only: fast,ch4lag,latlag,nbsub,no_n2frost,tsurfmax,kmixmin,source_haze,vmrlag 14 14 USE vertical_layers_mod, ONLY: ap,bp 15 use geometry_mod, only: latitude 15 USE geometry_mod, only: latitude, longitude, cell_area 16 use planetwide_mod, only: planetwide_sumval 16 17 17 18 … … 87 88 REAL tcond_n2 88 89 REAL pcond_n2 89 REAL glob_average2d ! function90 90 REAL zqn2(klon,klev) ! N2 MMR used to compute Tcond/zqn2 91 91 REAL ztcond (klon,klev) … … 123 123 124 124 REAL zplevhist(klon) 125 REAL zplevhistglob 125 126 REAL zplevnew(klon) 126 127 REAL zplev(klon) … … 157 158 INTEGER,SAVE :: i_n2ice=0 ! n2 ice 158 159 CHARACTER(LEN=20) :: tracername ! to temporarily store text 159 logical olkin ! option to prevent N2 ice effect in the south160 DATA olkin/.false./161 save olkin162 160 163 161 CHARACTER(len=10) :: tname … … 176 174 ENDDO 177 175 IF (fast) THEN 178 p00=glob_average2d(kp) ! mean pres at ref level 176 ! mean pres at ref level 177 call planetwide_sumval(kp(:)*cell_area(:)/totarea_planet,p00) 179 178 ENDIF 180 179 … … 297 296 nsubtimestep= 1 ! if more then kp and p00 have to be calculated 298 297 ! for nofast mode 299 ENDIF 298 ENDIF ! fast 300 299 subtimestep=ptimestep/float(nsubtimestep) 301 300 … … 324 323 ENDDO 325 324 ! intermediaire de calcul: valeur moyenne de zplevnew (called twice in the code) 326 globzplevnew=glob_average2d(zplevnew)325 call planetwide_sumval(zplevnew(:)*cell_area(:)/totarea_planet,globzplevnew) 327 326 DO ig=1,klon 328 327 zplev(ig)=kp(ig)*globzplevnew/p00 ! 2) … … 335 334 zplevhist(ig)=zplev(ig) 336 335 ENDDO 337 zplev=zplev*globzplevnew/glob_average2d(zplevhist) ! 4) 336 call planetwide_sumval(zplevhist(:)*cell_area(:)/totarea_planet,zplevhistglob) 337 zplev=zplev*globzplevnew/zplevhistglob ! 4) 338 338 DO ig=1,klon ! 5) 339 339 zdtsrf(ig)=pdtsrf(ig) + (stephan/pcapcal(ig))*(ptsrf(ig)**4-ztsrf(ig)**4) … … 343 343 ENDIF ! (itsub=1) 344 344 345 DO ig=1,klon346 ! forecast of frost temperature ztcondsol347 !ztcondsol(ig) = tcond_n2(zplev(ig),zqn2(ig,1))348 ztcondsol(ig) = tcond_n2(zplev(ig),vmrn2(ig))349 350 !Loop over where we have condensation / sublimation351 IF ((ztsrf(ig) .LT. ztcondsol(ig)) .OR. & ! ground cond345 DO ig=1,klon 346 ! forecast of frost temperature ztcondsol 347 !ztcondsol(ig) = tcond_n2(zplev(ig),zqn2(ig,1)) 348 ztcondsol(ig) = tcond_n2(zplev(ig),vmrn2(ig)) 349 350 ! Loop over where we have condensation / sublimation 351 IF ((ztsrf(ig) .LT. ztcondsol(ig)) .OR. & ! ground cond 352 352 ((ztsrf(ig) .GT. ztcondsol(ig)) .AND. & ! ground sublim 353 353 (zpicen2(ig) .GT. 0.))) THEN 354 condsub(ig) = .true. ! condensation or sublimation 355 356 ! Condensation or partial sublimation of N2 ice 357 if (ztsrf(ig) .LT. ztcondsol(ig)) then ! condensation 358 ! Include a correction to account for the cooling of air near 359 ! the surface before condensing: 360 zcondices(ig)=pcapcal(ig)*(ztcondsol(ig)-ztsrf(ig)) & 361 /((lw_n2+cpp*(zt(ig,1)-ztcondsol(ig)))*subtimestep) 362 else ! sublimation 354 condsub(ig) = .true. ! condensation or sublimation 355 356 ! Condensation or partial sublimation of N2 ice 357 if (ztsrf(ig) .LT. ztcondsol(ig)) then ! condensation 358 ! Include a correction to account for the cooling of air near 359 ! the surface before condensing: 360 if (fast) then 361 zcondices(ig)=pcapcal(ig)*(ztcondsol(ig)-ztsrf(ig)) & 362 /(lw_n2*subtimestep) 363 else 364 zcondices(ig)=pcapcal(ig)*(ztcondsol(ig)-ztsrf(ig)) & 365 /((lw_n2+cpp*(zt(ig,1)-ztcondsol(ig)))*subtimestep) 366 endif 367 else ! sublimation 363 368 zcondices(ig)=pcapcal(ig)*(ztcondsol(ig)-ztsrf(ig)) & 364 369 /(lw_n2*subtimestep) 365 end if366 367 pdtsrfc(ig) = (ztcondsol(ig) - ztsrf(ig))/subtimestep368 369 ! partial sublimation of N2 ice370 ! If the entire N_2 ice layer sublimes371 ! (including what has just condensed in the atmosphere)372 IF((zpicen2(ig)/subtimestep).LE. &370 end if 371 372 pdtsrfc(ig) = (ztcondsol(ig) - ztsrf(ig))/subtimestep 373 374 ! partial sublimation of N2 ice 375 ! If the entire N_2 ice layer sublimes 376 ! (including what has just condensed in the atmosphere) 377 IF((zpicen2(ig)/subtimestep).LE. & 373 378 -zcondices(ig))THEN 374 379 zcondices(ig) = -zpicen2(ig)/subtimestep 375 380 pdtsrfc(ig)=(lw_n2/pcapcal(ig))* & 376 381 (zcondices(ig)) 377 END IF 378 379 ! Changing N2 ice amount and pressure 380 381 pdicen2(ig) = zcondices(ig) 382 pdpsrf(ig) = -pdicen2(ig)*g 383 ! pdpsrf(ig) = 0. ! OPTION to check impact N2 sub/cond 384 IF (fast.and.(zplev(ig)+pdpsrf(ig)*subtimestep.le.0.0000001)) then 382 END IF 383 384 ! Changing N2 ice amount and pressure 385 pdicen2(ig) = zcondices(ig) 386 pdpsrf(ig) = -pdicen2(ig)*g 387 ! pdpsrf(ig) = 0. ! OPTION to check impact N2 sub/cond 388 IF (fast.and.(zplev(ig)+pdpsrf(ig)*subtimestep.le.0.0000001)) then 385 389 pdpsrf(ig)=(0.0000001*kp(ig)/p00-zplev(ig))/subtimestep 386 390 pdicen2(ig)=-pdpsrf(ig)/g 387 ENDIF 388 389 ELSE ! no condsub 391 ENDIF 392 393 ELSE ! no condsub 394 395 !IF (zpicen2(ig) .GT. 0.) THEN 396 ! print*,'TB24 no condsub',latitude(ig)*180./pi,longitude(ig)*180./pi 397 !ENDIF 390 398 pdpsrf(ig)=0. 391 399 pdicen2(ig)=0. 392 400 pdtsrfc(ig)=0. 393 ENDIF394 ENDDO ! ig395 enddo ! subtimestep401 ENDIF 402 ENDDO ! ig 403 enddo ! itsub,nsubtimestep 396 404 397 405 ! Updating pressure, temperature and ice reservoir … … 403 411 404 412 pdtsrfc(ig)=((ztsrf(ig)+pdtsrfc(ig)*subtimestep)-(ztsrfhist(ig)))/ptimestep 413 414 !IF (picen2(ig) .GT. 0. .and. abs(pdicen2(ig)).lt.1.e-12) THEN 415 ! print*,'TB24 low pdq',latitude(ig)*180./pi,longitude(ig)*180./pi 416 !ENDIF 417 418 405 419 406 420 ! security … … 413 427 414 428 if(.not.picen2(ig).ge.0.) THEN 415 ! 429 ! if(picen2(ig) + pdicen2(ig)*ptimestep.le.-1.e-8) then 416 430 print*, 'WARNING NEG RESERVOIR in condense_n2: picen2(',ig,')=', picen2(ig) + pdicen2(ig)*ptimestep 417 ! 418 ! 431 ! pdicen2(ig)= -picen2(ig)/ptimestep 432 ! else 419 433 picen2(ig)=0.0 420 ! 434 ! endif 421 435 endif 422 ENDDO 436 ENDDO ! ig 423 437 424 438 ! *************************************************************** … … 433 447 ! Mass fluxes through the sigma levels (kg.m-2.s-1) (>0 when up) 434 448 ! """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 435 436 449 zmflux(1) = -zcondices(ig) 450 DO l=1,klev 437 451 zmflux(l+1) = zmflux(l) -zcondicea(ig,l) & 438 452 + (bp(l)-bp(l+1))*(zfallice(ig,1)-zmflux(1)) 439 453 ! zmflux set to 0 if very low to avoid: top layer is disappearing in v1ld 440 454 if (abs(zmflux(l+1)).lt.1E-13.OR.bp(l+1).eq.0.) zmflux(l+1)=0. 441 455 END DO 442 456 443 457 ! Mass of each layer 444 458 ! ------------------ 445 DO l=1,klev 446 masse(l)=(pplev(ig,l) - pplev(ig,l+1))/g 447 END DO 448 459 DO l=1,klev 460 masse(l)=(pplev(ig,l) - pplev(ig,l+1))/g 461 END DO 449 462 450 463 ! Corresponding fluxes for T,U,V,Q … … 456 469 ! the other tendencies 457 470 ! Estimation of subtimestep (using only the first layer, the most critical) 458 459 460 461 462 463 464 465 ! 466 467 468 469 ! 470 471 dtmax=ptimestep 472 if (zmflux(1).gt.1.e-20) then 473 dtmax=min(dtmax,masse(1)*zqn2(ig,1)/abs(zmflux(1))) 474 endif 475 nsubtimestep= max(nint(ptimestep/dtmax),nint(2.)) 476 subtimestep=ptimestep/float(nsubtimestep) 477 478 ! New flux for each subtimestep 479 do l=1,klev+1 480 w(l)=-zmflux(l)*subtimestep 481 enddo 482 ! initializing variables that will vary during subtimestep: 483 do l=1,klev 471 484 ztc(l) =pt(ig,l) 472 485 zu(l) =pu(ig,l) … … 475 488 zq(l,iq) = pq(ig,l,iq) 476 489 enddo 477 478 479 ! 480 ! 481 482 ! 483 490 end do 491 492 ! loop over nsubtimestep 493 ! """""""""""""""""""""" 494 do itsub=1,nsubtimestep 495 ! Progressively adding tendancies from other processes. 496 do l=1,klev 484 497 ztc(l) =ztc(l) +(pdt(ig,l) + zdtlatent(ig,l))*subtimestep 485 498 zu(l) =zu(l) +pdu( ig,l) * subtimestep … … 488 501 zq(l,iq) = zq(l,iq) + pdq(ig,l,iq)* subtimestep 489 502 enddo 490 491 492 ! 493 503 end do 504 505 ! Change of mass in each layer 506 do l=1,klev 494 507 masse(l)=masse(l)+pdpsrf(ig)*subtimestep*(pplev(ig,l) - pplev(ig,l+1))& 495 508 /(g*pplev(ig,1)) 496 end do 497 498 ! Value transfert at the surface interface when condensation sublimation: 499 500 if (zmflux(1).lt.0) then 501 ! Surface condensation 502 zum(1)= zu(1) 503 zvm(1)= zv(1) 504 ztm(1) = ztc(1) 505 else 506 ! Surface sublimation: 507 ztm(1) = ztsrf(ig) + pdtsrfc(ig)*ptimestep 508 zum(1) = 0 509 zvm(1) = 0 510 end if 511 do iq=1,nq 512 zqm(1,iq)=0. ! most tracer do not condense ! 513 enddo 514 ! Special case if the tracer is n2 gas 515 if (igcm_n2.ne.0) zqm(1,igcm_n2)=1. 516 517 ztm(2:klev+1)=0. 518 zum(2:klev+1)=0. 519 zvm(2:klev+1)=0. 520 zqm1(1:klev+1)=0. 521 522 ! Van Leer scheme: 523 call vl1d(klev,ztc,2.,masse,w,ztm) 524 call vl1d(klev,zu ,2.,masse,w,zum) 525 call vl1d(klev,zv ,2.,masse,w,zvm) 509 end do 510 511 ztm(2:klev+1)=0. 512 zum(2:klev+1)=0. 513 zvm(2:klev+1)=0. 514 zqm1(1:klev+1)=0. 515 516 ! Van Leer scheme: 517 call vl1d(klev,ztc,2.,masse,w,ztm) 518 call vl1d(klev,zu ,2.,masse,w,zum) 519 call vl1d(klev,zv ,2.,masse,w,zvm) 526 520 do iq=1,nq 527 521 do l=1,klev … … 533 527 zqm(l,iq)=zqm1(l) 534 528 enddo 535 536 537 ! 538 529 enddo 530 531 ! Correction to prevent negative value for qn2 532 if (igcm_n2.ne.0) then 539 533 zqm(1,igcm_n2)=1. 540 534 do l=1,klev-1 … … 566 560 if (igcm_n2.ne.0) zqm(1,igcm_n2)=1. 567 561 568 562 !!! Source haze: 0.02 pourcent when n2 sublimes 569 563 IF (source_haze) THEN 570 564 IF (pdicen2(ig).lt.0) THEN … … 611 605 END DO 612 606 613 ! 607 ! Tendencies on Q 614 608 do iq=1,nq 615 609 if (iq.eq.igcm_n2) then 616 ! 610 ! SPECIAL Case when the tracer IS N2 : 617 611 DO l=1,klev 618 612 pdqc(ig,l,iq)= (1/masse(l)) * & … … 630 624 end if 631 625 enddo 632 ! 626 ! Update variables at the end of each subtimestep. 633 627 do l=1,klev 634 628 ztc(l) =ztc(l) + zdtsig(ig,l) *subtimestep … … 639 633 enddo 640 634 end do 641 enddo ! loop on nsubtimestep 642 ! Recomputing Total tendencies 643 do l=1,klev 635 636 enddo ! loop on nsubtimestep 637 638 ! Recomputing Total tendencies 639 do l=1,klev 644 640 pdtc(ig,l) = (ztc(l) - zt(ig,l) )/ptimestep 645 641 pduc(ig,l) = (zu(l) - (pu(ig,l) + pdu(ig,l)*ptimestep))/ptimestep … … 659 655 660 656 enddo 661 657 end do 662 658 ! *******************************TEMPORAIRE ****************** 663 659 if (klon.eq.1) then 664 660 write(*,*) 'nsubtimestep=' ,nsubtimestep 665 661 write(*,*) 'masse avant' , (pplev(ig,1) - pplev(ig,2))/g … … 671 667 write(*,*) 'dq*Dt l=1' , pdq(1,1,1)*ptimestep 672 668 write(*,*) 'dqcond*Dt l=1' , pdqc(1,1,1)*ptimestep 673 669 end if 674 670 675 671 ! *********************************************************** … … 677 673 END DO ! loop on ig 678 674 endif ! not fast 679 680 ! ************ Option Olkin to prevent N2 effect in the south********681 112 continue682 if (olkin) then683 DO ig=1,klon684 if (latitude(ig).lt.0) then685 pdtsrfc(ig) = max(0.,pdtsrfc(ig))686 pdpsrf(ig) = 0.687 pdicen2(ig) = 0.688 do l=1,klev689 pdtc(ig,l) = max(0.,zdtlatent(ig,l))690 pduc(ig,l) = 0.691 pdvc(ig,l) = 0.692 do iq=1,nq693 pdqc(ig,l,iq) = 0694 enddo695 end do696 end if697 END DO698 end if699 ! *******************************************************************700 675 701 676 ! *************************************************************** … … 764 739 !------------------------------------------------------------------------- 765 740 766 real function glob_average2d(var)767 ! Calculates the global average of variable var768 use comgeomfi_h769 use dimphy, only: klon770 USE mod_grid_phy_lmdz, ONLY: nbp_lon, nbp_lat771 use geometry_mod, only: cell_area, latitude772 773 implicit none774 775 ! INTEGER klon776 REAL var(klon)777 INTEGER ig778 779 glob_average2d = 0.780 DO ig=2,klon-1781 glob_average2d = glob_average2d + var(ig)*cell_area(ig)782 END DO783 glob_average2d = glob_average2d + var(1)*cell_area(1)*nbp_lon784 glob_average2d = glob_average2d + var(klon)*cell_area(klon)*nbp_lon785 glob_average2d = glob_average2d/(totarea+(cell_area(1)+cell_area(klon))*(nbp_lon-1))786 787 end function glob_average2d788 789 ! *****************************************************************790 791 741 subroutine vl1d(klev,q,pente_max,masse,w,qm) 792 742 ! … … 835 785 enddo 836 786 837 838 839 840 787 dzq(1)=0. 788 dzq(klev)=0. 789 790 do l = 1,klev-1 841 791 842 792 ! Regular scheme (transfered mass < layer mass) … … 895 845 end if 896 846 end if 897 847 enddo 898 848 899 849 return -
TabularUnified trunk/LMDZ.PLUTO/libf/phypluto/cosurf.F ¶
r3421 r3539 59 59 cdrag=(vonk/log(alt/z00))**2 60 60 61 u= 6.62 v= 3.61 u=0.3 62 v=0.4 63 63 uv=sqrt(u**2+v**2) 64 64 -
TabularUnified trunk/LMDZ.PLUTO/libf/phypluto/inifis_mod.F90 ¶
r3477 r3539 21 21 use comcstfi_mod, only: rad, cpp, g, r, rcp, & 22 22 mugaz, pi, avocado 23 use planete_mod, only: nres24 23 use planetwide_mod, only: planetwide_sumval 25 24 use callkeys_mod … … 203 202 call getin_p("convergeps",convergeps) 204 203 if (is_master) write(*,*) trim(rname)//" convergeps = ",convergeps 204 205 205 conservn2=.false. ! default value 206 206 call getin_p("conservn2",conservn2) 207 207 if (is_master) write(*,*) trim(rname)//" conservn2 = ",conservn2 208 conservch4=.false. ! default value 209 call getin_p("conservch4",conservch4) 210 if (is_master) write(*,*) trim(rname)//" conservch4 = ",conservch4 208 211 209 212 if (is_master) write(*,*) trim(rname)//"KBO runs (eris, makemake) ?" … … 227 230 call getin_p("noseason_day",noseason_day) 228 231 if (is_master) write(*,*) trim(rname)//": noseason_day=", noseason_day 229 230 if (is_master) write(*,*) trim(rname)//": Tidal resonance ratio ?"231 nres=0 ! default value232 call getin_p("nres",nres)233 if (is_master) write(*,*) trim(rname)//": nres = ",nres234 232 235 233 if (is_master) write(*,*) trim(rname)//& … … 310 308 if (is_master) write(*,*) trim(rname)//& 311 309 ": call turbulent vertical diffusion ?" 312 calldifv=. true. ! default value310 calldifv=.false. ! default value 313 311 call getin_p("calldifv",calldifv) 314 312 if (is_master) write(*,*) trim(rname)//": calldifv = ",calldifv 315 313 316 314 if (is_master) write(*,*) trim(rname)//": use turbdiff instead of vdifc ?" 317 UseTurbDiff=. true. ! default value315 UseTurbDiff=.false. ! default value 318 316 call getin_p("UseTurbDiff",UseTurbDiff) 319 317 if (is_master) write(*,*) trim(rname)//": UseTurbDiff = ",UseTurbDiff 320 318 321 319 if (is_master) write(*,*) trim(rname)//": call convective adjustment ?" 322 calladj=. true. ! default value320 calladj=.false. ! default value 323 321 call getin_p("calladj",calladj) 324 322 if (is_master) write(*,*) trim(rname)//": calladj = ",calladj … … 1477 1475 call abort_physic(rname, 'for now, haze/rad proffix only works w aerohaze=T', 1) 1478 1476 endif 1479 if (c ondcosurf.and.no_n2frost) then1477 if (carbox.and.condcosurf.and.no_n2frost) then 1480 1478 call abort_physic(rname, "CO surface condensation and no_n2frost are both active which may not be relevant", 1) 1481 1479 end if -
TabularUnified trunk/LMDZ.PLUTO/libf/phypluto/iniwritesoil.F90 ¶
r3184 r3539 195 195 text="Time" 196 196 ierr=NF_PUT_ATT_TEXT(nid,varid,"long_name",len_trim(text),text) 197 text="days since 0000-0 1-0100:00:00"197 text="days since 0000-00-00 00:00:00" 198 198 ierr=NF_PUT_ATT_TEXT(nid,varid,"units",len_trim(text),text) 199 199 -
TabularUnified trunk/LMDZ.PLUTO/libf/phypluto/phyredem.F90 ¶
r3184 r3539 7 7 subroutine physdem0(filename,lonfi,latfi,nsoil,ngrid,nlay,nq, & 8 8 phystep,day_ini,time,airefi, & 9 alb, ith,pzmea,pzstd,pzsig,pzgam,pzthe)9 alb,pzmea,pzstd,pzsig,pzgam,pzthe) 10 10 ! create physics restart file and write time-independent variables 11 11 use comsoil_h, only: volcapa, mlayer … … 36 36 real,intent(in) :: airefi(ngrid) 37 37 real,intent(in) :: alb(ngrid) 38 real,intent(in) :: ith(ngrid,nsoil)39 38 real,intent(in) :: pzmea(ngrid) 40 39 real,intent(in) :: pzstd(ngrid) … … 125 124 call put_field("ZTHE","Relief: theta parameter",zthe) 126 125 127 ! Soil thermal inertia128 call put_field("inertiedat","Soil thermal inertia",ith)129 130 126 ! Close file 131 127 call close_restartphy … … 134 130 135 131 subroutine physdem1(filename,nsoil,ngrid,nlay,nq, & 136 phystep,time,tsurf,tsoil,emis,q2,qsurf) 132 phystep,time,tsurf,tsoil,inertiesoil, & 133 emis,q2,qsurf) 137 134 ! write time-dependent variable to restart file 138 135 use iostart, only : open_restartphy, close_restartphy, & … … 152 149 real,intent(in) :: tsoil(ngrid,nsoil) 153 150 real,intent(in) :: emis(ngrid) 151 real,intent(in) :: inertiesoil(ngrid,nsoil) 154 152 real,intent(in) :: q2(ngrid,nlay+1) 155 153 real,intent(in) :: qsurf(ngrid,nq) … … 166 164 ! Surface temperature 167 165 call put_field("tsurf","Surface temperature",tsurf) 166 167 ! Soil inertia 168 call put_field("inertiedat","Soil thermal inertia",inertiesoil) 168 169 169 170 ! Soil temperature -
TabularUnified trunk/LMDZ.PLUTO/libf/phypluto/phys_state_var_mod.F90 ¶
r3195 r3539 81 81 82 82 83 real,allocatable,dimension(:,:),save :: qsurf_hist84 83 real,allocatable,dimension(:,:,:),save :: nueffrad ! Aerosol effective radius variance. By RW 85 84 real,allocatable,dimension(:,:,:),save :: reffrad 86 !$OMP THREADPRIVATE(qsurf_hist,nueffrad,reffrad)87 85 88 86 real,dimension(:,:),allocatable,save :: dEzdiff ! Turbulent diffusion heating (W.m-2) … … 143 141 ALLOCATE(cloudfrac(klon,klev)) 144 142 ALLOCATE(totcloudfrac(klon)) 145 ALLOCATE(qsurf_hist(klon,nqtot))146 143 ALLOCATE(reffrad(klon,klev,naerkind)) 147 144 ALLOCATE(nueffrad(klon,klev,naerkind)) … … 221 218 DEALLOCATE(cloudfrac) 222 219 DEALLOCATE(totcloudfrac) 223 DEALLOCATE(qsurf_hist)224 220 DEALLOCATE(reffrad) 225 221 DEALLOCATE(nueffrad) -
TabularUnified trunk/LMDZ.PLUTO/libf/phypluto/physiq_mod.F90 ¶
r3522 r3539 29 29 use comsaison_h, only: mu0, fract, dist_star, declin, right_ascen 30 30 use comsoil_h, only: nsoilmx, layer, mlayer, inertiedat, volcapa 31 use geometry_mod, only: latitude, longitude, cell_area 31 use geometry_mod, only: latitude, longitude, cell_area, & 32 cell_area_for_lonlat_outputs 32 33 USE comgeomfi_h, only: totarea, totarea_planet 33 34 USE tracer_h, only: noms, mmol, radius, rho_q, qext, & … … 43 44 use mod_phys_lmdz_para, only : is_master 44 45 use planete_mod, only: apoastr, periastr, year_day, peri_day, & 45 obliquit, nres,z0, adjust, tpal46 obliquit, z0, adjust, tpal 46 47 use comcstfi_mod, only: pi, g, rcp, r, rad, mugaz, cpp 47 48 use time_phylmdz_mod, only: daysec … … 54 55 lwrite, mass_redistrib, meanOLR, & 55 56 fast,fasthaze,haze,metcloud,monoxcloud, & 56 n2cond,n earn2cond,noseason_day,conservn2, &57 n2cond,noseason_day,conservn2,conservch4, & 57 58 convergeps,kbo,triton,paleo,paleoyears,glaflow, & 58 59 carbox, methane,condmetsurf,condcosurf, & … … 78 79 use condensation_generic_mod, only: condensation_generic 79 80 use datafile_mod, only: datadir 80 #ifndef MESOSCALE81 81 USE vertical_layers_mod, ONLY: ap,bp,aps,bps,presnivs,pseudoalt 82 82 use mod_phys_lmdz_omp_data, ONLY: is_omp_master 83 #else 84 use comm_wrf, only : comm_HR_SW, comm_HR_LW, & 85 comm_CLOUDFRAC,comm_TOTCLOUDFRAC, comm_RH, & 86 comm_HR_DYN, & 87 comm_DQICE,comm_DQVAP,comm_ALBEQ, & 88 comm_FLUXTOP_DN,comm_FLUXABS_SW, & 89 comm_FLUXTOP_LW,comm_FLUXSURF_SW, & 90 comm_FLUXSURF_LW,comm_FLXGRD, & 91 comm_DTRAIN,comm_DTLSC, & 92 comm_LATENT_HF 93 94 #endif 83 USE mod_grid_phy_lmdz, ONLY: regular_lonlat, grid_type, unstructured 95 84 96 85 #ifdef CPP_XIOS … … 110 99 ! ------- 111 100 ! Central subroutine for all the physics parameterisations in the 112 ! universalmodel. Originally adapted from the Mars LMDZ model.113 ! 114 ! The model can be run with out or withtracer transport101 ! Pluto model. Originally adapted from the Mars LMDZ model. 102 ! 103 ! The model can be run with 1 (N2) or more tracer transport 115 104 ! depending on the value of "tracer" in file "callphys.def". 116 !117 105 ! 118 106 ! It includes: … … 122 110 ! I.2 Initialization for every call to physiq. 123 111 ! 124 ! II. Compute radiative transfer tendencies (longwave and shortwave) : 112 ! II.1 Thermosphere 113 ! II.2 Compute radiative transfer tendencies (longwave and shortwave) : 125 114 ! II.a Option 1 : Call correlated-k radiative transfer scheme. 126 ! II.b Option 2 : Call Newtonian cooling scheme. 127 ! II.! Option 3 : Atmosphere has no radiative effect. 128 ! 129 ! III. Vertical diffusion (turbulent mixing) : 115 ! II.b Option 2 : Atmosphere has no radiative effect. 116 ! 117 ! III. Vertical diffusion (turbulent mixing) 130 118 ! 131 119 ! IV. Convection : 132 ! IV.a Thermal plume model 133 ! IV.b Dry convective adjusment 134 ! 135 ! V. Condensation and sublimation of gases (currently just N2). 120 ! IV.a Dry convective adjusment 121 ! 122 ! V. Condensation and sublimation of gases. 136 123 ! 137 124 ! VI. Tracers 138 ! VI.1. Water and water ice. 139 ! VI.2 Photochemistry 140 ! VI.3. Aerosols and particles. 141 ! VI.4. Updates (pressure variations, surface budget). 142 ! VI.5. Slab Ocean. 143 ! VI.6. Surface Tracer Update. 125 ! VI.1. Aerosols and particles. 126 ! VI.2. Updates (pressure variations, surface budget). 127 ! VI.3. Surface Tracer Update. 144 128 ! 145 129 ! VII. Surface and sub-surface soil temperature. … … 210 194 ! Photochemical core developped by F. Lefevre: B. Charnay (2017) 211 195 ! Purge for Pluto model : A. Falco (2024) 196 ! Adapting to Pluto : A. Falco, T. Bertrand (2024) 212 197 !================================================================== 213 198 … … 264 249 REAL,save :: tcond1p4Pa 265 250 DATA tcond1p4Pa/38/ 266 267 268 251 269 252 ! Local variables : … … 297 280 REAL,SAVE :: glastep=20 ! step in pluto day to spread glacier 298 281 299 300 282 ! Aerosol (dust or ice) extinction optical depth at reference wavelength 301 283 ! for the "naerkind" optically active aerosols: … … 318 300 real zzlev(ngrid,nlayer+1) ! Altitude at the atmospheric layer boundaries. 319 301 320 321 ! VARIABLES for the thermal plume model (AF24: deleted)322 323 302 ! TENDENCIES due to various processes : 324 303 … … 328 307 real zdtsurfc(ngrid) ! Condense_n2 routine. 329 308 real zdtsdif(ngrid) ! Turbdiff/vdifc routines. 330 ! real zdtsurf_hyd(ngrid) ! Hydrol routine.331 309 332 310 ! For Atmospheric Temperatures : (K/s) … … 359 337 REAL,allocatable,save :: zdqschim(:,:) ! Calchim_asis routine 360 338 !$OMP THREADPRIVATE(zdqchim,zdqschim) 361 362 339 363 340 !! PLUTO variables … … 400 377 REAL zfluxuv ! Lyman alpha flux at 1AU 401 378 402 403 404 379 REAL array_zero1(ngrid) 405 380 REAL array_zero2(ngrid,nlayer) … … 417 392 real zdmassmr_col(ngrid) ! Atmospheric Column Mass tendency for mass_redistribution (kg_of_air/m2/s). 418 393 real zdpsrfmr(ngrid) ! Pressure tendency for mass_redistribution routine (Pa/s). 419 420 421 394 422 395 ! Local variables for LOCAL CALCULATIONS: … … 431 404 real gmplanet 432 405 real taux(ngrid),tauy(ngrid) 433 434 406 435 407 ! local variables for DIAGNOSTICS : (diagfi & stat) … … 471 443 real rneb_lsc(ngrid,nlayer) ! H2O cloud fraction (large scale). 472 444 473 474 445 ! to test energy conservation (RW+JL) 475 446 real mass(ngrid,nlayer),massarea(ngrid,nlayer) … … 479 450 480 451 !JL12 conservation test for mean flow kinetic energy has been disabled temporarily 481 482 452 real dtmoist_max,dtmoist_min 483 453 real dItot, dItot_tmp, dVtot, dVtot_tmp 484 485 486 454 real dWtot, dWtot_tmp, dWtots, dWtots_tmp 487 488 455 real psat_tmp ! AF24: to remove? 489 456 … … 512 479 REAL zustrhi(ngrid), zvstrhi(ngrid) 513 480 514 515 481 real :: tsurf2(ngrid) 516 482 !! real :: flux_o(ngrid),flux_g(ngrid) … … 518 484 real :: flux_sens_lat(ngrid) 519 485 real :: qsurfint(ngrid,nq) 520 #ifdef MESOSCALE521 REAL :: lsf_dt(nlayer)522 REAL :: lsf_dq(nlayer)523 #endif524 486 525 487 ! local variables for skin depth check 488 real :: therm_inertia(ngrid,nsoilmx) 526 489 real :: inertia_min,inertia_max 527 490 real :: diurnal_skin ! diurnal skin depth (m) … … 556 519 ! Allocate saved arrays (except for 1D model, where this has already 557 520 ! been done) 558 #ifndef MESOSCALE559 521 if (ngrid>1) call phys_state_var_init(nq) 560 #endif561 522 562 523 ! Variables set to 0 … … 591 552 ! Read 'startfi.nc' file. 592 553 ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 593 #ifndef MESOSCALE594 554 call phyetat0(startphy_file, & 595 555 ngrid,nlayer,"startfi.nc",0,0,nsoilmx,nq, & 596 556 day_ini,time_phys,tsurf,tsoil,emis,q2,qsurf,inertiedat) 597 557 598 #else599 600 day_ini = pday601 #endif602 603 #ifndef MESOSCALE604 558 if (.not.startphy_file) then 605 559 ! starting without startfi.nc and with callsoil … … 611 565 alpha=2 612 566 do iloop=0,nsoilmx-1 613 mlayer(iloop)=lay1*(alpha**(iloop-0.5))614 enddo567 mlayer(iloop)=lay1*(alpha**(iloop-0.5)) 568 enddo 615 569 lay1=sqrt(mlayer(0)*mlayer(1)) 616 570 alpha=mlayer(1)/mlayer(0) … … 629 583 day_ini=pday 630 584 endif 631 #endif 585 632 586 if (pday.ne.day_ini) then 633 587 write(*,*) "ERROR in physiq.F90:" … … 674 628 icount=1 675 629 676 ! Initialize surface history variable.677 ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~678 qsurf_hist(:,:)=qsurf(:,:)679 680 !! call WriteField_phy("post_qsurf_hist_qsurf",qsurf(1:ngrid,igcm_h2o_gas),1)681 682 630 ! Initialize variable for dynamical heating and zonal wind tendency diagnostic 683 631 ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ … … 685 633 zuprevious(:,:)=pu(:,:) 686 634 687 ! Set temperature just above condensation temperature (for Early Mars)688 ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~689 if(nearn2cond) then690 write(*,*)' WARNING! Starting at Tcond+1K'691 do l=1, nlayer692 do ig=1,ngrid693 pdt(ig,l)= ((-3167.8)/(log(.01*pplay(ig,l))-23.23)+4 &694 -pt(ig,l)) / ptimestep695 enddo696 enddo697 endif698 699 635 if(meanOLR)then 700 636 call system('rm -f rad_bal.out') ! to record global radiative balance. … … 703 639 endif 704 640 705 706 !! Initialize variables for water cycle ! AF24: removed707 708 641 ! Set metallicity for GCS 709 642 ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ … … 714 647 ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 715 648 716 #ifndef MESOSCALE717 649 if (ngrid.ne.1) then ! Note : no need to create a restart file in 1d. 718 650 call physdem0("restartfi.nc",longitude,latitude,nsoilmx,ngrid,nlayer,nq, & 719 651 ptimestep,pday+nday,time_phys,cell_area, & 720 albedo_bareground,inertiedat,zmea,zstd,zsig,zgam,zthe) 721 endif 722 723 !! call WriteField_phy("post_physdem_qsurf",qsurf(1:ngrid,igcm_h2o_gas),1) 724 #endif 652 albedo_bareground,zmea,zstd,zsig,zgam,zthe) 653 endif 654 725 655 if (corrk) then 726 656 ! We initialise the spectral grid here instead of … … 779 709 ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 780 710 781 if ( .not.nearn2cond ) then 782 pdt(1:ngrid,1:nlayer) = 0.0 783 endif 711 pdt(1:ngrid,1:nlayer) = 0.0 784 712 zdtsurf(1:ngrid) = 0.0 785 713 pdq(1:ngrid,1:nlayer,1:nq) = 0.0 … … 808 736 end if 809 737 810 811 738 ! Get Lyman alpha flux at specific Ls 812 739 if (haze) then … … 815 742 end if 816 743 817 818 744 IF (triton) then 819 745 CALL orbitetriton(zls,zday,dist_star,declin) … … 822 748 ENDIF 823 749 824 825 750 if (diurnal) then 826 751 zlss=-2.*pi*(zday-.5) … … 828 753 zlss=9999. 829 754 endif 830 831 755 832 756 glat(:) = g !AF24: removed oblateness … … 892 816 endif 893 817 894 895 896 818 ! -------------------------------------------------------- 897 ! 1.3 thermosphere819 ! II.1 Thermosphere 898 820 ! -------------------------------------------------------- 899 821 … … 944 866 945 867 if (conservn2) then 946 write(*,*) 'conservn2 thermo '868 write(*,*) 'conservn2 thermosphere' 947 869 call testconservmass(ngrid,nlayer,pplev(:,1),qsurf(:,1)) 948 870 endif … … 950 872 951 873 !--------------------------------- 952 ! II. Compute radiative tendencies874 ! II.2 Compute radiative tendencies 953 875 !--------------------------------- 954 876 ! Saving qsurf to compute paleo flux condensation/sublimation … … 999 921 .and.zday.gt.saveday+1000. & 1000 922 .and.declin.lt.savedeclin) then 1001 call globalaverage2d(ngrid,pplev(:,1),globave)923 call planetwide_sumval(pplev(:,1)*cell_area(:)/totarea_planet,globave) 1002 924 if (globave.gt.1.5) then 1003 925 adjust=adjust+0.005 … … 1012 934 .and.zday.gt.saveday+10000. & 1013 935 .and.declin.gt.savedeclin) then 1014 call globalaverage2d(ngrid,pplev(:,1),globave)936 call planetwide_sumval(pplev(:,1)*cell_area(:)/totarea_planet,globave) 1015 937 if (globave.gt.1.2) then 1016 938 adjust=adjust+0.005 … … 1026 948 call surfprop(ngrid,nq,fract,qsurf,tsurf, & 1027 949 capcal,adjust,dist_star,flusurfold,ptimestep,zls,& 1028 albedo,emis, inertiedat)950 albedo,emis,therm_inertia) 1029 951 ! do i=2,ngrid 1030 952 ! albedo(i,:) = albedo(1,:) … … 1032 954 1033 955 if (firstcall.and.callsoil) then 1034 ! AF24 Originally in soil.F, but inertiedatis modified by surfprop956 ! AF24 Originally in soil.F, but therm_inertia is modified by surfprop 1035 957 ! Additional checks: is the vertical discretization sufficient 1036 958 ! to resolve diurnal and annual waves? 1037 959 do ig=1,ngrid 1038 960 ! extreme inertia for this column 1039 inertia_min=minval( inertiedat(ig,:))1040 inertia_max=maxval( inertiedat(ig,:))961 inertia_min=minval(therm_inertia(ig,:)) 962 inertia_max=maxval(therm_inertia(ig,:)) 1041 963 ! diurnal and annual skin depth 1042 964 diurnal_skin=(inertia_min/volcapa)*sqrt(daysec/pi) … … 1170 1092 endif 1171 1093 1172 ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~1173 ! II.b Call Newtonian cooling scheme !AF24: removed1174 ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~1175 1094 else 1176 1095 ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1177 ! II. !Atmosphere has no radiative effect1096 ! II.b Atmosphere has no radiative effect 1178 1097 ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1179 1098 fluxtop_dn(1:ngrid) = fract(1:ngrid)*mu0(1:ngrid)*Fat1AU/dist_star**2 … … 1264 1183 acond=r/lw_n2 1265 1184 1266 !------------------------------------------------------------------1267 ! test methane conservation1268 ! if(methane)then1269 ! call testconserv(ngrid,nlayer,nq,igcm_ch4_gas,igcm_ch4_ice,1270 ! & ptimestep,pplev,zdqdif,zdqsdif,'CH4',' vdifc ')1271 ! endif ! methane1272 !------------------------------------------------------------------1273 ! test CO conservation1274 ! if(carbox)then1275 ! call testconserv(ngrid,nlayer,nq,igcm_co_gas,igcm_co_ice,1276 ! & ptimestep,pplev,zdqdif,zdqsdif,'CO ',' vdifc ')1277 ! endif ! carbox1278 !------------------------------------------------------------------1279 1280 1185 ! JL12 the following if test is temporarily there to allow us to compare the old vdifc with turbdiff. 1281 1186 else if (UseTurbDiff) then … … 1361 1266 endif ! end of 'enertest' 1362 1267 1363 1364 ! ! Test water conservation. !AF24: removed1365 1366 1268 else ! calldifv 1367 1269 1270 ztim1=4.*sigma*ptimestep 1271 DO ig=1,ngrid 1272 ztim2=ztim1*emis(ig)*tsurf(ig)**3 1273 z1=capcal(ig)*tsurf(ig)+ & 1274 ztim2*tsurf(ig)+ (fluxrad(ig)+fluxgrd(ig))*ptimestep 1275 z2= capcal(ig)+ztim2 1276 zdtsurf(ig)=(z1/z2 - tsurf(ig))/ptimestep 1277 1278 ! for output: 1279 !dplanck(ig)=4.*stephan*ptimestep*emis(ig)*tsurf(ig)**3 1280 ENDDO 1281 1368 1282 ! if(.not.newtonian)then 1369 zdtsurf(1:ngrid) = zdtsurf(1:ngrid) + (fluxrad(1:ngrid) + fluxgrd(1:ngrid))/capcal(1:ngrid)1283 !zdtsurf(1:ngrid) = zdtsurf(1:ngrid) + (fluxrad(1:ngrid) + fluxgrd(1:ngrid))/capcal(1:ngrid) 1370 1284 1371 1285 ! ------------------------------------------------------------------ … … 1374 1288 if ((methane).and.(fast).and.condmetsurf) THEN 1375 1289 1376 call ch4surf(ngrid,nlayer,nq,ptimestep, &1290 call ch4surf(ngrid,nlayer,nq,ptimestep,capcal, & 1377 1291 tsurf,zdtsurf,pplev,pdpsrf,pq,pdq,qsurf,dqsurf, & 1378 1292 zdqch4fast,zdqsch4fast) … … 1404 1318 1405 1319 if (conservn2) then 1406 write(*,*) 'conservn2 diff'1320 write(*,*) 'conservn2 calldifv' 1407 1321 call testconservmass(ngrid,nlayer,pplev(:,1),qsurf(:,1)+ & 1408 1322 dqsurf(:,1)*ptimestep) 1323 endif 1324 if (methane.and.conservch4) then 1325 write(*,*) 'conservch4 calldifv' 1326 if (fast) then 1327 call testconservfast(ngrid,nlayer,nq,pq(:,1,igcm_ch4_gas),pdq(:,1,igcm_ch4_gas), & 1328 qsurf(:,igcm_ch4_ice),dqsurf(:,igcm_ch4_ice), & 1329 ptimestep,pplev,zdqch4fast,zdqsch4fast,'CH4',' vdifc ') 1330 else 1331 call testconserv(ngrid,nlayer,nq,pq,pdq,qsurf,dqsurf, & 1332 igcm_ch4_gas,igcm_ch4_ice, & 1333 ptimestep,pplev,zdqdif,zdqsdif,'CH4',' vdifc ') 1334 endif 1409 1335 endif 1410 1336 … … 1413 1339 !------------------- 1414 1340 1415 ! ~~~~~~~~~~~~~~~~~~~~~~~~~~1416 ! IV.a Thermal plume model : AF24: removed1417 ! ~~~~~~~~~~~~~~~~~~~~~~~~~~1418 1419 1341 ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1420 ! IV. bDry convective adjustment :1342 ! IV.a Dry convective adjustment : 1421 1343 ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1422 1344 … … 1454 1376 1455 1377 endif ! end of 'calladj' 1456 !----------------------------------------------1457 ! Non orographic Gravity Waves: AF24: removed1458 !---------------------------------------------1459 1378 1460 1379 !----------------------------------------------- … … 1506 1425 pdpsrf(:)*ptimestep,qsurf(:,1)+dqsurf(:,1)*ptimestep) 1507 1426 endif 1427 if (methane.and.conservch4) then 1428 write(*,*) 'conservch4 n2cond' 1429 if (fast) then 1430 call testconservfast(ngrid,nlayer,nq,pq(:,1,igcm_ch4_gas),pdq(:,1,igcm_ch4_gas), & 1431 qsurf(:,igcm_ch4_ice),dqsurf(:,igcm_ch4_ice), & 1432 ptimestep,pplev,zdqch4fast,zdqsch4fast,'CH4',' n2cond') 1433 else 1434 call testconserv(ngrid,nlayer,nq,pq,pdq,qsurf,dqsurf, & 1435 igcm_ch4_gas,igcm_ch4_ice, & 1436 ptimestep,pplev,zdqc,zdqsc,'CH4',' n2cond') 1437 endif 1438 endif 1508 1439 1509 1440 !--------------------------------------------- … … 1512 1443 1513 1444 if (tracer) then 1514 1515 1516 1445 1517 1446 ! 7a. Methane, CO, and ice … … 1584 1513 rice_co(:,:)=0 ! initialization needed for callsedim 1585 1514 END IF ! of IF (carbox) 1586 1587 !------------------------------------------------------------------1588 ! test methane conservation1589 ! if(methane)then1590 ! call testconserv(ngrid,nlayer,nq,igcm_ch4_gas,igcm_ch4_ice,1591 ! & ptimestep,pplev,zdqch4cloud,zdqsch4cloud,'CH4','ch4clou')1592 ! endif ! methane1593 !------------------------------------------------------------------1594 ! test CO conservation1595 ! if(carbox)then1596 ! call testconserv(ngrid,nlayer,nq,igcm_co_gas,igcm_co_ice,1597 ! & ptimestep,pplev,zdqcocloud,zdqscocloud,'CO ','cocloud')1598 ! endif ! carbox1599 !------------------------------------------------------------------1600 1515 1601 1516 ! 7b. Haze particle production … … 1646 1561 ENDIF 1647 1562 1648 1649 1650 1563 ! ------------------------- 1651 1564 ! VI.3. Aerosol particles … … 1748 1661 ! call writediagfi(ngrid,"mass_redistribution_post_dqsurf"," "," ",2,dqsurf(1:ngrid,igcm_h2o_gas)) 1749 1662 1750 !! call writediagfi(ngrid,"slab_pre_dqsurf"," "," ",2,dqsurf(1:ngrid,igcm_h2o_gas))1751 !! call writediagfi(ngrid,"slab_pre_qsurf"," "," ",2,qsurf(1:ngrid,igcm_h2o_gas))1752 1753 1754 ! ------------------1755 ! VI.5. Slab Ocean !AF24: removed1756 ! ------------------1757 1758 1663 ! ----------------------------- 1759 1664 ! VI.6. Surface Tracer Update 1760 1665 ! ----------------------------- 1761 1666 1762 ! AF24: deleted hydrology1763 1764 1667 qsurf(1:ngrid,1:nq) = qsurf(1:ngrid,1:nq) + ptimestep*dqsurf(1:ngrid,1:nq) 1765 1766 ! Add qsurf to qsurf_hist, which is what we save in diagfi.nc. At the same time, we set the water1767 ! content of ocean gridpoints back to zero, in order to avoid rounding errors in vdifc, rain.1768 qsurf_hist(:,:) = qsurf(:,:)1769 1770 ! if(ice_update)then1771 ! ice_min(1:ngrid)=min(ice_min(1:ngrid),qsurf(1:ngrid,igcm_h2o_ice))1772 ! endif1773 1668 1774 1669 endif! end of if 'tracer' … … 1820 1715 ! For diagnostic 1821 1716 ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1822 DO ig=1,ngrid 1717 if (.not.fast) then 1718 DO ig=1,ngrid 1823 1719 rho(ig,1) = pplay(ig,1)/(r*pt(ig,1)) 1824 1720 sensiblehf1(ig)=rho(ig,1)*cpp*(0.4/log(zzlay(ig,1)/z0))**2* & … … 1828 1724 sensiblehf2(ig)=zflubid(ig)-capcal(ig)*zdtsdif(ig) 1829 1725 end if 1830 1831 ENDDO1726 ENDDO 1727 endif 1832 1728 1833 1729 … … 1850 1746 ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1851 1747 if (callsoil) then 1852 call soil(ngrid,nsoilmx,.false.,lastcall, inertiedat, &1748 call soil(ngrid,nsoilmx,.false.,lastcall,therm_inertia, & 1853 1749 ptimestep,tsurf,tsoil,capcal,fluxgrd) 1854 1750 endif … … 1939 1835 endif 1940 1836 1941 ! Dynamical heating diagnostic. 1942 do ig=1,ngrid 1943 fluxdyn(ig)= SUM(zdtdyn(ig,:) *mass(ig,:))*cpp 1944 enddo 1837 ! Dynamical heating diagnostic 1838 fluxdyn(:)=0.0 1839 if (.not.fast) then 1840 do ig=1,ngrid 1841 fluxdyn(ig)= SUM(zdtdyn(ig,:) *mass(ig,:))*cpp 1842 enddo 1843 endif 1945 1844 1946 1845 ! Tracers. … … 1949 1848 ! Surface pressure. 1950 1849 ps(1:ngrid) = pplev(1:ngrid,1) + pdpsrf(1:ngrid)*ptimestep 1951 call globalaverage2d(ngrid,ps,globave)1850 call planetwide_sumval(ps(:)*cell_area(:)/totarea_planet,globave) 1952 1851 1953 1852 ! pressure density !pluto specific … … 2216 2115 ! Finally ensure conservation of qsurf 2217 2116 DO iq=1,nq 2218 call globalaverage2d(ngrid,qsurf(:,iq),globaveice(iq)) 2219 call globalaverage2d(ngrid,qsurfpal(:,iq), & 2220 globavenewice(iq)) 2117 call planetwide_sumval(qsurf(:,iq)*cell_area(:)/totarea_planet,globaveice(iq)) 2118 call planetwide_sumval(qsurfpal(:,iq)*cell_area(:)/totarea_planet,globavenewice(iq)) 2221 2119 IF (globavenewice(iq).gt.0.) THEN 2222 2120 qsurfpal(:,iq)=qsurfpal(:,iq)* & … … 2263 2161 ! thus we store for time=time+dtvr 2264 2162 2265 #ifndef MESOSCALE 2266 ! create restartfi 2163 ! create restartfi 2267 2164 if (ngrid.ne.1) then 2268 2165 print*, "physdem1pal not yet implemented" … … 2272 2169 ! ptimestep,pdaypal, & 2273 2170 ! ztime_fin,tsurf,tsoil,emis,q2,qsurfpal, & 2274 ! cell_area,albedodat, inertiedat,zmea,zstd,zsig, &2171 ! cell_area,albedodat,therm_inertia,zmea,zstd,zsig, & 2275 2172 ! zgam,zthe,oblipal,eccpal,tpalnew,adjustnew,phisfipal, & 2276 2173 ! peri_daypal) … … 2283 2180 call physdem1("restartfi.nc",nsoilmx,ngrid,nlayer,nq, & 2284 2181 ptimestep,ztime_fin, & 2285 tsurf,tsoil, emis,q2,qsurf_hist)2182 tsurf,tsoil,therm_inertia,emis,q2,qsurf) 2286 2183 endif 2287 #endif 2184 2288 2185 endif ! end of 'paleo' 2289 2186 endif ! end of 'lastcall' 2290 2291 2292 ! -----------------------------------------------------------------2293 ! WSTATS: Saving statistics2294 ! -----------------------------------------------------------------2295 ! ("stats" stores and accumulates key variables in file "stats.nc"2296 ! which can later be used to make the statistic files of the run:2297 ! if flag "callstats" from callphys.def is .true.)2298 2299 2300 call wstats(ngrid,"ps","Surface pressure","Pa",2,ps)2301 call wstats(ngrid,"tsurf","Surface temperature","K",2,tsurf)2302 call wstats(ngrid,"fluxsurf_lw", &2303 "Thermal IR radiative flux to surface","W.m-2",2, &2304 fluxsurf_lw)2305 call wstats(ngrid,"fluxtop_lw", &2306 "Thermal IR radiative flux to space","W.m-2",2, &2307 fluxtop_lw)2308 2309 ! call wstats(ngrid,"fluxsurf_sw", &2310 ! "Solar radiative flux to surface","W.m-2",2, &2311 ! fluxsurf_sw_tot)2312 ! call wstats(ngrid,"fluxtop_sw", &2313 ! "Solar radiative flux to space","W.m-2",2, &2314 ! fluxtop_sw_tot)2315 2316 call wstats(ngrid,"ISR","incoming stellar rad.","W m-2",2,fluxtop_dn)2317 call wstats(ngrid,"ASR","absorbed stellar rad.","W m-2",2,fluxabs_sw)2318 call wstats(ngrid,"OLR","outgoing longwave rad.","W m-2",2,fluxtop_lw)2319 ! call wstats(ngrid,"ALB","Surface albedo"," ",2,albedo_equivalent)2320 ! call wstats(ngrid,"ALB_1st","First Band Surface albedo"," ",2,albedo(:,1))2321 call wstats(ngrid,"p","Pressure","Pa",3,pplay)2322 call wstats(ngrid,"emis","Emissivity","",2,emis)2323 call wstats(ngrid,"temp","Atmospheric temperature","K",3,zt)2324 call wstats(ngrid,"u","Zonal (East-West) wind","m.s-1",3,zu)2325 call wstats(ngrid,"v","Meridional (North-South) wind","m.s-1",3,zv)2326 call wstats(ngrid,"w","Vertical (down-up) wind","m.s-1",3,pw)2327 call wstats(ngrid,"q2","Boundary layer eddy kinetic energy","m2.s-2",3,q2)2328 2329 if (tracer) then2330 do iq=1,nq2331 call wstats(ngrid,noms(iq),noms(iq),'kg/kg',3,zq(1,1,iq))2332 call wstats(ngrid,trim(noms(iq))//'_surf',trim(noms(iq))//'_surf',&2333 'kg m^-2',2,qsurf(1,iq) )2334 call wstats(ngrid,trim(noms(iq))//'_col',trim(noms(iq))//'_col', &2335 'kg m^-2',2,qcol(1,iq) )2336 ! call wstats(ngrid,trim(noms(iq))//'_reff',trim(noms(iq))//'_reff',&2337 ! 'm',3,reffrad(1,1,iq)) ! bug (2): Subscript #3 of the array REFFRAD has value 2 which is greater than the upper bound of 12338 end do2339 2340 endif ! end of 'tracer'2341 2342 if(lastcall.and.callstats) then2343 write (*,*) "Writing stats..."2344 call mkstats(ierr)2345 endif2346 2347 #ifndef MESOSCALE2348 2187 2349 2188 !------------------------------------------------------------------------------ … … 2357 2196 !------------------------------------------------------------------------------ 2358 2197 2198 !-------- General 1D variables 2199 2359 2200 call write_output("Ls","solar longitude","deg",zls*180./pi) 2360 2201 ! call write_output("Lss","sub solar longitude","deg",zlss*180./pi) … … 2362 2203 call write_output("Declin","solar declination","deg",declin*180./pi) 2363 2204 call write_output("dist_star","dist_star","AU",dist_star) 2205 call write_output("globave","surf press","Pa",globave) 2206 2207 !-------- General 2D variables 2364 2208 2365 2209 call write_output("tsurf","Surface temperature","K",tsurf) 2366 2210 call write_output("ps","Surface pressure","Pa",ps) 2367 2211 call write_output("emis","Emissivity","",emis) 2212 !if (grid_type == regular_lonlat) then 2213 ! call write_output("area","Mesh area","m2", & 2214 ! cell_area_for_lonlat_outputs) 2215 ! else ! unstructured grid (e.g. dynamico) 2216 ! call write_output("area","Mesh area","m2",cell_area) 2217 !endif 2368 2218 2369 2219 if (fast) then 2370 call write_output("globave","surf press","Pa",globave)2371 2220 call write_output("fluxrad","fluxrad","W m-2",fluxrad) 2372 2221 call write_output("fluxgrd","fluxgrd","W m-2",fluxgrd) 2222 ! call write_output("dplanck","dplanck","W.s m-2 K-1",dplanck) 2223 ! "soil" variables 2373 2224 call write_output("capcal","capcal","W.s m-2 K-1",capcal) 2374 ! call write_output("dplanck","dplanck","W.s m-2 K-1",dplanck)2375 2225 call write_output("tsoil","tsoil","K",tsoil) 2376 else 2226 endif 2227 2228 ! Total energy balance diagnostics 2229 if(callrad)then 2230 call write_output("ALB","Surface albedo"," ",albedo_equivalent) 2231 call write_output("ASR","absorbed stellar rad.","W m-2",fluxabs_sw) 2232 call write_output("ISR","incoming stellar rad.","W m-2",fluxtop_dn) 2233 call write_output("OLR","outgoing longwave rad.","W m-2",fluxtop_lw) 2234 call write_output("GND","heat flux from ground","W m-2",fluxgrd) 2235 if (.not.fast) then 2236 call write_output("DYN","dynamical heat input","W m-2",fluxdyn) 2237 endif 2238 endif ! end of 'callrad' 2239 2240 !-------- General 3D variables 2241 2242 if (.not.fast) then 2377 2243 if (check_physics_outputs) then 2378 2244 ! Check the validity of updated fields at the end of the physics step … … 2393 2259 endif 2394 2260 2395 ! Total energy balance diagnostics2396 if(callrad)then2397 call write_output("ALB","Surface albedo"," ",albedo_equivalent)2398 call write_output("ASR","absorbed stellar rad.","W m-2",fluxabs_sw)2399 call write_output("ISR","incoming stellar rad.","W m-2",fluxtop_dn)2400 call write_output("OLR","outgoing longwave rad.","W m-2",fluxtop_lw)2401 call write_output("GND","heat flux from ground","W m-2",fluxgrd)2402 call write_output("DYN","dynamical heat input","W m-2",fluxdyn)2403 endif ! end of 'callrad'2404 2405 2261 if(enertest) then 2406 2262 if (calldifv) then … … 2421 2277 endif ! end of 'enertest' 2422 2278 2423 2424 2425 2279 ! Diagnostics of optical thickness 2280 ! Warning this is exp(-tau), I let you postproc with -log to have tau itself - JVO 19 2281 if (diagdtau) then 2426 2282 do nw=1,L_NSPECTV 2427 2283 write(str2,'(i2.2)') nw … … 2432 2288 call write_output('dtaui'//str2,'Layer optical thickness attenuation in IR band '//str2,'',int_dtaui(:,nlayer:1:-1,nw)) 2433 2289 enddo 2434 endif 2435 2436 ! Temporary inclusions for heating diagnostics. 2437 call write_output("zdtsw","SW heating","T s-1",zdtsw) 2438 call write_output("zdtlw","LW heating","T s-1",zdtlw) 2439 call write_output("dtrad","radiative heating","K s-1",dtrad) 2440 call write_output("zdtdyn","Dyn. heating","T s-1",zdtdyn) 2441 2442 ! For Debugging. 2443 !call write_output('rnat','Terrain type',' ',real(rnat)) 2290 endif 2291 2292 ! Temporary inclusions for heating diagnostics. 2293 if (.not.fast) then 2294 call write_output("zdtsw","SW heating","T s-1",zdtsw) 2295 call write_output("zdtlw","LW heating","T s-1",zdtlw) 2296 call write_output("dtrad","radiative heating","K s-1",dtrad) 2297 call write_output("zdtdyn","Dyn. heating","T s-1",zdtdyn) 2298 endif 2299 2300 ! For Debugging. 2301 !call write_output('rnat','Terrain type',' ',real(rnat)) 2444 2302 2445 2303 ! Output tracers. 2446 2304 if (tracer) then 2447 ! call write_output("zdtc","tendancy T cond N2","K",zdtc)2448 2305 2449 2306 do iq=1,nq 2450 call write_output(noms(iq),noms(iq),'kg/kg',zq(:,:,iq))2451 ! call write_output(trim(noms(iq))//'_surf',trim(noms(iq))//'_surf', &2452 ! 'kg m^-2',qsurf_hist(1,iq) )2307 if (.not.fast) then 2308 call write_output(noms(iq),noms(iq),'kg/kg',zq(:,:,iq)) 2309 endif 2453 2310 call write_output(trim(noms(iq))//'_col',trim(noms(iq))//'_col', & 2454 2311 'kg m^-2',qcol(:,iq) ) … … 2457 2314 enddo ! end of 'nq' loop 2458 2315 2459 !Pluto specific 2460 call write_output('n2_iceflux','n2_iceflux',"kg m^-2 s^-1",flusurf(1,igcm_n2) ) 2461 if (haze_radproffix)then 2462 call write_output('haze_reff','haze_reff','m',reffrad(1,1,1)) 2463 end if 2316 ! N2 cycle 2317 call write_output('n2_iceflux','n2_iceflux',"kg m^-2 s^-1",flusurf(:,igcm_n2) ) 2318 if (.not.fast) then 2319 call write_output("zdtc","tendancy T cond N2","K",zdtc) 2320 endif 2321 2322 ! CH4 cycle 2464 2323 if (methane) then 2465 ! call write_output("rice_ch4","ch4 ice mass mean radius","m",rice_ch4)2466 ! call write_output("zq1temp_ch4"," "," ",zq1temp_ch4)2467 ! call write_output("qsat_ch4"," "," ",qsat_ch4)2468 ! call write_output("qsat_ch4_l1"," "," ",qsat_ch4_l1)2469 2324 2470 2325 call write_output('ch4_iceflux','ch4_iceflux',& 2471 "kg m^-2 s^-1",flusurf( 1,igcm_ch4_ice) )2326 "kg m^-2 s^-1",flusurf(:,igcm_ch4_ice) ) 2472 2327 call write_output("vmr_ch4","vmr_ch4","%",vmr_ch4) 2328 2473 2329 if (.not.fast) then 2474 2330 call write_output("zrho_ch4","zrho_ch4","kg.m-3",zrho_ch4(:,:)) 2331 !call write_output("rice_ch4","ch4 ice mass mean radius","m",rice_ch4) 2332 !call write_output("zq1temp_ch4"," "," ",zq1temp_ch4) 2333 !call write_output("qsat_ch4"," "," ",qsat_ch4) 2334 !call write_output("qsat_ch4_l1"," "," ",qsat_ch4_l1) 2335 2336 ! 3D Tendancies 2337 call write_output("zdqcn2_ch4","zdq condn2 ch4","",& 2338 zdqc(:,:,igcm_ch4_gas)) 2339 call write_output("zdqdif_ch4","zdqdif ch4","",& 2340 zdqdif(:,:,igcm_ch4_gas)) 2341 call write_output("zdqsdif_ch4_ice","zdqsdif ch4","",& 2342 zdqsdif(:,igcm_ch4_ice)) 2343 call write_output("zdqadj_ch4","zdqadj ch4","",& 2344 zdqadj(:,:,igcm_ch4_gas)) 2475 2345 endif 2476 2346 2477 ! Tendancies2478 call write_output("zdqcn2_ch4","zdq condn2 ch4","",&2479 zdqc(:,:,igcm_ch4_gas))2480 call write_output("zdqdif_ch4","zdqdif ch4","",&2481 zdqdif(:,:,igcm_ch4_gas))2482 call write_output("zdqsdif_ch4_ice","zdqsdif ch4","",&2483 zdqsdif(:,igcm_ch4_ice))2484 call write_output("zdqadj_ch4","zdqadj ch4","",&2485 zdqadj(:,:,igcm_ch4_gas))2486 2347 if (sedimentation) then 2487 2348 call write_output("zdqsed_ch4","zdqsed ch4","",& … … 2490 2351 zdqssed(:,igcm_ch4_gas)) 2491 2352 endif 2353 2492 2354 if (metcloud.and.(.not.fast)) then 2493 2355 call write_output("zdtch4cloud","ch4 cloud","T s-1",& 2494 2356 zdtch4cloud) 2495 2357 call write_output("zdqch4cloud","ch4 cloud","T s-1",& 2496 zdqch4cloud( 1,1,igcm_ch4_gas))2358 zdqch4cloud(:,:,igcm_ch4_gas)) 2497 2359 endif 2498 2360 2499 2361 endif 2500 2362 2363 ! CO cycle 2501 2364 if (carbox) then 2502 2365 ! call write_output("zdtcocloud","tendancy T cocloud","K",zdtcocloud) 2503 2366 call write_output('co_iceflux','co_iceflux',& 2504 "kg m^-2 s^-1",flusurf( 1,igcm_co_ice) )2367 "kg m^-2 s^-1",flusurf(:,igcm_co_ice) ) 2505 2368 call write_output("vmr_co","vmr_co","%",vmr_co) 2506 2369 if (.not.fast) THEN … … 2509 2372 endif 2510 2373 2374 ! Haze 2511 2375 if (haze) then 2512 ! call write_output("zrho_haze","zrho_haze","kg.m-3",zrho_haze(:,:)) 2376 2377 if (haze_radproffix)then 2378 call write_output('haze_reff','haze_reff','m',reffrad(:,:,1)) 2379 end if 2380 !call write_output("zrho_haze","zrho_haze","kg.m-3",zrho_haze(:,:)) 2381 !call write_output("zdqhaze_col","zdqhaze col","kg/m2/s",& 2382 ! zdqhaze_col(:)) 2383 2384 ! 3D Tendencies 2513 2385 call write_output("zdqrho_photprec","zdqrho_photprec",& 2514 2386 "kg.m-3.s-1",zdqrho_photprec(:,:)) … … 2519 2391 call write_output("zdqhaze_prec","zdqhaze_prec","",& 2520 2392 zdqhaze(:,:,igcm_prec_haze)) 2393 call write_output("zdqphot_ch4","zdqphot_ch4","",& 2394 zdqphot_ch4(:,:)) 2395 call write_output("zdqconv_prec","zdqconv_prec","",& 2396 zdqconv_prec(:,:)) 2397 2521 2398 if (igcm_haze.ne.0) then 2522 2399 call write_output("zdqhaze_haze","zdqhaze_haze","",& … … 2527 2404 endif 2528 2405 endif 2529 call write_output("zdqphot_ch4","zdqphot_ch4","",& 2530 zdqphot_ch4(:,:)) 2531 call write_output("zdqconv_prec","zdqconv_prec","",& 2532 zdqconv_prec(:,:)) 2533 ! call write_output("zdqhaze_col","zdqhaze col","kg/m2/s", 2534 ! & zdqhaze_col(:)) 2535 endif 2536 2537 if (aerohaze) then 2538 call write_output("tau_col",& 2539 "Total aerosol optical depth","opacity",tau_col) 2406 2407 if (aerohaze) then 2408 call write_output("tau_col",& 2409 "Total aerosol optical depth","opacity",tau_col) 2410 endif 2411 2540 2412 endif 2541 2413 2542 2414 endif ! end of 'tracer' 2543 2544 2415 2545 2416 ! Output spectrum. … … 2550 2421 endif 2551 2422 2552 #else2553 comm_HR_SW(1:ngrid,1:nlayer) = zdtsw(1:ngrid,1:nlayer)2554 comm_HR_LW(1:ngrid,1:nlayer) = zdtlw(1:ngrid,1:nlayer)2555 comm_ALBEQ(1:ngrid)=albedo_equivalent(1:ngrid)2556 if (.not.calldifv) comm_LATENT_HF(:)=0.02557 2558 if ((tracer).and.(generic_condensation)) then2559 2560 ! If you have set generic_condensation (and not water) and you have set several GCS2561 ! then the outputs given to WRF will be only the ones for the last generic tracer2562 ! (Because it is rewritten every tracer in the loop)2563 ! WRF can take only one moist tracer2564 2565 do iq=1,nq2566 call generic_tracer_index(nq,iq,igcm_generic_gas,igcm_generic_ice,call_ice_gas_generic)2567 2568 if (call_ice_gas_generic) then ! to call only one time the ice/vap pair of a tracer2569 2570 reffrad_generic_zeros_for_wrf(:,:) = 1.2571 2572 comm_CLOUDFRAC(1:ngrid,1:nlayer) = cloudfrac(1:ngrid,1:nlayer)2573 comm_TOTCLOUDFRAC(1:ngrid) = totcloudfrac(1:ngrid) !??????2574 comm_SURFRAIN(1:ngrid) = zdqsrain_generic(1:ngrid,iq)2575 comm_DQVAP(1:ngrid,1:nlayer) = pdq(1:ngrid,1:nlayer,igcm_generic_gas)2576 comm_DQICE(1:ngrid,1:nlayer)=pdq(1:ngrid,1:nlayer,igcm_generic_ice)2577 ! comm_H2OICE_REFF(1:ngrid,1:nlayer) = reffrad_generic_zeros_for_wrf(1:ngrid,1:nlayer) ! for now zeros !2578 !comm_H2OICE_REFF(1:ngrid,1:nlayer) = 0*zdtrain_generic(1:ngrid,1:nlayer) ! for now zeros !2579 comm_REEVAP(1:ngrid) = reevap_precip_generic(1:ngrid,iq)2580 comm_DTRAIN(1:ngrid,1:nlayer) = zdtrain_generic(1:ngrid,1:nlayer)2581 comm_DTLSC(1:ngrid,1:nlayer) = dt_generic_condensation(1:ngrid,1:nlayer)2582 comm_RH(1:ngrid,1:nlayer) = RH_generic(1:ngrid,1:nlayer,iq)2583 2584 endif2585 end do ! do iq=1,nq loop on tracers2586 2587 else2588 comm_CLOUDFRAC(1:ngrid,1:nlayer)=0.2589 comm_TOTCLOUDFRAC(1:ngrid)=0.2590 comm_SURFRAIN(1:ngrid)=0.2591 comm_DQVAP(1:ngrid,1:nlayer)=0.2592 comm_DQICE(1:ngrid,1:nlayer)=0.2593 ! comm_H2OICE_REFF(1:ngrid,1:nlayer)=0.2594 comm_REEVAP(1:ngrid)=0.2595 comm_DTRAIN(1:ngrid,1:nlayer)=0.2596 comm_DTLSC(1:ngrid,1:nlayer)=0.2597 comm_RH(1:ngrid,1:nlayer)=0.2598 2599 endif ! if water, if generic_condensation, else2600 2601 comm_FLUXTOP_DN(1:ngrid)=fluxtop_dn(1:ngrid)2602 comm_FLUXABS_SW(1:ngrid)=fluxabs_sw(1:ngrid)2603 comm_FLUXTOP_LW(1:ngrid)=fluxtop_lw(1:ngrid)2604 comm_FLUXSURF_SW(1:ngrid)=fluxsurf_sw(1:ngrid)2605 comm_FLUXSURF_LW(1:ngrid)=fluxsurf_lw(1:ngrid)2606 comm_FLXGRD(1:ngrid)=fluxgrd(1:ngrid)2607 sensibFlux(1:ngrid) = zflubid(1:ngrid) - capcal(1:ngrid)*zdtsdif(1:ngrid) !!! ????2608 comm_HR_DYN(1:ngrid,1:nlayer) = zdtdyn(1:ngrid,1:nlayer)2609 #endif2610 2611 2423 ! XIOS outputs 2612 2424 #ifdef CPP_XIOS -
TabularUnified trunk/LMDZ.PLUTO/libf/phypluto/planete_mod.F90 ¶
r3241 r3539 8 8 REAL,SAVE :: obliquit ! Obliquity of the planet (deg) 9 9 !$OMP THREADPRIVATE(apoastr,periastr,year_day,peri_day,obliquit) 10 REAL,SAVE :: nres ! tidal resonance ratio11 10 REAL,SAVE :: z0 ! surface roughness (m) 12 11 REAL,SAVE :: lmixmin ! mixing length 13 12 REAL,SAVE :: emin_turb ! minimal energy 14 !$OMP THREADPRIVATE( nres,z0,lmixmin,emin_turb)13 !$OMP THREADPRIVATE(z0,lmixmin,emin_turb) 15 14 REAL,SAVE :: coefvis 16 15 REAL,SAVE :: coefir -
TabularUnified trunk/LMDZ.PLUTO/libf/phypluto/surfprop.F90 ¶
r3483 r3539 70 70 REAL,INTENT(OUT) :: albedo(ngrid,L_NSPECTV) 71 71 REAL,INTENT(OUT) :: emis(ngrid) 72 REAL,INTENT(OUT) :: therm_inertia(ngrid,nsoilmx) ! therm_inertia = inertiedat72 REAL,INTENT(OUT) :: therm_inertia(ngrid,nsoilmx) 73 73 !----------------------------------------------------------------------- 74 74 ! Local variables … … 419 419 ! get depth of the different layers 420 420 ! limit diurnal / seasonal 421 if (changetid ) then421 if (changetid.and.methane) then 422 422 if (qsurf(ig,igcm_n2)>1.e-3) then 423 423 emin=facls*ITN2d/volcapa*(daysec/pi)**0.5 … … 426 426 emin=facls*ITCH4d/volcapa*(daysec/pi)**0.5 427 427 tid=ITCH4d 428 else 429 emin=facls*ITH2Od/volcapa*(daysec/pi)**0.5 430 tid=ITH2Od 431 endif 432 else if (changetid) then 433 if (qsurf(ig,igcm_n2)>1.e-3) then 434 emin=facls*ITN2d/volcapa*(daysec/pi)**0.5 435 tid=ITN2d 428 436 else 429 437 emin=facls*ITH2Od/volcapa*(daysec/pi)**0.5 -
TabularUnified trunk/LMDZ.PLUTO/libf/phypluto/testconserv.F90 ¶
r3412 r3539 1 subroutine testconserv(ngrid,nlayer,nq,igcm1,igcm2,ptimestep, & 1 subroutine testconserv(ngrid,nlayer,nq,pq,pdq,pqs,pdqs, & 2 igcm1,igcm2,ptimestep, & 2 3 pplev,zdq,zdqs,car1,car2) 3 4 4 use comgeomfi_h5 5 use comcstfi_mod, only: pi, g 6 6 use geometry_mod, only: latitude, longitude, cell_area 7 7 USE tracer_h, only: igcm_co_ice, igcm_ch4_ice 8 USE comgeomfi_h, only: totarea,totarea_planet 8 9 implicit none 9 10 … … 39 40 INTEGER ngrid, nlayer, nq 40 41 INTEGER igcm1, igcm2 42 REAL pq(ngrid,nlayer,nq) 43 REAL pdq(ngrid,nlayer,nq) 41 44 REAL zdq(ngrid,nlayer,nq) 45 REAL pqs(ngrid,nq) 46 REAL pdqs(ngrid,nq) 42 47 REAL zdqs(ngrid,nq) 43 48 REAL ptimestep … … 49 54 INTEGER l,ig,iq 50 55 REAL masse 56 REAL pqc(ngrid,nlayer,nq) 57 REAL pqcs(ngrid,nq) 51 58 52 59 ! OUTPUT 53 60 REAL dWtot 54 61 REAL dWtots 62 REAL Wtot 63 REAL Wtots 55 64 REAL nconsMAX 56 65 INTEGER myig … … 58 67 !----------------------------------------------------------------------- 59 68 60 write(*,*) 'TB igcm=',igcm1,igcm261 write(*,*) 'TB zdq1=',zdq(1,1,igcm1)62 69 dWtot=0.0 63 70 dWtots=0.0 71 Wtot=0.0 72 Wtots=0.0 64 73 nconsMAX=0.0 74 pqc=pq+pdq*ptimestep 75 pqcs=pqs+pdqs*ptimestep 65 76 do ig = 1, ngrid 66 77 vdifcncons(ig)=0.0 … … 70 81 iq = igcm1 71 82 ! sum of atmospheric mass : kg 83 Wtot = Wtot + masse*pqc(ig,l,iq)*cell_area(ig) 72 84 dWtot = dWtot + masse*zdq(ig,l,iq)*ptimestep*cell_area(ig) 73 85 ! for each column, total mass lost per sec : kg(tracer) / m2 /s … … 78 90 iq = igcm2 79 91 dWtot = dWtot + masse*zdq(ig,l,iq)*ptimestep*cell_area(ig) 92 Wtot = Wtot + masse*pqc(ig,l,iq)*cell_area(ig) 80 93 vdifcncons(ig)=vdifcncons(ig) + masse*zdq(ig,l,iq) 81 94 ENDIF … … 83 96 enddo 84 97 85 iq = igcm1 86 dWtots = dWtots + zdqs(ig,iq)*ptimestep*cell_area(ig) 87 vdifcncons(ig)=vdifcncons(ig)+zdqs(ig,iq) 98 iq = igcm1 99 dWtots = dWtots + zdqs(ig,iq)*ptimestep*cell_area(ig) 100 Wtots = Wtots + pqcs(ig,iq)*cell_area(ig) 101 vdifcncons(ig)=vdifcncons(ig)+zdqs(ig,iq) 88 102 89 103 IF ((igcm2.eq.igcm_co_ice).or.(igcm2.eq.igcm_ch4_ice)) THEN 90 104 iq = igcm2 91 105 dWtots = dWtots + zdqs(ig,iq)*ptimestep*cell_area(ig) 106 Wtots = Wtots + pqcs(ig,iq)*cell_area(ig) 92 107 vdifcncons(ig)=vdifcncons(ig)+zdqs(ig,iq) 93 108 ENDIF 94 109 95 96 97 110 ! vdifcncons is the total amount of material that appear or 111 ! disapear per second in the routine 112 ! it is the non conservative factor 98 113 99 if(vdifcncons(ig).gt.nconsMAX)then100 101 102 114 if(abs(vdifcncons(ig)).gt.abs(nconsMAX))then 115 nconsMAX=vdifcncons(ig) 116 myig=ig 117 endif 103 118 104 119 enddo 105 write(*,*) 'TB Dwtot=',dWtots,dWtot106 120 107 dWtot = dWtot/totarea 108 dWtots = dWtots/totarea 109 print*,'-------------------------------------------' 121 dWtot = dWtot/totarea_planet 122 dWtots = dWtots/totarea_planet 110 123 print*,'In ',car2,' atmospheric ',car1,' change=',dWtot,' kg m-2' 111 124 print*,'In ',car2,' surface ',car1,' change =',dWtots,' kg m-2' … … 115 128 print*,'--> obtained at lat/lon=',latitude(myig)*180./pi,longitude(myig)*180./pi 116 129 ENDIF 130 print*,'--> Total Mass ',car1,' =',Wtot+Wtots,' kg m-2' 117 131 end subroutine testconserv 118 132 -
TabularUnified trunk/LMDZ.PLUTO/libf/phypluto/testconservfast.F90 ¶
r3412 r3539 1 subroutine testconservfast(ngrid,nlayer,nq,p timestep, &2 p plev,zdq,zdqs,car1,car2)1 subroutine testconservfast(ngrid,nlayer,nq,pq,pdq,pqs,pdqs, & 2 ptimestep,pplev,zdq,zdqs,car1,car2) 3 3 4 use comgeomfi_h5 4 use comcstfi_mod, only: pi, g 6 5 use geometry_mod, only: latitude, longitude, cell_area 6 USE comgeomfi_h, only: totarea,totarea_planet 7 7 implicit none 8 8 … … 37 37 38 38 INTEGER ngrid, nlayer, nq 39 40 REAL pq(ngrid) 41 REAL pdq(ngrid) 39 42 REAL zdq(ngrid) 43 REAL pqs(ngrid) 44 REAL pdqs(ngrid) 40 45 REAL zdqs(ngrid) 41 46 REAL ptimestep … … 47 52 INTEGER l,ig,iq 48 53 REAL masse 54 REAL pqc(ngrid) 55 REAL pqcs(ngrid) 49 56 50 57 ! OUTPUT 51 58 REAL dWtot 52 59 REAL dWtots 60 REAL Wtot 61 REAL Wtots 53 62 REAL nconsMAX 54 63 INTEGER myig … … 58 67 dWtot=0.0 59 68 dWtots=0.0 69 Wtot=0.0 70 Wtots=0.0 60 71 nconsMAX=0.0 72 pqc=pq+pdq*ptimestep 73 pqcs=pqs+pdqs*ptimestep 61 74 do ig = 1, ngrid 62 75 vdifcncons(ig)=0.0 63 76 64 77 ! sum of atmospheric mass : kg 65 dWtot = dWtot + zdq(ig)*ptimestep*cell_area(ig)*pplev(ig,1)/g 78 Wtot = Wtot + pqc(ig)*cell_area(ig)*pplev(ig,1)/g 79 dWtot = dWtot + zdq(ig)*ptimestep*cell_area(ig)*pplev(ig,1)/g 66 80 ! for each column, total mass lost per sec : kg(tracer) / m2 /s 67 81 vdifcncons(ig)=vdifcncons(ig) + pplev(ig,1)/g*zdq(ig) 68 82 69 dWtots = dWtots + zdqs(ig)*ptimestep*cell_area(ig) 70 vdifcncons(ig)=vdifcncons(ig)+zdqs(ig) 83 dWtots = dWtots + zdqs(ig)*ptimestep*cell_area(ig) 84 Wtots = Wtots + pqcs(ig)*cell_area(ig) 85 vdifcncons(ig)=vdifcncons(ig)+zdqs(ig) 71 86 72 87 73 74 75 88 ! vdifcncons is the total amount of material that appear or 89 ! disapear per second in the routine 90 ! it is the non conservative factor 76 91 77 if(vdifcncons(ig).gt.nconsMAX)then92 if(abs(vdifcncons(ig)).gt.abs(nconsMAX))then 78 93 nconsMAX=vdifcncons(ig) 79 94 myig=ig 80 95 endif 81 96 82 97 enddo 83 98 84 dWtot = dWtot/totarea 85 dWtots = dWtots/totarea 86 print*,'-------------------------------------------' 99 dWtot = dWtot/totarea_planet 100 dWtots = dWtots/totarea_planet 87 101 print*,'In ',car2,' atmospheric ',car1,' change=',dWtot,' kg m-2' 88 102 print*,'In ',car2,' surface ',car1,' change =',dWtots,' kg m-2' … … 92 106 print*,'--> obtained at lat/lon=',latitude(myig)*180./pi,longitude(myig)*180./pi 93 107 ENDIF 108 print*,'--> Total Mass ',car1,' =',(Wtot+Wtots)/totarea_planet,' kg m-2' 94 109 end subroutine testconservfast 95 110
Note: See TracChangeset
for help on using the changeset viewer.