Changeset 1302 for trunk/LMDZ.COMMON/libf
- Timestamp:
- Jun 26, 2014, 6:07:05 PM (11 years ago)
- Location:
- trunk/LMDZ.COMMON/libf
- Files:
-
- 3 deleted
- 21 edited
- 5 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.COMMON/libf/bibio/wxios.F90
r1300 r1302 26 26 27 27 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 28 ! str + i => str_i !!!!!!!!!!!!!!!!!!!!29 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!30 31 SUBROUTINE concat(str, str2, str_str2)32 CHARACTER(len=*), INTENT(IN) :: str, str233 CHARACTER(len=20), INTENT(OUT) :: str_str234 35 36 str_str2 = TRIM(ADJUSTL(str//"_"//TRIM(ADJUSTL(str2))))37 !IF (prt_level >= 10) WRITE(lunout,*) "Xios. ",str,"+",str2,"=",str_str238 END SUBROUTINE concat39 40 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!41 28 ! 36day => 36d etc !!!!!!!!!!!!!!!!!!!! 42 29 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! … … 109 96 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 110 97 111 SUBROUTINE wxios_init(xios_ctx_name, locom, outcom )98 SUBROUTINE wxios_init(xios_ctx_name, locom, outcom, type_ocean) 112 99 IMPLICIT NONE 113 100 INCLUDE 'iniprint.h' … … 116 103 INTEGER, INTENT(IN), OPTIONAL :: locom 117 104 INTEGER, INTENT(OUT), OPTIONAL :: outcom 105 CHARACTER(len=6), INTENT(IN), OPTIONAL :: type_ocean 118 106 119 107 … … 142 130 g_ctx_name = xios_ctx_name 143 131 144 CALL wxios_context_init() 145 132 ! Si couple alors init fait dans cpl_init 133 IF (.not. PRESENT(type_ocean)) THEN 134 CALL wxios_context_init() 135 ENDIF 136 146 137 END SUBROUTINE wxios_init 147 138 … … 158 149 g_ctx = xios_ctx 159 150 160 IF (prt_level >= 10) WRITE(lunout,*) "wxios_context_init: Current context is ",trim(g_ctx_name) 161 151 IF (prt_level >= 10) THEN 152 WRITE(lunout,*) "wxios_context_init: Current context is ",trim(g_ctx_name) 153 WRITE(lunout,*) " now call xios_solve_inheritance()" 154 ENDIF 162 155 !Une première analyse des héritages: 163 156 CALL xios_solve_inheritance() … … 303 296 ! Pour déclarer un axe vertical !!!!!!!!!!!!!!! 304 297 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 305 SUBROUTINE wxios_add_vaxis(axis group_id, axis_file, axis_size, axis_value)306 IMPLICIT NONE 307 INCLUDE 'iniprint.h' 308 309 CHARACTER (len=*), INTENT(IN) :: axis group_id, axis_file298 SUBROUTINE wxios_add_vaxis(axis_id, axis_size, axis_value) 299 IMPLICIT NONE 300 INCLUDE 'iniprint.h' 301 302 CHARACTER (len=*), INTENT(IN) :: axis_id 310 303 INTEGER, INTENT(IN) :: axis_size 311 304 REAL, DIMENSION(axis_size), INTENT(IN) :: axis_value 312 305 313 TYPE(xios_axisgroup) :: axgroup 314 TYPE(xios_axis) :: ax 315 CHARACTER(len=20) :: axis_id 316 317 318 !Préparation du nom de l'axe: 319 CALL concat(axisgroup_id, axis_file, axis_id) 306 ! TYPE(xios_axisgroup) :: axgroup 307 ! TYPE(xios_axis) :: ax 308 ! CHARACTER(len=50) :: axis_id 309 310 ! IF (len_trim(axisgroup_id).gt.len(axis_id)) THEN 311 ! WRITE(lunout,*) "wxios_add_vaxis: error, size of axis_id too small!!" 312 ! WRITE(lunout,*) " increase it to at least ",len_trim(axisgroup_id) 313 ! CALL abort_gcm("wxios_add_vaxis","len(axis_id) too small",1) 314 ! ENDIF 315 ! axis_id=trim(axisgroup_id) 320 316 321 317 !On récupère le groupe d'axes qui va bien: 322 CALL xios_get_axisgroup_handle(axisgroup_id, axgroup)318 !CALL xios_get_axisgroup_handle(axisgroup_id, axgroup) 323 319 324 320 !On ajoute l'axe correspondant à ce fichier: 325 CALL xios_add_axis(axgroup, ax, TRIM(ADJUSTL(axis_id)))321 !CALL xios_add_axis(axgroup, ax, TRIM(ADJUSTL(axis_id))) 326 322 327 323 !Et on le parametrise: 328 CALL xios_set_axis_attr_hdl(ax, size=axis_size, value=axis_value) 324 !CALL xios_set_axis_attr_hdl(ax, size=axis_size, value=axis_value) 325 326 ! Ehouarn: New way to declare axis, without axis_group: 327 CALL xios_set_axis_attr(trim(axis_id),size=axis_size,value=axis_value) 329 328 330 329 !Vérification: … … 332 331 IF (prt_level >= 10) WRITE(lunout,*) "wxios_add_vaxis: Axis created: ", TRIM(ADJUSTL(axis_id)) 333 332 ELSE 334 WRITE( *,*) "wxios_add_vaxis: Invalid axis: ", TRIM(ADJUSTL(axis_id))333 WRITE(lunout,*) "wxios_add_vaxis: Invalid axis: ", TRIM(ADJUSTL(axis_id)) 335 334 END IF 336 335 … … 367 366 368 367 IF (xios_is_valid_file("X"//fname)) THEN 369 IF (prt_level >= 10) WRITE(lunout,*) "wxios_add_file: New file: ", "X"//fname 370 IF (prt_level >= 10) WRITE(lunout,*) "wxios_add_file: output_freq=",TRIM(ADJUSTL(nffreq)),"; output_lvl=",flvl 368 IF (prt_level >= 10) THEN 369 WRITE(lunout,*) "wxios_add_file: New file: ", "X"//fname 370 WRITE(lunout,*) "wxios_add_file: output_freq=",TRIM(ADJUSTL(nffreq)),"; output_lvl=",flvl 371 ENDIF 371 372 ELSE 372 WRITE( *,*) "wxios_add_file: Error, invalid file: ", "X"//trim(fname)373 WRITE( *,*) "wxios_add_file: output_freq=",TRIM(ADJUSTL(nffreq)),"; output_lvl=",flvl373 WRITE(lunout,*) "wxios_add_file: Error, invalid file: ", "X"//trim(fname) 374 WRITE(lunout,*) "wxios_add_file: output_freq=",TRIM(ADJUSTL(nffreq)),"; output_lvl=",flvl 374 375 END IF 375 376 ELSE 376 IF (prt_level >= 10) WRITE(lunout,*) "wxios_add_file: File ",trim(fname), " défined using XML." 377 CALL xios_set_file_attr(fname, enabled=.TRUE.) 377 IF (prt_level >= 10) THEN 378 WRITE(lunout,*) "wxios_add_file: File ",trim(fname), " défined using XML." 379 ENDIF 380 ! Ehouarn: add an enable=.true. on top of xml definitions... why??? 381 CALL xios_set_file_attr(fname, enabled=.TRUE.) 378 382 END IF 379 383 END SUBROUTINE wxios_add_file 380 384 381 385 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 382 ! Pour créer un champ !!!!!!!!!!!!!!! 386 ! Pour créer un champ !!!!!!!!!!!!!!!!!!!! 383 387 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 384 388 SUBROUTINE wxios_add_field(fieldname, fieldgroup, fieldlongname, fieldunit) … … 418 422 419 423 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 420 ! Pour déclarer un champ !!!!!!!!!!!!!!! 424 ! Pour déclarer un champ !!!!!!!!!!!!!!!!! 421 425 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 422 426 SUBROUTINE wxios_add_field_to_file(fieldname, fdim, fid, fname, fieldlongname, fieldunit, field_level, op) … … 432 436 CHARACTER(len=*), INTENT(IN) :: op 433 437 434 CHARACTER(len=20) :: axis_id 438 CHARACTER(len=20) :: axis_id ! Ehouarn: dangerous... 435 439 CHARACTER(len=100) :: operation 436 440 TYPE(xios_file) :: f … … 441 445 442 446 443 !Préparation du nom de l'axe: 444 CALL concat("presnivs", fname, axis_id) 447 ! Ajout Abd pour NMC: 448 IF (fid.LE.6) THEN 449 axis_id="presnivs" 450 ELSE 451 axis_id="plev" 452 ENDIF 445 453 446 454 !on prépare le nom de l'opération: … … 448 456 449 457 450 451 458 !On selectionne le bon groupe de champs: 452 459 IF (fdim.EQ.2) THEN 453 460 CALL xios_get_fieldgroup_handle("fields_2D", fieldgroup) 454 461 ELSE 455 462 CALL xios_get_fieldgroup_handle("fields_3D", fieldgroup) … … 515 522 !Sinon on se contente de l'activer: 516 523 CALL xios_set_field_attr(fieldname, enabled=.TRUE.) 524 !NB: This will override an enable=.false. set by a user in the xml file; 525 ! then the only way to not output the field is by changing its 526 ! output level 517 527 ENDIF 518 528 519 529 END SUBROUTINE wxios_add_field_to_file 520 530 521 SUBROUTINE wxios_update_calendar(ito)522 INTEGER, INTENT(IN) :: ito523 CALL xios_update_calendar(ito)524 END SUBROUTINE wxios_update_calendar525 526 SUBROUTINE wxios_write_2D(fieldname, fdata)527 CHARACTER(len=*), INTENT(IN) :: fieldname528 REAL, DIMENSION(:,:), INTENT(IN) :: fdata529 530 CALL xios_send_field(fieldname, fdata)531 END SUBROUTINE wxios_write_2D532 533 SUBROUTINE wxios_write_3D(fieldname, fdata)534 CHARACTER(len=*), INTENT(IN) :: fieldname535 REAL, DIMENSION(:,:,:), INTENT(IN) :: fdata536 537 CALL xios_send_field(fieldname, fdata)538 END SUBROUTINE wxios_write_3D531 ! SUBROUTINE wxios_update_calendar(ito) 532 ! INTEGER, INTENT(IN) :: ito 533 ! CALL xios_update_calendar(ito) 534 ! END SUBROUTINE wxios_update_calendar 535 ! 536 ! SUBROUTINE wxios_write_2D(fieldname, fdata) 537 ! CHARACTER(len=*), INTENT(IN) :: fieldname 538 ! REAL, DIMENSION(:,:), INTENT(IN) :: fdata 539 ! 540 ! CALL xios_send_field(fieldname, fdata) 541 ! END SUBROUTINE wxios_write_2D 542 543 ! SUBROUTINE wxios_write_3D(fieldname, fdata) 544 ! CHARACTER(len=*), INTENT(IN) :: fieldname 545 ! REAL, DIMENSION(:,:,:), INTENT(IN) :: fdata 546 ! 547 ! CALL xios_send_field(fieldname, fdata) 548 ! END SUBROUTINE wxios_write_3D 539 549 540 550 SUBROUTINE wxios_closedef() -
trunk/LMDZ.COMMON/libf/dyn3d/calfis.F
r1256 r1302 172 172 REAL unskap, pksurcp 173 173 save unskap 174 175 cIM diagnostique PVteta, Amip2176 INTEGER,PARAMETER :: ntetaSTD=3177 REAL,SAVE :: rtetaSTD(ntetaSTD)=(/350.,380.,405./) ! Earth-specific, beware !!178 REAL PVteta(ngridmx,ntetaSTD)179 174 180 175 REAL flxwfi(ngridmx,llm) ! Flux de masse verticale sur la grille physiq … … 651 646 ENDDO 652 647 c 653 if (planet_type=="earth") then654 #ifdef CPP_EARTH655 ! PVtheta calls tetalevel, which is in the (Earth) physics656 cIM calcul PV a teta=350, 380, 405K657 CALL PVtheta(ngridmx,llm,pucov,pvcov,pteta,658 $ ztfi,zplay,zplev,659 $ ntetaSTD,rtetaSTD,PVteta)660 #endif661 endif662 c663 648 c On change de grille, dynamique vers physiq, pour le flux de masse verticale 664 649 CALL gr_dyn_fi(llm,iip1,jjp1,ngridmx,flxw,flxwfi) … … 713 698 . zdqfi, 714 699 . zdpsrf, 715 cIM diagnostique PVteta, Amip2 716 . pducov, 717 . PVteta) 700 . pducov) 718 701 719 702 else if ( planet_type=="generic" ) then -
trunk/LMDZ.COMMON/libf/dyn3d/ce0l.F90
r1019 r1302 1 1 ! 2 ! $Id: ce0l.F90 1 511 2011-04-28 15:21:47Z jghattas$2 ! $Id: ce0l.F90 1984 2014-02-18 09:59:29Z emillour $ 3 3 ! 4 4 !------------------------------------------------------------------------------- … … 30 30 #ifndef CPP_EARTH 31 31 #include "iniprint.h" 32 WRITE(lunout,*)'limit_netcdf: Earth-specific program, needs Earth physics'32 WRITE(lunout,*)'limit_netcdf: Earth-specific routine, needs Earth physics' 33 33 #else 34 34 !------------------------------------------------------------------------------- … … 94 94 END IF 95 95 96 IF (grilles_gcm_netcdf) THEN97 98 99 100 101 102 103 END IF 96 97 WRITE(lunout,'(//)') 98 WRITE(lunout,*) ' *************************** ' 99 WRITE(lunout,*) ' *** grilles_gcm_netcdf *** ' 100 WRITE(lunout,*) ' *************************** ' 101 WRITE(lunout,'(//)') 102 CALL grilles_gcm_netcdf_sub(masque,phis) 103 104 104 #endif 105 105 ! of #ifndef CPP_EARTH #else … … 108 108 ! 109 109 !------------------------------------------------------------------------------- 110 -
trunk/LMDZ.COMMON/libf/dyn3d/conf_gcm.F
r1189 r1302 2 2 ! $Id: conf_gcm.F 1418 2010-07-19 15:11:24Z jghattas $ 3 3 ! 4 c 5 c 4 ! 5 ! 6 6 SUBROUTINE conf_gcm( tapedef, etatinit ) 7 c 7 ! 8 8 USE control_mod 9 9 #ifdef CPP_IOIPSL … … 18 18 19 19 IMPLICIT NONE 20 c-----------------------------------------------------------------------21 cAuteurs : L. Fairhead , P. Le Van .22 c 23 cArguments :24 c 25 ctapedef :26 cetatinit : = TRUE , on ne compare pas les valeurs des para-27 c-metres du zoom avec celles lues sur le fichier start .28 c 20 !----------------------------------------------------------------------- 21 ! Auteurs : L. Fairhead , P. Le Van . 22 ! 23 ! Arguments : 24 ! 25 ! tapedef : 26 ! etatinit : = TRUE , on ne compare pas les valeurs des para- 27 ! -metres du zoom avec celles lues sur le fichier start . 28 ! 29 29 LOGICAL etatinit 30 30 INTEGER tapedef 31 31 32 cDeclarations :33 c--------------32 ! Declarations : 33 ! -------------- 34 34 #include "dimensions.h" 35 35 #include "paramet.h" … … 43 43 ! FH 2008/05/09 On elimine toutes les clefs physiques dans la dynamique 44 44 ! #include "clesphys.h" 45 c 46 c 47 clocal:48 c------45 ! 46 ! 47 ! local: 48 ! ------ 49 49 50 50 CHARACTER ch1*72,ch2*72,ch3*72,ch4*12 … … 54 54 INTEGER i 55 55 LOGICAL use_filtre_fft 56 c 57 c-------------------------------------------------------------------58 c 59 c......... Version du 29/04/97 ..........60 c 61 cNouveaux parametres nitergdiv,nitergrot,niterh,tetagdiv,tetagrot,62 ctetatemp ajoutes pour la dissipation .63 c 64 cAutre parametre ajoute en fin de liste de tapedef : ** fxyhypb **65 c 66 cSi fxyhypb = .TRUE. , choix de la fonction a derivee tangente hyperb.67 cSinon , choix de fxynew , a derivee sinusoidale ..68 c 69 c...... etatinit = . TRUE. si defrun est appele dans ETAT0_LMD ou70 cLIMIT_LMD pour l'initialisation de start.dat (dic) et71 cde limit.dat ( dic) ...........72 cSinon etatinit = . FALSE .73 c 74 cDonc etatinit = .F. si on veut comparer les valeurs de grossismx ,75 cgrossismy,clon,clat, fxyhypb lues sur le fichier start avec76 ccelles passees par run.def , au debut du gcm, apres l'appel a77 clectba .78 cCes parmetres definissant entre autres la grille et doivent etre79 cpareils et coherents , sinon il y aura divergence du gcm .80 c 81 c-----------------------------------------------------------------------82 cinitialisations:83 c----------------56 ! 57 ! ------------------------------------------------------------------- 58 ! 59 ! ......... Version du 29/04/97 .......... 60 ! 61 ! Nouveaux parametres nitergdiv,nitergrot,niterh,tetagdiv,tetagrot, 62 ! tetatemp ajoutes pour la dissipation . 63 ! 64 ! Autre parametre ajoute en fin de liste de tapedef : ** fxyhypb ** 65 ! 66 ! Si fxyhypb = .TRUE. , choix de la fonction a derivee tangente hyperb. 67 ! Sinon , choix de fxynew , a derivee sinusoidale .. 68 ! 69 ! ...... etatinit = . TRUE. si defrun est appele dans ETAT0_LMD ou 70 ! LIMIT_LMD pour l'initialisation de start.dat (dic) et 71 ! de limit.dat ( dic) ........... 72 ! Sinon etatinit = . FALSE . 73 ! 74 ! Donc etatinit = .F. si on veut comparer les valeurs de grossismx , 75 ! grossismy,clon,clat, fxyhypb lues sur le fichier start avec 76 ! celles passees par run.def , au debut du gcm, apres l'appel a 77 ! lectba . 78 ! Ces parmetres definissant entre autres la grille et doivent etre 79 ! pareils et coherents , sinon il y aura divergence du gcm . 80 ! 81 !----------------------------------------------------------------------- 82 ! initialisations: 83 ! ---------------- 84 84 85 85 !Config Key = lunout … … 91 91 CALL getin('lunout', lunout) 92 92 IF (lunout /= 5 .and. lunout /= 6) THEN 93 OPEN(UNIT=lunout,FILE='lmdz.out',ACTION='write', 93 OPEN(UNIT=lunout,FILE='lmdz.out',ACTION='write', & 94 94 & STATUS='unknown',FORM='formatted') 95 95 ENDIF … … 103 103 CALL getin('prt_level',prt_level) 104 104 105 c-----------------------------------------------------------------------106 cParametres de controle du run:107 c-----------------------------------------------------------------------105 !----------------------------------------------------------------------- 106 ! Parametres de controle du run: 107 !----------------------------------------------------------------------- 108 108 !Config Key = planet_type 109 109 !Config Desc = planet type ("earth", "mars", "venus", ...) … … 264 264 CALL getin('dissip_period',dissip_period) 265 265 266 ccc .... P. Le Van , modif le 29/04/97 .pour la dissipation ...267 ccc266 !cc .... P. Le Van , modif le 29/04/97 .pour la dissipation ... 267 !cc 268 268 269 269 !Config Key = lstardis … … 430 430 CALL getin('ok_guide',ok_guide) 431 431 432 c...............................................................432 ! ............................................................... 433 433 434 434 !Config Key = read_start … … 587 587 CALL getin('ok_etat0',ok_etat0) 588 588 589 !Config Key = grilles_gcm_netcdf 590 !Config Desc = creation de fichier grilles_gcm.nc dans create_etat0_limit 591 !Config Def = n 592 grilles_gcm_netcdf = .FALSE. 593 CALL getin('grilles_gcm_netcdf',grilles_gcm_netcdf) 594 595 c---------------------------------------- 596 c Parameters for zonal averages in the case of Titan 589 !---------------------------------------- 590 ! Parameters for zonal averages in the case of Titan 597 591 moyzon_mu = .false. 598 592 moyzon_ch = .false. … … 601 595 CALL getin('moyzon_ch', moyzon_ch) 602 596 endif 603 c----------------------------------------604 605 c----------------------------------------606 ccc .... P. Le Van , ajout le 7/03/95 .pour le zoom ...607 c......... ( modif le 17/04/96 ) .........608 c 609 CZOOM PARAMETERS ... the ones read in start.nc prevail anyway ! (SL, 2012)610 c 611 c----------------------------------------597 !---------------------------------------- 598 599 !---------------------------------------- 600 !cc .... P. Le Van , ajout le 7/03/95 .pour le zoom ... 601 ! ......... ( modif le 17/04/96 ) ......... 602 ! 603 ! ZOOM PARAMETERS ... the ones read in start.nc prevail anyway ! (SL, 2012) 604 ! 605 !---------------------------------------- 612 606 IF( etatinit ) then 613 607 … … 645 639 646 640 IF( grossismx.LT.1. ) THEN 647 write(lunout,*) 648 & 'conf_gcm: *** ATTENTION !! grossismx < 1 . *** '641 write(lunout,*) & 642 & 'conf_gcm: *** ATTENTION !! grossismx < 1 . *** ' 649 643 STOP 650 644 ELSE … … 654 648 655 649 IF( grossismy.LT.1. ) THEN 656 write(lunout,*) 657 & 'conf_gcm: *** ATTENTION !! grossismy < 1 . *** '650 write(lunout,*) & 651 & 'conf_gcm: *** ATTENTION !! grossismy < 1 . *** ' 658 652 STOP 659 653 ELSE … … 662 656 663 657 write(lunout,*)'conf_gcm: alphax alphay ',alphax,alphay 664 c 665 calphax et alphay sont les anciennes formulat. des grossissements666 c 667 c 658 ! 659 ! alphax et alphay sont les anciennes formulat. des grossissements 660 ! 661 ! 668 662 669 663 !Config Key = fxyhypb … … 737 731 c 738 732 IF( ABS(clat - clatt).GE. 0.001 ) THEN 739 write(lunout,*)'conf_gcm: La valeur de clat passee par run.def', 733 write(lunout,*)'conf_gcm: La valeur de clat passee par run.def', & 740 734 & ' est differente de celle lue sur le fichier start ' 741 735 STOP … … 752 746 753 747 IF( ABS(grossismx - grossismxx).GE. 0.001 ) THEN 754 write(lunout,*)'conf_gcm: La valeur de grossismx passee par ', 748 write(lunout,*)'conf_gcm: La valeur de grossismx passee par ', & 755 749 & 'run.def est differente de celle lue sur le fichier start ' 756 750 STOP … … 766 760 767 761 IF( ABS(grossismy - grossismyy).GE. 0.001 ) THEN 768 write(lunout,*)'conf_gcm: La valeur de grossismy passee par ', 762 write(lunout,*)'conf_gcm: La valeur de grossismy passee par ', & 769 763 & 'run.def est differente de celle lue sur le fichier start ' 770 764 STOP … … 772 766 773 767 IF( grossismx.LT.1. ) THEN 774 write(lunout,*) 768 write(lunout,*) & 775 769 & 'conf_gcm: *** ATTENTION !! grossismx < 1 . *** ' 776 770 STOP … … 781 775 782 776 IF( grossismy.LT.1. ) THEN 783 write(lunout,*) 777 write(lunout,*) & 784 778 & 'conf_gcm: *** ATTENTION !! grossismy < 1 . *** ' 785 779 STOP … … 789 783 790 784 write(lunout,*)'conf_gcm: alphax alphay',alphax,alphay 791 c 792 calphax et alphay sont les anciennes formulat. des grossissements793 c 794 c 785 ! 786 ! alphax et alphay sont les anciennes formulat. des grossissements 787 ! 788 ! 795 789 796 790 !Config Key = fxyhypb … … 805 799 IF( fxyhypbb ) THEN 806 800 write(lunout,*)' ******** PBS DANS CONF_GCM ******** ' 807 write(lunout,*)' *** fxyhypb lu sur le fichier start est ', 808 *'F alors qu il est T sur run.def ***'801 write(lunout,*)' *** fxyhypb lu sur le fichier start est ', & 802 & 'F alors qu il est T sur run.def ***' 809 803 STOP 810 804 ENDIF … … 812 806 IF( .NOT.fxyhypbb ) THEN 813 807 write(lunout,*)' ******** PBS DANS CONF_GCM ******** ' 814 write(lunout,*)' *** fxyhypb lu sur le fichier start est ', 815 *'T alors qu il est F sur run.def **** '808 write(lunout,*)' *** fxyhypb lu sur le fichier start est ', & 809 & 'T alors qu il est F sur run.def **** ' 816 810 STOP 817 811 ENDIF 818 812 ENDIF 819 c 813 ! 820 814 !Config Key = dzoomx 821 815 !Config Desc = extension en longitude … … 828 822 IF( fxyhypb ) THEN 829 823 IF( ABS(dzoomx - dzoomxx).GE. 0.001 ) THEN 830 write(lunout,*)'conf_gcm: La valeur de dzoomx passee par ', 831 *'run.def est differente de celle lue sur le fichier start '824 write(lunout,*)'conf_gcm: La valeur de dzoomx passee par ', & 825 & 'run.def est differente de celle lue sur le fichier start ' 832 826 STOP 833 827 ENDIF … … 844 838 IF( fxyhypb ) THEN 845 839 IF( ABS(dzoomy - dzoomyy).GE. 0.001 ) THEN 846 write(lunout,*)'conf_gcm: La valeur de dzoomy passee par ', 847 *'run.def est differente de celle lue sur le fichier start '840 write(lunout,*)'conf_gcm: La valeur de dzoomy passee par ', & 841 & 'run.def est differente de celle lue sur le fichier start ' 848 842 STOP 849 843 ENDIF … … 859 853 IF( fxyhypb ) THEN 860 854 IF( ABS(taux - tauxx).GE. 0.001 ) THEN 861 write(lunout,*)'conf_gcm: La valeur de taux passee par ', 862 *'run.def est differente de celle lue sur le fichier start '855 write(lunout,*)'conf_gcm: La valeur de taux passee par ', & 856 & 'run.def est differente de celle lue sur le fichier start ' 863 857 STOP 864 858 ENDIF … … 874 868 IF( fxyhypb ) THEN 875 869 IF( ABS(tauy - tauyy).GE. 0.001 ) THEN 876 write(lunout,*)'conf_gcm: La valeur de tauy passee par ', 877 *'run.def est differente de celle lue sur le fichier start '870 write(lunout,*)'conf_gcm: La valeur de tauy passee par ', & 871 & 'run.def est differente de celle lue sur le fichier start ' 878 872 STOP 879 873 ENDIF … … 895 889 IF( ysinuss ) THEN 896 890 write(lunout,*)' ******** PBS DANS CONF_GCM ******** ' 897 write(lunout,*)' *** ysinus lu sur le fichier start est F', 898 *' alors qu il est T sur run.def ***'891 write(lunout,*)' *** ysinus lu sur le fichier start est F', & 892 & ' alors qu il est T sur run.def ***' 899 893 STOP 900 894 ENDIF … … 902 896 IF( .NOT.ysinuss ) THEN 903 897 write(lunout,*)' ******** PBS DANS CONF_GCM ******** ' 904 write(lunout,*)' *** ysinus lu sur le fichier start est T', 905 *' alors qu il est F sur run.def **** '898 write(lunout,*)' *** ysinus lu sur le fichier start est T', & 899 & ' alors qu il est F sur run.def **** ' 906 900 STOP 907 901 ENDIF … … 910 904 911 905 endif ! etatinit 912 c----------------------------------------906 !---------------------------------------- 913 907 914 908 … … 962 956 write(lunout,*)' ok_limit = ', ok_limit 963 957 write(lunout,*)' ok_etat0 = ', ok_etat0 964 write(lunout,*)' grilles_gcm_netcdf = ', grilles_gcm_netcdf965 958 if (planet_type=="titan") then 966 959 write(lunout,*)' moyzon_mu = ', moyzon_mu -
trunk/LMDZ.COMMON/libf/dyn3d/gcm.F
r1300 r1302 107 107 REAL ps(ip1jmp1) ! pression au sol 108 108 REAL p (ip1jmp1,llmp1 ) ! pression aux interfac.des couches 109 REAL pks(ip1jmp1) ! exner au sol110 REAL pk(ip1jmp1,llm) ! exner au milieu des couches111 REAL pkf(ip1jmp1,llm) ! exner filt.au milieu des couches112 109 REAL masse(ip1jmp1,llm) ! masse d'air 113 110 REAL phis(ip1jmp1) ! geopotentiel au sol … … 133 130 data call_iniphys/.true./ 134 131 135 REAL alpha(ip1jmp1,llm),beta(ip1jmp1,llm)136 132 c+jld variables test conservation energie 137 133 c REAL ecin(ip1jmp1,llm),ecin0(ip1jmp1,llm) … … 500 496 c ------------------------ 501 497 502 day_end=day_ini+nday 498 if (nday>=0) then ! standard case 499 day_end=day_ini+nday 500 else ! special case when nday <0, run -nday dynamical steps 501 day_end=day_ini-nday/day_step 502 endif 503 503 if (less1day) then 504 504 day_end=day_ini+floor(time_0+fractday) -
trunk/LMDZ.COMMON/libf/dyn3d/guide_mod.F90
r1300 r1302 437 437 ! Sauvegarde du guidage? 438 438 f_out=((MOD(itau,iguide_sav).EQ.0).AND.guide_sav) 439 IF (f_out) CALL guide_out("S ",jjp1,1,ps)439 IF (f_out) CALL guide_out("SP",jjp1,1,ps) 440 440 441 441 if (guide_u) then … … 447 447 if (guide_zon) CALL guide_zonave(1,jjp1,llm,f_add) 448 448 CALL guide_addfield(ip1jmp1,llm,f_add,alpha_u) 449 IF (f_out) CALL guide_out("U",jjp1,llm,f_add/factt) 449 IF (f_out) CALL guide_out("ua",jjp1,llm,(1.-tau)*ugui1+tau*ugui2) 450 IF (f_out) CALL guide_out("u",jjp1,llm,ucov) 451 IF (f_out) CALL guide_out("ucov",jjp1,llm,f_add/factt) 450 452 ucov=ucov+f_add 451 453 endif … … 459 461 if (guide_zon) CALL guide_zonave(2,jjp1,llm,f_add) 460 462 CALL guide_addfield(ip1jmp1,llm,f_add,alpha_T) 461 IF (f_out) CALL guide_out(" T",jjp1,llm,f_add/factt)463 IF (f_out) CALL guide_out("teta",jjp1,llm,f_add/factt) 462 464 teta=teta+f_add 463 465 endif … … 471 473 if (guide_zon) CALL guide_zonave(2,jjp1,1,f_add(1:ip1jmp1,1)) 472 474 CALL guide_addfield(ip1jmp1,1,f_add(1:ip1jmp1,1),alpha_P) 473 IF (f_out) CALL guide_out(" P",jjp1,1,f_add(1:ip1jmp1,1)/factt)475 IF (f_out) CALL guide_out("ps",jjp1,1,f_add(1:ip1jmp1,1)/factt) 474 476 ps=ps+f_add(1:ip1jmp1,1) 475 477 CALL pression(ip1jmp1,ap,bp,ps,p) … … 485 487 if (guide_zon) CALL guide_zonave(2,jjp1,llm,f_add) 486 488 CALL guide_addfield(ip1jmp1,llm,f_add,alpha_Q) 487 IF (f_out) CALL guide_out(" Q",jjp1,llm,f_add/factt)489 IF (f_out) CALL guide_out("q",jjp1,llm,f_add/factt) 488 490 q=q+f_add 489 491 endif … … 497 499 if (guide_zon) CALL guide_zonave(2,jjm,llm,f_add(1:ip1jm,:)) 498 500 CALL guide_addfield(ip1jm,llm,f_add(1:ip1jm,:),alpha_v) 499 IF (f_out) CALL guide_out("V",jjm,llm,f_add(1:ip1jm,:)/factt) 501 IF (f_out) CALL guide_out("v",jjm,llm,vcov) 502 IF (f_out) CALL guide_out("va",jjm,llm,(1.-tau)*vgui1+tau*vgui2) 503 IF (f_out) CALL guide_out("vcov",jjm,llm,f_add(1:ip1jm,:)/factt) 500 504 vcov=vcov+f_add(1:ip1jm,:) 501 505 endif … … 589 593 SUBROUTINE guide_interp(psi,teta) 590 594 595 use exner_hyb_m, only: exner_hyb 596 use exner_milieu_m, only: exner_milieu 591 597 IMPLICIT NONE 592 598 … … 610 616 REAL, DIMENSION (iip1,jjm,llm) :: pbary 611 617 ! Variables pour fonction Exner (P milieu couche) 612 REAL, DIMENSION (iip1,jjp1,llm) :: pk, pkf 613 REAL, DIMENSION (iip1,jjp1,llm) :: alpha, beta 618 REAL, DIMENSION (iip1,jjp1,llm) :: pk 614 619 REAL, DIMENSION (iip1,jjp1) :: pks 615 620 REAL :: prefkap,unskap … … 676 681 CALL pression( ip1jmp1, ap, bp, psi, p ) 677 682 if (pressure_exner) then 678 CALL exner_hyb(ip1jmp1,psi,p, alpha,beta,pks,pk,pkf)683 CALL exner_hyb(ip1jmp1,psi,p,pks,pk) 679 684 else 680 CALL exner_milieu(ip1jmp1,psi,p, beta,pks,pk,pkf)685 CALL exner_milieu(ip1jmp1,psi,p,pks,pk) 681 686 endif 682 687 ! .... Calcul de pls , pression au milieu des couches ,en Pascals … … 1507 1512 1508 1513 ! Variables entree 1509 CHARACTER , INTENT(IN) :: varname1514 CHARACTER*(*), INTENT(IN) :: varname 1510 1515 INTEGER, INTENT (IN) :: hsize,vsize 1511 1516 REAL, DIMENSION (iip1,hsize,vsize), INTENT(IN) :: field … … 1516 1521 INTEGER :: nid, id_lonu, id_lonv, id_latu, id_latv, id_tim, id_lev 1517 1522 INTEGER :: vid_lonu,vid_lonv,vid_latu,vid_latv,vid_cu,vid_cv,vid_lev 1523 INTEGER :: vid_au,vid_av 1518 1524 INTEGER, DIMENSION (3) :: dim3 1519 1525 INTEGER, DIMENSION (4) :: dim4,count,start 1520 INTEGER :: ierr, varid 1526 INTEGER :: ierr, varid,l 1527 REAL, DIMENSION (iip1,hsize,vsize) :: field2 1521 1528 1522 1529 print *,'Guide: output timestep',timestep,'var ',varname … … 1542 1549 ierr=NF_DEF_VAR(nid,"LEVEL",NF_FLOAT,1,id_lev,vid_lev) 1543 1550 ierr=NF_DEF_VAR(nid,"cu",NF_FLOAT,2,(/id_lonu,id_latu/),vid_cu) 1551 ierr=NF_DEF_VAR(nid,"au",NF_FLOAT,2,(/id_lonu,id_latu/),vid_au) 1544 1552 ierr=NF_DEF_VAR(nid,"cv",NF_FLOAT,2,(/id_lonv,id_latv/),vid_cv) 1553 ierr=NF_DEF_VAR(nid,"av",NF_FLOAT,2,(/id_lonv,id_latv/),vid_av) 1545 1554 1546 1555 ierr=NF_ENDDEF(nid) … … 1555 1564 ierr = NF_PUT_VAR_DOUBLE(nid,vid_cu,cu) 1556 1565 ierr = NF_PUT_VAR_DOUBLE(nid,vid_cv,cv) 1566 ierr = NF_PUT_VAR_DOUBLE(nid,vid_au,alpha_u) 1567 ierr = NF_PUT_VAR_DOUBLE(nid,vid_av,alpha_v) 1557 1568 #else 1558 1569 ierr = NF_PUT_VAR_REAL(nid,vid_lonu,rlonu*180./pi) … … 1563 1574 ierr = NF_PUT_VAR_REAL(nid,vid_cu,cu) 1564 1575 ierr = NF_PUT_VAR_REAL(nid,vid_cv,cv) 1576 ierr = NF_PUT_VAR_REAL(nid,vid_au,alpha_u) 1577 ierr = NF_PUT_VAR_REAL(nid,vid_av,alpha_v) 1565 1578 #endif 1566 1579 ! -------------------------------------------------------------------- … … 1579 1592 IF (guide_u) THEN 1580 1593 dim4=(/id_lonu,id_latu,id_lev,id_tim/) 1594 ierr = NF_DEF_VAR(nid,"u",NF_FLOAT,4,dim4,varid) 1595 ierr = NF_DEF_VAR(nid,"ua",NF_FLOAT,4,dim4,varid) 1581 1596 ierr = NF_DEF_VAR(nid,"ucov",NF_FLOAT,4,dim4,varid) 1582 1597 ENDIF … … 1584 1599 IF (guide_v) THEN 1585 1600 dim4=(/id_lonv,id_latv,id_lev,id_tim/) 1601 ierr = NF_DEF_VAR(nid,"v",NF_FLOAT,4,dim4,varid) 1602 ierr = NF_DEF_VAR(nid,"va",NF_FLOAT,4,dim4,varid) 1586 1603 ierr = NF_DEF_VAR(nid,"vcov",NF_FLOAT,4,dim4,varid) 1587 1604 ENDIF … … 1606 1623 ierr=NF_OPEN("guide_ins.nc",NF_WRITE,nid) 1607 1624 1625 IF (varname=="SP") timestep=timestep+1 1626 1627 ierr = NF_INQ_VARID(nid,varname,varid) 1608 1628 SELECT CASE (varname) 1609 CASE ("S") 1610 timestep=timestep+1 1611 ierr = NF_INQ_VARID(nid,"SP",varid) 1629 CASE ("SP","ps") 1612 1630 start=(/1,1,timestep,0/) 1613 1631 count=(/iip1,jjp1,1,0/) 1614 #ifdef NC_DOUBLE 1615 ierr = NF_PUT_VARA_DOUBLE(nid,varid,start,count,field) 1616 #else 1617 ierr = NF_PUT_VARA_REAL(nid,varid,start,count,field) 1618 #endif 1619 CASE ("P") 1620 ierr = NF_INQ_VARID(nid,"ps",varid) 1621 start=(/1,1,timestep,0/) 1622 count=(/iip1,jjp1,1,0/) 1623 #ifdef NC_DOUBLE 1624 ierr = NF_PUT_VARA_DOUBLE(nid,varid,start,count,field) 1625 #else 1626 ierr = NF_PUT_VARA_REAL(nid,varid,start,count,field) 1627 #endif 1628 CASE ("U") 1629 ierr = NF_INQ_VARID(nid,"ucov",varid) 1632 CASE ("v","va","vcov") 1633 start=(/1,1,1,timestep/) 1634 count=(/iip1,jjm,llm,1/) 1635 CASE DEFAULT 1630 1636 start=(/1,1,1,timestep/) 1631 1637 count=(/iip1,jjp1,llm,1/) 1638 END SELECT 1639 1640 SELECT CASE (varname) 1641 CASE("u","ua") 1642 DO l=1,llm ; field2(:,2:jjm,l)=field(:,2:jjm,l)/cu(:,2:jjm) ; ENDDO 1643 field2(:,1,:)=0. ; field2(:,jjp1,:)=0. 1644 CASE("v","va") 1645 DO l=1,llm ; field2(:,:,l)=field(:,:,l)/cv(:,:) ; ENDDO 1646 CASE DEFAULT 1647 field2=field 1648 END SELECT 1649 1650 1632 1651 #ifdef NC_DOUBLE 1633 ierr = NF_PUT_VARA_DOUBLE(nid,varid,start,count,field)1652 ierr = NF_PUT_VARA_DOUBLE(nid,varid,start,count,field2) 1634 1653 #else 1635 ierr = NF_PUT_VARA_REAL(nid,varid,start,count,field)1654 ierr = NF_PUT_VARA_REAL(nid,varid,start,count,field2) 1636 1655 #endif 1637 CASE ("V") 1638 ierr = NF_INQ_VARID(nid,"vcov",varid) 1639 start=(/1,1,1,timestep/) 1640 count=(/iip1,jjm,llm,1/) 1641 #ifdef NC_DOUBLE 1642 ierr = NF_PUT_VARA_DOUBLE(nid,varid,start,count,field) 1643 #else 1644 ierr = NF_PUT_VARA_REAL(nid,varid,start,count,field) 1645 #endif 1646 CASE ("T") 1647 ierr = NF_INQ_VARID(nid,"teta",varid) 1648 start=(/1,1,1,timestep/) 1649 count=(/iip1,jjp1,llm,1/) 1650 #ifdef NC_DOUBLE 1651 ierr = NF_PUT_VARA_DOUBLE(nid,varid,start,count,field) 1652 #else 1653 ierr = NF_PUT_VARA_REAL(nid,varid,start,count,field) 1654 #endif 1655 CASE ("Q") 1656 ierr = NF_INQ_VARID(nid,"q",varid) 1657 start=(/1,1,1,timestep/) 1658 count=(/iip1,jjp1,llm,1/) 1659 #ifdef NC_DOUBLE 1660 ierr = NF_PUT_VARA_DOUBLE(nid,varid,start,count,field) 1661 #else 1662 ierr = NF_PUT_VARA_REAL(nid,varid,start,count,field) 1663 #endif 1664 END SELECT 1665 1656 1666 1657 ierr = NF_CLOSE(nid) 1667 1658 -
trunk/LMDZ.COMMON/libf/dyn3d/leapfrog.F
r1189 r1302 20 20 & ok_dynzon,periodav,ok_dyn_ave,iecri, 21 21 & ok_dyn_ins,output_grads_dyn 22 use exner_hyb_m, only: exner_hyb 23 use exner_milieu_m, only: exner_milieu 22 24 use cpdet_mod, only: cpdet,tpot2t,t2tpot 23 25 use sponge_mod, only: callsponge,mode_sponge,sponge … … 217 219 endif 218 220 219 itaufin = nday*day_step 221 if (nday>=0) then 222 itaufin = nday*day_step 223 else 224 ! to run a given (-nday) number of dynamical steps 225 itaufin = -nday 226 endif 220 227 if (less1day) then 221 228 c MODIF VENUS: to run less than one day: … … 262 269 CALL pression ( ip1jmp1, ap, bp, ps, p ) 263 270 if (pressure_exner) then 264 CALL exner_hyb( ip1jmp1, ps, p, alpha,beta,pks, pk, pkf )271 CALL exner_hyb( ip1jmp1, ps, p, pks, pk, pkf ) 265 272 else 266 CALL exner_milieu( ip1jmp1, ps, p, beta,pks, pk, pkf )273 CALL exner_milieu( ip1jmp1, ps, p, pks, pk, pkf ) 267 274 endif 268 275 … … 476 483 CALL pression ( ip1jmp1, ap, bp, ps, p ) 477 484 if (pressure_exner) then 478 CALL exner_hyb( ip1jmp1, ps, p, alpha,beta,pks, pk, pkf )485 CALL exner_hyb( ip1jmp1, ps, p,pks, pk, pkf ) 479 486 else 480 CALL exner_milieu( ip1jmp1, ps, p, beta,pks, pk, pkf )487 CALL exner_milieu( ip1jmp1, ps, p, pks, pk, pkf ) 481 488 endif 489 490 ! Compute geopotential (physics might need it) 491 CALL geopot ( ip1jmp1, teta , pk , pks, phis , phi ) 482 492 483 493 jD_cur = jD_ref + day_ini - day_ref + & … … 551 561 CALL massdair(p,masse) 552 562 if (pressure_exner) then 553 CALL exner_hyb( ip1jmp1,ps,p,alpha,beta,pks,pk,pkf)563 CALL exner_hyb( ip1jmp1, ps, p, pks, pk, pkf ) 554 564 else 555 CALL exner_milieu( ip1jmp1,ps,p,beta,pks,pk,pkf)565 CALL exner_milieu( ip1jmp1, ps, p, pks, pk, pkf ) 556 566 endif 557 567 … … 604 614 CALL pression ( ip1jmp1, ap, bp, ps, p ) 605 615 if (pressure_exner) then 606 CALL exner_hyb( ip1jmp1, ps, p, alpha,beta,pks, pk, pkf )616 CALL exner_hyb( ip1jmp1, ps, p, pks, pk, pkf ) 607 617 else 608 CALL exner_milieu( ip1jmp1, ps, p, beta,pks, pk, pkf )618 CALL exner_milieu( ip1jmp1, ps, p, pks, pk, pkf ) 609 619 endif 610 620 CALL massdair(p,masse) -
trunk/LMDZ.COMMON/libf/dyn3d/logic.h
r1056 r1302 11 11 & statcl,conser,apdiss,apdelq,saison,ecripar,fxyhypb,ysinus & 12 12 & ,read_start,ok_guide,ok_strato,tidal,ok_gradsfile & 13 & ,ok_limit,ok_etat0, grilles_gcm_netcdf,hybrid&13 & ,ok_limit,ok_etat0,hybrid & 14 14 & ,moyzon_mu,moyzon_ch 15 15 … … 19 19 & apdiss,apdelq,saison,ecripar,fxyhypb,ysinus & 20 20 & ,read_start,ok_guide,ok_strato,tidal,ok_gradsfile & 21 & ,ok_limit,ok_etat0,grilles_gcm_netcdf 21 & ,ok_limit,ok_etat0 22 22 23 logical hybrid ! vertical coordinate is hybrid if true (sigma otherwise) 23 24 ! (only used if disvert_type==2) -
trunk/LMDZ.COMMON/libf/dyn3d_common/disvert.F90
r1300 r1302 1 1 ! $Id: disvert.F90 1645 2012-07-30 16:01:50Z lguez $ 2 2 3 SUBROUTINE disvert( pa,preff,ap,bp,dpres,presnivs,nivsigs,nivsig,scaleheight)3 SUBROUTINE disvert() 4 4 5 5 ! Auteur : P. Le Van 6 6 7 #ifdef CPP_IOIPSL 8 use ioipsl, only: getin 9 #else 10 USE ioipsl_getincom, only: getin 11 #endif 7 12 use new_unit_m, only: new_unit 8 use ioipsl, only: getin9 13 use assert_m, only: assert 10 14 … … 13 17 include "dimensions.h" 14 18 include "paramet.h" 19 include "comvert.h" 20 include "comconst.h" 15 21 include "iniprint.h" 16 22 include "logic.h" 17 23 18 ! s = sigma ** kappa : coordonnee verticale 19 ! dsig(l) : epaisseur de la couche l ds la coord. s 20 ! sig(l) : sigma a l'interface des couches l et l-1 21 ! ds(l) : distance entre les couches l et l-1 en coord.s 22 23 real,intent(in) :: pa, preff 24 real,intent(out) :: ap(llmp1) ! in Pa 25 real, intent(out):: bp(llmp1) 26 real,intent(out) :: dpres(llm), nivsigs(llm), nivsig(llmp1) 27 real,intent(out) :: presnivs(llm) 28 real,intent(out) :: scaleheight 29 24 !------------------------------------------------------------------------------- 25 ! Purpose: Vertical distribution functions for LMDZ. 26 ! Triggered by the levels number llm. 27 !------------------------------------------------------------------------------- 28 ! Read in "comvert.h": 29 ! pa !--- PURE PRESSURE COORDINATE FOR P<pa (in Pascals) 30 ! preff !--- REFERENCE PRESSURE (101325 Pa) 31 ! Written in "comvert.h": 32 ! ap(llm+1), bp(llm+1) !--- Ap, Bp HYBRID COEFFICIENTS AT INTERFACES 33 ! aps(llm), bps(llm) !--- Ap, Bp HYBRID COEFFICIENTS AT MID-LAYERS 34 ! dpres(llm) !--- PRESSURE DIFFERENCE FOR EACH LAYER 35 ! presnivs(llm) !--- PRESSURE AT EACH MID-LAYER 36 ! scaleheight !--- VERTICAL SCALE HEIGHT (Earth: 8kms) 37 ! nivsig(llm+1) !--- SIGMA INDEX OF EACH LAYER INTERFACE 38 ! nivsigs(llm) !--- SIGMA INDEX OF EACH MID-LAYER 39 !------------------------------------------------------------------------------- 40 ! Local variables: 30 41 REAL sig(llm+1), dsig(llm) 31 real zk, zkm1, dzk1, dzk2, k0, k1 42 REAL sig0(llm+1), zz(llm+1) 43 REAL zk, zkm1, dzk1, dzk2, z, k0, k1 32 44 33 45 INTEGER l, unit 34 46 REAL dsigmin 47 REAL vert_scale,vert_dzmin,vert_dzlow,vert_z0low,vert_dzmid,vert_z0mid,vert_h_mid,vert_dzhig,vert_z0hig,vert_h_hig 48 35 49 REAL alpha, beta, deltaz 36 50 REAL x 37 51 character(len=*),parameter :: modname="disvert" 38 52 39 character(len= 6):: vert_sampling53 character(len=24):: vert_sampling 40 54 ! (allowed values are "param", "tropo", "strato" and "read") 41 55 42 56 !----------------------------------------------------------------------- 43 57 44 print *, "Call sequence information: disvert"58 WRITE(lunout,*) TRIM(modname)//" starts" 45 59 46 60 ! default scaleheight is 8km for earth … … 49 63 vert_sampling = merge("strato", "tropo ", ok_strato) ! default value 50 64 call getin('vert_sampling', vert_sampling) 51 print *, 'vert_sampling = ' // vert_sampling 65 WRITE(lunout,*) TRIM(modname)//' vert_sampling = ' // vert_sampling 66 if (llm==39 .and. vert_sampling=="strato") then 67 dsigmin=0.3 ! Vieille option par défaut pour CMIP5 68 else 69 dsigmin=1. 70 endif 71 call getin('dsigmin', dsigmin) 72 WRITE(LUNOUT,*) trim(modname), 'Discretisation verticale DSIGMIN=',dsigmin 73 52 74 53 75 select case (vert_sampling) … … 86 108 87 109 ap = pa * (sig - bp) 88 case(" tropo")110 case("sigma") 89 111 DO l = 1, llm 90 112 x = 2*asin(1.) * (l - 0.5) / (llm + 1) 91 dsig(l) = 1.0+ 7.0 * SIN(x)**2113 dsig(l) = dsigmin + 7.0 * SIN(x)**2 92 114 ENDDO 93 115 dsig = dsig / sum(dsig) … … 98 120 99 121 bp(1)=1. 122 bp(2: llm) = sig(2:llm) 123 bp(llmp1) = 0. 124 ap(:)=0. 125 case("tropo") 126 DO l = 1, llm 127 x = 2*asin(1.) * (l - 0.5) / (llm + 1) 128 dsig(l) = dsigmin + 7.0 * SIN(x)**2 129 ENDDO 130 dsig = dsig / sum(dsig) 131 sig(llm+1) = 0. 132 DO l = llm, 1, -1 133 sig(l) = sig(l+1) + dsig(l) 134 ENDDO 135 136 bp(1)=1. 100 137 bp(2: llm) = EXP(1. - 1. / sig(2: llm)**2) 101 138 bp(llmp1) = 0. … … 104 141 ap(2: llm + 1) = pa * (sig(2: llm + 1) - bp(2: llm + 1)) 105 142 case("strato") 106 if (llm==39) then107 dsigmin=0.3108 else if (llm==50) then109 dsigmin=1.110 else111 write(lunout,*) trim(modname), ' ATTENTION discretisation z a ajuster'112 dsigmin=1.113 endif114 WRITE(LUNOUT,*) trim(modname), 'Discretisation verticale DSIGMIN=',dsigmin115 116 143 DO l = 1, llm 117 144 x = 2*asin(1.) * (l - 0.5) / (llm + 1) … … 131 158 ap(1)=0. 132 159 ap(2: llm + 1) = pa * (sig(2: llm + 1) - bp(2: llm + 1)) 160 case("strato_correct") 161 !================================================================== 162 ! Fredho 2014/05/18, Saint-Louis du Senegal 163 ! Cette version de la discretisation strato est corrige au niveau 164 ! du passage des sig aux ap, bp 165 ! la version precedente donne un coude dans l'epaisseur des couches 166 ! vers la tropopause 167 !================================================================== 168 169 170 DO l = 1, llm 171 x = 2*asin(1.) * (l - 0.5) / (llm + 1) 172 dsig(l) =(dsigmin + 7. * SIN(x)**2) & 173 *(0.5*(1.-tanh(1.*(x-asin(1.))/asin(1.))))**2 174 ENDDO 175 dsig = dsig / sum(dsig) 176 sig0(llm+1) = 0. 177 DO l = llm, 1, -1 178 sig0(l) = sig0(l+1) + dsig(l) 179 ENDDO 180 sig=racinesig(sig0) 181 182 bp(1)=1. 183 bp(2:llm)=EXP(1.-1./sig(2: llm)**2) 184 bp(llmp1)=0. 185 186 ap(1)=0. 187 ap(2:llm)=pa*(sig(2:llm)-bp(2:llm)) 188 ap(llm+1)=0. 189 190 CASE("strato_custom0") 191 !======================================================= 192 ! Version Transitoire 193 ! custumize strato distribution with specific alpha & beta values and function 194 ! depending on llm (experimental and temporary)! 195 SELECT CASE (llm) 196 CASE(55) 197 alpha=0.45 198 beta=4.0 199 CASE(63) 200 alpha=0.45 201 beta=5.0 202 CASE(71) 203 alpha=3.05 204 beta=65. 205 CASE(79) 206 alpha=3.20 207 ! alpha=2.05 ! FLOTT 79 (PLANTE) 208 beta=70. 209 END SELECT 210 ! Or used values provided by user in def file: 211 CALL getin("strato_alpha",alpha) 212 CALL getin("strato_beta",beta) 213 214 ! Build geometrical distribution 215 scaleheight=7. 216 zz(1)=0. 217 IF (llm==55.OR.llm==63) THEN 218 DO l=1,llm 219 z=zz(l)/scaleheight 220 zz(l+1)=zz(l)+0.03+z*1.5*(1.-TANH(z-0.5))+alpha*(1.+TANH(z-1.5)) & 221 +5.0*EXP((l-llm)/beta) 222 ENDDO 223 ELSEIF (llm==71) THEN !.OR.llm==79) THEN ! FLOTT 79 (PLANTE) 224 DO l=1,llm 225 z=zz(l) 226 zz(l+1)=zz(l)+0.02+0.88*TANH(z/2.5)+alpha*(1.+TANH((z-beta)/15.)) 227 ENDDO 228 ELSEIF (llm==79) THEN 229 DO l=1,llm 230 z=zz(l) 231 zz(l+1)=zz(l)+0.02+0.80*TANH(z/3.8)+alpha*(1+TANH((z-beta)/17.)) & 232 +0.03*TANH(z/.25) 233 ENDDO 234 ENDIF ! of IF (llm==55.OR.llm==63) ... 235 236 237 ! Build sigma distribution 238 sig0=EXP(-zz(:)/scaleheight) 239 sig0(llm+1)=0. 240 ! sig=ridders(sig0) 241 sig=racinesig(sig0) 242 243 ! Compute ap() and bp() 244 bp(1)=1. 245 bp(2:llm)=EXP(1.-1./sig(2:llm)**2) 246 bp(llm+1)=0. 247 ap=pa*(sig-bp) 248 249 CASE("strato_custom") 250 !=================================================================== 251 ! David Cugnet, François Lott, Lionel Guez, Ehouoarn Millour, Fredho 252 ! 2014/05 253 ! custumize strato distribution 254 ! Al the parameter are given in km assuming a given scalehigh 255 vert_scale=7. ! scale hight 256 vert_dzmin=0.02 ! width of first layer 257 vert_dzlow=1. ! dz in the low atmosphere 258 vert_z0low=8. ! height at which resolution recches dzlow 259 vert_dzmid=3. ! dz in the mid atmsophere 260 vert_z0mid=70. ! height at which resolution recches dzmid 261 vert_h_mid=20. ! width of the transition 262 vert_dzhig=11. ! dz in the high atmsophere 263 vert_z0hig=80. ! height at which resolution recches dz 264 vert_h_hig=20. ! width of the transition 265 !=================================================================== 266 267 call getin('vert_scale',vert_scale) 268 call getin('vert_dzmin',vert_dzmin) 269 call getin('vert_dzlow',vert_dzlow) 270 call getin('vert_z0low',vert_z0low) 271 CALL getin('vert_dzmid',vert_dzmid) 272 CALL getin('vert_z0mid',vert_z0mid) 273 call getin('vert_h_mid',vert_h_mid) 274 call getin('vert_dzhig',vert_dzhig) 275 call getin('vert_z0hig',vert_z0hig) 276 call getin('vert_h_hig',vert_h_hig) 277 278 scaleheight=vert_scale ! for consistency with further computations 279 ! Build geometrical distribution 280 zz(1)=0. 281 DO l=1,llm 282 z=zz(l) 283 zz(l+1)=zz(l)+vert_dzmin+vert_dzlow*TANH(z/vert_z0low)+ & 284 & (vert_dzmid-vert_dzlow)* & 285 & (TANH((z-vert_z0mid)/vert_h_mid)-TANH((-vert_z0mid)/vert_h_mid)) & 286 & +(vert_dzhig-vert_dzmid-vert_dzlow)* & 287 & (TANH((z-vert_z0hig)/vert_h_hig)-TANH((-vert_z0hig)/vert_h_hig)) 288 ENDDO 289 290 291 !=================================================================== 292 ! Comment added Fredho 2014/05/18, Saint-Louis, Senegal 293 ! From approximate z to ap, bp, so that p=ap+bp*p0 and p/p0=exp(-z/H) 294 ! sig0 is p/p0 295 ! sig is an intermediate distribution introduce to estimate bp 296 ! 1. sig0=exp(-z/H) 297 ! 2. inversion of sig0=(1-pa/p0)*sig+(1-pa/p0)*exp(1-1/sig**2) 298 ! 3. bp=exp(1-1/sig**2) 299 ! 4. ap deduced from the combination of 2 and 3 so that sig0=ap/p0+bp 300 !=================================================================== 301 302 sig0=EXP(-zz(:)/vert_scale) 303 sig0(llm+1)=0. 304 sig=racinesig(sig0) 305 bp(1)=1. 306 bp(2:llm)=EXP(1.-1./sig(2:llm)**2) 307 bp(llm+1)=0. 308 ap=pa*(sig-bp) 309 133 310 case("read") 134 311 ! Read "ap" and "bp". First line is skipped (title line). "ap" … … 178 355 write(lunout, *) presnivs 179 356 357 CONTAINS 358 359 !------------------------------------------------------------------------------- 360 ! 361 FUNCTION ridders(sig) RESULT(sg) 362 ! 363 !------------------------------------------------------------------------------- 364 IMPLICIT NONE 365 !------------------------------------------------------------------------------- 366 ! Purpose: Search for s solving (Pa/Preff)*s+(1-Pa/Preff)*EXP(1-1./s**2)=sg 367 ! Notes: Uses Ridders' method, quite robust. Initial bracketing: 0<=sg<=1. 368 ! Reference: Ridders, C. F. J. "A New Algorithm for Computing a Single Root of a 369 ! Real Continuous Function" IEEE Trans. Circuits Systems 26, 979-980, 1979 370 !------------------------------------------------------------------------------- 371 ! Arguments: 372 REAL, INTENT(IN) :: sig(:) 373 REAL :: sg(SIZE(sig)) 374 !------------------------------------------------------------------------------- 375 ! Local variables: 376 INTEGER :: it, ns, maxit 377 REAL :: c1, c2, x1, x2, x3, x4, f1, f2, f3, f4, s, xx, distrib 378 !------------------------------------------------------------------------------- 379 ns=SIZE(sig); maxit=9999 380 c1=Pa/Preff; c2=1.-c1 381 DO l=1,ns 382 xx=HUGE(1.) 383 x1=0.0; f1=distrib(x1,c1,c2,sig(l)) 384 x2=1.0; f2=distrib(x2,c1,c2,sig(l)) 385 DO it=1,maxit 386 x3=0.5*(x1+x2); f3=distrib(x3,c1,c2,sig(l)) 387 s=SQRT(f3**2-f1*f2); IF(s==0.) EXIT 388 x4=x3+(x3-x1)*(SIGN(1.,f1-f2)*f3/s); IF(ABS(10.*LOG(x4-xx))<=1E-5) EXIT 389 xx=x4; f4=distrib(x4,c1,c2,sig(l)); IF(f4==0.) EXIT 390 IF(SIGN(f3,f4)/=f3) THEN; x1=x3; f1=f3; x2=xx; f2=f4 391 ELSE IF(SIGN(f1,f4)/=f1) THEN; x2=xx; f2=f4 392 ELSE IF(SIGN(f2,f4)/=f2) THEN; x1=xx; f1=f4 393 ELSE; CALL abort_gcm("ridders",'Algorithm failed (which is odd...') 394 END IF 395 IF(ABS(10.*LOG(ABS(x2-x1)))<=1E-5) EXIT !--- ERROR ON SIG <= 0.01m 396 END DO 397 IF(it==maxit+1) WRITE(lunout,'(a,i3)')'WARNING in ridder: failed to converg& 398 &e for level ',l 399 sg(l)=xx 400 END DO 401 sg(1)=1.; sg(ns)=0. 402 403 END FUNCTION ridders 404 405 FUNCTION racinesig(sig) RESULT(sg) 406 ! 407 !------------------------------------------------------------------------------- 408 IMPLICIT NONE 409 !------------------------------------------------------------------------------- 410 ! Fredho 2014/05/18 411 ! Purpose: Search for s solving (Pa/Preff)*sg+(1-Pa/Preff)*EXP(1-1./sg**2)=s 412 ! Notes: Uses Newton Raphson search 413 !------------------------------------------------------------------------------- 414 ! Arguments: 415 REAL, INTENT(IN) :: sig(:) 416 REAL :: sg(SIZE(sig)) 417 !------------------------------------------------------------------------------- 418 ! Local variables: 419 INTEGER :: it, ns, maxit 420 REAL :: c1, c2, x1, x2, x3, x4, f1, f2, f3, f4, s, xx, distrib 421 !------------------------------------------------------------------------------- 422 ns=SIZE(sig); maxit=100 423 c1=Pa/Preff; c2=1.-c1 424 DO l=2,ns-1 425 sg(l)=sig(l) 426 DO it=1,maxit 427 f1=exp(1-1./sg(l)**2)*(1.-c1) 428 sg(l)=sg(l)-(c1*sg(l)+f1-sig(l))/(c1+2*f1*sg(l)**(-3)) 429 ENDDO 430 ! print*,'SSSSIG ',sig(l),sg(l),c1*sg(l)+exp(1-1./sg(l)**2)*(1.-c1) 431 ENDDO 432 sg(1)=1.; sg(ns)=0. 433 434 END FUNCTION racinesig 435 436 437 438 180 439 END SUBROUTINE disvert 440 441 !------------------------------------------------------------------------------- 442 443 FUNCTION distrib(x,c1,c2,x0) RESULT(res) 444 ! 445 !------------------------------------------------------------------------------- 446 ! Arguments: 447 REAL, INTENT(IN) :: x, c1, c2, x0 448 REAL :: res 449 !------------------------------------------------------------------------------- 450 res=c1*x+c2*EXP(1-1/(x**2))-x0 451 452 END FUNCTION distrib 453 454 455 -
trunk/LMDZ.COMMON/libf/dyn3d_common/exner_hyb_m.F90
r1300 r1302 1 ! 2 ! $Id $ 3 ! 4 SUBROUTINE exner_hyb ( ngrid, ps, p,alpha,beta, pks, pk, pkf ) 5 c 6 c Auteurs : P.Le Van , Fr. Hourdin . 7 c .......... 8 c 9 c .... ngrid, ps,p sont des argum.d'entree au sous-prog ... 10 c .... alpha,beta, pks,pk,pkf sont des argum.de sortie au sous-prog ... 11 c 12 c ************************************************************************ 13 c Calcule la fonction d'Exner pk = Cp * p ** kappa , aux milieux des 14 c couches . Pk(l) sera calcule aux milieux des couches l ,entre les 15 c pressions p(l) et p(l+1) ,definis aux interfaces des llm couches . 16 c ************************************************************************ 17 c .. N.B : Au sommet de l'atmosphere, p(llm+1) = 0. , et ps et pks sont 18 c la pression et la fonction d'Exner au sol . 19 c 20 c -------- z 21 c A partir des relations ( 1 ) p*dz(pk) = kappa *pk*dz(p) et 22 c ( 2 ) pk(l) = alpha(l)+ beta(l)*pk(l-1) 23 c ( voir note de Fr.Hourdin ) , 24 c 25 c on determine successivement , du haut vers le bas des couches, les 26 c coef. alpha(llm),beta(llm) .,.,alpha(l),beta(l),,,alpha(2),beta(2), 27 c puis pk(ij,1). Ensuite ,on calcule,du bas vers le haut des couches, 28 c pk(ij,l) donne par la relation (2), pour l = 2 a l = llm . 29 c 30 c 31 IMPLICIT NONE 32 c 33 #include "dimensions.h" 34 #include "paramet.h" 35 #include "comconst.h" 36 #include "comgeom.h" 37 #include "comvert.h" 38 #include "serre.h" 1 module exner_hyb_m 39 2 40 INTEGER ngrid 41 REAL p(ngrid,llmp1),pk(ngrid,llm),pkf(ngrid,llm) 42 REAL ps(ngrid),pks(ngrid), alpha(ngrid,llm),beta(ngrid,llm) 3 IMPLICIT NONE 43 4 44 c .... variables locales ...5 contains 45 6 46 INTEGER l, ij 47 REAL unpl2k,dellta 7 SUBROUTINE exner_hyb ( ngrid, ps, p, pks, pk, pkf ) 48 8 49 REAL ppn(iim),pps(iim) 50 REAL xpn, xps 51 REAL SSUM 52 c 53 logical,save :: firstcall=.true. 54 character(len=*),parameter :: modname="exner_hyb" 55 56 ! Sanity check 57 if (firstcall) then 58 ! sanity checks for Shallow Water case (1 vertical layer) 59 if (llm.eq.1) then 9 ! Auteurs : P.Le Van , Fr. Hourdin . 10 ! .......... 11 ! 12 ! .... ngrid, ps,p sont des argum.d'entree au sous-prog ... 13 ! .... pks,pk,pkf sont des argum.de sortie au sous-prog ... 14 ! 15 ! ************************************************************************ 16 ! Calcule la fonction d'Exner pk = Cp * (p/preff) ** kappa , aux milieux des 17 ! couches . Pk(l) sera calcule aux milieux des couches l ,entre les 18 ! pressions p(l) et p(l+1) ,definis aux interfaces des llm couches . 19 ! ************************************************************************ 20 ! .. N.B : Au sommet de l'atmosphere, p(llm+1) = 0. , et ps et pks sont 21 ! la pression et la fonction d'Exner au sol . 22 ! 23 ! -------- z 24 ! A partir des relations ( 1 ) p*dz(pk) = kappa *pk*dz(p) et 25 ! ( 2 ) pk(l) = alpha(l)+ beta(l)*pk(l-1) 26 ! ( voir note de Fr.Hourdin ) , 27 ! 28 ! on determine successivement , du haut vers le bas des couches, les 29 ! coef. alpha(llm),beta(llm) .,.,alpha(l),beta(l),,,alpha(2),beta(2), 30 ! puis pk(ij,1). Ensuite ,on calcule,du bas vers le haut des couches, 31 ! pk(ij,l) donne par la relation (2), pour l = 2 a l = llm . 32 ! 33 ! 34 ! 35 include "dimensions.h" 36 include "paramet.h" 37 include "comconst.h" 38 include "comgeom.h" 39 include "comvert.h" 40 include "serre.h" 41 42 INTEGER ngrid 43 REAL p(ngrid,llmp1),pk(ngrid,llm) 44 real, optional:: pkf(ngrid,llm) 45 REAL ps(ngrid),pks(ngrid), alpha(ngrid,llm),beta(ngrid,llm) 46 47 ! .... variables locales ... 48 49 INTEGER l, ij 50 REAL unpl2k,dellta 51 52 logical,save :: firstcall=.true. 53 character(len=*),parameter :: modname="exner_hyb" 54 55 ! Sanity check 56 if (firstcall) then 57 ! sanity checks for Shallow Water case (1 vertical layer) 58 if (llm.eq.1) then 60 59 if (kappa.ne.1) then 61 call abort_gcm(modname,62 &"kappa!=1 , but running in Shallow Water mode!!",42)60 call abort_gcm(modname, & 61 "kappa!=1 , but running in Shallow Water mode!!",42) 63 62 endif 64 63 if (cpp.ne.r) then 65 call abort_gcm(modname,66 &"cpp!=r , but running in Shallow Water mode!!",42)64 call abort_gcm(modname, & 65 "cpp!=r , but running in Shallow Water mode!!",42) 67 66 endif 68 67 endif ! of if (llm.eq.1) 69 68 70 71 69 firstcall=.false. 70 endif ! of if (firstcall) 72 71 73 if (llm.eq.1) then 74 75 ! Compute pks(:),pk(:),pkf(:) 76 77 DO ij = 1, ngrid 78 pks(ij) = (cpp/preff) * ps(ij) 72 ! Specific behaviour for Shallow Water (1 vertical layer) case: 73 if (llm.eq.1) then 74 75 ! Compute pks(:),pk(:),pkf(:) 76 77 DO ij = 1, ngrid 78 pks(ij) = (cpp/preff) * ps(ij) 79 79 pk(ij,1) = .5*pks(ij) 80 ENDDO 81 82 CALL SCOPY ( ngrid * llm, pk, 1, pkf, 1 ) 83 CALL filtreg ( pkf, jmp1, llm, 2, 1, .TRUE., 1 ) 84 85 ! our work is done, exit routine 86 return 80 ENDDO 87 81 88 endif ! of if (llm.eq.1) 82 if (present(pkf)) then 83 pkf = pk 84 CALL filtreg ( pkf, jmp1, llm, 2, 1, .TRUE., 1 ) 85 end if 89 86 90 !!!! General case: 91 92 unpl2k = 1.+ 2.* kappa 93 c 94 DO ij = 1, ngrid 95 pks(ij) = cpp * ( ps(ij)/preff ) ** kappa 96 ENDDO 87 ! our work is done, exit routine 88 return 89 endif ! of if (llm.eq.1) 97 90 98 DO ij = 1, iim 99 ppn(ij) = aire( ij ) * pks( ij ) 100 pps(ij) = aire(ij+ip1jm) * pks(ij+ip1jm ) 101 ENDDO 102 xpn = SSUM(iim,ppn,1) /apoln 103 xps = SSUM(iim,pps,1) /apols 91 ! General case: 104 92 105 DO ij = 1, iip1 106 pks( ij ) = xpn 107 pks( ij+ip1jm ) = xps 108 ENDDO 109 c 110 c 111 c .... Calcul des coeff. alpha et beta pour la couche l = llm .. 112 c 113 DO ij = 1, ngrid 93 unpl2k = 1.+ 2.* kappa 94 95 ! ------------- 96 ! Calcul de pks 97 ! ------------- 98 99 DO ij = 1, ngrid 100 pks(ij) = cpp * ( ps(ij)/preff ) ** kappa 101 ENDDO 102 103 ! .... Calcul des coeff. alpha et beta pour la couche l = llm .. 104 ! 105 DO ij = 1, ngrid 114 106 alpha(ij,llm) = 0. 115 107 beta (ij,llm) = 1./ unpl2k 116 ENDDO 117 c 118 c ... Calcul des coeff. alpha et beta pour l = llm-1 a l = 2 ... 119 c 120 DO l = llm -1 , 2 , -1 121 c 122 DO ij = 1, ngrid 123 dellta = p(ij,l)* unpl2k + p(ij,l+1)* ( beta(ij,l+1)-unpl2k ) 124 alpha(ij,l) = - p(ij,l+1) / dellta * alpha(ij,l+1) 125 beta (ij,l) = p(ij,l ) / dellta 126 ENDDO 127 c 128 ENDDO 129 c 130 c *********************************************************************** 131 c ..... Calcul de pk pour la couche 1 , pres du sol .... 132 c 133 DO ij = 1, ngrid 134 pk(ij,1) = ( p(ij,1)*pks(ij) - 0.5*alpha(ij,2)*p(ij,2) ) / 135 * ( p(ij,1)* (1.+kappa) + 0.5*( beta(ij,2)-unpl2k )* p(ij,2) ) 136 ENDDO 137 c 138 c ..... Calcul de pk(ij,l) , pour l = 2 a l = llm ........ 139 c 140 DO l = 2, llm 141 DO ij = 1, ngrid 142 pk(ij,l) = alpha(ij,l) + beta(ij,l) * pk(ij,l-1) 143 ENDDO 144 ENDDO 145 c 146 c 147 CALL SCOPY ( ngrid * llm, pk, 1, pkf, 1 ) 148 CALL filtreg ( pkf, jmp1, llm, 2, 1, .TRUE., 1 ) 149 108 ENDDO 109 ! 110 ! ... Calcul des coeff. alpha et beta pour l = llm-1 a l = 2 ... 111 ! 112 DO l = llm -1 , 2 , -1 113 ! 114 DO ij = 1, ngrid 115 dellta = p(ij,l)* unpl2k + p(ij,l+1)* ( beta(ij,l+1)-unpl2k ) 116 alpha(ij,l) = - p(ij,l+1) / dellta * alpha(ij,l+1) 117 beta (ij,l) = p(ij,l ) / dellta 118 ENDDO 119 ENDDO 150 120 151 RETURN 152 END 121 ! *********************************************************************** 122 ! ..... Calcul de pk pour la couche 1 , pres du sol .... 123 ! 124 DO ij = 1, ngrid 125 pk(ij,1) = ( p(ij,1)*pks(ij) - 0.5*alpha(ij,2)*p(ij,2) ) / & 126 ( p(ij,1)* (1.+kappa) + 0.5*( beta(ij,2)-unpl2k )* p(ij,2) ) 127 ENDDO 128 ! 129 ! ..... Calcul de pk(ij,l) , pour l = 2 a l = llm ........ 130 ! 131 DO l = 2, llm 132 DO ij = 1, ngrid 133 pk(ij,l) = alpha(ij,l) + beta(ij,l) * pk(ij,l-1) 134 ENDDO 135 ENDDO 136 137 if (present(pkf)) then 138 ! calcul de pkf 139 pkf = pk 140 CALL filtreg ( pkf, jmp1, llm, 2, 1, .TRUE., 1 ) 141 end if 142 143 END SUBROUTINE exner_hyb 144 145 end module exner_hyb_m 146 -
trunk/LMDZ.COMMON/libf/dyn3d_common/exner_milieu_m.F90
r1300 r1302 1 ! 2 ! $Id $ 3 ! 4 SUBROUTINE exner_milieu ( ngrid, ps, p,beta, pks, pk, pkf ) 5 c 6 c Auteurs : F. Forget , Y. Wanherdrick 7 c P.Le Van , Fr. Hourdin . 8 c .......... 9 c 10 c .... ngrid, ps,p sont des argum.d'entree au sous-prog ... 11 c .... beta, pks,pk,pkf sont des argum.de sortie au sous-prog ... 12 c 13 c ************************************************************************ 14 c Calcule la fonction d'Exner pk = Cp * (p/preff) ** kappa , aux milieux des 15 c couches . Pk(l) sera calcule aux milieux des couches l ,entre les 16 c pressions p(l) et p(l+1) ,definis aux interfaces des llm couches . 17 c ************************************************************************ 18 c .. N.B : Au sommet de l'atmosphere, p(llm+1) = 0. , et ps et pks sont 19 c la pression et la fonction d'Exner au sol . 20 c 21 c WARNING : CECI est une version speciale de exner_hyb originale 22 c Utilise dans la version martienne pour pouvoir 23 c tourner avec des coordonnees verticales complexe 24 c => Il ne verifie PAS la condition la proportionalite en 25 c energie totale/ interne / potentielle (F.Forget 2001) 26 c ( voir note de Fr.Hourdin ) , 27 c 28 IMPLICIT NONE 29 c 30 #include "dimensions.h" 31 #include "paramet.h" 32 #include "comconst.h" 33 #include "comgeom.h" 34 #include "comvert.h" 35 #include "serre.h" 1 module exner_milieu_m 36 2 37 INTEGER ngrid 38 REAL p(ngrid,llmp1),pk(ngrid,llm),pkf(ngrid,llm) 39 REAL ps(ngrid),pks(ngrid), beta(ngrid,llm) 3 IMPLICIT NONE 40 4 41 c .... variables locales ...5 contains 42 6 43 INTEGER l, ij 44 REAL dum1 7 SUBROUTINE exner_milieu ( ngrid, ps, p, pks, pk, pkf ) 8 ! 9 ! Auteurs : F. Forget , Y. Wanherdrick 10 ! P.Le Van , Fr. Hourdin . 11 ! .......... 12 ! 13 ! .... ngrid, ps,p sont des argum.d'entree au sous-prog ... 14 ! .... pks,pk,pkf sont des argum.de sortie au sous-prog ... 15 ! 16 ! ************************************************************************ 17 ! Calcule la fonction d'Exner pk = Cp * (p/preff) ** kappa , aux milieux des 18 ! couches . Pk(l) sera calcule aux milieux des couches l ,entre les 19 ! pressions p(l) et p(l+1) ,definis aux interfaces des llm couches . 20 ! ************************************************************************ 21 ! .. N.B : Au sommet de l'atmosphere, p(llm+1) = 0. , et ps et pks sont 22 ! la pression et la fonction d'Exner au sol . 23 ! 24 ! WARNING : CECI est une version speciale de exner_hyb originale 25 ! Utilise dans la version martienne pour pouvoir 26 ! tourner avec des coordonnees verticales complexe 27 ! => Il ne verifie PAS la condition la proportionalite en 28 ! energie totale/ interne / potentielle (F.Forget 2001) 29 ! ( voir note de Fr.Hourdin ) , 30 ! 31 ! 32 include "dimensions.h" 33 include "paramet.h" 34 include "comconst.h" 35 include "comgeom.h" 36 include "comvert.h" 37 include "serre.h" 45 38 46 REAL ppn(iim),pps(iim) 47 REAL xpn, xps 48 REAL SSUM 49 EXTERNAL SSUM 50 logical,save :: firstcall=.true. 51 character(len=*),parameter :: modname="exner_milieu" 39 INTEGER ngrid 40 REAL p(ngrid,llmp1),pk(ngrid,llm) 41 real, optional:: pkf(ngrid,llm) 42 REAL ps(ngrid),pks(ngrid) 52 43 53 ! Sanity check 54 if (firstcall) then 55 ! sanity checks for Shallow Water case (1 vertical layer) 56 if (llm.eq.1) then 44 ! .... variables locales ... 45 46 INTEGER l, ij 47 REAL dum1 48 49 logical,save :: firstcall=.true. 50 character(len=*),parameter :: modname="exner_milieu" 51 52 ! Sanity check 53 if (firstcall) then 54 ! sanity checks for Shallow Water case (1 vertical layer) 55 if (llm.eq.1) then 57 56 if (kappa.ne.1) then 58 call abort_gcm(modname,59 &"kappa!=1 , but running in Shallow Water mode!!",42)57 call abort_gcm(modname, & 58 "kappa!=1 , but running in Shallow Water mode!!",42) 60 59 endif 61 60 if (cpp.ne.r) then 62 call abort_gcm(modname,63 &"cpp!=r , but running in Shallow Water mode!!",42)61 call abort_gcm(modname, & 62 "cpp!=r , but running in Shallow Water mode!!",42) 64 63 endif 65 64 endif ! of if (llm.eq.1) 66 65 67 68 66 firstcall=.false. 67 endif ! of if (firstcall) 69 68 70 !!!! Specific behaviour for Shallow Water (1 vertical layer) case:71 72 73 74 75 76 pks(ij) = (cpp/preff) * ps(ij) 69 ! Specific behaviour for Shallow Water (1 vertical layer) case: 70 if (llm.eq.1) then 71 72 ! Compute pks(:),pk(:),pkf(:) 73 74 DO ij = 1, ngrid 75 pks(ij) = (cpp/preff) * ps(ij) 77 76 pk(ij,1) = .5*pks(ij) 78 ENDDO 79 80 CALL SCOPY ( ngrid * llm, pk, 1, pkf, 1 ) 81 CALL filtreg ( pkf, jmp1, llm, 2, 1, .TRUE., 1 ) 82 83 ! our work is done, exit routine 84 return 77 ENDDO 85 78 86 endif ! of if (llm.eq.1) 79 if (present(pkf)) then 80 pkf = pk 81 CALL filtreg ( pkf, jmp1, llm, 2, 1, .TRUE., 1 ) 82 end if 87 83 88 !!!! General case: 84 ! our work is done, exit routine 85 return 86 endif ! of if (llm.eq.1) 89 87 90 c ------------- 91 c Calcul de pks 92 c ------------- 93 94 DO ij = 1, ngrid 95 pks(ij) = cpp * ( ps(ij)/preff ) ** kappa 96 ENDDO 88 ! General case: 97 89 98 DO ij = 1, iim 99 ppn(ij) = aire( ij ) * pks( ij ) 100 pps(ij) = aire(ij+ip1jm) * pks(ij+ip1jm ) 101 ENDDO 102 xpn = SSUM(iim,ppn,1) /apoln 103 xps = SSUM(iim,pps,1) /apols 90 ! ------------- 91 ! Calcul de pks 92 ! ------------- 104 93 105 DO ij = 1, iip1 106 pks( ij ) = xpn 107 pks( ij+ip1jm ) = xps 108 ENDDO 109 c 110 c 111 c .... Calcul de pk pour la couche l 112 c -------------------------------------------- 113 c 114 dum1 = cpp * (2*preff)**(-kappa) 115 DO l = 1, llm-1 116 DO ij = 1, ngrid 117 pk(ij,l) = dum1 * (p(ij,l) + p(ij,l+1))**kappa 118 ENDDO 119 ENDDO 94 DO ij = 1, ngrid 95 pks(ij) = cpp * ( ps(ij)/preff ) ** kappa 96 ENDDO 120 97 121 c .... Calcul de pk pour la couche l = llm .. 122 c (on met la meme distance (en log pression) entre Pk(llm) 123 c et Pk(llm -1) qu'entre Pk(llm-1) et Pk(llm-2) 98 ! .... Calcul de pk pour la couche l 99 ! -------------------------------------------- 100 ! 101 dum1 = cpp * (2*preff)**(-kappa) 102 DO l = 1, llm-1 103 DO ij = 1, ngrid 104 pk(ij,l) = dum1 * (p(ij,l) + p(ij,l+1))**kappa 105 ENDDO 106 ENDDO 124 107 125 DO ij = 1, ngrid126 pk(ij,llm) = pk(ij,llm-1)**2 / pk(ij,llm-2)127 ENDDO108 ! .... Calcul de pk pour la couche l = llm .. 109 ! (on met la meme distance (en log pression) entre Pk(llm) 110 ! et Pk(llm -1) qu'entre Pk(llm-1) et Pk(llm-2) 128 111 112 DO ij = 1, ngrid 113 pk(ij,llm) = pk(ij,llm-1)**2 / pk(ij,llm-2) 114 ENDDO 129 115 130 c calcul de pkf 131 c ------------- 132 CALL SCOPY ( ngrid * llm, pk, 1, pkf, 1 ) 133 CALL filtreg ( pkf, jmp1, llm, 2, 1, .TRUE., 1 ) 134 135 c EST-CE UTILE ?? : calcul de beta 136 c -------------------------------- 137 DO l = 2, llm 138 DO ij = 1, ngrid 139 beta(ij,l) = pk(ij,l) / pk(ij,l-1) 140 ENDDO 141 ENDDO 116 if (present(pkf)) then 117 ! calcul de pkf 118 pkf = pk 119 CALL filtreg ( pkf, jmp1, llm, 2, 1, .TRUE., 1 ) 120 end if 142 121 143 RETURN 144 END 122 END SUBROUTINE exner_milieu 123 124 end module exner_milieu_m 125 -
trunk/LMDZ.COMMON/libf/dyn3d_common/iniacademic.F90
r1300 r1302 14 14 #endif 15 15 USE Write_Field 16 use exner_hyb_m, only: exner_hyb 17 use exner_milieu_m, only: exner_milieu 16 18 17 19 ! Author: Frederic Hourdin original: 15/01/93 … … 54 56 REAL pks(ip1jmp1) ! exner au sol 55 57 REAL pk(ip1jmp1,llm) ! exner au milieu des couches 56 REAL pkf(ip1jmp1,llm) ! exner filt.au milieu des couches57 58 REAL phi(ip1jmp1,llm) ! geopotentiel 58 59 REAL ddsin,zsig,tetapv,w_pv ! variables auxiliaires … … 223 224 CALL pression ( ip1jmp1, ap, bp, ps, p ) 224 225 if (pressure_exner) then 225 CALL exner_hyb( ip1jmp1, ps, p, alpha,beta, pks, pk, pkf)226 else 227 call exner_milieu(ip1jmp1,ps,p, beta,pks,pk,pkf)226 CALL exner_hyb( ip1jmp1, ps, p, pks, pk) 227 else 228 call exner_milieu(ip1jmp1,ps,p,pks,pk) 228 229 endif 229 230 CALL massdair(p,masse) -
trunk/LMDZ.COMMON/libf/dyn3d_common/iniconst.F90
r1300 r1302 73 73 if (disvert_type==1) then 74 74 ! standard case for Earth (automatic generation of levels) 75 call disvert( pa,preff,ap,bp,dpres,presnivs,nivsigs,nivsig, scaleheight)75 call disvert() 76 76 else if (disvert_type==2) then 77 77 ! standard case for planets (levels generated using z2sig.def file) -
trunk/LMDZ.COMMON/libf/dyn3d_common/q_sat.F
r1300 r1302 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 73 -
trunk/LMDZ.COMMON/libf/dyn3dpar/calfis_p.F
r1256 r1302 225 225 save unskap 226 226 227 cIM diagnostique PVteta, Amip2228 INTEGER,PARAMETER :: ntetaSTD=3229 REAL,SAVE :: rtetaSTD(ntetaSTD)=(/350.,380.,405./) ! Earth-specific, beware !!230 REAL PVteta(klon,ntetaSTD)231 232 233 227 REAL SSUM 234 228 … … 267 261 klon=klon_mpi 268 262 269 PVteta(:,:)=0.270 271 263 IF ( firstcal ) THEN 272 264 debut = .TRUE. … … 684 676 endif 685 677 686 687 IF (is_sequential.and.(planet_type=="earth")) THEN688 #ifdef CPP_EARTH689 ! PVtheta calls tetalevel, which is in the physics690 cIM calcul PV a teta=350, 380, 405K691 CALL PVtheta(ngridmx,llm,pucov,pvcov,pteta,692 $ ztfi,zplay,zplev,693 $ ntetaSTD,rtetaSTD,PVteta)694 c695 #endif696 ENDIF697 698 678 c On change de grille, dynamique vers physiq, pour le flux de masse verticale 699 679 CALL gr_dyn_fi_p(llm,iip1,jjp1,klon,flxw,flxwfi) … … 923 903 . zdqfi_omp, 924 904 . zdpsrf_omp, 925 cIM diagnostique PVteta, Amip2 926 . pducov, 927 . PVteta) 905 . pducov) 928 906 929 907 else if ( planet_type=="generic" ) then -
trunk/LMDZ.COMMON/libf/dyn3dpar/ce0l.F90
r1019 r1302 1 1 ! 2 ! $Id: ce0l.F90 1 615 2012-02-10 15:42:26Z emillour $2 ! $Id: ce0l.F90 1984 2014-02-18 09:59:29Z emillour $ 3 3 ! 4 4 !------------------------------------------------------------------------------- … … 115 115 END IF 116 116 117 IF (grilles_gcm_netcdf) THEN 118 WRITE(lunout,'(//)') 119 WRITE(lunout,*) ' *************************** ' 120 WRITE(lunout,*) ' *** grilles_gcm_netcdf *** ' 121 WRITE(lunout,*) ' *************************** ' 122 WRITE(lunout,'(//)') 123 CALL grilles_gcm_netcdf_sub(masque,phis) 124 END IF 117 WRITE(lunout,'(//)') 118 WRITE(lunout,*) ' *************************** ' 119 WRITE(lunout,*) ' *** grilles_gcm_netcdf *** ' 120 WRITE(lunout,*) ' *************************** ' 121 WRITE(lunout,'(//)') 122 CALL grilles_gcm_netcdf_sub(masque,phis) 125 123 126 124 #ifdef CPP_MPI … … 137 135 ! 138 136 !------------------------------------------------------------------------------- 137 -
trunk/LMDZ.COMMON/libf/dyn3dpar/conf_gcm.F
r1300 r1302 2 2 ! $Id: conf_gcm.F 1438 2010-10-08 10:19:34Z jghattas $ 3 3 ! 4 c 5 c 4 ! 5 ! 6 6 SUBROUTINE conf_gcm( tapedef, etatinit ) 7 c 7 ! 8 8 #ifdef CPP_IOIPSL 9 9 use IOIPSL … … 20 20 use sponge_mod_p, only: callsponge,mode_sponge,nsponge,tetasponge 21 21 IMPLICIT NONE 22 c-----------------------------------------------------------------------23 cAuteurs : L. Fairhead , P. Le Van .24 c 25 cArguments :26 c 27 ctapedef :28 cetatinit : = TRUE , on ne compare pas les valeurs des para-29 c-metres du zoom avec celles lues sur le fichier start .30 c 22 !----------------------------------------------------------------------- 23 ! Auteurs : L. Fairhead , P. Le Van . 24 ! 25 ! Arguments : 26 ! 27 ! tapedef : 28 ! etatinit : = TRUE , on ne compare pas les valeurs des para- 29 ! -metres du zoom avec celles lues sur le fichier start . 30 ! 31 31 LOGICAL etatinit 32 32 INTEGER tapedef 33 33 34 cDeclarations :35 c--------------34 ! Declarations : 35 ! -------------- 36 36 #include "dimensions.h" 37 37 #include "paramet.h" … … 45 45 ! FH 2008/05/09 On elimine toutes les clefs physiques dans la dynamique 46 46 ! #include "clesphys.h" 47 c 48 c 49 clocal:50 c------47 ! 48 ! 49 ! local: 50 ! ------ 51 51 52 52 CHARACTER ch1*72,ch2*72,ch3*72,ch4*12 … … 60 60 integer,external :: OMP_GET_NUM_THREADS 61 61 #endif 62 c 63 c-------------------------------------------------------------------64 c 65 c......... Version du 29/04/97 ..........66 c 67 cNouveaux parametres nitergdiv,nitergrot,niterh,tetagdiv,tetagrot,68 ctetatemp ajoutes pour la dissipation .69 c 70 cAutre parametre ajoute en fin de liste de tapedef : ** fxyhypb **71 c 72 cSi fxyhypb = .TRUE. , choix de la fonction a derivee tangente hyperb.73 cSinon , choix de fxynew , a derivee sinusoidale ..74 c 75 c...... etatinit = . TRUE. si defrun est appele dans ETAT0_LMD ou76 cLIMIT_LMD pour l'initialisation de start.dat (dic) et77 cde limit.dat ( dic) ...........78 cSinon etatinit = . FALSE .79 c 80 cDonc etatinit = .F. si on veut comparer les valeurs de grossismx ,81 cgrossismy,clon,clat, fxyhypb lues sur le fichier start avec82 ccelles passees par run.def , au debut du gcm, apres l'appel a83 clectba .84 cCes parmetres definissant entre autres la grille et doivent etre85 cpareils et coherents , sinon il y aura divergence du gcm .86 c 87 c-----------------------------------------------------------------------88 cinitialisations:89 c----------------62 ! 63 ! ------------------------------------------------------------------- 64 ! 65 ! ......... Version du 29/04/97 .......... 66 ! 67 ! Nouveaux parametres nitergdiv,nitergrot,niterh,tetagdiv,tetagrot, 68 ! tetatemp ajoutes pour la dissipation . 69 ! 70 ! Autre parametre ajoute en fin de liste de tapedef : ** fxyhypb ** 71 ! 72 ! Si fxyhypb = .TRUE. , choix de la fonction a derivee tangente hyperb. 73 ! Sinon , choix de fxynew , a derivee sinusoidale .. 74 ! 75 ! ...... etatinit = . TRUE. si defrun est appele dans ETAT0_LMD ou 76 ! LIMIT_LMD pour l'initialisation de start.dat (dic) et 77 ! de limit.dat ( dic) ........... 78 ! Sinon etatinit = . FALSE . 79 ! 80 ! Donc etatinit = .F. si on veut comparer les valeurs de grossismx , 81 ! grossismy,clon,clat, fxyhypb lues sur le fichier start avec 82 ! celles passees par run.def , au debut du gcm, apres l'appel a 83 ! lectba . 84 ! Ces parmetres definissant entre autres la grille et doivent etre 85 ! pareils et coherents , sinon il y aura divergence du gcm . 86 ! 87 !----------------------------------------------------------------------- 88 ! initialisations: 89 ! ---------------- 90 90 91 91 !Config Key = lunout … … 290 290 CALL getin('dissip_period',dissip_period) 291 291 292 ccc .... P. Le Van , modif le 29/04/97 .pour la dissipation ...293 ccc292 !cc .... P. Le Van , modif le 29/04/97 .pour la dissipation ... 293 !cc 294 294 295 295 !Config Key = lstardis … … 456 456 CALL getin('ok_guide',ok_guide) 457 457 458 c...............................................................458 ! ............................................................... 459 459 460 460 !Config Key = read_start … … 632 632 CALL getin('ok_etat0',ok_etat0) 633 633 634 !Config Key = grilles_gcm_netcdf 635 !Config Desc = creation de fichier grilles_gcm.nc dans create_etat0_limit 636 !Config Def = n 637 grilles_gcm_netcdf = .FALSE. 638 CALL getin('grilles_gcm_netcdf',grilles_gcm_netcdf) 639 640 c---------------------------------------- 641 c Parameters for zonal averages in the case of Titan 634 !---------------------------------------- 635 ! Parameters for zonal averages in the case of Titan 642 636 moyzon_mu = .false. 643 637 moyzon_ch = .false. … … 646 640 CALL getin('moyzon_ch', moyzon_ch) 647 641 endif 648 c----------------------------------------649 650 c----------------------------------------651 ccc .... P. Le Van , ajout le 7/03/95 .pour le zoom ...652 c......... ( modif le 17/04/96 ) .........653 c 654 CZOOM PARAMETERS ... the ones read in start.nc prevail anyway ! (SL, 2012)655 c 656 c----------------------------------------642 !---------------------------------------- 643 644 !---------------------------------------- 645 !cc .... P. Le Van , ajout le 7/03/95 .pour le zoom ... 646 ! ......... ( modif le 17/04/96 ) ......... 647 ! 648 ! ZOOM PARAMETERS ... the ones read in start.nc prevail anyway ! (SL, 2012) 649 ! 650 !---------------------------------------- 657 651 IF( etatinit ) then 658 652 … … 707 701 708 702 write(lunout,*)'conf_gcm: alphax alphay ',alphax,alphay 709 c 710 calphax et alphay sont les anciennes formulat. des grossissements711 c 712 c 703 ! 704 ! alphax et alphay sont les anciennes formulat. des grossissements 705 ! 706 ! 713 707 714 708 !Config Key = fxyhypb … … 758 752 ysinus = .TRUE. 759 753 CALL getin('ysinus',ysinus) 760 c 761 c----------------------------------------754 ! 755 !---------------------------------------- 762 756 else ! etatinit=false 763 c----------------------------------------757 !---------------------------------------- 764 758 765 759 !Config Key = clon … … 779 773 CALL getin('clat',clatt) 780 774 781 c 782 c 775 ! 776 ! 783 777 IF( ABS(clat - clatt).GE. 0.001 ) THEN 784 778 write(lunout,*)'conf_gcm: La valeur de clat passee par run.def', … … 834 828 835 829 write(lunout,*)'conf_gcm: alphax alphay',alphax,alphay 836 c 837 calphax et alphay sont les anciennes formulat. des grossissements838 c 839 c 830 ! 831 ! alphax et alphay sont les anciennes formulat. des grossissements 832 ! 833 ! 840 834 841 835 !Config Key = fxyhypb … … 862 856 ENDIF 863 857 ENDIF 864 c 858 ! 865 859 !Config Key = dzoomx 866 860 !Config Desc = extension en longitude … … 925 919 ENDIF 926 920 927 cc921 !c 928 922 IF( .NOT.fxyhypb ) THEN 929 923 … … 955 949 956 950 endif ! etatinit 957 c----------------------------------------951 !---------------------------------------- 958 952 959 953 … … 1009 1003 write(lunout,*)' ok_limit = ', ok_limit 1010 1004 write(lunout,*)' ok_etat0 = ', ok_etat0 1011 write(lunout,*)' grilles_gcm_netcdf = ', grilles_gcm_netcdf1012 1005 if (planet_type=="titan") then 1013 1006 write(lunout,*)' moyzon_mu = ', moyzon_mu -
trunk/LMDZ.COMMON/libf/dyn3dpar/exner_hyb_p_m.F90
r1299 r1302 1 ! 2 ! $Id $ 3 ! 4 SUBROUTINE exner_hyb_p ( ngrid, ps, p,alpha,beta, pks, pk, pkf ) 5 c 6 c Auteurs : P.Le Van , Fr. Hourdin . 7 c .......... 8 c 9 c .... ngrid, ps,p sont des argum.d'entree au sous-prog ... 10 c .... alpha,beta, pks,pk,pkf sont des argum.de sortie au sous-prog ... 11 c 12 c ************************************************************************ 13 c Calcule la fonction d'Exner pk = Cp * p ** kappa , aux milieux des 14 c couches . Pk(l) sera calcule aux milieux des couches l ,entre les 15 c pressions p(l) et p(l+1) ,definis aux interfaces des llm couches . 16 c ************************************************************************ 17 c .. N.B : Au sommet de l'atmosphere, p(llm+1) = 0. , et ps et pks sont 18 c la pression et la fonction d'Exner au sol . 19 c 20 c -------- z 21 c A partir des relations ( 1 ) p*dz(pk) = kappa *pk*dz(p) et 22 c ( 2 ) pk(l) = alpha(l)+ beta(l)*pk(l-1) 23 c ( voir note de Fr.Hourdin ) , 24 c 25 c on determine successivement , du haut vers le bas des couches, les 26 c coef. alpha(llm),beta(llm) .,.,alpha(l),beta(l),,,alpha(2),beta(2), 27 c puis pk(ij,1). Ensuite ,on calcule,du bas vers le haut des couches, 28 c pk(ij,l) donne par la relation (2), pour l = 2 a l = llm . 29 c 30 c 31 USE parallel_lmdz 32 IMPLICIT NONE 33 c 34 #include "dimensions.h" 35 #include "paramet.h" 36 #include "comconst.h" 37 #include "comgeom.h" 38 #include "comvert.h" 39 #include "serre.h" 1 module exner_hyb_p_m 40 2 41 INTEGER ngrid 42 REAL p(ngrid,llmp1),pk(ngrid,llm),pkf(ngrid,llm) 43 REAL ps(ngrid),pks(ngrid), alpha(ngrid,llm),beta(ngrid,llm) 3 IMPLICIT NONE 44 4 45 c .... variables locales ...5 contains 46 6 47 INTEGER l, ij 48 REAL unpl2k,dellta 7 SUBROUTINE exner_hyb_p ( ngrid, ps, p, pks, pk, pkf ) 49 8 50 REAL ppn(iim),pps(iim) 51 REAL xpn, xps 52 REAL SSUM 53 EXTERNAL SSUM 54 INTEGER ije,ijb,jje,jjb 55 logical,save :: firstcall=.true. 56 !$OMP THREADPRIVATE(firstcall) 57 character(len=*),parameter :: modname="exner_hyb_p" 58 c 9 ! Auteurs : P.Le Van , Fr. Hourdin . 10 ! .......... 11 ! 12 ! .... ngrid, ps,p sont des argum.d'entree au sous-prog ... 13 ! .... pks,pk,pkf sont des argum.de sortie au sous-prog ... 14 ! 15 ! ************************************************************************ 16 ! Calcule la fonction d'Exner pk = Cp * (p/preff) ** kappa , aux milieux des 17 ! couches . Pk(l) sera calcule aux milieux des couches l ,entre les 18 ! pressions p(l) et p(l+1) ,definis aux interfaces des llm couches . 19 ! ************************************************************************ 20 ! .. N.B : Au sommet de l'atmosphere, p(llm+1) = 0. , et ps et pks sont 21 ! la pression et la fonction d'Exner au sol . 22 ! 23 ! -------- z 24 ! A partir des relations ( 1 ) p*dz(pk) = kappa *pk*dz(p) et 25 ! ( 2 ) pk(l) = alpha(l)+ beta(l)*pk(l-1) 26 ! ( voir note de Fr.Hourdin ) , 27 ! 28 ! on determine successivement , du haut vers le bas des couches, les 29 ! coef. alpha(llm),beta(llm) .,.,alpha(l),beta(l),,,alpha(2),beta(2), 30 ! puis pk(ij,1). Ensuite ,on calcule,du bas vers le haut des couches, 31 ! pk(ij,l) donne par la relation (2), pour l = 2 a l = llm . 32 ! 33 ! 34 USE parallel_lmdz 35 ! 36 include "dimensions.h" 37 include "paramet.h" 38 include "comconst.h" 39 include "comgeom.h" 40 include "comvert.h" 41 include "serre.h" 59 42 60 ! Sanity check 61 if (firstcall) then 62 ! sanity checks for Shallow Water case (1 vertical layer) 63 if (llm.eq.1) then 43 INTEGER ngrid 44 REAL p(ngrid,llmp1),pk(ngrid,llm) 45 REAL, optional:: pkf(ngrid,llm) 46 REAL ps(ngrid),pks(ngrid) 47 REAL alpha(ngrid,llm),beta(ngrid,llm) 48 49 ! .... variables locales ... 50 51 INTEGER l, ij 52 REAL unpl2k,dellta 53 54 INTEGER ije,ijb,jje,jjb 55 logical,save :: firstcall=.true. 56 !$OMP THREADPRIVATE(firstcall) 57 character(len=*),parameter :: modname="exner_hyb_p" 58 59 ! Sanity check 60 if (firstcall) then 61 ! sanity checks for Shallow Water case (1 vertical layer) 62 if (llm.eq.1) then 64 63 if (kappa.ne.1) then 65 call abort_gcm(modname,66 &"kappa!=1 , but running in Shallow Water mode!!",42)64 call abort_gcm(modname, & 65 "kappa!=1 , but running in Shallow Water mode!!",42) 67 66 endif 68 67 if (cpp.ne.r) then 69 call abort_gcm(modname,70 &"cpp!=r , but running in Shallow Water mode!!",42)68 call abort_gcm(modname, & 69 "cpp!=r , but running in Shallow Water mode!!",42) 71 70 endif 72 71 endif ! of if (llm.eq.1) 73 72 74 75 73 firstcall=.false. 74 endif ! of if (firstcall) 76 75 77 c$OMP BARRIER76 !$OMP BARRIER 78 77 79 ! Specific behaviour for Shallow Water (1 vertical layer) case 80 81 82 83 84 85 !$OMP DO SCHEDULE(STATIC)86 87 pks(ij) =(cpp/preff)*ps(ij)78 ! Specific behaviour for Shallow Water (1 vertical layer) case: 79 if (llm.eq.1) then 80 81 ! Compute pks(:),pk(:),pkf(:) 82 ijb=ij_begin 83 ije=ij_end 84 !$OMP DO SCHEDULE(STATIC) 85 DO ij=ijb, ije 86 pks(ij) = (cpp/preff) * ps(ij) 88 87 pk(ij,1) = .5*pks(ij) 89 pkf(ij,1)=pk(ij,1)90 91 !$OMP ENDDO88 if (present(pkf)) pkf(ij,1)=pk(ij,1) 89 ENDDO 90 !$OMP ENDDO 92 91 93 !$OMP MASTER 94 if (pole_nord) then 95 DO ij = 1, iim 96 ppn(ij) = aire( ij ) * pks( ij ) 97 ENDDO 98 xpn = SSUM(iim,ppn,1) /apoln 99 100 DO ij = 1, iip1 101 pks( ij ) = xpn 102 pk(ij,1) = .5*pks(ij) 103 pkf(ij,1)=pk(ij,1) 104 ENDDO 105 endif 106 107 if (pole_sud) then 108 DO ij = 1, iim 109 pps(ij) = aire(ij+ip1jm) * pks(ij+ip1jm ) 110 ENDDO 111 xps = SSUM(iim,pps,1) /apols 112 113 DO ij = 1, iip1 114 pks( ij+ip1jm ) = xps 115 pk(ij+ip1jm,1)=.5*pks(ij+ip1jm) 116 pkf(ij+ip1jm,1)=pk(ij+ip1jm,1) 117 ENDDO 118 endif 119 !$OMP END MASTER 120 !$OMP BARRIER 121 jjb=jj_begin 122 jje=jj_end 123 CALL filtreg_p ( pkf,jjb,jje, jmp1, llm, 2, 1, .TRUE., 1 ) 92 !$OMP BARRIER 93 if (present(pkf)) then 94 jjb=jj_begin 95 jje=jj_end 96 CALL filtreg_p ( pkf,jjb,jje, jmp1, llm, 2, 1, .TRUE., 1 ) 97 end if 124 98 125 126 127 99 ! our work is done, exit routine 100 return 101 endif ! of if (llm.eq.1) 128 102 129 !!!! General case:103 ! General case: 130 104 131 unpl2k = 1.+ 2.* kappa 132 c 133 ijb=ij_begin 134 ije=ij_end 105 unpl2k = 1.+ 2.* kappa 135 106 136 c$OMP DO SCHEDULE(STATIC) 137 DO ij = ijb, ije 138 pks(ij) = cpp * ( ps(ij)/preff ) ** kappa 139 ENDDO 140 c$OMP ENDDO 141 c Synchro OPENMP ici 107 ! ------------- 108 ! Calcul de pks 109 ! ------------- 142 110 143 c$OMP MASTER 144 if (pole_nord) then 145 DO ij = 1, iim 146 ppn(ij) = aire( ij ) * pks( ij ) 147 ENDDO 148 xpn = SSUM(iim,ppn,1) /apoln 149 150 DO ij = 1, iip1 151 pks( ij ) = xpn 152 ENDDO 153 endif 154 155 if (pole_sud) then 156 DO ij = 1, iim 157 pps(ij) = aire(ij+ip1jm) * pks(ij+ip1jm ) 158 ENDDO 159 xps = SSUM(iim,pps,1) /apols 160 161 DO ij = 1, iip1 162 pks( ij+ip1jm ) = xps 163 ENDDO 164 endif 165 c$OMP END MASTER 166 c$OMP BARRIER 167 c 168 c 169 c .... Calcul des coeff. alpha et beta pour la couche l = llm .. 170 c 171 c$OMP DO SCHEDULE(STATIC) 172 DO ij = ijb,ije 111 ijb=ij_begin 112 ije=ij_end 113 114 !$OMP DO SCHEDULE(STATIC) 115 DO ij = ijb, ije 116 pks(ij) = cpp * ( ps(ij)/preff ) ** kappa 117 ENDDO 118 !$OMP ENDDO 119 ! Synchro OPENMP ici 120 121 !$OMP BARRIER 122 ! 123 ! 124 ! .... Calcul des coeff. alpha et beta pour la couche l = llm .. 125 ! 126 !$OMP DO SCHEDULE(STATIC) 127 DO ij = ijb,ije 173 128 alpha(ij,llm) = 0. 174 129 beta (ij,llm) = 1./ unpl2k 175 ENDDO 176 c$OMP ENDDO NOWAIT 177 c 178 c ... Calcul des coeff. alpha et beta pour l = llm-1 a l = 2 ... 179 c 180 DO l = llm -1 , 2 , -1 181 c 182 c$OMP DO SCHEDULE(STATIC) 183 DO ij = ijb, ije 184 dellta = p(ij,l)* unpl2k + p(ij,l+1)* ( beta(ij,l+1)-unpl2k ) 185 alpha(ij,l) = - p(ij,l+1) / dellta * alpha(ij,l+1) 186 beta (ij,l) = p(ij,l ) / dellta 187 ENDDO 188 c$OMP ENDDO NOWAIT 189 c 190 ENDDO 130 ENDDO 131 !$OMP ENDDO NOWAIT 132 ! 133 ! ... Calcul des coeff. alpha et beta pour l = llm-1 a l = 2 ... 134 ! 135 DO l = llm -1 , 2 , -1 136 ! 137 !$OMP DO SCHEDULE(STATIC) 138 DO ij = ijb, ije 139 dellta = p(ij,l)* unpl2k + p(ij,l+1)* ( beta(ij,l+1)-unpl2k ) 140 alpha(ij,l) = - p(ij,l+1) / dellta * alpha(ij,l+1) 141 beta (ij,l) = p(ij,l ) / dellta 142 ENDDO 143 !$OMP ENDDO NOWAIT 144 ENDDO 191 145 192 c 193 c *********************************************************************** 194 c ..... Calcul de pk pour la couche 1 , pres du sol .... 195 c 196 c$OMP DO SCHEDULE(STATIC) 197 DO ij = ijb, ije 198 pk(ij,1) = ( p(ij,1)*pks(ij) - 0.5*alpha(ij,2)*p(ij,2) ) / 199 * ( p(ij,1)* (1.+kappa) + 0.5*( beta(ij,2)-unpl2k )* p(ij,2) ) 200 ENDDO 201 c$OMP ENDDO NOWAIT 202 c 203 c ..... Calcul de pk(ij,l) , pour l = 2 a l = llm ........ 204 c 205 DO l = 2, llm 206 c$OMP DO SCHEDULE(STATIC) 207 DO ij = ijb, ije 208 pk(ij,l) = alpha(ij,l) + beta(ij,l) * pk(ij,l-1) 209 ENDDO 210 c$OMP ENDDO NOWAIT 211 ENDDO 212 c 213 c 214 c CALL SCOPY ( ngrid * llm, pk, 1, pkf, 1 ) 215 DO l = 1, llm 216 c$OMP DO SCHEDULE(STATIC) 217 DO ij = ijb, ije 218 pkf(ij,l)=pk(ij,l) 219 ENDDO 220 c$OMP ENDDO NOWAIT 221 ENDDO 146 ! *********************************************************************** 147 ! ..... Calcul de pk pour la couche 1 , pres du sol .... 148 ! 149 !$OMP DO SCHEDULE(STATIC) 150 DO ij = ijb, ije 151 pk(ij,1) = ( p(ij,1)*pks(ij) - 0.5*alpha(ij,2)*p(ij,2) ) / & 152 ( p(ij,1)* (1.+kappa) + 0.5*( beta(ij,2)-unpl2k )* p(ij,2) ) 153 ENDDO 154 !$OMP ENDDO NOWAIT 155 ! 156 ! ..... Calcul de pk(ij,l) , pour l = 2 a l = llm ........ 157 ! 158 DO l = 2, llm 159 !$OMP DO SCHEDULE(STATIC) 160 DO ij = ijb, ije 161 pk(ij,l) = alpha(ij,l) + beta(ij,l) * pk(ij,l-1) 162 ENDDO 163 !$OMP ENDDO NOWAIT 164 ENDDO 222 165 223 c$OMP BARRIER 224 225 jjb=jj_begin 226 jje=jj_end 227 CALL filtreg_p ( pkf,jjb,jje, jmp1, llm, 2, 1, .TRUE., 1 ) 228 166 if (present(pkf)) then 167 ! calcul de pkf 229 168 230 RETURN 231 END 169 DO l = 1, llm 170 !$OMP DO SCHEDULE(STATIC) 171 DO ij = ijb, ije 172 pkf(ij,l)=pk(ij,l) 173 ENDDO 174 !$OMP ENDDO NOWAIT 175 ENDDO 176 177 !$OMP BARRIER 178 179 jjb=jj_begin 180 jje=jj_end 181 CALL filtreg_p ( pkf,jjb,jje, jmp1, llm, 2, 1, .TRUE., 1 ) 182 end if 183 184 END SUBROUTINE exner_hyb_p 185 186 end module exner_hyb_p_m 187 -
trunk/LMDZ.COMMON/libf/dyn3dpar/exner_milieu_p_m.F90
r1299 r1302 1 ! 2 ! $Id $ 3 ! 4 SUBROUTINE exner_milieu_p ( ngrid, ps, p,beta, pks, pk, pkf ) 5 c 6 c Auteurs : F. Forget , Y. Wanherdrick 7 c P.Le Van , Fr. Hourdin . 8 c .......... 9 c 10 c .... ngrid, ps,p sont des argum.d'entree au sous-prog ... 11 c .... beta, pks,pk,pkf sont des argum.de sortie au sous-prog ... 12 c 13 c ************************************************************************ 14 c Calcule la fonction d'Exner pk = Cp * (p/preff) ** kappa , aux milieux des 15 c couches . Pk(l) sera calcule aux milieux des couches l ,entre les 16 c pressions p(l) et p(l+1) ,definis aux interfaces des llm couches . 17 c ************************************************************************ 18 c .. N.B : Au sommet de l'atmosphere, p(llm+1) = 0. , et ps et pks sont 19 c la pression et la fonction d'Exner au sol . 20 c 21 c WARNING : CECI est une version speciale de exner_hyb originale 22 c Utilise dans la version martienne pour pouvoir 23 c tourner avec des coordonnees verticales complexe 24 c => Il ne verifie PAS la condition la proportionalite en 25 c energie totale/ interne / potentielle (F.Forget 2001) 26 c ( voir note de Fr.Hourdin ) , 27 c 28 USE parallel_lmdz 29 IMPLICIT NONE 30 c 31 #include "dimensions.h" 32 #include "paramet.h" 33 #include "comconst.h" 34 #include "comgeom.h" 35 #include "comvert.h" 36 #include "serre.h" 1 module exner_milieu_p_m 37 2 38 INTEGER ngrid 39 REAL p(ngrid,llmp1),pk(ngrid,llm),pkf(ngrid,llm) 40 REAL ps(ngrid),pks(ngrid), beta(ngrid,llm) 3 IMPLICIT NONE 41 4 42 c .... variables locales ...5 contains 43 6 44 INTEGER l, ij 45 REAL dum1 7 SUBROUTINE exner_milieu_p ( ngrid, ps, p, pks, pk, pkf ) 8 ! 9 ! Auteurs : F. Forget , Y. Wanherdrick 10 ! P.Le Van , Fr. Hourdin . 11 ! .......... 12 ! 13 ! .... ngrid, ps,p sont des argum.d'entree au sous-prog ... 14 ! .... pks,pk,pkf sont des argum.de sortie au sous-prog ... 15 ! 16 ! ************************************************************************ 17 ! Calcule la fonction d'Exner pk = Cp * (p/preff) ** kappa , aux milieux des 18 ! couches . Pk(l) sera calcule aux milieux des couches l ,entre les 19 ! pressions p(l) et p(l+1) ,definis aux interfaces des llm couches . 20 ! ************************************************************************ 21 ! .. N.B : Au sommet de l'atmosphere, p(llm+1) = 0. , et ps et pks sont 22 ! la pression et la fonction d'Exner au sol . 23 ! 24 ! WARNING : CECI est une version speciale de exner_hyb originale 25 ! Utilise dans la version martienne pour pouvoir 26 ! tourner avec des coordonnees verticales complexe 27 ! => Il ne verifie PAS la condition la proportionalite en 28 ! energie totale/ interne / potentielle (F.Forget 2001) 29 ! ( voir note de Fr.Hourdin ) , 30 ! 31 USE parallel_lmdz 32 ! 33 include "dimensions.h" 34 include "paramet.h" 35 include "comconst.h" 36 include "comgeom.h" 37 include "comvert.h" 38 include "serre.h" 46 39 47 REAL ppn(iim),pps(iim) 48 REAL xpn, xps 49 REAL SSUM 50 EXTERNAL SSUM 51 INTEGER ije,ijb,jje,jjb 52 logical,save :: firstcall=.true. 53 !$OMP THREADPRIVATE(firstcall) 54 character(len=*),parameter :: modname="exner_milieu_p" 40 INTEGER ngrid 41 REAL p(ngrid,llmp1),pk(ngrid,llm) 42 REAL, optional:: pkf(ngrid,llm) 43 REAL ps(ngrid),pks(ngrid) 55 44 56 ! Sanity check 57 if (firstcall) then 58 ! sanity checks for Shallow Water case (1 vertical layer) 59 if (llm.eq.1) then 45 ! .... variables locales ... 46 47 INTEGER l, ij,ijb,ije,jjb,jje 48 REAL dum1 49 50 logical,save :: firstcall=.true. 51 !$OMP THREADPRIVATE(firstcall) 52 character(len=*),parameter :: modname="exner_milieu_p" 53 54 ! Sanity check 55 if (firstcall) then 56 ! sanity checks for Shallow Water case (1 vertical layer) 57 if (llm.eq.1) then 60 58 if (kappa.ne.1) then 61 call abort_gcm(modname,62 &"kappa!=1 , but running in Shallow Water mode!!",42)59 call abort_gcm(modname, & 60 "kappa!=1 , but running in Shallow Water mode!!",42) 63 61 endif 64 62 if (cpp.ne.r) then 65 call abort_gcm(modname,66 &"cpp!=r , but running in Shallow Water mode!!",42)63 call abort_gcm(modname, & 64 "cpp!=r , but running in Shallow Water mode!!",42) 67 65 endif 68 66 endif ! of if (llm.eq.1) 69 67 70 firstcall=.false. 71 endif ! of if (firstcall) 72 73 c$OMP BARRIER 68 firstcall=.false. 69 endif ! of if (firstcall) 74 70 75 ! Specific behaviour for Shallow Water (1 vertical layer) case 76 if (llm.eq.1) then 77 78 ! Compute pks(:),pk(:),pkf(:) 79 ijb=ij_begin 80 ije=ij_end 81 !$OMP DO SCHEDULE(STATIC) 82 DO ij=ijb, ije 83 pks(ij)=(cpp/preff)*ps(ij) 71 !$OMP BARRIER 72 73 ! Specific behaviour for Shallow Water (1 vertical layer) case: 74 if (llm.eq.1) then 75 76 ! Compute pks(:),pk(:),pkf(:) 77 ijb=ij_begin 78 ije=ij_end 79 !$OMP DO SCHEDULE(STATIC) 80 DO ij=ijb, ije 81 pks(ij) = (cpp/preff) * ps(ij) 84 82 pk(ij,1) = .5*pks(ij) 85 pkf(ij,1)=pk(ij,1)86 87 !$OMP ENDDO83 if (present(pkf)) pkf(ij,1)=pk(ij,1) 84 ENDDO 85 !$OMP ENDDO 88 86 89 !$OMP MASTER 90 if (pole_nord) then 91 DO ij = 1, iim 92 ppn(ij) = aire( ij ) * pks( ij ) 93 ENDDO 94 xpn = SSUM(iim,ppn,1) /apoln 95 96 DO ij = 1, iip1 97 pks( ij ) = xpn 98 pk(ij,1) = .5*pks(ij) 99 pkf(ij,1)=pk(ij,1) 100 ENDDO 101 endif 102 103 if (pole_sud) then 104 DO ij = 1, iim 105 pps(ij) = aire(ij+ip1jm) * pks(ij+ip1jm ) 106 ENDDO 107 xps = SSUM(iim,pps,1) /apols 108 109 DO ij = 1, iip1 110 pks( ij+ip1jm ) = xps 111 pk(ij+ip1jm,1)=.5*pks(ij+ip1jm) 112 pkf(ij+ip1jm,1)=pk(ij+ip1jm,1) 113 ENDDO 114 endif 115 !$OMP END MASTER 116 !$OMP BARRIER 117 jjb=jj_begin 118 jje=jj_end 119 CALL filtreg_p ( pkf,jjb,jje, jmp1, llm, 2, 1, .TRUE., 1 ) 87 !$OMP BARRIER 88 if (present(pkf)) then 89 jjb=jj_begin 90 jje=jj_end 91 CALL filtreg_p ( pkf,jjb,jje, jmp1, llm, 2, 1, .TRUE., 1 ) 92 end if 120 93 121 122 123 94 ! our work is done, exit routine 95 return 96 endif ! of if (llm.eq.1) 124 97 125 !!!! General case:98 ! General case: 126 99 127 c ------------- 128 c Calcul de pks 129 c ------------- 130 131 ijb=ij_begin 132 ije=ij_end 100 ! ------------- 101 ! Calcul de pks 102 ! ------------- 133 103 134 c$OMP DO SCHEDULE(STATIC) 135 DO ij = ijb, ije 136 pks(ij) = cpp * ( ps(ij)/preff ) ** kappa 137 ENDDO 138 c$OMP ENDDO 139 c Synchro OPENMP ici 104 ijb=ij_begin 105 ije=ij_end 140 106 141 c$OMP MASTER 142 if (pole_nord) then 143 DO ij = 1, iim 144 ppn(ij) = aire( ij ) * pks( ij ) 145 ENDDO 146 xpn = SSUM(iim,ppn,1) /apoln 147 148 DO ij = 1, iip1 149 pks( ij ) = xpn 150 ENDDO 151 endif 152 153 if (pole_sud) then 154 DO ij = 1, iim 155 pps(ij) = aire(ij+ip1jm) * pks(ij+ip1jm ) 156 ENDDO 157 xps = SSUM(iim,pps,1) /apols 158 159 DO ij = 1, iip1 160 pks( ij+ip1jm ) = xps 161 ENDDO 162 endif 163 c$OMP END MASTER 164 c$OMP BARRIER 165 c 166 c 167 c .... Calcul de pk pour la couche l 168 c -------------------------------------------- 169 c 170 dum1 = cpp * (2*preff)**(-kappa) 171 DO l = 1, llm-1 172 c$OMP DO SCHEDULE(STATIC) 173 DO ij = ijb, ije 174 pk(ij,l) = dum1 * (p(ij,l) + p(ij,l+1))**kappa 175 ENDDO 176 c$OMP ENDDO NOWAIT 177 ENDDO 107 !$OMP DO SCHEDULE(STATIC) 108 DO ij = ijb, ije 109 pks(ij) = cpp * ( ps(ij)/preff ) ** kappa 110 ENDDO 111 !$OMP ENDDO 112 ! Synchro OPENMP ici 178 113 179 c .... Calcul de pk pour la couche l = llm .. 180 c (on met la meme distance (en log pression) entre Pk(llm) 181 c et Pk(llm -1) qu'entre Pk(llm-1) et Pk(llm-2) 114 !$OMP BARRIER 115 ! 116 ! 117 ! .... Calcul de pk pour la couche l 118 ! -------------------------------------------- 119 ! 120 dum1 = cpp * (2*preff)**(-kappa) 121 DO l = 1, llm-1 122 !$OMP DO SCHEDULE(STATIC) 123 DO ij = ijb, ije 124 pk(ij,l) = dum1 * (p(ij,l) + p(ij,l+1))**kappa 125 ENDDO 126 !$OMP ENDDO NOWAIT 127 ENDDO 182 128 183 c$OMP DO SCHEDULE(STATIC) 184 DO ij = ijb, ije 185 pk(ij,llm) = pk(ij,llm-1)**2 / pk(ij,llm-2) 186 ENDDO 187 c$OMP ENDDO NOWAIT 129 ! .... Calcul de pk pour la couche l = llm .. 130 ! (on met la meme distance (en log pression) entre Pk(llm) 131 ! et Pk(llm -1) qu'entre Pk(llm-1) et Pk(llm-2) 188 132 133 !$OMP DO SCHEDULE(STATIC) 134 DO ij = ijb, ije 135 pk(ij,llm) = pk(ij,llm-1)**2 / pk(ij,llm-2) 136 ENDDO 137 !$OMP ENDDO NOWAIT 189 138 190 c calcul de pkf 191 c ------------- 192 c CALL SCOPY ( ngrid * llm, pk, 1, pkf, 1 ) 193 DO l = 1, llm 194 c$OMP DO SCHEDULE(STATIC) 195 DO ij = ijb, ije 196 pkf(ij,l)=pk(ij,l) 197 ENDDO 198 c$OMP ENDDO NOWAIT 199 ENDDO 139 if (present(pkf)) then 140 ! calcul de pkf 200 141 201 c$OMP BARRIER 202 203 jjb=jj_begin 204 jje=jj_end 205 CALL filtreg_p ( pkf,jjb,jje, jmp1, llm, 2, 1, .TRUE., 1 ) 206 207 c EST-CE UTILE ?? : calcul de beta 208 c -------------------------------- 209 DO l = 2, llm 210 c$OMP DO SCHEDULE(STATIC) 211 DO ij = ijb, ije 212 beta(ij,l) = pk(ij,l) / pk(ij,l-1) 213 ENDDO 214 c$OMP ENDDO NOWAIT 215 ENDDO 142 DO l = 1, llm 143 !$OMP DO SCHEDULE(STATIC) 144 DO ij = ijb, ije 145 pkf(ij,l)=pk(ij,l) 146 ENDDO 147 !$OMP ENDDO NOWAIT 148 ENDDO 216 149 217 RETURN 218 END 150 !$OMP BARRIER 151 152 jjb=jj_begin 153 jje=jj_end 154 CALL filtreg_p ( pkf,jjb,jje, jmp1, llm, 2, 1, .TRUE., 1 ) 155 end if 156 157 END SUBROUTINE exner_milieu_p 158 159 end module exner_milieu_p_m 160 -
trunk/LMDZ.COMMON/libf/dyn3dpar/gcm.F
r1300 r1302 516 516 517 517 518 day_end = day_ini + nday 518 if (nday>=0) then ! standard case 519 day_end=day_ini+nday 520 else ! special case when nday <0, run -nday dynamical steps 521 day_end=day_ini-nday/day_step 522 endif 519 523 if (less1day) then 520 524 day_end=day_ini+floor(time_0+fractday) -
trunk/LMDZ.COMMON/libf/dyn3dpar/guide_p_mod.F90
r1300 r1302 328 328 !======================================================================= 329 329 SUBROUTINE guide_main(itau,ucov,vcov,teta,q,masse,ps) 330 use exner_hyb_p_m, only: exner_hyb_p 331 use exner_milieu_p_m, only: exner_milieu_p 330 332 USE parallel_lmdz 331 333 USE control_mod … … 349 351 REAL, DIMENSION (ip1jmp1,llm) :: f_add ! var aux: champ de guidage 350 352 ! Variables pour fonction Exner (P milieu couche) 351 REAL, DIMENSION (iip1,jjp1,llm) :: pk, pkf 352 REAL, DIMENSION (iip1,jjp1,llm) :: alpha, beta 353 REAL, DIMENSION (iip1,jjp1,llm) :: pk 353 354 REAL, DIMENSION (iip1,jjp1) :: pks 354 355 REAL :: unskap … … 491 492 IF (f_out) THEN 492 493 ! Calcul niveaux pression milieu de couches 493 494 495 CALL exner_hyb_p(ip1jmp1,ps,p, alpha,beta,pks,pk,pkf)496 497 CALL exner_milieu_p(ip1jmp1,ps,p, beta,pks,pk,pkf)494 CALL pression_p( ip1jmp1, ap, bp, ps, p ) 495 if (pressure_exner) then 496 CALL exner_hyb_p(ip1jmp1,ps,p,pks,pk) 497 else 498 CALL exner_milieu_p(ip1jmp1,ps,p,pks,pk) 498 499 endif 499 500 unskap=1./kappa 500 501 502 503 504 505 506 507 CALL guide_out(" P",jjp1,llm,p(1:ip1jmp1,1:llm),1.)501 DO l = 1, llm 502 DO j=jjb_u,jje_u 503 DO i =1, iip1 504 p(i+(j-1)*iip1,l) = preff * ( pk(i,j,l)/cpp) ** unskap 505 ENDDO 506 ENDDO 507 ENDDO 508 CALL guide_out("SP",jjp1,llm,p(1:ip1jmp1,1:llm),1.) 508 509 ENDIF 509 510 … … 517 518 if (guide_zon) CALL guide_zonave(1,jjp1,llm,f_add) 518 519 CALL guide_addfield(ip1jmp1,llm,f_add,alpha_u) 519 IF (f_out) CALL guide_out("U",jjp1,llm,f_add(:,:),factt) 520 IF (f_out) CALL guide_out("u",jjp1,llm,ucov,factt) 521 IF (f_out) CALL guide_out("ua",jjp1,llm,(1.-tau)*ugui1(:,:)+tau*ugui2(:,:),factt) 522 IF (f_out) CALL guide_out("ucov",jjp1,llm,f_add(:,:)/factt,factt) 520 523 ucov(ijb_u:ije_u,:)=ucov(ijb_u:ije_u,:)+f_add(ijb_u:ije_u,:) 521 524 endif … … 529 532 if (guide_zon) CALL guide_zonave(2,jjp1,llm,f_add) 530 533 CALL guide_addfield(ip1jmp1,llm,f_add,alpha_T) 531 IF (f_out) CALL guide_out(" T",jjp1,llm,f_add(:,:),factt)534 IF (f_out) CALL guide_out("teta",jjp1,llm,f_add(:,:)/factt,factt) 532 535 teta(ijb_u:ije_u,:)=teta(ijb_u:ije_u,:)+f_add(ijb_u:ije_u,:) 533 536 endif … … 541 544 if (guide_zon) CALL guide_zonave(2,jjp1,1,f_add(1:ip1jmp1,1)) 542 545 CALL guide_addfield(ip1jmp1,1,f_add(1:ip1jmp1,1),alpha_P) 543 IF (f_out) CALL guide_out(" SP",jjp1,1,f_add(1:ip1jmp1,1),factt)546 IF (f_out) CALL guide_out("ps",jjp1,1,f_add(1:ip1jmp1,1)/factt,factt) 544 547 ps(ijb_u:ije_u)=ps(ijb_u:ije_u)+f_add(ijb_u:ije_u,1) 545 548 CALL pression_p(ip1jmp1,ap,bp,ps,p) … … 555 558 if (guide_zon) CALL guide_zonave(2,jjp1,llm,f_add) 556 559 CALL guide_addfield(ip1jmp1,llm,f_add,alpha_Q) 557 IF (f_out) CALL guide_out(" Q",jjp1,llm,f_add(:,:),factt)560 IF (f_out) CALL guide_out("q",jjp1,llm,f_add(:,:)/factt,factt) 558 561 q(ijb_u:ije_u,:)=q(ijb_u:ije_u,:)+f_add(ijb_u:ije_u,:) 559 562 endif … … 568 571 if (guide_zon) CALL guide_zonave(2,jjm,llm,f_add(1:ip1jm,:)) 569 572 CALL guide_addfield(ip1jm,llm,f_add(1:ip1jm,:),alpha_v) 570 IF (f_out) CALL guide_out("V",jjm,llm,f_add(1:ip1jm,:),factt) 573 IF (f_out) CALL guide_out("v",jjm,llm,vcov(1:ip1jm,:),factt) 574 IF (f_out) CALL guide_out("va",jjm,llm,(1.-tau)*vgui1(:,:)+tau*vgui2(:,:),factt) 575 IF (f_out) CALL guide_out("vcov",jjm,llm,f_add(1:ip1jm,:)/factt,factt) 571 576 vcov(ijb_v:ije_v,:)=vcov(ijb_v:ije_v,:)+f_add(ijb_v:ije_v,:) 572 577 endif … … 689 694 !======================================================================= 690 695 SUBROUTINE guide_interp(psi,teta) 696 use exner_hyb_p_m, only: exner_hyb_p 697 use exner_milieu_p_m, only: exner_milieu_p 691 698 USE parallel_lmdz 692 699 USE mod_hallo … … 713 720 REAL, DIMENSION (iip1,jjm,llm) :: pbary 714 721 ! Variables pour fonction Exner (P milieu couche) 715 REAL, DIMENSION (iip1,jjp1,llm) :: pk, pkf 716 REAL, DIMENSION (iip1,jjp1,llm) :: alpha, beta 722 REAL, DIMENSION (iip1,jjp1,llm) :: pk 717 723 REAL, DIMENSION (iip1,jjp1) :: pks 718 724 REAL :: unskap … … 784 790 IF (guide_plevs.EQ.1) THEN 785 791 DO l=1,llm 786 787 792 DO j=jjb_u,jje_u 793 DO i =1, iip1 788 794 pls(i,j,l)=(ap(l)+ap(l+1))/2.+psi(i,j)*(bp(l)+bp(l+1))/2. 789 790 795 ENDDO 796 ENDDO 791 797 ENDDO 792 798 ELSE 793 794 795 CALL exner_hyb_p(ip1jmp1,psi,p, alpha,beta,pks,pk,pkf)799 CALL pression_p( ip1jmp1, ap, bp, psi, p ) 800 if (pressure_exner) then 801 CALL exner_hyb_p(ip1jmp1,psi,p,pks,pk) 796 802 else 797 CALL exner_milieu_p(ip1jmp1,psi,p, beta,pks,pk,pkf)803 CALL exner_milieu_p(ip1jmp1,psi,p,pks,pk) 798 804 endif 799 800 801 802 803 804 805 806 805 unskap=1./kappa 806 DO l = 1, llm 807 DO j=jjb_u,jje_u 808 DO i =1, iip1 809 pls(i,j,l) = preff * ( pk(i,j,l)/cpp) ** unskap 810 ENDDO 811 ENDDO 812 ENDDO 807 813 ENDIF 808 814 … … 1024 1030 ! Calcul des nouvelles valeurs des niveaux de pression du guidage 1025 1031 IF (guide_plevs.EQ.1) THEN 1026 1027 1028 1029 1030 1031 1032 CALL Register_SwapFieldHallo(psnat1,psnat1,ip1jmp1,1,jj_Nb_caldyn,1,2,Req) 1033 CALL SendRequest(Req) 1034 CALL WaitRequest(Req) 1035 CALL Register_SwapFieldHallo(psnat2,psnat2,ip1jmp1,1,jj_Nb_caldyn,1,2,Req) 1036 CALL SendRequest(Req) 1037 CALL WaitRequest(Req) 1032 1038 DO l=1,nlevnc 1033 1039 DO j=jjb_v,jje_v … … 1041 1047 ENDDO 1042 1048 ELSE IF (guide_plevs.EQ.2) THEN 1043 1044 1045 1046 1047 1048 1049 CALL Register_SwapFieldHallo(pnat1,pnat1,ip1jmp1,llm,jj_Nb_caldyn,1,2,Req) 1050 CALL SendRequest(Req) 1051 CALL WaitRequest(Req) 1052 CALL Register_SwapFieldHallo(pnat2,pnat2,ip1jmp1,llm,jj_Nb_caldyn,1,2,Req) 1053 CALL SendRequest(Req) 1054 CALL WaitRequest(Req) 1049 1055 DO l=1,nlevnc 1050 1056 DO j=jjb_v,jje_v … … 1807 1813 1808 1814 ! Variables entree 1809 CHARACTER , INTENT(IN) :: varname1815 CHARACTER*(*), INTENT(IN) :: varname 1810 1816 INTEGER, INTENT (IN) :: hsize,vsize 1811 1817 REAL, DIMENSION (iip1,hsize,vsize), INTENT(IN) :: field … … 1817 1823 INTEGER :: nid, id_lonu, id_lonv, id_latu, id_latv, id_tim, id_lev 1818 1824 INTEGER :: vid_lonu,vid_lonv,vid_latu,vid_latv,vid_cu,vid_cv,vid_lev 1825 INTEGER :: vid_au,vid_av 1826 INTEGER :: l 1819 1827 INTEGER, DIMENSION (3) :: dim3 1820 1828 INTEGER, DIMENSION (4) :: dim4,count,start 1821 1829 INTEGER :: ierr, varid 1830 REAL, DIMENSION (iip1,hsize,vsize) :: field2 1822 1831 1823 1832 CALL gather_field(field,iip1*hsize,vsize,0) … … 1834 1843 ! Definition des dimensions 1835 1844 ierr=NF_DEF_DIM(nid,"LONU",iip1,id_lonu) 1845 print*,'id_lonu 1 ',id_lonu 1836 1846 ierr=NF_DEF_DIM(nid,"LONV",iip1,id_lonv) 1837 1847 ierr=NF_DEF_DIM(nid,"LATU",jjp1,id_latu) … … 1842 1852 ! Creation des variables dimensions 1843 1853 ierr=NF_DEF_VAR(nid,"LONU",NF_FLOAT,1,id_lonu,vid_lonu) 1854 print*,'id_lonu 2 ',id_lonu 1844 1855 ierr=NF_DEF_VAR(nid,"LONV",NF_FLOAT,1,id_lonv,vid_lonv) 1845 1856 ierr=NF_DEF_VAR(nid,"LATU",NF_FLOAT,1,id_latu,vid_latu) … … 1848 1859 ierr=NF_DEF_VAR(nid,"cu",NF_FLOAT,2,(/id_lonu,id_latu/),vid_cu) 1849 1860 ierr=NF_DEF_VAR(nid,"cv",NF_FLOAT,2,(/id_lonv,id_latv/),vid_cv) 1861 ierr=NF_DEF_VAR(nid,"au",NF_FLOAT,2,(/id_lonu,id_latu/),vid_au) 1862 ierr=NF_DEF_VAR(nid,"av",NF_FLOAT,2,(/id_lonv,id_latv/),vid_av) 1850 1863 1851 1864 ierr=NF_ENDDEF(nid) … … 1853 1866 ! Enregistrement des variables dimensions 1854 1867 #ifdef NC_DOUBLE 1868 print*,'id_lonu DOUBLE ',id_lonu,rlonu*180./pi 1855 1869 ierr = NF_PUT_VAR_DOUBLE(nid,vid_lonu,rlonu*180./pi) 1856 1870 ierr = NF_PUT_VAR_DOUBLE(nid,vid_lonv,rlonv*180./pi) … … 1860 1874 ierr = NF_PUT_VAR_DOUBLE(nid,vid_cu,cu) 1861 1875 ierr = NF_PUT_VAR_DOUBLE(nid,vid_cv,cv) 1876 ierr = NF_PUT_VAR_DOUBLE(nid,vid_au,alpha_u) 1877 ierr = NF_PUT_VAR_DOUBLE(nid,vid_av,alpha_v) 1862 1878 #else 1879 print*,'id_lonu 3 ',id_lonu,rlonu*180./pi 1863 1880 ierr = NF_PUT_VAR_REAL(nid,vid_lonu,rlonu*180./pi) 1864 1881 ierr = NF_PUT_VAR_REAL(nid,vid_lonv,rlonv*180./pi) … … 1868 1885 ierr = NF_PUT_VAR_REAL(nid,vid_cu,cu) 1869 1886 ierr = NF_PUT_VAR_REAL(nid,vid_cv,cv) 1887 ierr = NF_PUT_VAR_REAL(nid,vid_au,alpha_u) 1888 ierr = NF_PUT_VAR_REAL(nid,vid_av,alpha_v) 1870 1889 #endif 1871 1890 ! -------------------------------------------------------------------- … … 1875 1894 ! Pressure (GCM) 1876 1895 dim4=(/id_lonv,id_latu,id_lev,id_tim/) 1877 ierr = NF_DEF_VAR(nid," P",NF_FLOAT,4,dim4,varid)1896 ierr = NF_DEF_VAR(nid,"SP",NF_FLOAT,4,dim4,varid) 1878 1897 ! Surface pressure (guidage) 1879 1898 IF (guide_P) THEN … … 1883 1902 ! Zonal wind 1884 1903 IF (guide_u) THEN 1904 print*,'id_lonu 4 ',id_lonu,varname 1885 1905 dim4=(/id_lonu,id_latu,id_lev,id_tim/) 1906 ierr = NF_DEF_VAR(nid,"u",NF_FLOAT,4,dim4,varid) 1907 ierr = NF_DEF_VAR(nid,"ua",NF_FLOAT,4,dim4,varid) 1886 1908 ierr = NF_DEF_VAR(nid,"ucov",NF_FLOAT,4,dim4,varid) 1887 1909 ENDIF … … 1889 1911 IF (guide_v) THEN 1890 1912 dim4=(/id_lonv,id_latv,id_lev,id_tim/) 1913 ierr = NF_DEF_VAR(nid,"v",NF_FLOAT,4,dim4,varid) 1914 ierr = NF_DEF_VAR(nid,"va",NF_FLOAT,4,dim4,varid) 1891 1915 ierr = NF_DEF_VAR(nid,"vcov",NF_FLOAT,4,dim4,varid) 1892 1916 ENDIF … … 1912 1936 ierr=NF_OPEN("guide_ins.nc",NF_WRITE,nid) 1913 1937 1938 IF (varname=="SP") timestep=timestep+1 1939 1940 IF (varname=="SP") THEN 1941 print*,'varname=SP=',varname 1942 ELSE 1943 print*,'varname diff SP=',varname 1944 ENDIF 1945 1946 1947 ierr = NF_INQ_VARID(nid,varname,varid) 1914 1948 SELECT CASE (varname) 1915 CASE ("P") 1916 timestep=timestep+1 1917 ierr = NF_INQ_VARID(nid,"P",varid) 1949 CASE ("SP","ps") 1918 1950 start=(/1,1,1,timestep/) 1919 1951 count=(/iip1,jjp1,llm,1/) 1920 #ifdef NC_DOUBLE 1921 ierr = NF_PUT_VARA_DOUBLE(nid,varid,start,count,field) 1922 #else 1923 ierr = NF_PUT_VARA_REAL(nid,varid,start,count,field) 1924 #endif 1925 CASE ("SP") 1926 ierr = NF_INQ_VARID(nid,"ps",varid) 1927 start=(/1,1,timestep,0/) 1928 count=(/iip1,jjp1,1,0/) 1929 #ifdef NC_DOUBLE 1930 ierr = NF_PUT_VARA_DOUBLE(nid,varid,start,count,field/factt) 1931 #else 1932 ierr = NF_PUT_VARA_REAL(nid,varid,start,count,field/factt) 1933 #endif 1934 CASE ("U") 1935 ierr = NF_INQ_VARID(nid,"ucov",varid) 1952 CASE ("v","va","vcov") 1953 start=(/1,1,1,timestep/) 1954 count=(/iip1,jjm,llm,1/) 1955 CASE DEFAULT 1936 1956 start=(/1,1,1,timestep/) 1937 1957 count=(/iip1,jjp1,llm,1/) 1958 END SELECT 1959 1960 SELECT CASE (varname) 1961 CASE("u","ua") 1962 DO l=1,llm ; field2(:,2:jjm,l)=field(:,2:jjm,l)/cu(:,2:jjm) ; ENDDO 1963 field2(:,1,:)=0. ; field2(:,jjp1,:)=0. 1964 CASE("v","va") 1965 DO l=1,llm ; field2(:,:,l)=field(:,:,l)/cv(:,:) ; ENDDO 1966 CASE DEFAULT 1967 field2=field 1968 END SELECT 1969 1938 1970 #ifdef NC_DOUBLE 1939 ierr = NF_PUT_VARA_DOUBLE(nid,varid,start,count,field/factt)1971 ierr = NF_PUT_VARA_DOUBLE(nid,varid,start,count,field2) 1940 1972 #else 1941 ierr = NF_PUT_VARA_REAL(nid,varid,start,count,field/factt)1973 ierr = NF_PUT_VARA_REAL(nid,varid,start,count,field2) 1942 1974 #endif 1943 CASE ("V")1944 ierr = NF_INQ_VARID(nid,"vcov",varid)1945 start=(/1,1,1,timestep/)1946 count=(/iip1,jjm,llm,1/)1947 #ifdef NC_DOUBLE1948 ierr = NF_PUT_VARA_DOUBLE(nid,varid,start,count,field/factt)1949 #else1950 ierr = NF_PUT_VARA_REAL(nid,varid,start,count,field/factt)1951 #endif1952 CASE ("T")1953 ierr = NF_INQ_VARID(nid,"teta",varid)1954 start=(/1,1,1,timestep/)1955 count=(/iip1,jjp1,llm,1/)1956 #ifdef NC_DOUBLE1957 ierr = NF_PUT_VARA_DOUBLE(nid,varid,start,count,field/factt)1958 #else1959 ierr = NF_PUT_VARA_REAL(nid,varid,start,count,field/factt)1960 #endif1961 CASE ("Q")1962 ierr = NF_INQ_VARID(nid,"q",varid)1963 start=(/1,1,1,timestep/)1964 count=(/iip1,jjp1,llm,1/)1965 #ifdef NC_DOUBLE1966 ierr = NF_PUT_VARA_DOUBLE(nid,varid,start,count,field/factt)1967 #else1968 ierr = NF_PUT_VARA_REAL(nid,varid,start,count,field/factt)1969 #endif1970 END SELECT1971 1975 1972 1976 ierr = NF_CLOSE(nid) -
trunk/LMDZ.COMMON/libf/dyn3dpar/leapfrog_p.F
r1300 r1302 8 8 & time_0) 9 9 10 use exner_hyb_m, only: exner_hyb 11 use exner_milieu_m, only: exner_milieu 12 use exner_hyb_p_m, only: exner_hyb_p 13 use exner_milieu_p_m, only: exner_milieu_p 10 14 USE misc_mod 11 15 USE parallel_lmdz … … 17 21 USE vampir 18 22 USE timer_filtre, ONLY : print_filtre_timer 19 USE infotrac 23 USE infotrac, ONLY: nqtot 20 24 USE guide_p_mod, ONLY : guide_main 21 25 USE getparam … … 165 169 character*10 string10 166 170 167 REAL,SAVE :: alpha(ip1jmp1,llm),beta(ip1jmp1,llm)168 171 REAL,SAVE :: flxw(ip1jmp1,llm) ! flux de masse verticale 169 172 … … 236 239 lafin=.false. 237 240 238 itaufin = nday*day_step 241 if (nday>=0) then 242 itaufin = nday*day_step 243 else 244 ! to run a given (-nday) number of dynamical steps 245 itaufin = -nday 246 endif 239 247 if (less1day) then 240 248 c MODIF VENUS: to run less than one day: … … 292 300 CALL pression ( ip1jmp1, ap, bp, ps, p ) 293 301 if (pressure_exner) then 294 CALL exner_hyb( ip1jmp1, ps, p, alpha,beta,pks, pk, pkf )302 CALL exner_hyb( ip1jmp1, ps, p, pks, pk, pkf ) 295 303 else 296 CALL exner_milieu( ip1jmp1, ps, p, beta,pks, pk, pkf )304 CALL exner_milieu( ip1jmp1, ps, p, pks, pk, pkf ) 297 305 endif 298 306 c$OMP END MASTER … … 830 838 c$OMP BARRIER 831 839 if (pressure_exner) then 832 CALL exner_hyb_p( ip1jmp1, ps, p, alpha,beta,pks, pk, pkf )840 CALL exner_hyb_p( ip1jmp1, ps, p,pks, pk, pkf ) 833 841 else 834 CALL exner_milieu_p( ip1jmp1, ps, p, beta,pks, pk, pkf )842 CALL exner_milieu_p( ip1jmp1, ps, p, pks, pk, pkf ) 835 843 endif 844 ! Compute geopotential (physics might need it) 845 CALL geopot ( ip1jmp1, teta , pk , pks, phis , phi ) 836 846 c$OMP BARRIER 837 847 jD_cur = jD_ref + day_ini - day_ref … … 1040 1050 c$OMP BARRIER 1041 1051 if (pressure_exner) then 1042 CALL exner_hyb_p(ip1jmp1,ps,p, alpha,beta,pks,pk,pkf)1052 CALL exner_hyb_p(ip1jmp1,ps,p,pks,pk,pkf) 1043 1053 else 1044 CALL exner_milieu_p(ip1jmp1,ps,p, beta,pks,pk,pkf)1054 CALL exner_milieu_p(ip1jmp1,ps,p,pks,pk,pkf) 1045 1055 endif 1046 1056 c$OMP BARRIER … … 1202 1212 c$OMP BARRIER 1203 1213 if (pressure_exner) then 1204 CALL exner_hyb_p( ip1jmp1, ps, p, alpha,beta,pks, pk, pkf )1214 CALL exner_hyb_p( ip1jmp1, ps, p, pks, pk, pkf ) 1205 1215 else 1206 CALL exner_milieu_p( ip1jmp1, ps, p, beta,pks, pk, pkf )1216 CALL exner_milieu_p( ip1jmp1, ps, p, pks, pk, pkf ) 1207 1217 endif 1208 1218 c$OMP BARRIER -
trunk/LMDZ.COMMON/libf/dyn3dpar/logic.h
r1056 r1302 11 11 & statcl,conser,apdiss,apdelq,saison,ecripar,fxyhypb,ysinus & 12 12 & ,read_start,ok_guide,ok_strato,tidal,ok_gradsfile & 13 & ,ok_limit,ok_etat0, grilles_gcm_netcdf,hybrid&13 & ,ok_limit,ok_etat0,hybrid & 14 14 & ,moyzon_mu,moyzon_ch 15 15 … … 19 19 & apdiss,apdelq,saison,ecripar,fxyhypb,ysinus & 20 20 & ,read_start,ok_guide,ok_strato,tidal,ok_gradsfile & 21 & ,ok_limit,ok_etat0 ,grilles_gcm_netcdf21 & ,ok_limit,ok_etat0 22 22 logical hybrid ! vertical coordinate is hybrid if true (sigma otherwise) 23 23 ! (only used if disvert_type==2) -
trunk/LMDZ.COMMON/libf/dyn3dpar/mod_const_mpi.F90
r1300 r1302 1 1 ! 2 ! $Id: mod_const_mpi.F90 1700 2012-12-20 14:43:19Z lguez$2 ! $Id: mod_const_mpi.F90 2055 2014-06-04 12:33:27Z acaubel $ 3 3 ! 4 4 MODULE mod_const_mpi … … 17 17 USE ioipsl_getincom, only: getin 18 18 #endif 19 19 ! Use of Oasis-MCT coupler 20 #ifdef CPP_OMCT 21 USE mod_prism 22 #endif 23 #ifdef CPP_XIOS 24 USE wxios, only: wxios_init 25 #endif 20 26 IMPLICIT NONE 21 27 #ifdef CPP_MPI … … 38 44 #ifdef CPP_COUPLE 39 45 !$OMP MASTER 40 CALL prism_init_comp_proto (comp_id, 'lmdz.x', ierr) 46 #ifdef CPP_XIOS 47 CALL wxios_init("LMDZ", outcom=COMM_LMDZ, type_ocean=type_ocean) 48 #else 49 CALL prism_init_comp_proto (comp_id, 'LMDZ', ierr) 41 50 CALL prism_get_localcomm_proto(COMM_LMDZ,ierr) 51 #endif 42 52 !$OMP END MASTER 43 53 #endif -
trunk/LMDZ.COMMON/libf/dyn3dpar/parallel_lmdz.F90
r1300 r1302 225 225 #endif 226 226 #ifdef CPP_COUPLE 227 ! Use of Oasis-MCT coupler 228 #if defined CPP_OMCT 229 use mod_prism 230 #else 227 231 use mod_prism_proto 228 232 #endif 229 #ifdef CPP_EARTH230 233 ! Ehouarn: surface_data module is in 'phylmd' ... 231 234 use surface_data, only : type_ocean … … 252 255 253 256 if (type_ocean == 'couple') then 257 #ifdef CPP_XIOS 258 !Fermeture propre de XIOS 259 CALL wxios_close() 260 #else 254 261 #ifdef CPP_COUPLE 255 262 call prism_terminate_proto(ierr) … … 258 265 endif 259 266 #endif 267 #endif 260 268 else 261 269 #ifdef CPP_XIOS
Note: See TracChangeset
for help on using the changeset viewer.