- Timestamp:
- Aug 2, 2024, 2:12:03 PM (3 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/lmdz_old_1dconv.f90
r5144 r5158 2 2 PRIVATE ! -- We'd love to put IMPLICIT NONE; here... 3 3 PUBLIC get_uvd, copie, get_uvd2, rdgrads, spaces 4 5 REAL play(100) !pression en Pa au milieu de chaque couche GCM 6 INTEGER JM(100) !pression en Pa au milieu de chaque couche GCM 7 REAL coef1(100) !coefficient d interpolation 8 REAL coef2(100) !coefficient d interpolation 9 INTEGER klev 10 11 INTEGER nblvlm !nombre de niveau de pression du mesoNH 12 REAL playm(100) !pression en Pa au milieu de chaque couche Meso-NH 13 REAL hplaym(100) !pression en hPa milieux des couches Meso-NH 14 15 4 16 CONTAINS 5 17 … … 16 28 ! pouvoir calculer la convergence et le cisaillement dans la physiq 17 29 !cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc 18 19 INTEGER klev20 REAL play(100) !pression en Pa au milieu de chaque couche GCM21 INTEGER JM(100) !pression en Pa au milieu de chaque couche GCM22 REAL coef1(100) !coefficient d interpolation23 REAL coef2(100) !coefficient d interpolation24 25 INTEGER nblvlm !nombre de niveau de pression du mesoNH26 REAL playm(100) !pression en Pa au milieu de chaque couche Meso-NH27 REAL hplaym(100) !pression en hPa milieux des couches Meso-NH28 29 30 INTEGER i, j, k, ll, in 30 31 31 CHARACTER*80 file_forctl, file_fordat 32 33 COMMON/com1_phys_gcss/play, coef1, coef2, JM, klev34 COMMON/com2_phys_gcss/playm, hplaym, nblvlm35 32 36 33 !====================================================================== … … 162 159 !*** precedent en format gcm *** 163 160 IF(pas>pasprev)THEN 164 doi = 1, klev161 DO i = 1, klev 165 162 htbef(i) = htaft(i) 166 163 hqbef(i) = hqaft(i) … … 192 189 IF(Tp_fcg) THEN 193 190 ! (le forcage est donne en temperature potentielle) 194 doi = 1, nblvlm191 DO i = 1, nblvlm 195 192 ht_mes(i) = ht_mes(i) * (hplaym(i) / 1000.)**rkappa 196 193 enddo 197 194 endif ! Tp_fcg 198 195 IF(Turb_fcg) THEN 199 doi = 1, nblvlm196 DO i = 1, nblvlm 200 197 hThTurb_mes(i) = hThTurb_mes(i) * (hplaym(i) / 1000.)**rkappa 201 198 enddo … … 216 213 !*** on interpole les champs meso_NH sur les niveaux de pression*** 217 214 !*** gcm . on obtient le nouveau champ after *** 218 dok = 1, klev215 DO k = 1, klev 219 216 IF (JM(k) == 0) THEN 220 217 htaft(k) = ht_mes(jm(k) + 1) … … 254 251 !*** on conserve les derniers champs calcules *** 255 252 IF(temps>=pasmax)THEN 256 doll = 1, klev253 DO ll = 1, klev 257 254 ht(ll) = htaft(ll) 258 255 hq(ll) = hqaft(ll) … … 267 264 !*** on interpole sur les pas de temps de 10mn du gcm a partir *** 268 265 !** des pas de temps de 1h du meso_NH *** 269 doj = 1, klev266 DO j = 1, klev 270 267 ht(j) = ((timeaft - time) * htbef(j) + (time - timebef) * htaft(j)) / dt 271 268 hq(j) = ((timeaft - time) * hqbef(j) + (time - timebef) * hqaft(j)) / dt … … 287 284 print *, ' time,timebef,timeaft', time, timebef, timeaft 288 285 print *, ' ht,htbef,htaft,hthturb,hthturbbef,hthturbaft' 289 doj = 1, klev286 DO j = 1, klev 290 287 print *, j, ht(j), htbef(j), htaft(j), & 291 288 & hthturb(j), hthturbbef(j), hthturbaft(j) 292 289 enddo 293 290 print *, ' hq,hqbef,hqaft,hqturb,hqturbbef,hqturbaft' 294 doj = 1, klev291 DO j = 1, klev 295 292 print *, j, hq(j), hqbef(j), hqaft(j), & 296 293 & hqturb(j), hqturbbef(j), hqturbaft(j) … … 317 314 318 315 !------------------ 319 doi = 1, 1000316 DO i = 1, 1000 320 317 read(97, 1000, end = 999) string 321 318 1000 format (a4) … … 373 370 !------------------------------------------------------------------------ 374 371 IF(Tp_fcg) THEN 375 doi = 1, nblvlm372 DO i = 1, nblvlm 376 373 ht_mes(i) = ht_mes(i) * (hplaym(i) / 1000.)**rkappa 377 374 enddo … … 393 390 ! on interpole sur les niveaux du gcm(niveau pression bien sur!) 394 391 !----------------------------------------------------------------------- 395 dok = 1, klev392 DO k = 1, klev 396 393 IF (JM(k) == 0) THEN 397 394 !FKC bug? ne faut il pas convertir tsol en tendance ???? … … 426 423 tsaft = ts_subr 427 424 ! valeurs initiales des champs de convergence 428 dok = 1, klev425 DO k = 1, klev 429 426 ht(k) = htaft(k) 430 427 hq(k) = hqaft(k) … … 473 470 data alx, aly /100000., 150000./ 474 471 475 dok = 1, klev472 DO k = 1, klev 476 473 du = abs(vu_f(k) - cx) / alx 477 474 dv = abs(vv_f(k) - cy) / aly … … 489 486 IMPLICIT NONE 490 487 491 !cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc492 ! cette routine remplit les COMMON com1_phys_gcss et com2_phys_gcss.h493 !ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc494 495 INTEGER klev !nombre de niveau de pression du GCM496 REAL play(100) !pression en Pa au milieu de chaque couche GCM497 INTEGER JM(100)498 REAL coef1(100) !coefficient d interpolation499 REAL coef2(100) !coefficient d interpolation500 501 INTEGER nblvlm !nombre de niveau de pression du mesoNH502 REAL playm(100) !pression en Pa au milieu de chaque couche Meso-NH503 REAL hplaym(100)!pression en hecto-Pa des milieux de couche Meso-NH504 505 COMMON/com1_phys_gcss/play, coef1, coef2, JM, klev506 COMMON/com2_phys_gcss/playm, hplaym, nblvlm507 508 488 INTEGER k, klevgcm 509 489 REAL playgcm(klevgcm) ! pression en milieu de couche du gcm … … 518 498 !--------------------------------------------------------------------- 519 499 520 dok = 1, klev500 DO k = 1, klev 521 501 play(k) = playgcm(k) 522 502 PRINT*, 'la pression gcm est:', play(k) … … 526 506 ! lecture du descripteur des donnees Meso-NH (forcing.ctl): 527 507 ! -> nb niveaux du meso.NH (nblvlm) + pressions meso.NH 528 ! (on remplit le COMMON com2_phys_gcss)529 508 !---------------------------------------------------------------------- 530 509 … … 536 515 ! etude de la correspondance entre les niveaux meso.NH et GCM; 537 516 ! calcul des coefficients d interpolation coef1 et coef2 538 ! (on remplit le COMMON com1_phys_gcss)539 517 !---------------------------------------------------------------------- 540 518 … … 549 527 WRITE(*, *) '--------------------------------------' 550 528 WRITE(*, *) 'GCM: nb niveaux:', klev, ' et pression, coeffs:' 551 dok = 1, klev529 DO k = 1, klev 552 530 WRITE(*, *) play(k), coef1(k), coef2(k) 553 531 enddo 554 532 WRITE(*, *) 'MESO-NH: nb niveaux:', nblvlm, ' et pression:' 555 dok = 1, nblvlm533 DO k = 1, nblvlm 556 534 WRITE(*, *) playm(k), hplaym(k) 557 535 enddo … … 570 548 !ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc 571 549 572 INTEGER nblvlm !nombre de niveau de pression du mesoNH573 REAL playm(100) !pression en Pa milieu de chaque couche Meso-NH574 REAL hplaym(100) !pression en hPa des milieux de couche Meso-NH575 COMMON/com2_phys_gcss/playm, hplaym, nblvlm576 577 550 INTEGER i, lu, mlz, mlzh 578 551 … … 586 559 open(lu, file = file_forctl, form = 'formatted') 587 560 588 doi = 1, 1000561 DO i = 1, 1000 589 562 read(lu, 1000, end = 999) a 590 563 IF (a == 'ZDEF') go to 100 … … 608 581 ! Si la pression est en HPa, la multiplier par 100 609 582 IF (playm(1) < 10000.) THEN 610 domlz = 1, nblvlm583 DO mlz = 1, nblvlm 611 584 playm(mlz) = playm(mlz) * 100. 612 585 enddo … … 617 590 618 591 PRINT*, ' ' 619 domlzh = 1, nblvlm592 DO mlzh = 1, nblvlm 620 593 hplaym(mlzh) = playm(mlzh) / 100. 621 594 enddo … … 644 617 icomp = icount 645 618 646 dok = 1, nl619 DO k = 1, nl 647 620 icomp = icomp + 1 648 621 read(itape, rec = icomp)z(k) 649 622 print *, 'icomp,k,z(k) ', icomp, k, z(k) 650 623 enddo 651 dok = 1, nl624 DO k = 1, nl 652 625 icomp = icomp + 1 653 626 read(itape, rec = icomp)hT(k) 654 627 PRINT*, hT(k), k 655 628 enddo 656 dok = 1, nl629 DO k = 1, nl 657 630 icomp = icomp + 1 658 631 read(itape, rec = icomp)hQ(k) … … 660 633 661 634 IF(turb_fcg) THEN 662 dok = 1, nl635 DO k = 1, nl 663 636 icomp = icomp + 1 664 637 read(itape, rec = icomp)hThTur(k) 665 638 enddo 666 dok = 1, nl639 DO k = 1, nl 667 640 icomp = icomp + 1 668 641 read(itape, rec = icomp)hqTur(k) … … 672 645 673 646 IF(imp_fcg) THEN 674 dok = 1, nl647 DO k = 1, nl 675 648 icomp = icomp + 1 676 649 read(itape, rec = icomp)hu(k) 677 650 enddo 678 dok = 1, nl651 DO k = 1, nl 679 652 icomp = icomp + 1 680 653 read(itape, rec = icomp)hv(k) … … 683 656 endif 684 657 685 dok = 1, nl658 DO k = 1, nl 686 659 icomp = icomp + 1 687 660 read(itape, rec = icomp)hw(k) … … 707 680 !ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc 708 681 709 INTEGER klev !nombre de niveau de pression du GCM710 REAL play(100) !pression en Pa au milieu de chaque couche GCM711 INTEGER JM(100)712 REAL coef1(100) !coefficient d interpolation713 REAL coef2(100) !coefficient d interpolation714 715 INTEGER nblvlm !nombre de niveau de pression du mesoNH716 REAL playm(100) !pression en Pa milieu de chaque couche Meso-NH717 REAL hplaym(100)!pression en hPa des milieux de couche Meso-NH718 719 COMMON/com1_phys_gcss/play, coef1, coef2, JM, klev720 COMMON/com2_phys_gcss/playm, hplaym, nblvlm721 722 682 REAL psol 723 683 REAL val 724 684 INTEGER k, mlz 725 685 726 dok = 1, klev686 DO k = 1, klev 727 687 val = play(k) 728 688 IF (val > playm(1)) THEN … … 732 692 coef2(1) = (val - psol) / (playm(mlz + 1) - psol) 733 693 ELSE IF (val > playm(nblvlm)) THEN 734 domlz = 1, nblvlm694 DO mlz = 1, nblvlm 735 695 IF (val <= playm(mlz).AND. val > playm(mlz + 1))THEN 736 696 JM(k) = mlz
Note: See TracChangeset
for help on using the changeset viewer.