Skip to content

Commit 8ddb33c

Browse files
committed
checks on temperature spikes in ADD_INCS
1 parent 4780721 commit 8ddb33c

File tree

1 file changed

+48
-8
lines changed

1 file changed

+48
-8
lines changed

DynCore_GridCompMod.F90

Lines changed: 48 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ Module FVdycoreCubed_GridComp
6666
type(ESMF_FieldBundle), save :: bundleAdv
6767
integer :: NXQ = 0
6868
logical :: overwrite_Q = .true.
69+
logical :: DEBUG_TQ_ERRORS
6970

7071
public SetServices ! Register component methods
7172

@@ -2613,6 +2614,9 @@ Subroutine SetServices ( gc, rc )
26132614
call MAPL_GetResource ( MAPL, DEBUG_ADV, 'DEBUG_ADV:', default=.FALSE., rc=status )
26142615
VERIFY_(STATUS)
26152616

2617+
call MAPL_GetResource ( MAPL, DEBUG_TQ_ERRORS, 'DEBUG_TQ_ERRORS:', default=.FALSE., rc=status )
2618+
VERIFY_(STATUS)
2619+
26162620
! Generic SetServices
26172621
!--------------------
26182622

@@ -3895,7 +3899,7 @@ subroutine Run(gc, import, export, clock, rc)
38953899
! -----------------------
38963900
delpold = delp ! Old Pressure Thickness
38973901

3898-
call ADD_INCS ( STATE,IMPORT,DT,IS_WEIGHTED=IS_WEIGHTED )
3902+
call ADD_INCS ( MAPL,STATE,IMPORT,DT,IS_WEIGHTED=IS_WEIGHTED )
38993903

39003904
if (DYN_DEBUG) call DEBUG_FV_STATE('ANA ADD_INCS',STATE)
39013905

@@ -6628,7 +6632,7 @@ subroutine RunAddIncs(gc, import, export, clock, rc)
66286632
! Add Diabatic Forcing to State Variables
66296633
! ---------------------------------------
66306634
call MAPL_TimerOn (GENSTATE,"PHYS_ADD_INCS")
6631-
call ADD_INCS ( STATE,IMPORT,DT )
6635+
call ADD_INCS ( GENSTATE,STATE,IMPORT,DT )
66326636
call MAPL_TimerOff(GENSTATE,"PHYS_ADD_INCS")
66336637

66346638

@@ -6693,9 +6697,9 @@ subroutine RunAddIncs(gc, import, export, clock, rc)
66936697

66946698
tempxy = vars%pt * vars%pkz ! Dry Temperature
66956699

6696-
#if defined(DEBUG_T)
6697-
call Write_Profile(grid, tempxy, 'T')
6698-
#endif
6700+
!#if defined(DEBUG_T)
6701+
! call Write_Profile(grid, tempxy, 'T')
6702+
!#endif
66996703

67006704
if (DEBUG_DYN) then
67016705
call MAPL_MaxMin('DYN: Q_AF_INC ', qv)
@@ -7205,7 +7209,7 @@ subroutine RunAddIncs(gc, import, export, clock, rc)
72057209
end subroutine RunAddIncs
72067210

72077211
!-----------------------------------------------------------------------
7208-
subroutine ADD_INCS ( STATE,IMPORT,DT,IS_WEIGHTED,RC )
7212+
subroutine ADD_INCS ( MAPL,STATE,IMPORT,DT,IS_WEIGHTED,RC )
72097213

72107214
use fms_mod, only: set_domain, nullify_domain
72117215
use fv_diagnostics_mod, only: prt_maxmin
@@ -7214,6 +7218,7 @@ subroutine ADD_INCS ( STATE,IMPORT,DT,IS_WEIGHTED,RC )
72147218
!
72157219
! !INPUT PARAMETERS:
72167220

7221+
type (MAPL_MetaComp) :: MAPL
72177222
type(DynState), pointer :: STATE
72187223
type(ESMF_State), intent(INOUT) :: IMPORT
72197224
real(FVPRC), intent(IN ) :: DT
@@ -7230,6 +7235,7 @@ subroutine ADD_INCS ( STATE,IMPORT,DT,IS_WEIGHTED,RC )
72307235
integer :: status
72317236
logical :: is_weighted_
72327237

7238+
integer :: II, JJ, I, J, L
72337239
integer :: is ,ie , js ,je , km
72347240
integer :: isd,ied, jsd,jed
72357241
real(r4), allocatable :: fvQOLD(:,:,:), QTEND(:,:,:)
@@ -7242,6 +7248,9 @@ subroutine ADD_INCS ( STATE,IMPORT,DT,IS_WEIGHTED,RC )
72427248

72437249
real(kind=4), pointer :: tend(:,:,:)
72447250

7251+
real, pointer, dimension(:,:) :: LONS
7252+
real, pointer, dimension(:,:) :: LATS
7253+
72457254
type(DynTracers) :: qqq ! Specific Humidity
72467255
real(FVPRC), allocatable :: Q(:,:,:,:), CVM(:,:,:)
72477256
integer :: n, nwat_tracers, nwat, sphum, liq_wat, ice_wat, rainwat, snowwat, graupel
@@ -7272,6 +7281,9 @@ subroutine ADD_INCS ( STATE,IMPORT,DT,IS_WEIGHTED,RC )
72727281
jsd = state%grid%jsd
72737282
jed = state%grid%jed
72747283

7284+
call MAPL_Get( MAPL, LONS=LONS, LATS=LATS, RC=STATUS )
7285+
VERIFY_(STATUS)
7286+
72757287
! **********************************************************************
72767288
! **** Use QV from FV3 init when coldstarting idealized cases ****
72777289
! **********************************************************************
@@ -7447,8 +7459,6 @@ subroutine ADD_INCS ( STATE,IMPORT,DT,IS_WEIGHTED,RC )
74477459

74487460
DEALLOCATE( tend_ua )
74497461
DEALLOCATE( tend_va )
7450-
DEALLOCATE( tend_un )
7451-
DEALLOCATE( tend_vn )
74527462

74537463
! **********************************************************************
74547464
! **** Compute Old Pressure Thickness ****
@@ -7537,6 +7547,36 @@ subroutine ADD_INCS ( STATE,IMPORT,DT,IS_WEIGHTED,RC )
75377547
STATE%VARS%PT = (STATE%VARS%PT + DT*TEND*(MAPL_CP/CVM))/DPNEW
75387548
endif
75397549

7550+
if (DEBUG_TQ_ERRORS) then
7551+
do L=1,KM
7552+
do J=js,je
7553+
do I=is,ie
7554+
if (STATE%VARS%PT(I,J,L) > 333.0) then
7555+
print *, "Temperature spike detected : ", STATE%VARS%PT(I,J,L)
7556+
print *, " Total Physics Increment : ", (DT*TEND(I,J,L)*(MAPL_CP/CVM(I,J,L)))/DPNEW(I,J,L)
7557+
print *, " IN ADD_INCS inside DYN "
7558+
II=I-is+1
7559+
JJ=J-js+1
7560+
print *, " Latitude =", LATS(II,JJ)*180.0/MAPL_PI
7561+
print *, " Longitude =", LONS(II,JJ)*180.0/MAPL_PI
7562+
print *, " Pressure (mb) =", 0.5*(STATE%VARS%PE(I,J,L+1)+STATE%VARS%PE(I,J,L))/100.0
7563+
7564+
print *, " UWND =", STATE%VARS%U(I,J,L), " UINC =", DT*TEND_UN(I,J,L)
7565+
print *, " VWND =", STATE%VARS%V(I,J,L), " VINC =", DT*TEND_VN(I,J,L)
7566+
if (nwat >= 6) then
7567+
print *, " QV=", Q(I,J,L,sphum ), " QL=", Q(I,J,L,liq_wat), " QI=", Q(I,J,L,ice_wat)
7568+
print *, " QR=", Q(I,J,L,rainwat), " QS=", Q(I,J,L,snowwat), " QG=", Q(I,J,L,graupel)
7569+
end if
7570+
endif
7571+
end do ! IM loop
7572+
end do ! JM loop
7573+
end do ! LM loop
7574+
endif
7575+
7576+
DEALLOCATE( tend_un )
7577+
DEALLOCATE( tend_vn )
7578+
7579+
75407580
! Update PKZ from hydrostatic pressures
75417581
! This isn't entirely necessary, FV3 overwrites this in fv_dynamics
75427582
! but we have to get back to PT here

0 commit comments

Comments
 (0)