Changeset 1140 for LMDZ4/branches/LMDZ4-dev/libf/dyn3dpar
- Timestamp:
- Mar 30, 2009, 4:46:54 PM (16 years ago)
- Location:
- LMDZ4/branches/LMDZ4-dev/libf/dyn3dpar
- Files:
-
- 2 added
- 3 deleted
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ4/branches/LMDZ4-dev/libf/dyn3dpar/comdissip.h
r774 r1140 2 2 ! $Header$ 3 3 ! 4 c-----------------------------------------------------------------------5 c INCLUDEdissip.h4 !----------------------------------------------------------------------- 5 ! INCLUDE comdissip.h 6 6 7 COMMON/comdissip/ 8 $ lstardis,niterdis,coefdis,tetavel,tetatemp,gamdissip7 COMMON/comdissip/ & 8 & niterdis,coefdis,tetavel,tetatemp,gamdissip 9 9 10 10 11 LOGICAL lstardis12 11 INTEGER niterdis 13 12 14 13 REAL tetavel,tetatemp,coefdis,gamdissip 15 14 16 c-----------------------------------------------------------------------15 !----------------------------------------------------------------------- -
LMDZ4/branches/LMDZ4-dev/libf/dyn3dpar/conf_gcm.F
r1111 r1140 6 6 SUBROUTINE conf_gcm( tapedef, etatinit, clesphy0 ) 7 7 c 8 #ifdef CPP_IOIPSL 8 9 use IOIPSL 10 #else 11 ! if not using IOIPSL, we still need to use (a local version of) getin 12 use ioipsl_getincom 13 #endif 9 14 use misc_mod 10 15 use mod_filtre_fft, ONLY : use_filtre_fft … … 99 104 100 105 !Config Key = prt_level 101 !Config Desc = niveau d'impressions de d �bogage102 !Config Def = 0 103 !Config Help = Niveau d'impression pour le d �bogage106 !Config Desc = niveau d'impressions de débogage 107 !Config Def = 0 108 !Config Help = Niveau d'impression pour le débogage 104 109 !Config (0 = minimum d'impression) 105 110 prt_level = 0 … … 109 114 c Parametres de controle du run: 110 115 c----------------------------------------------------------------------- 116 !Config Key = planet_type 117 !Config Desc = planet type ("earth", "mars", "venus", ...) 118 !Config Def = earth 119 !Config Help = this flag sets the type of atymosphere that is considered 120 planet_type="earth" 121 CALL getin('planet_type',planet_type) 111 122 112 123 !Config Key = dayref … … 189 200 CALL getin('periodav',periodav) 190 201 202 !Config Key = output_grads_dyn 203 !Config Desc = output dynamics diagnostics in 'dyn.dat' file 204 !Config Def = n 205 !Config Help = output dynamics diagnostics in Grads-readable 'dyn.dat' file 206 output_grads_dyn=.false. 207 CALL getin('output_grads_dyn',output_grads_dyn) 208 191 209 !Config Key = idissip 192 210 !Config Desc = periode de la dissipation … … 284 302 c ............................................................... 285 303 304 !Config Key = read_start 305 !Config Desc = Initialize model using a 'start.nc' file 306 !Config Def = y 307 !Config Help = y: intialize dynamical fields using a 'start.nc' file 308 ! n: fields are initialized by 'iniacademic' routine 309 read_start= .true. 310 CALL getin('read_start',read_start) 311 286 312 !Config Key = iflag_phys 287 313 !Config Desc = Avec ls physique … … 341 367 c 342 368 IF( ABS(clat - clatt).GE. 0.001 ) THEN 343 PRINT *,' La valeur de clat passee par run.def est differente de344 *celle lue sur le fichier start '369 write(lunout,*)'conf_gcm: La valeur de clat passee par run.def', 370 & ' est differente de celle lue sur le fichier start ' 345 371 STOP 346 372 ENDIF … … 356 382 357 383 IF( ABS(grossismx - grossismxx).GE. 0.001 ) THEN 358 PRINT *,' La valeur de grossismx passee par run.def est differente359 *de celle lue sur le fichier start '384 write(lunout,*)'conf_gcm: La valeur de grossismx passee par ', 385 & 'run.def est differente de celle lue sur le fichier start ' 360 386 STOP 361 387 ENDIF … … 370 396 371 397 IF( ABS(grossismy - grossismyy).GE. 0.001 ) THEN 372 PRINT *,' La valeur de grossismy passee par run.def est differen373 *te de celle lue sur le fichier start '398 write(lunout,*)'conf_gcm: La valeur de grossismy passee par ', 399 & 'run.def est differente de celle lue sur le fichier start ' 374 400 STOP 375 401 ENDIF 376 402 377 403 IF( grossismx.LT.1. ) THEN 378 PRINT *,' *** ATTENTION !! grossismx < 1 . *** ' 404 write(lunout,*) 405 & 'conf_gcm: *** ATTENTION !! grossismx < 1 . *** ' 379 406 STOP 380 407 ELSE … … 384 411 385 412 IF( grossismy.LT.1. ) THEN 386 PRINT *,' *** ATTENTION !! grossismy < 1 . *** ' 413 write(lunout,*) 414 & 'conf_gcm: *** ATTENTION !! grossismy < 1 . *** ' 387 415 STOP 388 416 ELSE … … 390 418 ENDIF 391 419 392 PRINT *,' alphax alphay defrun',alphax,alphay420 write(lunout,*)'conf_gcm: alphax alphay',alphax,alphay 393 421 c 394 422 c alphax et alphay sont les anciennes formulat. des grossissements … … 405 433 406 434 IF( .NOT.fxyhypb ) THEN 407 408 PRINT *,' ******** PBS DANS DEFRUN******** '409 PRINT *,' *** fxyhypb lu sur le fichier start est F',410 * ' alors qu il est T sur run.def ***'435 IF( fxyhypbb ) THEN 436 write(lunout,*)' ******** PBS DANS CONF_GCM ******** ' 437 write(lunout,*)' *** fxyhypb lu sur le fichier start est ', 438 * 'F alors qu il est T sur run.def ***' 411 439 STOP 412 440 ENDIF 413 441 ELSE 414 415 PRINT *,' ******** PBS DANS DEFRUN******** '416 PRINT *,' *** fxyhypb lu sur le fichier start est T',417 * ' alors qu il est F sur run.def **** '442 IF( .NOT.fxyhypbb ) THEN 443 write(lunout,*)' ******** PBS DANS CONF_GCM ******** ' 444 write(lunout,*)' *** fxyhypb lu sur le fichier start est ', 445 * 'T alors qu il est F sur run.def **** ' 418 446 STOP 419 447 ENDIF 420 448 ENDIF 421 449 c … … 430 458 IF( fxyhypb ) THEN 431 459 IF( ABS(dzoomx - dzoomxx).GE. 0.001 ) THEN 432 PRINT *,' La valeur de dzoomx passee par run.def est differente433 * de celle lue sur le fichier start '460 write(lunout,*)'conf_gcm: La valeur de dzoomx passee par ', 461 * 'run.def est differente de celle lue sur le fichier start ' 434 462 STOP 435 463 ENDIF … … 446 474 IF( fxyhypb ) THEN 447 475 IF( ABS(dzoomy - dzoomyy).GE. 0.001 ) THEN 448 PRINT *,' La valeur de dzoomy passee par run.def est differente449 * de celle lue sur le fichier start '476 write(lunout,*)'conf_gcm: La valeur de dzoomy passee par ', 477 * 'run.def est differente de celle lue sur le fichier start ' 450 478 STOP 451 479 ENDIF … … 461 489 IF( fxyhypb ) THEN 462 490 IF( ABS(taux - tauxx).GE. 0.001 ) THEN 463 PRINT *,' La valeur de taux passee par run.def est differente464 * de celle lue sur le fichier start '491 write(lunout,*)'conf_gcm: La valeur de taux passee par ', 492 * 'run.def est differente de celle lue sur le fichier start ' 465 493 STOP 466 494 ENDIF … … 476 504 IF( fxyhypb ) THEN 477 505 IF( ABS(tauy - tauyy).GE. 0.001 ) THEN 478 PRINT *,' La valeur de tauy passee par run.def est differente479 * de celle lue sur le fichier start '506 write(lunout,*)'conf_gcm: La valeur de tauy passee par ', 507 * 'run.def est differente de celle lue sur le fichier start ' 480 508 STOP 481 509 ENDIF … … 495 523 496 524 IF( .NOT.ysinus ) THEN 497 IF( ysinuss ) THEN 498 PRINT *,' ******** PBS DANS DEFRUN ******** ' 499 PRINT *,' *** ysinus lu sur le fichier start est F ', 500 * 'alors qu il est T sur run.def ***' 525 IF( ysinuss ) THEN 526 write(lunout,*)' ******** PBS DANS CONF_GCM ******** ' 527 write(lunout,*)' *** ysinus lu sur le fichier start est F', 528 * ' alors qu il est T sur run.def ***' 529 STOP 530 ENDIF 531 ELSE 532 IF( .NOT.ysinuss ) THEN 533 write(lunout,*)' ******** PBS DANS CONF_GCM ******** ' 534 write(lunout,*)' *** ysinus lu sur le fichier start est T', 535 * ' alors qu il est F sur run.def **** ' 501 536 STOP 502 ENDIF 503 ELSE 504 IF( .NOT.ysinuss ) THEN 505 PRINT *,' ******** PBS DANS DEFRUN ******** ' 506 PRINT *,' *** ysinus lu sur le fichier start est T ', 507 * 'alors qu il est F sur run.def **** ' 508 STOP 509 ENDIF 537 ENDIF 510 538 ENDIF 511 ENDIF 539 ENDIF ! of IF( .NOT.fxyhypb ) 512 540 c 513 541 !Config Key = offline … … 532 560 write(lunout,*)' #########################################' 533 561 write(lunout,*)' Configuration des parametres du gcm: ' 562 write(lunout,*)' planet_type = ', planet_type 534 563 write(lunout,*)' dayref = ', dayref 535 564 write(lunout,*)' anneeref = ', anneeref … … 540 569 write(lunout,*)' iecri = ', iecri 541 570 write(lunout,*)' periodav = ', periodav 571 write(lunout,*)' output_grads_dyn = ', output_grads_dyn 542 572 write(lunout,*)' idissip = ', idissip 543 573 write(lunout,*)' lstardis = ', lstardis … … 550 580 write(lunout,*)' coefdis = ', coefdis 551 581 write(lunout,*)' purmats = ', purmats 582 write(lunout,*)' read_start = ', read_start 552 583 write(lunout,*)' iflag_phys = ', iflag_phys 553 584 write(lunout,*)' clonn = ', clonn … … 600 631 601 632 IF( grossismx.LT.1. ) THEN 602 PRINT *,' *** ATTENTION !! grossismx < 1 . *** ' 633 write(lunout,*) 634 & 'conf_gcm: *** ATTENTION !! grossismx < 1 . *** ' 603 635 STOP 604 636 ELSE … … 608 640 609 641 IF( grossismy.LT.1. ) THEN 610 PRINT *,' *** ATTENTION !! grossismy < 1 . *** ' 642 write(lunout,*) 643 & 'conf_gcm: *** ATTENTION !! grossismy < 1 . *** ' 611 644 STOP 612 645 ELSE … … 614 647 ENDIF 615 648 616 PRINT *,' alphax alphay defrun',alphax,alphay649 write(lunout,*)'conf_gcm: alphax alphay ',alphax,alphay 617 650 c 618 651 c alphax et alphay sont les anciennes formulat. des grossissements … … 697 730 write(lunout,*)"Le zoom en longitude est incompatible", 698 731 & " avec l'utilisation du filtre FFT ", 699 & "---> filtre FFT d ésactivé"732 & "---> filtre FFT désactivé " 700 733 use_filtre_fft=.FALSE. 701 734 ENDIF … … 704 737 705 738 !Config Key = use_mpi_alloc 706 !Config Desc = Utilise un buffer MPI en m �moire globale739 !Config Desc = Utilise un buffer MPI en m�moire globale 707 740 !Config Def = false 708 741 !Config Help = permet d'activer l'utilisation d'un buffer MPI 709 !Config en m �moire globale a l'aide de la fonction MPI_ALLOC.710 !Config Cela peut am �liorer la bande passante des transferts MPI742 !Config en m�moire globale a l'aide de la fonction MPI_ALLOC. 743 !Config Cela peut am�liorer la bande passante des transferts MPI 711 744 !Config d'un facteur 2 712 745 use_mpi_alloc=.FALSE. … … 716 749 !Config Desc = taille des blocs openmp 717 750 !Config Def = 1 718 !Config Help = defini la taille des packets d'it �ration openmp719 !Config distribu �e � chaque t�che lors de l'entr�e dans une720 !Config boucle parall �lis�e751 !Config Help = defini la taille des packets d'it�ration openmp 752 !Config distribu�e � chaque t�che lors de l'entr�e dans une 753 !Config boucle parall�lis�e 721 754 722 755 omp_chunk=1 … … 726 759 !Config Desc = activation de la version strato 727 760 !Config Def = .FALSE. 728 !Config Help = active la version stratosph �rique de LMDZ de F. Lott761 !Config Help = active la version stratosph�rique de LMDZ de F. Lott 729 762 730 763 ok_strato=.FALSE. … … 741 774 write(lunout,*)' #########################################' 742 775 write(lunout,*)' Configuration des parametres du gcm: ' 776 write(lunout,*)' planet_type = ', planet_type 743 777 write(lunout,*)' dayref = ', dayref 744 778 write(lunout,*)' anneeref = ', anneeref … … 749 783 write(lunout,*)' iecri = ', iecri 750 784 write(lunout,*)' periodav = ', periodav 785 write(lunout,*)' output_grads_dyn = ', output_grads_dyn 751 786 write(lunout,*)' idissip = ', idissip 752 787 write(lunout,*)' lstardis = ', lstardis … … 759 794 write(lunout,*)' coefdis = ', coefdis 760 795 write(lunout,*)' purmats = ', purmats 796 write(lunout,*)' read_start = ', read_start 761 797 write(lunout,*)' iflag_phys = ', iflag_phys 762 798 write(lunout,*)' clon = ', clon … … 764 800 write(lunout,*)' grossismx = ', grossismx 765 801 write(lunout,*)' grossismy = ', grossismy 766 write(lunout,*)' fxyhypb b = ', fxyhypbb802 write(lunout,*)' fxyhypb = ', fxyhypb 767 803 write(lunout,*)' dzoomx = ', dzoomx 768 804 write(lunout,*)' dzoomy = ', dzoomy -
LMDZ4/branches/LMDZ4-dev/libf/dyn3dpar/control.h
r985 r1140 14 14 & iperiod,iapp_tracvl,iconser,iecri,idissip,iphysiq , & 15 15 & periodav,iecrimoy,dayref,anneeref, & 16 & raz_date,offline,ip_ebil_dyn,config_inca 16 & raz_date,offline,ip_ebil_dyn,config_inca, & 17 & planet_type,output_grads_dyn 17 18 18 19 INTEGER nday,day_step,iperiod,iapp_tracvl,iconser,iecri, & … … 21 22 REAL periodav 22 23 logical offline 23 CHARACTER*4 config_inca 24 CHARACTER (len=4) :: config_inca 25 CHARACTER(len=10) :: planet_type ! planet type ('earth','mars',...) 26 LOGICAL :: output_grads_dyn ! output dynamics diagnostics in 27 ! binary grads file 'dyn.dat' (y/n) 24 28 !----------------------------------------------------------------------- -
LMDZ4/branches/LMDZ4-dev/libf/dyn3dpar/diagedyn.F
r774 r1140 58 58 #include "paramet.h" 59 59 #include "comgeom.h" 60 61 #ifdef CPP_PHYS 60 #include "iniprint.h" 61 62 #ifdef CPP_EARTH 62 63 #include "../phylmd/YOMCST.h" 63 64 #include "../phylmd/YOETHF.h" … … 139 140 140 141 141 #ifdef CPP_ PHYS142 #ifdef CPP_EARTH 142 143 c====================================================================== 143 144 C Compute Kinetic enrgy … … 314 315 C 315 316 #else 316 print*,'Pour l instant diagedyn a besoin de la physique'317 write(lunout,*),'diagedyn: Needs Earth physics to function' 317 318 #endif 319 ! #endif of #ifdef CPP_EARTH 318 320 RETURN 319 321 END -
LMDZ4/branches/LMDZ4-dev/libf/dyn3dpar/etat0_netcdf.F
r1117 r1140 5 5 c 6 6 SUBROUTINE etat0_netcdf (interbar, masque) 7 7 #ifdef CPP_EARTH 8 8 USE startvar 9 9 USE ioipsl … … 14 14 USE filtreg_mod 15 15 USE infotrac 16 #endif 17 !#endif of #ifdef CPP_EARTH 16 18 ! 17 19 IMPLICIT NONE … … 25 27 ! .KLON=KFDIA-KIDIA+1,KLEV=llm 26 28 ! 29 #ifdef CPP_EARTH 27 30 #include "comgeom2.h" 28 31 #include "comvert.h" … … 31 34 #include "dimsoil.h" 32 35 #include "temps.h" 33 ! 36 #endif 37 !#endif of #ifdef CPP_EARTH 38 ! arguments: 34 39 LOGICAL interbar 40 REAL :: masque(iip1,jjp1) 41 42 #ifdef CPP_EARTH 43 ! local variables: 35 44 REAL :: latfi(klon), lonfi(klon) 36 REAL :: orog(iip1,jjp1), rugo(iip1,jjp1), masque(iip1,jjp1),45 REAL :: orog(iip1,jjp1), rugo(iip1,jjp1), 37 46 . psol(iip1, jjp1), phis(iip1, jjp1) 38 47 REAL :: p3d(iip1, jjp1, llm+1) … … 144 153 ! 145 154 preff = 101325. 155 pa = 50000. 146 156 unskap = 1./kappa 147 157 ! … … 167 177 print*,'dtvr',dtvr 168 178 169 CALL inicons 0()179 CALL iniconst() 170 180 CALL inigeom() 171 181 ! … … 754 764 print*,'entree histclo' 755 765 CALL histclo 766 767 #endif 768 !#endif of #ifdef CPP_EARTH 756 769 RETURN 757 770 ! -
LMDZ4/branches/LMDZ4-dev/libf/dyn3dpar/gcm.F
r1129 r1140 9 9 USE IOIPSL 10 10 #endif 11 11 12 USE mod_const_mpi, ONLY: init_const_mpi 12 13 USE parallel 13 14 USE mod_phys_lmdz_para, ONLY : klon_mpi_para_nb 15 USE infotrac 16 USE mod_interface_dyn_phys 17 USE mod_hallo 18 USE Bands 19 20 USE filtreg_mod 21 22 ! Ehouarn: for now these only apply to Earth: 23 #ifdef CPP_EARTH 14 24 USE mod_grid_phy_lmdz 15 25 USE mod_phys_lmdz_omp_data, ONLY: klon_omp 16 26 USE dimphy 17 USE infotrac18 USE mod_interface_dyn_phys19 27 USE comgeomphy 20 USE mod_hallo 21 USE Bands 22 23 USE filtreg_mod 24 28 #endif 25 29 IMPLICIT NONE 26 30 … … 160 164 dynhistave_file = 'dyn_hist_ave' 161 165 162 c--------------------------------------------------------------------------163 c Iflag_phys controle l'appel a la physique :164 c -------------------------------------------165 c 0 : pas de physique166 c 1 : Normale (appel a phylmd, phymars ...)167 c 2 : rappel Newtonien pour la temperature + friction au sol168 iflag_phys=1169 170 c--------------------------------------------------------------------------171 c Lecture de l'etat initial :172 c ---------------------------173 c T : on lit start.nc174 c F : le modele s'autoinitialise avec un cas academique (iniacademic)175 #ifdef CPP_IOIPSL176 read_start=.true.177 #else178 read_start=.false.179 #endif180 166 181 167 c----------------------------------------------------------------------- … … 194 180 c --------------------------------------- 195 181 c 196 #ifdef CPP_IOIPSL 182 ! Ehouarn: dump possibility of using defrun 183 !#ifdef CPP_IOIPSL 197 184 CALL conf_gcm( 99, .TRUE. , clesphy0 ) 198 #else199 CALL defrun( 99, .TRUE. , clesphy0 )200 #endif185 !#else 186 ! CALL defrun( 99, .TRUE. , clesphy0 ) 187 !#endif 201 188 c 202 189 c … … 208 195 call init_parallel 209 196 call Read_Distrib 210 CALL Init_Phys_lmdz(iim,jjp1,llm,mpi_size,distrib_phys) 197 ! Ehouarn : temporarily (?) keep this only for Earth 198 if (planet_type.eq."earth") then 199 #ifdef CPP_EARTH 200 CALL Init_Phys_lmdz(iim,jjp1,llm,mpi_size,distrib_phys) 201 #endif 202 endif ! of if (planet_type.eq."earth") 211 203 CALL set_bands 212 204 CALL Init_interface_dyn_phys … … 220 212 c$OMP END PARALLEL 221 213 214 ! Ehouarn : temporarily (?) keep this only for Earth 215 if (planet_type.eq."earth") then 216 #ifdef CPP_EARTH 222 217 c$OMP PARALLEL 223 218 call InitComgeomphy 224 219 c$OMP END PARALLEL 220 #endif 221 endif ! of if (planet_type.eq."earth") 225 222 226 223 IF (config_inca /= 'none') THEN … … 252 249 c lecture du fichier start.nc 253 250 if (read_start) then 254 #ifdef CPP_IOIPSL 251 ! we still need to run iniacademic to initialize some 252 ! constants & fields, if we run the 'newtonian' case: 253 if (iflag_phys.eq.2) then 254 CALL iniacademic(vcov,ucov,teta,q,masse,ps,phis,time_0) 255 endif 256 !#ifdef CPP_IOIPSL 257 if (planet_type.eq."earth") then 258 #ifdef CPP_EARTH 259 ! Load an Earth-format start file 255 260 CALL dynetat0("start.nc",vcov,ucov, 256 261 . teta,q,masse,ps,phis, time_0) 262 #endif 263 endif ! of if (planet_type.eq."earth") 257 264 c write(73,*) 'ucov',ucov 258 265 c write(74,*) 'vcov',vcov … … 261 268 c write(77,*) 'q',q 262 269 263 #endif 264 endif 270 endif ! of if (read_start) 265 271 266 272 c le cas echeant, creation d un etat initial 267 273 IF (prt_level > 9) WRITE(lunout,*) 268 . 'AVANT iniacademic AVANT AVANT AVANT AVANT'274 . 'GCM: AVANT iniacademic AVANT AVANT AVANT AVANT' 269 275 if (.not.read_start) then 270 276 CALL iniacademic(vcov,ucov,teta,q,masse,ps,phis,time_0) … … 351 357 c Initialisation de la physique : 352 358 c ------------------------------- 353 #ifdef CPP_PHYS354 359 IF (call_iniphys.and.iflag_phys.eq.1) THEN 355 360 latfi(1)=rlatu(1) … … 372 377 373 378 WRITE(lunout,*) 374 . 'WARNING!!! vitesse verticale nulle dans la physique' 375 379 . 'GCM: WARNING!!! vitesse verticale nulle dans la physique' 380 ! Earth: 381 if (planet_type.eq."earth") then 382 #ifdef CPP_EARTH 376 383 CALL iniphysiq(ngridmx,llm,daysec,day_ini,dtphys , 377 384 , latfi,lonfi,airefi,zcufi,zcvfi,rad,g,r,cpp ) 378 385 #endif 386 endif ! of if (planet_type.eq."earth") 379 387 call_iniphys=.false. 380 381 ENDIF 382 #endif 388 ENDIF ! of IF (call_iniphys.and.(iflag_phys.eq.1)) 383 389 384 390 … … 402 408 day_end = day_ini + nday 403 409 WRITE(lunout,300)day_ini,day_end 410 300 FORMAT('1'/,15x,'run du jour',i7,2x,'au jour',i7//) 411 412 !#ifdef CPP_IOIPSL 413 if (planet_type.eq."earth") then 414 #ifdef CPP_EARTH 415 CALL dynredem0_p("restart.nc", day_end, phis) 416 #endif 417 endif 418 419 ecripar = .TRUE. 404 420 405 421 #ifdef CPP_IOIPSL 406 CALL dynredem0_p("restart.nc", day_end, phis)407 408 ecripar = .TRUE.409 410 422 if ( 1.eq.1) then 411 423 time_step = zdtvr … … 425 437 426 438 #endif 439 ! #endif of #ifdef CPP_IOIPSL 427 440 428 441 c Choix des frequences de stokage pour le offline … … 450 463 451 464 452 300 FORMAT('1'/,15x,'run du pas',i7,2x,'au pas',i7,2x,453 . 'c''est a dire du jour',i7,3x,'au jour',i7//)454 465 END 455 466 -
LMDZ4/branches/LMDZ4-dev/libf/dyn3dpar/iniacademic.F
r1114 r1140 45 45 #include "temps.h" 46 46 #include "control.h" 47 #include "iniprint.h" 47 48 48 49 c Arguments: … … 57 58 REAL ps(ip1jmp1) ! pression au sol 58 59 REAL masse(ip1jmp1,llm) ! masse d'air 60 REAL phis(ip1jmp1) ! geopotentiel au sol 61 62 c Local: 63 c ------ 64 59 65 REAL p (ip1jmp1,llmp1 ) ! pression aux interfac.des couches 60 66 REAL pks(ip1jmp1) ! exner au sol 61 67 REAL pk(ip1jmp1,llm) ! exner au milieu des couches 62 68 REAL pkf(ip1jmp1,llm) ! exner filt.au milieu des couches 63 REAL phis(ip1jmp1) ! geopotentiel au sol64 69 REAL phi(ip1jmp1,llm) ! geopotentiel 65 66 67 68 69 70 c Local:71 c ------72 73 70 REAL ddsin,tetarappelj,tetarappell,zsig 74 71 real tetajl(jjp1,llm) … … 81 78 82 79 c----------------------------------------------------------------------- 80 ! 1. Initializations for Earth-like case 81 ! -------------------------------------- 82 if (planet_type=="earth") then 83 c 84 time_0=0. 83 85 84 c 85 time_0=0. 86 im = iim 87 jm = jjm 88 day_ini = 0 89 omeg = 4.*asin(1.)/86400. 90 rad = 6371229. 91 g = 9.8 92 daysec = 86400. 93 dtvr = daysec/FLOAT(day_step) 94 zdtvr=dtvr 95 kappa = 0.2857143 96 cpp = 1004.70885 97 preff = 101325. 98 pa = 50000. 99 etot0 = 0. 100 ptot0 = 0. 101 ztot0 = 0. 102 stot0 = 0. 103 ang0 = 0. 86 104 87 im = iim 88 jm = jjm 89 day_ini = 0 90 omeg = 4.*asin(1.)/86400. 91 rad = 6371229. 92 g = 9.8 93 daysec = 86400. 94 dtvr = daysec/FLOAT(day_step) 95 zdtvr=dtvr 96 kappa = 0.2857143 97 cpp = 1004.70885 98 preff = 101325. 99 pa = 50 000. 100 etot0 = 0. 101 ptot0 = 0. 102 ztot0 = 0. 103 stot0 = 0. 104 ang0 = 0. 105 pa = 0. 105 CALL iniconst 106 CALL inigeom 107 CALL inifilr 106 108 107 CALL inicons0 108 CALL inigeom 109 CALL inifilr 110 111 ps=0. 112 phis=0. 109 ps=0. 110 phis=0. 113 111 c--------------------------------------------------------------------- 114 112 115 taurappel=10.*daysec113 taurappel=10.*daysec 116 114 117 115 c--------------------------------------------------------------------- … … 119 117 c -------------------------------------- 120 118 121 DO l=1,llm122 zsig=ap(l)/preff+bp(l)123 if (zsig.gt.0.3) then124 lsup=l125 tetarappell=1./8.*(-log(zsig)-.5)126 DO j=1,jjp1127 ddsin=sin(rlatu(j))-sin(pi/20.)128 tetajl(j,l)=300.*(1+1./18.*(1.-3.*ddsin*ddsin)+tetarappell)129 ENDDO130 else119 DO l=1,llm 120 zsig=ap(l)/preff+bp(l) 121 if (zsig.gt.0.3) then 122 lsup=l 123 tetarappell=1./8.*(-log(zsig)-.5) 124 DO j=1,jjp1 125 ddsin=sin(rlatu(j))-sin(pi/20.) 126 tetajl(j,l)=300.*(1+1./18.*(1.-3.*ddsin*ddsin)+tetarappell) 127 ENDDO 128 else 131 129 c Choix isotherme au-dessus de 300 mbar 132 do j=1,jjp1133 tetajl(j,l)=tetajl(j,lsup)*(0.3/zsig)**kappa134 enddo135 endif136 ENDDO130 do j=1,jjp1 131 tetajl(j,l)=tetajl(j,lsup)*(0.3/zsig)**kappa 132 enddo 133 endif ! of if (zsig.gt.0.3) 134 ENDDO ! of DO l=1,llm 137 135 138 do l=1,llm139 do j=1,jjp1140 do i=1,iip1141 ij=(j-1)*iip1+i142 tetarappel(ij,l)=tetajl(j,l)143 enddo144 enddo145 enddo136 do l=1,llm 137 do j=1,jjp1 138 do i=1,iip1 139 ij=(j-1)*iip1+i 140 tetarappel(ij,l)=tetajl(j,l) 141 enddo 142 enddo 143 enddo 146 144 147 c call dump2d(jjp1,llm,tetajl,'TEQ ')145 c call dump2d(jjp1,llm,tetajl,'TEQ ') 148 146 149 ps=1.e5150 phis=0.151 CALL pression ( ip1jmp1, ap, bp, ps, p )152 CALL exner_hyb( ip1jmp1, ps, p,alpha,beta, pks, pk, pkf )153 CALL massdair(p,masse)147 ps=1.e5 148 phis=0. 149 CALL pression ( ip1jmp1, ap, bp, ps, p ) 150 CALL exner_hyb( ip1jmp1, ps, p,alpha,beta, pks, pk, pkf ) 151 CALL massdair(p,masse) 154 152 155 153 c intialisation du vent et de la temperature 156 teta(:,:)=tetarappel(:,:)157 CALL geopot(ip1jmp1,teta,pk,pks,phis,phi)158 call ugeostr(phi,ucov)159 vcov=0.160 q(:,:,1 )=1.e-10161 q(:,:,2 )=1.e-15162 q(:,:,3:nqtot)=0.154 teta(:,:)=tetarappel(:,:) 155 CALL geopot(ip1jmp1,teta,pk,pks,phis,phi) 156 call ugeostr(phi,ucov) 157 vcov=0. 158 q(:,:,1 )=1.e-10 159 q(:,:,2 )=1.e-15 160 q(:,:,3:nqtot)=0. 163 161 164 162 165 c perturbation al \351atoire sur la temp\351rature166 idum = -1167 zz = ran1(idum)168 idum = 0169 do l=1,llm170 do ij=iip2,ip1jm171 teta(ij,l)=teta(ij,l)*(1.+0.005*ran1(idum))172 enddo173 enddo163 c perturbation aleatoire sur la temperature 164 idum = -1 165 zz = ran1(idum) 166 idum = 0 167 do l=1,llm 168 do ij=iip2,ip1jm 169 teta(ij,l)=teta(ij,l)*(1.+0.005*ran1(idum)) 170 enddo 171 enddo 174 172 175 do l=1,llm176 do ij=1,ip1jmp1,iip1177 teta(ij+iim,l)=teta(ij,l)178 enddo179 enddo173 do l=1,llm 174 do ij=1,ip1jmp1,iip1 175 teta(ij+iim,l)=teta(ij,l) 176 enddo 177 enddo 180 178 181 179 … … 187 185 188 186 c initialisation d'un traceur sur une colonne 189 j=jjp1*3/4 190 i=iip1/2 191 ij=(j-1)*iip1+i 192 q(ij,:,3)=1. 193 187 j=jjp1*3/4 188 i=iip1/2 189 ij=(j-1)*iip1+i 190 q(ij,:,3)=1. 191 192 else 193 write(lunout,*)"iniacademic: planet types other than earth", 194 & " not implemented (yet)." 195 stop 196 endif ! of if (planet_type=="earth") 194 197 return 195 198 END -
LMDZ4/branches/LMDZ4-dev/libf/dyn3dpar/leapfrog_p.F
r1134 r1140 4 4 c 5 5 c 6 #define IO_DEBUG7 8 #undef CPP_IOIPSL9 #define CPP_IOIPSL10 6 11 7 SUBROUTINE leapfrog_p(ucov,vcov,teta,ps,masse,phis,q,clesphy0, … … 285 281 c$OMP BARRIER 286 282 else 287 283 ! Save fields obtained at previous time step as '...m1' 288 284 ijb=ij_begin 289 285 ije=ij_end … … 312 308 . llm, -2,2, .TRUE., 1 ) 313 309 314 endif 310 endif ! of if (FirstCaldyn) 315 311 316 312 forward = .TRUE. … … 356 352 IF( MOD(itau,idissip ).EQ.0.AND..NOT.forward ) apdiss = .TRUE. 357 353 IF( MOD(itau,iphysiq ).EQ.0.AND..NOT.forward 358 s .and. iflag_phys. NE.0) apphys = .TRUE.354 s .and. iflag_phys.EQ.1 ) apphys = .TRUE. 359 355 ELSE 360 356 IF( MOD(itau ,iconser) .EQ. 0 ) conser = .TRUE. 361 357 IF( MOD(itau+1,idissip) .EQ. 0 ) apdiss = .TRUE. 362 IF( MOD(itau+1,iphysiq).EQ.0.AND.iflag_phys. NE.0) apphys=.TRUE.358 IF( MOD(itau+1,iphysiq).EQ.0.AND.iflag_phys.EQ.1) apphys=.TRUE. 363 359 END IF 364 360 … … 537 533 538 534 c$OMP MASTER 539 IF (prt_level>9)WRITE(lunout,*)"Iteration No",True_itau 535 IF (prt_level>9) THEN 536 WRITE(lunout,*)"leapfrog_p: Iteration No",True_itau 537 ENDIF 540 538 541 539 … … 594 592 595 593 596 ENDIF 597 c 598 ENDIF 594 ENDIF ! of IF (offline) 595 c 596 ENDIF ! of IF( forward. OR . leapf ) 599 597 cc$OMP END PARALLEL 600 598 … … 673 671 c$OMP MASTER 674 672 call suspend_timer(timer_caldyn) 675 WRITE(lunout,*)'Entree dans la physique : Iteration No ', & 676 & true_itau 673 674 write(lunout,*) 675 & 'leapfrog_p: Entree dans la physique : Iteration No ',true_itau 677 676 c$OMP END MASTER 678 677 … … 693 692 c ----------------------------------------------------- 694 693 695 #ifdef CPP_PHYS696 694 c+jld 697 695 … … 699 697 IF (ip_ebil_dyn.ge.1 ) THEN 700 698 ztit='bil dyn' 701 CALL diagedyn(ztit,2,1,1,dtphys 702 e , ucov , vcov , ps, p ,pk , teta , q(:,:,1), q(:,:,2)) 699 ! Ehouarn: be careful, diagedyn is Earth-specific (includes ../phylmd/..)! 700 IF (planet_type.eq."earth") THEN 701 CALL diagedyn(ztit,2,1,1,dtphys 702 & , ucov , vcov , ps, p ,pk , teta , q(:,:,1), q(:,:,2)) 703 ENDIF 703 704 ENDIF 704 705 c-jld … … 787 788 dpfi_tmp(1:iip1) = dpfi(ijb:ijb+iim) 788 789 c$OMP END MASTER 789 endif 790 endif ! of if ( .not. pole_nord) 790 791 791 792 c$OMP BARRIER … … 843 844 c$OMP END MASTER 844 845 845 endif 846 endif ! of if (.not. pole_nord) 846 847 c$OMP BARRIER 847 848 cc$OMP MASTER … … 932 933 cc$OMP END MASTER 933 934 934 #else 935 935 936 c-jld 937 c$OMP MASTER 938 call resume_timer(timer_caldyn) 939 if (FirstPhysic) then 940 ok_start_timer=.TRUE. 941 FirstPhysic=.false. 942 endif 943 c$OMP END MASTER 944 ENDIF ! of IF( apphys ) 945 946 IF(iflag_phys.EQ.2) THEN ! "Newtonian" case 936 947 c Calcul academique de la physique = Rappel Newtonien + fritcion 937 948 c -------------------------------------------------------------- … … 949 960 950 961 call friction_p(ucov,vcov,iphysiq*dtvr) 951 952 #endif 953 954 c-jld 955 c$OMP MASTER 956 call resume_timer(timer_caldyn) 957 if (FirstPhysic) then 958 ok_start_timer=.TRUE. 959 FirstPhysic=.false. 960 endif 961 c$OMP END MASTER 962 ENDIF 962 ENDIF ! of IF(iflag_phys.EQ.2) 963 963 964 964 965 CALL pression_p ( ip1jmp1, ap, bp, ps, p ) … … 1312 1313 c IF( MOD(itau,iecri ).EQ.0) THEN 1313 1314 1314 IF( MOD(itau,iecri*day_step).EQ.0) THEN1315 c$OMP BARRIER 1316 c$OMP MASTER 1317 1318 CALL geopot_p ( ip1jmp1, teta , pk , pks, phis , phi)1315 IF( MOD(itau,iecri*day_step).EQ.0) THEN 1316 c$OMP BARRIER 1317 c$OMP MASTER 1318 nbetat = nbetatdem 1319 CALL geopot_p(ip1jmp1,teta,pk,pks,phis,phi) 1319 1320 1320 1321 cym unat=0. 1321 1322 1322 ijb=ij_begin1323 ije=ij_end1324 1325 if (pole_nord) then1326 ijb=ij_begin+iip11327 unat(1:iip1,:)=0.1328 endif1329 1330 if (pole_sud) then1331 ije=ij_end-iip11332 unat(ij_end-iip1+1:ij_end,:)=0.1333 endif1323 ijb=ij_begin 1324 ije=ij_end 1325 1326 if (pole_nord) then 1327 ijb=ij_begin+iip1 1328 unat(1:iip1,:)=0. 1329 endif 1330 1331 if (pole_sud) then 1332 ije=ij_end-iip1 1333 unat(ij_end-iip1+1:ij_end,:)=0. 1334 endif 1334 1335 1335 do l=1,llm1336 unat(ijb:ije,l)=ucov(ijb:ije,l)/cu(ijb:ije)1337 enddo1338 1339 ijb=ij_begin1340 ije=ij_end1341 if (pole_sud) ije=ij_end-iip11342 1343 do l=1,llm1344 vnat(ijb:ije,l)=vcov(ijb:ije,l)/cv(ijb:ije)1345 enddo1336 do l=1,llm 1337 unat(ijb:ije,l)=ucov(ijb:ije,l)/cu(ijb:ije) 1338 enddo 1339 1340 ijb=ij_begin 1341 ije=ij_end 1342 if (pole_sud) ije=ij_end-iip1 1343 1344 do l=1,llm 1345 vnat(ijb:ije,l)=vcov(ijb:ije,l)/cv(ijb:ije) 1346 enddo 1346 1347 1347 1348 #ifdef CPP_IOIPSL 1348 1349 1349 CALL writehist_p(histid,histvid, itau,vcov,1350 sucov,teta,phi,q,masse,ps,phis)1350 CALL writehist_p(histid,histvid, itau,vcov, 1351 & ucov,teta,phi,q,masse,ps,phis) 1351 1352 1352 1353 #endif 1353 c$OMP END MASTER 1354 ENDIF 1354 ! For some Grads outputs of fields 1355 if (output_grads_dyn) then 1356 ! Ehouarn: hope this works the way I think it does: 1357 call Gather_Field(unat,ip1jmp1,llm,0) 1358 call Gather_Field(vnat,ip1jm,llm,0) 1359 call Gather_Field(teta,ip1jmp1,llm,0) 1360 call Gather_Field(ps,ip1jmp1,1,0) 1361 do iq=1,nqtot 1362 call Gather_Field(q(1,1,iq),ip1jmp1,llm,0) 1363 enddo 1364 if (mpi_rank==0) then 1365 #include "write_grads_dyn.h" 1366 endif 1367 endif ! of if (output_grads_dyn) 1368 c$OMP END MASTER 1369 ENDIF ! of IF(MOD(itau,iecri).EQ.0) 1355 1370 1356 1371 IF(itau.EQ.itaufin) THEN … … 1359 1374 c$OMP MASTER 1360 1375 1361 c#ifdef CPP_IOIPSL 1362 1363 CALL dynredem1_p("restart.nc",0.0, 1364 , vcov,ucov,teta,q,masse,ps) 1365 c#endif 1376 if (planet_type.eq."earth") then 1377 #ifdef CPP_EARTH 1378 ! Write an Earth-format restart file 1379 CALL dynredem1_p("restart.nc",0.0, 1380 & vcov,ucov,teta,q,masse,ps) 1381 1382 #endif 1383 endif ! of if (planet_type.eq."earth") 1366 1384 1367 1385 CLOSE(99) 1368 1386 c$OMP END MASTER 1369 ENDIF 1387 ENDIF ! of IF (itau.EQ.itaufin) 1370 1388 1371 1389 c----------------------------------------------------------------------- … … 1398 1416 dt = 2.*dtvr 1399 1417 GO TO 2 1400 END IF 1401 1402 ELSE 1418 END IF ! of IF (MOD(itau,iperiod).EQ.0) 1419 ! ELSEIF (MOD(itau-1,iperiod).EQ.0) 1420 1421 1422 ELSE ! of IF (.not.purmats) 1403 1423 1404 1424 c ........................................................ … … 1427 1447 GO TO 2 1428 1448 1429 ELSE 1430 1431 IF(MOD(itau,iperiod).EQ.0 .OR. itau.EQ.itaufin) THEN1449 ELSE ! of IF(forward) 1450 1451 IF(MOD(itau,iperiod).EQ.0 .OR. itau.EQ.itaufin) THEN 1432 1452 IF(itau.EQ.itaufin) THEN 1433 1453 iav=1 … … 1438 1458 c$OMP BARRIER 1439 1459 1440 call Register_Hallo(vcov,ip1jm,llm,1,0,0,1,TestRequest)1441 call SendRequest(TestRequest)1442 c$OMP BARRIER 1443 call WaitRequest(TestRequest)1444 1445 c$OMP BARRIER 1446 c$OMP MASTER 1447 CALL writedynav_p(histaveid, itau,vcov ,1460 call Register_Hallo(vcov,ip1jm,llm,1,0,0,1,TestRequest) 1461 call SendRequest(TestRequest) 1462 c$OMP BARRIER 1463 call WaitRequest(TestRequest) 1464 1465 c$OMP BARRIER 1466 c$OMP MASTER 1467 CALL writedynav_p(histaveid, itau,vcov , 1448 1468 , ucov,teta,pk,phi,q,masse,ps,phis) 1449 1469 call bilan_dyn_p (2,dtvr*iperiod,dtvr*day_step*periodav, … … 1451 1471 c$OMP END MASTER 1452 1472 #endif 1453 ENDIF 1473 ENDIF ! of IF(MOD(itau,iperiod).EQ.0 .OR. itau.EQ.itaufin) 1474 1454 1475 1455 1476 c IF(MOD(itau,iecri ).EQ.0) THEN … … 1457 1478 c$OMP BARRIER 1458 1479 c$OMP MASTER 1459 1460 CALL geopot_p( ip1jmp1, teta , pk , pks, phis , phi)1480 nbetat = nbetatdem 1481 CALL geopot_p(ip1jmp1,teta,pk,pks,phis,phi) 1461 1482 1462 1483 cym unat=0. 1463 ijb=ij_begin1464 ije=ij_end1465 1466 if (pole_nord) then1467 ijb=ij_begin+iip11468 unat(1:iip1,:)=0.1469 endif1470 1471 if (pole_sud) then1472 ije=ij_end-iip11473 unat(ij_end-iip1+1:ij_end,:)=0.1474 endif1484 ijb=ij_begin 1485 ije=ij_end 1486 1487 if (pole_nord) then 1488 ijb=ij_begin+iip1 1489 unat(1:iip1,:)=0. 1490 endif 1491 1492 if (pole_sud) then 1493 ije=ij_end-iip1 1494 unat(ij_end-iip1+1:ij_end,:)=0. 1495 endif 1475 1496 1476 do l=1,llm1477 unat(ijb:ije,l)=ucov(ijb:ije,l)/cu(ijb:ije)1478 enddo1479 1480 ijb=ij_begin1481 ije=ij_end1482 if (pole_sud) ije=ij_end-iip11483 1484 do l=1,llm1485 vnat(ijb:ije,l)=vcov(ijb:ije,l)/cv(ijb:ije)1486 enddo1497 do l=1,llm 1498 unat(ijb:ije,l)=ucov(ijb:ije,l)/cu(ijb:ije) 1499 enddo 1500 1501 ijb=ij_begin 1502 ije=ij_end 1503 if (pole_sud) ije=ij_end-iip1 1504 1505 do l=1,llm 1506 vnat(ijb:ije,l)=vcov(ijb:ije,l)/cv(ijb:ije) 1507 enddo 1487 1508 1488 1509 #ifdef CPP_IOIPSL 1489 1510 1490 CALL writehist_p( histid, histvid, itau,vcov , 1491 , ucov,teta,phi,q,masse,ps,phis) 1492 c#else 1493 c call Gather_Field(unat,ip1jmp1,llm,0) 1494 c call Gather_Field(vnat,ip1jm,llm,0) 1495 c call Gather_Field(teta,ip1jmp1,llm,0) 1496 c call Gather_Field(ps,ip1jmp1,1,0) 1497 c do iq=1,nqtot 1498 c call Gather_Field(q(1,1,iq),ip1jmp1,llm,0) 1499 c enddo 1511 CALL writehist_p(histid, histvid, itau,vcov , 1512 & ucov,teta,phi,q,masse,ps,phis) 1513 #endif 1514 ! For some Grads output (but does it work?) 1515 if (output_grads_dyn) then 1516 call Gather_Field(unat,ip1jmp1,llm,0) 1517 call Gather_Field(vnat,ip1jm,llm,0) 1518 call Gather_Field(teta,ip1jmp1,llm,0) 1519 call Gather_Field(ps,ip1jmp1,1,0) 1520 do iq=1,nqtot 1521 call Gather_Field(q(1,1,iq),ip1jmp1,llm,0) 1522 enddo 1500 1523 c 1501 c if (mpi_rank==0) then 1502 c#include "write_grads_dyn.h" 1503 c endif 1504 #endif 1505 1506 c$OMP END MASTER 1507 ENDIF 1508 1509 IF(itau.EQ.itaufin) THEN 1524 if (mpi_rank==0) then 1525 #include "write_grads_dyn.h" 1526 endif 1527 endif ! of if (output_grads_dyn) 1528 1529 c$OMP END MASTER 1530 ENDIF ! of IF(MOD(itau,iecri*day_step).EQ.0) 1531 1532 IF(itau.EQ.itaufin) THEN 1533 if (planet_type.eq."earth") then 1534 #ifdef CPP_EARTH 1510 1535 c$OMP MASTER 1511 1536 CALL dynredem1_p("restart.nc",0.0, 1512 1537 . vcov,ucov,teta,q,masse,ps) 1513 1538 c$OMP END MASTER 1514 ENDIF 1515 forward = .TRUE. 1516 GO TO 1 1517 1518 ENDIF 1519 1520 END IF 1521 c$OMP MASTER 1522 call finalize_parallel 1523 c$OMP END MASTER 1524 RETURN 1539 #endif 1540 endif ! of if (planet_type.eq."earth") 1541 ENDIF ! of IF(itau.EQ.itaufin) 1542 1543 forward = .TRUE. 1544 GO TO 1 1545 1546 ENDIF ! of IF (forward) 1547 1548 END IF ! of IF(.not.purmats) 1549 c$OMP MASTER 1550 call finalize_parallel 1551 c$OMP END MASTER 1552 RETURN 1525 1553 END
Note: See TracChangeset
for help on using the changeset viewer.