Changeset 2258 for LMDZ5/branches/testing/libf
- Timestamp:
- Apr 13, 2015, 10:21:09 AM (10 years ago)
- Location:
- LMDZ5/branches/testing
- Files:
-
- 8 deleted
- 52 edited
- 12 copied
Legend:
- Unmodified
- Added
- Removed
-
LMDZ5/branches/testing
- Property svn:mergeinfo changed
/LMDZ5/trunk merged: 2218,2221-2237
- Property svn:mergeinfo changed
-
LMDZ5/branches/testing/libf/dyn3d/calfis.F
r2056 r2258 21 21 $ pdq, 22 22 $ flxw, 23 $ clesphy0,24 23 $ pdufi, 25 24 $ pdvfi, … … 131 130 REAL,INTENT(OUT) :: pdpsfi(iip1,jjp1) ! tendency on surface pressure (Pa/s) 132 131 133 INTEGER,PARAMETER :: longcles = 20134 REAL,INTENT(IN) :: clesphy0( longcles ) ! unused135 136 132 137 133 c Local variables : … … 465 461 . zphis, 466 462 . presnivs, 467 . clesphy0,468 463 . zufi, 469 464 . zvfi, -
LMDZ5/branches/testing/libf/dyn3d/ce0l.F90
r1999 r2258 41 41 #include "temps.h" 42 42 #include "logic.h" 43 INTEGER, PARAMETER :: longcles=2044 REAL, DIMENSION(longcles) :: clesphy045 43 REAL, DIMENSION(iip1,jjp1) :: masque 46 44 CHARACTER(LEN=15) :: calnd 47 45 REAL, DIMENSION(iip1,jjp1) :: phis ! geopotentiel au sol 48 46 !------------------------------------------------------------------------------- 49 CALL conf_gcm( 99, .TRUE. , clesphy0)47 CALL conf_gcm( 99, .TRUE. ) 50 48 51 49 CALL Init_Phys_lmdz(iim,jjp1,llm,1,(/(jjm-1)*iim+2/)) -
LMDZ5/branches/testing/libf/dyn3d/conf_gcm.F90
r2160 r2258 2 2 ! $Id$ 3 3 4 SUBROUTINE conf_gcm( tapedef, etatinit , clesphy0)4 SUBROUTINE conf_gcm( tapedef, etatinit ) 5 5 6 6 USE control_mod … … 23 23 ! etatinit : = TRUE , on ne compare pas les valeurs des para- 24 24 ! -metres du zoom avec celles lues sur le fichier start . 25 ! clesphy0 : sortie . 26 27 LOGICAL etatinit 28 INTEGER tapedef 29 30 INTEGER longcles 31 PARAMETER( longcles = 20 ) 32 REAL clesphy0( longcles ) 25 26 LOGICAL,INTENT(IN) :: etatinit 27 INTEGER,INTENT(IN) :: tapedef 33 28 34 29 ! Declarations : … … 41 36 include "temps.h" 42 37 include "comconst.h" 43 44 ! FH 2008/05/09 On elimine toutes les clefs physiques dans la dynamique45 ! include "clesphys.h"46 38 include "iniprint.h" 47 39 … … 381 373 ip_ebil_dyn = 0 382 374 CALL getin('ip_ebil_dyn',ip_ebil_dyn) 383 384 DO i = 1, longcles385 clesphy0(i) = 0.386 ENDDO387 375 388 376 !cc .... P. Le Van , ajout le 7/03/95 .pour le zoom ... … … 734 722 !Config Help = extension en longitude de la zone du zoom 735 723 !Config ( fraction de la zone totale) 736 dzoomx = 0. 0724 dzoomx = 0.2 737 725 CALL getin('dzoomx',dzoomx) 726 call assert(dzoomx < 1, "conf_gcm: dzoomx must be < 1") 738 727 739 728 !Config Key = dzoomy … … 742 731 !Config Help = extension en latitude de la zone du zoom 743 732 !Config ( fraction de la zone totale) 744 dzoomy = 0. 0733 dzoomy = 0.2 745 734 CALL getin('dzoomy',dzoomy) 735 call assert(dzoomy< 1, "conf_gcm: dzoomy must be < 1") 746 736 747 737 !Config Key = taux -
LMDZ5/branches/testing/libf/dyn3d/gcm.F
r2160 r2258 26 26 ! Only INCA needs these informations (from the Earth's physics) 27 27 USE indice_sol_mod 28 USE mod_phys_lmdz_para, ONLY : klon_mpi_para_nb 28 29 #endif 29 30 … … 33 34 ! dynamique -> physique pour l'initialisation 34 35 #ifdef CPP_PHYS 35 USE dimphy 36 USE comgeomphy 37 USE mod_phys_lmdz_para, ONLY : klon_mpi_para_nb 36 ! USE dimphy 37 ! USE comgeomphy 38 38 #endif 39 39 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! … … 90 90 !#include "indicesol.h" 91 91 #endif 92 INTEGER longcles93 PARAMETER ( longcles = 20 )94 REAL clesphy0( longcles )95 SAVE clesphy096 97 98 92 99 93 REAL zdtvr … … 125 119 LOGICAL first 126 120 127 LOGICAL call_iniphys128 data call_iniphys/.true./121 ! LOGICAL call_iniphys 122 ! data call_iniphys/.true./ 129 123 130 124 c+jld variables test conservation energie … … 147 141 REAL :: heure 148 142 149 150 c-----------------------------------------------------------------------151 c variables pour l'initialisation de la physique :152 c ------------------------------------------------153 INTEGER ngridmx154 PARAMETER( ngridmx = 2+(jjm-1)*iim - 1/jjm )155 REAL zcufi(ngridmx),zcvfi(ngridmx)156 REAL latfi(ngridmx),lonfi(ngridmx)157 REAL airefi(ngridmx)158 SAVE latfi, lonfi, airefi159 160 143 c----------------------------------------------------------------------- 161 144 c Initialisations: … … 175 158 c --------------------------------------- 176 159 c 177 ! Ehouarn: dump possibility of using defrun 178 !#ifdef CPP_IOIPSL 179 CALL conf_gcm( 99, .TRUE. , clesphy0 ) 160 CALL conf_gcm( 99, .TRUE.) 180 161 if (mod(iphysiq, iperiod) /= 0) call abort_gcm("conf_gcm", 181 162 s "iphysiq must be a multiple of iperiod", 1) 182 !#else183 ! CALL defrun( 99, .TRUE. , clesphy0 )184 !#endif185 163 186 164 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! … … 199 177 #ifdef CPP_PHYS 200 178 CALL Init_Phys_lmdz(iim,jjp1,llm,1,(/(jjm-1)*iim+2/)) 201 call InitComgeomphy 179 ! call InitComgeomphy ! now done in iniphysiq 202 180 #endif 203 181 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! … … 215 193 call ioconf_calendar('noleap') 216 194 write(lunout,*)'CALENDRIER CHOISI: Terrestre a 365 jours/an' 217 else if (calend == ' earth_366d') then195 else if (calend == 'gregorian') then 218 196 call ioconf_calendar('gregorian') 219 197 write(lunout,*)'CALENDRIER CHOISI: Terrestre bissextile' … … 316 294 317 295 C 318 C on remet le calendrier àzero si demande296 C on remet le calendrier \`a zero si demande 319 297 c 320 298 IF (start_time /= starttime) then 321 299 WRITE(lunout,*)' GCM: Attention l''heure de depart lue dans le' 322 &,' fichier restart ne correspond pas àcelle lue dans le run.def'300 &,' fichier restart ne correspond pas a celle lue dans le run.def' 323 301 IF (raz_date == 1) then 324 302 WRITE(lunout,*)'Je prends l''heure lue dans run.def' … … 428 406 c ------------------------------- 429 407 430 IF (call_iniphys.and.(iflag_phys==1.or.iflag_phys>=100)) THEN 431 latfi(1)=rlatu(1) 432 lonfi(1)=0. 433 zcufi(1) = cu(1) 434 zcvfi(1) = cv(1) 435 DO j=2,jjm 436 DO i=1,iim 437 latfi((j-2)*iim+1+i)= rlatu(j) 438 lonfi((j-2)*iim+1+i)= rlonv(i) 439 zcufi((j-2)*iim+1+i) = cu((j-1)*iip1+i) 440 zcvfi((j-2)*iim+1+i) = cv((j-1)*iip1+i) 441 ENDDO 442 ENDDO 443 latfi(ngridmx)= rlatu(jjp1) 444 lonfi(ngridmx)= 0. 445 zcufi(ngridmx) = cu(ip1jm+1) 446 zcvfi(ngridmx) = cv(ip1jm-iim) 447 CALL gr_dyn_fi(1,iip1,jjp1,ngridmx,aire,airefi) 448 WRITE(lunout,*) 449 . 'GCM: WARNING!!! vitesse verticale nulle dans la physique' 408 IF ((iflag_phys==1).or.(iflag_phys>=100)) THEN 450 409 ! Physics: 451 410 #ifdef CPP_PHYS 452 CALL iniphysiq( ngridmx,llm,daysec,day_ini,dtphys/nsplit_phys,453 & latfi,lonfi,airefi,zcufi,zcvfi,rad,g,r,cpp,411 CALL iniphysiq(iim,jjm,llm,daysec,day_ini,dtphys/nsplit_phys, 412 & rlatu,rlonv,aire,cu,cv,rad,g,r,cpp, 454 413 & iflag_phys) 455 414 #endif 456 call_iniphys=.false. 457 ENDIF ! of IF (call_iniphys.and.(iflag_phys.eq.1)) 415 ENDIF ! of IF ((iflag_phys==1).or.(iflag_phys>=100)) 458 416 459 417 c numero de stockage pour les fichiers de redemarrage: … … 530 488 531 489 532 CALL leapfrog(ucov,vcov,teta,ps,masse,phis,q,clesphy0, 533 . time_0) 490 CALL leapfrog(ucov,vcov,teta,ps,masse,phis,q,time_0) 534 491 535 492 END -
LMDZ5/branches/testing/libf/dyn3d/leapfrog.F
r2056 r2258 4 4 c 5 5 c 6 SUBROUTINE leapfrog(ucov,vcov,teta,ps,masse,phis,q,clesphy0, 7 & time_0) 6 SUBROUTINE leapfrog(ucov,vcov,teta,ps,masse,phis,q,time_0) 8 7 9 8 … … 70 69 #include "academic.h" 71 70 72 ! FH 2008/05/09 On elimine toutes les clefs physiques dans la dynamique73 ! #include "clesphys.h"74 75 INTEGER,PARAMETER :: longcles = 2076 REAL,INTENT(IN) :: clesphy0( longcles ) ! not used77 71 REAL,INTENT(IN) :: time_0 ! not used 78 72 … … 446 440 $ ucov,vcov,teta,q,masse,ps,p,pk,phis,phi , 447 441 $ du,dv,dteta,dq, 448 $ flxw, 449 $ clesphy0, dufi,dvfi,dtetafi,dqfi,dpfi ) 442 $ flxw,dufi,dvfi,dtetafi,dqfi,dpfi ) 450 443 451 444 c ajout des tendances physiques: -
LMDZ5/branches/testing/libf/dyn3d_common/grilles_gcm_netcdf_sub.F90
r2116 r2258 31 31 INTEGER out_latudim,out_latvdim,out_dim(3) 32 32 INTEGER out_levdim 33 34 INTEGER, PARAMETER :: longcles = 2035 REAL clesphy0(longcles)36 33 37 34 INTEGER start(4),COUNT(4) … … 60 57 pa= 50000. 61 58 62 CALL conf_gcm( 99, .TRUE. , clesphy0)59 CALL conf_gcm( 99, .TRUE. ) 63 60 CALL iniconst 64 61 CALL inigeom -
LMDZ5/branches/testing/libf/dyn3d_common/inigeom.F
r1999 r2258 16 16 c 17 17 c 18 use fxhyp_m, only: fxhyp 19 use fyhyp_m, only: fyhyp 18 20 IMPLICIT NONE 19 21 c … … 264 266 WRITE(6,*)'*** Inigeom , Y = Latitude , der.tg. hyperbolique ***' 265 267 266 CALL fxyhyper( clat, grossismy, dzoomy, tauy , 267 , clon, grossismx, dzoomx, taux , 268 , rlatu,yprimu,rlatv, yprimv,rlatu1, yprimu1,rlatu2,yprimu2 , 269 , rlonu,xprimu,rlonv,xprimv,rlonm025,xprimm025,rlonp025,xprimp025 ) 270 268 CALL fyhyp(rlatu, yprimu, rlatv, rlatu2, yprimu2, rlatu1, yprimu1) 269 CALL fxhyp(xprimm025, rlonv, xprimv, rlonu, xprimu, xprimp025) 271 270 272 271 ENDIF -
LMDZ5/branches/testing/libf/dyn3dmem/calfis_loc.F
r2056 r2258 21 21 $ pdq, 22 22 $ flxw, 23 $ clesphy0,24 23 $ pdufi, 25 24 $ pdvfi, … … 141 140 REAL,INTENT(OUT) :: pdqfi(iip1,jjb_u:jje_u,llm,nqtot) ! tendency on tracers 142 141 REAL,INTENT(OUT) :: pdpsfi(iip1,jjb_u:jje_u) ! tendency on surface pressure (Pa/s) 143 144 INTEGER,PARAMETER :: longcles = 20145 REAL,INTENT(IN) :: clesphy0( longcles ) ! unused146 147 142 148 143 #ifdef CPP_PHYS … … 674 669 . zphis_omp, 675 670 . presnivs_omp, 676 . clesphy0,677 671 . zufi_omp, 678 672 . zvfi_omp, 679 673 . ztfi_omp, 680 674 . zqfi_omp, 681 c#ifdef INCA682 675 . flxwfi_omp, 683 c#endif684 676 . zdufi_omp, 685 677 . zdvfi_omp, -
LMDZ5/branches/testing/libf/dyn3dmem/call_calfis_mod.F90
r2056 r2258 68 68 69 69 70 SUBROUTINE call_calfis(itau,lafin, clesphy0,ucov_dyn,vcov_dyn,teta_dyn,masse_dyn,ps_dyn, &70 SUBROUTINE call_calfis(itau,lafin,ucov_dyn,vcov_dyn,teta_dyn,masse_dyn,ps_dyn, & 71 71 phis_dyn,q_dyn,flxw_dyn) 72 72 USE dimensions_mod … … 91 91 INTEGER,INTENT(IN) :: itau ! (time) iteration step number 92 92 LOGICAL,INTENT(IN) :: lafin ! .true. if final time step 93 REAL,INTENT(IN) :: clesphy0( : ) ! not used94 93 REAL,INTENT(INOUT) :: ucov_dyn(ijb_u:ije_u,llm) ! covariant zonal wind 95 94 REAL,INTENT(INOUT) :: vcov_dyn(ijb_v:ije_v,llm) ! covariant meridional wind … … 231 230 ucov,vcov,teta,q,masse,ps,p,pk,phis,phi , & 232 231 du,dv,dteta,dq, & 233 flxw, & 234 clesphy0, dufi,dvfi,dtetafi,dqfi,dpfi ) 232 flxw, dufi,dvfi,dtetafi,dqfi,dpfi ) 235 233 236 234 ijb=ij_begin -
LMDZ5/branches/testing/libf/dyn3dmem/ce0l.F90
r1999 r2258 48 48 #endif 49 49 50 INTEGER, PARAMETER :: longcles=2051 50 INTEGER :: ierr 52 REAL, DIMENSION(longcles) :: clesphy053 51 REAL, DIMENSION(iip1,jjp1) :: masque 54 52 CHARACTER(LEN=15) :: calnd 55 53 REAL, DIMENSION(iip1,jjp1) :: phis ! geopotentiel au sol 56 54 !------------------------------------------------------------------------------- 57 CALL conf_gcm( 99, .TRUE. , clesphy0)55 CALL conf_gcm( 99, .TRUE. ) 58 56 59 57 #ifdef CPP_MPI -
LMDZ5/branches/testing/libf/dyn3dmem/conf_gcm.F90
r2160 r2258 2 2 ! $Id$ 3 3 4 SUBROUTINE conf_gcm( tapedef, etatinit , clesphy0)4 SUBROUTINE conf_gcm( tapedef, etatinit ) 5 5 6 6 USE control_mod … … 27 27 ! etatinit : = TRUE , on ne compare pas les valeurs des para- 28 28 ! -metres du zoom avec celles lues sur le fichier start . 29 ! clesphy0 : sortie . 30 31 LOGICAL etatinit 32 INTEGER tapedef 33 34 INTEGER longcles 35 PARAMETER( longcles = 20 ) 36 REAL clesphy0( longcles ) 29 30 LOGICAL,INTENT(IN) :: etatinit 31 INTEGER,INTENT(IN) :: tapedef 37 32 38 33 ! Declarations : … … 45 40 include "temps.h" 46 41 include "comconst.h" 47 48 ! FH 2008/05/09 On elimine toutes les clefs physiques dans la dynamique49 ! include "clesphys.h"50 42 include "iniprint.h" 51 43 … … 768 760 !Config Help = extension en longitude de la zone du zoom 769 761 !Config ( fraction de la zone totale) 770 dzoomx = 0. 0762 dzoomx = 0.2 771 763 CALL getin('dzoomx',dzoomx) 764 call assert(dzoomx < 1, "conf_gcm: dzoomx must be < 1") 772 765 773 766 !Config Key = dzoomy … … 776 769 !Config Help = extension en latitude de la zone du zoom 777 770 !Config ( fraction de la zone totale) 778 dzoomy = 0. 0771 dzoomy = 0.2 779 772 CALL getin('dzoomy',dzoomy) 773 call assert(dzoomy < 1, "conf_gcm: dzoomy must be < 1") 780 774 781 775 !Config Key = taux -
LMDZ5/branches/testing/libf/dyn3dmem/gcm.F
r2187 r2258 1 1 ! 2 ! $Id $2 ! $Id: $ 3 3 ! 4 4 c … … 23 23 ! Only INCA needs these informations (from the Earth's physics) 24 24 USE indice_sol_mod 25 USE mod_phys_lmdz_omp_data, ONLY: klon_omp 25 26 #endif 26 27 27 28 #ifdef CPP_PHYS 28 USE mod_grid_phy_lmdz 29 USE mod_phys_lmdz_para, ONLY : klon_mpi_para_nb 30 USE mod_phys_lmdz_omp_data, ONLY: klon_omp 31 USE dimphy 32 USE comgeomphy 29 ! USE mod_grid_phy_lmdz 30 ! USE mod_phys_lmdz_para, ONLY : klon_mpi_para_nb 31 ! USE dimphy 32 ! USE comgeomphy 33 33 #endif 34 34 IMPLICIT NONE … … 83 83 #endif 84 84 85 INTEGER longcles86 PARAMETER ( longcles = 20 )87 REAL clesphy0( longcles )88 SAVE clesphy089 90 91 92 85 REAL zdtvr 93 86 … … 111 104 112 105 LOGICAL lafin 113 c INTEGER ij,iq,l,i,j114 INTEGER i,j115 116 106 117 107 real time_step, t_wrt, t_ops 118 119 120 LOGICAL call_iniphys121 data call_iniphys/.true./122 108 123 109 c+jld variables test conservation energie … … 142 128 143 129 c----------------------------------------------------------------------- 144 c variables pour l'initialisation de la physique :145 c ------------------------------------------------146 INTEGER ngridmx147 PARAMETER( ngridmx = 2+(jjm-1)*iim - 1/jjm )148 REAL zcufi(ngridmx),zcvfi(ngridmx)149 REAL latfi(ngridmx),lonfi(ngridmx)150 REAL airefi(ngridmx)151 SAVE latfi, lonfi, airefi152 153 INTEGER :: ierr154 155 156 c-----------------------------------------------------------------------157 130 c Initialisations: 158 131 c ---------------- … … 171 144 c --------------------------------------- 172 145 c 173 ! Ehouarn: dump possibility of using defrun 174 !#ifdef CPP_IOIPSL 175 CALL conf_gcm( 99, .TRUE. , clesphy0 ) 146 CALL conf_gcm( 99, .TRUE. ) 176 147 if (mod(iphysiq, iperiod) /= 0) call abort_gcm("conf_gcm", 177 148 s "iphysiq must be a multiple of iperiod", 1) 178 !#else179 ! CALL defrun( 99, .TRUE. , clesphy0 )180 !#endif181 149 c 182 150 c … … 192 160 #ifdef CPP_PHYS 193 161 CALL Init_Phys_lmdz(iim,jjp1,llm,mpi_size,distrib_phys) 194 #endif 162 !#endif 163 ! CALL set_bands 164 !#ifdef CPP_PHYS 165 CALL Init_interface_dyn_phys 166 #endif 167 CALL barrier 168 195 169 CALL set_bands 196 #ifdef CPP_PHYS197 CALL Init_interface_dyn_phys198 #endif199 CALL barrier200 201 170 if (mpi_rank==0) call WriteBands 202 171 call Set_Distrib(distrib_caldyn) … … 206 175 c$OMP END PARALLEL 207 176 208 #ifdef CPP_PHYS209 c$OMP PARALLEL210 call InitComgeomphy 211 c$OMP END PARALLEL212 #endif177 !#ifdef CPP_PHYS 178 !c$OMP PARALLEL 179 ! call InitComgeomphy ! now done in iniphysiq 180 !c$OMP END PARALLEL 181 !#endif 213 182 214 183 c----------------------------------------------------------------------- … … 225 194 call ioconf_calendar('noleap') 226 195 write(lunout,*)'CALENDRIER CHOISI: Terrestre a 365 jours/an' 227 else if (calend == ' earth_366d') then196 else if (calend == 'gregorian') then 228 197 call ioconf_calendar('gregorian') 229 198 write(lunout,*)'CALENDRIER CHOISI: Terrestre bissextile' … … 321 290 322 291 C 323 C on remet le calendrier àzero si demande292 C on remet le calendrier \`a zero si demande 324 293 c 325 294 IF (start_time /= starttime) then 326 295 WRITE(lunout,*)' GCM: Attention l''heure de depart lue dans le' 327 &,' fichier restart ne correspond pas àcelle lue dans le run.def'296 &,' fichier restart ne correspond pas a celle lue dans le run.def' 328 297 IF (raz_date == 1) then 329 298 WRITE(lunout,*)'Je prends l''heure lue dans run.def' … … 431 400 c Initialisation de la physique : 432 401 c ------------------------------- 433 IF (call_iniphys.and.(iflag_phys==1.or.iflag_phys>=100)) THEN 434 latfi(1)=rlatu(1) 435 lonfi(1)=0. 436 zcufi(1) = cu(1) 437 zcvfi(1) = cv(1) 438 DO j=2,jjm 439 DO i=1,iim 440 latfi((j-2)*iim+1+i)= rlatu(j) 441 lonfi((j-2)*iim+1+i)= rlonv(i) 442 zcufi((j-2)*iim+1+i) = cu((j-1)*iip1+i) 443 zcvfi((j-2)*iim+1+i) = cv((j-1)*iip1+i) 444 ENDDO 445 ENDDO 446 latfi(ngridmx)= rlatu(jjp1) 447 lonfi(ngridmx)= 0. 448 zcufi(ngridmx) = cu(ip1jm+1) 449 zcvfi(ngridmx) = cv(ip1jm-iim) 450 CALL gr_dyn_fi(1,iip1,jjp1,ngridmx,aire,airefi) 451 452 WRITE(lunout,*) 453 . 'GCM: WARNING!!! vitesse verticale nulle dans la physique' 402 IF ((iflag_phys==1).or.(iflag_phys>=100)) THEN 454 403 ! Physics: 455 404 #ifdef CPP_PHYS 456 CALL iniphysiq(ngridmx,llm,daysec,day_ini,dtphys/nsplit_phys, 457 & latfi,lonfi,airefi,zcufi,zcvfi,rad,g,r,cpp, 458 & iflag_phys) 459 #endif 460 call_iniphys=.false. 461 ENDIF ! of IF (call_iniphys.and.(iflag_phys==1.or.iflag_phys>=100)) 405 CALL iniphysiq(iim,jjm,llm,daysec,day_ini,dtphys/nsplit_phys, 406 & rlatu,rlonv,aire,cu,cv,rad,g,r,cpp, 407 & iflag_phys) 408 #endif 409 ENDIF ! of IF ((iflag_phys==1).or.(iflag_phys>=100)) 462 410 463 411 … … 547 495 548 496 c$OMP PARALLEL DEFAULT(SHARED) COPYIN(/temps/,/logici/,/logicl/) 549 CALL leapfrog_loc(ucov,vcov,teta,ps,masse,phis,q,clesphy0, 550 . time_0) 497 CALL leapfrog_loc(ucov,vcov,teta,ps,masse,phis,q,time_0) 551 498 c$OMP END PARALLEL 552 499 -
LMDZ5/branches/testing/libf/dyn3dmem/leapfrog_loc.F
r2187 r2258 9 9 10 10 SUBROUTINE leapfrog_loc(ucov0,vcov0,teta0,ps0, 11 & masse0,phis0,q0,clesphy0, 12 & time_0) 11 & masse0,phis0,q0,time_0) 13 12 14 13 USE misc_mod … … 82 81 ! include "mpif.h" 83 82 84 INTEGER,PARAMETER :: longcles = 2085 REAL,INTENT(IN) :: clesphy0( longcles ) ! not used86 83 REAL,INTENT(IN) :: time_0 ! not used 87 84 … … 757 754 IF( apphys ) THEN 758 755 759 CALL call_calfis(itau,lafin, clesphy0,ucov,vcov,teta,masse,ps,756 CALL call_calfis(itau,lafin,ucov,vcov,teta,masse,ps, 760 757 & phis,q,flxw) 761 758 ! #ifdef DEBUG_IO … … 882 879 ! $ du,dv,dteta,dq, 883 880 ! $ flxw, 884 ! $ clesphy0,dufi,dvfi,dtetafi,dqfi,dpfi )881 ! $ dufi,dvfi,dtetafi,dqfi,dpfi ) 885 882 ! ! CALL FTRACE_REGION_END("calfis") 886 883 ! ! ijb=ij_begin -
LMDZ5/branches/testing/libf/dyn3dpar/calfis_p.F
r2056 r2258 21 21 $ pdq, 22 22 $ flxw, 23 $ clesphy0,24 23 $ pdufi, 25 24 $ pdvfi, … … 140 139 REAL,INTENT(OUT) :: pdqfi(iip1,jjp1,llm,nqtot) ! tendency on tracers 141 140 REAL,INTENT(OUT) :: pdpsfi(iip1,jjp1) ! tendency on surface pressure (Pa/s) 142 143 INTEGER,PARAMETER :: longcles = 20144 REAL,INTENT(IN) :: clesphy0( longcles ) ! unused145 141 146 142 #ifdef CPP_PHYS … … 636 632 . zphis_omp, 637 633 . presnivs_omp, 638 . clesphy0,639 634 . zufi_omp, 640 635 . zvfi_omp, 641 636 . ztfi_omp, 642 637 . zqfi_omp, 643 c#ifdef INCA644 638 . flxwfi_omp, 645 c#endif646 639 . zdufi_omp, 647 640 . zdvfi_omp, -
LMDZ5/branches/testing/libf/dyn3dpar/ce0l.F90
r1999 r2258 48 48 #endif 49 49 50 INTEGER, PARAMETER :: longcles=2051 50 INTEGER :: ierr 52 REAL, DIMENSION(longcles) :: clesphy053 51 REAL, DIMENSION(iip1,jjp1) :: masque 54 52 CHARACTER(LEN=15) :: calnd 55 53 REAL, DIMENSION(iip1,jjp1) :: phis ! geopotentiel au sol 56 54 !------------------------------------------------------------------------------- 57 CALL conf_gcm( 99, .TRUE. , clesphy0)55 CALL conf_gcm( 99, .TRUE. ) 58 56 59 57 #ifdef CPP_MPI -
LMDZ5/branches/testing/libf/dyn3dpar/conf_gcm.F90
r2160 r2258 2 2 ! $Id$ 3 3 4 SUBROUTINE conf_gcm( tapedef, etatinit , clesphy0)4 SUBROUTINE conf_gcm( tapedef, etatinit ) 5 5 6 6 USE control_mod … … 26 26 ! etatinit : = TRUE , on ne compare pas les valeurs des para- 27 27 ! -metres du zoom avec celles lues sur le fichier start . 28 ! clesphy0 : sortie . 29 30 LOGICAL etatinit 31 INTEGER tapedef 32 33 INTEGER longcles 34 PARAMETER( longcles = 20 ) 35 REAL clesphy0( longcles ) 28 29 LOGICAL,INTENT(IN) :: etatinit 30 INTEGER,INTENT(IN) :: tapedef 36 31 37 32 ! Declarations : … … 44 39 include "temps.h" 45 40 include "comconst.h" 46 47 ! FH 2008/05/09 On elimine toutes les clefs physiques dans la dynamique48 ! include "clesphys.h"49 41 include "iniprint.h" 50 42 -
LMDZ5/branches/testing/libf/dyn3dpar/gcm.F
r2187 r2258 24 24 ! Only INCA needs these informations (from the Earth's physics) 25 25 USE indice_sol_mod 26 USE mod_phys_lmdz_omp_data, ONLY: klon_omp 26 27 #endif 27 28 28 29 #ifdef CPP_PHYS 29 USE mod_grid_phy_lmdz 30 USE mod_phys_lmdz_para, ONLY : klon_mpi_para_nb 31 USE mod_phys_lmdz_omp_data, ONLY: klon_omp 32 USE dimphy 33 USE comgeomphy 30 ! USE mod_grid_phy_lmdz 31 ! USE mod_phys_lmdz_para, ONLY : klon_mpi_para_nb 32 ! USE dimphy 33 ! USE comgeomphy 34 34 #endif 35 35 IMPLICIT NONE … … 84 84 #endif 85 85 86 INTEGER longcles87 PARAMETER ( longcles = 20 )88 REAL clesphy0( longcles )89 SAVE clesphy090 91 92 93 86 REAL zdtvr 94 87 … … 112 105 113 106 LOGICAL lafin 114 c INTEGER ij,iq,l,i,j115 INTEGER i,j116 117 107 118 108 real time_step, t_wrt, t_ops 119 109 120 121 LOGICAL call_iniphys122 data call_iniphys/.true./123 110 124 111 c+jld variables test conservation energie … … 143 130 144 131 c----------------------------------------------------------------------- 145 c variables pour l'initialisation de la physique :146 c ------------------------------------------------147 INTEGER ngridmx148 PARAMETER( ngridmx = 2+(jjm-1)*iim - 1/jjm )149 REAL zcufi(ngridmx),zcvfi(ngridmx)150 REAL latfi(ngridmx),lonfi(ngridmx)151 REAL airefi(ngridmx)152 SAVE latfi, lonfi, airefi153 154 INTEGER :: ierr155 156 157 c-----------------------------------------------------------------------158 132 c Initialisations: 159 133 c ---------------- … … 172 146 c --------------------------------------- 173 147 c 174 ! Ehouarn: dump possibility of using defrun 175 !#ifdef CPP_IOIPSL 176 CALL conf_gcm( 99, .TRUE. , clesphy0 ) 148 CALL conf_gcm( 99, .TRUE. ) 177 149 if (mod(iphysiq, iperiod) /= 0) call abort_gcm("conf_gcm", 178 150 s "iphysiq must be a multiple of iperiod", 1) 179 !#else180 ! CALL defrun( 99, .TRUE. , clesphy0 )181 !#endif182 151 c 183 152 c … … 193 162 #ifdef CPP_PHYS 194 163 CALL Init_Phys_lmdz(iim,jjp1,llm,mpi_size,distrib_phys) 195 #endif 164 !#endif 165 ! CALL set_bands 166 !#ifdef CPP_PHYS 167 CALL Init_interface_dyn_phys 168 #endif 169 CALL barrier 170 196 171 CALL set_bands 197 #ifdef CPP_PHYS198 CALL Init_interface_dyn_phys199 #endif200 CALL barrier201 202 172 if (mpi_rank==0) call WriteBands 203 173 call SetDistrib(jj_Nb_Caldyn) … … 207 177 c$OMP END PARALLEL 208 178 209 #ifdef CPP_PHYS210 c$OMP PARALLEL211 call InitComgeomphy 212 c$OMP END PARALLEL213 #endif179 !#ifdef CPP_PHYS 180 !c$OMP PARALLEL 181 ! call InitComgeomphy ! now done in iniphysiq 182 !c$OMP END PARALLEL 183 !#endif 214 184 215 185 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! … … 431 401 c Initialisation de la physique : 432 402 c ------------------------------- 433 IF (call_iniphys.and.(iflag_phys==1.or.iflag_phys>=100)) THEN 434 latfi(1)=rlatu(1) 435 lonfi(1)=0. 436 zcufi(1) = cu(1) 437 zcvfi(1) = cv(1) 438 DO j=2,jjm 439 DO i=1,iim 440 latfi((j-2)*iim+1+i)= rlatu(j) 441 lonfi((j-2)*iim+1+i)= rlonv(i) 442 zcufi((j-2)*iim+1+i) = cu((j-1)*iip1+i) 443 zcvfi((j-2)*iim+1+i) = cv((j-1)*iip1+i) 444 ENDDO 445 ENDDO 446 latfi(ngridmx)= rlatu(jjp1) 447 lonfi(ngridmx)= 0. 448 zcufi(ngridmx) = cu(ip1jm+1) 449 zcvfi(ngridmx) = cv(ip1jm-iim) 450 CALL gr_dyn_fi(1,iip1,jjp1,ngridmx,aire,airefi) 451 452 WRITE(lunout,*) 453 . 'GCM: WARNING!!! vitesse verticale nulle dans la physique' 403 IF ((iflag_phys==1).or.(iflag_phys>=100)) THEN 454 404 ! Physics: 455 405 #ifdef CPP_PHYS 456 CALL iniphysiq( ngridmx,llm,daysec,day_ini,dtphys/nsplit_phys,457 & latfi,lonfi,airefi,zcufi,zcvfi,rad,g,r,cpp,406 CALL iniphysiq(iim,jjm,llm,daysec,day_ini,dtphys/nsplit_phys, 407 & rlatu,rlonv,aire,cu,cv,rad,g,r,cpp, 458 408 & iflag_phys) 459 409 #endif 460 call_iniphys=.false. 461 ENDIF ! of IF (call_iniphys.and.(iflag_phys==1.or.iflag_phys>=100)) 410 ENDIF ! of IF ((iflag_phys==1).or.(iflag_phys>=100)) 462 411 463 412 … … 550 499 551 500 c$OMP PARALLEL DEFAULT(SHARED) COPYIN(/temps/,/logici/,/logicl/) 552 CALL leapfrog_p(ucov,vcov,teta,ps,masse,phis,q,clesphy0, 553 . time_0) 501 CALL leapfrog_p(ucov,vcov,teta,ps,masse,phis,q,time_0) 554 502 c$OMP END PARALLEL 555 503 -
LMDZ5/branches/testing/libf/dyn3dpar/leapfrog_p.F
r2187 r2258 5 5 c 6 6 7 SUBROUTINE leapfrog_p(ucov,vcov,teta,ps,masse,phis,q,clesphy0, 8 & time_0) 7 SUBROUTINE leapfrog_p(ucov,vcov,teta,ps,masse,phis,q,time_0) 9 8 10 9 use exner_hyb_m, only: exner_hyb … … 77 76 #include "academic.h" 78 77 79 INTEGER,PARAMETER :: longcles = 2080 REAL,INTENT(IN) :: clesphy0( longcles ) ! not used81 78 REAL,INTENT(IN) :: time_0 ! not used 82 79 … … 831 828 $ ucov,vcov,teta,q,masse,ps,p,pk,phis,phi , 832 829 $ du,dv,dteta,dq, 833 $ flxw, 834 $ clesphy0, dufi,dvfi,dtetafi,dqfi,dpfi ) 830 $ flxw, dufi,dvfi,dtetafi,dqfi,dpfi ) 835 831 ! CALL FTRACE_REGION_END("calfis") 836 832 ijb=ij_begin -
LMDZ5/branches/testing/libf/phydev/iniphysiq.F90
r1999 r2258 2 2 ! $Id: iniphysiq.F 1403 2010-07-01 09:02:53Z fairhead $ 3 3 ! 4 SUBROUTINE iniphysiq(ngrid, nlayer, punjours, pdayref, ptimestep, plat, plon, & 5 parea, pcu, pcv, prad, pg, pr, pcpp, iflag_phys) 6 USE dimphy, ONLY: klev 7 USE mod_grid_phy_lmdz, ONLY: klon_glo 8 USE mod_phys_lmdz_para, ONLY: klon_omp, klon_omp_begin, klon_omp_end, & 9 klon_mpi_begin 10 USE comgeomphy, ONLY: airephy, cuphy, cvphy, rlond, rlatd 11 USE comcstphy, ONLY: rradius, rg, rr, rcpp 4 SUBROUTINE iniphysiq(iim,jjm,nlayer,punjours, pdayref,ptimestep, & 5 rlatu,rlonv,aire,cu,cv, & 6 prad,pg,pr,pcpp,iflag_phys) 7 USE dimphy, ONLY: klev ! number of atmospheric levels 8 USE mod_grid_phy_lmdz, ONLY: klon_glo ! number of atmospheric columns 9 ! (on full grid) 10 USE mod_phys_lmdz_para, ONLY: klon_omp, & ! number of columns (on local omp grid) 11 klon_omp_begin, & ! start index of local omp subgrid 12 klon_omp_end, & ! end index of local omp subgrid 13 klon_mpi_begin ! start indes of columns (on local mpi grid) 14 USE comgeomphy, ONLY: initcomgeomphy, & 15 airephy, & ! physics grid area (m2) 16 cuphy, & ! cu coeff. (u_covariant = cu * u) 17 cvphy, & ! cv coeff. (v_covariant = cv * v) 18 rlond, & ! longitudes 19 rlatd ! latitudes 20 USE comcstphy, ONLY: rradius, & ! planet radius (m) 21 rr, & ! recuced gas constant: R/molar mass of atm 22 rg, & ! gravity 23 rcpp ! specific heat of the atmosphere 12 24 USE phyaqua_mod, ONLY: iniaqua 13 25 IMPLICIT NONE 14 26 ! 15 27 !======================================================================= 16 !17 28 ! Initialisation of the physical constants and some positional and 18 29 ! geometrical arrays for the physics 19 !20 !21 ! ngrid Size of the horizontal grid.22 ! All internal loops are performed on that grid.23 ! nlayer Number of vertical layers.24 ! pdayref Day of reference for the simulation25 !26 30 !======================================================================= 27 31 … … 34 38 REAL,INTENT(IN) :: pcpp ! specific heat Cp 35 39 REAL,INTENT(IN) :: punjours ! length (in s) of a standard day 36 INTEGER,INTENT(IN) :: ngrid ! number of horizontal grid points in the physics 37 INTEGER,INTENT(IN) :: nlayer ! number of atmospheric layers 38 REAL,INTENT(IN) :: plat(ngrid) ! latitudes of the physics grid 39 REAL,INTENT(IN) :: plon(ngrid) ! longitudes of the physics grid 40 REAL,INTENT(IN) :: parea(klon_glo) ! area (m2) 41 REAL,INTENT(IN) :: pcu(klon_glo) ! cu coeff. (u_covariant = cu * u) 42 REAL,INTENT(IN) :: pcv(klon_glo) ! cv coeff. (v_covariant = cv * v) 43 INTEGER,INTENT(IN) :: pdayref ! reference day of for the simulation 40 INTEGER, INTENT (IN) :: nlayer ! number of atmospheric layers 41 INTEGER, INTENT (IN) :: iim ! number of atmospheric coulumns along longitudes 42 INTEGER, INTENT (IN) :: jjm ! number of atompsheric columns along latitudes 43 REAL, INTENT (IN) :: rlatu(jjm+1) ! latitudes of the physics grid 44 REAL, INTENT (IN) :: rlonv(iim+1) ! longitudes of the physics grid 45 REAL, INTENT (IN) :: aire(iim+1,jjm+1) ! area of the dynamics grid (m2) 46 REAL, INTENT (IN) :: cu((iim+1)*(jjm+1)) ! cu coeff. (u_covariant = cu * u) 47 REAL, INTENT (IN) :: cv((iim+1)*jjm) ! cv coeff. (v_covariant = cv * v) 48 INTEGER, INTENT (IN) :: pdayref ! reference day of for the simulation 44 49 REAL,INTENT(IN) :: ptimestep !physics time step (s) 45 50 INTEGER,INTENT(IN) :: iflag_phys ! type of physics to be called 46 51 47 52 INTEGER :: ibegin,iend,offset 53 INTEGER :: i,j 48 54 CHARACTER (LEN=20) :: modname='iniphysiq' 49 55 CHARACTER (LEN=80) :: abort_message 50 56 REAL :: total_area_phy, total_area_dyn 57 58 59 ! global array, on full physics grid: 60 REAL,ALLOCATABLE :: latfi(:) 61 REAL,ALLOCATABLE :: lonfi(:) 62 REAL,ALLOCATABLE :: cufi(:) 63 REAL,ALLOCATABLE :: cvfi(:) 64 REAL,ALLOCATABLE :: airefi(:) 65 51 66 IF (nlayer.NE.klev) THEN 52 67 WRITE(lunout,*) 'STOP in ',trim(modname) … … 58 73 ENDIF 59 74 60 IF (ngrid.NE.klon_glo) THEN 61 WRITE(lunout,*) 'STOP in ',trim(modname) 62 WRITE(lunout,*) 'Problem with dimensions :' 63 WRITE(lunout,*) 'ngrid = ',ngrid 64 WRITE(lunout,*) 'klon = ',klon_glo 65 abort_message = '' 66 CALL abort_gcm (modname,abort_message,1) 67 ENDIF 75 !call init_phys_lmdz(iim,jjm+1,llm,1,(/(jjm-1)*iim+2/)) 76 77 ! Generate global arrays on full physics grid 78 ALLOCATE(latfi(klon_glo),lonfi(klon_glo),cufi(klon_glo),cvfi(klon_glo)) 79 ALLOCATE(airefi(klon_glo)) 68 80 69 !$OMP PARALLEL PRIVATE(ibegin,iend) & 70 !$OMP SHARED(parea,pcu,pcv,plon,plat) 71 81 ! North pole 82 latfi(1)=rlatu(1) 83 lonfi(1)=0. 84 cufi(1) = cu(1) 85 cvfi(1) = cv(1) 86 DO j=2,jjm 87 DO i=1,iim 88 latfi((j-2)*iim+1+i)= rlatu(j) 89 lonfi((j-2)*iim+1+i)= rlonv(i) 90 cufi((j-2)*iim+1+i) = cu((j-1)*iim+1+i) 91 cvfi((j-2)*iim+1+i) = cv((j-1)*iim+1+i) 92 ENDDO 93 ENDDO 94 ! South pole 95 latfi(klon_glo)= rlatu(jjm+1) 96 lonfi(klon_glo)= 0. 97 cufi(klon_glo) = cu((iim+1)*jjm+1) 98 cvfi(klon_glo) = cv((iim+1)*jjm-iim) 99 100 ! build airefi(), mesh area on physics grid 101 CALL gr_dyn_fi(1,iim+1,jjm+1,klon_glo,aire,airefi) 102 ! Poles are single points on physics grid 103 airefi(1)=sum(aire(1:iim,1)) 104 airefi(klon_glo)=sum(aire(1:iim,jjm+1)) 105 106 ! Sanity check: do total planet area match between physics and dynamics? 107 total_area_dyn=sum(aire(1:iim,1:jjm+1)) 108 total_area_phy=sum(airefi(1:klon_glo)) 109 IF (total_area_dyn/=total_area_phy) THEN 110 WRITE (lunout, *) 'iniphysiq: planet total surface discrepancy !!!' 111 WRITE (lunout, *) ' in the dynamics total_area_dyn=', total_area_dyn 112 WRITE (lunout, *) ' but in the physics total_area_phy=', total_area_phy 113 IF (abs(total_area_dyn-total_area_phy)>0.00001*total_area_dyn) THEN 114 ! stop here if the relative difference is more than 0.001% 115 abort_message = 'planet total surface discrepancy' 116 CALL abort_gcm(modname, abort_message, 1) 117 ENDIF 118 ENDIF 119 120 !$OMP PARALLEL 121 ! Now generate local lon/lat/cu/cv/area arrays 122 CALL initcomgeomphy 123 72 124 offset = klon_mpi_begin - 1 73 airephy(1:klon_omp) = parea(offset+klon_omp_begin:offset+klon_omp_end)74 cuphy(1:klon_omp) = pcu(offset+klon_omp_begin:offset+klon_omp_end)75 cvphy(1:klon_omp) = pcv(offset+klon_omp_begin:offset+klon_omp_end)76 rlond(1:klon_omp) = plon(offset+klon_omp_begin:offset+klon_omp_end)77 rlatd(1:klon_omp) = plat(offset+klon_omp_begin:offset+klon_omp_end)125 airephy(1:klon_omp) = airefi(offset+klon_omp_begin:offset+klon_omp_end) 126 cuphy(1:klon_omp) = cufi(offset+klon_omp_begin:offset+klon_omp_end) 127 cvphy(1:klon_omp) = cvfi(offset+klon_omp_begin:offset+klon_omp_end) 128 rlond(1:klon_omp) = lonfi(offset+klon_omp_begin:offset+klon_omp_end) 129 rlatd(1:klon_omp) = latfi(offset+klon_omp_begin:offset+klon_omp_end) 78 130 79 131 ! copy some fundamental parameters to physics … … 83 135 rcpp=pcpp 84 136 85 137 !$OMP END PARALLEL 86 138 87 139 ! Additional initializations for aquaplanets 88 140 !$OMP PARALLEL 89 141 IF (iflag_phys>=100) THEN 90 142 CALL iniaqua(klon_omp,rlatd,rlond,iflag_phys) 91 143 ENDIF 92 144 !$OMP END PARALLEL 93 145 94 146 END SUBROUTINE iniphysiq -
LMDZ5/branches/testing/libf/phydev/physiq.F90
r2160 r2258 4 4 SUBROUTINE physiq (nlon,nlev, & 5 5 & debut,lafin,jD_cur, jH_cur,pdtphys, & 6 & paprs,pplay,pphi,pphis,presnivs, clesphy0,&6 & paprs,pplay,pphi,pphis,presnivs, & 7 7 & u,v,t,qx, & 8 8 & flxmass_w, & … … 45 45 real,intent(in) :: pphis(klon) ! surface geopotential 46 46 real,intent(in) :: presnivs(klev) ! pseudo-pressure (Pa) of mid-layers 47 integer,parameter :: longcles=2048 real,intent(in) :: clesphy0(longcles) ! Not used49 47 real,intent(in) :: u(klon,klev) ! eastward zonal wind (m/s) 50 48 real,intent(in) :: v(klon,klev) ! northward meridional wind (m/s) -
LMDZ5/branches/testing/libf/phylmd/add_pbl_tend.F90
r2160 r2258 1 SUBROUTINE add_pbl_tend(zdu, zdv, zdt, zdq, zdql, zdqi, paprs, text )1 SUBROUTINE add_pbl_tend(zdu, zdv, zdt, zdq, zdql, zdqi, paprs, text,abortphy) 2 2 ! ====================================================================== 3 3 ! Ajoute les tendances de couche limite, soit determinees par la … … 20 20 REAL hqturb_gcssold(llm) 21 21 REAL dtime_frcg 22 INTEGER abortphy 22 23 LOGICAL turb_fcg_gcssold 23 24 COMMON /turb_forcing/dtime_frcg, hthturb_gcssold, hqturb_gcssold, & … … 46 47 PRINT *, ' add_pbl_tend, zzdt ', zzdt 47 48 PRINT *, ' add_pbl_tend, zzdq ', zzdq 48 CALL add_phys_tend(zdu, zdv, zzdt, zzdq, zdql, zdqi, paprs, text )49 CALL add_phys_tend(zdu, zdv, zzdt, zzdq, zdql, zdqi, paprs, text,abortphy) 49 50 ELSE 50 CALL add_phys_tend(zdu, zdv, zdt, zdq, zdql, zdqi, paprs, text )51 CALL add_phys_tend(zdu, zdv, zdt, zdq, zdql, zdqi, paprs, text,abortphy) 51 52 END IF 52 53 -
LMDZ5/branches/testing/libf/phylmd/add_phys_tend.F90
r2160 r2258 2 2 ! $Id$ 3 3 ! 4 SUBROUTINE add_phys_tend (zdu,zdv,zdt,zdq,zdql,zdqi,paprs,text )4 SUBROUTINE add_phys_tend (zdu,zdv,zdt,zdq,zdql,zdqi,paprs,text,abortphy) 5 5 !====================================================================== 6 6 ! Ajoute les tendances des variables physiques aux variables … … 28 28 REAL paprs(klon,klev+1) 29 29 CHARACTER*(*) text 30 INTEGER abortphy 30 31 31 32 ! Local : … … 52 53 ! Initialisations 53 54 54 debug_level=10 55 IF (abortphy==1) RETURN ! on n ajoute pas les tendance si le modele 56 ! a deja plante. 57 58 debug_level=10 55 59 if (first) then 56 60 itap=0 … … 230 234 ENDIF 231 235 232 CALL hgardfou(t_seri,ftsol,text) 236 237 !====================================================================== 238 ! Contrôle des min/max pour arrêt du modèle 239 ! Si le modele est en mode abortphy, on retire les tendances qu'on 240 ! vient d'ajouter. Pas exactement parce qu'on ne tient pas compte des 241 ! seuils. 242 !====================================================================== 243 244 CALL hgardfou(t_seri,ftsol,text,abortphy) 245 IF (abortphy==1) THEN 246 Print*,'ERROR ABORT hgardfou dans ',text 247 u_seri(:,:)=u_seri(:,:)-zdu(:,:) 248 v_seri(:,:)=v_seri(:,:)-zdv(:,:) 249 ql_seri(:,:)=ql_seri(:,:)-zdql(:,:) 250 qs_seri(:,:)=qs_seri(:,:)-zdqi(:,:) 251 ENDIF 252 253 254 233 255 RETURN 234 256 END -
LMDZ5/branches/testing/libf/phylmd/calcratqs.F90
r2220 r2258 1 1 SUBROUTINE calcratqs(klon,klev,prt_level,lunout, & 2 iflag_ratqs,iflag_con,iflag_cld th,pdtphys, &2 iflag_ratqs,iflag_con,iflag_cld_th,pdtphys, & 3 3 ratqsbas,ratqshaut,tau_ratqs,fact_cldcon, & 4 4 ptconv,ptconvth,clwcon0th, rnebcon0th, & … … 19 19 ! Input 20 20 integer,intent(in) :: klon,klev,prt_level,lunout 21 integer,intent(in) :: iflag_con,iflag_cld th,iflag_ratqs21 integer,intent(in) :: iflag_con,iflag_cld_th,iflag_ratqs 22 22 real,intent(in) :: pdtphys,ratqsbas,ratqshaut,fact_cldcon,tau_ratqs 23 23 real, dimension(klon,klev+1),intent(in) :: paprs … … 43 43 ! ---------------- 44 44 ! on ecrase le tableau ratqsc calcule par clouds_gno 45 if (iflag_cld th.eq.1) then45 if (iflag_cld_th.eq.1) then 46 46 do k=1,klev 47 47 do i=1,klon … … 58 58 ! par nversion de la fonction log normale 59 59 !----------------------------------------------------------------------- 60 else if (iflag_cld th.eq.4) then60 else if (iflag_cld_th.eq.4) then 61 61 ptconvth(:,:)=.false. 62 62 ratqsc(:,:)=0. … … 136 136 ! ----------- 137 137 138 if (iflag_cld th.eq.1 .or.iflag_cldth.eq.2.or.iflag_cldth.eq.4) then138 if (iflag_cld_th.eq.1 .or.iflag_cld_th.eq.2.or.iflag_cld_th.eq.4) then 139 139 140 140 ! On ajoute une constante au ratqsc*2 pour tenir compte de … … 165 165 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 166 166 ratqs(:,:)=max(ratqs(:,:),ratqss(:,:)) 167 else if (iflag_cld th<=6) then167 else if (iflag_cld_th<=6) then 168 168 ! on ne prend que le ratqs stable pour fisrtilp 169 169 ratqs(:,:)=ratqss(:,:) … … 174 174 do i=1,klon 175 175 if (ratqsc(i,k).gt.1.e-10) then 176 ratqs(i,k)=ratqs(i,k)*zfratqs2+(iflag_cld th/100.)*ratqsc(i,k)*(1.-zfratqs2)176 ratqs(i,k)=ratqs(i,k)*zfratqs2+(iflag_cld_th/100.)*ratqsc(i,k)*(1.-zfratqs2) 177 177 endif 178 178 ratqs(i,k)=min(ratqs(i,k)*zfratqs1+ratqss(i,k)*(1.-zfratqs1),0.5) -
LMDZ5/branches/testing/libf/phylmd/change_srf_frac_mod.F90
r2220 r2258 1 1 ! 2 ! $ Header$2 ! $Id$ 3 3 ! 4 4 MODULE change_srf_frac_mod … … 12 12 13 13 SUBROUTINE change_srf_frac(itime, dtime, jour, & 14 pctsrf, alb1, alb2, tsurf, ustar, u10m, v10m, pbl_tke) 14 !albedo SB >>> 15 ! pctsrf, alb1, alb2, tsurf, ustar, u10m, v10m, pbl_tke) 16 pctsrf, alb_dir, alb_dif, tsurf, ustar, u10m, v10m, pbl_tke) 17 !albedo SB <<< 18 19 20 15 21 ! 16 22 ! This subroutine is called from physiq.F at each timestep. … … 32 38 INCLUDE "iniprint.h" 33 39 INCLUDE "YOMCST.h" 40 !albedo SB >>> 41 include "clesphys.h" 42 !albedo SB <<< 43 44 34 45 35 46 ! Input arguments … … 43 54 44 55 REAL, DIMENSION(klon,nbsrf), INTENT(INOUT) :: pctsrf ! sub-surface fraction 45 REAL, DIMENSION(klon,nbsrf), INTENT(INOUT) :: alb1 ! albedo first interval in SW spektrum 46 REAL, DIMENSION(klon,nbsrf), INTENT(INOUT) :: alb2 ! albedo second interval in SW spektrum 56 !albedo SB >>> 57 ! REAL, DIMENSION(klon,nbsrf), INTENT(INOUT) :: alb1 ! albedo first interval in SW spektrum 58 ! REAL, DIMENSION(klon,nbsrf), INTENT(INOUT) :: alb2 ! albedo second interval in SW spektrum 59 REAL, DIMENSION(klon,nsw,nbsrf), INTENT(INOUT) :: alb_dir,alb_dif 60 !albedo SB <<< 61 47 62 REAL, DIMENSION(klon,nbsrf), INTENT(INOUT) :: tsurf 48 63 REAL, DIMENSION(klon,nbsrf), INTENT(INOUT) :: ustar … … 160 175 ! 161 176 !**************************************************************************************** 162 CALL pbl_surface_newfrac(itime, pctsrf, pctsrf_old, tsurf, alb1, alb2, ustar, u10m, v10m, pbl_tke) 177 178 !albedo SB >>> 179 ! CALL pbl_surface_newfrac(itime, pctsrf, pctsrf_old, tsurf, alb1, alb2, ustar, 180 ! u10m, v10m, pbl_tke) 181 CALL pbl_surface_newfrac(itime, pctsrf, pctsrf_old, tsurf, alb_dir,alb_dif, ustar, u10m, v10m, pbl_tke) 182 !albedo SB <<< 183 184 163 185 164 186 ELSE -
LMDZ5/branches/testing/libf/phylmd/clcdrag.F90
r2160 r2258 61 61 REAL, DIMENSION(klon) :: zgeop1 ! geopotentiel au 1er niveau du modele 62 62 LOGICAL, PARAMETER :: zxli=.FALSE. ! calcul des cdrags selon Laurent Li 63 64 CHARACTER (LEN=80) :: abort_message 65 CHARACTER (LEN=20) :: modname = 'clcdrag' 66 67 63 68 ! 64 69 ! Fonctions thermodynamiques et fonctions d'instabilite … … 66 71 fsta(x) = 1.0 / (1.0+10.0*x*(1+8.0*x)) 67 72 fins(x) = SQRT(1.0-18.0*x) 73 74 abort_message='obsolete, remplace par cdrag, use at you own risk' 75 CALL abort_gcm(modname,abort_message,1) 76 77 68 78 69 79 ! ================================================================= c -
LMDZ5/branches/testing/libf/phylmd/clesphys.h
r2160 r2258 74 74 REAL freq_COSP 75 75 LOGICAL :: ok_cosp,ok_mensuelCOSP,ok_journeCOSP,ok_hfCOSP 76 INTEGER :: ip_ebil_phy, iflag_rrtm, iflag_ice_thermo,NSW 76 INTEGER :: ip_ebil_phy, iflag_rrtm, iflag_ice_thermo, NSW, iflag_albedo 77 LOGICAL :: ok_chlorophyll 77 78 LOGICAL :: ok_strato 78 79 LOGICAL :: ok_hines, ok_gwd_rando … … 116 117 & , ok_lic_melt, aer_type & 117 118 & , iflag_rrtm, ok_strato,ok_hines, ok_qch4 & 118 & , iflag_ice_thermo, ok_gwd_rando, NSW 119 & , ok_c onserv_q, ok_all_xml119 & , iflag_ice_thermo, ok_gwd_rando, NSW, iflag_albedo & 120 & , ok_chlorophyll,ok_conserv_q, ok_all_xml 120 121 121 122 save /clesphys/ -
LMDZ5/branches/testing/libf/phylmd/coefcdrag.F90
r2160 r2258 64 64 REAL, dimension(klon) :: trm0, trm1 65 65 66 CHARACTER (LEN=80) :: abort_message 67 CHARACTER (LEN=20) :: modname = 'coefcdra' 68 69 70 ! 71 72 66 73 !------------------------------------------------------------------------- 67 74 REAL :: fsta, fins, x … … 69 76 fins(x) = SQRT(1.0-18.0*x) 70 77 !------------------------------------------------------------------------- 78 79 abort_message='obsolete, remplace par cdrag, use at you own risk' 80 CALL abort_gcm(modname,abort_message,1) 81 71 82 ! 72 83 DO i = 1, knon -
LMDZ5/branches/testing/libf/phylmd/conf_phys_m.F90
r2220 r2258 15 15 solarlong0,seuil_inversion, & 16 16 fact_cldcon, facttemps,ok_newmicro,iflag_radia,& 17 iflag_cld th, &17 iflag_cld_th, & 18 18 iflag_ratqs,ratqsbas,ratqshaut,tau_ratqs, & 19 19 ok_ade, ok_aie, ok_cdnc, aerosol_couple, & … … 81 81 REAL :: bl95_b0, bl95_b1 82 82 real :: fact_cldcon, facttemps,ratqsbas,ratqshaut,tau_ratqs 83 integer :: iflag_cld th83 integer :: iflag_cld_th 84 84 integer :: iflag_ratqs 85 85 … … 110 110 integer,SAVE :: iflag_radia_omp 111 111 integer,SAVE :: iflag_rrtm_omp 112 integer,SAVE :: iflag_albedo_omp !albedo SB 113 logical,save :: ok_chlorophyll_omp ! albedo SB 112 114 integer,SAVE :: NSW_omp 113 integer,SAVE :: iflag_cld th_omp, ip_ebil_phy_omp115 integer,SAVE :: iflag_cld_th_omp, ip_ebil_phy_omp 114 116 integer,SAVE :: iflag_ratqs_omp 115 117 … … 889 891 NSW_omp = 6 890 892 call getin('NSW',NSW_omp) 891 892 ! 893 !Config Key = iflag_cldth 893 !albedo SB >>> 894 iflag_albedo_omp = 0 895 call getin('iflag_albedo',iflag_albedo_omp) 896 897 ok_chlorophyll_omp=.false. 898 call getin('ok_chlorophyll',ok_chlorophyll_omp) 899 !albedo SB <<< 900 901 ! 902 !Config Key = iflag_cld_th 894 903 !Config Desc = 895 904 !Config Def = 1 896 905 !Config Help = 897 906 ! 898 iflag_cld th_omp = 1907 iflag_cld_th_omp = 1 899 908 ! On lit deux fois avec l'ancien et le nouveau nom 900 909 ! pour assurer une retrocompatiblite. 901 910 ! A abandonner un jour 902 call getin('iflag_cldcon',iflag_cldth_omp) 903 call getin('iflag_cldth',iflag_cldth_omp) 904 905 ! 906 !Config Key = iflag_cld_cv 907 !Config Desc = 908 !Config Def = 1 909 !Config Help = 910 ! 911 iflag_cld_cv_omp = 1 911 call getin('iflag_cldcon',iflag_cld_th_omp) 912 call getin('iflag_cld_th',iflag_cld_th_omp) 913 iflag_cld_cv_omp = 0 912 914 call getin('iflag_cld_cv',iflag_cld_cv_omp) 913 915 … … 1973 1975 iflag_rrtm = iflag_rrtm_omp 1974 1976 NSW = NSW_omp 1975 iflag_cld th = iflag_cldth_omp1977 iflag_cld_th = iflag_cld_th_omp 1976 1978 iflag_cld_cv = iflag_cld_cv_omp 1977 1979 tau_cld_cv = tau_cld_cv_omp … … 2128 2130 write(lunout,*)' reevap_ice = ', reevap_ice 2129 2131 write(lunout,*)' iflag_pdf = ', iflag_pdf 2130 write(lunout,*)' iflag_cld th = ', iflag_cldth2132 write(lunout,*)' iflag_cld_th = ', iflag_cld_th 2131 2133 write(lunout,*)' iflag_cld_cv = ', iflag_cld_cv 2132 2134 write(lunout,*)' tau_cld_cv = ', tau_cld_cv … … 2135 2137 write(lunout,*)' iflag_rrtm = ', iflag_rrtm 2136 2138 write(lunout,*)' NSW = ', NSW 2139 write(lunout,*)' iflag_albedo = ', iflag_albedo !albedo SB 2140 write(lunout,*)' ok_chlorophyll =',ok_chlorophyll ! albedo SB 2137 2141 write(lunout,*)' iflag_ratqs = ', iflag_ratqs 2138 2142 write(lunout,*)' seuil_inversion = ', seuil_inversion -
LMDZ5/branches/testing/libf/phylmd/cv3p1_closure.F90
r2220 r2258 53 53 54 54 ! local variables: 55 INTEGER il, i, j, k, icbmax, i0(nloc), klfc 55 INTEGER il, i, j, k, icbmax, i0(nloc), klfc(nloc) 56 56 REAL deltap, fac, w, amu 57 57 REAL rhodp … … 525 525 526 526 !CR:Compute k at plfc 527 DO il=1,ncum 528 klfc(il)=nl 529 ENDDO 527 530 DO k=1,nl 528 531 DO il=1,ncum 529 532 if ((plfc(il).lt.ph(il,k)).and.(plfc(il).ge.ph(il,k+1))) then 530 klfc =k533 klfc(il)=k 531 534 endif 532 535 ENDDO … … 540 543 !CR: Add large-scale component to the mass-flux 541 544 !encore connu sous le nom "Experience du tube de dentifrice" 542 if ( coef_clos_ls.gt.0.) then543 cbmf1(il) = cbmf1(il) - coef_clos_ls*min(0.,1./RG*omega(il,klfc ))545 if ((coef_clos_ls.gt.0.).and.(plfc(il).gt.0.)) then 546 cbmf1(il) = cbmf1(il) - coef_clos_ls*min(0.,1./RG*omega(il,klfc(il))) 544 547 endif 545 548 !RC -
LMDZ5/branches/testing/libf/phylmd/cv3p_mixing.F90
r2056 r2258 58 58 REAL, DIMENSION (nloc) :: Smid, Sjmin, Sjmax 59 59 REAL, DIMENSION (nloc) :: Sbef, sup, smin 60 REAL, DIMENSION (nloc) :: ASij, smax, Scrit 60 !jyg REAL, DIMENSION (nloc) :: ASij, smax, Scrit 61 REAL, DIMENSION (nloc) :: ASij, ASij_inv, smax, Scrit 61 62 REAL, DIMENSION (nloc, nd, nd) :: Sij 62 63 REAL, DIMENSION (nloc, nd) :: csum … … 524 525 IF (i>=icb(il) .AND. i<=inb(il) .AND. lwork(il)) THEN 525 526 ASij(il) = amax1(1.0E-16, ASij(il)) 526 ASij(il) = 1.0/ASij(il) 527 !jyg+lluis< 528 !! ASij(il) = 1.0/ASij(il) 529 ASij_inv(il) = 1.0/ASij(il) 530 ! IF the F-interval spanned by possible mixtures is less than 0.01, no mixing occurs 531 IF (ASij_inv(il) > 100.) ASij_inv(il) = 0. 532 !>jyg+lluis 527 533 csum(il, i) = 0.0 528 534 END IF … … 533 539 IF (i>=icb(il) .AND. i<=inb(il) .AND. lwork(il) .AND. & 534 540 j>=(icb(il)-1) .AND. j<=inb(il)) THEN 535 Ment(il, i, j) = Ment(il, i, j)*ASij(il) 541 !jyg Ment(il, i, j) = Ment(il, i, j)*ASij(il) 542 Ment(il, i, j) = Ment(il, i, j)*ASij_inv(il) 536 543 END IF 537 544 END DO -
LMDZ5/branches/testing/libf/phylmd/etat0_netcdf.F90
r2160 r2258 482 482 falb1(:,is_oce) = 0.5; falb1(:,is_sic) = 0.6 483 483 falb2 = falb1 484 !albedo SB >>> 485 falb_dir(:,is_ter,:)=0.08; falb_dir(:,is_lic,:)=0.6 486 falb_dir(:,is_oce,:)=0.5; falb_dir(:,is_sic,:)=0.6 487 !albedo SB <<< 484 488 evap(:,:) = 0. 485 489 DO i=1,nbsrf; qsolsrf(:,i)=150.; END DO -
LMDZ5/branches/testing/libf/phylmd/fisrtilp.F90
r2220 r2258 8 8 frac_impa, frac_nucl, beta, & 9 9 prfl, psfl, rhcl, zqta, fraca, & 10 ztv, zpspsk, ztla, zthl, iflag_cld th, &10 ztv, zpspsk, ztla, zthl, iflag_cld_th, & 11 11 iflag_ice_thermo) 12 12 … … 82 82 INTEGER ninter ! sous-intervals pour la precipitation 83 83 INTEGER ncoreczq 84 INTEGER iflag_cld th84 INTEGER iflag_cld_th 85 85 INTEGER iflag_ice_thermo 86 86 PARAMETER (ninter=5) … … 545 545 enddo 546 546 547 if (iflag_cld th>=5) then547 if (iflag_cld_th>=5) then 548 548 549 549 call cloudth(klon,klev,k,ztv, & … … 559 559 endif 560 560 561 if (iflag_cld th <= 4) then561 if (iflag_cld_th <= 4) then 562 562 lognormale = .true. 563 elseif (iflag_cld th >= 6) then563 elseif (iflag_cld_th >= 6) then 564 564 ! lognormale en l'absence des thermiques 565 565 lognormale = fraca(:,k) < 1e-10 566 566 else 567 ! Dans le cas iflag_cld th=5, on prend systématiquement la567 ! Dans le cas iflag_cld_th=5, on prend systématiquement la 568 568 ! bi-gaussienne 569 569 lognormale = .false. … … 783 783 else if (iflag_fisrtilp_qsat.gt.0) then 784 784 DO i= 1, klon 785 if (lognormale(i)) then786 zt(i)=Tbef(i)787 else788 785 zt(i) = zt(i) + zcond(i) * RLVTT/RCPD/(1.0+RVTMP2*(zq(i)+zcond(i))) 789 endif790 786 ENDDO 791 787 endif … … 800 796 ! t_glace_max, exposant_glace) 801 797 if (iflag_t_glace.eq.0) then 802 zfice(i) = 1.0 - ( Tbef(i)-t_glace_min_old) / (RTT-t_glace_min_old)798 zfice(i) = 1.0 - (zt(i)-t_glace_min_old) / (RTT-t_glace_min_old) 803 799 zfice(i) = MIN(MAX(zfice(i),0.0),1.0) 804 800 zfice(i) = zfice(i)**exposant_glace_old … … 809 805 else 810 806 DO i=1, klon 811 if (lognormale(i)) then812 zt(i)=Tbef(i)813 else814 807 ! JBM: icefrac_lsc is now a function contained in icefrac_lsc_mod 815 808 ! zfice(i) = icefrac_lsc(zt(i), t_glace_min, & 816 809 ! t_glace_max, exposant_glace) 817 810 if (iflag_t_glace.eq.0) then 818 zfice(i) = 1.0 - ( Tbef(i)-t_glace_min_old) / (RTT-t_glace_min_old)811 zfice(i) = 1.0 - (zt(i)-t_glace_min_old) / (RTT-t_glace_min_old) 819 812 zfice(i) = MIN(MAX(zfice(i),0.0),1.0) 820 813 zfice(i) = zfice(i)**exposant_glace_old … … 822 815 zt(i) = zt(i) + (1.-zfice(i))*zcond(i) * RLVTT/RCPD/(1.0+RVTMP2*(zq(i)+zcond(i))) & 823 816 +zfice(i)*zcond(i) * RLSTT/RCPD/(1.0+RVTMP2*(zq(i)+zcond(i))) 824 endif825 817 ENDDO 826 818 endif -
LMDZ5/branches/testing/libf/phylmd/hgardfou.F90
r2160 r2258 1 1 2 2 ! $Id$ 3 SUBROUTINE hgardfou(t, tsol, text )3 SUBROUTINE hgardfou(t, tsol, text,abortphy) 4 4 USE dimphy 5 5 USE phys_state_var_mod … … 15 15 CHARACTER(len=*), intent(in):: text 16 16 CHARACTER (LEN=20) :: modname = 'hgardfou' 17 INTEGER abortphy 17 18 18 19 INTEGER i, k, nsrf … … 128 129 END DO 129 130 130 IF (.NOT. ok) CALL abort_gcm(modname, text, 1) 131 ! IF (.NOT. ok) CALL abort_gcm(modname, text, 1) 132 IF (.NOT. ok) abortphy=1 131 133 132 134 END SUBROUTINE hgardfou -
LMDZ5/branches/testing/libf/phylmd/iniphysiq.F90
r1999 r2258 3 3 4 4 5 6 SUBROUTINE iniphysiq(ngrid, nlayer, punjours, pdayref, ptimestep, plat, plon, & 7 parea, pcu, pcv, prad, pg, pr, pcpp, iflag_phys) 8 USE dimphy, ONLY: klev 9 USE mod_grid_phy_lmdz, ONLY: klon_glo 10 USE mod_phys_lmdz_para, ONLY: klon_omp, klon_omp_begin, klon_omp_end, & 11 klon_mpi_begin 12 USE comgeomphy, ONLY: airephy, cuphy, cvphy, rlond, rlatd 5 SUBROUTINE iniphysiq(iim,jjm,nlayer,punjours, pdayref,ptimestep, & 6 rlatu,rlonv,aire,cu,cv, & 7 prad,pg,pr,pcpp,iflag_phys) 8 USE dimphy, ONLY: klev ! number of atmospheric levels 9 USE mod_grid_phy_lmdz, ONLY: klon_glo ! number of atmospheric columns 10 ! (on full grid) 11 USE mod_phys_lmdz_para, ONLY: klon_omp, & ! number of columns (on local omp grid) 12 klon_omp_begin, & ! start index of local omp subgrid 13 klon_omp_end, & ! end index of local omp subgrid 14 klon_mpi_begin ! start indes of columns (on local mpi grid) 15 USE comgeomphy, ONLY: initcomgeomphy, & 16 airephy, & ! physics grid area (m2) 17 cuphy, & ! cu coeff. (u_covariant = cu * u) 18 cvphy, & ! cv coeff. (v_covariant = cv * v) 19 rlond, & ! longitudes 20 rlatd ! latitudes 13 21 USE phyaqua_mod, ONLY: iniaqua 14 22 IMPLICIT NONE 15 23 16 24 ! ======================================================================= 17 18 25 ! Initialisation of the physical constants and some positional and 19 26 ! geometrical arrays for the physics 20 21 22 ! ngrid Size of the horizontal grid.23 ! All internal loops are performed on that grid.24 ! nlayer Number of vertical layers.25 ! pdayref Day of reference for the simulation26 27 27 ! ======================================================================= 28 28 29 ! ym#include "dimensions.h"30 ! ym#include "dimphy.h"31 ! ym#include "comgeomphy.h"32 29 include "YOMCST.h" 33 30 include "iniprint.h" … … 38 35 REAL, INTENT (IN) :: pcpp ! specific heat Cp 39 36 REAL, INTENT (IN) :: punjours ! length (in s) of a standard day 40 INTEGER, INTENT (IN) :: ngrid ! number of horizontal grid points in the physics41 37 INTEGER, INTENT (IN) :: nlayer ! number of atmospheric layers 42 REAL, INTENT (IN) :: plat(ngrid) ! latitudes of the physics grid 43 REAL, INTENT (IN) :: plon(ngrid) ! longitudes of the physics grid 44 REAL, INTENT (IN) :: parea(klon_glo) ! area (m2) 45 REAL, INTENT (IN) :: pcu(klon_glo) ! cu coeff. (u_covariant = cu * u) 46 REAL, INTENT (IN) :: pcv(klon_glo) ! cv coeff. (v_covariant = cv * v) 38 INTEGER, INTENT (IN) :: iim ! number of atmospheric columns along longitudes 39 INTEGER, INTENT (IN) :: jjm ! number of atompsheric columns along latitudes 40 REAL, INTENT (IN) :: rlatu(jjm+1) ! latitudes of the physics grid 41 REAL, INTENT (IN) :: rlonv(iim+1) ! longitudes of the physics grid 42 REAL, INTENT (IN) :: aire(iim+1,jjm+1) ! area of the dynamics grid (m2) 43 REAL, INTENT (IN) :: cu((iim+1)*(jjm+1)) ! cu coeff. (u_covariant = cu * u) 44 REAL, INTENT (IN) :: cv((iim+1)*jjm) ! cv coeff. (v_covariant = cv * v) 47 45 INTEGER, INTENT (IN) :: pdayref ! reference day of for the simulation 48 46 REAL, INTENT (IN) :: ptimestep !physics time step (s) … … 50 48 51 49 INTEGER :: ibegin, iend, offset 50 INTEGER :: i,j 52 51 CHARACTER (LEN=20) :: modname = 'iniphysiq' 53 52 CHARACTER (LEN=80) :: abort_message 53 REAL :: total_area_phy, total_area_dyn 54 55 56 ! global array, on full physics grid: 57 REAL,ALLOCATABLE :: latfi(:) 58 REAL,ALLOCATABLE :: lonfi(:) 59 REAL,ALLOCATABLE :: cufi(:) 60 REAL,ALLOCATABLE :: cvfi(:) 61 REAL,ALLOCATABLE :: airefi(:) 54 62 55 63 IF (nlayer/=klev) THEN … … 62 70 END IF 63 71 64 IF (ngrid/=klon_glo) THEN 65 WRITE (lunout, *) 'STOP in ', trim(modname) 66 WRITE (lunout, *) 'Problem with dimensions :' 67 WRITE (lunout, *) 'ngrid = ', ngrid 68 WRITE (lunout, *) 'klon = ', klon_glo 69 abort_message = '' 70 CALL abort_gcm(modname, abort_message, 1) 71 END IF 72 73 !$OMP PARALLEL PRIVATE(ibegin,iend) & 74 !$OMP SHARED(parea,pcu,pcv,plon,plat) 72 !call init_phys_lmdz(iim,jjm+1,llm,1,(/(jjm-1)*iim+2/)) 73 74 ! Generate global arrays on full physics grid 75 ALLOCATE(latfi(klon_glo),lonfi(klon_glo),cufi(klon_glo),cvfi(klon_glo)) 76 ALLOCATE(airefi(klon_glo)) 77 78 IF (klon_glo>1) THEN ! general case 79 ! North pole 80 latfi(1)=rlatu(1) 81 lonfi(1)=0. 82 cufi(1) = cu(1) 83 cvfi(1) = cv(1) 84 DO j=2,jjm 85 DO i=1,iim 86 latfi((j-2)*iim+1+i)= rlatu(j) 87 lonfi((j-2)*iim+1+i)= rlonv(i) 88 cufi((j-2)*iim+1+i) = cu((j-1)*iim+1+i) 89 cvfi((j-2)*iim+1+i) = cv((j-1)*iim+1+i) 90 ENDDO 91 ENDDO 92 ! South pole 93 latfi(klon_glo)= rlatu(jjm+1) 94 lonfi(klon_glo)= 0. 95 cufi(klon_glo) = cu((iim+1)*jjm+1) 96 cvfi(klon_glo) = cv((iim+1)*jjm-iim) 97 98 ! build airefi(), mesh area on physics grid 99 CALL gr_dyn_fi(1,iim+1,jjm+1,klon_glo,aire,airefi) 100 ! Poles are single points on physics grid 101 airefi(1)=sum(aire(1:iim,1)) 102 airefi(klon_glo)=sum(aire(1:iim,jjm+1)) 103 104 ! Sanity check: do total planet area match between physics and dynamics? 105 total_area_dyn=sum(aire(1:iim,1:jjm+1)) 106 total_area_phy=sum(airefi(1:klon_glo)) 107 IF (total_area_dyn/=total_area_phy) THEN 108 WRITE (lunout, *) 'iniphysiq: planet total surface discrepancy !!!' 109 WRITE (lunout, *) ' in the dynamics total_area_dyn=', total_area_dyn 110 WRITE (lunout, *) ' but in the physics total_area_phy=', total_area_phy 111 IF (abs(total_area_dyn-total_area_phy)>0.00001*total_area_dyn) THEN 112 ! stop here if the relative difference is more than 0.001% 113 abort_message = 'planet total surface discrepancy' 114 CALL abort_gcm(modname, abort_message, 1) 115 ENDIF 116 ENDIF 117 ELSE ! klon_glo==1, running the 1D model 118 ! just copy over input values 119 latfi(1)=rlatu(1) 120 lonfi(1)=rlonv(1) 121 cufi(1)=cu(1) 122 cvfi(1)=cv(1) 123 airefi(1)=aire(1,1) 124 ENDIF ! of IF (klon_glo>1) 125 126 !$OMP PARALLEL 127 ! Now generate local lon/lat/cu/cv/area arrays 128 CALL initcomgeomphy 75 129 76 130 offset = klon_mpi_begin - 1 77 airephy(1:klon_omp) = parea(offset+klon_omp_begin:offset+klon_omp_end)78 cuphy(1:klon_omp) = pcu(offset+klon_omp_begin:offset+klon_omp_end)79 cvphy(1:klon_omp) = pcv(offset+klon_omp_begin:offset+klon_omp_end)80 rlond(1:klon_omp) = plon(offset+klon_omp_begin:offset+klon_omp_end)81 rlatd(1:klon_omp) = plat(offset+klon_omp_begin:offset+klon_omp_end)131 airephy(1:klon_omp) = airefi(offset+klon_omp_begin:offset+klon_omp_end) 132 cuphy(1:klon_omp) = cufi(offset+klon_omp_begin:offset+klon_omp_end) 133 cvphy(1:klon_omp) = cvfi(offset+klon_omp_begin:offset+klon_omp_end) 134 rlond(1:klon_omp) = lonfi(offset+klon_omp_begin:offset+klon_omp_end) 135 rlatd(1:klon_omp) = latfi(offset+klon_omp_begin:offset+klon_omp_end) 82 136 83 137 ! suphel => initialize some physical constants (orbital parameters, … … 86 140 CALL suphel 87 141 88 89 90 91 142 !$OMP END PARALLEL 143 144 ! check that physical constants set in 'suphel' are coherent 145 ! with values set in the dynamics: 92 146 IF (rday/=punjours) THEN 93 147 WRITE (lunout, *) 'iniphysiq: length of day discrepancy!!!' … … 142 196 143 197 ! Additional initializations for aquaplanets 144 198 !$OMP PARALLEL 145 199 IF (iflag_phys>=100) THEN 146 200 CALL iniaqua(klon_omp, rlatd, rlond, iflag_phys) 147 201 END IF 148 !$OMP END PARALLEL 149 150 ! RETURN 151 ! 9999 CONTINUE 152 ! abort_message ='Cette version demande les fichier rnatur.dat 153 ! & et surf.def' 154 ! CALL abort_gcm (modname,abort_message,1) 202 !$OMP END PARALLEL 155 203 156 204 END SUBROUTINE iniphysiq -
LMDZ5/branches/testing/libf/phylmd/lmdz1d.F90
r2220 r2258 10 10 USE ioipsl, only: ju2ymds, ymds2ju, ioconf_calendar 11 11 use phys_state_var_mod 12 use comgeomphy13 12 use dimphy 14 13 use surface_data, only : type_ocean,ok_veget … … 203 202 ! Call to physiq 204 203 !--------------------------------------------------------------------- 205 integer, parameter :: longcles=20206 204 logical :: firstcall=.true. 207 205 logical :: lastcall=.false. 208 206 real :: phis = 0.0 209 real :: clesphy0(longcles) = 0.0210 207 real :: dpsrf 211 208 … … 365 362 !--------------------------------------------------------------------- 366 363 367 call conf_gcm( 99, .TRUE. , clesphy0)364 call conf_gcm( 99, .TRUE. ) 368 365 !----------------------------------------------------------------------- 369 366 ! Choix du calendrier … … 473 470 call init_phys_lmdz(1,1,llm,1,(/1/)) 474 471 call suphel 475 call initcomgeomphy476 472 call infotrac_init 477 473 … … 608 604 rlon_rad(:)=rlon(:)*rpi/180. 609 605 610 call iniphysiq( ngrid,llm,rday,day_ini,timestep, &606 call iniphysiq(iim,jjm,llm,rday,day_ini,timestep, & 611 607 & rlat_rad,rlon_rad,airefi,zcufi,zcvfi,ra,rg,rd,rcpd,(/1/)) 612 608 print*,'apres iniphysiq' … … 618 614 ! Ecriture du startphy avant le premier appel a la physique. 619 615 ! On le met juste avant pour avoir acces a tous les champs 620 ! NB: les clesphy0 seront remplies dans phyredem d'apres les flags lus dans gcm.def621 616 622 617 if (ok_writedem) then … … 673 668 zpic = zpicinp 674 669 ftsol=tsurf 670 nsw=6 ! on met le nb de bandes SW=6, pour initialiser 671 ! 6 albedo, mais on peut quand meme tourner avec 672 ! moins. Seules les 2 ou 4 premiers seront lus 675 673 falb1 = albedo 676 674 falb2 = albedo 675 falb_dir=albedo 676 falb_dif=albedo 677 677 rugoro=rugos 678 678 t_ancien(1,:)=temp(:) … … 859 859 & firstcall,lastcall, & 860 860 & day,time,timestep, & 861 & plev,play,phi,phis,presnivs, clesphy0,&861 & plev,play,phi,phis,presnivs, & 862 862 & u,v,temp,q,omega2, & 863 863 & du_phys,dv_phys,dt_phys,dq,dpsrf, & -
LMDZ5/branches/testing/libf/phylmd/pbl_surface_mod.F90
r2220 r2258 181 181 !!! 182 182 pplay, paprs, pctsrf, & 183 ts, alb1, alb2,ustar, u10m, v10m,wstar, & 183 !albedo SB >>> 184 ! ts, alb1, alb2,ustar, u10m, v10m,wstar, & 185 ts,SFRWL, alb_dir, alb_dif,ustar, u10m, v10m,wstar, & 186 !albedo SB <<< 184 187 cdragh, cdragm, zu1, zv1, & 185 alb1_m, alb2_m, zxsens, zxevap, & 188 !albedo SB >>> 189 ! alb1_m, alb2_m, zxsens, zxevap, & 190 alb_dir_m, alb_dif_m, zxsens, zxevap, & 191 !albedo SB <<< 186 192 alb3_lic, runoff, snowhgt, qsnow, to_ice, sissnow, & 187 193 zxtsol, zxfluxlat, zt2m, qsat2m, & … … 349 355 REAL, DIMENSION(klon, nbsrf), INTENT(INOUT) :: delta_tsurf !surface temperature difference between 350 356 !wake and off-wake regions 351 REAL, DIMENSION(klon, nbsrf), INTENT(INOUT) :: alb1 ! albedo in visible SW interval 352 REAL, DIMENSION(klon, nbsrf), INTENT(INOUT) :: alb2 ! albedo in near infra-red SW interval 357 !albedo SB >>> 358 ! REAL, DIMENSION(klon, nbsrf), INTENT(INOUT) :: alb1 ! albedo in visible SW interval 359 ! REAL, DIMENSION(klon, nbsrf), INTENT(INOUT) :: alb2 ! albedo in near infra-red SW interval 360 REAL, DIMENSIOn(6),intent(in) :: SFRWL 361 REAL, DIMENSION(klon, nsw, nbsrf), INTENT(INOUT) :: alb_dir,alb_dif 362 !albedo SB <<< 353 363 !jyg Pourquoi ustar et wstar sont-elles INOUT ? 354 364 REAL, DIMENSION(klon, nbsrf), INTENT(INOUT) :: ustar ! u* (m/s) … … 371 381 REAL, DIMENSION(klon), INTENT(OUT) :: zu1 ! u wind speed in first layer 372 382 REAL, DIMENSION(klon), INTENT(OUT) :: zv1 ! v wind speed in first layer 373 REAL, DIMENSION(klon), INTENT(OUT) :: alb1_m ! mean albedo in visible SW interval 374 REAL, DIMENSION(klon), INTENT(OUT) :: alb2_m ! mean albedo in near IR SW interval 383 !albedo SB >>> 384 ! REAL, DIMENSION(klon), INTENT(OUT) :: alb1_m ! mean albedo 385 ! in visible SW interval 386 ! REAL, DIMENSION(klon), INTENT(OUT) :: alb2_m ! mean albedo 387 ! in near IR SW interval 388 REAL, DIMENSION(klon, nsw), INTENT(OUT) :: alb_dir_m,alb_dif_m 389 !albedo SB <<< 375 390 ! Martin 376 391 REAL, DIMENSION(klon), INTENT(OUT) :: alb3_lic … … 505 520 REAL, DIMENSION(klon) :: r_co2_ppm ! taux CO2 atmosphere 506 521 REAL, DIMENSION(klon) :: yts, yrugos, ypct, yz0_new 507 REAL, DIMENSION(klon) :: yalb, yalb1, yalb2 522 !albedo SB >>> 523 ! REAL, DIMENSION(klon) :: yalb, yalb1, yalb2 524 REAL, DIMENSION(klon) :: yalb,yalb_vis 525 !albedo SB <<< 508 526 REAL, DIMENSION(klon) :: yu1, yv1 509 527 REAL, DIMENSION(klon) :: ysnow, yqsurf, yagesno, yqsol … … 535 553 REAL, DIMENSION(klon) :: tair1, qair1, tairsol 536 554 REAL, DIMENSION(klon) :: psfce, patm 537 REAL, DIMENSION(klon) :: qairsol, zgeo1 555 REAL, DIMENSION(klon) :: qairsol, zgeo1, speed, zri1, pref !speed, zri1, pref, added by Fuxing WANG, 04/03/2015 538 556 REAL, DIMENSION(klon) :: rugo1 539 557 REAL, DIMENSION(klon) :: yfluxsens … … 542 560 REAL, DIMENSION(klon) :: ypsref 543 561 REAL, DIMENSION(klon) :: yevap, ytsurf_new, yalb1_new, yalb2_new, yalb3_new 562 !albedo SB >>> 563 REAL, DIMENSION(klon,nsw) :: yalb_dir_new, yalb_dif_new 564 !albedo SB <<< 544 565 REAL, DIMENSION(klon) :: ztsol 545 566 REAL, DIMENSION(klon) :: alb_m ! mean albedo for whole SW interval … … 693 714 REAL, DIMENSION(klon) :: ytrmb3_w 694 715 ! 695 REAL, DIMENSION(klon) :: uzon_x, vmer_x 716 REAL, DIMENSION(klon) :: uzon_x, vmer_x, speed_x, zri1_x, pref_x !speed_x, zri1_x, pref_x, added by Fuxing WANG, 04/03/2015 696 717 REAL, DIMENSION(klon) :: zgeo1_x, tair1_x, qair1_x, tairsol_x 697 718 ! 698 REAL, DIMENSION(klon) :: uzon_w, vmer_w 719 REAL, DIMENSION(klon) :: uzon_w, vmer_w, speed_w, zri1_w, pref_w !speed_w, zri1_w, pref_w, added by Fuxing WANG, 04/03/2015 699 720 REAL, DIMENSION(klon) :: zgeo1_w, tair1_w, qair1_w, tairsol_w 700 721 … … 855 876 cdragh(:)=0. ; cdragm(:)=0. 856 877 zu1(:)=0. ; zv1(:)=0. 857 alb1_m(:)=0. ; alb2_m(:)=0. ; alb3_lic(:)=0. 878 !albedo SB >>> 879 ! alb1_m(:)=0. ; alb2_m(:)=0. ; alb3_lic(:)=0. 880 alb_dir_m=0. ; alb_dif_m=0. ; alb3_lic(:)=0. 881 !albedo SB <<< 858 882 zxsens(:)=0. ; zxevap(:)=0. ; zxtsol(:)=0. 859 883 d_t_w(:,:)=0. ; d_q_w(:,:)=0. ; d_t_x(:,:)=0. ; d_q_x(:,:)=0. … … 920 944 ypct = 0.0 ; yts = 0.0 ; ysnow = 0.0 921 945 !! zv1 = 0.0 ; yqsurf = 0.0 ; yalb1 = 0.0 ; yalb2 = 0.0 922 yqsurf = 0.0 ; yalb1 = 0.0 ; yalb2 = 0.0 946 !albedo SB >>> 947 ! yqsurf = 0.0 ; yalb1 = 0.0 ; yalb2 = 0.0 948 yqsurf = 0.0 ; yalb = 0.0 ; yalb_vis = 0.0 949 !albedo SB <<< 923 950 yrain_f = 0.0 ; ysnow_f = 0.0 ; yfder = 0.0 ; ysolsw = 0.0 924 951 ysollw = 0.0 ; yrugos = 0.0 ; yu1 = 0.0 … … 1070 1097 ! * alb_m : mean albedo at whole SW interval 1071 1098 1072 alb1_m(:) = 0.0 1073 alb2_m(:) = 0.0 1074 DO nsrf = 1, nbsrf 1099 !albedo SB >>> 1100 ! alb1_m(:) = 0.0 1101 ! alb2_m(:) = 0.0 1102 ! DO nsrf = 1, nbsrf 1103 ! DO i = 1, klon 1104 ! alb1_m(i) = alb1_m(i) + alb1(i,nsrf) * pctsrf(i,nsrf) 1105 ! alb2_m(i) = alb2_m(i) + alb2(i,nsrf) * pctsrf(i,nsrf) 1106 ! ENDDO 1107 ! ENDDO 1108 1109 alb_dir_m(:,:) = 0.0 1110 alb_dif_m(:,:) = 0.0 1111 DO k = 1, nsw 1112 DO nsrf = 1, nbsrf 1075 1113 DO i = 1, klon 1076 alb 1_m(i) = alb1_m(i) + alb1(i,nsrf) * pctsrf(i,nsrf)1077 alb 2_m(i) = alb2_m(i) + alb2(i,nsrf) * pctsrf(i,nsrf)1114 alb_dir_m(i,k) = alb_dir_m(i,k) + alb_dir(i,k,nsrf) * pctsrf(i,nsrf) 1115 alb_dif_m(i,k) = alb_dif_m(i,k) + alb_dif(i,k,nsrf) * pctsrf(i,nsrf) 1078 1116 ENDDO 1117 ENDDO 1079 1118 ENDDO 1080 1119 1081 1120 ! We here suppose the fraction f1 of incoming radiance of visible radiance 1082 1121 ! as a fraction of all shortwave radiance 1083 f1 = 0.5 1122 f1 = 0.5 1084 1123 ! f1 = 1 ! put f1=1 to recreate old calculations 1085 1124 1086 DO nsrf = 1, nbsrf 1087 DO i = 1, klon 1088 alb(i,nsrf) = f1*alb1(i,nsrf) + (1-f1)*alb2(i,nsrf) 1089 ENDDO 1125 ! DO nsrf = 1, nbsrf 1126 ! DO i = 1, klon 1127 ! alb(i,nsrf) = f1*alb1(i,nsrf) + (1-f1)*alb2(i,nsrf) 1128 ! ENDDO 1129 ! ENDDO 1130 ! 1131 ! DO i = 1, klon 1132 ! alb_m(i) = f1*alb1_m(i) + (1-f1)*alb2_m(i) 1133 ! END DO 1134 1135 1136 !f1 is already included with SFRWL values in each surf files 1137 alb=0.0 1138 DO k=1,nsw 1139 DO nsrf = 1, nbsrf 1140 DO i = 1, klon 1141 alb(i,nsrf) = alb(i,nsrf) + alb_dir(i,k,nsrf)*SFRWL(k) 1142 ENDDO 1143 ENDDO 1090 1144 ENDDO 1091 1145 1092 DO i = 1, klon 1093 alb_m(i) = f1*alb1_m(i) + (1-f1)*alb2_m(i) 1094 END DO 1146 alb_m=0.0 1147 DO k = 1,nsw 1148 DO i = 1, klon 1149 alb_m(i) = alb_m(i) + alb_dir_m(i,k)*SFRWL(k) 1150 END DO 1151 ENDDO 1152 !albedo SB <<< 1153 1154 1095 1155 1096 1156 ! Calculation of mean temperature at surface grid points … … 1170 1230 yqsurf(j) = qsurf(i,nsrf) 1171 1231 yalb(j) = alb(i,nsrf) 1172 yalb1(j) = alb1(i,nsrf) 1173 yalb2(j) = alb2(i,nsrf) 1232 !albedo SB >>> 1233 ! yalb1(j) = alb1(i,nsrf) 1234 ! yalb2(j) = alb2(i,nsrf) 1235 yalb_vis(j) = alb_dir(i,1,nsrf) 1236 if(nsw==6)then 1237 yalb_vis(j)=(alb_dir(i,1,nsrf)*SFRWL(1)+alb_dir(i,2,nsrf)*SFRWL(2) & 1238 +alb_dir(i,3,nsrf)*SFRWL(3))/(SFRWL(1)+SFRWL(2)+SFRWL(3)) 1239 endif 1240 !albedo SB <<< 1174 1241 yrain_f(j) = rain_f(i) 1175 1242 ysnow_f(j) = snow_f(i) … … 1295 1362 !!! 1296 1363 !!! nrlmd & jyg les 02/05/2011, 13/06/2011, 05/02/2012 1297 CALL clcdrag( knon, nsrf, ypaprs, ypplay, & 1298 yu(:,1), yv(:,1), yt(:,1), yq(:,1), & 1364 ! Faire disparaitre les lignes commentees fin 2015 (le temps des tests) 1365 ! CALL clcdrag( knon, nsrf, ypaprs, ypplay, & 1366 ! yu(:,1), yv(:,1), yt(:,1), yq(:,1), & 1367 ! yts, yqsurf, yrugos, & 1368 ! ycdragm, ycdragh ) 1369 ! Fuxing WANG, 04/03/2015, replace the clcdrag by the merged version: cdrag 1370 DO i = 1, knon 1371 ! print*,'PBL ',i,RD 1372 ! print*,'PBL ',yt(i,1),ypaprs(i,1),ypplay(i,1) 1373 zgeo1(i) = RD * yt(i,1) / (0.5*(ypaprs(i,1)+ypplay(i,1))) & 1374 * (ypaprs(i,1)-ypplay(i,1)) 1375 speed(i) = SQRT(yu(i,1)**2+yv(i,1)**2) 1376 END DO 1377 CALL cdrag(knon, nsrf, & 1378 speed, yt(:,1), yq(:,1), zgeo1, ypaprs(:,1),& 1299 1379 yts, yqsurf, yrugos, & 1300 ycdragm, ycdragh ) 1380 ycdragm, ycdragh, zri1, pref ) 1381 1301 1382 ! --- special Dice: on force cdragm ( a defaut de forcer ustar) MPL 05082013 1302 1383 IF (ok_prescr_ust) then … … 1313 1394 IF (prt_level >=10) print *,'clcdrag -> ycdragh ', ycdragh 1314 1395 ELSE !(iflag_split .eq.0) 1315 CALL clcdrag( knon, nsrf, ypaprs, ypplay, & 1316 yu_x(:,1), yv_x(:,1), yt_x(:,1), yq_x(:,1), & 1396 1397 ! Faire disparaitre les lignes commentees fin 2015 (le temps des tests) 1398 ! CALL clcdrag( knon, nsrf, ypaprs, ypplay, & 1399 ! yu_x(:,1), yv_x(:,1), yt_x(:,1), yq_x(:,1), & 1400 ! yts_x, yqsurf, yrugos, & 1401 ! ycdragm_x, ycdragh_x ) 1402 ! Fuxing WANG, 04/03/2015, replace the clcdrag by the merged version: cdrag 1403 DO i = 1, knon 1404 zgeo1_x(i) = RD * yt_x(i,1) / (0.5*(ypaprs(i,1)+ypplay(i,1))) & 1405 * (ypaprs(i,1)-ypplay(i,1)) 1406 speed_x(i) = SQRT(yu_x(i,1)**2+yv_x(i,1)**2) 1407 END DO 1408 CALL cdrag(knon, nsrf, & 1409 speed_x, yt_x(:,1), yq_x(:,1), zgeo1_x, ypaprs(:,1),& 1317 1410 yts_x, yqsurf, yrugos, & 1318 ycdragm_x, ycdragh_x ) 1411 ycdragm_x, ycdragh_x, zri1_x, pref_x ) 1412 1319 1413 ! --- special Dice. JYG+MPL 25112013 1320 1414 IF (ok_prescr_ust) then … … 1710 1804 ylwdown, yq2m, yt2m, & 1711 1805 ysnow, yqsol, yagesno, ytsoil, & 1712 yz0_new, yalb1_new, yalb2_new, yevap, yfluxsens, yfluxlat, & 1806 !albedo SB >>> 1807 ! yz0_new, yalb1_new, yalb2_new, yevap, yfluxsens, yfluxlat, & 1808 yz0_new, SFRWL, yalb_dir_new, yalb_dif_new, yevap, yfluxsens,yfluxlat,& 1809 !albedo SB <<< 1713 1810 yqsurf, ytsurf_new, y_dflux_t, y_dflux_q, & 1714 1811 y_flux_u1, y_flux_v1 ) … … 1746 1843 ypsref, yu1, yv1, yrugoro, pctsrf, & 1747 1844 ysnow, yqsurf, yqsol, yagesno, & 1748 ytsoil, yz0_new, yalb1_new, yalb2_new, yevap, yfluxsens, yfluxlat, & 1845 !albedo SB >>> 1846 ! ytsoil, yz0_new, yalb1_new, yalb2_new, yevap, yfluxsens, yfluxlat, & 1847 ytsoil, yz0_new, SFRWL, yalb_dir_new, yalb_dif_new, yevap,yfluxsens,yfluxlat, & 1848 !albedo SB <<< 1749 1849 ytsurf_new, y_dflux_t, y_dflux_q, & 1750 1850 yzsig, ycldt, & … … 1778 1878 1779 1879 CASE(is_oce) 1780 CALL surf_ocean(rlon, rlat, ysolsw, ysollw, yalb1, & 1880 !albedo SB >>> 1881 ! CALL surf_ocean(rlon, rlat, ysolsw, ysollw, yalb1, & 1882 CALL surf_ocean(rlon, rlat, ysolsw, ysollw, yalb_vis, & 1883 !albedo SB <<< 1781 1884 yrugos, ywindsp, rmu0, yfder, yts, & 1782 1885 itap, dtime, jour, knon, ni, & … … 1786 1889 ypsref, yu1, yv1, yrugoro, pctsrf, & 1787 1890 ysnow, yqsurf, yagesno, & 1788 yz0_new, yalb1_new, yalb2_new, yevap, yfluxsens, yfluxlat, & 1891 !albedo SB >>> 1892 ! yz0_new, yalb1_new, yalb2_new, yevap, yfluxsens, yfluxlat, & 1893 yz0_new, SFRWL,yalb_dir_new, yalb_dif_new, yevap, yfluxsens,yfluxlat,& 1894 !albedo SB <<< 1789 1895 ytsurf_new, y_dflux_t, y_dflux_q, slab_wfbils, & 1790 1896 y_flux_u1, y_flux_v1) … … 1807 1913 CASE(is_sic) 1808 1914 CALL surf_seaice( & 1809 rlon, rlat, ysolsw, ysollw, yalb1, yfder, & 1915 !albedo SB >>> 1916 ! rlon, rlat, ysolsw, ysollw, yalb1, yfder, & 1917 rlon, rlat, ysolsw, ysollw, yalb_vis, yfder, & 1918 !albedo SB <<< 1810 1919 itap, dtime, jour, knon, ni, & 1811 1920 lafin, & … … 1815 1924 ypsref, yu1, yv1, yrugoro, pctsrf, & 1816 1925 ysnow, yqsurf, yqsol, yagesno, ytsoil, & 1817 yz0_new, yalb1_new, yalb2_new, yevap, yfluxsens, yfluxlat, & 1926 !albedo SB >>> 1927 ! yz0_new, yalb1_new, yalb2_new, yevap, yfluxsens, yfluxlat, & 1928 yz0_new, SFRWL, yalb_dir_new, yalb_dif_new, yevap, yfluxsens,yfluxlat,& 1929 !albedo SB <<< 1818 1930 ytsurf_new, y_dflux_t, y_dflux_q, & 1819 1931 y_flux_u1, y_flux_v1) … … 2185 2297 evap(i,nsrf) = - flux_q(i,1,nsrf) !jyg 2186 2298 d_ts(i,nsrf) = y_d_ts(j) 2187 alb1(i,nsrf) = yalb1_new(j) 2188 alb2(i,nsrf) = yalb2_new(j) 2299 !albedo SB >>> 2300 ! alb1(i,nsrf) = yalb1_new(j) 2301 ! alb2(i,nsrf) = yalb2_new(j) 2302 do k=1,nsw 2303 alb_dir(i,k,nsrf) = yalb_dir_new(j,k) 2304 alb_dif(i,k,nsrf) = yalb_dif_new(j,k) 2305 enddo 2306 !albedo SB <<< 2189 2307 snow(i,nsrf) = ysnow(j) 2190 2308 qsurf(i,nsrf) = yqsurf(j) … … 2930 3048 !**************************************************************************************** 2931 3049 ! 2932 SUBROUTINE pbl_surface_newfrac(itime, pctsrf_new, pctsrf_old, tsurf, alb1, alb2, ustar, u10m, v10m, tke) 2933 3050 3051 !albedo SB >>> 3052 ! SUBROUTINE pbl_surface_newfrac(itime, pctsrf_new, pctsrf_old, tsurf, alb1, alb2, ustar, u10m, v10m, tke) 3053 SUBROUTINE pbl_surface_newfrac(itime, pctsrf_new, pctsrf_old, tsurf,alb_dir,alb_dif, ustar, u10m, v10m, tke) 3054 !albedo SB <<< 2934 3055 ! Give default values where new fraction has appread 2935 3056 … … 2948 3069 !**************************************************************************************** 2949 3070 REAL, DIMENSION(klon,nbsrf), INTENT(INOUT) :: tsurf 2950 REAL, DIMENSION(klon,nbsrf), INTENT(INOUT) :: alb1, alb2 3071 !albedo SB >>> 3072 ! REAL, DIMENSION(klon,nbsrf), INTENT(INOUT) :: alb1, alb2 3073 REAL, DIMENSION(klon,nsw,nbsrf), INTENT(INOUT) :: alb_dir, alb_dif 3074 INTEGER :: k 3075 !albedo SB <<< 2951 3076 REAL, DIMENSION(klon,nbsrf), INTENT(INOUT) :: ustar,u10m, v10m 2952 3077 REAL, DIMENSION(klon,klev+1,nbsrf+1), INTENT(INOUT) :: tke … … 2993 3118 rugos(i,nsrf) = rugos(i,nsrf_comp1) 2994 3119 tsurf(i,nsrf) = tsurf(i,nsrf_comp1) 2995 alb1(i,nsrf) = alb1(i,nsrf_comp1) 2996 alb2(i,nsrf) = alb2(i,nsrf_comp1) 3120 !albedo SB >>> 3121 ! alb1(i,nsrf) = alb1(i,nsrf_comp1) 3122 ! alb2(i,nsrf) = alb2(i,nsrf_comp1) 3123 DO k=1,nsw 3124 alb_dir(i,k,nsrf)=alb_dir(i,k,nsrf_comp1) 3125 alb_dif(i,k,nsrf)=alb_dif(i,k,nsrf_comp1) 3126 ENDDO 3127 !albedo SB <<< 2997 3128 ustar(i,nsrf) = ustar(i,nsrf_comp1) 2998 3129 u10m(i,nsrf) = u10m(i,nsrf_comp1) … … 3008 3139 rugos(i,nsrf) = rugos(i,nsrf_comp2)*pctsrf_old(i,nsrf_comp2) + rugos(i,nsrf_comp3)*pctsrf_old(i,nsrf_comp3) 3009 3140 tsurf(i,nsrf) = tsurf(i,nsrf_comp2)*pctsrf_old(i,nsrf_comp2) + tsurf(i,nsrf_comp3)*pctsrf_old(i,nsrf_comp3) 3010 alb1(i,nsrf) = alb1(i,nsrf_comp2) *pctsrf_old(i,nsrf_comp2) + alb1(i,nsrf_comp3) *pctsrf_old(i,nsrf_comp3) 3011 alb2(i,nsrf) = alb2(i,nsrf_comp2) *pctsrf_old(i,nsrf_comp2) + alb2(i,nsrf_comp3) *pctsrf_old(i,nsrf_comp3) 3141 !albedo SB >>> 3142 ! alb1(i,nsrf) = alb1(i,nsrf_comp2) *pctsrf_old(i,nsrf_comp2) + alb1(i,nsrf_comp3) *pctsrf_old(i,nsrf_comp3) 3143 ! alb2(i,nsrf) = alb2(i,nsrf_comp2) *pctsrf_old(i,nsrf_comp2) + alb2(i,nsrf_comp3) *pctsrf_old(i,nsrf_comp3) 3144 DO k=1,nsw 3145 alb_dir(i,k,nsrf)=alb_dir(i,k,nsrf_comp2)*pctsrf_old(i,nsrf_comp2)+& 3146 alb_dir(i,k,nsrf_comp3)*pctsrf_old(i,nsrf_comp3) 3147 alb_dif(i,k,nsrf)=alb_dif(i,k,nsrf_comp2)*pctsrf_old(i,nsrf_comp2)+& 3148 alb_dif(i,k,nsrf_comp3)*pctsrf_old(i,nsrf_comp3) 3149 ENDDO 3150 !albedo SB <<< 3012 3151 ustar(i,nsrf) = ustar(i,nsrf_comp2) *pctsrf_old(i,nsrf_comp2) + ustar(i,nsrf_comp3) *pctsrf_old(i,nsrf_comp3) 3013 3152 u10m(i,nsrf) = u10m(i,nsrf_comp2) *pctsrf_old(i,nsrf_comp2) + u10m(i,nsrf_comp3) *pctsrf_old(i,nsrf_comp3) -
LMDZ5/branches/testing/libf/phylmd/phyetat0.F90
r2220 r2258 11 11 USE phys_state_var_mod, ONLY : ancien_ok, clwcon, detr_therm, dtime, & 12 12 du_gwd_rando, dv_gwd_rando, entr_therm, f0, falb1, falb2, fm_therm, & 13 falb_dir, falb_dif, & 13 14 ftsol, pbl_tke, pctsrf, q_ancien, radpas, radsol, rain_fall, ratqs, & 14 15 rlat, rlon, rnebcon, rugoro, sig1, snow_fall, solaire_etat0, sollw, sollwdown, & … … 69 70 INTEGER length 70 71 PARAMETER (length=100) 71 INTEGER it, iiq 72 INTEGER it, iiq, isw 72 73 REAL tab_cntrl(length), tabcntr0(length) 73 74 CHARACTER*7 str7 … … 243 244 ENDIF 244 245 246 !=================================================================== 247 ! Lecture des albedo difus et direct 248 249 DO nsrf = 1, nbsrf 250 DO isw=1, nsw 251 IF (isw.GT.99 .AND. nsrf.GT.99) THEN 252 PRINT*, "Trop de bandes SW ou sous-mailles" 253 call abort_gcm("phyetat0", "", 1) 254 ENDIF 255 WRITE(str7, '(i2.2, "srf", i2.2)') isw, nsrf 256 257 CALL get_field('A_dir_SW'//str7, falb_dir(:, isw, nsrf), found) 258 IF (.NOT. found) THEN 259 PRINT*, "phyetat0: Le champ <A_dir_SW"//str7//"> est absent" 260 PRINT*, " Il prend donc la valeur de surface" 261 DO i=1, klon 262 falb_dir(i, isw, nsrf)=0.2 263 ENDDO 264 ENDIF 265 CALL get_field('A_dif_SW'//str7, falb_dif(:, isw, nsrf), found) 266 IF (.NOT. found) THEN 267 PRINT*, "phyetat0: Le champ <A_dif_SW"//str7//"> est absent" 268 PRINT*, " Il prend donc la valeur de surface" 269 DO i=1, klon 270 falb_dif(i, isw, nsrf)=0.2 271 ENDDO 272 ENDIF 273 ENDDO 274 ENDDO 275 276 !=================================================================== 245 277 ! Lecture des temperatures du sol profond: 246 278 … … 264 296 ENDDO 265 297 298 !=================================================================== 266 299 ! Lecture de l'humidite de l'air juste au dessus du sol: 267 300 -
LMDZ5/branches/testing/libf/phylmd/phyredem.F90
r2220 r2258 51 51 REAL tab_cntrl(length) 52 52 53 INTEGER isoil, nsrf 53 INTEGER isoil, nsrf,isw 54 54 CHARACTER (len=7) :: str7 55 55 CHARACTER (len=2) :: str2 … … 142 142 ENDDO 143 143 144 ! ================== Albedo ======================================= 145 print*,'PHYREDEM NOUVEAU' 146 DO nsrf = 1, nbsrf 147 DO isw=1, nsw 148 IF (isw.LE.99 .AND. nsrf.LE.99) THEN 149 WRITE(str7, '(i2.2, "srf", i2.2)') isw, nsrf 150 print*,'PHYREDEM ',"A_dir_SW"//str7 151 CALL put_field("A_dir_SW"//str7, "Albedo direct du sol bande "//str7, & 152 falb_dir(:, isw, nsrf)) 153 CALL put_field("A_dif_SW"//str7, "Albedo difus du sol bande "//str7, & 154 falb_dif(:, isw, nsrf)) 155 ELSE 156 PRINT*, "Trop de couches" 157 call abort_gcm("phyredem", "", 1) 158 ENDIF 159 ENDDO 160 ENDDO 161 162 ! ================== Tsoil ======================================= 144 163 DO nsrf = 1, nbsrf 145 164 DO isoil=1, nsoilmx -
LMDZ5/branches/testing/libf/phylmd/phys_state_var_mod.F90
r2220 r2258 30 30 REAL, ALLOCATABLE, SAVE :: falb1(:,:), falb2(:,:) 31 31 !$OMP THREADPRIVATE(falb1, falb2) 32 33 !albedo SB >>> 34 REAL, ALLOCATABLE, SAVE :: falb_dif(:,:,:), falb_dir(:,:,:) 35 real, allocatable, save :: chl_con(:) 36 !$OMP THREADPRIVATE(falb_dir,falb_dif,chl_con) 37 !albedo SB <<< 38 39 32 40 REAL, ALLOCATABLE, SAVE :: rain_fall(:), snow_fall(:) 33 41 !$OMP THREADPRIVATE( rain_fall, snow_fall) … … 261 269 !$OMP THREADPRIVATE(albsol1,albsol2) 262 270 271 !albedo SB >>> 272 REAL,ALLOCATABLE,SAVE :: albsol_dif(:,:),albsol_dir(:,:) 273 !$OMP THREADPRIVATE(albsol_dif,albsol_dir) 274 !albedo SB <<< 275 276 263 277 REAL, ALLOCATABLE, SAVE:: wo(:, :, :) 264 278 ! column-density of ozone in a layer, in kilo-Dobsons … … 404 418 ALLOCATE(falb1(klon,nbsrf)) 405 419 ALLOCATE(falb2(klon,nbsrf)) 420 !albedo SB >>> 421 ALLOCATE(falb_dir(klon,nsw,nbsrf),falb_dif(klon,nsw,nbsrf)) 422 ALLOCATE(chl_con(klon)) 423 !albedo SB <<< 406 424 ALLOCATE(rain_fall(klon)) 407 425 ALLOCATE(snow_fall(klon)) … … 501 519 ALLOCATE(paire_ter(klon)) 502 520 ALLOCATE(albsol1(klon), albsol2(klon)) 521 !albedo SB >>> 522 ALLOCATE(albsol_dir(klon,nsw),albsol_dif(klon,nsw)) 523 !albedo SB <<< 503 524 504 525 if (read_climoz <= 1) then … … 634 655 deallocate(paire_ter) 635 656 deallocate(albsol1, albsol2) 657 !albedo SB >>> 658 deallocate(albsol_dir,albsol_dif,falb_dir,falb_dif,chl_con) 659 !albedo SB <<< 636 660 deallocate(wo) 637 661 deallocate(clwcon0,rnebcon0) -
LMDZ5/branches/testing/libf/phylmd/physiq.F90
r2220 r2258 4 4 SUBROUTINE physiq (nlon,nlev, & 5 5 debut,lafin,jD_cur, jH_cur,pdtphys, & 6 paprs,pplay,pphi,pphis,presnivs, clesphy0,&6 paprs,pplay,pphi,pphis,presnivs, & 7 7 u,v,t,qx, & 8 8 flxmass_w, & … … 283 283 !$OMP THREADPRIVATE(ok_hf) 284 284 285 INTEGER longcles286 PARAMETER ( longcles = 20)287 REAL clesphy0( longcles)285 INTEGER,PARAMETER :: longcles=20 286 REAL,SAVE :: clesphy0(longcles) 287 !$OMP THREADPRIVATE(clesphy0) 288 288 ! 289 289 ! Variables propres a la physique … … 291 291 SAVE itap ! compteur pour la physique 292 292 !$OMP THREADPRIVATE(itap) 293 294 INTEGER, SAVE :: abortphy=0 ! Reprere si on doit arreter en fin de phys 295 !$OMP THREADPRIVATE(abortphy) 293 296 ! 294 297 REAL,save :: solarlong0 … … 636 639 !$OMP THREADPRIVATE(fact_cldcon,facttemps) 637 640 638 integer iflag_cld th639 save iflag_cld th640 !$OMP THREADPRIVATE(iflag_cld th)641 integer iflag_cld_th 642 save iflag_cld_th 643 !$OMP THREADPRIVATE(iflag_cld_th) 641 644 logical ptconv(klon,klev) 642 645 !IM cf. AM 081204 BEG … … 865 868 866 869 REAL zzz 870 !albedo SB >>> 871 real,dimension(6),save :: SFRWL 872 !albedo SB <<< 867 873 868 874 !====================================================================== … … 913 919 solarlong0,seuil_inversion, & 914 920 fact_cldcon, facttemps,ok_newmicro,iflag_radia, & 915 iflag_cld th,iflag_ratqs,ratqsbas,ratqshaut,tau_ratqs, &921 iflag_cld_th,iflag_ratqs,ratqsbas,ratqshaut,tau_ratqs, & 916 922 ok_ade, ok_aie, ok_cdnc, aerosol_couple, & 917 923 flag_aerosol, flag_aerosol_strat, new_aod, & … … 924 930 print*, '=================================================' 925 931 ! 932 !CR: check sur le nb de traceurs de l eau 933 if ((iflag_ice_thermo.gt.0).and.(nqo==2)) then 934 WRITE (lunout, *) ' iflag_ice_thermo==1 requires 3 H2O tracers (H2Ov, H2Ol, H2Oi)', ' but nqo=', nqo, & 935 '. Might as well stop here.' 936 STOP 937 endif 938 926 939 dnwd0=0.0 927 940 ftd=0.0 … … 1014 1027 print*,'CYCLE_DIURNE', cycle_diurne 1015 1028 ! 1016 IF (iflag_con.EQ.2.AND.iflag_cld th.GT.-1) THEN1017 abort_message = 'Tiedtke needs iflag_cld th=-2 or -1'1029 IF (iflag_con.EQ.2.AND.iflag_cld_th.GT.-1) THEN 1030 abort_message = 'Tiedtke needs iflag_cld_th=-2 or -1' 1018 1031 CALL abort_gcm (modname,abort_message,1) 1019 1032 ENDIF … … 1130 1143 ,alp_bl_prescr, ale_bl_prescr) 1131 1144 ! 11/09/06 rajout initialisation ALE et ALP du wake et PBL(YU) 1132 ! print*,'apres ini_wake iflag_cld th=', iflag_cldth1145 ! print*,'apres ini_wake iflag_cld_th=', iflag_cld_th 1133 1146 endif 1134 1147 … … 1342 1355 mskocean_beta=.FALSE. 1343 1356 1357 !albedo SB >>> 1358 select case(nsw) 1359 case(2) 1360 SFRWL(1)=0.45538747 1361 SFRWL(2)=0.54461211 1362 case(4) 1363 SFRWL(1)=0.45538747 1364 SFRWL(2)=0.32870591 1365 SFRWL(3)=0.18568763 1366 SFRWL(4)=3.02191470E-02 1367 case(6) 1368 SFRWL(1)=1.28432794E-03 1369 SFRWL(2)=0.12304168 1370 SFRWL(3)=0.33106142 1371 SFRWL(4)=0.32870591 1372 SFRWL(5)=0.18568763 1373 SFRWL(6)=3.02191470E-02 1374 end select 1375 1376 1377 !albedo SB <<< 1378 1344 1379 OPEN(99,file='beta_crf.data',status='old', & 1345 1380 form='formatted',err=9999) … … 1378 1413 ! 1379 1414 CALL change_srf_frac(itap, dtime, days_elapsed+1, & 1380 pctsrf, falb1, falb2, ftsol, ustar, u10m, v10m, pbl_tke) 1381 1415 !albedo SB >>> 1416 ! pctsrf, falb1, falb2, ftsol, ustar, u10m, v10m, pbl_tke) 1417 pctsrf, falb_dir, falb_dif, ftsol, ustar, u10m, v10m, pbl_tke) 1418 !albedo SB <<< 1382 1419 1383 1420 ! Update time and other variables in Reprobus … … 1569 1606 !IM END 1570 1607 ! 1571 CALL hgardfou(t_seri,ftsol,'debutphy') 1608 CALL hgardfou(t_seri,ftsol,'debutphy',abortphy) 1609 IF (abortphy==1) Print*,'ERROR ABORT hgardfou debutphy' 1610 1572 1611 ! 1573 1612 !IM BEG … … 1813 1852 !>nrlmd+jyg 1814 1853 pplay, paprs, pctsrf, & 1815 ftsol,falb1,falb2,ustar,u10m,v10m,wstar, & 1854 !albedo SB >>> 1855 ! ftsol,falb1,falb2,ustar,u10m,v10m,wstar, & 1856 ftsol,SFRWL,falb_dir,falb_dif,ustar,u10m,v10m,wstar, & 1857 !albedo SB <<< 1816 1858 cdragh, cdragm, u1, v1, & 1817 albsol1, albsol2, sens, evap, & 1859 !albedo SB >>> 1860 ! albsol1, albsol2, sens, evap, & 1861 albsol_dir, albsol_dif, sens, evap, & 1862 !albedo SB <<< 1818 1863 albsol3_lic,runoff, snowhgt, qsnow, to_ice, sissnow, & 1819 1864 zxtsol, zxfluxlat, zt2m, qsat2m, & … … 1868 1913 IF (klon_glo==1) THEN 1869 1914 CALL add_pbl_tend & 1870 (d_u_vdf,d_v_vdf,d_t_vdf+d_t_diss,d_q_vdf,dql0,dqi0,paprs,'vdf')1915 (d_u_vdf,d_v_vdf,d_t_vdf+d_t_diss,d_q_vdf,dql0,dqi0,paprs,'vdf',abortphy) 1871 1916 ELSE 1872 1917 CALL add_phys_tend & 1873 (d_u_vdf,d_v_vdf,d_t_vdf+d_t_diss,d_q_vdf,dql0,dqi0,paprs,'vdf')1918 (d_u_vdf,d_v_vdf,d_t_vdf+d_t_diss,d_q_vdf,dql0,dqi0,paprs,'vdf',abortphy) 1874 1919 ENDIF 1875 1920 !-------------------------------------------------------------------- … … 1881 1926 call writefield_phy('q_seri',q_seri,llm) 1882 1927 endif 1928 1929 1930 !albedo SB >>> 1931 albsol1=0. 1932 albsol2=0. 1933 falb1=0. 1934 falb2=0. 1935 select case(nsw) 1936 case(2) 1937 albsol1=albsol_dir(:,1) 1938 albsol2=albsol_dir(:,2) 1939 falb1=falb_dir(:,1,:) 1940 falb2=falb_dir(:,2,:) 1941 case(4) 1942 albsol1=albsol_dir(:,1) 1943 albsol2=albsol_dir(:,2)*SFRWL(2)+albsol_dir(:,3)*SFRWL(3)+albsol_dir(:,4)*SFRWL(4) 1944 albsol2=albsol2/(SFRWL(2)+SFRWL(3)+SFRWL(4)) 1945 falb1=falb_dir(:,1,:) 1946 falb2=falb_dir(:,2,:)*SFRWL(2)+falb_dir(:,3,:)*SFRWL(3)+falb_dir(:,4,:)*SFRWL(4) 1947 falb2=falb2/(SFRWL(2)+SFRWL(3)+SFRWL(4)) 1948 case(6) 1949 albsol1=albsol_dir(:,1)*SFRWL(1)+albsol_dir(:,2)*SFRWL(2)+albsol_dir(:,3)*SFRWL(3) 1950 albsol1=albsol1/(SFRWL(1)+SFRWL(2)+SFRWL(3)) 1951 albsol2=albsol_dir(:,4)*SFRWL(4)+albsol_dir(:,5)*SFRWL(5)+albsol_dir(:,6)*SFRWL(6) 1952 albsol2=albsol2/(SFRWL(4)+SFRWL(5)+SFRWL(6)) 1953 falb1=falb_dir(:,1,:)*SFRWL(1)+falb_dir(:,2,:)*SFRWL(2)+falb_dir(:,3,:)*SFRWL(3) 1954 falb1=falb1/(SFRWL(1)+SFRWL(2)+SFRWL(3)) 1955 falb2=falb_dir(:,4,:)*SFRWL(4)+falb_dir(:,5,:)*SFRWL(5)+falb_dir(:,6,:)*SFRWL(6) 1956 falb2=falb2/(SFRWL(4)+SFRWL(5)+SFRWL(6)) 1957 end select 1958 !albedo SB <<< 1959 1883 1960 1884 1961 CALL evappot(klon,nbsrf,ftsol,pplay(:,1),cdragh, & … … 2221 2298 ! calcul des proprietes des nuages convectifs 2222 2299 clwcon0(:,:)=fact_cldcon*clwcon0(:,:) 2223 IF (iflag_cld_cv <= 1) THEN2300 IF (iflag_cld_cv == 0) THEN 2224 2301 call clouds_gno & 2225 2302 (klon,klev,q_seri,zqsat,clwcon0,ptconv,ratqsc,rnebcon0) … … 2273 2350 2274 2351 CALL add_phys_tend(d_u_con, d_v_con, d_t_con, d_q_con, dql0, dqi0, paprs, & 2275 'convection') 2352 'convection',abortphy) 2353 2276 2354 !---------------------------------------------------------------------------- 2277 2355 … … 2442 2520 d_t_wake(:,:)=dt_wake(:,:)*dtime 2443 2521 d_q_wake(:,:)=dq_wake(:,:)*dtime 2444 CALL add_phys_tend(du0,dv0,d_t_wake,d_q_wake,dql0,dqi0,paprs,'wake' )2522 CALL add_phys_tend(du0,dv0,d_t_wake,d_q_wake,dql0,dqi0,paprs,'wake',abortphy) 2445 2523 !------------------------------------------------------------------------ 2446 2524 … … 2461 2539 END IF 2462 2540 2463 ! print*,'apres callwake iflag_cld th=', iflag_cldth2541 ! print*,'apres callwake iflag_cld_th=', iflag_cld_th 2464 2542 ! 2465 2543 !=================================================================== … … 2753 2831 !----------------------------------------------------------------------- 2754 2832 ! ajout des tendances de l'ajustement sec ou des thermiques 2755 CALL add_phys_tend(du0,dv0,d_t_ajsb,d_q_ajsb,dql0,dqi0,paprs,'ajsb' )2833 CALL add_phys_tend(du0,dv0,d_t_ajsb,d_q_ajsb,dql0,dqi0,paprs,'ajsb',abortphy) 2756 2834 d_t_ajs(:,:)=d_t_ajs(:,:)+d_t_ajsb(:,:) 2757 2835 d_q_ajs(:,:)=d_q_ajs(:,:)+d_q_ajsb(:,:) … … 2782 2860 ! water distribution 2783 2861 CALL calcratqs(klon,klev,prt_level,lunout, & 2784 iflag_ratqs,iflag_con,iflag_cld th,pdtphys, &2862 iflag_ratqs,iflag_con,iflag_cld_th,pdtphys, & 2785 2863 ratqsbas,ratqshaut,tau_ratqs,fact_cldcon, & 2786 2864 ptconv,ptconvth,clwcon0th, rnebcon0th, & … … 2804 2882 frac_impa, frac_nucl, beta_prec_fisrt, & 2805 2883 prfl, psfl, rhcl, & 2806 zqasc, fraca,ztv,zpspsk,ztla,zthl,iflag_cld th, &2884 zqasc, fraca,ztv,zpspsk,ztla,zthl,iflag_cld_th, & 2807 2885 iflag_ice_thermo) 2808 2886 ! … … 2810 2888 WHERE (snow_lsc < 0) snow_lsc = 0. 2811 2889 2812 CALL add_phys_tend(du0,dv0,d_t_lsc,d_q_lsc,d_ql_lsc,d_qi_lsc,paprs,'lsc' )2890 CALL add_phys_tend(du0,dv0,d_t_lsc,d_q_lsc,d_ql_lsc,d_qi_lsc,paprs,'lsc',abortphy) 2813 2891 !--------------------------------------------------------------------------- 2814 2892 DO k = 1, klev … … 2860 2938 ! 2861 2939 !IM cf FH 2862 ! IF (iflag_cld th.eq.-1) THEN ! seulement pour Tiedtke2863 IF (iflag_cld th.le.-1) THEN ! seulement pour Tiedtke2940 ! IF (iflag_cld_th.eq.-1) THEN ! seulement pour Tiedtke 2941 IF (iflag_cld_th.le.-1) THEN ! seulement pour Tiedtke 2864 2942 snow_tiedtke=0. 2865 2943 ! print*,'avant calcul de la pseudo precip ' 2866 ! print*,'iflag_cld th',iflag_cldth2867 if (iflag_cld th.eq.-1) then2944 ! print*,'iflag_cld_th',iflag_cld_th 2945 if (iflag_cld_th.eq.-1) then 2868 2946 rain_tiedtke=rain_con 2869 2947 else … … 2898 2976 ENDDO 2899 2977 2900 ELSE IF (iflag_cld th.ge.3) THEN2978 ELSE IF (iflag_cld_th.ge.3) THEN 2901 2979 ! On prend pour les nuages convectifs le max du calcul de la 2902 2980 ! convection et du calcul du pas de temps precedent diminue d'un facteur … … 2954 3032 tausum_aero(:,:,:) = 0. 2955 3033 IF (iflag_rrtm .EQ. 0) THEN !--old radiation 2956 tau_aero(:,:,:,:) = 0.2957 piz_aero(:,:,:,:) = 0.3034 tau_aero(:,:,:,:) = 1.e-15 3035 piz_aero(:,:,:,:) = 1. 2958 3036 cg_aero(:,:,:,:) = 0. 2959 3037 ELSE 2960 tau_aero_sw_rrtm(:,:,:,:)=0.0 2961 piz_aero_sw_rrtm(:,:,:,:)=0.0 2962 cg_aero_sw_rrtm(:,:,:,:)=0.0 3038 tau_aero_sw_rrtm(:,:,:,:) = 1.e-15 3039 tau_aero_lw_rrtm(:,:,:,:) = 1.e-15 3040 piz_aero_sw_rrtm(:,:,:,:) = 1.0 3041 cg_aero_sw_rrtm(:,:,:,:) = 0.0 2963 3042 ENDIF 2964 3043 ENDIF … … 2987 3066 ! On prend la somme des fractions nuageuses et des contenus en eau 2988 3067 2989 if (iflag_cld th>=5) then3068 if (iflag_cld_th>=5) then 2990 3069 2991 3070 do k=1,klev … … 3293 3372 IF (MOD(itaprad,radpas).EQ.0) THEN 3294 3373 3295 DO i = 1, klon 3296 albsol1(i) = falb1(i,is_oce) * pctsrf(i,is_oce) & 3297 + falb1(i,is_lic) * pctsrf(i,is_lic) & 3298 + falb1(i,is_ter) * pctsrf(i,is_ter) & 3299 + falb1(i,is_sic) * pctsrf(i,is_sic) 3300 albsol2(i) = falb2(i,is_oce) * pctsrf(i,is_oce) & 3301 + falb2(i,is_lic) * pctsrf(i,is_lic) & 3302 + falb2(i,is_ter) * pctsrf(i,is_ter) & 3303 + falb2(i,is_sic) * pctsrf(i,is_sic) 3304 ENDDO 3374 !albedo SB >>> 3375 if(ok_chlorophyll)then 3376 print*,"-- reading chlorophyll" 3377 call readchlorophyll(debut) 3378 endif 3379 !do i=1,klon 3380 !if(chl_con(i)>1.) print*,i,chl_con(i),pctsrf(i,is_ter) 3381 !enddo 3382 !albedo SB <<< 3383 3384 !albedo SB >>> 3385 ! DO i = 1, klon 3386 ! albsol1(i) = falb1(i,is_oce) * pctsrf(i,is_oce) & 3387 ! + falb1(i,is_lic) * pctsrf(i,is_lic) & 3388 ! + falb1(i,is_ter) * pctsrf(i,is_ter) & 3389 ! + falb1(i,is_sic) * pctsrf(i,is_sic) 3390 ! albsol2(i) = falb2(i,is_oce) * pctsrf(i,is_oce) & 3391 ! + falb2(i,is_lic) * pctsrf(i,is_lic) & 3392 ! + falb2(i,is_ter) * pctsrf(i,is_ter) & 3393 ! + falb2(i,is_sic) * pctsrf(i,is_sic) 3394 ! ENDDO 3395 !albedo SB <<< 3305 3396 3306 3397 if (mydebug) then … … 3350 3441 CALL radlwsw & 3351 3442 (dist, rmu0, fract, & 3352 paprs, pplay,zxtsol,albsol1, albsol2, & 3443 !albedo SB >>> 3444 ! paprs, pplay,zxtsol,albsol1, albsol2, & 3445 paprs, pplay,zxtsol,SFRWL,albsol_dir, albsol_dif, & 3446 !albedo SB <<< 3353 3447 t_seri,q_seri,wo, & 3354 3448 cldfrarad, cldemirad, cldtaurad, & … … 3403 3497 CALL radlwsw & 3404 3498 (dist, rmu0, fract, & 3405 paprs, pplay,zxtsol,albsol1, albsol2, & 3499 !albedo SB >>> 3500 ! paprs, pplay,zxtsol,albsol1, albsol2, & 3501 paprs, pplay,zxtsol,SFRWL,albsol_dir, albsol_dif, & 3502 !albedo SB <<< 3406 3503 t_seri,q_seri,wo, & 3407 3504 cldfra, cldemi, cldtau, & … … 3470 3567 d_t_sw0(:,:)=heat0(:,:)*dtime/RDAY 3471 3568 d_t_lw0(:,:)=-cool0(:,:)*dtime/RDAY 3472 CALL add_phys_tend(du0,dv0,d_t_swr,dq0,dql0,dqi0,paprs,'SW' )3473 CALL add_phys_tend(du0,dv0,d_t_lwr,dq0,dql0,dqi0,paprs,'LW' )3569 CALL add_phys_tend(du0,dv0,d_t_swr,dq0,dql0,dqi0,paprs,'SW',abortphy) 3570 CALL add_phys_tend(du0,dv0,d_t_lwr,dq0,dql0,dqi0,paprs,'LW',abortphy) 3474 3571 3475 3572 ! … … 3554 3651 !----------------------------------------------------------------------------------------- 3555 3652 ! ajout des tendances de la trainee de l'orographie 3556 CALL add_phys_tend(d_u_oro,d_v_oro,d_t_oro,dq0,dql0,dqi0,paprs,'oro' )3653 CALL add_phys_tend(d_u_oro,d_v_oro,d_t_oro,dq0,dql0,dqi0,paprs,'oro',abortphy) 3557 3654 !----------------------------------------------------------------------------------------- 3558 3655 ! … … 3600 3697 !----------------------------------------------------------------------------------------- 3601 3698 ! ajout des tendances de la portance de l'orographie 3602 CALL add_phys_tend(d_u_lif,d_v_lif,d_t_lif,dq0,dql0,dqi0,paprs,'lif' )3699 CALL add_phys_tend(d_u_lif,d_v_lif,d_t_lif,dq0,dql0,dqi0,paprs,'lif',abortphy) 3603 3700 !----------------------------------------------------------------------------------------- 3604 3701 ! … … 3614 3711 ! 3615 3712 ! ajout des tendances 3616 CALL add_phys_tend(d_u_hin,d_v_hin,d_t_hin,dq0,dql0,dqi0,paprs,'hin' )3713 CALL add_phys_tend(d_u_hin,d_v_hin,d_t_hin,dq0,dql0,dqi0,paprs,'hin',abortphy) 3617 3714 3618 3715 ENDIF … … 3623 3720 du_gwd_rando, dv_gwd_rando) 3624 3721 CALL add_phys_tend(du_gwd_rando, dv_gwd_rando, dt0, dq0, dql0,dqi0,paprs, & 3625 'flott_gwd_rando' )3722 'flott_gwd_rando',abortphy) 3626 3723 end if 3627 3724 … … 3677 3774 CALL METHOX(1,klon,klon,klev,q_seri,d_q_ch4,pplay) 3678 3775 ! ajout de la tendance d'humidite due au methane 3679 CALL add_phys_tend(du0,dv0,dt0,d_q_ch4*dtime,dql0,'q_ch4' )3776 CALL add_phys_tend(du0,dv0,dt0,d_q_ch4*dtime,dql0,'q_ch4',abortphy) 3680 3777 END IF 3681 3778 ! … … 4058 4155 !On effectue les sorties: 4059 4156 4060 CALL phys_output_write(itap, pdtphys, paprs, pphis, 4157 CALL phys_output_write(itap, pdtphys, paprs, pphis, & 4061 4158 pplay, lmax_th, aerosol_couple, & 4062 4159 ok_ade, ok_aie, ivap, new_aod, ok_sync, & … … 4067 4164 4068 4165 4069 4070 4166 include "write_histday_seri.h" 4071 4167 … … 4073 4169 4074 4170 #endif 4171 4172 4173 !==================================================================== 4174 ! Arret du modele apres hgardfou en cas de detection d'un 4175 ! plantage par hgardfou 4176 !==================================================================== 4177 4178 IF (abortphy==1) THEN 4179 abort_message ='Plantage hgardfou' 4180 CALL abort_gcm (modname,abort_message,1) 4181 ENDIF 4182 4075 4183 4076 4184 ! 22.03.04 END -
LMDZ5/branches/testing/libf/phylmd/radlwsw_m.F90
r2220 r2258 10 10 SUBROUTINE radlwsw( & 11 11 dist, rmu0, fract, & 12 paprs, pplay,tsol,alb1, alb2, & 12 !albedo SB >>> 13 ! paprs, pplay,tsol,alb1, alb2, & 14 paprs, pplay,tsol,SFRWL,alb_dir, alb_dif, & 15 !albedo SB <<< 13 16 t,q,wo,& 14 17 cldfra, cldemi, cldtaupd,& … … 174 177 REAL, INTENT(in) :: rmu0(KLON), fract(KLON) 175 178 REAL, INTENT(in) :: paprs(KLON,KLEV+1), pplay(KLON,KLEV) 176 REAL, INTENT(in) :: alb1(KLON), alb2(KLON), tsol(KLON) 179 !albedo SB >>> 180 ! REAL, INTENT(in) :: alb1(KLON), alb2(KLON), tsol(KLON) 181 REAL, INTENT(in) :: tsol(KLON) 182 REAL, INTENT(in) :: alb_dir(KLON,NSW),alb_dif(KLON,NSW) 183 real, intent(in) :: SFRWL(6) 184 !albedo SB <<< 177 185 REAL, INTENT(in) :: t(KLON,KLEV), q(KLON,KLEV) 178 186 … … 418 426 ! zfract(i) = 1. !!!!!! essai MPL 19052010 419 427 zrmu0(i) = rmu0(iof+i) 420 PALBD(i,1) = alb1(iof+i) 421 PALBD(i,2) = alb2(iof+i) 422 ! 423 PALBD_NEW(i,1) = alb1(iof+i) !!!!! A REVOIR (MPL) PALBD_NEW en fonction bdes SW 424 do kk=2,NSW 425 PALBD_NEW(i,kk) = alb2(iof+i) 426 enddo 427 PALBP(i,1) = alb1(iof+i) 428 PALBP(i,2) = alb2(iof+i) 429 ! 430 PALBP_NEW(i,1) = alb1(iof+i) !!!!! A REVOIR (MPL) PALBP_NEW en fonction bdes SW 431 do kk=2,NSW 432 PALBP_NEW(i,kk) = alb2(iof+i) 433 enddo 428 429 430 !albedo SB >>> 431 ! PALBD(i,1) = alb1(iof+i) 432 ! PALBD(i,2) = alb2(iof+i) 433 ! PALBD_NEW(i,1) = alb1(iof+i) !!!!! A REVOIR (MPL) PALBD_NEW en 434 ! fonction bdes SW 435 ! do kk=2,NSW 436 ! PALBD_NEW(i,kk) = alb2(iof+i) 437 ! enddo 438 ! PALBP(i,1) = alb1(iof+i) 439 ! PALBP(i,2) = alb2(iof+i) 440 ! 441 ! PALBP_NEW(i,1) = alb1(iof+i) !!!!! A REVOIR (MPL) PALBP_NEW en 442 ! fonction bdes SW 443 ! do kk=2,NSW 444 ! PALBP_NEW(i,kk) = alb2(iof+i) 445 ! enddo 446 447 if(iflag_rrtm==0)then 448 select case(nsw) 449 case(2) 450 PALBD(i,1)=alb_dif(iof+i,1) 451 PALBD(i,2)=alb_dif(iof+i,2) 452 PALBP(i,1)=alb_dir(iof+i,1) 453 PALBP(i,2)=alb_dir(iof+i,2) 454 case(4) 455 PALBD(i,1)=alb_dif(iof+i,1) 456 PALBD(i,2)=(alb_dif(iof+i,2)*SFRWL(2)+alb_dif(iof+i,3)*SFRWL(3) & 457 +alb_dif(iof+i,4)*SFRWL(4))/(SFRWL(2)+SFRWL(3)+SFRWL(4)) 458 PALBP(i,1)=alb_dir(iof+i,1) 459 PALBP(i,2)=(alb_dir(iof+i,2)*SFRWL(2)+alb_dir(iof+i,3)*SFRWL(3) & 460 +alb_dir(iof+i,4)*SFRWL(4))/(SFRWL(2)+SFRWL(3)+SFRWL(4)) 461 case(6) 462 PALBD(i,1)=(alb_dif(iof+i,1)*SFRWL(1)+alb_dif(iof+i,2)*SFRWL(2) & 463 +alb_dif(iof+i,3)*SFRWL(3))/(SFRWL(1)+SFRWL(2)+SFRWL(3)) 464 PALBD(i,2)=(alb_dif(iof+i,4)*SFRWL(4)+alb_dif(iof+i,5)*SFRWL(5) & 465 +alb_dif(iof+i,6)*SFRWL(6))/(SFRWL(4)+SFRWL(5)+SFRWL(6)) 466 PALBP(i,1)=(alb_dir(iof+i,1)*SFRWL(1)+alb_dir(iof+i,2)*SFRWL(2) & 467 +alb_dir(iof+i,3)*SFRWL(3))/(SFRWL(1)+SFRWL(2)+SFRWL(3)) 468 PALBP(i,2)=(alb_dir(iof+i,4)*SFRWL(4)+alb_dir(iof+i,5)*SFRWL(5) & 469 +alb_dir(iof+i,6)*SFRWL(6))/(SFRWL(4)+SFRWL(5)+SFRWL(6)) 470 end select 471 elseif(iflag_rrtm==1)then 472 DO kk=1,NSW 473 PALBD_NEW(i,kk)=alb_dif(iof+i,kk) 474 PALBP_NEW(i,kk)=alb_dir(iof+i,kk) 475 ENDDO 476 endif 477 !albedo SB <<< 478 479 480 481 434 482 PEMIS(i) = 1.0 !!!!! A REVOIR (MPL) 435 483 PVIEW(i) = 1.66 -
LMDZ5/branches/testing/libf/phylmd/rrtm/aeropt_6bands_rrtm.F90
r2211 r2258 473 473 tau_ae(i,k,id_ASSSM_phy,inu)+tau_ae(i,k,id_CSSSM_phy,inu)+ & 474 474 tau_ae(i,k,id_SSSSM_phy,inu)+ tau_ae(i,k,id_CIDUSTM_phy,inu) 475 tau_allaer(i,k,2,inu)=MAX(tau_allaer(i,k,2,inu),1e- 5)475 tau_allaer(i,k,2,inu)=MAX(tau_allaer(i,k,2,inu),1e-15) 476 476 477 477 piz_allaer(i,k,2,inu)=(tau_ae(i,k,id_ASSO4M_phy,inu)*piz_ae(i,k,id_ASSO4M_phy,inu)+ & … … 486 486 tau_ae(i,k,id_CIDUSTM_phy,inu)*piz_ae(i,k,id_CIDUSTM_phy,inu)) & 487 487 /tau_allaer(i,k,2,inu) 488 piz_allaer(i,k,2,inu)=MAX(piz_allaer(i,k,2,inu),0. 1)488 piz_allaer(i,k,2,inu)=MAX(piz_allaer(i,k,2,inu),0.01) 489 489 490 490 cg_allaer(i,k,2,inu)=(tau_ae(i,k,id_ASSO4M_phy,inu)*piz_ae(i,k,id_ASSO4M_phy,inu)*cg_ae(i,k,id_ASSO4M_phy,inu)+ & … … 506 506 tau_ae_pi(i,k,id_ASSSM_phy,inu)+tau_ae_pi(i,k,id_CSSSM_phy,inu)+ & 507 507 tau_ae_pi(i,k,id_SSSSM_phy,inu)+ tau_ae_pi(i,k,id_CIDUSTM_phy,inu) 508 tau_allaer(i,k,1,inu)=MAX(tau_allaer(i,k,1,inu),1e- 5)508 tau_allaer(i,k,1,inu)=MAX(tau_allaer(i,k,1,inu),1e-15) 509 509 510 510 piz_allaer(i,k,1,inu)=(tau_ae_pi(i,k,id_ASSO4M_phy,inu)*piz_ae(i,k,id_ASSO4M_phy,inu)+ & … … 519 519 tau_ae_pi(i,k,id_CIDUSTM_phy,inu)*piz_ae(i,k,id_CIDUSTM_phy,inu)) & 520 520 /tau_allaer(i,k,1,inu) 521 piz_allaer(i,k,1,inu)=MAX(piz_allaer(i,k,1,inu),0. 1)521 piz_allaer(i,k,1,inu)=MAX(piz_allaer(i,k,1,inu),0.01) 522 522 523 523 cg_allaer(i,k,1,inu)=(tau_ae_pi(i,k,id_ASSO4M_phy,inu)*piz_ae(i,k,id_ASSO4M_phy,inu)*cg_ae(i,k,id_ASSO4M_phy,inu)+ & -
LMDZ5/branches/testing/libf/phylmd/rrtm/aeropt_lw_rrtm.F90
r2220 r2258 9 9 IMPLICIT NONE 10 10 11 tau_aero_lw_rrtm(:,:,:,:) =0.011 tau_aero_lw_rrtm(:,:,:,:) = 1.e-15 12 12 13 13 END SUBROUTINE AEROPT_LW_RRTM -
LMDZ5/branches/testing/libf/phylmd/rrtm/readaerosolstrato_rrtm.F90
r2187 r2258 211 211 ENDDO 212 212 213 !--default SSA value if there is no aerosol 214 !--to avoid 0 values that seems to cause some problem to RRTM 215 WHERE (tau_aero_sw_rrtm.LT.1.e-14) 216 piz_aero_sw_rrtm = 1.0 217 ENDWHERE 218 219 !--in principle this should not be necessary 220 !--as these variables have min values already but just in case 221 !--put 1e-15 min value to both SW and LW AOD 222 tau_aero_sw_rrtm = MAX(tau_aero_sw_rrtm,1.e-15) 223 tau_aero_lw_rrtm = MAX(tau_aero_lw_rrtm,1.e-15) 224 213 225 end subroutine readaerosolstrato_rrtm -
LMDZ5/branches/testing/libf/phylmd/screenc.F90
r1910 r2258 66 66 ! Richardson at reference level 67 67 ! 68 CALL coefcdrag (klon, knon, nsrf, zxli, & 68 ! CALL coefcdrag (klon, knon, nsrf, zxli, & 69 ! speed, temp, q_zref, gref, & 70 ! psol, ts, qsurf, rugos, & 71 ! okri, ri1, & 72 ! cdram, cdrah, cdran, zri1, & 73 ! pref) 74 ! Fuxing WANG, 04/03/2015, replace the coefcdrag by the merged version: cdrag 75 CALL cdrag (knon, nsrf, & 69 76 speed, temp, q_zref, gref, & 70 77 psol, ts, qsurf, rugos, & 71 okri, ri1, & 72 cdram, cdrah, cdran, zri1, & 73 pref) 74 ! 78 cdram, cdrah, zri1, pref) 75 79 DO i = 1, knon 76 80 delu(i) = ustar(i)/sqrt(cdram(i)) -
LMDZ5/branches/testing/libf/phylmd/stdlevvar.F90
r2160 r2258 98 98 ! 99 99 okri=.FALSE. 100 CALL coefcdrag(klon, knon, nsrf, zxli, & 101 & speed, t1, q1, z1, psol, & 102 & ts1, qsurf, rugos, okri, ri1, & 103 & cdram, cdrah, cdran, zri1, pref) 100 ! CALL coefcdrag(klon, knon, nsrf, zxli, & 101 ! & speed, t1, q1, z1, psol, & 102 ! & ts1, qsurf, rugos, okri, ri1, & 103 ! & cdram, cdrah, cdran, zri1, pref) 104 ! Fuxing WANG, 04/03/2015, replace the coefcdrag by the merged version: cdrag 105 CALL cdrag(knon, nsrf, & 106 & speed, t1, q1, z1, & 107 & psol, ts1, qsurf, rugos, & 108 & cdram, cdrah, zri1, pref) 109 104 110 ! --- special Dice: on force cdragm ( a defaut de forcer ustar) MPL 05082013 105 111 IF (ok_prescr_ust) then -
LMDZ5/branches/testing/libf/phylmd/surf_land_mod.F90
r2220 r2258 17 17 lwdown_m, q2m, t2m, & 18 18 snow, qsol, agesno, tsoil, & 19 z0_new, alb1_new, alb2_new, evap, fluxsens, fluxlat, & 19 !albedo SB >>> 20 ! z0_new, alb1_new, alb2_new, evap, fluxsens, fluxlat, & 21 z0_new, SFRWL, alb_dir_new, alb_dif_new, evap, fluxsens, fluxlat, & 22 !albedo SB <<< 20 23 qsurf, tsurf_new, dflux_s, dflux_l, & 21 24 flux_u1, flux_v1 ) … … 35 38 INCLUDE "dimsoil.h" 36 39 INCLUDE "YOMCST.h" 40 !albedo SB >>> 41 INCLUDE "clesphys.h" 42 !albedo SB <<< 37 43 38 44 ! Input variables … … 71 77 !**************************************************************************************** 72 78 REAL, DIMENSION(klon), INTENT(OUT) :: z0_new 73 REAL, DIMENSION(klon), INTENT(OUT) :: alb1_new ! albdeo for shortwave interval 1(visible) 74 REAL, DIMENSION(klon), INTENT(OUT) :: alb2_new ! albedo for shortwave interval 2(near infrared) 79 !albedo SB >>> 80 ! REAL, DIMENSION(klon), INTENT(OUT) :: alb1_new ! albdeo for shortwave interval 1(visible) 81 ! REAL, DIMENSION(klon), INTENT(OUT) :: alb2_new ! albedo for shortwave interval 2(near infrared) 82 REAL, DIMENSION(6), INTENT(IN) :: SFRWL 83 REAL, DIMENSION(klon,nsw), INTENT(OUT) :: alb_dir_new,alb_dif_new 84 !albedo SB <<< 75 85 REAL, DIMENSION(klon), INTENT(OUT) :: evap 76 86 REAL, DIMENSION(klon), INTENT(OUT) :: fluxsens, fluxlat … … 89 99 REAL, DIMENSION(klon) :: u0, v0 ! surface speed 90 100 INTEGER :: i 101 102 !albedo SB >>> 103 REAL, DIMENSION(klon) :: alb1_new,alb2_new 104 !albedo SB <<< 91 105 92 106 … … 165 179 p1lay, temp_air, & 166 180 flux_u1, flux_v1) 181 182 !albedo SB >>> 183 184 185 select case(NSW) 186 case(2) 187 alb_dir_new(1:knon,1)=alb1_new(1:knon) 188 alb_dir_new(1:knon,2)=alb2_new(1:knon) 189 case(4) 190 alb_dir_new(1:knon,1)=alb1_new(1:knon) 191 alb_dir_new(1:knon,2)=alb2_new(1:knon) 192 alb_dir_new(1:knon,3)=alb2_new(1:knon) 193 alb_dir_new(1:knon,4)=alb2_new(1:knon) 194 case(6) 195 alb_dir_new(1:knon,1)=alb1_new(1:knon) 196 alb_dir_new(1:knon,2)=alb1_new(1:knon) 197 alb_dir_new(1:knon,3)=alb1_new(1:knon) 198 alb_dir_new(1:knon,4)=alb2_new(1:knon) 199 alb_dir_new(1:knon,5)=alb2_new(1:knon) 200 alb_dir_new(1:knon,6)=alb2_new(1:knon) 201 end select 202 alb_dif_new=alb_dir_new 203 !albedo SB <<< 204 205 167 206 168 207 END SUBROUTINE surf_land -
LMDZ5/branches/testing/libf/phylmd/surf_landice_mod.F90
r1910 r2258 17 17 ps, u1, v1, rugoro, pctsrf, & 18 18 snow, qsurf, qsol, agesno, & 19 tsoil, z0_new, alb1, alb2, evap, fluxsens, fluxlat, & 19 !albedo SB >>> 20 ! tsoil, z0_new, alb1, alb2, evap, fluxsens, fluxlat, & 21 tsoil, z0_new, SFRWL, alb_dir, alb_dif, evap, fluxsens, fluxlat, & 22 !albedo SB <<< 20 23 tsurf_new, dflux_s, dflux_l, & 21 24 slope, cloudf, & … … 80 83 REAL, DIMENSION(klon), INTENT(OUT) :: qsurf 81 84 REAL, DIMENSION(klon), INTENT(OUT) :: z0_new 82 REAL, DIMENSION(klon), INTENT(OUT) :: alb1 ! new albedo in visible SW interval 83 REAL, DIMENSION(klon), INTENT(OUT) :: alb2 ! new albedo in near IR interval 85 !albedo SB >>> 86 ! REAL, DIMENSION(klon), INTENT(OUT) :: alb1 ! new albedo in visible SW interval 87 ! REAL, DIMENSION(klon), INTENT(OUT) :: alb2 ! new albedo in near IR interval 88 REAL, DIMENSION(6), INTENT(IN) ::SFRWL 89 REAL, DIMENSION(klon,nsw), INTENT(OUT) ::alb_dir,alb_dif 90 !albedo SB <<< 84 91 REAL, DIMENSION(klon), INTENT(OUT) :: evap, fluxsens, fluxlat 85 92 REAL, DIMENSION(klon), INTENT(OUT) :: tsurf_new … … 116 123 CHARACTER (len = 20) :: modname = 'surf_landice' 117 124 CHARACTER (len = 80) :: abort_message 125 126 !albedo SB >>> 127 real,dimension(klon) :: alb1,alb2 128 !albedo SB <<< 118 129 119 130 ! End definition … … 315 326 316 327 328 !albedo SB >>> 329 select case(NSW) 330 case(2) 331 alb_dir(1:knon,1)=alb1(1:knon) 332 alb_dir(1:knon,2)=alb2(1:knon) 333 case(4) 334 alb_dir(1:knon,1)=alb1(1:knon) 335 alb_dir(1:knon,2)=alb2(1:knon) 336 alb_dir(1:knon,3)=alb2(1:knon) 337 alb_dir(1:knon,4)=alb2(1:knon) 338 case(6) 339 alb_dir(1:knon,1)=alb1(1:knon) 340 alb_dir(1:knon,2)=alb1(1:knon) 341 alb_dir(1:knon,3)=alb1(1:knon) 342 alb_dir(1:knon,4)=alb2(1:knon) 343 alb_dir(1:knon,5)=alb2(1:knon) 344 alb_dir(1:knon,6)=alb2(1:knon) 345 end select 346 alb_dif=alb_dir 347 !albedo SB <<< 348 349 350 351 317 352 END SUBROUTINE surf_landice 318 353 ! -
LMDZ5/branches/testing/libf/phylmd/surf_ocean_mod.F90
r2220 r2258 16 16 ps, u1, v1, rugoro, pctsrf, & 17 17 snow, qsurf, agesno, & 18 z0_new, alb1_new, alb2_new, evap, fluxsens, fluxlat, & 18 !albedo SB >>> 19 ! z0_new, alb1_new, alb2_new, evap, fluxsens, fluxlat, & 20 z0_new, SFRWL, alb_dir_new, alb_dif_new, evap, fluxsens, fluxlat, & 21 !albedo SB <<< 19 22 tsurf_new, dflux_s, dflux_l, lmt_bils, & 20 23 flux_u1, flux_v1) … … 72 75 !**************************************************************************************** 73 76 REAL, DIMENSION(klon), INTENT(OUT) :: z0_new 74 REAL, DIMENSION(klon), INTENT(OUT) :: alb1_new ! new albedo in visible SW interval 75 REAL, DIMENSION(klon), INTENT(OUT) :: alb2_new ! new albedo in near IR interval 77 !albedo SB >>> 78 ! REAL, DIMENSION(klon), INTENT(OUT) :: alb1_new ! new albedo in visible SW interval 79 ! REAL, DIMENSION(klon), INTENT(OUT) :: alb2_new ! new albedo in near IR interval 80 REAL, DIMENSION(6), INTENT(IN) :: SFRWL 81 REAL, DIMENSION(klon,nsw), INTENT(OUT) :: alb_dir_new,alb_dif_new 82 !albedo SB <<< 76 83 REAL, DIMENSION(klon), INTENT(OUT) :: evap, fluxsens, fluxlat 77 84 REAL, DIMENSION(klon), INTENT(OUT) :: tsurf_new … … 82 89 ! Local variables 83 90 !**************************************************************************************** 84 INTEGER :: i 91 INTEGER :: i, k 85 92 REAL :: tmp 86 93 REAL, PARAMETER :: cepdu2=(0.1)**2 … … 155 162 ! 156 163 !**************************************************************************************** 164 !albedo SB >>> 165 166 167 if(iflag_albedo==1)then 168 call ocean_albedo(knon,rmu0,knindex,windsp,SFRWL,alb_dir_new,alb_dif_new) 169 else 157 170 IF (cycle_diurne) THEN 158 171 CALL alboc_cd(rmu0,alb_eau) … … 162 175 163 176 DO i =1, knon 164 alb1_new(i) = alb_eau(knindex(i)) 177 do k=1,nsw 178 alb_dir_new(i,k) = alb_eau(knindex(i)) 179 enddo 165 180 ENDDO 166 alb2_new(1:knon) = alb1_new(1:knon) 181 alb_dif_new=0.05 !alb_dir_new 182 endif 183 184 !albedo SB <<< 167 185 168 186 !**************************************************************************************** -
LMDZ5/branches/testing/libf/phylmd/surf_seaice_mod.F90
r2220 r2258 1 ! 2 ! $Id$ 1 3 ! 2 4 MODULE surf_seaice_mod … … 17 19 ps, u1, v1, rugoro, pctsrf, & 18 20 snow, qsurf, qsol, agesno, tsoil, & 19 z0_new, alb1_new, alb2_new, evap, fluxsens, fluxlat, & 21 !albedo SB >>> 22 ! z0_new, alb1_new, alb2_new, evap, fluxsens, fluxlat, & 23 z0_new, SFRWL, alb_dir_new, alb_dif_new, evap, fluxsens, fluxlat, & 24 !albedo SB <<< 20 25 tsurf_new, dflux_s, dflux_l, & 21 26 flux_u1, flux_v1) … … 34 39 ! 35 40 INCLUDE "dimsoil.h" 41 INCLUDE "clesphys.h" 36 42 37 43 ! Input arguments … … 67 73 !**************************************************************************************** 68 74 REAL, DIMENSION(klon), INTENT(OUT) :: z0_new 69 REAL, DIMENSION(klon), INTENT(OUT) :: alb1_new ! new albedo in visible SW interval 70 REAL, DIMENSION(klon), INTENT(OUT) :: alb2_new ! new albedo in near IR interval 75 !albedo SB >>> 76 ! REAL, DIMENSION(klon), INTENT(OUT) :: alb1_new ! new albedo in visible SW interval 77 ! REAL, DIMENSION(klon), INTENT(OUT) :: alb2_new ! new albedo in near IR interval 78 REAL, DIMENSION(6), INTENT(IN) :: SFRWL 79 REAL, DIMENSION(klon,nsw), INTENT(OUT) :: alb_dir_new,alb_dif_new 80 !albedo SB <<< 71 81 REAL, DIMENSION(klon), INTENT(OUT) :: evap, fluxsens, fluxlat 72 82 REAL, DIMENSION(klon), INTENT(OUT) :: tsurf_new … … 78 88 REAL, DIMENSION(klon) :: radsol 79 89 90 !albedo SB >>> 91 REAL, DIMENSION(klon) :: alb1_new,alb2_new 92 !albedo SB <<< 80 93 ! 81 94 ! End definitions … … 140 153 z0_new = SQRT(z0_new**2+rugoro**2) 141 154 155 156 !albedo SB >>> 157 select case(NSW) 158 case(2) 159 alb_dir_new(1:knon,1)=alb1_new(1:knon) 160 alb_dir_new(1:knon,2)=alb2_new(1:knon) 161 case(4) 162 alb_dir_new(1:knon,1)=alb1_new(1:knon) 163 alb_dir_new(1:knon,2)=alb2_new(1:knon) 164 alb_dir_new(1:knon,3)=alb2_new(1:knon) 165 alb_dir_new(1:knon,4)=alb2_new(1:knon) 166 case(6) 167 alb_dir_new(1:knon,1)=alb1_new(1:knon) 168 alb_dir_new(1:knon,2)=alb1_new(1:knon) 169 alb_dir_new(1:knon,3)=alb1_new(1:knon) 170 alb_dir_new(1:knon,4)=alb2_new(1:knon) 171 alb_dir_new(1:knon,5)=alb2_new(1:knon) 172 alb_dir_new(1:knon,6)=alb2_new(1:knon) 173 end select 174 alb_dif_new=alb_dir_new 175 !albedo SB <<< 176 177 178 179 142 180 END SUBROUTINE surf_seaice 143 181 ! -
LMDZ5/branches/testing/libf/phymar/physiq.F90
r2160 r2258 10 10 SUBROUTINE physiq (nlon,nlev, & 11 11 & debut,lafin,jD_cur, jH_cur,pdtphys, & 12 & paprs,pplay,pphi,pphis,ppresnivs, clesphy0,&12 & paprs,pplay,pphi,pphis,ppresnivs, & 13 13 & u,v,t,qx, & 14 14 & flxmass_w, & … … 118 118 real,intent(in) :: pphis(klon) ! surface geopotential 119 119 real,intent(in) :: ppresnivs(klev) ! pseudo-pressure (Pa) of mid-layers 120 integer,parameter :: longcles=20121 real,intent(in) :: clesphy0(longcles) ! Not used122 120 real,intent(in) :: u(klon,klev) ! eastward zonal wind (m/s) 123 121 real,intent(in) :: v(klon,klev) ! northward meridional wind (m/s)
Note: See TracChangeset
for help on using the changeset viewer.