Commit 318ea04f authored by Lluís Fita Borrell's avatar Lluís Fita Borrell
Browse files

Committing ORCHIDEE's changes

parent 6c6337d4
......@@ -109,7 +109,6 @@ CONTAINS
REAL ,DIMENSION(ims:ime,kms:kme,jms:jme), INTENT(INOUT) :: tke_tend
REAL ,DIMENSION(ims:ime,jms:jme), INTENT(INOUT) :: mu_tendf
INTEGER, INTENT(IN) :: k_start, k_end
LOGICAL, INTENT(IN), OPTIONAL :: f_flux
......@@ -254,7 +253,7 @@ BENCH_END(phy_prep_tim)
CALL wrf_debug ( 200 , ' call radiation_driver' )
BENCH_START(rad_driver_tim)
CALL radiation_driver( &
CALL radiation_driver( &
& p_top=grid%p_top & !DJW 140312 added p_top for vertical nesting
& ,ACFRCV=grid%acfrcv ,ACFRST=grid%acfrst ,ALBEDO=grid%albedo &
& ,CFRACH=grid%cfrach ,CFRACL=grid%cfracl ,CFRACM=grid%cfracm &
......@@ -390,7 +389,11 @@ BENCH_START(rad_driver_tim)
& ,slope_rad=config_flags%slope_rad,topo_shading=config_flags%topo_shading &
& ,shadowmask=grid%shadowmask,ht=grid%ht,dx=grid%dx,dy=grid%dy &
& ,diffuse_frac=grid%diffuse_frac &
& ,IS_CAMMGMP_USED = grid%is_CAMMGMP_used )
& ,IS_CAMMGMP_USED = grid%is_CAMMGMP_used &
#ifdef key_cpp_orchidee
& ,ACEMISS=grid%ACEMISS,ACTSK=grid%ACTSK &
#endif
)
BENCH_END(rad_driver_tim)
......@@ -431,6 +434,12 @@ BENCH_START(surf_driver_tim)
endif
CALL surface_driver( &
#ifdef key_cpp_nemo
& SINALPHA=grid%sina, COSALPHA=grid%cosa,
#endif
#ifdef key_cpp_orchidee
& PHP=grid%php, &
#endif
& HYDRO_dt=HYDRO_dt, sfcheadrt=grid%sfcheadrt, &
& INFXSRT=grid%INFXSRT, soldrain=grid%soldrain, &
& ACGRDFLX=grid%acgrdflx ,ACHFX=grid%achfx ,ACLHF=grid%aclhf &
......@@ -491,14 +500,14 @@ BENCH_START(surf_driver_tim)
& ,UOCE=grid%uoce ,VOCE=grid%voce &
& ,VEGFRA=grid%vegfra ,VZ0=grid%vz0 ,V_FRAME=grid%v_frame &
& ,V_PHY=grid%v_phy ,WARM_RAIN=grid%warm_rain &
& ,WSPD=wspd ,XICE=grid%xice ,XLAND=grid%xland &
& ,WSPD=wspd ,XICE=grid%xice ,LANDMASK=grid%landmask ,XLAND=grid%xland &
& ,MAX_EDOM=grid%num_ext_model_couple_dom ,CPLMASK=grid%cplmask &
& ,Z0=grid%z0 ,Z=grid%z ,ZNT=grid%znt &
& ,Z0=grid%z0 ,Z=grid%z, ZNT=grid%znt, ZQT=grid%zqt &
& ,ZS=grid%zs ,ALBSI=grid%albsi , ICEDEPTH=grid%icedepth &
& ,SNOWSI=grid%snowsi &
& ,XICEM=grid%xicem ,ISICE=grid%landuse_isice &
& ,USTM=grid%ustm ,CK=grid%ck ,CKA=grid%cka &
& ,CD=grid%cd ,CDA=grid%cda &
& ,CD=grid%cd, CDA=grid%cda, CHS=grid%chs &
& ,ISFTCFLX=config_flags%isftcflx, IZ0TLND=config_flags%iz0tlnd &
& ,SF_OCEAN_PHYSICS=config_flags%sf_ocean_physics &
& ,OML_HML0=config_flags%oml_hml0 ,OML_GAMMA=config_flags%oml_gamma &
......
......@@ -76,12 +76,13 @@ CONTAINS
SUBROUTINE SFCLAY_mynn(U3D,V3D,T3D,QV3D,P3D,dz8w, &
CP,G,ROVCP,R,XLV,PSFCPA,CHS,CHS2,CQS2,CPM, &
ZNT,UST,PBLH,MAVAIL,ZOL,MOL,REGIME,PSIM,PSIH, &
XLAND,HFX,QFX,LH,TSK,FLHC,FLQC,QGH,QSFC,RMOL, &
XLAND,HFX,QFX,LH,TSK,FLHC,FLQC,QGH,QSFC,RMOL, &
U10,V10,TH2,T2,Q2,SNOWH, &
GZ1OZ0,WSPD,BR,ISFFLX,DX, &
SVP1,SVP2,SVP3,SVPT0,EP1,EP2, &
KARMAN,itimestep,ch,th3d,pi3d,qc3d,rho3d, &
tsq,qsq,cov,sh3d,el_pbl,qcg, &
ZQT, QCDRAG, &
!JOE-add output
! z0zt_ratio,BulkRi,wstar,qstar,resist,logres, &
!JOE-end
......@@ -116,7 +117,11 @@ CONTAINS
!-- ZOL z/L height over Monin-Obukhov length
!-- MOL T* (similarity theory) (K)
!-- RMOL Reciprocal of M-O length (/m)
!-- REGIME flag indicating PBL regime (stable, unstable, etc.)
!!
!! ZQT : Time variable roughness for T and Q diffusion into the surface layer
!! QCDRAG : Drag coefficient for T and Q produced for ORCHIDEE by sf_mynn.
!!
!--REGIME flag indicating PBL regime (stable, unstable, etc.)
!-- PSIM similarity stability function for momentum
!-- PSIH similarity stability function for heat
!-- XLAND land mask (1 for land, 2 for water)
......@@ -254,6 +259,12 @@ CONTAINS
GZ1OZ0,WSPD,BR, &
PSIM,PSIH
REAL, DIMENSION( ims:ime, jms:jme ) , &
INTENT(INOUT) :: ZQT
REAL, DIMENSION( ims:ime, jms:jme ) , &
INTENT(OUT) :: QCDRAG
!ADDITIONAL OUTPUT
!JOE-begin
REAL, DIMENSION( ims:ime, jms:jme ) :: z0zt_ratio, &
......@@ -340,6 +351,7 @@ CONTAINS
GZ1OZ0(ims,j),WSPD(ims,j),BR(ims,j),ISFFLX,DX, &
SVP1,SVP2,SVP3,SVPT0,EP1,EP2,KARMAN, &
ch(ims,j),vt1,vq1,qc1d,qcg(ims,j),itimestep, &
ZQT(ims,j),QCDRAG(ims,j), &
!JOE-begin additional output
z0zt_ratio(ims,j),BulkRi(ims,j),wstar(ims,j), &
qstar(ims,j),resist(ims,j),logres(ims,j), &
......@@ -365,6 +377,7 @@ CONTAINS
QSFC,LH,GZ1OZ0,WSPD,BR,ISFFLX,DX, &
SVP1,SVP2,SVP3,SVPT0,EP1,EP2, &
KARMAN,ch,vt1,vq1,qc1d,qcg,itimestep, &
ZQT,QCDRAG, &
!JOE-additional output
zratio,BRi,wstar,qstar,resist,logres, &
!JOE-end
......@@ -429,7 +442,8 @@ CONTAINS
WSPD, &
BR, &
PSIM,PSIH
REAL, DIMENSION( ims:ime ), INTENT(INOUT) :: ZQT
REAL, DIMENSION( ims:ime ), INTENT(OUT) :: QCDRAG
! DIAGNOSTIC OUTPUT
REAL, DIMENSION( ims:ime ), INTENT(OUT) :: U10,V10, &
TH2,T2,Q2
......@@ -480,8 +494,14 @@ CONTAINS
REAL :: FLUXC,VSGD
REAL :: restar,VISC,DQG,OLDUST,OLDTST
REAL, PARAMETER :: psilim = -10. ! ONLY AFFECTS z/L > 2.0
LOGICAL :: zqtexists
!-------------------------------------------------------------------
IF ( MAXVAL(ZQT) < 0 ) THEN
zqtexists = .FALSE.
ELSE
zqtexists = .TRUE.
ENDIF
DO I=its,ite
! CONVERT GROUND & LOWEST LAYER TEMPERATURE TO POTENTIAL TEMPERATURE:
! PSFC cmb
......@@ -702,29 +722,33 @@ CONTAINS
!--------------------------------------
!CHECK FOR SNOW/ICE POINTS OVER LAND
!IF ( ZNT(i) .LE. SNOWZ0 .AND. TSK(I) .LE. 273.15 ) THEN
IF ( SNOWH(i) .GE. 0.1) THEN
CALL Andreas_2002(ZNT(i),restar,z_t(i),z_q(i))
IF ( zqtexists ) THEN
z_t(i) = ZQT(i)
z_q(i) = ZQT(i)
ELSE
IF ( PRESENT(IZ0TLND) ) THEN
IF ( IZ0TLND .LE. 1 .OR. IZ0TLND .EQ. 4) THEN
!IF IZ0TLND==4, THEN PSIQ WILL BE RECALCULATED USING
!PAN ET AL (1994), but PSIT FROM ZILI WILL BE USED.
IF ( SNOWH(i) .GE. 0.1) THEN
CALL Andreas_2002(ZNT(i),restar,z_t(i),z_q(i))
ELSE
IF ( PRESENT(IZ0TLND) ) THEN
IF ( IZ0TLND .LE. 1 .OR. IZ0TLND .EQ. 4) THEN
!IF IZ0TLND==4, THEN PSIQ WILL BE RECALCULATED USING
!PAN ET AL (1994), but PSIT FROM ZILI WILL BE USED.
CALL zilitinkevich_1995(ZNT(i),z_t(i),z_q(i),restar,&
UST(I),KARMAN,XLAND(I),IZ0TLND)
ELSEIF ( IZ0TLND .EQ. 2 ) THEN
CALL Yang_2008(ZNT(i),z_t(i),z_q(i),UST(i),MOL(I),&
qstar(I),restar,visc,XLAND(I))
ELSEIF ( IZ0TLND .EQ. 3 ) THEN
!Original MYNN in WRF-ARW used this form:
CALL garratt_1992(z_t(i),z_q(i),ZNT(i),restar,XLAND(I))
ENDIF
ELSE
!DEFAULT TO ZILITINKEVICH
CALL zilitinkevich_1995(ZNT(i),z_t(i),z_q(i),restar,&
UST(I),KARMAN,XLAND(I),IZ0TLND)
ELSEIF ( IZ0TLND .EQ. 2 ) THEN
CALL Yang_2008(ZNT(i),z_t(i),z_q(i),UST(i),MOL(I),&
qstar(I),restar,visc,XLAND(I))
ELSEIF ( IZ0TLND .EQ. 3 ) THEN
!Original MYNN in WRF-ARW used this form:
CALL garratt_1992(z_t(i),z_q(i),ZNT(i),restar,XLAND(I))
UST(I),KARMAN,XLAND(I),0)
ENDIF
ELSE
!DEFAULT TO ZILITINKEVICH
CALL zilitinkevich_1995(ZNT(i),z_t(i),z_q(i),restar,&
UST(I),KARMAN,XLAND(I),0)
ENDIF
ENDIF
ENDIF
zratio(i)=znt(i)/z_t(i)
......@@ -1016,8 +1040,25 @@ CONTAINS
ENDDO ! end ITERATION-loop
!
! After the itration save the last Z_t value so that it can be saved.
! Different cases have to be differentiated :
! Over Oceans it is computed by one of the parametrization proposed by WRF.
! Over Land it can be provided by ORCHIDEE through ZQT or computed locally
! through on of WRFs parametrizatrions.
! Thus no need to replace it in this case.
!
IF((XLAND(I)-1.5).GE.0)THEN
ZQT(I) = z_t(I)
ELSE
IF ( zqtexists ) THEN
! Nothing to do
ELSE
ZQT(I) = z_t(I)
ENDIF
ENDIF
ENDDO ! end i-loop
1000 format(A,F6.1, A,f6.1, A,f5.1, A,f7.1)
1001 format(A,F2.0, A,f10.4,A,f5.3, A,f11.5)
1002 format(A,f7.2, A,f7.2, A,f7.2, A,f10.3)
......@@ -1105,10 +1146,12 @@ CONTAINS
HFX(I)=FLHC(I)*(THGB(I)-TH1D(I))
HFX(I)=MAX(HFX(I),-250.)
ENDIF
QCDRAG(I) = UST(I)*KARMAN/PSIT/WSPD(I)
!CHS(I)=UST(I)*KARMAN/(ALOG(KARMAN*UST(I)*ZA(I) &
! /XKA+ZA(I)/ZL)-PSIH(I))
CHS(I)=UST(I)*KARMAN/PSIT
! The exchange coefficient for cloud water is assumed to be the
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment