Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ACCORD/IAL changes to PHYEX in CY49T2 #55

Open
wants to merge 4 commits into
base: arome_474b516
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions aux/ini_phyex.F90
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
SUBROUTINE INI_PHYEX(HPROGRAM, KUNITNML, LDNEEDNAM, KLUOUT, KFROM, KTO, &
&PTSTEP, PDZMIN, &
&CMICRO, CSCONV, CTURB, &
&LDCHANGEMODEL, LDDEFAULTVAL, LDREADNAM, LDCHECK, KPRINT, LDINIT, &
&LDCHANGEMODEL, LDDEFAULTVAL, LDREADNAM, LDCHECK, &
&KPRINT, LDINIT, &
&PHYEX_IN, PHYEX_OUT)
!
USE MODD_PHYEX, ONLY: PHYEX_t
Expand Down Expand Up @@ -228,7 +229,7 @@ SUBROUTINE INI_PHYEX(HPROGRAM, KUNITNML, LDNEEDNAM, KLUOUT, KFROM, KTO, &
ENDIF

CALL TURBN_INIT(HPROGRAM, KUNITNML, LDNEEDNAM, KLUOUT, &
&LDDEFAULTVAL, LDREADNAM, LDCHECK, KPRINT)
&LDDEFAULTVAL=LDDEFAULTVAL, LDREADNAM=LDREADNAM, LDCHECK=LDCHECK,KPRINT=KPRINT)
IF(LLINIT) THEN
CALL INI_TURB(HPROGRAM)
ENDIF
Expand Down
8 changes: 4 additions & 4 deletions aux/modd_nsv.F90
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ MODULE MODD_NSV
LOGICAL :: LINI_NSV(JPMODELMAX) = .FALSE. ! becomes True when routine INI_NSV is called
!
CHARACTER(LEN=NMNHNAMELGTMAX), DIMENSION(:,:), ALLOCATABLE :: CSV_CHEM_LIST_A !Names of all the chemical variables
CHARACTER(LEN=6), DIMENSION(:,:), ALLOCATABLE :: CSV_A !Names of the scalar variables
CHARACTER(LEN=16), DIMENSION(:,:), ALLOCATABLE :: CSV_A !Names of the scalar variables
TYPE(tfieldmetadata), DIMENSION(:,:), ALLOCATABLE :: TSVLIST_A !Metadata of all the scalar variables

INTEGER,DIMENSION(JPMODELMAX)::NSV_A = 0 ! total number of scalar variables
Expand Down Expand Up @@ -167,7 +167,7 @@ MODULE MODD_NSV
! variables updated for the current model
!
CHARACTER(LEN=NMNHNAMELGTMAX), DIMENSION(:), POINTER :: CSV_CHEM_LIST !Names of all the chemical variables
CHARACTER(LEN=6), DIMENSION(:), POINTER :: CSV !Names of the scalar variables
CHARACTER(LEN=16), DIMENSION(:), POINTER :: CSV !Names of the scalar variables

TYPE(tfieldmetadata), DIMENSION(:), POINTER :: TSVLIST !Metadata of all the scalar variables

Expand Down Expand Up @@ -289,7 +289,7 @@ MODULE MODD_NSV
LOGICAL, POINTER :: LINI_NSV(:) => NULL()
!
CHARACTER(LEN=NMNHNAMELGTMAX), DIMENSION(:,:), POINTER :: CSV_CHEM_LIST_A => NULL()
CHARACTER(LEN=6), DIMENSION(:,:), POINTER :: CSV_A => NULL()
CHARACTER(LEN=16), DIMENSION(:,:), POINTER :: CSV_A => NULL()
TYPE(tfieldmetadata), DIMENSION(:,:), POINTER :: TSVLIST_A => NULL()

INTEGER, DIMENSION(:), POINTER ::NSV_A => NULL(), &
Expand Down Expand Up @@ -376,7 +376,7 @@ MODULE MODD_NSV
NSV_SNWEND_A => NULL()

CHARACTER(LEN=NMNHNAMELGTMAX), DIMENSION(:), POINTER :: CSV_CHEM_LIST => NULL()
CHARACTER(LEN=6), DIMENSION(:), POINTER :: CSV => NULL()
CHARACTER(LEN=16), DIMENSION(:), POINTER :: CSV => NULL()

TYPE(tfieldmetadata), DIMENSION(:), POINTER :: TSVLIST => NULL()

Expand Down
3 changes: 2 additions & 1 deletion aux/modi_ini_phyex.F90
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ MODULE MODI_INI_PHYEX
SUBROUTINE INI_PHYEX(HPROGRAM, KUNITNML, LDNEEDNAM, KLUOUT, KFROM, KTO, &
&PTSTEP, PDZMIN, &
&CMICRO, CSCONV, CTURB, &
&LDCHANGEMODEL, LDDEFAULTVAL, LDREADNAM, LDCHECK, KPRINT, LDINIT, &
&LDCHANGEMODEL, LDDEFAULTVAL, LDREADNAM, LDCHECK,&
&KPRINT, LDINIT, &
&PHYEX_IN, PHYEX_OUT)
!
USE MODD_PHYEX, ONLY: PHYEX_t
Expand Down
11 changes: 8 additions & 3 deletions conv/convect_chem_transport.F90
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ SUBROUTINE CONVECT_CHEM_TRANSPORT( CVPEXT, D, NSV, KCH, PCH1, PCH1C, &
INTEGER :: JI ! horizontal loop index
INTEGER :: JK, JKP ! vertical loop index
INTEGER :: JN ! chemical tracer loop index
INTEGER :: JCH
INTEGER :: JSTEP ! fractional time loop index
INTEGER :: JKLD, JKLP, JKMIN, JKMAX, JKMAX2 ! loop index for levels
!
Expand Down Expand Up @@ -212,7 +213,9 @@ SUBROUTINE CONVECT_CHEM_TRANSPORT( CVPEXT, D, NSV, KCH, PCH1, PCH1C, &
!* 4. Final closure (environmental) computations
! ------------------------------------------
!
PCH1C(D%NIB:D%NIE,IKB:IKE,1:KCH) = PCH1(D%NIB:D%NIE,IKB:IKE,1:KCH) ! initialize adjusted envir. values
DO JCH = 1, KCH
PCH1C(:,IKB:IKE,JCH) = PCH1(:,IKB:IKE,JCH) ! initialize adjusted envir. values
ENDDO
!
DO JK = IKB, IKE
DO JI=D%NIB,D%NIE
Expand All @@ -233,8 +236,10 @@ SUBROUTINE CONVECT_CHEM_TRANSPORT( CVPEXT, D, NSV, KCH, PCH1, PCH1C, &
ENDDO
ENDDO
!
ZCH1MFIN(D%NIB:D%NIE,1:D%NKT,1:KCH) = 0.
ZCH1MFOUT(D%NIB:D%NIE,1:D%NKT,1:KCH) = 0.
DO JCH = 1, KCH
ZCH1MFIN(:,1:D%NKT,JCH) = 0.
ZCH1MFOUT(:,1:D%NKT,JCH) = 0.
ENDDO
!
DO JSTEP = 1, KFTSTEPS ! Enter the fractional time step loop
!
Expand Down
26 changes: 19 additions & 7 deletions conv/convect_closure.F90
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ SUBROUTINE CONVECT_CLOSURE( KLON, KLEV, &
REAL, DIMENSION(KLON,KLEV), INTENT(INOUT):: PDTEVRF! downdraft evaporation rate
REAL, DIMENSION(KLON,KLEV), INTENT(OUT) :: PPRLFLX! liquid precip flux
REAL, DIMENSION(KLON,KLEV), INTENT(OUT) :: PPRSFLX! solid precip flux

!
!* 0.2 Declarations of local variables :
!
Expand All @@ -156,6 +157,7 @@ SUBROUTINE CONVECT_CLOSURE( KLON, KLEV, &
INTEGER :: JITER ! iteration loop index
INTEGER :: JSTEP ! fractional time loop index
REAL :: ZCPORD, ZRDOCP ! C_pd / R_d, R_d / C_pd
REAL :: ZEPS
!
REAL, DIMENSION(KLON,KLEV) :: ZTHLC ! convectively adjusted
! grid scale enthalpy
Expand Down Expand Up @@ -203,14 +205,15 @@ SUBROUTINE CONVECT_CLOSURE( KLON, KLEV, &
LOGICAL, DIMENSION(KLON) :: GWORK1, GWORK3! work arrays
LOGICAL, DIMENSION(KLON,KLEV) :: GWORK4 ! work array
!
REAL(KIND=JPHOOK) :: ZHOOK_HANDLE
!
#include "convect_closure_thrvlcl.h"
!-------------------------------------------------------------------------------
!
!* 0.2 Initialize local variables
! ----------------------------
!
!
REAL(KIND=JPHOOK) :: ZHOOK_HANDLE
IF (LHOOK) CALL DR_HOOK('CONVECT_CLOSURE',0,ZHOOK_HANDLE)
PSPR(:) = 0.
ZTIMC(:,:) = 0.
Expand All @@ -225,6 +228,7 @@ SUBROUTINE CONVECT_CLOSURE( KLON, KLEV, &
GWORK4(:,:) = .FALSE.
ILCL(:) = KLCL(:)
!
ZEPS = XRD / XRV
ZCPORD = XCPD / XRD
ZRDOCP = XRD / XCPD
!
Expand Down Expand Up @@ -545,10 +549,11 @@ SUBROUTINE CONVECT_CLOSURE( KLON, KLEV, &
! that in routine TRIGGER_FUNCT
! ---------------------------------------------
!
CALL CONVECT_CLOSURE_THRVLCL( KLON, KLEV, &
PPRES, PTHC, PRWC, PZ, GWORK1, &
ZTHLCL, ZRVLCL, ZZLCL, ZTLCL, ZTELCL, &
ILCL, KDPL, KPBL )
CALL ABOR1('FIXME: THE INTERFACE IS WRONG')
!CALL CONVECT_CLOSURE_THRVLCL( KLON, KLEV, &
!PPRES, PTHC, PRWC, PZ, GWORK1, &
!ZTHLCL, ZRVLCL, ZZLCL, ZTLCL, ZTELCL, &
!ILCL, KDPL, KPBL )
!
!
ZTLCL(:) = MAX( 230., MIN( 335., ZTLCL(:) ) ) ! set some overflow bounds
Expand All @@ -565,7 +570,9 @@ SUBROUTINE CONVECT_CLOSURE( KLON, KLEV, &
ZPI(:) = MAX( 0.95, MIN( 1.5, ZPI(:) ) )
ZWORK1(:) = XP00 / ZPI(:) ** ZCPORD ! pressure at LCL
!
CALL CONVECT_SATMIXRATIO( KLON, ZWORK1, ZTELCL, ZWORK3, ZLV, ZLS, ZCPH )
DO JI = 1, IIE
CALL CONVECT_SATMIXRATIO( ZWORK1(JI), ZTELCL(JI), ZEPS, ZWORK3(JI), ZLV(JI), ZLS(JI), ZCPH(JI) )
END DO
ZWORK3(:) = MIN( .1, MAX( 0., ZWORK3(:) ) )
!
! compute theta_e updraft undilute
Expand Down Expand Up @@ -593,7 +600,9 @@ SUBROUTINE CONVECT_CLOSURE( KLON, KLEV, &
ZWORK2(JI) = PTHC(JI,JK) / ZPI(JI)
END DO
!
CALL CONVECT_SATMIXRATIO( KLON, PPRES(:,JK), ZWORK2, ZWORK3, ZLV, ZLS, ZCPH )
DO JI = 1, IIE
CALL CONVECT_SATMIXRATIO( PPRES(JI,JK), ZWORK2(JI), ZEPS, ZWORK3(JI), ZLV(JI), ZLS(JI), ZCPH(JI) )
END DO
!
!
DO JI = 1, IIE
Expand Down Expand Up @@ -659,4 +668,7 @@ SUBROUTINE CONVECT_CLOSURE( KLON, KLEV, &
!
!
IF (LHOOK) CALL DR_HOOK('CONVECT_CLOSURE',1,ZHOOK_HANDLE)
CONTAINS
INCLUDE "convect_satmixratio.h"
!
END SUBROUTINE CONVECT_CLOSURE
14 changes: 7 additions & 7 deletions conv/convect_closure_adjust_shal.F90
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,13 @@ SUBROUTINE CONVECT_CLOSURE_ADJUST_SHAL( CVPEXT, D, PADJ, &
! specified degree of stabilization
! ----------------------------------------------------
!
DO JK = IKB + 1, IKE
DO JI = D%NIB, D%NIE
PUMF(JI,JK) = PZUMF(JI,JK) * PADJ(JI)
PUER(JI,JK) = PZUER(JI,JK) * PADJ(JI)
PUDR(JI,JK) = PZUDR(JI,JK) * PADJ(JI)
ENDDO
END DO
DO JK = IKB + 1, IKE
DO JI = D%NIB, D%NIE
PUMF(JI,JK) = PZUMF(JI,JK) * PADJ(JI)
PUER(JI,JK) = PZUER(JI,JK) * PADJ(JI)
PUDR(JI,JK) = PZUDR(JI,JK) * PADJ(JI)
ENDDO
END DO
!
IF (LHOOK) CALL DR_HOOK('CONVECT_CLOSURE_ADJUST_SHAL',1,ZHOOK_HANDLE)
END SUBROUTINE CONVECT_CLOSURE_ADJUST_SHAL
Loading