Changeset 2019
- Timestamp:
- Apr 16, 2014, 7:16:58 AM (10 years ago)
- Location:
- LMDZ5/trunk/libf
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ5/trunk/libf/dyn3d/conf_gcm.F
r1984 r2019 2 2 ! $Id$ 3 3 ! 4 c 5 c 4 ! 5 ! 6 6 SUBROUTINE conf_gcm( tapedef, etatinit, clesphy0 ) 7 c 7 ! 8 8 USE control_mod 9 9 #ifdef CPP_IOIPSL … … 17 17 18 18 IMPLICIT NONE 19 c-----------------------------------------------------------------------20 cAuteurs : L. Fairhead , P. Le Van .21 c 22 cArguments :23 c 24 ctapedef :25 cetatinit : = TRUE , on ne compare pas les valeurs des para-26 c-metres du zoom avec celles lues sur le fichier start .27 cclesphy0 : sortie .28 c 19 !----------------------------------------------------------------------- 20 ! Auteurs : L. Fairhead , P. Le Van . 21 ! 22 ! Arguments : 23 ! 24 ! tapedef : 25 ! etatinit : = TRUE , on ne compare pas les valeurs des para- 26 ! -metres du zoom avec celles lues sur le fichier start . 27 ! clesphy0 : sortie . 28 ! 29 29 LOGICAL etatinit 30 30 INTEGER tapedef … … 33 33 PARAMETER( longcles = 20 ) 34 34 REAL clesphy0( longcles ) 35 c 36 cDeclarations :37 c--------------35 ! 36 ! Declarations : 37 ! -------------- 38 38 #include "dimensions.h" 39 39 #include "paramet.h" … … 47 47 ! #include "clesphys.h" 48 48 #include "iniprint.h" 49 c 50 c 51 clocal:52 c------49 ! 50 ! 51 ! local: 52 ! ------ 53 53 54 54 CHARACTER ch1*72,ch2*72,ch3*72,ch4*12 … … 58 58 INTEGER i 59 59 LOGICAL use_filtre_fft 60 c 61 c-------------------------------------------------------------------62 c 63 c......... Version du 29/04/97 ..........64 c 65 cNouveaux parametres nitergdiv,nitergrot,niterh,tetagdiv,tetagrot,66 ctetatemp ajoutes pour la dissipation .67 c 68 cAutre parametre ajoute en fin de liste de tapedef : ** fxyhypb **69 c 70 cSi fxyhypb = .TRUE. , choix de la fonction a derivee tangente hyperb.71 cSinon , choix de fxynew , a derivee sinusoidale ..72 c 73 c...... etatinit = . TRUE. si defrun est appele dans ETAT0_LMD ou74 cLIMIT_LMD pour l'initialisation de start.dat (dic) et75 cde limit.dat ( dic) ...........76 cSinon etatinit = . FALSE .77 c 78 cDonc etatinit = .F. si on veut comparer les valeurs de grossismx ,79 cgrossismy,clon,clat, fxyhypb lues sur le fichier start avec80 ccelles passees par run.def , au debut du gcm, apres l'appel a81 clectba .82 cCes parmetres definissant entre autres la grille et doivent etre83 cpareils et coherents , sinon il y aura divergence du gcm .84 c 85 c-----------------------------------------------------------------------86 cinitialisations:87 c----------------60 ! 61 ! ------------------------------------------------------------------- 62 ! 63 ! ......... Version du 29/04/97 .......... 64 ! 65 ! Nouveaux parametres nitergdiv,nitergrot,niterh,tetagdiv,tetagrot, 66 ! tetatemp ajoutes pour la dissipation . 67 ! 68 ! Autre parametre ajoute en fin de liste de tapedef : ** fxyhypb ** 69 ! 70 ! Si fxyhypb = .TRUE. , choix de la fonction a derivee tangente hyperb. 71 ! Sinon , choix de fxynew , a derivee sinusoidale .. 72 ! 73 ! ...... etatinit = . TRUE. si defrun est appele dans ETAT0_LMD ou 74 ! LIMIT_LMD pour l'initialisation de start.dat (dic) et 75 ! de limit.dat ( dic) ........... 76 ! Sinon etatinit = . FALSE . 77 ! 78 ! Donc etatinit = .F. si on veut comparer les valeurs de grossismx , 79 ! grossismy,clon,clat, fxyhypb lues sur le fichier start avec 80 ! celles passees par run.def , au debut du gcm, apres l'appel a 81 ! lectba . 82 ! Ces parmetres definissant entre autres la grille et doivent etre 83 ! pareils et coherents , sinon il y aura divergence du gcm . 84 ! 85 !----------------------------------------------------------------------- 86 ! initialisations: 87 ! ---------------- 88 88 89 89 !Config Key = lunout … … 95 95 CALL getin('lunout', lunout) 96 96 IF (lunout /= 5 .and. lunout /= 6) THEN 97 OPEN(UNIT=lunout,FILE='lmdz.out',ACTION='write', 97 OPEN(UNIT=lunout,FILE='lmdz.out',ACTION='write', & 98 98 & STATUS='unknown',FORM='formatted') 99 99 ENDIF … … 107 107 CALL getin('prt_level',prt_level) 108 108 109 c-----------------------------------------------------------------------110 cParametres de controle du run:111 c-----------------------------------------------------------------------109 !----------------------------------------------------------------------- 110 ! Parametres de controle du run: 111 !----------------------------------------------------------------------- 112 112 !Config Key = planet_type 113 113 !Config Desc = planet type ("earth", "mars", "venus", ...) … … 232 232 CALL getin('dissip_period',dissip_period) 233 233 234 ccc .... P. Le Van , modif le 29/04/97 .pour la dissipation ...235 ccc234 !cc .... P. Le Van , modif le 29/04/97 .pour la dissipation ... 235 !cc 236 236 237 237 !Config Key = lstardis … … 348 348 CALL getin('ok_guide',ok_guide) 349 349 350 c...............................................................350 ! ............................................................... 351 351 352 352 !Config Key = read_start … … 390 390 ENDDO 391 391 392 ccc .... P. Le Van , ajout le 7/03/95 .pour le zoom ...393 c......... ( modif le 17/04/96 ) .........394 c 392 !cc .... P. Le Van , ajout le 7/03/95 .pour le zoom ... 393 ! ......... ( modif le 17/04/96 ) ......... 394 ! 395 395 IF( etatinit ) GO TO 100 396 396 … … 411 411 CALL getin('clat',clatt) 412 412 413 c 414 c 413 ! 414 ! 415 415 IF( ABS(clat - clatt).GE. 0.001 ) THEN 416 write(lunout,*)'conf_gcm: La valeur de clat passee par run.def', 416 write(lunout,*)'conf_gcm: La valeur de clat passee par run.def', & 417 417 & ' est differente de celle lue sur le fichier start ' 418 418 STOP … … 429 429 430 430 IF( ABS(grossismx - grossismxx).GE. 0.001 ) THEN 431 write(lunout,*)'conf_gcm: La valeur de grossismx passee par ', 431 write(lunout,*)'conf_gcm: La valeur de grossismx passee par ', & 432 432 & 'run.def est differente de celle lue sur le fichier start ' 433 433 STOP … … 443 443 444 444 IF( ABS(grossismy - grossismyy).GE. 0.001 ) THEN 445 write(lunout,*)'conf_gcm: La valeur de grossismy passee par ', 445 write(lunout,*)'conf_gcm: La valeur de grossismy passee par ', & 446 446 & 'run.def est differente de celle lue sur le fichier start ' 447 447 STOP … … 449 449 450 450 IF( grossismx.LT.1. ) THEN 451 write(lunout,*) 451 write(lunout,*) & 452 452 & 'conf_gcm: *** ATTENTION !! grossismx < 1 . *** ' 453 453 STOP … … 458 458 459 459 IF( grossismy.LT.1. ) THEN 460 write(lunout,*) 460 write(lunout,*) & 461 461 & 'conf_gcm: *** ATTENTION !! grossismy < 1 . *** ' 462 462 STOP … … 466 466 467 467 write(lunout,*)'conf_gcm: alphax alphay',alphax,alphay 468 c 469 calphax et alphay sont les anciennes formulat. des grossissements470 c 471 c 468 ! 469 ! alphax et alphay sont les anciennes formulat. des grossissements 470 ! 471 ! 472 472 473 473 !Config Key = fxyhypb … … 482 482 IF( fxyhypbb ) THEN 483 483 write(lunout,*)' ******** PBS DANS CONF_GCM ******** ' 484 write(lunout,*)' *** fxyhypb lu sur le fichier start est ', 485 *'F alors qu il est T sur run.def ***'484 write(lunout,*)' *** fxyhypb lu sur le fichier start est ', & 485 & 'F alors qu il est T sur run.def ***' 486 486 STOP 487 487 ENDIF … … 489 489 IF( .NOT.fxyhypbb ) THEN 490 490 write(lunout,*)' ******** PBS DANS CONF_GCM ******** ' 491 write(lunout,*)' *** fxyhypb lu sur le fichier start est ', 492 *'T alors qu il est F sur run.def **** '491 write(lunout,*)' *** fxyhypb lu sur le fichier start est ', & 492 & 'T alors qu il est F sur run.def **** ' 493 493 STOP 494 494 ENDIF 495 495 ENDIF 496 c 496 ! 497 497 !Config Key = dzoomx 498 498 !Config Desc = extension en longitude … … 505 505 IF( fxyhypb ) THEN 506 506 IF( ABS(dzoomx - dzoomxx).GE. 0.001 ) THEN 507 write(lunout,*)'conf_gcm: La valeur de dzoomx passee par ', 508 *'run.def est differente de celle lue sur le fichier start '507 write(lunout,*)'conf_gcm: La valeur de dzoomx passee par ', & 508 & 'run.def est differente de celle lue sur le fichier start ' 509 509 STOP 510 510 ENDIF … … 521 521 IF( fxyhypb ) THEN 522 522 IF( ABS(dzoomy - dzoomyy).GE. 0.001 ) THEN 523 write(lunout,*)'conf_gcm: La valeur de dzoomy passee par ', 524 *'run.def est differente de celle lue sur le fichier start '523 write(lunout,*)'conf_gcm: La valeur de dzoomy passee par ', & 524 & 'run.def est differente de celle lue sur le fichier start ' 525 525 STOP 526 526 ENDIF … … 536 536 IF( fxyhypb ) THEN 537 537 IF( ABS(taux - tauxx).GE. 0.001 ) THEN 538 write(lunout,*)'conf_gcm: La valeur de taux passee par ', 539 *'run.def est differente de celle lue sur le fichier start '538 write(lunout,*)'conf_gcm: La valeur de taux passee par ', & 539 & 'run.def est differente de celle lue sur le fichier start ' 540 540 STOP 541 541 ENDIF … … 551 551 IF( fxyhypb ) THEN 552 552 IF( ABS(tauy - tauyy).GE. 0.001 ) THEN 553 write(lunout,*)'conf_gcm: La valeur de tauy passee par ', 554 *'run.def est differente de celle lue sur le fichier start '553 write(lunout,*)'conf_gcm: La valeur de tauy passee par ', & 554 & 'run.def est differente de celle lue sur le fichier start ' 555 555 STOP 556 556 ENDIF 557 557 ENDIF 558 558 559 cc559 !c 560 560 IF( .NOT.fxyhypb ) THEN 561 561 … … 572 572 IF( ysinuss ) THEN 573 573 write(lunout,*)' ******** PBS DANS CONF_GCM ******** ' 574 write(lunout,*)' *** ysinus lu sur le fichier start est F', 575 *' alors qu il est T sur run.def ***'574 write(lunout,*)' *** ysinus lu sur le fichier start est F', & 575 & ' alors qu il est T sur run.def ***' 576 576 STOP 577 577 ENDIF … … 579 579 IF( .NOT.ysinuss ) THEN 580 580 write(lunout,*)' ******** PBS DANS CONF_GCM ******** ' 581 write(lunout,*)' *** ysinus lu sur le fichier start est T', 582 *' alors qu il est F sur run.def **** '581 write(lunout,*)' *** ysinus lu sur le fichier start est T', & 582 & ' alors qu il est F sur run.def **** ' 583 583 STOP 584 584 ENDIF 585 585 ENDIF 586 586 ENDIF ! of IF( .NOT.fxyhypb ) 587 c 587 ! 588 588 !Config Key = offline 589 589 !Config Desc = Nouvelle eau liquide … … 682 682 683 683 RETURN 684 c...............................................685 c 684 ! ............................................... 685 ! 686 686 100 CONTINUE 687 687 !Config Key = clon … … 718 718 719 719 IF( grossismx.LT.1. ) THEN 720 write(lunout,*) 721 & 'conf_gcm: *** ATTENTION !! grossismx < 1 . *** ' 720 write(lunout,*)'conf_gcm: ***ATTENTION !! grossismx < 1 . *** ' 722 721 STOP 723 722 ELSE … … 727 726 728 727 IF( grossismy.LT.1. ) THEN 729 write(lunout,*) 730 & 'conf_gcm: *** ATTENTION !! grossismy < 1 . *** ' 728 write(lunout,*) 'conf_gcm: ***ATTENTION !! grossismy < 1 . *** ' 731 729 STOP 732 730 ELSE … … 735 733 736 734 write(lunout,*)'conf_gcm: alphax alphay ',alphax,alphay 737 c 738 calphax et alphay sont les anciennes formulat. des grossissements739 c 740 c 735 ! 736 ! alphax et alphay sont les anciennes formulat. des grossissements 737 ! 738 ! 741 739 742 740 !Config Key = fxyhypb … … 786 784 ysinus = .TRUE. 787 785 CALL getin('ysinus',ysinus) 788 c 786 ! 789 787 !Config Key = offline 790 788 !Config Desc = Nouvelle eau liquide … … 864 862 vert_prof_dissip = merge(1, 0, ok_strato .and. llm==39) 865 863 CALL getin('vert_prof_dissip', vert_prof_dissip) 866 call assert(vert_prof_dissip == 0 .or. vert_prof_dissip == 1, 867 $"bad value for vert_prof_dissip")864 call assert(vert_prof_dissip == 0 .or. vert_prof_dissip == 1, & 865 & "bad value for vert_prof_dissip") 868 866 869 867 !Config Key = ok_gradsfile … … 892 890 893 891 write(lunout,*)' #########################################' 894 write(lunout,*)' Configuration des parametres de cel0' 892 write(lunout,*)' Configuration des parametres de cel0' & 895 893 & //'_limit: ' 896 894 write(lunout,*)' planet_type = ', planet_type … … 937 935 write(lunout,*)' ok_limit = ', ok_limit 938 936 write(lunout,*)' ok_etat0 = ', ok_etat0 939 c 937 ! 940 938 RETURN 941 939 END -
LMDZ5/trunk/libf/dyn3d_common/q_sat.F
r1945 r2019 2 2 ! $Header$ 3 3 ! 4 c 5 c 4 ! 5 ! 6 6 7 7 subroutine q_sat(np,temp,pres,qsat) 8 c 8 ! 9 9 IMPLICIT none 10 c======================================================================11 cAutheur(s): Z.X. Li (LMD/CNRS)12 creecriture vectorisee par F. Hourdin.13 cObjet: calculer la vapeur d'eau saturante (formule Centre Euro.)14 c======================================================================15 cArguments:16 ckelvin---input-R: temperature en Kelvin17 cmillibar--input-R: pression en mb18 c 19 cq_sat----output-R: vapeur d'eau saturante en kg/kg20 c======================================================================21 c 10 !====================================================================== 11 ! Autheur(s): Z.X. Li (LMD/CNRS) 12 ! reecriture vectorisee par F. Hourdin. 13 ! Objet: calculer la vapeur d'eau saturante (formule Centre Euro.) 14 !====================================================================== 15 ! Arguments: 16 ! kelvin---input-R: temperature en Kelvin 17 ! millibar--input-R: pression en mb 18 ! 19 ! q_sat----output-R: vapeur d'eau saturante en kg/kg 20 !====================================================================== 21 ! 22 22 integer np 23 23 REAL temp(np),pres(np),qsat(np) 24 c 24 ! 25 25 REAL r2es 26 26 PARAMETER (r2es=611.14 *18.0153/28.9644) 27 c 27 ! 28 28 REAL r3les, r3ies, r3es 29 29 PARAMETER (R3LES=17.269) 30 30 PARAMETER (R3IES=21.875) 31 c 31 ! 32 32 REAL r4les, r4ies, r4es 33 33 PARAMETER (R4LES=35.86) 34 34 PARAMETER (R4IES=7.66) 35 c 35 ! 36 36 REAL rtt 37 37 PARAMETER (rtt=273.16) 38 c 38 ! 39 39 REAL retv 40 40 PARAMETER (retv=28.9644/18.0153 - 1.0) … … 42 42 real zqsat 43 43 integer ip 44 c 45 C------------------------------------------------------------------46 c 47 c 44 ! 45 ! ------------------------------------------------------------------ 46 ! 47 ! 48 48 49 49 do ip=1,np 50 50 51 cwrite(*,*)'kelvin,millibar=',kelvin,millibar52 cwrite(*,*)'temp,pres=',temp(ip),pres(ip)53 c 51 ! write(*,*)'kelvin,millibar=',kelvin,millibar 52 ! write(*,*)'temp,pres=',temp(ip),pres(ip) 53 ! 54 54 IF (temp(ip) .LE. rtt) THEN 55 55 r3es = r3ies … … 59 59 r4es = r4les 60 60 ENDIF 61 c 61 ! 62 62 zqsat=r2es/pres(ip)*EXP(r3es*(temp(ip)-rtt)/(temp(ip)-r4es)) 63 63 zqsat=MIN(0.5,ZQSAT) 64 64 zqsat=zqsat/(1.-retv *zqsat) 65 c 65 ! 66 66 qsat(ip)= zqsat 67 cwrite(*,*)'qsat=',qsat(ip)67 ! write(*,*)'qsat=',qsat(ip) 68 68 69 69 enddo 70 c 70 ! 71 71 RETURN 72 72 END -
LMDZ5/trunk/libf/phylmd/1DUTILS.h
r2018 r2019 5 5 ! $Id: conf_unicol.F 1279 2010-08-04 17:20:56Z lahellec $ 6 6 ! 7 c 8 c 7 ! 8 ! 9 9 SUBROUTINE conf_unicol 10 c 10 ! 11 11 #ifdef CPP_IOIPSL 12 12 use IOIPSL … … 16 16 #endif 17 17 IMPLICIT NONE 18 c-----------------------------------------------------------------------19 cAuteurs : A. Lahellec .20 c 21 cDeclarations :22 c--------------18 !----------------------------------------------------------------------- 19 ! Auteurs : A. Lahellec . 20 ! 21 ! Declarations : 22 ! -------------- 23 23 24 24 #include "compar1d.h" … … 28 28 #include "fcg_racmo.h" 29 29 #include "iniprint.h" 30 c 31 c 32 clocal:33 c------34 35 cCHARACTER ch1*72,ch2*72,ch3*72,ch4*1230 ! 31 ! 32 ! local: 33 ! ------ 34 35 ! CHARACTER ch1*72,ch2*72,ch3*72,ch4*12 36 36 37 c 38 c-------------------------------------------------------------------39 c 40 c......... Initilisation parametres du lmdz1D ..........41 c 42 c---------------------------------------------------------------------43 cinitialisations:44 c----------------37 ! 38 ! ------------------------------------------------------------------- 39 ! 40 ! ......... Initilisation parametres du lmdz1D .......... 41 ! 42 !--------------------------------------------------------------------- 43 ! initialisations: 44 ! ---------------- 45 45 46 46 !Config Key = lunout … … 60 60 !Config Help = Niveau d'impression pour le débogage 61 61 !Config (0 = minimum d'impression) 62 cprt_level = 063 cCALL getin('prt_level',prt_level)64 65 c-----------------------------------------------------------------------66 cParametres de controle du run:67 c-----------------------------------------------------------------------62 ! prt_level = 0 63 ! CALL getin('prt_level',prt_level) 64 65 !----------------------------------------------------------------------- 66 ! Parametres de controle du run: 67 !----------------------------------------------------------------------- 68 68 69 69 !Config Key = restart … … 71 71 !Config Def = false 72 72 !Config Help = les fichiers restart doivent etre renomme en start 73 restart = .FALSE.73 restart =.false. 74 74 CALL getin('restart',restart) 75 75 … … 137 137 !Config Def = false 138 138 !Config Help = forcage ou non par les flux de surface 139 ok_flux_surf = .FALSE.139 ok_flux_surf =.false. 140 140 CALL getin('ok_flux_surf',ok_flux_surf) 141 141 … … 319 319 write(lunout,*)' +++++++++++++++++++++++++++++++++++++++' 320 320 write(lunout,*) 321 c 321 ! 322 322 RETURN 323 323 END … … 325 325 ! $Id: dyn1deta0.F 1279 2010/07/30 A Lahellec$ 326 326 ! 327 c 328 SUBROUTINE dyn1deta0(fichnom,plev,play,phi,phis,presnivs, 327 ! 328 SUBROUTINE dyn1deta0(fichnom,plev,play,phi,phis,presnivs, & 329 329 & ucov,vcov,temp,q,omega2) 330 330 USE dimphy … … 339 339 340 340 IMPLICIT NONE 341 c=======================================================342 cEcriture du fichier de redemarrage sous format NetCDF343 c=======================================================344 cDeclarations:345 c-------------341 !======================================================= 342 ! Ecriture du fichier de redemarrage sous format NetCDF 343 !======================================================= 344 ! Declarations: 345 ! ------------- 346 346 #include "dimensions.h" 347 347 #include "comconst.h" … … 351 351 #include "netcdf.inc" 352 352 353 cArguments:354 c----------353 ! Arguments: 354 ! ---------- 355 355 CHARACTER*(*) fichnom 356 cAl1 plev tronque pour .nc mais plev(klev+1):=0356 !Al1 plev tronque pour .nc mais plev(klev+1):=0 357 357 real :: plev(klon,klev),play (klon,klev),phi(klon,klev) 358 358 real :: presnivs(klon,klev) 359 359 real :: ucov(klon,klev),vcov(klon,klev),temp(klon,klev) 360 360 real :: q(klon,klev,nqtot),omega2(klon,klev) 361 creal :: ug(klev),vg(klev),fcoriolis361 ! real :: ug(klev),vg(klev),fcoriolis 362 362 real :: phis(klon) 363 363 364 cVariables locales pour NetCDF:365 c------------------------------364 ! Variables locales pour NetCDF: 365 ! ------------------------------ 366 366 INTEGER iq 367 367 INTEGER length … … 383 383 print*,'after open startphy ',fichnom,nmq 384 384 385 c 386 cLecture des parametres de controle:387 c 385 ! 386 ! Lecture des parametres de controle: 387 ! 388 388 CALL get_var("controle",tab_cntrl) 389 389 … … 394 394 day_ref = tab_cntrl(4) 395 395 annee_ref = tab_cntrl(5) 396 crad = tab_cntrl(6)397 comeg = tab_cntrl(7)398 cg = tab_cntrl(8)399 ccpp = tab_cntrl(9)400 ckappa = tab_cntrl(10)401 cdaysec = tab_cntrl(11)402 cdtvr = tab_cntrl(12)403 cetot0 = tab_cntrl(13)404 cptot0 = tab_cntrl(14)405 cztot0 = tab_cntrl(15)406 cstot0 = tab_cntrl(16)407 cang0 = tab_cntrl(17)408 cpa = tab_cntrl(18)409 cpreff = tab_cntrl(19)410 c 411 cclon = tab_cntrl(20)412 cclat = tab_cntrl(21)413 cgrossismx = tab_cntrl(22)414 cgrossismy = tab_cntrl(23)415 c 396 ! rad = tab_cntrl(6) 397 ! omeg = tab_cntrl(7) 398 ! g = tab_cntrl(8) 399 ! cpp = tab_cntrl(9) 400 ! kappa = tab_cntrl(10) 401 ! daysec = tab_cntrl(11) 402 ! dtvr = tab_cntrl(12) 403 ! etot0 = tab_cntrl(13) 404 ! ptot0 = tab_cntrl(14) 405 ! ztot0 = tab_cntrl(15) 406 ! stot0 = tab_cntrl(16) 407 ! ang0 = tab_cntrl(17) 408 ! pa = tab_cntrl(18) 409 ! preff = tab_cntrl(19) 410 ! 411 ! clon = tab_cntrl(20) 412 ! clat = tab_cntrl(21) 413 ! grossismx = tab_cntrl(22) 414 ! grossismy = tab_cntrl(23) 415 ! 416 416 IF ( tab_cntrl(24).EQ.1. ) THEN 417 fxyhypb = . TRUE.418 cdzoomx = tab_cntrl(25)419 cdzoomy = tab_cntrl(26)420 ctaux = tab_cntrl(28)421 ctauy = tab_cntrl(29)417 fxyhypb =.true. 418 ! dzoomx = tab_cntrl(25) 419 ! dzoomy = tab_cntrl(26) 420 ! taux = tab_cntrl(28) 421 ! tauy = tab_cntrl(29) 422 422 ELSE 423 fxyhypb = . FALSE.424 ysinus = . FALSE.425 IF( tab_cntrl(27).EQ.1. ) ysinus = . TRUE.423 fxyhypb = .false. 424 ysinus = .false. 425 IF( tab_cntrl(27).EQ.1. ) ysinus =.true. 426 426 ENDIF 427 427 428 428 day_ini = tab_cntrl(30) 429 429 itau_dyn = tab_cntrl(31) 430 c.................................................................431 c 432 c 433 cPRINT*,'rad,omeg,g,cpp,kappa',rad,omeg,g,cpp,kappa434 cAl1435 Print*,'day_ref,annee_ref,day_ini,itau_dyn', 430 ! ................................................................. 431 ! 432 ! 433 ! PRINT*,'rad,omeg,g,cpp,kappa',rad,omeg,g,cpp,kappa 434 !Al1 435 Print*,'day_ref,annee_ref,day_ini,itau_dyn', & 436 436 & day_ref,annee_ref,day_ini,itau_dyn 437 437 438 cLecture des champs439 c 438 ! Lecture des champs 439 ! 440 440 plev(1,klev+1)=0. 441 441 CALL get_field("plev",plev,found) … … 460 460 Do iq=1,nqtot 461 461 CALL get_field("q"//nmq(iq),q(:,:,iq),found) 462 IF (.NOT. found) 463 & PRINT*, modname//'Le champ <q'//nmq//'> est absent' 462 IF (.NOT.found)PRINT*, modname//'Le champ <q'//nmq//'> est absent' 464 463 EndDo 465 464 466 465 CALL close_startphy 467 print*,' close startphy' 468 . ,fichnom,play(1,1),play(1,klev),temp(1,klev) 469 c 466 print*,' close startphy',fichnom,play(1,1),play(1,klev),temp(1,klev) 467 ! 470 468 RETURN 471 469 END … … 473 471 ! $Id: dyn1dredem.F 1279 2010/07/29 A Lahellec$ 474 472 ! 475 c 476 SUBROUTINE dyn1dredem(fichnom,plev,play,phi,phis,presnivs, 473 ! 474 SUBROUTINE dyn1dredem(fichnom,plev,play,phi,phis,presnivs, & 477 475 & ucov,vcov,temp,q,omega2) 478 476 USE dimphy … … 485 483 486 484 IMPLICIT NONE 487 c=======================================================488 cEcriture du fichier de redemarrage sous format NetCDF489 c=======================================================490 cDeclarations:491 c-------------485 !======================================================= 486 ! Ecriture du fichier de redemarrage sous format NetCDF 487 !======================================================= 488 ! Declarations: 489 ! ------------- 492 490 #include "dimensions.h" 493 491 #include "comconst.h" … … 497 495 #include "netcdf.inc" 498 496 499 cArguments:500 c----------497 ! Arguments: 498 ! ---------- 501 499 CHARACTER*(*) fichnom 502 cAl1 plev tronque pour .nc mais plev(klev+1):=0500 !Al1 plev tronque pour .nc mais plev(klev+1):=0 503 501 real :: plev(klon,klev),play (klon,klev),phi(klon,klev) 504 502 real :: presnivs(klon,klev) … … 506 504 real :: q(klon,klev,nqtot) 507 505 real :: omega2(klon,klev),rho(klon,klev+1) 508 creal :: ug(klev),vg(klev),fcoriolis506 ! real :: ug(klev),vg(klev),fcoriolis 509 507 real :: phis(klon) 510 508 511 cVariables locales pour NetCDF:512 c------------------------------509 ! Variables locales pour NetCDF: 510 ! ------------------------------ 513 511 INTEGER nid 514 512 INTEGER ierr … … 520 518 character*20 modname 521 519 character*80 abort_message 522 c 520 ! 523 521 INTEGER nb 524 522 SAVE nb … … 554 552 tab_cntrl(11) = daysec 555 553 tab_cntrl(12) = dtvr 556 ctab_cntrl(13) = etot0557 ctab_cntrl(14) = ptot0558 ctab_cntrl(15) = ztot0559 ctab_cntrl(16) = stot0560 ctab_cntrl(17) = ang0561 ctab_cntrl(18) = pa562 ctab_cntrl(19) = preff563 c 564 c..... parametres pour le zoom ......565 566 ctab_cntrl(20) = clon567 ctab_cntrl(21) = clat568 ctab_cntrl(22) = grossismx569 ctab_cntrl(23) = grossismy570 c 554 ! tab_cntrl(13) = etot0 555 ! tab_cntrl(14) = ptot0 556 ! tab_cntrl(15) = ztot0 557 ! tab_cntrl(16) = stot0 558 ! tab_cntrl(17) = ang0 559 ! tab_cntrl(18) = pa 560 ! tab_cntrl(19) = preff 561 ! 562 ! ..... parametres pour le zoom ...... 563 564 ! tab_cntrl(20) = clon 565 ! tab_cntrl(21) = clat 566 ! tab_cntrl(22) = grossismx 567 ! tab_cntrl(23) = grossismy 568 ! 571 569 IF ( fxyhypb ) THEN 572 570 tab_cntrl(24) = 1. 573 ctab_cntrl(25) = dzoomx574 ctab_cntrl(26) = dzoomy571 ! tab_cntrl(25) = dzoomx 572 ! tab_cntrl(26) = dzoomy 575 573 tab_cntrl(27) = 0. 576 ctab_cntrl(28) = taux577 ctab_cntrl(29) = tauy574 ! tab_cntrl(28) = taux 575 ! tab_cntrl(29) = tauy 578 576 ELSE 579 577 tab_cntrl(24) = 0. 580 ctab_cntrl(25) = dzoomx581 ctab_cntrl(26) = dzoomy578 ! tab_cntrl(25) = dzoomx 579 ! tab_cntrl(26) = dzoomy 582 580 tab_cntrl(27) = 0. 583 581 tab_cntrl(28) = 0. … … 585 583 IF( ysinus ) tab_cntrl(27) = 1. 586 584 ENDIF 587 CAl1 iday_end -> day_end585 !Al1 iday_end -> day_end 588 586 tab_cntrl(30) = FLOAT(day_end) 589 587 tab_cntrl(31) = FLOAT(itau_dyn + itaufin) 590 c 588 ! 591 589 CALL put_var("controle","Param. de controle Dyn1D",tab_cntrl) 592 c 593 594 cEcriture/extension de la coordonnee temps590 ! 591 592 ! Ecriture/extension de la coordonnee temps 595 593 596 594 nb = nb + 1 597 595 598 cEcriture des champs599 c 596 ! Ecriture des champs 597 ! 600 598 CALL put_field("plev","p interfaces sauf la nulle",plev) 601 599 CALL put_field("play","",play) … … 609 607 610 608 Do iq=1,nqtot 611 CALL put_field("q"//nmq(iq),"eau vap ou condens et traceurs", 612 .q(:,:,iq))609 CALL put_field("q"//nmq(iq),"eau vap ou condens et traceurs", & 610 & q(:,:,iq)) 613 611 EndDo 614 612 CALL close_restartphy 615 613 616 c 614 ! 617 615 RETURN 618 616 END … … 770 768 ! ------- 771 769 772 IF(ngrid.NE.2+(jm-2)*(im-1).AND.ngrid.NE.1) 773 sSTOP 'probleme de dim'770 IF(ngrid.NE.2+(jm-2)*(im-1).AND.ngrid.NE.1) & 771 & STOP 'probleme de dim' 774 772 ! traitement des poles 775 773 CALL SCOPY(nfield,pdyn,im*jm,pfi,ngrid) … … 829 827 pi=2.*ASIN(1.) 830 828 831 OPEN(99,file='sigma.def',status='old',form='formatted', 832 siostat=ierr)829 OPEN(99,file='sigma.def',status='old',form='formatted', & 830 & iostat=ierr) 833 831 834 832 !----------------------------------------------------------------------- … … 850 848 851 849 DO 1 l = 1, llm 852 dsig(l) = (alpha+(1.-alpha)*exp(-beta*(llm-l)))* 853 $ ( (tanh(gama*l)/tanh(gama*llm))**np +854 $(1.-l/FLOAT(llm))*delta )850 dsig(l) = (alpha+(1.-alpha)*exp(-beta*(llm-l)))* & 851 & ( (tanh(gama*l)/tanh(gama*llm))**np + & 852 & (1.-l/FLOAT(llm))*delta ) 855 853 1 CONTINUE 856 854 … … 1005 1003 1006 1004 1007 SUBROUTINE advect_va(llm,omega,d_t_va,d_q_va,d_u_va,d_v_va, 1008 sq,temp,u,v,play)1005 SUBROUTINE advect_va(llm,omega,d_t_va,d_q_va,d_u_va,d_v_va, & 1006 & q,temp,u,v,play) 1009 1007 !itlmd 1010 1008 !---------------------------------------------------------------------- … … 1031 1029 !si omgup pour la couche 1, alors tendance nulle 1032 1030 omgdown=max(omega(2),0.0) 1033 alpha = rkappa*temp(l)*(1.+q(l,1)*rv/rd)/(play(l)* 1034 & (1.+q(l,1))) 1035 d_t_va(l)= alpha*(omgdown)- 1036 & omgdown*(temp(l)-temp(l+1)) 1037 & /(play(l)-play(l+1)) 1038 1039 d_q_va(l,:)= -omgdown*(q(l,:)-q(l+1,:)) 1040 & /(play(l)-play(l+1)) 1041 1042 d_u_va(l)= -omgdown*(u(l)-u(l+1)) 1043 & /(play(l)-play(l+1)) 1044 d_v_va(l)= -omgdown*(v(l)-v(l+1)) 1045 & /(play(l)-play(l+1)) 1031 alpha = rkappa*temp(l)*(1.+q(l,1)*rv/rd)/(play(l)*(1.+q(l,1))) 1032 d_t_va(l)= alpha*(omgdown)-omgdown*(temp(l)-temp(l+1)) & 1033 & /(play(l)-play(l+1)) 1034 1035 d_q_va(l,:)= -omgdown*(q(l,:)-q(l+1,:))/(play(l)-play(l+1)) 1036 1037 d_u_va(l)= -omgdown*(u(l)-u(l+1))/(play(l)-play(l+1)) 1038 d_v_va(l)= -omgdown*(v(l)-v(l+1))/(play(l)-play(l+1)) 1046 1039 1047 1040 1048 1041 elseif(l.eq.llm) then 1049 1042 omgup=min(omega(l),0.0) 1050 alpha = rkappa*temp(l)*(1.+q(l,1)*rv/rd)/(play(l)* 1051 & (1.+q(l,1)))1052 d_t_va(l)= alpha*(omgup)- 1043 alpha = rkappa*temp(l)*(1.+q(l,1)*rv/rd)/(play(l)*(1.+q(l,1))) 1044 d_t_va(l)= alpha*(omgup)- & 1045 1053 1046 !bug? & omgup*(temp(l-1)-temp(l))/(play(l-1)-plev(l)) 1054 1047 & omgup*(temp(l-1)-temp(l))/(play(l-1)-play(l)) … … 1060 1053 omgup=min(omega(l),0.0) 1061 1054 omgdown=max(omega(l+1),0.0) 1062 alpha = rkappa*temp(l)*(1.+q(l,1)*rv/rd)/(play(l)* 1063 & (1.+q(l,1))) 1064 d_t_va(l)= alpha*(omgup+omgdown)- 1065 & omgdown*(temp(l)-temp(l+1)) 1066 & /(play(l)-play(l+1))- 1055 alpha = rkappa*temp(l)*(1.+q(l,1)*rv/rd)/(play(l)*(1.+q(l,1))) 1056 d_t_va(l)= alpha*(omgup+omgdown)-omgdown*(temp(l)-temp(l+1)) & 1057 & /(play(l)-play(l+1))- & 1067 1058 !bug? & omgup*(temp(l-1)-temp(l))/(play(l-1)-plev(l)) 1068 1059 & omgup*(temp(l-1)-temp(l))/(play(l-1)-play(l)) 1069 1060 ! print*, ' ??? ' 1070 1061 1071 d_q_va(l,:)= -omgdown*(q(l,:)-q(l+1,:)) 1072 & /(play(l)-play(l+1))- 1073 & omgup*(q(l-1,:)-q(l,:))/(play(l-1)-play(l)) 1074 d_u_va(l)= -omgdown*(u(l)-u(l+1)) 1075 & /(play(l)-play(l+1))- 1076 & omgup*(u(l-1)-u(l))/(play(l-1)-play(l)) 1077 d_v_va(l)= -omgdown*(v(l)-v(l+1)) 1078 & /(play(l)-play(l+1))- 1062 d_q_va(l,:)= -omgdown*(q(l,:)-q(l+1,:)) & 1063 & /(play(l)-play(l+1))- & 1064 & omgup*(q(l-1,:)-q(l,:))/(play(l-1)-play(l)) 1065 d_u_va(l)= -omgdown*(u(l)-u(l+1)) & 1066 & /(play(l)-play(l+1))- & 1067 & omgup*(u(l-1)-u(l))/(play(l-1)-play(l)) 1068 d_v_va(l)= -omgdown*(v(l)-v(l+1)) & 1069 & /(play(l)-play(l+1))- & 1079 1070 & omgup*(v(l-1)-v(l))/(play(l-1)-play(l)) 1080 1071 … … 1086 1077 end 1087 1078 ! SUBROUTINE lstendH(llm,omega,d_t_va,d_q_va,d_u_va,d_v_va, 1088 SUBROUTINE lstendH(llm,nqtot,omega,d_t_va,d_q_va, 1089 !q,temp,u,v,play)1079 SUBROUTINE lstendH(llm,nqtot,omega,d_t_va,d_q_va, & 1080 & q,temp,u,v,play) 1090 1081 !itlmd 1091 1082 !---------------------------------------------------------------------- … … 1143 1134 ! d_v_va(k) = -omdn*dvdp(k)-omup*dvdp(k-1) 1144 1135 d_q_va(k,1)= -omdn*dqdp(k)-omup*dqdp(k-1) 1145 d_t_va(k) = -omdn*dtdp(k)-omup*dtdp(k-1) 1146 : +(omup+omdn)*cor(k) 1136 d_t_va(k) = -omdn*dtdp(k)-omup*dtdp(k-1)+(omup+omdn)*cor(k) 1147 1137 enddo 1148 1138 … … 1170 1160 1171 1161 !====================================================================== 1172 SUBROUTINE read_togacoare(fich_toga,nlev_toga,nt_toga 1173 : ,ts_toga,plev_toga,t_toga,q_toga,u_toga,v_toga,w_toga1174 :,ht_toga,vt_toga,hq_toga,vq_toga)1162 SUBROUTINE read_togacoare(fich_toga,nlev_toga,nt_toga & 1163 & ,ts_toga,plev_toga,t_toga,q_toga,u_toga,v_toga,w_toga & 1164 & ,ht_toga,vt_toga,hq_toga,vq_toga) 1175 1165 implicit none 1176 1166 1177 c-------------------------------------------------------------------------1178 cRead TOGA-COARE forcing data1179 c-------------------------------------------------------------------------1167 !------------------------------------------------------------------------- 1168 ! Read TOGA-COARE forcing data 1169 !------------------------------------------------------------------------- 1180 1170 1181 1171 integer nlev_toga,nt_toga … … 1207 1197 1208 1198 do k = 1, nlev_toga 1209 read(21,230) plev_toga(k,ip), t_toga(k,ip), q_toga(k,ip) 1210 : ,u_toga(k,ip), v_toga(k,ip), w_toga(k,ip)1211 :,ht_toga(k,ip), vt_toga(k,ip), hq_toga(k,ip), vq_toga(k,ip)1199 read(21,230) plev_toga(k,ip), t_toga(k,ip), q_toga(k,ip) & 1200 & ,u_toga(k,ip), v_toga(k,ip), w_toga(k,ip) & 1201 & ,ht_toga(k,ip), vt_toga(k,ip), hq_toga(k,ip), vq_toga(k,ip) 1212 1202 1213 1203 ! conversion in SI units: … … 1233 1223 end 1234 1224 1235 c-------------------------------------------------------------------------1225 !------------------------------------------------------------------------- 1236 1226 SUBROUTINE read_sandu(fich_sandu,nlev_sandu,nt_sandu,ts_sandu) 1237 1227 implicit none 1238 1228 1239 c-------------------------------------------------------------------------1240 cRead I.SANDU case forcing data1241 c-------------------------------------------------------------------------1229 !------------------------------------------------------------------------- 1230 ! Read I.SANDU case forcing data 1231 !------------------------------------------------------------------------- 1242 1232 1243 1233 integer nlev_sandu,nt_sandu … … 1269 1259 1270 1260 !===================================================================== 1271 c-------------------------------------------------------------------------1272 SUBROUTINE read_astex(fich_astex,nlev_astex,nt_astex,div_astex, 1273 :ts_astex,ug_astex,vg_astex,ufa_astex,vfa_astex)1261 !------------------------------------------------------------------------- 1262 SUBROUTINE read_astex(fich_astex,nlev_astex,nt_astex,div_astex, & 1263 & ts_astex,ug_astex,vg_astex,ufa_astex,vfa_astex) 1274 1264 implicit none 1275 1265 1276 c-------------------------------------------------------------------------1277 cRead Astex case forcing data1278 c-------------------------------------------------------------------------1266 !------------------------------------------------------------------------- 1267 ! Read Astex case forcing data 1268 !------------------------------------------------------------------------- 1279 1269 1280 1270 integer nlev_astex,nt_astex … … 1297 1287 read(21,'(a)') 1298 1288 read(21,'(a)') 1299 read(21,223) iy, im, id, ih, div_astex(ip),ts_astex(ip), 1300 :ug_astex(ip),vg_astex(ip),ufa_astex(ip),vfa_astex(ip)1289 read(21,223) iy, im, id, ih, div_astex(ip),ts_astex(ip), & 1290 &ug_astex(ip),vg_astex(ip),ufa_astex(ip),vfa_astex(ip) 1301 1291 ts_astex(ip)=ts_astex(ip)+273.15 1302 print *,'ts=',iy,im,id,ih,ip,div_astex(ip),ts_astex(ip), 1303 :ug_astex(ip),vg_astex(ip),ufa_astex(ip),vg_astex(ip)1292 print *,'ts=',iy,im,id,ih,ip,div_astex(ip),ts_astex(ip), & 1293 &ug_astex(ip),vg_astex(ip),ufa_astex(ip),vg_astex(ip) 1304 1294 enddo 1305 1295 close(21) … … 1310 1300 end 1311 1301 !===================================================================== 1312 subroutine read_twpice(fich_twpice,nlevel,ntime 1313 : ,T_srf,plev,T,q,u,v,omega1314 :,T_adv_h,T_adv_v,q_adv_h,q_adv_v)1302 subroutine read_twpice(fich_twpice,nlevel,ntime & 1303 & ,T_srf,plev,T,q,u,v,omega & 1304 & ,T_adv_h,T_adv_v,q_adv_h,q_adv_v) 1315 1305 1316 1306 !program reading forcings of the TWP-ICE experiment … … 1792 1782 !===================================================================== 1793 1783 1794 SUBROUTINE interp_sandu_vertical(play,nlev_sandu,plev_prof 1795 : ,t_prof,thl_prof,q_prof,u_prof,v_prof,w_prof1796 : ,omega_prof,o3mmr_prof1797 : ,t_mod,thl_mod,q_mod,u_mod,v_mod,w_mod1798 :,omega_mod,o3mmr_mod,mxcalc)1784 SUBROUTINE interp_sandu_vertical(play,nlev_sandu,plev_prof & 1785 & ,t_prof,thl_prof,q_prof,u_prof,v_prof,w_prof & 1786 & ,omega_prof,o3mmr_prof & 1787 & ,t_mod,thl_mod,q_mod,u_mod,v_mod,w_mod & 1788 & ,omega_mod,o3mmr_mod,mxcalc) 1799 1789 1800 1790 implicit none … … 1802 1792 #include "dimensions.h" 1803 1793 1804 c-------------------------------------------------------------------------1805 cVertical interpolation of SANDUREF forcing data onto model levels1806 c-------------------------------------------------------------------------1794 !------------------------------------------------------------------------- 1795 ! Vertical interpolation of SANDUREF forcing data onto model levels 1796 !------------------------------------------------------------------------- 1807 1797 1808 1798 integer nlevmax … … 1838 1828 1839 1829 do k = 1, nlev_sandu-1 1840 if (play(l).le.plev_prof(k) 1841 : .and. play(l).gt.plev_prof(k+1)) then 1830 if (play(l).le.plev_prof(k).and. play(l).gt.plev_prof(k+1)) then 1842 1831 k1=k 1843 1832 k2=k+1 … … 1860 1849 v_mod(l)= v_prof(k2) - frac*(v_prof(k2)-v_prof(k1)) 1861 1850 w_mod(l)= w_prof(k2) - frac*(w_prof(k2)-w_prof(k1)) 1862 omega_mod(l)=omega_prof(k2)- 1863 : frac*(omega_prof(k2)-omega_prof(k1)) 1864 o3mmr_mod(l)=o3mmr_prof(k2)- 1865 : frac*(o3mmr_prof(k2)-o3mmr_prof(k1)) 1851 omega_mod(l)=omega_prof(k2)-frac*(omega_prof(k2)-omega_prof(k1)) 1852 o3mmr_mod(l)=o3mmr_prof(k2)-frac*(o3mmr_prof(k2)-o3mmr_prof(k1)) 1866 1853 1867 1854 else !play>plev_prof(1) … … 1884 1871 else ! above max altitude of forcing file 1885 1872 1886 cjyg1873 !jyg 1887 1874 fact=20.*(plev_prof(nlev_sandu)-play(l))/plev_prof(nlev_sandu) !jyg 1888 1875 fact = max(fact,0.) !jyg … … 1909 1896 end 1910 1897 !===================================================================== 1911 SUBROUTINE interp_astex_vertical(play,nlev_astex,plev_prof 1912 : ,t_prof,thl_prof,qv_prof,ql_prof,qt_prof,u_prof,v_prof1913 : ,w_prof,tke_prof,o3mmr_prof1914 : ,t_mod,thl_mod,qv_mod,ql_mod,qt_mod,u_mod,v_mod,w_mod1915 :,tke_mod,o3mmr_mod,mxcalc)1898 SUBROUTINE interp_astex_vertical(play,nlev_astex,plev_prof & 1899 & ,t_prof,thl_prof,qv_prof,ql_prof,qt_prof,u_prof,v_prof & 1900 & ,w_prof,tke_prof,o3mmr_prof & 1901 & ,t_mod,thl_mod,qv_mod,ql_mod,qt_mod,u_mod,v_mod,w_mod & 1902 & ,tke_mod,o3mmr_mod,mxcalc) 1916 1903 1917 1904 implicit none … … 1919 1906 #include "dimensions.h" 1920 1907 1921 c-------------------------------------------------------------------------1922 cVertical interpolation of Astex forcing data onto model levels1923 c-------------------------------------------------------------------------1908 !------------------------------------------------------------------------- 1909 ! Vertical interpolation of Astex forcing data onto model levels 1910 !------------------------------------------------------------------------- 1924 1911 1925 1912 integer nlevmax … … 1956 1943 1957 1944 do k = 1, nlev_astex-1 1958 if (play(l).le.plev_prof(k) 1959 : .and. play(l).gt.plev_prof(k+1)) then 1945 if (play(l).le.plev_prof(k).and. play(l).gt.plev_prof(k+1)) then 1960 1946 k1=k 1961 1947 k2=k+1 … … 1981 1967 w_mod(l)= w_prof(k2) - frac*(w_prof(k2)-w_prof(k1)) 1982 1968 tke_mod(l)= tke_prof(k2) - frac*(tke_prof(k2)-tke_prof(k1)) 1983 o3mmr_mod(l)=o3mmr_prof(k2)- 1984 : frac*(o3mmr_prof(k2)-o3mmr_prof(k1)) 1969 o3mmr_mod(l)=o3mmr_prof(k2)-frac*(o3mmr_prof(k2)-o3mmr_prof(k1)) 1985 1970 1986 1971 else !play>plev_prof(1) … … 2005 1990 else ! above max altitude of forcing file 2006 1991 2007 cjyg1992 !jyg 2008 1993 fact=20.*(plev_prof(nlev_astex)-play(l))/plev_prof(nlev_astex) !jyg 2009 1994 fact = max(fact,0.) !jyg … … 2033 2018 2034 2019 !====================================================================== 2035 SUBROUTINE read_rico(fich_rico,nlev_rico,ps_rico,play 2036 : ,ts_rico,t_rico,q_rico,u_rico,v_rico,w_rico2037 :,dth_dyn,dqh_dyn)2020 SUBROUTINE read_rico(fich_rico,nlev_rico,ps_rico,play & 2021 & ,ts_rico,t_rico,q_rico,u_rico,v_rico,w_rico & 2022 & ,dth_dyn,dqh_dyn) 2038 2023 implicit none 2039 2024 2040 c-------------------------------------------------------------------------2041 cRead RICO forcing data2042 c-------------------------------------------------------------------------2025 !------------------------------------------------------------------------- 2026 ! Read RICO forcing data 2027 !------------------------------------------------------------------------- 2043 2028 #include "dimensions.h" 2044 2029 … … 2081 2066 if(prico(l)>play(k)) then 2082 2067 if(play(k)>prico(l+1)) then 2083 zlay(k)=zrico(l)+(play(k)-prico(l)) * 2068 zlay(k)=zrico(l)+(play(k)-prico(l)) * & 2084 2069 & (zrico(l+1)-zrico(l))/(prico(l+1)-prico(l)) 2085 else 2086 zlay(k)=zrico(l)+(play(k)-prico(80))* 2070 else 2071 zlay(k)=zrico(l)+(play(k)-prico(80))* & 2087 2072 & (zrico(81)-zrico(80))/(prico(81)-prico(80)) 2088 2073 endif … … 2094 2079 u_rico(k)=-9.9 + (-1.9 + 9.9)*zlay(k)/4000 2095 2080 elseif(4000 < zlay(k) .and. zlay(k) < 12000) then 2096 u_rico(k)= -1.9 + (30.0 + 1.9) / 2097 :(12000 - 4000) * (zlay(k) - 4000)2081 u_rico(k)= -1.9 + (30.0 + 1.9) / & 2082 & (12000 - 4000) * (zlay(k) - 4000) 2098 2083 elseif(12000 < zlay(k) .and. zlay(k) < 13000) then 2099 2084 u_rico(k)=30.0 2100 2085 elseif(13000 < zlay(k) .and. zlay(k) < 20000) then 2101 u_rico(k)=30.0 - (30.0) / 2102 :(20000 - 13000) * (zlay(k) - 13000)2086 u_rico(k)=30.0 - (30.0) / & 2087 & (20000 - 13000) * (zlay(k) - 13000) 2103 2088 else 2104 2089 u_rico(k)=0.0 … … 2109 2094 q_rico(k)=16.0 + (13.8 - 16.0) / (740) * zlay(k) 2110 2095 elseif(740 < zlay(k) .and. zlay(k) < 3260) then 2111 q_rico(k)=13.8 + (2.4 - 13.8) / 2112 :(3260 - 740) * (zlay(k) - 740)2096 q_rico(k)=13.8 + (2.4 - 13.8) / & 2097 & (3260 - 740) * (zlay(k) - 740) 2113 2098 elseif(3260 < zlay(k) .and. zlay(k) < 4000) then 2114 q_rico(k)=2.4 + (1.8 - 2.4) / 2115 :(4000 - 3260) * (zlay(k) - 3260)2099 q_rico(k)=2.4 + (1.8 - 2.4) / & 2100 & (4000 - 3260) * (zlay(k) - 3260) 2116 2101 elseif(4000 < zlay(k) .and. zlay(k) < 9000) then 2117 q_rico(k)=1.8 + (0 - 1.8) / 2118 :(10000 - 4000) * (zlay(k) - 4000)2102 q_rico(k)=1.8 + (0 - 1.8) / & 2103 & (10000 - 4000) * (zlay(k) - 4000) 2119 2104 else 2120 2105 q_rico(k)=0.0 … … 2125 2110 t_rico(k)=299.2 + (292.0 - 299.2) / (740) * zlay(k) 2126 2111 elseif(740 < zlay(k) .and. zlay(k) < 4000) then 2127 t_rico(k)=292.0 + (278.0 - 292.0) / 2128 :(4000 - 740) * (zlay(k) - 740)2112 t_rico(k)=292.0 + (278.0 - 292.0) / & 2113 & (4000 - 740) * (zlay(k) - 740) 2129 2114 elseif(4000 < zlay(k) .and. zlay(k) < 15000) then 2130 t_rico(k)=278.0 + (203.0 - 278.0) / 2131 :(15000 - 4000) * (zlay(k) - 4000)2115 t_rico(k)=278.0 + (203.0 - 278.0) / & 2116 & (15000 - 4000) * (zlay(k) - 4000) 2132 2117 elseif(15000 < zlay(k) .and. zlay(k) < 17500) then 2133 t_rico(k)=203.0 + (194.0 - 203.0) / 2134 :(17500 - 15000)* (zlay(k) - 15000)2118 t_rico(k)=203.0 + (194.0 - 203.0) / & 2119 & (17500 - 15000)* (zlay(k) - 15000) 2135 2120 elseif(17500 < zlay(k) .and. zlay(k) < 20000) then 2136 t_rico(k)=194.0 + (206.0 - 194.0) / 2137 :(20000 - 17500)* (zlay(k) - 17500)2121 t_rico(k)=194.0 + (206.0 - 194.0) / & 2122 & (20000 - 17500)* (zlay(k) - 17500) 2138 2123 elseif(20000 < zlay(k) .and. zlay(k) < 60000) then 2139 t_rico(k)=206.0 + (270.0 - 206.0) / 2140 :(60000 - 20000)* (zlay(k) - 20000)2124 t_rico(k)=206.0 + (270.0 - 206.0) / & 2125 & (60000 - 20000)* (zlay(k) - 20000) 2141 2126 endif 2142 2127 … … 2154 2139 ! dThrz+dTsw0+dTlw0 2155 2140 if(0 < zlay(k) .and. zlay(k) < 4000) then 2156 dth_dyn(k)=- 2.51 / 86400 + (-2.18 + 2.51 )/ 2157 :(86400*4000) * zlay(k)2141 dth_dyn(k)=- 2.51 / 86400 + (-2.18 + 2.51 )/ & 2142 & (86400*4000) * zlay(k) 2158 2143 elseif(4000 < zlay(k) .and. zlay(k) < 5000) then 2159 dth_dyn(k)=- 2.18 / 86400 + ( 2.18 ) / 2160 :(86400*(5000 - 4000)) * (zlay(k) - 4000)2144 dth_dyn(k)=- 2.18 / 86400 + ( 2.18 ) / & 2145 & (86400*(5000 - 4000)) * (zlay(k) - 4000) 2161 2146 else 2162 2147 dth_dyn(k)=0.0 … … 2164 2149 ! dQhrz 2165 2150 if(0 < zlay(k) .and. zlay(k) < 3000) then 2166 dqh_dyn(k)=-1.0 / 86400 + (0.345 + 1.0)/ 2167 :(86400*3000) * (zlay(k))2151 dqh_dyn(k)=-1.0 / 86400 + (0.345 + 1.0)/ & 2152 & (86400*3000) * (zlay(k)) 2168 2153 elseif(3000 < zlay(k) .and. zlay(k) < 4000) then 2169 2154 dqh_dyn(k)=0.345 / 86400 2170 2155 elseif(4000 < zlay(k) .and. zlay(k) < 5000) then 2171 dqh_dyn(k)=0.345 / 86400 + 2172 +(-0.345)/(86400 * (5000 - 4000)) * (zlay(k)-4000)2156 dqh_dyn(k)=0.345 / 86400 + & 2157 & (-0.345)/(86400 * (5000 - 4000)) * (zlay(k)-4000) 2173 2158 else 2174 2159 dqh_dyn(k)=0.0 … … 2196 2181 2197 2182 !====================================================================== 2198 SUBROUTINE interp_sandu_time(day,day1,annee_ref 2199 i ,year_ini_sandu,day_ini_sandu,nt_sandu,dt_sandu2200 i,nlev_sandu,ts_sandu,ts_prof)2183 SUBROUTINE interp_sandu_time(day,day1,annee_ref & 2184 & ,year_ini_sandu,day_ini_sandu,nt_sandu,dt_sandu & 2185 & ,nlev_sandu,ts_sandu,ts_prof) 2201 2186 implicit none 2202 2187 … … 2247 2232 time_sandu2=(it_sandu2-1)*dt_sandu 2248 2233 print *,'timeit day day_ini_sandu',timeit,day,day_ini_sandu 2249 print *,'it_sandu1,it_sandu2,time_sandu1,time_sandu2', 2250 .it_sandu1,it_sandu2,time_sandu1,time_sandu22234 print *,'it_sandu1,it_sandu2,time_sandu1,time_sandu2', & 2235 & it_sandu1,it_sandu2,time_sandu1,time_sandu2 2251 2236 2252 2237 if (it_sandu1 .ge. nt_sandu) then 2253 write(*,*) 'PB-stop: day, it_sandu1, it_sandu2, timeit: ' 2254 :,day,it_sandu1,it_sandu2,timeit/86400.2238 write(*,*) 'PB-stop: day, it_sandu1, it_sandu2, timeit: ' & 2239 & ,day,it_sandu1,it_sandu2,timeit/86400. 2255 2240 stop 2256 2241 endif … … 2260 2245 frac=max(frac,0.0) 2261 2246 2262 ts_prof = ts_sandu(it_sandu2) 2263 :-frac*(ts_sandu(it_sandu2)-ts_sandu(it_sandu1))2264 2265 print*, 2266 :'day,annee_ref,day_ini_sandu,timeit,it_sandu1,it_sandu2,SST:',2267 :day,annee_ref,day_ini_sandu,timeit/86400.,it_sandu1,2268 :it_sandu2,ts_prof2247 ts_prof = ts_sandu(it_sandu2) & 2248 & -frac*(ts_sandu(it_sandu2)-ts_sandu(it_sandu1)) 2249 2250 print*, & 2251 &'day,annee_ref,day_ini_sandu,timeit,it_sandu1,it_sandu2,SST:', & 2252 &day,annee_ref,day_ini_sandu,timeit/86400.,it_sandu1, & 2253 &it_sandu2,ts_prof 2269 2254 2270 2255 return 2271 2256 END 2272 2257 !===================================================================== 2273 c-------------------------------------------------------------------------2274 SUBROUTINE read_armcu(fich_armcu,nlev_armcu,nt_armcu, 2275 :sens,flat,adv_theta,rad_theta,adv_qt)2258 !------------------------------------------------------------------------- 2259 SUBROUTINE read_armcu(fich_armcu,nlev_armcu,nt_armcu, & 2260 & sens,flat,adv_theta,rad_theta,adv_qt) 2276 2261 implicit none 2277 2262 2278 c-------------------------------------------------------------------------2279 cRead ARM_CU case forcing data2280 c-------------------------------------------------------------------------2263 !------------------------------------------------------------------------- 2264 ! Read ARM_CU case forcing data 2265 !------------------------------------------------------------------------- 2281 2266 2282 2267 integer nlev_armcu,nt_armcu … … 2296 2281 read(21,'(a)') 2297 2282 read(21,'(a)') 2298 read(21,223) iy, im, id, ih, in, sens(ip),flat(ip), 2299 :adv_theta(ip),rad_theta(ip),adv_qt(ip)2300 print *,'forcages=',iy,im,id,ih,in, sens(ip),flat(ip), 2301 :adv_theta(ip),rad_theta(ip),adv_qt(ip)2283 read(21,223) iy, im, id, ih, in, sens(ip),flat(ip), & 2284 & adv_theta(ip),rad_theta(ip),adv_qt(ip) 2285 print *,'forcages=',iy,im,id,ih,in, sens(ip),flat(ip), & 2286 & adv_theta(ip),rad_theta(ip),adv_qt(ip) 2302 2287 enddo 2303 2288 close(21) … … 2309 2294 2310 2295 !===================================================================== 2311 SUBROUTINE interp_toga_vertical(play,nlev_toga,plev_prof 2312 : ,t_prof,q_prof,u_prof,v_prof,w_prof2313 : ,ht_prof,vt_prof,hq_prof,vq_prof2314 : ,t_mod,q_mod,u_mod,v_mod,w_mod2315 :,ht_mod,vt_mod,hq_mod,vq_mod,mxcalc)2296 SUBROUTINE interp_toga_vertical(play,nlev_toga,plev_prof & 2297 & ,t_prof,q_prof,u_prof,v_prof,w_prof & 2298 & ,ht_prof,vt_prof,hq_prof,vq_prof & 2299 & ,t_mod,q_mod,u_mod,v_mod,w_mod & 2300 & ,ht_mod,vt_mod,hq_mod,vq_mod,mxcalc) 2316 2301 2317 2302 implicit none … … 2319 2304 #include "dimensions.h" 2320 2305 2321 c-------------------------------------------------------------------------2322 cVertical interpolation of TOGA-COARE forcing data onto model levels2323 c-------------------------------------------------------------------------2306 !------------------------------------------------------------------------- 2307 ! Vertical interpolation of TOGA-COARE forcing data onto model levels 2308 !------------------------------------------------------------------------- 2324 2309 2325 2310 integer nlevmax … … 2357 2342 2358 2343 do k = 1, nlev_toga-1 2359 if (play(l).le.plev_prof(k) 2360 : .and. play(l).gt.plev_prof(k+1)) then 2344 if (play(l).le.plev_prof(k).and. play(l).gt.plev_prof(k+1)) then 2361 2345 k1=k 2362 2346 k2=k+1 … … 2403 2387 else ! above max altitude of forcing file 2404 2388 2405 cjyg2389 !jyg 2406 2390 fact=20.*(plev_prof(nlev_toga)-play(l))/plev_prof(nlev_toga) !jyg 2407 2391 fact = max(fact,0.) !jyg … … 2430 2414 2431 2415 !====================================================================== 2432 SUBROUTINE interp_astex_time(day,day1,annee_ref 2433 i ,year_ini_astex,day_ini_astex,nt_astex,dt_astex2434 i ,nlev_astex,div_astex,ts_astex,ug_astex,vg_astex2435 i ,ufa_astex,vfa_astex,div_prof,ts_prof,ug_prof,vg_prof2436 i,ufa_prof,vfa_prof)2416 SUBROUTINE interp_astex_time(day,day1,annee_ref & 2417 & ,year_ini_astex,day_ini_astex,nt_astex,dt_astex & 2418 & ,nlev_astex,div_astex,ts_astex,ug_astex,vg_astex & 2419 & ,ufa_astex,vfa_astex,div_prof,ts_prof,ug_prof,vg_prof & 2420 & ,ufa_prof,vfa_prof) 2437 2421 implicit none 2438 2422 … … 2486 2470 time_astex2=(it_astex2-1)*dt_astex 2487 2471 print *,'timeit day day_ini_astex',timeit,day,day_ini_astex 2488 print *,'it_astex1,it_astex2,time_astex1,time_astex2', 2489 .it_astex1,it_astex2,time_astex1,time_astex22472 print *,'it_astex1,it_astex2,time_astex1,time_astex2', & 2473 & it_astex1,it_astex2,time_astex1,time_astex2 2490 2474 2491 2475 if (it_astex1 .ge. nt_astex) then 2492 write(*,*) 'PB-stop: day, it_astex1, it_astex2, timeit: ' 2493 :,day,it_astex1,it_astex2,timeit/86400.2476 write(*,*) 'PB-stop: day, it_astex1, it_astex2, timeit: ' & 2477 & ,day,it_astex1,it_astex2,timeit/86400. 2494 2478 stop 2495 2479 endif … … 2499 2483 frac=max(frac,0.0) 2500 2484 2501 div_prof = div_astex(it_astex2) 2502 :-frac*(div_astex(it_astex2)-div_astex(it_astex1))2503 ts_prof = ts_astex(it_astex2) 2504 :-frac*(ts_astex(it_astex2)-ts_astex(it_astex1))2505 ug_prof = ug_astex(it_astex2) 2506 :-frac*(ug_astex(it_astex2)-ug_astex(it_astex1))2507 vg_prof = vg_astex(it_astex2) 2508 :-frac*(vg_astex(it_astex2)-vg_astex(it_astex1))2509 ufa_prof = ufa_astex(it_astex2) 2510 :-frac*(ufa_astex(it_astex2)-ufa_astex(it_astex1))2511 vfa_prof = vfa_astex(it_astex2) 2512 :-frac*(vfa_astex(it_astex2)-vfa_astex(it_astex1))2513 2514 print*, 2515 :'day,annee_ref,day_ini_astex,timeit,it_astex1,it_astex2,SST:',2516 :day,annee_ref,day_ini_astex,timeit/86400.,it_astex1,2517 :it_astex2,div_prof,ts_prof,ug_prof,vg_prof,ufa_prof,vfa_prof2485 div_prof = div_astex(it_astex2) & 2486 & -frac*(div_astex(it_astex2)-div_astex(it_astex1)) 2487 ts_prof = ts_astex(it_astex2) & 2488 & -frac*(ts_astex(it_astex2)-ts_astex(it_astex1)) 2489 ug_prof = ug_astex(it_astex2) & 2490 & -frac*(ug_astex(it_astex2)-ug_astex(it_astex1)) 2491 vg_prof = vg_astex(it_astex2) & 2492 & -frac*(vg_astex(it_astex2)-vg_astex(it_astex1)) 2493 ufa_prof = ufa_astex(it_astex2) & 2494 & -frac*(ufa_astex(it_astex2)-ufa_astex(it_astex1)) 2495 vfa_prof = vfa_astex(it_astex2) & 2496 & -frac*(vfa_astex(it_astex2)-vfa_astex(it_astex1)) 2497 2498 print*, & 2499 &'day,annee_ref,day_ini_astex,timeit,it_astex1,it_astex2,SST:', & 2500 &day,annee_ref,day_ini_astex,timeit/86400.,it_astex1, & 2501 &it_astex2,div_prof,ts_prof,ug_prof,vg_prof,ufa_prof,vfa_prof 2518 2502 2519 2503 return … … 2521 2505 2522 2506 !====================================================================== 2523 SUBROUTINE interp_toga_time(day,day1,annee_ref 2524 i ,year_ini_toga,day_ini_toga,nt_toga,dt_toga,nlev_toga2525 i ,ts_toga,plev_toga,t_toga,q_toga,u_toga,v_toga,w_toga2526 i ,ht_toga,vt_toga,hq_toga,vq_toga2527 o ,ts_prof,plev_prof,t_prof,q_prof,u_prof,v_prof,w_prof2528 o,ht_prof,vt_prof,hq_prof,vq_prof)2507 SUBROUTINE interp_toga_time(day,day1,annee_ref & 2508 & ,year_ini_toga,day_ini_toga,nt_toga,dt_toga,nlev_toga & 2509 & ,ts_toga,plev_toga,t_toga,q_toga,u_toga,v_toga,w_toga & 2510 & ,ht_toga,vt_toga,hq_toga,vq_toga & 2511 & ,ts_prof,plev_prof,t_prof,q_prof,u_prof,v_prof,w_prof & 2512 & ,ht_prof,vt_prof,hq_prof,vq_prof) 2529 2513 implicit none 2530 2514 … … 2618 2602 2619 2603 if (it_toga1 .ge. nt_toga) then 2620 write(*,*) 'PB-stop: day, it_toga1, it_toga2, timeit: ' 2621 :,day,it_toga1,it_toga2,timeit/86400.2604 write(*,*) 'PB-stop: day, it_toga1, it_toga2, timeit: ' & 2605 & ,day,it_toga1,it_toga2,timeit/86400. 2622 2606 stop 2623 2607 endif … … 2627 2611 frac=max(frac,0.0) 2628 2612 2629 ts_prof = ts_toga(it_toga2) 2630 :-frac*(ts_toga(it_toga2)-ts_toga(it_toga1))2613 ts_prof = ts_toga(it_toga2) & 2614 & -frac*(ts_toga(it_toga2)-ts_toga(it_toga1)) 2631 2615 2632 2616 ! print*, … … 2635 2619 2636 2620 do k=1,nlev_toga 2637 plev_prof(k) = 100.*(plev_toga(k,it_toga2) 2638 :-frac*(plev_toga(k,it_toga2)-plev_toga(k,it_toga1)))2639 t_prof(k) = t_toga(k,it_toga2) 2640 :-frac*(t_toga(k,it_toga2)-t_toga(k,it_toga1))2641 q_prof(k) = q_toga(k,it_toga2) 2642 :-frac*(q_toga(k,it_toga2)-q_toga(k,it_toga1))2643 u_prof(k) = u_toga(k,it_toga2) 2644 :-frac*(u_toga(k,it_toga2)-u_toga(k,it_toga1))2645 v_prof(k) = v_toga(k,it_toga2) 2646 :-frac*(v_toga(k,it_toga2)-v_toga(k,it_toga1))2647 w_prof(k) = w_toga(k,it_toga2) 2648 :-frac*(w_toga(k,it_toga2)-w_toga(k,it_toga1))2649 ht_prof(k) = ht_toga(k,it_toga2) 2650 :-frac*(ht_toga(k,it_toga2)-ht_toga(k,it_toga1))2651 vt_prof(k) = vt_toga(k,it_toga2) 2652 :-frac*(vt_toga(k,it_toga2)-vt_toga(k,it_toga1))2653 hq_prof(k) = hq_toga(k,it_toga2) 2654 :-frac*(hq_toga(k,it_toga2)-hq_toga(k,it_toga1))2655 vq_prof(k) = vq_toga(k,it_toga2) 2656 :-frac*(vq_toga(k,it_toga2)-vq_toga(k,it_toga1))2621 plev_prof(k) = 100.*(plev_toga(k,it_toga2) & 2622 & -frac*(plev_toga(k,it_toga2)-plev_toga(k,it_toga1))) 2623 t_prof(k) = t_toga(k,it_toga2) & 2624 & -frac*(t_toga(k,it_toga2)-t_toga(k,it_toga1)) 2625 q_prof(k) = q_toga(k,it_toga2) & 2626 & -frac*(q_toga(k,it_toga2)-q_toga(k,it_toga1)) 2627 u_prof(k) = u_toga(k,it_toga2) & 2628 & -frac*(u_toga(k,it_toga2)-u_toga(k,it_toga1)) 2629 v_prof(k) = v_toga(k,it_toga2) & 2630 & -frac*(v_toga(k,it_toga2)-v_toga(k,it_toga1)) 2631 w_prof(k) = w_toga(k,it_toga2) & 2632 & -frac*(w_toga(k,it_toga2)-w_toga(k,it_toga1)) 2633 ht_prof(k) = ht_toga(k,it_toga2) & 2634 & -frac*(ht_toga(k,it_toga2)-ht_toga(k,it_toga1)) 2635 vt_prof(k) = vt_toga(k,it_toga2) & 2636 & -frac*(vt_toga(k,it_toga2)-vt_toga(k,it_toga1)) 2637 hq_prof(k) = hq_toga(k,it_toga2) & 2638 & -frac*(hq_toga(k,it_toga2)-hq_toga(k,it_toga1)) 2639 vq_prof(k) = vq_toga(k,it_toga2) & 2640 & -frac*(vq_toga(k,it_toga2)-vq_toga(k,it_toga1)) 2657 2641 enddo 2658 2642 … … 2661 2645 2662 2646 !====================================================================== 2663 SUBROUTINE interp_armcu_time(day,day1,annee_ref 2664 i ,year_ini_armcu,day_ini_armcu,nt_armcu,dt_armcu2665 i ,nlev_armcu,fs_armcu,fl_armcu,at_armcu,rt_armcu2666 i,aqt_armcu,fs_prof,fl_prof,at_prof,rt_prof,aqt_prof)2647 SUBROUTINE interp_armcu_time(day,day1,annee_ref & 2648 & ,year_ini_armcu,day_ini_armcu,nt_armcu,dt_armcu & 2649 & ,nlev_armcu,fs_armcu,fl_armcu,at_armcu,rt_armcu & 2650 & ,aqt_armcu,fs_prof,fl_prof,at_prof,rt_prof,aqt_prof) 2667 2651 implicit none 2668 2652 … … 2707 2691 time_armcu2=(it_armcu2-1)*dt_armcu 2708 2692 print *,'timeit day day_ini_armcu',timeit,day,day_ini_armcu 2709 print *,'it_armcu1,it_armcu2,time_armcu1,time_armcu2', 2710 .it_armcu1,it_armcu2,time_armcu1,time_armcu22693 print *,'it_armcu1,it_armcu2,time_armcu1,time_armcu2', & 2694 & it_armcu1,it_armcu2,time_armcu1,time_armcu2 2711 2695 2712 2696 if (it_armcu1 .ge. nt_armcu) then 2713 write(*,*) 'PB-stop: day, it_armcu1, it_armcu2, timeit: ' 2714 :,day,it_armcu1,it_armcu2,timeit/86400.2697 write(*,*) 'PB-stop: day, it_armcu1, it_armcu2, timeit: ' & 2698 & ,day,it_armcu1,it_armcu2,timeit/86400. 2715 2699 stop 2716 2700 endif … … 2720 2704 frac=max(frac,0.0) 2721 2705 2722 fs_prof = fs_armcu(it_armcu2) 2723 :-frac*(fs_armcu(it_armcu2)-fs_armcu(it_armcu1))2724 fl_prof = fl_armcu(it_armcu2) 2725 :-frac*(fl_armcu(it_armcu2)-fl_armcu(it_armcu1))2726 at_prof = at_armcu(it_armcu2) 2727 :-frac*(at_armcu(it_armcu2)-at_armcu(it_armcu1))2728 rt_prof = rt_armcu(it_armcu2) 2729 :-frac*(rt_armcu(it_armcu2)-rt_armcu(it_armcu1))2730 aqt_prof = aqt_armcu(it_armcu2) 2731 :-frac*(aqt_armcu(it_armcu2)-aqt_armcu(it_armcu1))2732 2733 print*, 2734 :'day,annee_ref,day_ini_armcu,timeit,it_armcu1,it_armcu2,SST:',2735 :day,annee_ref,day_ini_armcu,timeit/86400.,it_armcu1,2736 :it_armcu2,fs_prof,fl_prof,at_prof,rt_prof,aqt_prof2706 fs_prof = fs_armcu(it_armcu2) & 2707 & -frac*(fs_armcu(it_armcu2)-fs_armcu(it_armcu1)) 2708 fl_prof = fl_armcu(it_armcu2) & 2709 & -frac*(fl_armcu(it_armcu2)-fl_armcu(it_armcu1)) 2710 at_prof = at_armcu(it_armcu2) & 2711 & -frac*(at_armcu(it_armcu2)-at_armcu(it_armcu1)) 2712 rt_prof = rt_armcu(it_armcu2) & 2713 & -frac*(rt_armcu(it_armcu2)-rt_armcu(it_armcu1)) 2714 aqt_prof = aqt_armcu(it_armcu2) & 2715 & -frac*(aqt_armcu(it_armcu2)-aqt_armcu(it_armcu1)) 2716 2717 print*, & 2718 &'day,annee_ref,day_ini_armcu,timeit,it_armcu1,it_armcu2,SST:', & 2719 &day,annee_ref,day_ini_armcu,timeit/86400.,it_armcu1, & 2720 &it_armcu2,fs_prof,fl_prof,at_prof,rt_prof,aqt_prof 2737 2721 2738 2722 return … … 2740 2724 2741 2725 !===================================================================== 2742 subroutine readprofiles(nlev_max,kmax,ntrac,height, 2743 . thlprof,qtprof,uprof,2744 . vprof,e12prof,ugprof,vgprof,2745 . wfls,dqtdxls,dqtdyls,dqtdtls,2746 .thlpcar,tracer,nt1,nt2)2726 subroutine readprofiles(nlev_max,kmax,ntrac,height, & 2727 & thlprof,qtprof,uprof, & 2728 & vprof,e12prof,ugprof,vgprof, & 2729 & wfls,dqtdxls,dqtdyls,dqtdtls, & 2730 & thlpcar,tracer,nt1,nt2) 2747 2731 implicit none 2748 2732 … … 2750 2734 logical :: llesread = .true. 2751 2735 2752 real height(nlev_max),thlprof(nlev_max),qtprof(nlev_max), 2753 . uprof(nlev_max),vprof(nlev_max),e12prof(nlev_max),2754 . ugprof(nlev_max),vgprof(nlev_max),wfls(nlev_max),2755 . dqtdxls(nlev_max),dqtdyls(nlev_max),dqtdtls(nlev_max),2756 .thlpcar(nlev_max),tracer(nlev_max,ntrac)2736 real height(nlev_max),thlprof(nlev_max),qtprof(nlev_max), & 2737 & uprof(nlev_max),vprof(nlev_max),e12prof(nlev_max), & 2738 & ugprof(nlev_max),vgprof(nlev_max),wfls(nlev_max), & 2739 & dqtdxls(nlev_max),dqtdyls(nlev_max),dqtdtls(nlev_max), & 2740 & thlpcar(nlev_max),tracer(nlev_max,ntrac) 2757 2741 2758 2742 integer, parameter :: ilesfile=1 … … 2765 2749 read (ilesfile,*) kmax 2766 2750 do k=1,kmax 2767 read (ilesfile,*) height(k),thlprof(k),qtprof (k), 2768 .uprof (k),vprof (k),e12prof(k)2751 read (ilesfile,*) height(k),thlprof(k),qtprof (k), & 2752 & uprof (k),vprof (k),e12prof(k) 2769 2753 enddo 2770 2754 close(ilesfile) … … 2779 2763 endif 2780 2764 do k=1,kmax 2781 read (ilesfile,*) height(k),ugprof(k),vgprof(k),wfls(k), 2782 .dqtdxls(k),dqtdyls(k),dqtdtls(k),thlpcar(k)2765 read (ilesfile,*) height(k),ugprof(k),vgprof(k),wfls(k), & 2766 & dqtdxls(k),dqtdyls(k),dqtdtls(k),thlpcar(k) 2783 2767 end do 2784 2768 close(ilesfile) … … 2806 2790 end 2807 2791 !====================================================================== 2808 subroutine readprofile_sandu(nlev_max,kmax,height,pprof,tprof, 2809 .thlprof,qprof,uprof,vprof,wprof,omega,o3mmr)2792 subroutine readprofile_sandu(nlev_max,kmax,height,pprof,tprof, & 2793 & thlprof,qprof,uprof,vprof,wprof,omega,o3mmr) 2810 2794 !====================================================================== 2811 2795 implicit none … … 2814 2798 logical :: llesread = .true. 2815 2799 2816 real height(nlev_max),pprof(nlev_max),tprof(nlev_max) ,2817 . thlprof(nlev_max),2818 . qprof(nlev_max),uprof(nlev_max),vprof(nlev_max),2819 .wprof(nlev_max),omega(nlev_max),o3mmr(nlev_max)2800 real height(nlev_max),pprof(nlev_max),tprof(nlev_max) 2801 real thlprof(nlev_max) 2802 real qprof(nlev_max),uprof(nlev_max),vprof(nlev_max) 2803 real wprof(nlev_max),omega(nlev_max),o3mmr(nlev_max) 2820 2804 2821 2805 integer, parameter :: ilesfile=1 … … 2828 2812 read (ilesfile,*) kmax 2829 2813 do k=1,kmax 2830 read (ilesfile,*) height(k),pprof(k), tprof(k),thlprof(k), 2831 . qprof (k),uprof(k), vprof(k), wprof(k),2832 .omega (k),o3mmr(k)2814 read (ilesfile,*) height(k),pprof(k), tprof(k),thlprof(k), & 2815 & qprof (k),uprof(k), vprof(k), wprof(k), & 2816 & omega (k),o3mmr(k) 2833 2817 enddo 2834 2818 close(ilesfile) … … 2838 2822 2839 2823 !====================================================================== 2840 subroutine readprofile_astex(nlev_max,kmax,height,pprof,tprof, 2841 .thlprof,qvprof,qlprof,qtprof,uprof,vprof,wprof,tkeprof,o3mmr)2824 subroutine readprofile_astex(nlev_max,kmax,height,pprof,tprof, & 2825 & thlprof,qvprof,qlprof,qtprof,uprof,vprof,wprof,tkeprof,o3mmr) 2842 2826 !====================================================================== 2843 2827 implicit none … … 2846 2830 logical :: llesread = .true. 2847 2831 2848 real height(nlev_max),pprof(nlev_max),tprof(nlev_max), 2849 . thlprof(nlev_max),qlprof(nlev_max),qtprof(nlev_max),2850 . qvprof(nlev_max),uprof(nlev_max),vprof(nlev_max),2851 .wprof(nlev_max),tkeprof(nlev_max),o3mmr(nlev_max)2832 real height(nlev_max),pprof(nlev_max),tprof(nlev_max), & 2833 & thlprof(nlev_max),qlprof(nlev_max),qtprof(nlev_max), & 2834 & qvprof(nlev_max),uprof(nlev_max),vprof(nlev_max), & 2835 & wprof(nlev_max),tkeprof(nlev_max),o3mmr(nlev_max) 2852 2836 2853 2837 integer, parameter :: ilesfile=1 … … 2860 2844 read (ilesfile,*) kmax 2861 2845 do k=1,kmax 2862 read (ilesfile,*) height(k),pprof(k), tprof(k),thlprof(k), 2863 . qvprof (k),qlprof (k),qtprof (k),2864 .uprof(k), vprof(k), wprof(k),tkeprof(k),o3mmr(k)2846 read (ilesfile,*) height(k),pprof(k), tprof(k),thlprof(k), & 2847 & qvprof (k),qlprof (k),qtprof (k), & 2848 & uprof(k), vprof(k), wprof(k),tkeprof(k),o3mmr(k) 2865 2849 enddo 2866 2850 close(ilesfile) … … 2872 2856 2873 2857 !====================================================================== 2874 subroutine readprofile_armcu(nlev_max,kmax,height,pprof,uprof, 2875 .vprof,thetaprof,tprof,qvprof,rvprof,aprof,bprof)2858 subroutine readprofile_armcu(nlev_max,kmax,height,pprof,uprof, & 2859 & vprof,thetaprof,tprof,qvprof,rvprof,aprof,bprof) 2876 2860 !====================================================================== 2877 2861 implicit none … … 2880 2864 logical :: llesread = .true. 2881 2865 2882 real height(nlev_max),pprof(nlev_max),tprof(nlev_max) ,2883 . thetaprof(nlev_max),rvprof(nlev_max),2884 . qvprof(nlev_max),uprof(nlev_max),vprof(nlev_max),2885 .aprof(nlev_max+1),bprof(nlev_max+1)2866 real height(nlev_max),pprof(nlev_max),tprof(nlev_max) 2867 real thetaprof(nlev_max),rvprof(nlev_max) 2868 real qvprof(nlev_max),uprof(nlev_max),vprof(nlev_max) 2869 real aprof(nlev_max+1),bprof(nlev_max+1) 2886 2870 2887 2871 integer, parameter :: ilesfile=1 … … 2902 2886 read (ilesfile,*) kmax 2903 2887 do k=1,kmax 2904 read (ilesfile,*) height(k) ,pprof(k), uprof(k), vprof(k), 2905 .thetaprof(k) ,tprof(k), qvprof(k),rvprof(k)2888 read (ilesfile,*) height(k) ,pprof(k), uprof(k), vprof(k), & 2889 & thetaprof(k) ,tprof(k), qvprof(k),rvprof(k) 2906 2890 enddo 2907 2891 close(ilesfile) … … 2926 2910 end 2927 2911 !===================================================================== 2928 subroutine read_amma(fich_amma,nlevel,ntime 2929 : ,zz,pp,temp,qv,u,v,dw2930 :,dt,dq,sens,flat)2912 subroutine read_amma(fich_amma,nlevel,ntime & 2913 & ,zz,pp,temp,qv,u,v,dw & 2914 & ,dt,dq,sens,flat) 2931 2915 2932 2916 !program reading forcings of the AMMA case study … … 3156 3140 end subroutine read_amma 3157 3141 !====================================================================== 3158 SUBROUTINE interp_amma_time(day,day1,annee_ref 3159 i ,year_ini_amma,day_ini_amma,nt_amma,dt_amma,nlev_amma3160 i ,vitw_amma,ht_amma,hq_amma,lat_amma,sens_amma3161 o,vitw_prof,ht_prof,hq_prof,lat_prof,sens_prof)3142 SUBROUTINE interp_amma_time(day,day1,annee_ref & 3143 & ,year_ini_amma,day_ini_amma,nt_amma,dt_amma,nlev_amma & 3144 & ,vitw_amma,ht_amma,hq_amma,lat_amma,sens_amma & 3145 & ,vitw_prof,ht_prof,hq_prof,lat_prof,sens_prof) 3162 3146 implicit none 3163 3147 … … 3237 3221 3238 3222 if (it_amma1 .gt. nt_amma) then 3239 write(*,*) 'PB-stop: day, it_amma1, it_amma2, timeit: ' 3240 :,day,day_ini_amma,it_amma1,it_amma2,timeit/86400.3223 write(*,*) 'PB-stop: day, it_amma1, it_amma2, timeit: ' & 3224 & ,day,day_ini_amma,it_amma1,it_amma2,timeit/86400. 3241 3225 stop 3242 3226 endif … … 3246 3230 frac=max(frac,0.0) 3247 3231 3248 lat_prof = lat_amma(it_amma2) 3249 : -frac*(lat_amma(it_amma2)-lat_amma(it_amma1))3250 sens_prof = sens_amma(it_amma2) 3251 :-frac*(sens_amma(it_amma2)-sens_amma(it_amma1))3232 lat_prof = lat_amma(it_amma2) & 3233 & -frac*(lat_amma(it_amma2)-lat_amma(it_amma1)) 3234 sens_prof = sens_amma(it_amma2) & 3235 & -frac*(sens_amma(it_amma2)-sens_amma(it_amma1)) 3252 3236 3253 3237 do k=1,nlev_amma 3254 vitw_prof(k) = vitw_amma(k,it_amma2) 3255 :-frac*(vitw_amma(k,it_amma2)-vitw_amma(k,it_amma1))3256 ht_prof(k) = ht_amma(k,it_amma2) 3257 :-frac*(ht_amma(k,it_amma2)-ht_amma(k,it_amma1))3258 hq_prof(k) = hq_amma(k,it_amma2) 3259 :-frac*(hq_amma(k,it_amma2)-hq_amma(k,it_amma1))3238 vitw_prof(k) = vitw_amma(k,it_amma2) & 3239 & -frac*(vitw_amma(k,it_amma2)-vitw_amma(k,it_amma1)) 3240 ht_prof(k) = ht_amma(k,it_amma2) & 3241 & -frac*(ht_amma(k,it_amma2)-ht_amma(k,it_amma1)) 3242 hq_prof(k) = hq_amma(k,it_amma2) & 3243 & -frac*(hq_amma(k,it_amma2)-hq_amma(k,it_amma1)) 3260 3244 enddo 3261 3245 … … 3264 3248 3265 3249 !===================================================================== 3266 subroutine read_fire(fich_fire,nlevel,ntime 3267 : ,zz,thl,qt,u,v,tke3268 :,ug,vg,wls,dqtdx,dqtdy,dqtdt,thl_rad)3250 subroutine read_fire(fich_fire,nlevel,ntime & 3251 & ,zz,thl,qt,u,v,tke & 3252 & ,ug,vg,wls,dqtdx,dqtdy,dqtdt,thl_rad) 3269 3253 3270 3254 !program reading forcings of the FIRE case study -
LMDZ5/trunk/libf/phylmd/1D_decl_cases.h
r2017 r2019 157 157 logical :: Turb_fcg_gcssold 158 158 159 common /turb_forcing/ 160 sdtime_frcg,hthturb_gcssold, hqturb_gcssold,Turb_fcg_gcssold159 common /turb_forcing/ & 160 & dtime_frcg,hthturb_gcssold, hqturb_gcssold,Turb_fcg_gcssold 161 161 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 162 162 ! Declarations specifiques au cas Arm_cu -
LMDZ5/trunk/libf/phylmd/1D_interp_cases.h
r2017 r2019 4 4 if (forcing_GCSSold) then 5 5 6 call get_uvd(it,timestep,fich_gcssold_ctl,fich_gcssold_dat, 7 : ht_gcssold,hq_gcssold,hw_gcssold,8 : hu_gcssold,hv_gcssold,9 : hthturb_gcssold,hqturb_gcssold,Ts_gcssold,10 : imp_fcg_gcssold,ts_fcg_gcssold,11 :Tp_fcg_gcssold,Turb_fcg_gcssold)6 call get_uvd(it,timestep,fich_gcssold_ctl,fich_gcssold_dat, & 7 & ht_gcssold,hq_gcssold,hw_gcssold, & 8 & hu_gcssold,hv_gcssold, & 9 & hthturb_gcssold,hqturb_gcssold,Ts_gcssold, & 10 & imp_fcg_gcssold,ts_fcg_gcssold, & 11 & Tp_fcg_gcssold,Turb_fcg_gcssold) 12 12 if (prt_level.ge.1) then 13 13 print *,' get_uvd -> hqturb_gcssold ',it,hqturb_gcssold … … 38 38 39 39 if (prt_level.ge.1) then 40 print*, 41 : '#### ITAP,day,day1,(day-day1)*86400,(day-day1)*86400/dt_toga=',42 :day,day1,(day-day1)*86400.,(day-day1)*86400/dt_toga40 print*, & 41 & '#### ITAP,day,day1,(day-day1)*86400,(day-day1)*86400/dt_toga=', & 42 & day,day1,(day-day1)*86400.,(day-day1)*86400/dt_toga 43 43 endif 44 44 45 45 ! time interpolation: 46 CALL interp_toga_time(daytime,day1,annee_ref 47 i ,year_ini_toga,day_ju_ini_toga,nt_toga,dt_toga48 i ,nlev_toga,ts_toga,plev_toga,t_toga,q_toga,u_toga49 i ,v_toga,w_toga,ht_toga,vt_toga,hq_toga,vq_toga50 o ,ts_prof,plev_prof,t_prof,q_prof,u_prof,v_prof,w_prof51 o,ht_prof,vt_prof,hq_prof,vq_prof)46 CALL interp_toga_time(daytime,day1,annee_ref & 47 & ,year_ini_toga,day_ju_ini_toga,nt_toga,dt_toga & 48 & ,nlev_toga,ts_toga,plev_toga,t_toga,q_toga,u_toga & 49 & ,v_toga,w_toga,ht_toga,vt_toga,hq_toga,vq_toga & 50 & ,ts_prof,plev_prof,t_prof,q_prof,u_prof,v_prof,w_prof & 51 & ,ht_prof,vt_prof,hq_prof,vq_prof) 52 52 53 53 if (type_ts_forcing.eq.1) ts_cur = ts_prof ! SST used in read_tsurf1d 54 54 55 55 ! vertical interpolation: 56 CALL interp_toga_vertical(play,nlev_toga,plev_prof 57 : ,t_prof,q_prof,u_prof,v_prof,w_prof58 : ,ht_prof,vt_prof,hq_prof,vq_prof59 : ,t_mod,q_mod,u_mod,v_mod,w_mod60 :,ht_mod,vt_mod,hq_mod,vq_mod,mxcalc)56 CALL interp_toga_vertical(play,nlev_toga,plev_prof & 57 & ,t_prof,q_prof,u_prof,v_prof,w_prof & 58 & ,ht_prof,vt_prof,hq_prof,vq_prof & 59 & ,t_mod,q_mod,u_mod,v_mod,w_mod & 60 & ,ht_mod,vt_mod,hq_mod,vq_mod,mxcalc) 61 61 62 62 ! large-scale forcing : … … 84 84 if (forcing_twpice) then 85 85 86 print*, 87 : '#### ITAP,day,day1,(day-day1)*86400,(day-day1)*86400/dt_twpi=',88 : daytime,day1,(daytime-day1)*86400.,89 :(daytime-day1)*86400/dt_twpi86 print*, & 87 & '#### ITAP,day,day1,(day-day1)*86400,(day-day1)*86400/dt_twpi=', & 88 & daytime,day1,(daytime-day1)*86400., & 89 & (daytime-day1)*86400/dt_twpi 90 90 91 91 ! time interpolation: 92 CALL interp_toga_time(daytime,day1,annee_ref 93 i ,year_ini_twpi,day_ju_ini_twpi,nt_twpi,dt_twpi,nlev_twpi94 i ,ts_twpi,plev_twpi,t_twpi,q_twpi,u_twpi,v_twpi,w_twpi95 i ,ht_twpi,vt_twpi,hq_twpi,vq_twpi96 o ,ts_proftwp,plev_proftwp,t_proftwp,q_proftwp,u_proftwp97 o ,v_proftwp,w_proftwp98 o,ht_proftwp,vt_proftwp,hq_proftwp,vq_proftwp)92 CALL interp_toga_time(daytime,day1,annee_ref & 93 & ,year_ini_twpi,day_ju_ini_twpi,nt_twpi,dt_twpi,nlev_twpi & 94 & ,ts_twpi,plev_twpi,t_twpi,q_twpi,u_twpi,v_twpi,w_twpi & 95 & ,ht_twpi,vt_twpi,hq_twpi,vq_twpi & 96 & ,ts_proftwp,plev_proftwp,t_proftwp,q_proftwp,u_proftwp & 97 & ,v_proftwp,w_proftwp & 98 & ,ht_proftwp,vt_proftwp,hq_proftwp,vq_proftwp) 99 99 100 100 ! vertical interpolation: 101 CALL interp_toga_vertical(play,nlev_twpi,plev_proftwp 102 : ,t_proftwp,q_proftwp,u_proftwp,v_proftwp,w_proftwp103 : ,ht_proftwp,vt_proftwp,hq_proftwp,vq_proftwp104 : ,t_mod,q_mod,u_mod,v_mod,w_mod105 :,ht_mod,vt_mod,hq_mod,vq_mod,mxcalc)101 CALL interp_toga_vertical(play,nlev_twpi,plev_proftwp & 102 & ,t_proftwp,q_proftwp,u_proftwp,v_proftwp,w_proftwp & 103 & ,ht_proftwp,vt_proftwp,hq_proftwp,vq_proftwp & 104 & ,t_mod,q_mod,u_mod,v_mod,w_mod & 105 & ,ht_mod,vt_mod,hq_mod,vq_mod,mxcalc) 106 106 107 107 108 108 !calcul de l'advection verticale a partir du omega 109 cCalcul des gradients verticaux110 cinitialisation109 !Calcul des gradients verticaux 110 !initialisation 111 111 d_t_z(:)=0. 112 112 d_q_z(:)=0. … … 114 114 d_q_dyn_z(:)=0. 115 115 DO l=2,llm-1 116 d_t_z(l)=(temp(l+1)-temp(l-1)) 117 & /(play(l+1)-play(l-1)) 118 d_q_z(l)=(q(l+1,1)-q(l-1,1)) 119 & /(play(l+1)-play(l-1)) 116 d_t_z(l)=(temp(l+1)-temp(l-1))/(play(l+1)-play(l-1)) 117 d_q_z(l)=(q(l+1,1)-q(l-1,1))/(play(l+1)-play(l-1)) 120 118 ENDDO 121 119 d_t_z(1)=d_t_z(2) … … 124 122 d_q_z(llm)=d_q_z(llm-1) 125 123 126 cCalcul de l advection verticale124 !Calcul de l advection verticale 127 125 d_t_dyn_z(:)=w_mod(:)*d_t_z(:) 128 126 d_q_dyn_z(:)=w_mod(:)*d_q_z(:) … … 133 131 ! if (phi(l).gt.5000.) then 134 132 if (phi(l).gt.0.) then 135 u(l)=u(l) 136 . +timestep*(u_mod(l)-u(l))/(2.*3600.) 137 v(l)=v(l) 138 . +timestep*(v_mod(l)-v(l))/(2.*3600.) 133 u(l)=u(l)+timestep*(u_mod(l)-u(l))/(2.*3600.) 134 v(l)=v(l)+timestep*(v_mod(l)-v(l))/(2.*3600.) 139 135 endif 140 136 else … … 150 146 if ((zz(l).le.16000.).and.(zz(l).gt.15000.)) then 151 147 zfact=(zz(l)-15000.)/1000. 152 q(l,1)=q(l,1) 153 . +timestep*(q_mod(l)-q(l,1))/(6.*3600.)*zfact 154 temp(l)=temp(l) 155 . +timestep*(t_mod(l)-temp(l))/(6.*3600.)*zfact 148 q(l,1)=q(l,1)+timestep*(q_mod(l)-q(l,1))/(6.*3600.)*zfact 149 temp(l)=temp(l)+timestep*(t_mod(l)-temp(l))/(6.*3600.)*zfact 156 150 else if (zz(l).gt.16000.) then 157 q(l,1)=q(l,1) 158 . +timestep*(q_mod(l)-q(l,1))/(6.*3600.) 159 temp(l)=temp(l) 160 . +timestep*(t_mod(l)-temp(l))/(6.*3600.) 151 q(l,1)=q(l,1)+timestep*(q_mod(l)-q(l,1))/(6.*3600.) 152 temp(l)=temp(l)+timestep*(t_mod(l)-temp(l))/(6.*3600.) 161 153 endif 162 154 enddo … … 189 181 if (forcing_amma) then 190 182 191 print*, 192 : '#### ITAP,day,day1,(day-day1)*86400,(day-day1)*86400/dt_amma=',193 : daytime,day1,(daytime-day1)*86400.,194 :(daytime-day1)*86400/dt_amma183 print*, & 184 & '#### ITAP,day,day1,(day-day1)*86400,(day-day1)*86400/dt_amma=', & 185 & daytime,day1,(daytime-day1)*86400., & 186 & (daytime-day1)*86400/dt_amma 195 187 196 188 ! time interpolation using TOGA interpolation routine 197 CALL interp_amma_time(daytime,day1,annee_ref 198 i ,year_ini_amma,day_ju_ini_amma,nt_amma,dt_amma,nlev_amma199 i ,vitw_amma,ht_amma,hq_amma,lat_amma,sens_amma200 o ,vitw_profamma,ht_profamma,hq_profamma,lat_profamma201 :,sens_profamma)189 CALL interp_amma_time(daytime,day1,annee_ref & 190 & ,year_ini_amma,day_ju_ini_amma,nt_amma,dt_amma,nlev_amma & 191 & ,vitw_amma,ht_amma,hq_amma,lat_amma,sens_amma & 192 & ,vitw_profamma,ht_profamma,hq_profamma,lat_profamma & 193 & ,sens_profamma) 202 194 203 195 print*,'apres interpolation temporelle AMMA' … … 213 205 ! vertical interpolation using TOGA interpolation routine: 214 206 ! write(*,*)'avant interp vert', t_proftwp 215 CALL interp_toga_vertical(play,nlev_amma,plev_amma 216 : ,th_profamma,q_profamma,u_profamma,v_profamma217 : ,vitw_profamma218 : ,ht_profamma,vt_profamma,hq_profamma,vq_profamma219 : ,t_mod,q_mod,u_mod,v_mod,w_mod220 :,ht_mod,vt_mod,hq_mod,vq_mod,mxcalc)207 CALL interp_toga_vertical(play,nlev_amma,plev_amma & 208 & ,th_profamma,q_profamma,u_profamma,v_profamma & 209 & ,vitw_profamma & 210 & ,ht_profamma,vt_profamma,hq_profamma,vq_profamma & 211 & ,t_mod,q_mod,u_mod,v_mod,w_mod & 212 & ,ht_mod,vt_mod,hq_mod,vq_mod,mxcalc) 221 213 write(*,*) 'Profil initial forcing AMMA interpole' 222 214 223 215 224 216 !calcul de l'advection verticale a partir du omega 225 cCalcul des gradients verticaux226 cinitialisation217 !Calcul des gradients verticaux 218 !initialisation 227 219 do l=1,llm 228 220 d_t_z(l)=0. … … 231 223 232 224 DO l=2,llm-1 233 d_t_z(l)=(temp(l+1)-temp(l-1)) 234 & /(play(l+1)-play(l-1)) 235 d_q_z(l)=(q(l+1,1)-q(l-1,1)) 236 & /(play(l+1)-play(l-1)) 225 d_t_z(l)=(temp(l+1)-temp(l-1))/(play(l+1)-play(l-1)) 226 d_q_z(l)=(q(l+1,1)-q(l-1,1))/(play(l+1)-play(l-1)) 237 227 ENDDO 238 228 d_t_z(1)=d_t_z(2) … … 250 240 ! d_th_adv(l) = alpha*omega(l)/rcpd+ht_mod(l)-omega(l)*d_t_z(l) 251 241 !attention: on impose dth 252 d_th_adv(l) = alpha*omega(l)/rcpd+ 242 d_th_adv(l) = alpha*omega(l)/rcpd+ & 253 243 & ht_mod(l)*(play(l)/pzero)**rkappa-omega(l)*d_t_z(l) 254 244 ! d_th_adv(l) = 0. … … 275 265 ! call lstendH(llm,omega,dt_dyn,dq_dyn,du_dyn, dv_dyn, 276 266 ! : q,temp,u,v,play) 277 call lstendH(llm,nqtot,omega,dt_dyn,dq_dyn, 278 : q,temp,u,v,play) 267 call lstendH(llm,nqtot,omega,dt_dyn,dq_dyn,q,temp,u,v,play) 279 268 280 269 do l=1,llm … … 290 279 if (forcing_armcu) then 291 280 292 print*, 293 : '#### ITAP,day,day1,(day-day1)*86400,(day-day1)*86400/dt_armcu=',294 :day,day1,(day-day1)*86400.,(day-day1)*86400/dt_armcu281 print*, & 282 & '#### ITAP,day,day1,(day-day1)*86400,(day-day1)*86400/dt_armcu=', & 283 & day,day1,(day-day1)*86400.,(day-day1)*86400/dt_armcu 295 284 296 285 ! time interpolation: 297 286 ! ATTENTION, cet appel ne convient pas pour TOGA !! 298 287 ! revoir 1DUTILS.h et les arguments 299 CALL interp_armcu_time(daytime,day1,annee_ref 300 i ,year_ini_armcu,day_ju_ini_armcu,nt_armcu,dt_armcu301 i ,nlev_armcu,sens_armcu,flat_armcu,adv_theta_armcu302 i ,rad_theta_armcu,adv_qt_armcu,sens_prof,flat_prof303 i,adv_theta_prof,rad_theta_prof,adv_qt_prof)288 CALL interp_armcu_time(daytime,day1,annee_ref & 289 & ,year_ini_armcu,day_ju_ini_armcu,nt_armcu,dt_armcu & 290 & ,nlev_armcu,sens_armcu,flat_armcu,adv_theta_armcu & 291 & ,rad_theta_armcu,adv_qt_armcu,sens_prof,flat_prof & 292 & ,adv_theta_prof,rad_theta_prof,adv_qt_prof) 304 293 305 294 ! vertical interpolation: … … 346 335 if (forcing_sandu) then 347 336 348 print*, 349 : '#### ITAP,day,day1,(day-day1)*86400,(day-day1)*86400/dt_sandu=',350 : day,day1,(day-day1)*86400.,(day-day1)*86400/dt_sandu337 print*, & 338 & '#### ITAP,day,day1,(day-day1)*86400,(day-day1)*86400/dt_sandu=', & 339 & day,day1,(day-day1)*86400.,(day-day1)*86400/dt_sandu 351 340 352 341 ! time interpolation: 353 342 ! ATTENTION, cet appel ne convient pas pour TOGA !! 354 343 ! revoir 1DUTILS.h et les arguments 355 CALL interp_sandu_time(daytime,day1,annee_ref 356 i ,year_ini_sandu,day_ju_ini_sandu,nt_sandu,dt_sandu357 i ,nlev_sandu358 i,ts_sandu,ts_prof)344 CALL interp_sandu_time(daytime,day1,annee_ref & 345 & ,year_ini_sandu,day_ju_ini_sandu,nt_sandu,dt_sandu & 346 & ,nlev_sandu & 347 & ,ts_sandu,ts_prof) 359 348 360 349 if (type_ts_forcing.eq.1) ts_cur = ts_prof ! SST used in read_tsurf1d 361 350 362 351 ! vertical interpolation: 363 CALL interp_sandu_vertical(play,nlev_sandu,plev_profs 364 : ,t_profs,thl_profs,q_profs,u_profs,v_profs,w_profs 365 : ,omega_profs,o3mmr_profs 366 : ,t_mod,thl_mod,q_mod,u_mod,v_mod,w_mod 367 : ,omega_mod,o3mmr_mod,mxcalc) 368 !calcul de l'advection verticale 369 cCalcul des gradients verticaux 370 cinitialisation 371 d_t_z(:)=0. 372 d_q_z(:)=0. 373 d_t_dyn_z(:)=0. 374 d_q_dyn_z(:)=0. 375 ! schema centre 376 ! DO l=2,llm-1 377 ! d_t_z(l)=(temp(l+1)-temp(l-1)) 378 ! & /(play(l+1)-play(l-1)) 379 ! d_q_z(l)=(q(l+1,1)-q(l-1,1)) 380 ! & /(play(l+1)-play(l-1)) 381 ! schema amont 382 DO l=2,llm-1 383 d_t_z(l)=(temp(l+1)-temp(l))/(play(l+1)-play(l)) 384 d_q_z(l)=(q(l+1,1)-q(l,1))/(play(l+1)-play(l)) 385 ! print *,'l temp2 temp0 play2 play0 omega_mod', 386 ! & temp(l+1),temp(l-1),play(l+1),play(l-1),omega_mod(l) 387 ENDDO 388 d_t_z(1)=d_t_z(2) 389 d_q_z(1)=d_q_z(2) 390 d_t_z(llm)=d_t_z(llm-1) 391 d_q_z(llm)=d_q_z(llm-1) 392 393 ! calcul de l advection verticale 394 ! Confusion w (m/s) et omega (Pa/s) !! 395 d_t_dyn_z(:)=omega_mod(:)*d_t_z(:) 396 d_q_dyn_z(:)=omega_mod(:)*d_q_z(:) 397 ! do l=1,llm 398 ! print *,'d_t_dyn omega_mod d_t_z d_q_dyn d_q_z', 399 ! :l,d_t_dyn_z(l),omega_mod(l),d_t_z(l),d_q_dyn_z(l),d_q_z(l) 400 ! enddo 401 402 403 ! large-scale forcing : pour le cas Sandu ces forcages sont la SST 404 ! et une divergence constante -> profil de omega 405 tsurf = ts_prof 406 write(*,*) 'SST suivante: ',tsurf 407 do l = 1, llm 408 omega(l) = omega_mod(l) 409 omega2(l)= omega(l)/rg*airefi ! flxmass_w calcule comme ds physiq 410 411 alpha = rd*temp(l)*(1.+(rv/rd-1.)*q(l,1))/play(l) 412 ! 413 ! d_th_adv(l) = 0.0 414 ! d_q_adv(l,1) = 0.0 415 !CR:test advection=0 416 !calcul de l'advection verticale 417 d_th_adv(l) = alpha*omega(l)/rcpd-d_t_dyn_z(l) 418 ! print*,'temp adv',l,-d_t_dyn_z(l) 419 d_q_adv(l,1) = -d_q_dyn_z(l) 420 ! print*,'q adv',l,-d_q_dyn_z(l) 421 dt_cooling(l) = 0.0 422 enddo 423 endif ! forcing_sandu 424 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 425 !--------------------------------------------------------------------- 426 ! Interpolation forcing in time and onto model levels 427 !--------------------------------------------------------------------- 428 if (forcing_astex) then 429 430 print*, 431 : '#### ITAP,day,day1,(day-day1)*86400,(day-day1)*86400/dt_astex=', 432 : day,day1,(day-day1)*86400.,(day-day1)*86400/dt_astex 433 434 ! time interpolation: 435 ! ATTENTION, cet appel ne convient pas pour TOGA !! 436 ! revoir 1DUTILS.h et les arguments 437 CALL interp_astex_time(daytime,day1,annee_ref 438 i ,year_ini_astex,day_ju_ini_astex,nt_astex,dt_astex 439 i ,nlev_astex,div_astex,ts_astex,ug_astex,vg_astex 440 i ,ufa_astex,vfa_astex,div_prof,ts_prof,ug_prof,vg_prof 441 i ,ufa_prof,vfa_prof) 442 443 if (type_ts_forcing.eq.1) ts_cur = ts_prof ! SST used in read_tsurf1d 444 445 ! vertical interpolation: 446 CALL interp_astex_vertical(play,nlev_astex,plev_profa 447 : ,t_profa,thl_profa,qv_profa,ql_profa,qt_profa 448 : ,u_profa,v_profa,w_profa,tke_profa,o3mmr_profa 449 : ,t_mod,thl_mod,qv_mod,ql_mod,qt_mod,u_mod,v_mod,w_mod 450 : ,tke_mod,o3mmr_mod,mxcalc) 352 CALL interp_sandu_vertical(play,nlev_sandu,plev_profs & 353 & ,t_profs,thl_profs,q_profs,u_profs,v_profs,w_profs & 354 & ,omega_profs,o3mmr_profs & 355 & ,t_mod,thl_mod,q_mod,u_mod,v_mod,w_mod & 356 & ,omega_mod,o3mmr_mod,mxcalc) 451 357 !calcul de l'advection verticale 452 358 !Calcul des gradients verticaux … … 476 382 ! calcul de l advection verticale 477 383 ! Confusion w (m/s) et omega (Pa/s) !! 478 d_t_dyn_z(:)= w_mod(:)*d_t_z(:)479 d_q_dyn_z(:)= w_mod(:)*d_q_z(:)384 d_t_dyn_z(:)=omega_mod(:)*d_t_z(:) 385 d_q_dyn_z(:)=omega_mod(:)*d_q_z(:) 480 386 ! do l=1,llm 481 387 ! print *,'d_t_dyn omega_mod d_t_z d_q_dyn d_q_z', … … 484 390 485 391 486 ! large-scale forcing : pour le cas Astexces forcages sont la SST487 ! la divergence,ug,vg,ufa,vfa392 ! large-scale forcing : pour le cas Sandu ces forcages sont la SST 393 ! et une divergence constante -> profil de omega 488 394 tsurf = ts_prof 489 395 write(*,*) 'SST suivante: ',tsurf 490 396 do l = 1, llm 491 omega(l) = w_mod(l)397 omega(l) = omega_mod(l) 492 398 omega2(l)= omega(l)/rg*airefi ! flxmass_w calcule comme ds physiq 493 399 … … 504 410 dt_cooling(l) = 0.0 505 411 enddo 412 endif ! forcing_sandu 413 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 414 !--------------------------------------------------------------------- 415 ! Interpolation forcing in time and onto model levels 416 !--------------------------------------------------------------------- 417 if (forcing_astex) then 418 419 print*, & 420 & '#### ITAP,day,day1,(day-day1)*86400,(day-day1)*86400/dt_astex=', & 421 & day,day1,(day-day1)*86400.,(day-day1)*86400/dt_astex 422 423 ! time interpolation: 424 ! ATTENTION, cet appel ne convient pas pour TOGA !! 425 ! revoir 1DUTILS.h et les arguments 426 CALL interp_astex_time(daytime,day1,annee_ref & 427 & ,year_ini_astex,day_ju_ini_astex,nt_astex,dt_astex & 428 & ,nlev_astex,div_astex,ts_astex,ug_astex,vg_astex & 429 & ,ufa_astex,vfa_astex,div_prof,ts_prof,ug_prof,vg_prof & 430 & ,ufa_prof,vfa_prof) 431 432 if (type_ts_forcing.eq.1) ts_cur = ts_prof ! SST used in read_tsurf1d 433 434 ! vertical interpolation: 435 CALL interp_astex_vertical(play,nlev_astex,plev_profa & 436 & ,t_profa,thl_profa,qv_profa,ql_profa,qt_profa & 437 & ,u_profa,v_profa,w_profa,tke_profa,o3mmr_profa & 438 & ,t_mod,thl_mod,qv_mod,ql_mod,qt_mod,u_mod,v_mod,w_mod & 439 & ,tke_mod,o3mmr_mod,mxcalc) 440 !calcul de l'advection verticale 441 !Calcul des gradients verticaux 442 !initialisation 443 d_t_z(:)=0. 444 d_q_z(:)=0. 445 d_t_dyn_z(:)=0. 446 d_q_dyn_z(:)=0. 447 ! schema centre 448 ! DO l=2,llm-1 449 ! d_t_z(l)=(temp(l+1)-temp(l-1)) 450 ! & /(play(l+1)-play(l-1)) 451 ! d_q_z(l)=(q(l+1,1)-q(l-1,1)) 452 ! & /(play(l+1)-play(l-1)) 453 ! schema amont 454 DO l=2,llm-1 455 d_t_z(l)=(temp(l+1)-temp(l))/(play(l+1)-play(l)) 456 d_q_z(l)=(q(l+1,1)-q(l,1))/(play(l+1)-play(l)) 457 ! print *,'l temp2 temp0 play2 play0 omega_mod', 458 ! & temp(l+1),temp(l-1),play(l+1),play(l-1),omega_mod(l) 459 ENDDO 460 d_t_z(1)=d_t_z(2) 461 d_q_z(1)=d_q_z(2) 462 d_t_z(llm)=d_t_z(llm-1) 463 d_q_z(llm)=d_q_z(llm-1) 464 465 ! calcul de l advection verticale 466 ! Confusion w (m/s) et omega (Pa/s) !! 467 d_t_dyn_z(:)=w_mod(:)*d_t_z(:) 468 d_q_dyn_z(:)=w_mod(:)*d_q_z(:) 469 ! do l=1,llm 470 ! print *,'d_t_dyn omega_mod d_t_z d_q_dyn d_q_z', 471 ! :l,d_t_dyn_z(l),omega_mod(l),d_t_z(l),d_q_dyn_z(l),d_q_z(l) 472 ! enddo 473 474 475 ! large-scale forcing : pour le cas Astex ces forcages sont la SST 476 ! la divergence,ug,vg,ufa,vfa 477 tsurf = ts_prof 478 write(*,*) 'SST suivante: ',tsurf 479 do l = 1, llm 480 omega(l) = w_mod(l) 481 omega2(l)= omega(l)/rg*airefi ! flxmass_w calcule comme ds physiq 482 483 alpha = rd*temp(l)*(1.+(rv/rd-1.)*q(l,1))/play(l) 484 ! 485 ! d_th_adv(l) = 0.0 486 ! d_q_adv(l,1) = 0.0 487 !CR:test advection=0 488 !calcul de l'advection verticale 489 d_th_adv(l) = alpha*omega(l)/rcpd-d_t_dyn_z(l) 490 ! print*,'temp adv',l,-d_t_dyn_z(l) 491 d_q_adv(l,1) = -d_q_dyn_z(l) 492 ! print*,'q adv',l,-d_q_dyn_z(l) 493 dt_cooling(l) = 0.0 494 enddo 506 495 endif ! forcing_astex 507 496 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -
LMDZ5/trunk/libf/phylmd/1D_nudge_sandu_astex.h
r2017 r2019 20 20 ! print *,'l dt relax dtadv',l,dt_phys(l),relax_thl(l),d_th_adv(l) 21 21 enddo 22 u(1:mxcalc)=u(1:mxcalc) + timestep*( 23 .du_phys(1:mxcalc) - relax_u(1:mxcalc))24 v(1:mxcalc)=v(1:mxcalc) + timestep*( 25 .dv_phys(1:mxcalc) - relax_v(1:mxcalc))26 cq(1:mxcalc,:)=q(1:mxcalc,:)+timestep*(27 c. dq(1:mxcalc,:) - relax_q(1:mxcalc,:)+28 c. d_q_adv(1:mxcalc,:))29 q(1:mxcalc,1)=q(1:mxcalc,1)+timestep*( 30 .dq(1:mxcalc,1) - relax_q(1:mxcalc,1)+d_q_adv(1:mxcalc,1))31 q(1:mxcalc,2)=q(1:mxcalc,2)+timestep*( 32 .dq(1:mxcalc,2) - relax_q(1:mxcalc,2)+d_q_adv(1:mxcalc,2))33 temp(1:mxcalc)=temp(1:mxcalc)+timestep*( 34 .dt_phys(1:mxcalc)-relax_thl(1:mxcalc)+d_th_adv(1:mxcalc))22 u(1:mxcalc)=u(1:mxcalc) + timestep*( & 23 & du_phys(1:mxcalc) - relax_u(1:mxcalc)) 24 v(1:mxcalc)=v(1:mxcalc) + timestep*( & 25 & dv_phys(1:mxcalc) - relax_v(1:mxcalc)) 26 ! q(1:mxcalc,:)=q(1:mxcalc,:)+timestep*( 27 ! . dq(1:mxcalc,:) - relax_q(1:mxcalc,:)+ 28 ! . d_q_adv(1:mxcalc,:)) 29 q(1:mxcalc,1)=q(1:mxcalc,1)+timestep*( & 30 & dq(1:mxcalc,1) - relax_q(1:mxcalc,1)+d_q_adv(1:mxcalc,1)) 31 q(1:mxcalc,2)=q(1:mxcalc,2)+timestep*( & 32 & dq(1:mxcalc,2) - relax_q(1:mxcalc,2)+d_q_adv(1:mxcalc,2)) 33 temp(1:mxcalc)=temp(1:mxcalc)+timestep*( & 34 & dt_phys(1:mxcalc)-relax_thl(1:mxcalc)+d_th_adv(1:mxcalc)) -
LMDZ5/trunk/libf/phylmd/1D_read_forc_cases.h
r2017 r2019 8 8 nq2=0 9 9 10 if (forcing_les .or. forcing_radconv 11 :.or. forcing_GCSSold .or. forcing_fire) then10 if (forcing_les .or. forcing_radconv & 11 & .or. forcing_GCSSold .or. forcing_fire) then 12 12 13 13 if (forcing_fire) then … … 16 16 !---------------------------------------------------------------------- 17 17 fich_fire='fire.nc' 18 call read_fire(fich_fire,nlev_fire,nt_fire 19 : ,height,tttprof,qtprof,uprof,vprof,e12prof20 : ,ugprof,vgprof,wfls,dqtdxls21 :,dqtdyls,dqtdtls,thlpcar)18 call read_fire(fich_fire,nlev_fire,nt_fire & 19 & ,height,tttprof,qtprof,uprof,vprof,e12prof & 20 & ,ugprof,vgprof,wfls,dqtdxls & 21 & ,dqtdyls,dqtdtls,thlpcar) 22 22 write(*,*) 'Forcing FIRE lu' 23 23 kmax=120 ! nombre de niveaux dans les profils et forcages … … 28 28 !---------------------------------------------------------------------- 29 29 30 call readprofiles(nlev_max,kmax,nqtot,height, 31 . tttprof,qtprof,uprof,vprof,32 . e12prof,ugprof,vgprof,33 . wfls,dqtdxls,dqtdyls,dqtdtls,34 .thlpcar,qprof,nq1,nq2)30 call readprofiles(nlev_max,kmax,nqtot,height, & 31 & tttprof,qtprof,uprof,vprof, & 32 & e12prof,ugprof,vgprof, & 33 & wfls,dqtdxls,dqtdyls,dqtdtls, & 34 & thlpcar,qprof,nq1,nq2) 35 35 endif 36 36 … … 66 66 ug(l) = ugprof(kmax)-frac*( ugprof(kmax)- ugprof(kmax-1)) 67 67 vg(l) = vgprof(kmax)-frac*( vgprof(kmax)- vgprof(kmax-1)) 68 IF (nq2>0) q(l,nq1:nq2)=qprof(kmax,nq1:nq2) 69 s-frac*(qprof(kmax,nq1:nq2)-qprof(kmax-1,nq1:nq2))68 IF (nq2>0) q(l,nq1:nq2)=qprof(kmax,nq1:nq2) & 69 & -frac*(qprof(kmax,nq1:nq2)-qprof(kmax-1,nq1:nq2)) 70 70 omega(l)= wfls(kmax)-frac*( wfls(kmax)- wfls(kmax-1)) 71 71 72 72 dq_dyn(l,1) = dqtdtls(kmax)-frac*(dqtdtls(kmax)-dqtdtls(kmax-1)) 73 dt_cooling(l) 74 . =thlpcar(kmax)-frac*(thlpcar(kmax)-thlpcar(kmax-1)) 73 dt_cooling(l)=thlpcar(kmax)-frac*(thlpcar(kmax)-thlpcar(kmax-1)) 75 74 do k=2,kmax 76 75 frac = (height(k)-zlay(l))/(height(k)-height(k-1)) … … 91 90 ug(l) = ugprof(k)-frac*( ugprof(k)- ugprof(k-1)) 92 91 vg(l) = vgprof(k)-frac*( vgprof(k)- vgprof(k-1)) 93 IF (nq2>0) q(l,nq1:nq2)=qprof(k,nq1:nq2) 94 s-frac*(qprof(k,nq1:nq2)-qprof(k-1,nq1:nq2))92 IF (nq2>0) q(l,nq1:nq2)=qprof(k,nq1:nq2) & 93 & -frac*(qprof(k,nq1:nq2)-qprof(k-1,nq1:nq2)) 95 94 omega(l)= wfls(k)-frac*( wfls(k)- wfls(k-1)) 96 95 dq_dyn(l,1)=dqtdtls(k)-frac*(dqtdtls(k)-dqtdtls(k-1)) 97 dt_cooling(l) 98 . =thlpcar(k)-frac*(thlpcar(k)-thlpcar(k-1)) 96 dt_cooling(l)=thlpcar(k)-frac*(thlpcar(k)-thlpcar(k-1)) 99 97 elseif(zlay(l)<height(1)) then ! profils uniformes pour z<height(1) 100 98 ttt =tttprof(1) … … 144 142 fich_gcssold_dat = './forcing8.dat' 145 143 call copie(llm,play,psurf,fich_gcssold_ctl) 146 call get_uvd2(it,timestep,fich_gcssold_ctl,fich_gcssold_dat, 147 : ht_gcssold,hq_gcssold,hw_gcssold,148 : hu_gcssold,hv_gcssold,149 : hthturb_gcssold,hqturb_gcssold,Ts_gcssold,150 : imp_fcg_gcssold,ts_fcg_gcssold,151 :Tp_fcg_gcssold,Turb_fcg_gcssold)144 call get_uvd2(it,timestep,fich_gcssold_ctl,fich_gcssold_dat, & 145 & ht_gcssold,hq_gcssold,hw_gcssold, & 146 & hu_gcssold,hv_gcssold, & 147 & hthturb_gcssold,hqturb_gcssold,Ts_gcssold, & 148 & imp_fcg_gcssold,ts_fcg_gcssold, & 149 & Tp_fcg_gcssold,Turb_fcg_gcssold) 152 150 print *,' get_uvd2 -> hqturb_gcssold ',hqturb_gcssold 153 151 endif ! forcing_GCSSold … … 160 158 ! call writefield_phy('omega', omega,llm+1) 161 159 fich_rico = 'rico.txt' 162 call read_rico(fich_rico,nlev_rico,ps_rico,play 163 : ,ts_rico,t_rico,q_rico,u_rico,v_rico,w_rico164 :,dth_rico,dqh_rico)160 call read_rico(fich_rico,nlev_rico,ps_rico,play & 161 & ,ts_rico,t_rico,q_rico,u_rico,v_rico,w_rico & 162 & ,dth_rico,dqh_rico) 165 163 print*, ' on a lu et prepare RICO' 166 164 … … 189 187 ! read TOGA-COARE forcing (native vertical grid, nt_toga timesteps): 190 188 fich_toga = './d_toga/ifa_toga_coare_v21_dime.txt' 191 CALL read_togacoare(fich_toga,nlev_toga,nt_toga 192 : ,ts_toga,plev_toga,t_toga,q_toga,u_toga,v_toga,w_toga193 :,ht_toga,vt_toga,hq_toga,vq_toga)189 CALL read_togacoare(fich_toga,nlev_toga,nt_toga & 190 & ,ts_toga,plev_toga,t_toga,q_toga,u_toga,v_toga,w_toga & 191 & ,ht_toga,vt_toga,hq_toga,vq_toga) 194 192 195 193 write(*,*) 'Forcing TOGA lu' … … 197 195 ! time interpolation for initial conditions: 198 196 write(*,*) 'AVT 1ere INTERPOLATION: day,day1 = ',day,day1 199 CALL interp_toga_time(daytime,day1,annee_ref 200 i ,year_ini_toga,day_ju_ini_toga,nt_toga,dt_toga201 i ,nlev_toga,ts_toga,plev_toga,t_toga,q_toga,u_toga202 i ,v_toga,w_toga,ht_toga,vt_toga,hq_toga,vq_toga203 o ,ts_prof,plev_prof,t_prof,q_prof,u_prof,v_prof,w_prof204 o,ht_prof,vt_prof,hq_prof,vq_prof)197 CALL interp_toga_time(daytime,day1,annee_ref & 198 & ,year_ini_toga,day_ju_ini_toga,nt_toga,dt_toga & 199 & ,nlev_toga,ts_toga,plev_toga,t_toga,q_toga,u_toga & 200 & ,v_toga,w_toga,ht_toga,vt_toga,hq_toga,vq_toga & 201 & ,ts_prof,plev_prof,t_prof,q_prof,u_prof,v_prof,w_prof & 202 & ,ht_prof,vt_prof,hq_prof,vq_prof) 205 203 206 204 ! vertical interpolation: 207 CALL interp_toga_vertical(play,nlev_toga,plev_prof 208 : ,t_prof,q_prof,u_prof,v_prof,w_prof209 : ,ht_prof,vt_prof,hq_prof,vq_prof210 : ,t_mod,q_mod,u_mod,v_mod,w_mod211 :,ht_mod,vt_mod,hq_mod,vq_mod,mxcalc)205 CALL interp_toga_vertical(play,nlev_toga,plev_prof & 206 & ,t_prof,q_prof,u_prof,v_prof,w_prof & 207 & ,ht_prof,vt_prof,hq_prof,vq_prof & 208 & ,t_mod,q_mod,u_mod,v_mod,w_mod & 209 & ,ht_mod,vt_mod,hq_mod,vq_mod,mxcalc) 212 210 write(*,*) 'Profil initial forcing TOGA interpole' 213 211 … … 239 237 if (forcing_twpice) then 240 238 !read TWP-ICE forcings 241 fich_twpice= 242 : 'd_twpi/twp180iopsndgvarana_v2.1_C3.c1.20060117.000000.cdf' 243 call read_twpice(fich_twpice,nlev_twpi,nt_twpi 244 : ,ts_twpi,plev_twpi,t_twpi,q_twpi,u_twpi,v_twpi,w_twpi 245 : ,ht_twpi,vt_twpi,hq_twpi,vq_twpi) 239 fich_twpice='d_twpi/twp180iopsndgvarana_v2.1_C3.c1.20060117.000000.cdf' 240 call read_twpice(fich_twpice,nlev_twpi,nt_twpi & 241 & ,ts_twpi,plev_twpi,t_twpi,q_twpi,u_twpi,v_twpi,w_twpi & 242 & ,ht_twpi,vt_twpi,hq_twpi,vq_twpi) 246 243 247 244 write(*,*) 'Forcing TWP-ICE lu' 248 245 !Time interpolation for initial conditions using TOGA interpolation routine 249 246 write(*,*) 'AVT 1ere INTERPOLATION: day,day1 = ',daytime,day1 250 CALL interp_toga_time(daytime,day1,annee_ref 251 i ,year_ini_twpi,day_ju_ini_twpi,nt_twpi,dt_twpi,nlev_twpi252 i ,ts_twpi,plev_twpi,t_twpi,q_twpi,u_twpi,v_twpi,w_twpi253 i ,ht_twpi,vt_twpi,hq_twpi,vq_twpi254 o ,ts_proftwp,plev_proftwp,t_proftwp,q_proftwp255 o ,u_proftwp,v_proftwp,w_proftwp256 o,ht_proftwp,vt_proftwp,hq_proftwp,vq_proftwp)247 CALL interp_toga_time(daytime,day1,annee_ref & 248 & ,year_ini_twpi,day_ju_ini_twpi,nt_twpi,dt_twpi,nlev_twpi & 249 & ,ts_twpi,plev_twpi,t_twpi,q_twpi,u_twpi,v_twpi,w_twpi & 250 & ,ht_twpi,vt_twpi,hq_twpi,vq_twpi & 251 & ,ts_proftwp,plev_proftwp,t_proftwp,q_proftwp & 252 & ,u_proftwp,v_proftwp,w_proftwp & 253 & ,ht_proftwp,vt_proftwp,hq_proftwp,vq_proftwp) 257 254 258 255 ! vertical interpolation using TOGA interpolation routine: 259 256 ! write(*,*)'avant interp vert', t_proftwp 260 CALL interp_toga_vertical(play,nlev_twpi,plev_proftwp 261 : ,t_proftwp,q_proftwp,u_proftwp,v_proftwp,w_proftwp262 : ,ht_proftwp,vt_proftwp,hq_proftwp,vq_proftwp263 : ,t_mod,q_mod,u_mod,v_mod,w_mod264 :,ht_mod,vt_mod,hq_mod,vq_mod,mxcalc)257 CALL interp_toga_vertical(play,nlev_twpi,plev_proftwp & 258 & ,t_proftwp,q_proftwp,u_proftwp,v_proftwp,w_proftwp & 259 & ,ht_proftwp,vt_proftwp,hq_proftwp,vq_proftwp & 260 & ,t_mod,q_mod,u_mod,v_mod,w_mod & 261 & ,ht_mod,vt_mod,hq_mod,vq_mod,mxcalc) 265 262 ! write(*,*) 'Profil initial forcing TWP-ICE interpole',t_mod 266 263 … … 295 292 !read AMMA forcings 296 293 fich_amma='amma.nc' 297 call read_amma(fich_amma,nlev_amma,nt_amma 298 : ,z_amma,plev_amma,th_amma,q_amma,u_amma,v_amma,vitw_amma299 :,ht_amma,hq_amma,sens_amma,lat_amma)294 call read_amma(fich_amma,nlev_amma,nt_amma & 295 & ,z_amma,plev_amma,th_amma,q_amma,u_amma,v_amma,vitw_amma & 296 & ,ht_amma,hq_amma,sens_amma,lat_amma) 300 297 301 298 write(*,*) 'Forcing AMMA lu' … … 318 315 ! vertical interpolation using TOGA interpolation routine: 319 316 ! write(*,*)'avant interp vert', t_proftwp 320 CALL interp_toga_vertical(play,nlev_amma,plev_amma 321 : ,th_ammai,q_ammai,u_ammai,v_ammai,vitw_ammai322 : ,ht_ammai,vt_ammai,hq_ammai,vq_ammai323 : ,t_mod,q_mod,u_mod,v_mod,w_mod324 :,ht_mod,vt_mod,hq_mod,vq_mod,mxcalc)317 CALL interp_toga_vertical(play,nlev_amma,plev_amma & 318 & ,th_ammai,q_ammai,u_ammai,v_ammai,vitw_ammai & 319 & ,ht_ammai,vt_ammai,hq_ammai,vq_ammai & 320 & ,t_mod,q_mod,u_mod,v_mod,w_mod & 321 & ,ht_mod,vt_mod,hq_mod,vq_mod,mxcalc) 325 322 ! write(*,*) 'Profil initial forcing TWP-ICE interpole',t_mod 326 323 … … 351 348 dt_cooling(l)=0. 352 349 enddo 353 write(*,*) 'Profil initial forcing AMMA interpole temp39', 354 & temp(39) 350 write(*,*) 'Prof initeforcing AMMA interpole temp39',temp(39) 355 351 356 352 … … 374 370 write(*,*) 'Avant lecture Forcing Arm_Cu' 375 371 fich_armcu = './ifa_armcu.txt' 376 CALL read_armcu(fich_armcu,nlev_armcu,nt_armcu, 377 : sens_armcu,flat_armcu,adv_theta_armcu,378 :rad_theta_armcu,adv_qt_armcu)372 CALL read_armcu(fich_armcu,nlev_armcu,nt_armcu, & 373 & sens_armcu,flat_armcu,adv_theta_armcu, & 374 & rad_theta_armcu,adv_qt_armcu) 379 375 write(*,*) 'Forcing Arm_Cu lu' 380 376 … … 391 387 !---------------------------------------------------------------------- 392 388 393 call readprofile_armcu(nlev_max,kmax,height,play_mod,u_mod, 394 .v_mod,theta_mod,t_mod,qv_mod,rv_mod,ap,bp)389 call readprofile_armcu(nlev_max,kmax,height,play_mod,u_mod, & 390 & v_mod,theta_mod,t_mod,qv_mod,rv_mod,ap,bp) 395 391 396 392 ! time interpolation for initial conditions: … … 406 402 print *,'dt_armcu=',dt_armcu 407 403 print *,'nlev_armcu=',nlev_armcu 408 CALL interp_armcu_time(daytime,day1,annee_ref 409 i ,year_ini_armcu,day_ju_ini_armcu,nt_armcu,dt_armcu410 i ,nlev_armcu,sens_armcu,flat_armcu,adv_theta_armcu411 i ,rad_theta_armcu,adv_qt_armcu,sens_prof,flat_prof412 i,adv_theta_prof,rad_theta_prof,adv_qt_prof)404 CALL interp_armcu_time(daytime,day1,annee_ref & 405 & ,year_ini_armcu,day_ju_ini_armcu,nt_armcu,dt_armcu & 406 & ,nlev_armcu,sens_armcu,flat_armcu,adv_theta_armcu & 407 & ,rad_theta_armcu,adv_qt_armcu,sens_prof,flat_prof & 408 & ,adv_theta_prof,rad_theta_prof,adv_qt_prof) 413 409 write(*,*) 'Forcages interpoles dans temps' 414 410 … … 456 452 do l = 1, llm 457 453 plev(l+1) = ap(llm-l+1)+bp(llm-l+1)*psurf 458 print *,'Read_forc: l height play plev zlay temp', 459 :l,height(l),play(l),plev(l),zlay(l),temp(l)454 print *,'Read_forc: l height play plev zlay temp', & 455 & l,height(l),play(l),plev(l),zlay(l),temp(l) 460 456 enddo 461 457 ! For this case, fluxes are imposed … … 482 478 !---------------------------------------------------------------------- 483 479 484 call readprofile_sandu(nlev_max,kmax,height,plev_profs,t_profs, 485 . thl_profs,q_profs,u_profs,v_profs,486 .w_profs,omega_profs,o3mmr_profs)480 call readprofile_sandu(nlev_max,kmax,height,plev_profs,t_profs, & 481 & thl_profs,q_profs,u_profs,v_profs, & 482 & w_profs,omega_profs,o3mmr_profs) 487 483 488 484 ! time interpolation for initial conditions: … … 500 496 print *,'dt_sandu=',dt_sandu 501 497 print *,'nlev_sandu=',nlev_sandu 502 CALL interp_sandu_time(daytime,day1,annee_ref 503 i ,year_ini_sandu,day_ju_ini_sandu,nt_sandu,dt_sandu504 i ,nlev_sandu505 i,ts_sandu,ts_prof)498 CALL interp_sandu_time(daytime,day1,annee_ref & 499 & ,year_ini_sandu,day_ju_ini_sandu,nt_sandu,dt_sandu & 500 & ,nlev_sandu & 501 & ,ts_sandu,ts_prof) 506 502 507 503 ! vertical interpolation: 508 504 print *,'Avant interp_vertical: nlev_sandu=',nlev_sandu 509 CALL interp_sandu_vertical(play,nlev_sandu,plev_profs 510 : ,t_profs,thl_profs,q_profs,u_profs,v_profs,w_profs511 : ,omega_profs,o3mmr_profs512 : ,t_mod,thl_mod,q_mod,u_mod,v_mod,w_mod513 :,omega_mod,o3mmr_mod,mxcalc)505 CALL interp_sandu_vertical(play,nlev_sandu,plev_profs & 506 & ,t_profs,thl_profs,q_profs,u_profs,v_profs,w_profs & 507 & ,omega_profs,o3mmr_profs & 508 & ,t_mod,thl_mod,q_mod,u_mod,v_mod,w_mod & 509 & ,omega_mod,o3mmr_mod,mxcalc) 514 510 write(*,*) 'Profil initial forcing SANDU interpole' 515 511 … … 548 544 ! read astex forcing : 549 545 fich_astex = './ifa_astex.txt' 550 CALL read_astex(fich_astex,nlev_astex,nt_astex,div_astex,ts_astex, 551 :ug_astex,vg_astex,ufa_astex,vfa_astex)546 CALL read_astex(fich_astex,nlev_astex,nt_astex,div_astex,ts_astex, & 547 & ug_astex,vg_astex,ufa_astex,vfa_astex) 552 548 553 549 write(*,*) 'Forcing Astex lu' … … 557 553 !---------------------------------------------------------------------- 558 554 559 call readprofile_astex(nlev_max,kmax,height,plev_profa,t_profa, 560 . thl_profa,qv_profa,ql_profa,qt_profa,u_profa,v_profa,561 .w_profa,tke_profa,o3mmr_profa)555 call readprofile_astex(nlev_max,kmax,height,plev_profa,t_profa, & 556 & thl_profa,qv_profa,ql_profa,qt_profa,u_profa,v_profa, & 557 & w_profa,tke_profa,o3mmr_profa) 562 558 563 559 ! time interpolation for initial conditions: … … 575 571 print *,'dt_astex=',dt_astex 576 572 print *,'nlev_astex=',nlev_astex 577 CALL interp_astex_time(daytime,day1,annee_ref 578 i ,year_ini_astex,day_ju_ini_astex,nt_astex,dt_astex579 i ,nlev_astex,div_astex,ts_astex,ug_astex,vg_astex580 i ,ufa_astex,vfa_astex,div_prof,ts_prof,ug_prof,vg_prof581 i,ufa_prof,vfa_prof)573 CALL interp_astex_time(daytime,day1,annee_ref & 574 & ,year_ini_astex,day_ju_ini_astex,nt_astex,dt_astex & 575 & ,nlev_astex,div_astex,ts_astex,ug_astex,vg_astex & 576 & ,ufa_astex,vfa_astex,div_prof,ts_prof,ug_prof,vg_prof & 577 & ,ufa_prof,vfa_prof) 582 578 583 579 ! vertical interpolation: 584 580 print *,'Avant interp_vertical: nlev_astex=',nlev_astex 585 CALL interp_astex_vertical(play,nlev_astex,plev_profa 586 : ,t_profa,thl_profa,qv_profa,ql_profa,qt_profa587 : ,u_profa,v_profa,w_profa,tke_profa,o3mmr_profa588 : ,t_mod,thl_mod,qv_mod,ql_mod,qt_mod,u_mod,v_mod,w_mod589 :,tke_mod,o3mmr_mod,mxcalc)581 CALL interp_astex_vertical(play,nlev_astex,plev_profa & 582 & ,t_profa,thl_profa,qv_profa,ql_profa,qt_profa & 583 & ,u_profa,v_profa,w_profa,tke_profa,o3mmr_profa & 584 & ,t_mod,thl_mod,qv_mod,ql_mod,qt_mod,u_mod,v_mod,w_mod & 585 & ,tke_mod,o3mmr_mod,mxcalc) 590 586 write(*,*) 'Profil initial forcing Astex interpole' 591 587 -
LMDZ5/trunk/libf/phylmd/1Dconv.h
r2017 r2019 1 subroutine get_uvd(itap,dtime,file_forctl,file_fordat, 2 : ht,hq,hw,hu,hv,hthturb,hqturb,3 : Ts,imp_fcg,ts_fcg,Tp_fcg,Turb_fcg)4 c 1 subroutine get_uvd(itap,dtime,file_forctl,file_fordat, & 2 & ht,hq,hw,hu,hv,hthturb,hqturb, & 3 & Ts,imp_fcg,ts_fcg,Tp_fcg,Turb_fcg) 4 ! 5 5 implicit none 6 6 7 cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc8 ccette routine permet d obtenir u_convg,v_convg,ht,hq et ainsi de9 cpouvoir calculer la convergence et le cisaillement dans la physiq10 ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc7 !ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc 8 ! cette routine permet d obtenir u_convg,v_convg,ht,hq et ainsi de 9 ! pouvoir calculer la convergence et le cisaillement dans la physiq 10 !cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc 11 11 12 12 #include "YOMCST.h" … … 29 29 COMMON/com2_phys_gcss/playm,hplaym,nblvlm 30 30 31 c======================================================================32 cmethode: on va chercher les donnees du mesoNH de meteo france, on y33 ca acces a tout pas detemps grace a la routine rdgrads qui34 cest une boucle lisant dans ces fichiers.35 cPuis on interpole ces donnes sur les 11 niveaux du gcm et36 cet sur les pas de temps de ce meme gcm37 c----------------------------------------------------------------------38 cinput:39 cpasmax :nombre de pas de temps maximum du mesoNH40 cdt :pas de temps du meso_NH (en secondes)41 c----------------------------------------------------------------------31 !====================================================================== 32 ! methode: on va chercher les donnees du mesoNH de meteo france, on y 33 ! a acces a tout pas detemps grace a la routine rdgrads qui 34 ! est une boucle lisant dans ces fichiers. 35 ! Puis on interpole ces donnes sur les 11 niveaux du gcm et 36 ! et sur les pas de temps de ce meme gcm 37 !---------------------------------------------------------------------- 38 ! input: 39 ! pasmax :nombre de pas de temps maximum du mesoNH 40 ! dt :pas de temps du meso_NH (en secondes) 41 !---------------------------------------------------------------------- 42 42 integer pasmax,dt 43 43 save pasmax,dt 44 c----------------------------------------------------------------------45 carguments:46 citap :compteur de la physique(le nombre de ces pas est47 cfixe dans la subroutine calcul_ini_gcm de interpo48 c-lation49 cdtime :pas detemps du gcm (en secondes)50 cht :convergence horizontale de temperature(K/s)51 chq : " " d humidite (kg/kg/s)52 chw :vitesse verticale moyenne (m/s**2)53 chu :convergence horizontale d impulsion le long de x54 c(kg/(m^2 s^2)55 chv : idem le long de y.56 cTs : Temperature de surface (K)57 cimp_fcg: var. logical .eq. T si forcage en impulsion58 cts_fcg: var. logical .eq. T si forcage en Ts present dans fichier59 cTp_fcg: var. logical .eq. T si forcage donne en Temp potentielle60 cTurb_fcg: var. logical .eq. T si forcage turbulent present dans fichier61 c----------------------------------------------------------------------44 !---------------------------------------------------------------------- 45 ! arguments: 46 ! itap :compteur de la physique(le nombre de ces pas est 47 ! fixe dans la subroutine calcul_ini_gcm de interpo 48 ! -lation 49 ! dtime :pas detemps du gcm (en secondes) 50 ! ht :convergence horizontale de temperature(K/s) 51 ! hq : " " d humidite (kg/kg/s) 52 ! hw :vitesse verticale moyenne (m/s**2) 53 ! hu :convergence horizontale d impulsion le long de x 54 ! (kg/(m^2 s^2) 55 ! hv : idem le long de y. 56 ! Ts : Temperature de surface (K) 57 ! imp_fcg: var. logical .eq. T si forcage en impulsion 58 ! ts_fcg: var. logical .eq. T si forcage en Ts present dans fichier 59 ! Tp_fcg: var. logical .eq. T si forcage donne en Temp potentielle 60 ! Turb_fcg: var. logical .eq. T si forcage turbulent present dans fichier 61 !---------------------------------------------------------------------- 62 62 integer itap 63 63 real dtime … … 74 74 logical Tp_fcg 75 75 logical Turb_fcg 76 c----------------------------------------------------------------------77 cVariables internes de get_uvd (note : l interpolation temporelle78 cest faite entre les pas de temps before et after, sur les variables79 cdefinies sur la grille du SCM; on atteint exactement les valeurs Meso80 caux milieux des pas de temps Meso)81 ctime0 :date initiale en secondes82 ctime :temps associe a chaque pas du SCM83 cpas :numero du pas du meso_NH (on lit en pas : le premier pas84 cdes donnees est duplique)85 cpasprev :numero du pas de lecture precedent86 chtaft :advection horizontale de temp. au pas de temps after87 chqaft : " " d humidite "88 chwaft :vitesse verticalle moyenne au pas de temps after89 chuaft,hvaft :advection horizontale d impulsion au pas de temps after90 ctsaft : surface temperature 'after time step'91 chtbef :idem htaft, mais pour le pas de temps before92 chqbef :voir hqaft93 chwbef :voir hwaft94 chubef,hvbef : idem huaft,hvaft, mais pour before95 ctsbef : surface temperature 'before time step'96 c----------------------------------------------------------------------76 !---------------------------------------------------------------------- 77 ! Variables internes de get_uvd (note : l interpolation temporelle 78 ! est faite entre les pas de temps before et after, sur les variables 79 ! definies sur la grille du SCM; on atteint exactement les valeurs Meso 80 ! aux milieux des pas de temps Meso) 81 ! time0 :date initiale en secondes 82 ! time :temps associe a chaque pas du SCM 83 ! pas :numero du pas du meso_NH (on lit en pas : le premier pas 84 ! des donnees est duplique) 85 ! pasprev :numero du pas de lecture precedent 86 ! htaft :advection horizontale de temp. au pas de temps after 87 ! hqaft : " " d humidite " 88 ! hwaft :vitesse verticalle moyenne au pas de temps after 89 ! huaft,hvaft :advection horizontale d impulsion au pas de temps after 90 ! tsaft : surface temperature 'after time step' 91 ! htbef :idem htaft, mais pour le pas de temps before 92 ! hqbef :voir hqaft 93 ! hwbef :voir hwaft 94 ! hubef,hvbef : idem huaft,hvaft, mais pour before 95 ! tsbef : surface temperature 'before time step' 96 !---------------------------------------------------------------------- 97 97 integer time0,pas,pasprev 98 98 save time0,pas,pasprev … … 106 106 real Tsbef 107 107 save htbef,hqbef,hwbef,hubef,hvbef,hthturbbef,hqturbbef 108 c 108 ! 109 109 real timeaft,timebef 110 110 save timeaft,timebef 111 111 integer temps 112 112 character*4 string 113 c----------------------------------------------------------------------114 cvariables arguments de la subroutine rdgrads115 c---------------------------------------------------------------------113 !---------------------------------------------------------------------- 114 ! variables arguments de la subroutine rdgrads 115 !--------------------------------------------------------------------- 116 116 integer icompt,icomp1 !compteurs de rdgrads 117 117 real z(100) ! altitude (grille Meso) … … 128 128 real hqturb_mes(100) !tendance horizontale d humidite, due aux 129 129 !flux turbulents 130 c 131 c---------------------------------------------------------------------132 cvariable argument de la subroutine copie133 c---------------------------------------------------------------------134 cSB real pplay(100) !pression en milieu de couche du gcm135 cSB !argument de la physique136 c---------------------------------------------------------------------137 cvariables destinees a la lecture du pas de temps du fichier de donnees138 c---------------------------------------------------------------------130 ! 131 !--------------------------------------------------------------------- 132 ! variable argument de la subroutine copie 133 !--------------------------------------------------------------------- 134 ! SB real pplay(100) !pression en milieu de couche du gcm 135 ! SB !argument de la physique 136 !--------------------------------------------------------------------- 137 ! variables destinees a la lecture du pas de temps du fichier de donnees 138 !--------------------------------------------------------------------- 139 139 character*80 aaa,atemps,spaces,apasmax 140 140 integer nch,imn,ipa 141 c---------------------------------------------------------------------142 cprocedures appelees141 !--------------------------------------------------------------------- 142 ! procedures appelees 143 143 external rdgrads !lire en iterant dans forcing.dat 144 c---------------------------------------------------------------------144 !--------------------------------------------------------------------- 145 145 print*,'le pas itap est:',itap 146 c*** on determine le pas du meso_NH correspondant au nouvel itap ***147 c*** pour aller chercher les champs dans rdgrads ***148 c 146 !*** on determine le pas du meso_NH correspondant au nouvel itap *** 147 !*** pour aller chercher les champs dans rdgrads *** 148 ! 149 149 time=time0+itap*dtime 150 cc temps=int(time/dt+1)151 cc pas=min(temps,pasmax)150 !c temps=int(time/dt+1) 151 !c pas=min(temps,pasmax) 152 152 temps = 1 + int((dt + 2*time)/(2*dt)) 153 153 pas=min(temps,pasmax-1) 154 154 print*,'le pas Meso est:',pas 155 c 156 c 157 c===================================================================158 c 159 c*** on remplit les champs before avec les champs after du pas ***160 c*** precedent en format gcm ***155 ! 156 ! 157 !=================================================================== 158 ! 159 !*** on remplit les champs before avec les champs after du pas *** 160 !*** precedent en format gcm *** 161 161 if(pas.gt.pasprev)then 162 162 do i=1,klev … … 180 180 print *, imp_fcg,ts_fcg,Turb_fcg,pas,nblvlm,icompt 181 181 print*,'le pas pas est:',pas 182 c*** on va chercher les nouveaux champs after dans toga.dat ***183 c*** champs en format meso_NH ***184 open(99,FILE=file_fordat,FORM='UNFORMATTED', 185 .ACCESS='DIRECT',RECL=8)186 call rdgrads(99,icompt,nblvlm,z,ht_mes,hq_mes,hw_mes 187 . ,hu_mes,hv_mes,hthturb_mes,hqturb_mes188 .,ts_fcg,ts_subr,imp_fcg,Turb_fcg)189 c 182 !*** on va chercher les nouveaux champs after dans toga.dat *** 183 !*** champs en format meso_NH *** 184 open(99,FILE=file_fordat,FORM='UNFORMATTED', & 185 & ACCESS='DIRECT',RECL=8) 186 call rdgrads(99,icompt,nblvlm,z,ht_mes,hq_mes,hw_mes & 187 & ,hu_mes,hv_mes,hthturb_mes,hqturb_mes & 188 & ,ts_fcg,ts_subr,imp_fcg,Turb_fcg) 189 ! 190 190 191 191 if(Tp_fcg) then 192 c(le forcage est donne en temperature potentielle)192 ! (le forcage est donne en temperature potentielle) 193 193 do i = 1,nblvlm 194 194 ht_mes(i) = ht_mes(i)*(hplaym(i)/1000.)**rkappa … … 200 200 enddo 201 201 endif ! Turb_fcg 202 c 202 ! 203 203 print*,'ht_mes ',(ht_mes(i),i=1,nblvlm) 204 204 print*,'hq_mes ',(hq_mes(i),i=1,nblvlm) … … 213 213 endif 214 214 IF (ts_fcg) print*,'ts_subr', ts_subr 215 c*** on interpole les champs meso_NH sur les niveaux de pression***216 c*** gcm . on obtient le nouveau champ after ***215 !*** on interpole les champs meso_NH sur les niveaux de pression*** 216 !*** gcm . on obtient le nouveau champ after *** 217 217 do k=1,klev 218 218 if (JM(k) .eq. 0) then … … 237 237 endif ! imp_fcg 238 238 if(Turb_fcg) then 239 hThTurbaft(k)=coef1(k)*hThTurb_mes(jm(k)) 240 $+coef2(k)*hThTurb_mes(jm(k)+1)241 hqTurbaft(k) =coef1(k)*hqTurb_mes(jm(k)) 242 $+coef2(k)*hqTurb_mes(jm(k)+1)239 hThTurbaft(k)=coef1(k)*hThTurb_mes(jm(k)) & 240 & +coef2(k)*hThTurb_mes(jm(k)+1) 241 hqTurbaft(k) =coef1(k)*hqTurb_mes(jm(k)) & 242 & +coef2(k)*hqTurb_mes(jm(k)+1) 243 243 endif ! Turb_fcg 244 244 endif ! JM(k) .eq. 0 … … 250 250 endif ! pas.gt.pasprev fin du bloc relatif au passage au pas 251 251 !de temps (meso) suivant 252 c*** si on atteint le pas max des donnees experimentales ,on ***253 c*** on conserve les derniers champs calcules ***252 !*** si on atteint le pas max des donnees experimentales ,on *** 253 !*** on conserve les derniers champs calcules *** 254 254 if(temps.ge.pasmax)then 255 255 do ll=1,klev … … 264 264 ts_subr = tsaft 265 265 else ! temps.ge.pasmax 266 c*** on interpole sur les pas de temps de 10mn du gcm a partir ***267 c** des pas de temps de 1h du meso_NH ***266 !*** on interpole sur les pas de temps de 10mn du gcm a partir *** 267 !** des pas de temps de 1h du meso_NH *** 268 268 do j=1,klev 269 269 ht(j)=((timeaft-time)*htbef(j)+(time-timebef)*htaft(j))/dt … … 275 275 endif ! imp_fcg 276 276 if(Turb_fcg) then 277 hThTurb(j)=((timeaft-time)*hThTurbbef(j) 278 $+(time-timebef)*hThTurbaft(j))/dt279 hqTurb(j)= ((timeaft-time)*hqTurbbef(j) 280 $+(time-timebef)*hqTurbaft(j))/dt277 hThTurb(j)=((timeaft-time)*hThTurbbef(j) & 278 & +(time-timebef)*hThTurbaft(j))/dt 279 hqTurb(j)= ((timeaft-time)*hqTurbbef(j) & 280 & +(time-timebef)*hqTurbaft(j))/dt 281 281 endif ! Turb_fcg 282 282 enddo 283 283 ts_subr = ((timeaft-time)*tsbef + (time-timebef)*tsaft)/dt 284 284 endif ! temps.ge.pasmax 285 c 285 ! 286 286 print *,' time,timebef,timeaft',time,timebef,timeaft 287 287 print *,' ht,htbef,htaft,hthturb,hthturbbef,hthturbaft' 288 288 do j= 1,klev 289 print *, j,ht(j),htbef(j),htaft(j), 290 $hthturb(j),hthturbbef(j),hthturbaft(j)289 print *, j,ht(j),htbef(j),htaft(j), & 290 & hthturb(j),hthturbbef(j),hthturbaft(j) 291 291 enddo 292 292 print *,' hq,hqbef,hqaft,hqturb,hqturbbef,hqturbaft' 293 293 do j= 1,klev 294 print *, j,hq(j),hqbef(j),hqaft(j), 295 $hqturb(j),hqturbbef(j),hqturbaft(j)294 print *, j,hq(j),hqbef(j),hqaft(j), & 295 & hqturb(j),hqturbbef(j),hqturbaft(j) 296 296 enddo 297 c 298 c-------------------------------------------------------------------299 c 297 ! 298 !------------------------------------------------------------------- 299 ! 300 300 IF (Ts_fcg) Ts = Ts_subr 301 301 return 302 c 303 c-----------------------------------------------------------------------304 con sort les champs de "convergence" pour l instant initial 'in'305 cceci se passe au pas temps itap=0 de la physique306 c-----------------------------------------------------------------------307 entry get_uvd2(itap,dtime,file_forctl,file_fordat, 308 . ht,hq,hw,hu,hv,hThTurb,hqTurb,ts,309 .imp_fcg,ts_fcg,Tp_fcg,Turb_fcg)302 ! 303 !----------------------------------------------------------------------- 304 ! on sort les champs de "convergence" pour l instant initial 'in' 305 ! ceci se passe au pas temps itap=0 de la physique 306 !----------------------------------------------------------------------- 307 entry get_uvd2(itap,dtime,file_forctl,file_fordat, & 308 & ht,hq,hw,hu,hv,hThTurb,hqTurb,ts, & 309 & imp_fcg,ts_fcg,Tp_fcg,Turb_fcg) 310 310 print*,'le pas itap est:',itap 311 c 312 c===================================================================313 c 311 ! 312 !=================================================================== 313 ! 314 314 write(*,'(a)') 'OPEN '//file_forctl 315 315 open(97,FILE=file_forctl,FORM='FORMATTED') 316 c 317 c------------------316 ! 317 !------------------ 318 318 do i=1,1000 319 319 read(97,1000,end=999) string … … 322 322 enddo 323 323 50 backspace(97) 324 c-------------------------------------------------------------------325 c*** on lit le pas de temps dans le fichier de donnees ***326 c*** "forcing.ctl" et pasmax ***327 c-------------------------------------------------------------------324 !------------------------------------------------------------------- 325 ! *** on lit le pas de temps dans le fichier de donnees *** 326 ! *** "forcing.ctl" et pasmax *** 327 !------------------------------------------------------------------- 328 328 read(97,2000) aaa 329 329 2000 format (a80) … … 344 344 print*,'pasmax est',pasmax 345 345 CLOSE(97) 346 c------------------------------------------------------------------347 c*** on lit le pas de temps initial de la simulation ***348 c------------------------------------------------------------------346 !------------------------------------------------------------------ 347 ! *** on lit le pas de temps initial de la simulation *** 348 !------------------------------------------------------------------ 349 349 in=itap 350 cc pasprev=in351 cc time0=dt*(pasprev-1)350 !c pasprev=in 351 !c time0=dt*(pasprev-1) 352 352 pasprev=in-1 353 353 time0=dt*pasprev 354 C 354 ! 355 355 close(98) 356 c 356 ! 357 357 write(*,'(a)') 'OPEN '//file_fordat 358 open(99,FILE=file_fordat,FORM='UNFORMATTED', 359 .ACCESS='DIRECT',RECL=8)358 open(99,FILE=file_fordat,FORM='UNFORMATTED', & 359 & ACCESS='DIRECT',RECL=8) 360 360 icomp1 = nblvlm*4 361 361 IF (ts_fcg) icomp1 = icomp1 + 1 … … 363 363 IF (Turb_fcg) icomp1 = icomp1 + nblvlm*2 364 364 icompt = icomp1*(in-1) 365 call rdgrads(99,icompt,nblvlm,z,ht_mes,hq_mes,hw_mes 366 . ,hu_mes,hv_mes,hthturb_mes,hqturb_mes367 .,ts_fcg,ts_subr,imp_fcg,Turb_fcg)365 call rdgrads(99,icompt,nblvlm,z,ht_mes,hq_mes,hw_mes & 366 & ,hu_mes,hv_mes,hthturb_mes,hqturb_mes & 367 & ,ts_fcg,ts_subr,imp_fcg,Turb_fcg) 368 368 print *, 'get_uvd : rdgrads ->' 369 369 print *, tp_fcg 370 c 371 cfollowing commented out because we have temperature already in ARM case372 c(otherwise this is the potential temperature )373 c------------------------------------------------------------------------370 ! 371 ! following commented out because we have temperature already in ARM case 372 ! (otherwise this is the potential temperature ) 373 !------------------------------------------------------------------------ 374 374 if(Tp_fcg) then 375 375 do i = 1,nblvlm … … 389 389 print*,'hqTurb ', (hqTurb_mes(i),i=1,nblvlm) 390 390 endif ! Turb_fcg 391 c----------------------------------------------------------------------392 con a obtenu des champs initiaux sur les niveaux du meso_NH393 con interpole sur les niveaux du gcm(niveau pression bien sur!)394 c-----------------------------------------------------------------------391 !---------------------------------------------------------------------- 392 ! on a obtenu des champs initiaux sur les niveaux du meso_NH 393 ! on interpole sur les niveaux du gcm(niveau pression bien sur!) 394 !----------------------------------------------------------------------- 395 395 do k=1,klev 396 396 if (JM(k) .eq. 0) then 397 cFKC bug? ne faut il pas convertir tsol en tendance ????398 cRT bug taken care of by removing the stuff397 !FKC bug? ne faut il pas convertir tsol en tendance ???? 398 !RT bug taken care of by removing the stuff 399 399 htaft(k)= ht_mes(jm(k)+1) 400 400 hqaft(k)= hq_mes(jm(k)+1) … … 417 417 endif ! imp_fcg 418 418 if(Turb_fcg) then 419 hThTurbaft(k)=coef1(k)*hThTurb_mes(jm(k)) 420 $+coef2(k)*hThTurb_mes(jm(k)+1)421 hqTurbaft(k) =coef1(k)*hqTurb_mes(jm(k)) 422 $+coef2(k)*hqTurb_mes(jm(k)+1)419 hThTurbaft(k)=coef1(k)*hThTurb_mes(jm(k)) & 420 & +coef2(k)*hThTurb_mes(jm(k)+1) 421 hqTurbaft(k) =coef1(k)*hqTurb_mes(jm(k)) & 422 & +coef2(k)*hqTurb_mes(jm(k)+1) 423 423 endif ! Turb_fcg 424 424 endif ! JM(k) .eq. 0 425 425 enddo 426 426 tsaft = ts_subr 427 cvaleurs initiales des champs de convergence427 ! valeurs initiales des champs de convergence 428 428 do k=1,klev 429 429 ht(k)=htaft(k) … … 442 442 close(99) 443 443 close(98) 444 c 445 c-------------------------------------------------------------------446 c 447 c 444 ! 445 !------------------------------------------------------------------- 446 ! 447 ! 448 448 100 IF (Ts_fcg) Ts = Ts_subr 449 449 return 450 c 450 ! 451 451 999 continue 452 452 stop 'erreur lecture, file forcing.ctl' 453 453 end 454 454 455 SUBROUTINE advect_tvl(dtime,zt,zq,vu_f,vv_f,t_f,q_f 456 :,d_t_adv,d_q_adv)455 SUBROUTINE advect_tvl(dtime,zt,zq,vu_f,vv_f,t_f,q_f & 456 & ,d_t_adv,d_q_adv) 457 457 use dimphy 458 458 implicit none 459 459 460 460 #include "dimensions.h" 461 ccccc#include "dimphy.h"461 !cccc#include "dimphy.h" 462 462 463 463 integer k 464 464 real dtime, fact, du, dv, cx, cy, alx, aly 465 465 real zt(klev), zq(klev,3) 466 : ,vu_f(klev), vv_f(klev), t_f(klev), q_f(klev,3)466 real vu_f(klev), vv_f(klev), t_f(klev), q_f(klev,3) 467 467 468 468 real d_t_adv(klev), d_q_adv(klev,3) 469 469 470 cVelocity of moving cell470 ! Velocity of moving cell 471 471 data cx,cy /12., -2./ 472 472 473 cDimensions of moving cell474 data alx,aly /100 000.,150000./473 ! Dimensions of moving cell 474 data alx,aly /100000.,150000./ 475 475 476 476 do k = 1, klev … … 490 490 implicit none 491 491 492 ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc493 ccette routine remplit les COMMON com1_phys_gcss et com2_phys_gcss.h494 cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc492 !cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc 493 ! cette routine remplit les COMMON com1_phys_gcss et com2_phys_gcss.h 494 !ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc 495 495 496 496 INTEGER klev !nombre de niveau de pression du GCM … … 514 514 klev = klevgcm 515 515 516 c---------------------------------------------------------------------517 cpression au milieu des couches du gcm dans la physiq518 c(SB: remplace le call conv_lipress_gcm(playgcm) )519 c---------------------------------------------------------------------516 !--------------------------------------------------------------------- 517 ! pression au milieu des couches du gcm dans la physiq 518 ! (SB: remplace le call conv_lipress_gcm(playgcm) ) 519 !--------------------------------------------------------------------- 520 520 521 521 do k = 1, klev … … 524 524 enddo 525 525 526 c----------------------------------------------------------------------527 clecture du descripteur des donnees Meso-NH (forcing.ctl):528 c-> nb niveaux du meso.NH (nblvlm) + pressions meso.NH529 c(on remplit le COMMON com2_phys_gcss)530 c----------------------------------------------------------------------526 !---------------------------------------------------------------------- 527 ! lecture du descripteur des donnees Meso-NH (forcing.ctl): 528 ! -> nb niveaux du meso.NH (nblvlm) + pressions meso.NH 529 ! (on remplit le COMMON com2_phys_gcss) 530 !---------------------------------------------------------------------- 531 531 532 532 call mesolupbis(file_forctl) … … 534 534 print*,'la valeur de nblvlm est:',nblvlm 535 535 536 c----------------------------------------------------------------------537 cetude de la correspondance entre les niveaux meso.NH et GCM;538 ccalcul des coefficients d interpolation coef1 et coef2539 c(on remplit le COMMON com1_phys_gcss)540 c----------------------------------------------------------------------536 !---------------------------------------------------------------------- 537 ! etude de la correspondance entre les niveaux meso.NH et GCM; 538 ! calcul des coefficients d interpolation coef1 et coef2 539 ! (on remplit le COMMON com1_phys_gcss) 540 !---------------------------------------------------------------------- 541 541 542 542 call corresbis(psolgcm) 543 543 544 c---------------------------------------------------------545 cTEST sur le remplissage de com1_phys_gcss et com2_phys_gcss:546 c---------------------------------------------------------544 !--------------------------------------------------------- 545 ! TEST sur le remplissage de com1_phys_gcss et com2_phys_gcss: 546 !--------------------------------------------------------- 547 547 548 548 write(*,*) ' ' … … 562 562 SUBROUTINE mesolupbis(file_forctl) 563 563 implicit none 564 c 565 cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc566 c 567 cLecture descripteur des donnees MESO-NH (forcing.ctl):568 c-------------------------------------------------------569 c 570 cCette subroutine lit dans le fichier de controle "essai.ctl"571 cet affiche le nombre de niveaux du Meso-NH ainsi que les valeurs572 cdes pressions en milieu de couche du Meso-NH (en Pa puis en hPa).573 cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc574 c 564 ! 565 !ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc 566 ! 567 ! Lecture descripteur des donnees MESO-NH (forcing.ctl): 568 ! ------------------------------------------------------- 569 ! 570 ! Cette subroutine lit dans le fichier de controle "essai.ctl" 571 ! et affiche le nombre de niveaux du Meso-NH ainsi que les valeurs 572 ! des pressions en milieu de couche du Meso-NH (en Pa puis en hPa). 573 !ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc 574 ! 575 575 INTEGER nblvlm !nombre de niveau de pression du mesoNH 576 576 REAL playm(100) !pression en Pa milieu de chaque couche Meso-NH … … 588 588 lu=9 589 589 open(lu,file=file_forctl,form='formatted') 590 c 590 ! 591 591 do i=1,1000 592 592 read(lu,1000,end=999) a 593 593 if (a .eq. 'ZDEF') go to 100 594 594 enddo 595 c 595 ! 596 596 100 backspace(lu) 597 597 print*,' DESCRIPTION DES 2 MODELES : ' 598 598 print*,' ' 599 c 599 ! 600 600 read(lu,2000) aaa 601 601 2000 format (a80) … … 604 604 read(anblvl,*) nblvlm 605 605 606 c 606 ! 607 607 print*,'nbre de niveaux de pression Meso-NH :',nblvlm 608 608 print*,' ' 609 609 print*,'pression en Pa de chaque couche du meso-NH :' 610 c 610 ! 611 611 read(lu,*) (playm(mlz),mlz=1,nblvlm) 612 cSi la pression est en HPa, la multiplier par 100612 ! Si la pression est en HPa, la multiplier par 100 613 613 if (playm(1) .lt. 10000.) then 614 614 do mlz = 1,nblvlm … … 617 617 endif 618 618 print*,(playm(mlz),mlz=1,nblvlm) 619 c 619 ! 620 620 1000 format (a4) 621 621 1001 format(5x,i2) 622 c 622 ! 623 623 print*,' ' 624 624 do mlzh=1,nblvlm 625 625 hplaym(mlzh)=playm(mlzh)/100. 626 626 enddo 627 c 627 ! 628 628 print*,'pression en hPa de chaque couche du meso-NH: ' 629 629 print*,(hplaym(mlzh),mlzh=1,nblvlm) 630 c 630 ! 631 631 close (lu) 632 632 return 633 c 633 ! 634 634 999 stop 'erreur lecture des niveaux pression des donnees' 635 635 end 636 636 637 SUBROUTINE rdgrads(itape,icount,nl,z,ht,hq,hw,hu,hv,hthtur,hqtur, 638 :ts_fcg,ts,imp_fcg,Turb_fcg)637 SUBROUTINE rdgrads(itape,icount,nl,z,ht,hq,hw,hu,hv,hthtur,hqtur, & 638 & ts_fcg,ts,imp_fcg,Turb_fcg) 639 639 IMPLICIT none 640 640 INTEGER itape,icount,icomp, nl … … 642 642 real hthtur(nl),hqtur(nl) 643 643 real ts 644 c 644 ! 645 645 INTEGER k 646 c 646 ! 647 647 LOGICAL imp_fcg,ts_fcg,Turb_fcg 648 c 648 ! 649 649 icomp = icount 650 c 651 c 650 ! 651 ! 652 652 do k=1,nl 653 653 icomp=icomp+1 … … 664 664 read(itape,rec=icomp)hQ(k) 665 665 enddo 666 c 666 ! 667 667 if(turb_fcg) then 668 668 do k=1,nl … … 676 676 endif 677 677 print *,' apres lecture hthtur, hqtur' 678 c 678 ! 679 679 if(imp_fcg) then 680 680 … … 689 689 690 690 endif 691 c 691 ! 692 692 do k=1,nl 693 693 icomp=icomp+1 694 694 read(itape,rec=icomp)hw(k) 695 695 enddo 696 c 696 ! 697 697 if(ts_fcg) then 698 698 icomp=icomp+1 699 699 read(itape,rec=icomp)ts 700 700 endif 701 c 701 ! 702 702 print *,' rdgrads ->' 703 703 … … 708 708 implicit none 709 709 710 ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc711 cCette subroutine calcule et affiche les valeurs des coefficients712 cd interpolation qui serviront dans la formule d interpolation elle-713 cmeme.714 cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc710 !cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc 711 ! Cette subroutine calcule et affiche les valeurs des coefficients 712 ! d interpolation qui serviront dans la formule d interpolation elle- 713 ! meme. 714 !ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc 715 715 716 716 INTEGER klev !nombre de niveau de pression du GCM … … 737 737 mlz = 0 738 738 JM(1) = mlz 739 coef1(1)=(playm(mlz+1)-val) 740 * /(playm(mlz+1)-psol) 741 coef2(1)=(val-psol) 742 * /(playm(mlz+1)-psol) 739 coef1(1)=(playm(mlz+1)-val)/(playm(mlz+1)-psol) 740 coef2(1)=(val-psol)/(playm(mlz+1)-psol) 743 741 else if (val .gt. playm(nblvlm)) then 744 742 do mlz=1,nblvlm 745 if ( val .le. playm(mlz) 746 * .and. val .gt. playm(mlz+1))then 743 if ( val .le. playm(mlz).and. val .gt. playm(mlz+1))then 747 744 JM(k)=mlz 748 coef1(k)=(playm(mlz+1)-val) 749 * /(playm(mlz+1)-playm(mlz)) 750 coef2(k)=(val-playm(mlz)) 751 * /(playm(mlz+1)-playm(mlz)) 745 coef1(k)=(playm(mlz+1)-val)/(playm(mlz+1)-playm(mlz)) 746 coef2(k)=(val-playm(mlz))/(playm(mlz+1)-playm(mlz)) 752 747 endif 753 748 enddo … … 758 753 endif 759 754 enddo 760 c 761 cc if (play(klev) .le. playm(nblvlm)) then762 cc mlz=nblvlm-1763 cc JM(klev)=mlz764 cc coef1(klev)=(playm(mlz+1)-val)765 cc * /(playm(mlz+1)-playm(mlz))766 cc coef2(klev)=(val-playm(mlz))767 cc * /(playm(mlz+1)-playm(mlz))768 cc endif769 c 755 ! 756 !c if (play(klev) .le. playm(nblvlm)) then 757 !c mlz=nblvlm-1 758 !c JM(klev)=mlz 759 !c coef1(klev)=(playm(mlz+1)-val) 760 !c * /(playm(mlz+1)-playm(mlz)) 761 !c coef2(klev)=(val-playm(mlz)) 762 !c * /(playm(mlz+1)-playm(mlz)) 763 !c endif 764 ! 770 765 print*,' ' 771 766 print*,' INTERPOLATION : ' … … 776 771 print*,(JM(k),k=1,klev) 777 772 print*,' ' 778 print*,'valeurs du premier coef d"interpolation pour les 9 niveaux 779 *: ' 773 print*,'vals du premier coef d"interpolation pour les 9 niveaux: ' 780 774 print*,(coef1(k),k=1,klev) 781 775 print*,' ' 782 print*,'valeurs du deuxieme coef d"interpolation pour les 9 niveau 783 *x: ' 776 print*,'valeurs du deuxieme coef d"interpolation pour les 9 niveaux:' 784 777 print*,(coef2(k),k=1,klev) 785 c 778 ! 786 779 return 787 780 end 788 781 SUBROUTINE GETSCH(STR,DEL,TRM,NTH,SST,NCH) 789 C***************************************************************790 C* *791 C* *792 C* GETSCH *793 C* *794 C* *795 C* modified by : *796 C***************************************************************797 C* Return in SST the character string found between the NTH-1 and NTH798 C* occurence of the delimiter 'DEL' but before the terminator 'TRM' in799 C* the input string 'STR'. If TRM=DEL then STR is considered unlimited.800 C* NCH=Length of the string returned in SST or =-1 if NTH is <1 or if801 C* NTH is greater than the number of delimiters in STR.782 !*************************************************************** 783 !* * 784 !* * 785 !* GETSCH * 786 !* * 787 !* * 788 !* modified by : * 789 !*************************************************************** 790 !* Return in SST the character string found between the NTH-1 and NTH 791 !* occurence of the delimiter 'DEL' but before the terminator 'TRM' in 792 !* the input string 'STR'. If TRM=DEL then STR is considered unlimited. 793 !* NCH=Length of the string returned in SST or =-1 if NTH is <1 or if 794 !* NTH is greater than the number of delimiters in STR. 802 795 IMPLICIT INTEGER (A-Z) 803 796 CHARACTER STR*(*),DEL*1,TRM*1,SST*(*) … … 811 804 IF(LENGTH.LT.0) LENGTH=LEN(STR) 812 805 ENDIF 813 C* Find beginning and end of the NTH DEL-limited substring in STR806 !* Find beginning and end of the NTH DEL-limited substring in STR 814 807 END=-1 815 808 DO 1,N=1,NTH … … 818 811 END=BEG+INDEX(STR(BEG:LENGTH),DEL)-2 819 812 IF(END.EQ.BEG-2) END=LENGTH 820 C* PRINT *,'NTH,LENGTH,N,BEG,END=',NTH,LENGTH,N,BEG,END813 !* PRINT *,'NTH,LENGTH,N,BEG,END=',NTH,LENGTH,N,BEG,END 821 814 1 CONTINUE 822 815 NCH=END-BEG+1 … … 825 818 END 826 819 CHARACTER*(*) FUNCTION SPACES(STR,NSPACE) 827 C 828 CCERN PROGLIB# M433 SPACES .VERSION KERNFOR 4.14 860211829 CORIG. 6/05/86 M.GOOSSENS/DD830 C 831 C- The function value SPACES returns the character string STR with832 C- leading blanks removed and each occurence of one or more blanks833 C- replaced by NSPACE blanks inside the string STR834 C 820 ! 821 ! CERN PROGLIB# M433 SPACES .VERSION KERNFOR 4.14 860211 822 ! ORIG. 6/05/86 M.GOOSSENS/DD 823 ! 824 !- The function value SPACES returns the character string STR with 825 !- leading blanks removed and each occurence of one or more blanks 826 !- replaced by NSPACE blanks inside the string STR 827 ! 835 828 CHARACTER*(*) STR 836 C 829 ! 837 830 LENSPA = LEN(SPACES) 838 831 SPACES = ' ' … … 857 850 999 END 858 851 FUNCTION INDEXC(STR,SSTR) 859 C 860 CCERN PROGLIB# M433 INDEXC .VERSION KERNFOR 4.14 860211861 CORIG. 26/03/86 M.GOOSSENS/DD862 C 863 C- Find the leftmost position where substring SSTR does not match864 C- string STR scanning forward865 C 852 ! 853 ! CERN PROGLIB# M433 INDEXC .VERSION KERNFOR 4.14 860211 854 ! ORIG. 26/03/86 M.GOOSSENS/DD 855 ! 856 !- Find the leftmost position where substring SSTR does not match 857 !- string STR scanning forward 858 ! 866 859 CHARACTER*(*) STR,SSTR 867 C 860 ! 868 861 LENS = LEN(STR) 869 862 LENSS = LEN(SSTR) 870 C 863 ! 871 864 DO 10 I=1,LENS-LENSS+1 872 865 IF (STR(I:I+LENSS-1).NE.SSTR) THEN … … 876 869 10 CONTINUE 877 870 INDEXC = 0 878 C 871 ! 879 872 999 END -
LMDZ5/trunk/libf/phylmd/compar1d.h
r2017 r2019 27 27 logical :: ok_old_disvert 28 28 29 common/com_par1d/ 29 common/com_par1d/ & 30 30 & nat_surf,tsurf,rugos, & 31 31 & qsol,qsurf,psurf,zsurf,albedo,time,time_ini,xlat,xlon,airefi, & 32 32 & wtsurf,wqsurf,restart_runoff,xagesno,qsolinp,zpicinp, & 33 & forcing_type, 33 & forcing_type, & 34 34 & restart,ok_old_disvert 35 35 -
LMDZ5/trunk/libf/phylmd/fcg_gcssold.h
r2017 r2019 2 2 ! $Id: fcg_gcssold.h 2010-08-10 17:02:56Z lahellec $ 3 3 ! 4 logical :: imp_fcg_gcssold,ts_fcg_gcssold,Tp_fcg_gcssold ,5 $ Tp_ini_gcssold,6 $xTurb_fcg_gcssold4 logical :: imp_fcg_gcssold,ts_fcg_gcssold,Tp_fcg_gcssold 5 logical :: Tp_ini_gcssold 6 logical :: xTurb_fcg_gcssold 7 7 8 common /fcg_gcssold/imp_fcg_gcssold,ts_fcg_gcssold,Tp_fcg_gcssold, 9 $ Tp_ini_gcssold,10 $xTurb_fcg_gcssold8 common /fcg_gcssold/imp_fcg_gcssold,ts_fcg_gcssold,Tp_fcg_gcssold, & 9 & Tp_ini_gcssold, & 10 & xTurb_fcg_gcssold 11 11 12 12 !$OMP THREADPRIVATE(/fcg_gcssold/) -
LMDZ5/trunk/libf/phylmd/lmdz1d.F90
r2017 r2019 4 4 #include "../dyn3d_common/disvert.F90" 5 5 6 CALL lmdz1d 7 8 END 6 7 PROGRAM lmdz1d 8 9 USE ioipsl, only: ju2ymds, ymds2ju, ioconf_calendar 10 use phys_state_var_mod 11 use comgeomphy 12 use dimphy 13 use surface_data, only : type_ocean,ok_veget 14 use pbl_surface_mod, only : ftsoil, pbl_surface_init, & 15 & pbl_surface_final 16 use fonte_neige_mod, only : fonte_neige_init, fonte_neige_final 17 18 use infotrac ! new 19 use control_mod 20 USE indice_sol_mod 21 USE phyaqua_mod 22 23 implicit none 24 #include "dimensions.h" 25 #include "YOMCST.h" 26 #include "temps.h" 27 !!#include "control.h" 28 #include "iniprint.h" 29 #include "clesphys.h" 30 #include "dimsoil.h" 31 !#include "indicesol.h" 32 33 #include "comvert.h" 34 #include "compar1d.h" 35 #include "flux_arp.h" 36 #include "tsoilnudge.h" 37 #include "fcg_gcssold.h" 38 !!!#include "fbforcing.h" 39 40 !===================================================================== 41 ! DECLARATIONS 42 !===================================================================== 43 44 !--------------------------------------------------------------------- 45 ! Externals 46 !--------------------------------------------------------------------- 47 external fq_sat 48 real fq_sat 49 50 !--------------------------------------------------------------------- 51 ! Arguments d' initialisations de la physique (USER DEFINE) 52 !--------------------------------------------------------------------- 53 54 integer, parameter :: ngrid=1 55 real :: zcufi = 1. 56 real :: zcvfi = 1. 57 58 !- real :: nat_surf 59 !- logical :: ok_flux_surf 60 !- real :: fsens 61 !- real :: flat 62 !- real :: tsurf 63 !- real :: rugos 64 !- real :: qsol(1:2) 65 !- real :: qsurf 66 !- real :: psurf 67 !- real :: zsurf 68 !- real :: albedo 69 !- 70 !- real :: time = 0. 71 !- real :: time_ini 72 !- real :: xlat 73 !- real :: xlon 74 !- real :: wtsurf 75 !- real :: wqsurf 76 !- real :: restart_runoff 77 !- real :: xagesno 78 !- real :: qsolinp 79 !- real :: zpicinp 80 !- 81 real :: fnday 82 real :: day, daytime 83 real :: day1 84 real :: heure 85 integer :: jour 86 integer :: mois 87 integer :: an 88 89 !--------------------------------------------------------------------- 90 ! Declarations related to forcing and initial profiles 91 !--------------------------------------------------------------------- 92 93 integer :: kmax = llm 94 integer llm700,nq1,nq2 95 INTEGER, PARAMETER :: nlev_max=1000, nqmx=1000 96 real timestep, frac 97 real height(nlev_max),tttprof(nlev_max),qtprof(nlev_max) 98 real uprof(nlev_max),vprof(nlev_max),e12prof(nlev_max) 99 real ugprof(nlev_max),vgprof(nlev_max),wfls(nlev_max) 100 real dqtdxls(nlev_max),dqtdyls(nlev_max) 101 real dqtdtls(nlev_max),thlpcar(nlev_max) 102 real qprof(nlev_max,nqmx) 103 104 ! integer :: forcing_type 105 logical :: forcing_les = .false. 106 logical :: forcing_armcu = .false. 107 logical :: forcing_rico = .false. 108 logical :: forcing_radconv = .false. 109 logical :: forcing_toga = .false. 110 logical :: forcing_twpice = .false. 111 logical :: forcing_amma = .false. 112 logical :: forcing_GCM2SCM = .false. 113 logical :: forcing_GCSSold = .false. 114 logical :: forcing_sandu = .false. 115 logical :: forcing_astex = .false. 116 logical :: forcing_fire = .false. 117 integer :: type_ts_forcing ! 0 = SST constant; 1 = SST read from a file 118 ! (cf read_tsurf1d.F) 119 120 !vertical advection computation 121 ! real d_t_z(llm), d_q_z(llm) 122 ! real d_t_dyn_z(llm), d_q_dyn_z(llm) 123 ! real zz(llm) 124 ! real zfact 125 126 !flag forcings 127 logical :: nudge_wind=.true. 128 logical :: nudge_thermo=.false. 129 logical :: cptadvw=.true. 130 !===================================================================== 131 ! DECLARATIONS FOR EACH CASE 132 !===================================================================== 133 ! 134 #include "1D_decl_cases.h" 135 ! 136 !--------------------------------------------------------------------- 137 ! Declarations related to vertical discretization: 138 !--------------------------------------------------------------------- 139 real :: pzero=1.e5 140 real :: play (llm),zlay (llm),sig_s(llm),plev(llm+1) 141 real :: playd(llm),zlayd(llm),ap_amma(llm+1),bp_amma(llm+1),poub 142 143 !--------------------------------------------------------------------- 144 ! Declarations related to variables 145 !--------------------------------------------------------------------- 146 147 real :: phi(llm) 148 real :: teta(llm),tetal(llm),temp(llm),u(llm),v(llm),w(llm) 149 real :: rlat_rad(1),rlon_rad(1) 150 real :: omega(llm+1),omega2(llm),rho(llm+1) 151 real :: ug(llm),vg(llm),fcoriolis 152 real :: sfdt, cfdt 153 real :: du_phys(llm),dv_phys(llm),dt_phys(llm) 154 real :: dt_dyn(llm) 155 real :: dt_cooling(llm),d_th_adv(llm) 156 real :: alpha 157 real :: ttt 158 159 REAL, ALLOCATABLE, DIMENSION(:,:):: q 160 REAL, ALLOCATABLE, DIMENSION(:,:):: dq 161 REAL, ALLOCATABLE, DIMENSION(:,:):: dq_dyn 162 REAL, ALLOCATABLE, DIMENSION(:,:):: d_q_adv 163 ! REAL, ALLOCATABLE, DIMENSION(:):: d_th_adv 164 165 !--------------------------------------------------------------------- 166 ! Initialization of surface variables 167 !--------------------------------------------------------------------- 168 real :: run_off_lic_0(1) 169 real :: fder(1),snsrf(1,nbsrf),qsurfsrf(1,nbsrf) 170 real :: evap(1,nbsrf),frugs(1,nbsrf) 171 real :: tsoil(1,nsoilmx,nbsrf) 172 real :: agesno(1,nbsrf) 173 174 !--------------------------------------------------------------------- 175 ! Call to phyredem 176 !--------------------------------------------------------------------- 177 logical :: ok_writedem =.true. 178 179 !--------------------------------------------------------------------- 180 ! Call to physiq 181 !--------------------------------------------------------------------- 182 integer, parameter :: longcles=20 183 logical :: firstcall=.true. 184 logical :: lastcall=.false. 185 real :: phis = 0.0 186 real :: clesphy0(longcles) = 0.0 187 real :: dpsrf 188 189 !--------------------------------------------------------------------- 190 ! Initializations of boundary conditions 191 !--------------------------------------------------------------------- 192 integer, parameter :: yd = 360 193 real :: phy_nat (yd) = 0.0 ! 0=ocean libre,1=land,2=glacier,3=banquise 194 real :: phy_alb (yd) ! Albedo land only (old value condsurf_jyg=0.3) 195 real :: phy_sst (yd) ! SST (will not be used; cf read_tsurf1d.F) 196 real :: phy_bil (yd) = 1.0 ! Ne sert que pour les slab_ocean 197 real :: phy_rug (yd) ! Longueur rugosite utilisee sur land only 198 real :: phy_ice (yd) = 0.0 ! Fraction de glace 199 real :: phy_fter(yd) = 0.0 ! Fraction de terre 200 real :: phy_foce(yd) = 0.0 ! Fraction de ocean 201 real :: phy_fsic(yd) = 0.0 ! Fraction de glace 202 real :: phy_flic(yd) = 0.0 ! Fraction de glace 203 204 !--------------------------------------------------------------------- 205 ! Fichiers et d'autres variables 206 !--------------------------------------------------------------------- 207 integer :: k,l,i,it=1,mxcalc 208 integer jjmp1 209 parameter (jjmp1=jjm+1-1/jjm) 210 INTEGER nbteta 211 PARAMETER(nbteta=3) 212 REAL dudyn(iim+1,jjmp1,llm) 213 REAL PVteta(1,nbteta) 214 INTEGER read_climoz 215 !Al1 216 integer ecrit_slab_oc !1=ecrit,-1=lit,0=no file 217 data ecrit_slab_oc/-1/ 218 219 !===================================================================== 220 ! INITIALIZATIONS 221 !===================================================================== 222 ! Initialization of Common turb_forcing 223 dtime_frcg = 0. 224 Turb_fcg_gcssold=.false. 225 hthturb_gcssold = 0. 226 hqturb_gcssold = 0. 227 228 !--------------------------------------------------------------------- 229 ! OPTIONS OF THE 1D SIMULATION (lmdz1d.def => unicol.def) 230 !--------------------------------------------------------------------- 231 !Al1 232 call conf_unicol 233 !Al1 moves this gcssold var from common fcg_gcssold to 234 Turb_fcg_gcssold = xTurb_fcg_gcssold 235 ! -------------------------------------------------------------------- 236 close(1) 237 !Al1 238 write(*,*) 'lmdz1d.def lu => unicol.def' 239 240 ! forcing_type defines the way the SCM is forced: 241 !forcing_type = 0 ==> forcing_les = .true. 242 ! initial profiles from file prof.inp.001 243 ! no forcing by LS convergence ; 244 ! surface temperature imposed ; 245 ! radiative cooling may be imposed (iflag_radia=0 in physiq.def) 246 !forcing_type = 1 ==> forcing_radconv = .true. 247 ! idem forcing_type = 0, but the imposed radiative cooling 248 ! is set to 0 (hence, if iflag_radia=0 in physiq.def, 249 ! then there is no radiative cooling at all) 250 !forcing_type = 2 ==> forcing_toga = .true. 251 ! initial profiles from TOGA-COARE IFA files 252 ! LS convergence and SST imposed from TOGA-COARE IFA files 253 !forcing_type = 3 ==> forcing_GCM2SCM = .true. 254 ! initial profiles from the GCM output 255 ! LS convergence imposed from the GCM output 256 !forcing_type = 4 ==> forcing_twpice = .true. 257 ! initial profiles from TWP-ICE cdf file 258 ! LS convergence, omega and SST imposed from TWP-ICE files 259 !forcing_type = 5 ==> forcing_rico = .true. 260 ! initial profiles from RICO files 261 ! LS convergence imposed from RICO files 262 !forcing_type = 6 ==> forcing_amma = .true. 263 ! initial profiles from AMMA nc file 264 ! LS convergence, omega and surface fluxes imposed from AMMA file 265 !forcing_type = 40 ==> forcing_GCSSold = .true. 266 ! initial profile from GCSS file 267 ! LS convergence imposed from GCSS file 268 !forcing_type = 50 ==> forcing_fire = .true. 269 ! forcing from fire.nc 270 !forcing_type = 59 ==> forcing_sandu = .true. 271 ! initial profiles from sanduref file: see prof.inp.001 272 ! SST varying with time and divergence constante: see ifa_sanduref.txt file 273 ! Radiation has to be computed interactively 274 !forcing_type = 60 ==> forcing_astex = .true. 275 ! initial profiles from file: see prof.inp.001 276 ! SST,divergence,ug,vg,ufa,vfa varying with time : see ifa_astex.txt file 277 ! Radiation has to be computed interactively 278 !forcing_type = 61 ==> forcing_armcu = .true. 279 ! initial profiles from file: see prof.inp.001 280 ! sensible and latent heat flux imposed: see ifa_arm_cu_1.txt 281 ! large scale advective forcing & radiative tendencies applied below 1000m: see ifa_arm_cu_2.txt 282 ! use geostrophic wind ug=10m/s vg=0m/s. Duration of the case 53100s 283 ! Radiation to be switched off 284 ! 285 if (forcing_type .eq.0) THEN 286 forcing_les = .true. 287 elseif (forcing_type .eq.1) THEN 288 forcing_radconv = .true. 289 elseif (forcing_type .eq.2) THEN 290 forcing_toga = .true. 291 elseif (forcing_type .eq.3) THEN 292 forcing_GCM2SCM = .true. 293 elseif (forcing_type .eq.4) THEN 294 forcing_twpice = .true. 295 elseif (forcing_type .eq.5) THEN 296 forcing_rico = .true. 297 elseif (forcing_type .eq.6) THEN 298 forcing_amma = .true. 299 elseif (forcing_type .eq.40) THEN 300 forcing_GCSSold = .true. 301 elseif (forcing_type .eq.50) THEN 302 forcing_fire = .true. 303 elseif (forcing_type .eq.59) THEN 304 forcing_sandu = .true. 305 elseif (forcing_type .eq.60) THEN 306 forcing_astex = .true. 307 elseif (forcing_type .eq.61) THEN 308 forcing_armcu = .true. 309 IF(llm.NE.19.AND.llm.NE.40) stop 'Erreur nombre de niveaux !!' 310 else 311 write (*,*) 'ERROR : unknown forcing_type ', forcing_type 312 stop 'Forcing_type should be 0,1,2,3,4,5,6 or 40,59,60,61' 313 ENDIF 314 print*,"forcing type=",forcing_type 315 316 ! if type_ts_forcing=0, the surface temp of 1D simulation is constant in time 317 ! (specified by tsurf in lmdz1d.def); if type_ts_forcing=1, the surface temperature 318 ! varies in time according to a forcing (e.g. forcing_toga) and is passed to read_tsurf1d.F 319 ! through the common sst_forcing. 320 321 type_ts_forcing = 0 322 if (forcing_toga.or.forcing_sandu.or.forcing_astex) & 323 & type_ts_forcing = 1 324 325 !--------------------------------------------------------------------- 326 ! Definition of the run 327 !--------------------------------------------------------------------- 328 329 call conf_gcm( 99, .TRUE. , clesphy0 ) 330 !----------------------------------------------------------------------- 331 ! Choix du calendrier 332 ! ------------------- 333 334 ! calend = 'earth_365d' 335 if (calend == 'earth_360d') then 336 call ioconf_calendar('360d') 337 write(*,*)'CALENDRIER CHOISI: Terrestre a 360 jours/an' 338 else if (calend == 'earth_365d') then 339 call ioconf_calendar('noleap') 340 write(*,*)'CALENDRIER CHOISI: Terrestre a 365 jours/an' 341 else if (calend == 'earth_366d') then 342 call ioconf_calendar('all_leap') 343 write(*,*)'CALENDRIER CHOISI: Terrestre bissextile' 344 else if (calend == 'gregorian') then 345 call ioconf_calendar('gregorian') ! not to be used by normal users 346 write(*,*)'CALENDRIER CHOISI: Gregorien' 347 else 348 write (*,*) 'ERROR : unknown calendar ', calend 349 stop 'calend should be 360d,earth_365d,earth_366d,gregorian' 350 endif 351 !----------------------------------------------------------------------- 352 ! 353 !c Date : 354 ! La date est supposee donnee sous la forme [annee, numero du jour dans 355 ! l annee] ; l heure est donnee dans time_ini, lu dans lmdz1d.def. 356 ! On appelle ymds2ju pour convertir [annee, jour] en [jour Julien]. 357 ! Le numero du jour est dans "day". L heure est traitee separement. 358 ! La date complete est dans "daytime" (l'unite est le jour). 359 if (nday>0) then 360 fnday=nday 361 else 362 fnday=-nday/float(day_step) 363 endif 364 365 ! Special case for arm_cu which lasts less than one day : 53100s !! (MPL 20111026) 366 IF(forcing_type .EQ. 61) fnday=53100./86400. 367 ! Special case for amma which lasts less than one day : 64800s !! (MPL 20120216) 368 IF(forcing_type .EQ. 6) fnday=64800./86400. 369 annee_ref = anneeref 370 mois = 1 371 day_ref = dayref 372 heure = 0. 373 itau_dyn = 0 374 itau_phy = 0 375 call ymds2ju(annee_ref,mois,day_ref,heure,day) 376 day_ini = int(day) 377 day_end = day_ini + fnday 378 379 IF (forcing_type .eq.2) THEN 380 ! Convert the initial date of Toga-Coare to Julian day 381 call ymds2ju & 382 & (year_ini_toga,mth_ini_toga,day_ini_toga,heure,day_ju_ini_toga) 383 384 ELSEIF (forcing_type .eq.4) THEN 385 ! Convert the initial date of TWPICE to Julian day 386 call ymds2ju & 387 & (year_ini_twpi,mth_ini_twpi,day_ini_twpi,heure_ini_twpi & 388 & ,day_ju_ini_twpi) 389 ELSEIF (forcing_type .eq.6) THEN 390 ! Convert the initial date of AMMA to Julian day 391 call ymds2ju & 392 & (year_ini_amma,mth_ini_amma,day_ini_amma,heure_ini_amma & 393 & ,day_ju_ini_amma) 394 395 ELSEIF (forcing_type .eq.59) THEN 396 ! Convert the initial date of Sandu case to Julian day 397 call ymds2ju & 398 & (year_ini_sandu,mth_ini_sandu,day_ini_sandu, & 399 & time_ini*3600.,day_ju_ini_sandu) 400 401 ELSEIF (forcing_type .eq.60) THEN 402 ! Convert the initial date of Astex case to Julian day 403 call ymds2ju & 404 & (year_ini_astex,mth_ini_astex,day_ini_astex, & 405 & time_ini*3600.,day_ju_ini_astex) 406 407 ELSEIF (forcing_type .eq.61) THEN 408 409 ! Convert the initial date of Arm_cu case to Julian day 410 call ymds2ju & 411 & (year_ini_armcu,mth_ini_armcu,day_ini_armcu,heure_ini_armcu & 412 & ,day_ju_ini_armcu) 413 ENDIF 414 415 daytime = day + time_ini/24. ! 1st day and initial time of the simulation 416 ! Print out the actual date of the beginning of the simulation : 417 call ju2ymds(daytime,year_print, month_print,day_print,sec_print) 418 print *,' Time of beginning : ', & 419 & year_print, month_print, day_print, sec_print 420 421 !--------------------------------------------------------------------- 422 ! Initialization of dimensions, geometry and initial state 423 !--------------------------------------------------------------------- 424 call init_phys_lmdz(1,1,llm,1,(/1/)) 425 call suphel 426 call initcomgeomphy 427 call infotrac_init 428 429 if (nqtot>nqmx) STOP'Augmenter nqmx dans lmdz1d.F' 430 allocate(q(llm,nqtot)) ; q(:,:)=0. 431 allocate(dq(llm,nqtot)) 432 allocate(dq_dyn(llm,nqtot)) 433 allocate(d_q_adv(llm,nqtot)) 434 ! allocate(d_th_adv(llm)) 435 436 ! 437 ! No ozone climatology need be read in this pre-initialization 438 ! (phys_state_var_init is called again in physiq) 439 read_climoz = 0 440 ! 441 call phys_state_var_init(read_climoz) 442 443 if (ngrid.ne.klon) then 444 print*,'stop in inifis' 445 print*,'Probleme de dimensions :' 446 print*,'ngrid = ',ngrid 447 print*,'klon = ',klon 448 stop 449 endif 450 !!!===================================================================== 451 !!! Feedback forcing values for Gateaux differentiation (al1) 452 !!!===================================================================== 453 !!! Surface Planck forcing bracketing call radiation 454 !! surf_Planck = 0. 455 !! surf_Conv = 0. 456 !! write(*,*) 'Gateaux-dif Planck,Conv:',surf_Planck,surf_Conv 457 !!! a mettre dans le lmdz1d.def ou autre 458 !! 459 !! 460 qsol = qsolinp 461 qsurf = fq_sat(tsurf,psurf/100.) 462 rlat=xlat 463 rlon=xlon 464 day1= day_ini 465 time=daytime-day 466 ts_toga(1)=tsurf ! needed by read_tsurf1d.F 467 rho(1)=psurf/(rd*tsurf*(1.+(rv/rd-1.)*qsurf)) 468 469 ! 470 !! mpl et jyg le 22/08/2012 : 471 !! pour que les cas a flux de surface imposes marchent 472 IF(.NOT.ok_flux_surf.or.max(abs(wtsurf),abs(wqsurf))>0.) THEN 473 fsens=-wtsurf*rcpd*rho(1) 474 flat=-wqsurf*rlvtt*rho(1) 475 print *,'Flux: ok_flux wtsurf wqsurf',ok_flux_surf,wtsurf,wqsurf 476 ENDIF 477 print*,'Flux sol ',fsens,flat 478 !! ok_flux_surf=.false. 479 !! fsens=-wtsurf*rcpd*rho(1) 480 !! flat=-wqsurf*rlvtt*rho(1) 481 !!!! 482 483 ! Vertical discretization and pressure levels at half and mid levels: 484 485 pa = 5e4 486 !! preff= 1.01325e5 487 preff = psurf 488 IF (ok_old_disvert) THEN 489 call disvert0(pa,preff,ap,bp,dpres,presnivs,nivsigs,nivsig) 490 print *,'On utilise disvert0' 491 ELSE 492 call disvert(pa,preff,ap,bp,dpres,presnivs,nivsigs,nivsig, & 493 & scaleheight) 494 print *,'On utilise disvert' 495 ! Nouvelle version disvert permettant d imposer ap,bp (modif L.Guez) MPL 18092012 496 ! Dans ce cas, on lit ap,bp dans le fichier hybrid.txt 497 ENDIF 498 sig_s=presnivs/preff 499 plev =ap+bp*psurf 500 play = 0.5*(plev(1:llm)+plev(2:llm+1)) 501 !cc zlay=-rd*300.*log(play/psurf)/rg ! moved after reading profiles 502 503 IF (forcing_type .eq. 59) THEN 504 ! pour forcing_sandu, on cherche l'indice le plus proche de 700hpa#3000m 505 write(*,*) '***********************' 506 do l = 1, llm 507 write(*,*) 'l,play(l),presnivs(l): ',l,play(l),presnivs(l) 508 if (trouve_700 .and. play(l).le.70000) then 509 llm700=l 510 print *,'llm700,play=',llm700,play(l)/100. 511 trouve_700= .false. 512 endif 513 enddo 514 write(*,*) '***********************' 515 ENDIF 516 517 ! 518 !===================================================================== 519 ! EVENTUALLY, READ FORCING DATA : 520 !===================================================================== 521 522 #include "1D_read_forc_cases.h" 523 524 if (forcing_GCM2SCM) then 525 write (*,*) 'forcing_GCM2SCM not yet implemented' 526 stop 'in initialization' 527 endif ! forcing_GCM2SCM 528 529 print*,'mxcalc=',mxcalc 530 print*,'zlay=',zlay(mxcalc) 531 print*,'play=',play(mxcalc) 532 533 !Al1 pour SST forced, appellé depuis ocean_forced_noice 534 ts_cur = tsurf ! SST used in read_tsurf1d 535 !===================================================================== 536 ! Initialisation de la physique : 537 !===================================================================== 538 539 ! Rq: conf_phys.F90 lit tous les flags de physiq.def; conf_phys appele depuis physiq.F 540 ! 541 ! day_step, iphysiq lus dans gcm.def ci-dessus 542 ! timestep: calcule ci-dessous from rday et day_step 543 ! ngrid=1 544 ! llm: defini dans .../modipsl/modeles/LMDZ4/libf/grid/dimension 545 ! rday: defini dans suphel.F (86400.) 546 ! day_ini: lu dans run.def (dayref) 547 ! rlat_rad,rlon-rad: transformes en radian de rlat,rlon lus dans lmdz1d.def (en degres) 548 ! airefi,zcufi,zcvfi initialises au debut de ce programme 549 ! rday,ra,rg,rd,rcpd declares dans YOMCST.h et calcules dans suphel.F 550 day_step = float(nsplit_phys)*day_step/float(iphysiq) 551 write (*,*) 'Time step divided by nsplit_phys (=',nsplit_phys,')' 552 timestep =rday/day_step 553 dtime_frcg = timestep 554 ! 555 zcufi=airefi 556 zcvfi=airefi 557 ! 558 rlat_rad(:)=rlat(:)*rpi/180. 559 rlon_rad(:)=rlon(:)*rpi/180. 560 561 call iniphysiq(ngrid,llm,rday,day_ini,timestep, & 562 & rlat_rad,rlon_rad,airefi,zcufi,zcvfi,ra,rg,rd,rcpd,(/1/)) 563 print*,'apres iniphysiq' 564 565 ! 2 PARAMETRES QUI DEVRAIENT ETRE LUS DANS run.def MAIS NE LE SONT PAS ICI: 566 co2_ppm= 330.0 567 solaire=1370.0 568 569 ! Ecriture du startphy avant le premier appel a la physique. 570 ! On le met juste avant pour avoir acces a tous les champs 571 ! NB: les clesphy0 seront remplies dans phyredem d'apres les flags lus dans gcm.def 572 573 if (ok_writedem) then 574 575 !-------------------------------------------------------------------------- 576 ! pbl_surface_init (called here) and pbl_surface_final (called by phyredem) 577 ! need : qsol fder snow qsurf evap rugos agesno ftsoil 578 !-------------------------------------------------------------------------- 579 580 type_ocean = "force" 581 run_off_lic_0(1) = restart_runoff 582 call fonte_neige_init(run_off_lic_0) 583 584 fder=0. 585 snsrf(1,:)=0. ! couverture de neige des sous surface 586 qsurfsrf(1,:)=qsurf ! humidite de l'air des sous surface 587 evap=0. 588 frugs(1,:)=rugos ! couverture de neige des sous surface 589 agesno = xagesno 590 tsoil(:,:,:)=tsurf 591 !------ AMMA 2e run avec modele sol et rayonnement actif (MPL 23052012) 592 ! tsoil(1,1,1)=299.18 593 ! tsoil(1,2,1)=300.08 594 ! tsoil(1,3,1)=301.88 595 ! tsoil(1,4,1)=305.48 596 ! tsoil(1,5,1)=308.00 597 ! tsoil(1,6,1)=308.00 598 ! tsoil(1,7,1)=308.00 599 ! tsoil(1,8,1)=308.00 600 ! tsoil(1,9,1)=308.00 601 ! tsoil(1,10,1)=308.00 602 ! tsoil(1,11,1)=308.00 603 !----------------------------------------------------------------------- 604 call pbl_surface_init(qsol, fder, snsrf, qsurfsrf, & 605 & evap, frugs, agesno, tsoil) 606 607 !------------------ prepare limit conditions for limit.nc ----------------- 608 !-- Ocean force 609 610 print*,'avant phyredem' 611 pctsrf(1,:)=0. 612 if (nat_surf.eq.0.) then 613 pctsrf(1,is_oce)=1. 614 pctsrf(1,is_ter)=0. 615 else 616 pctsrf(1,is_oce)=0. 617 pctsrf(1,is_ter)=1. 618 end if 619 620 print*,'nat_surf,pctsrf(1,is_oce),pctsrf(1,is_ter)',nat_surf & 621 & ,pctsrf(1,is_oce),pctsrf(1,is_ter) 622 623 zmasq=pctsrf(1,is_ter)+pctsrf(1,is_lic) 624 zpic = zpicinp 625 ftsol=tsurf 626 falb1 = albedo 627 falb2 = albedo 628 rugoro=rugos 629 t_ancien(1,:)=temp(:) 630 q_ancien(1,:)=q(:,1) 631 pbl_tke=1.e-8 632 633 rain_fall=0. 634 snow_fall=0. 635 solsw=0. 636 sollw=0. 637 radsol=0. 638 rnebcon=0. 639 ratqs=0. 640 clwcon=0. 641 zmea=0. 642 zstd=0. 643 zsig=0. 644 zgam=0. 645 zval=0. 646 zthe=0. 647 sig1=0. 648 w01=0. 649 u_ancien(1,:)=u(:) 650 v_ancien(1,:)=v(:) 651 652 !------------------------------------------------------------------------ 653 ! Make file containing restart for the physics (startphy.nc) 654 ! 655 ! NB: List of the variables to be written by phyredem (via put_field): 656 ! rlon,rlat,zmasq,pctsrf(:,is_ter),pctsrf(:,is_lic),pctsrf(:,is_oce) 657 ! pctsrf(:,is_sic),ftsol(:,nsrf),tsoil(:,isoil,nsrf),qsurf(:,nsrf) 658 ! qsol,falb1(:,nsrf),falb2(:,nsrf),evap(:,nsrf),snow(:,nsrf) 659 ! radsol,solsw,sollw,fder,rain_fall,snow_fall,frugs(:,nsrf) 660 ! agesno(:,nsrf),zmea,zstd,zsig,zgam,zthe,zpic,zval,rugoro 661 ! t_ancien,q_ancien,frugs(:,is_oce),clwcon(:,1),rnebcon(:,1),ratqs(:,1) 662 ! run_off_lic_0,pbl_tke(:,1:klev,nsrf),zmax0,f0,sig1,w01 663 ! wake_deltat,wake_deltaq,wake_s,wake_cstar,wake_fip 664 !------------------------------------------------------------------------ 665 !Al1 =============== restart option ========================== 666 if (.not.restart) then 667 call phyredem ("startphy.nc") 668 else 669 ! (desallocations) 670 print*,'callin surf final' 671 call pbl_surface_final(qsol, fder, snsrf, qsurfsrf, & 672 & evap, frugs, agesno, tsoil) 673 print*,'after surf final' 674 CALL fonte_neige_final(run_off_lic_0) 675 endif 676 677 ok_writedem=.false. 678 print*,'apres phyredem' 679 680 endif ! ok_writedem 681 682 !------------------------------------------------------------------------ 683 ! Make file containing boundary conditions (limit.nc) **Al1->restartdyn*** 684 ! -------------------------------------------------- 685 ! NB: List of the variables to be written in limit.nc 686 ! (by writelim.F, subroutine of 1DUTILS.h): 687 ! phy_nat,phy_alb,phy_sst,phy_bil,phy_rug,phy_ice, 688 ! phy_fter,phy_foce,phy_flic,phy_fsic) 689 !------------------------------------------------------------------------ 690 do i=1,yd 691 phy_nat(i) = nat_surf 692 phy_alb(i) = albedo 693 phy_sst(i) = tsurf ! read_tsurf1d will be used instead 694 phy_rug(i) = rugos 695 phy_fter(i) = pctsrf(1,is_ter) 696 phy_foce(i) = pctsrf(1,is_oce) 697 phy_fsic(i) = pctsrf(1,is_sic) 698 phy_flic(i) = pctsrf(1,is_lic) 699 enddo 700 701 ! fabrication de limit.nc 702 call writelim (1,phy_nat,phy_alb,phy_sst,phy_bil,phy_rug, & 703 & phy_ice,phy_fter,phy_foce,phy_flic,phy_fsic) 704 705 706 call phys_state_var_end 707 !Al1 708 if (restart) then 709 print*,'call to restart dyn 1d' 710 Call dyn1deta0("start1dyn.nc",plev,play,phi,phis,presnivs, & 711 & u,v,temp,q,omega2) 712 713 print*,'fnday,annee_ref,day_ref,day_ini', & 714 & fnday,annee_ref,day_ref,day_ini 715 !** call ymds2ju(annee_ref,mois,day_ini,heure,day) 716 day = day_ini 717 day_end = day_ini + nday 718 daytime = day + time_ini/24. ! 1st day and initial time of the simulation 719 720 ! Print out the actual date of the beginning of the simulation : 721 call ju2ymds(daytime, an, mois, jour, heure) 722 print *,' Time of beginning : y m d h',an, mois,jour,heure/3600. 723 724 day = int(daytime) 725 time=daytime-day 726 727 print*,'****** intialised fields from restart1dyn *******' 728 print*,'plev,play,phi,phis,presnivs,u,v,temp,q,omega2' 729 print*,'temp(1),q(1,1),u(1),v(1),plev(1),phis :' 730 print*,temp(1),q(1,1),u(1),v(1),plev(1),phis 731 ! raz for safety 732 do l=1,llm 733 dq_dyn(l,1) = 0. 734 enddo 735 endif 736 !Al1 ================ end restart ================================= 737 IF (ecrit_slab_oc.eq.1) then 738 open(97,file='div_slab.dat',STATUS='UNKNOWN') 739 elseif (ecrit_slab_oc.eq.0) then 740 open(97,file='div_slab.dat',STATUS='OLD') 741 endif 742 !===================================================================== 743 ! START OF THE TEMPORAL LOOP : 744 !===================================================================== 745 746 do while(it.le.nint(fnday*day_step)) 747 748 if (prt_level.ge.1) then 749 print*,'XXXXXXXXXXXXXXXXXXX ITAP,day,time=', & 750 & it,day,time,nint(fnday*day_step) 751 print*,'PAS DE TEMPS ',timestep 752 endif 753 !Al1 demande de restartphy.nc 754 if (it.eq.nint(fnday*day_step)) lastcall=.True. 755 756 !--------------------------------------------------------------------- 757 ! Interpolation of forcings in time and onto model levels 758 !--------------------------------------------------------------------- 759 760 #include "1D_interp_cases.h" 761 762 if (forcing_GCM2SCM) then 763 write (*,*) 'forcing_GCM2SCM not yet implemented' 764 stop 'in time loop' 765 endif ! forcing_GCM2SCM 766 767 !--------------------------------------------------------------------- 768 ! Geopotential : 769 !--------------------------------------------------------------------- 770 771 phi(1)=RD*temp(1)*(plev(1)-play(1))/(.5*(plev(1)+play(1))) 772 do l = 1, llm-1 773 phi(l+1)=phi(l)+RD*(temp(l)+temp(l+1))* & 774 & (play(l)-play(l+1))/(play(l)+play(l+1)) 775 enddo 776 777 !--------------------------------------------------------------------- 778 ! Listing output for debug prt_level>=1 779 !--------------------------------------------------------------------- 780 if (prt_level>=1) then 781 print *,' avant physiq : -------- day time ',day,time 782 write(*,*) 'firstcall,lastcall,phis', & 783 & firstcall,lastcall,phis 784 write(*,'(a10,2a4,4a13)') 'BEFOR1 IT=','it','l', & 785 & 'presniv','plev','play','phi' 786 write(*,'(a10,2i4,4f13.2)') ('BEFOR1 IT= ',it,l, & 787 & presnivs(l),plev(l),play(l),phi(l),l=1,llm) 788 write(*,'(a11,2a4,a11,6a8)') 'BEFOR2','it','l', & 789 & 'presniv','u','v','temp','q1','q2','omega2' 790 write(*,'(a11,2i4,f11.2,5f8.2,e10.2)') ('BEFOR2 IT= ',it,l, & 791 & presnivs(l),u(l),v(l),temp(l),q(l,1),q(l,2),omega2(l),l=1,llm) 792 endif 793 794 !--------------------------------------------------------------------- 795 ! Call physiq : 796 !--------------------------------------------------------------------- 797 798 call physiq(ngrid,llm, & 799 & firstcall,lastcall, & 800 & day,time,timestep, & 801 & plev,play,phi,phis,presnivs,clesphy0, & 802 & u,v,temp,q,omega2, & 803 & du_phys,dv_phys,dt_phys,dq,dpsrf, & 804 & dudyn,PVteta) 805 firstcall=.false. 806 807 !--------------------------------------------------------------------- 808 ! Listing output for debug prt_level>=1 809 !--------------------------------------------------------------------- 810 if (prt_level>=1) then 811 write(*,'(a11,2a4,4a13)') 'AFTER1 IT=','it','l', & 812 & 'presniv','plev','play','phi' 813 write(*,'(a11,2i4,4f13.2)') ('AFTER1 it= ',it,l, & 814 & presnivs(l),plev(l),play(l),phi(l),l=1,llm) 815 write(*,'(a11,2a4,a11,6a8)') 'AFTER2','it','l', & 816 & 'presniv','u','v','temp','q1','q2','omega2' 817 write(*,'(a11,2i4,f11.2,5f8.2,e10.2)') ('AFTER2 it= ',it,l, & 818 & presnivs(l),u(l),v(l),temp(l),q(l,1),q(l,2),omega2(l),l=1,llm) 819 write(*,'(a11,2a4,a11,5a8)') 'AFTER3','it','l', & 820 & 'presniv','du_phys','dv_phys','dt_phys','dq1','dq2' 821 write(*,'(a11,2i4,f11.2,5f8.2)') ('AFTER3 it= ',it,l, & 822 & presnivs(l),86400*du_phys(l),86400*dv_phys(l), & 823 & 86400*dt_phys(l),86400*dq(l,1),dq(l,2),l=1,llm) 824 write(*,*) 'dpsrf',dpsrf 825 endif 826 !--------------------------------------------------------------------- 827 ! Add physical tendencies : 828 !--------------------------------------------------------------------- 829 830 fcoriolis=2.*sin(rpi*xlat/180.)*romega 831 if (forcing_radconv .or. forcing_fire) then 832 fcoriolis=0.0 833 dt_cooling=0.0 834 d_th_adv=0.0 835 d_q_adv=0.0 836 endif 837 838 if (forcing_toga .or. forcing_GCSSold .or. forcing_twpice & 839 & .or.forcing_amma) then 840 fcoriolis=0.0 ; ug=0. ; vg=0. 841 endif 842 if(forcing_rico) then 843 dt_cooling=0. 844 endif 845 846 print*, 'fcoriolis ', fcoriolis, xlat 847 848 du_age(1:mxcalc)=fcoriolis*(v(1:mxcalc)-vg(1:mxcalc)) 849 dv_age(1:mxcalc)=-fcoriolis*(u(1:mxcalc)-ug(1:mxcalc)) 850 851 !!!!!!!!!!!!!!!!!!!!!!!! 852 ! Geostrophic wind 853 !!!!!!!!!!!!!!!!!!!!!!!! 854 sfdt = sin(0.5*fcoriolis*timestep) 855 cfdt = cos(0.5*fcoriolis*timestep) 856 ! 857 du_age(1:mxcalc)= -2.*sfdt/timestep* & 858 & (sfdt*(u(1:mxcalc)-ug(1:mxcalc)) - & 859 & cfdt*(v(1:mxcalc)-vg(1:mxcalc)) ) 860 !! : fcoriolis*(v(1:mxcalc)-vg(1:mxcalc)) 861 ! 862 dv_age(1:mxcalc)= -2.*sfdt/timestep* & 863 & (cfdt*(u(1:mxcalc)-ug(1:mxcalc)) + & 864 & sfdt*(v(1:mxcalc)-vg(1:mxcalc)) ) 865 !! : -fcoriolis*(u(1:mxcalc)-ug(1:mxcalc)) 866 ! 867 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 868 ! call writefield_phy('dv_age' ,dv_age,llm) 869 ! call writefield_phy('du_age' ,du_age,llm) 870 ! call writefield_phy('du_phys' ,du_phys,llm) 871 ! call writefield_phy('u_tend' ,u,llm) 872 ! call writefield_phy('u_g' ,ug,llm) 873 ! 874 !!!!!!!!!!!!!!!!!!!!!!!!!!!!! 875 !! Increment state variables 876 !!!!!!!!!!!!!!!!!!!!!!!!!!!!! 877 ! pour les cas sandu et astex, on reclacule u,v,q,temp et teta dans 1D_nudge_sandu_astex.h 878 ! au dessus de 700hpa, on relaxe vers les profils initiaux 879 if (forcing_sandu .OR. forcing_astex) then 880 #include "1D_nudge_sandu_astex.h" 881 else 882 u(1:mxcalc)=u(1:mxcalc) + timestep*( & 883 & du_phys(1:mxcalc) & 884 & +du_age(1:mxcalc) ) 885 v(1:mxcalc)=v(1:mxcalc) + timestep*( & 886 & dv_phys(1:mxcalc) & 887 & +dv_age(1:mxcalc) ) 888 q(1:mxcalc,:)=q(1:mxcalc,:)+timestep*( & 889 & dq(1:mxcalc,:) & 890 & +d_q_adv(1:mxcalc,:) ) 891 892 if (prt_level.ge.1) then 893 print *, & 894 & 'physiq-> temp(1),dt_phys(1),d_th_adv(1),dt_cooling(1) ', & 895 & temp(1),dt_phys(1),d_th_adv(1),dt_cooling(1) 896 print*,du_phys 897 print*, v 898 print*, vg 899 endif 900 901 temp(1:mxcalc)=temp(1:mxcalc)+timestep*( & 902 & dt_phys(1:mxcalc) & 903 & +d_th_adv(1:mxcalc) & 904 & +dt_cooling(1:mxcalc)) ! Taux de chauffage ou refroid. 905 906 endif ! forcing_sandu or forcing_astex 907 908 teta=temp*(pzero/play)**rkappa 909 ! 910 !--------------------------------------------------------------------- 911 ! Nudge soil temperature if requested 912 !--------------------------------------------------------------------- 913 914 IF (nudge_tsoil) THEN 915 ftsoil(1,isoil_nudge,:) = ftsoil(1,isoil_nudge,:) & 916 & -timestep/tau_soil_nudge*(ftsoil(1,isoil_nudge,:)-Tsoil_nudge) 917 ENDIF 918 919 !--------------------------------------------------------------------- 920 ! Add large-scale tendencies (advection, etc) : 921 !--------------------------------------------------------------------- 922 923 !cc nrlmd 924 !cc tmpvar=teta 925 !cc call advect_vert(llm,omega,timestep,tmpvar,plev) 926 !cc 927 !cc teta(1:mxcalc)=tmpvar(1:mxcalc) 928 !cc tmpvar(:)=q(:,1) 929 !cc call advect_vert(llm,omega,timestep,tmpvar,plev) 930 !cc q(1:mxcalc,1)=tmpvar(1:mxcalc) 931 !cc tmpvar(:)=q(:,2) 932 !cc call advect_vert(llm,omega,timestep,tmpvar,plev) 933 !cc q(1:mxcalc,2)=tmpvar(1:mxcalc) 934 935 !--------------------------------------------------------------------- 936 ! Air temperature : 937 !--------------------------------------------------------------------- 938 if (lastcall) then 939 print*,'Pas de temps final ',it 940 call ju2ymds(daytime, an, mois, jour, heure) 941 print*,'a la date : a m j h',an, mois, jour ,heure/3600. 942 endif 943 944 ! incremente day time 945 ! print*,'daytime bef',daytime,1./day_step 946 daytime = daytime+1./day_step 947 !Al1dbg 948 day = int(daytime+0.1/day_step) 949 ! time = max(daytime-day,0.0) 950 !Al1&jyg: correction de bug 951 !cc time = real(mod(it,day_step))/day_step 952 time = time_ini/24.+real(mod(it,day_step))/day_step 953 ! print*,'daytime nxt time',daytime,time 954 it=it+1 955 956 enddo 957 958 !Al1 959 if (ecrit_slab_oc.ne.-1) close(97) 960 961 !Al1 Call to 1D equivalent of dynredem (an,mois,jour,heure ?) 962 ! ------------------------------------- 963 call dyn1dredem("restart1dyn.nc", & 964 & plev,play,phi,phis,presnivs, & 965 & u,v,temp,q,omega2) 966 967 CALL abort_gcm ('lmdz1d ','The End ',0) 968 969 end 970 971 #include "1DUTILS.h" 972 #include "1Dconv.h" 973 974
Note: See TracChangeset
for help on using the changeset viewer.