Skip to content

Commit

Permalink
Add on/off for checking equilibrium.
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangsp8 committed Nov 26, 2024
1 parent 85ef6cc commit 24a53ea
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 20 deletions.
47 changes: 27 additions & 20 deletions main/MOD_CheckEquilibrium.F90
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ MODULE MOD_CheckEquilibrium
USE MOD_NetCDFSerial
USE MOD_SpatialMapping
USE MOD_Vars_Global, only : spval
USE MOD_Namelist, only : DEF_CheckEquilibrium

! ----- Variables -----
integer :: numcheck
Expand Down Expand Up @@ -46,6 +47,8 @@ SUBROUTINE CheckEqb_init ()
USE MOD_LandPatch, only : numpatch, landpatch
IMPLICIT NONE

IF (.not. DEF_CheckEquilibrium) return

numcheck = -1

IF (p_is_worker) THEN
Expand Down Expand Up @@ -74,6 +77,8 @@ SUBROUTINE CheckEqb_final ()

IMPLICIT NONE

IF (.not. DEF_CheckEquilibrium) return

IF (allocated(tws_last)) deallocate(tws_last)
IF (allocated(tws_this)) deallocate(tws_this)
IF (allocated(prcp_acc)) deallocate(prcp_acc)
Expand All @@ -83,32 +88,34 @@ END SUBROUTINE CheckEqb_final
!---------------------------------------
SUBROUTINE CheckEquilibrium (idate, deltim, itstamp, dir_out, casename)

USE MOD_Precision
USE MOD_Namelist
USE MOD_TimeManager
USE MOD_DataType
USE MOD_LandPatch
USE MOD_Vars_1DForcing, only : forc_prc, forc_prl
USE MOD_Vars_TimeVariables, only : wa, wat, wdsrf
USE MOD_Precision
USE MOD_Namelist
USE MOD_TimeManager
USE MOD_DataType
USE MOD_LandPatch
USE MOD_Vars_1DForcing, only : forc_prc, forc_prl
USE MOD_Vars_TimeVariables, only : wa, wat, wdsrf

IMPLICIT NONE

IMPLICIT NONE
integer, intent(in) :: idate(3)
real(r8), intent(in) :: deltim
type(timestamp), intent(in) :: itstamp

integer, intent(in) :: idate(3)
real(r8), intent(in) :: deltim
type(timestamp), intent(in) :: itstamp
character(len=*), intent(in) :: dir_out
character(len=*), intent(in) :: casename

character(len=*), intent(in) :: dir_out
character(len=*), intent(in) :: casename
! Local variables
logical :: docheck
character(len=256) :: filename
integer :: ncid, time_id, varid

! Local variables
logical :: docheck
character(len=256) :: filename
integer :: ncid, time_id, varid
real(r8), allocatable :: pct_dtws (:)
logical, allocatable :: filter (:)
type(block_data_real8_2d) :: sumarea

real(r8), allocatable :: pct_dtws (:)
logical, allocatable :: filter (:)
type(block_data_real8_2d) :: sumarea

IF (.not. DEF_CheckEquilibrium) return

IF (p_is_worker) THEN
IF (numpatch > 0) THEN
Expand Down
5 changes: 5 additions & 0 deletions share/MOD_Namelist.F90
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,9 @@ MODULE MOD_Namelist
!Dynamic Lake model
logical :: DEF_USE_Dynamic_Lake = .false.

!
logical :: DEF_CheckEquilibrium = .false.

! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
! ----- Part 12: forcing -----
! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -907,6 +910,7 @@ SUBROUTINE read_namelist (nlfile)
DEF_USE_FIRE, & !add by Xingjie Lu @ sysu 2023/06/27

DEF_USE_Dynamic_Lake, & !add by Shupeng Zhang @ sysu 2024/09/12
DEF_CheckEquilibrium, & !add by Shupeng Zhang @ sysu 2024/11/26

DEF_LANDONLY, &
DEF_USE_DOMINANT_PATCHTYPE, &
Expand Down Expand Up @@ -1385,6 +1389,7 @@ SUBROUTINE read_namelist (nlfile)
CALL mpi_bcast (DEF_USE_FIRE ,1 ,mpi_logical ,p_address_master ,p_comm_glb ,p_err)

CALL mpi_bcast (DEF_USE_Dynamic_Lake ,1 ,mpi_logical ,p_address_master ,p_comm_glb ,p_err)
CALL mpi_bcast (DEF_CheckEquilibrium ,1 ,mpi_logical ,p_address_master ,p_comm_glb ,p_err)

CALL mpi_bcast (DEF_LANDONLY ,1 ,mpi_logical ,p_address_master ,p_comm_glb ,p_err)
CALL mpi_bcast (DEF_USE_DOMINANT_PATCHTYPE ,1 ,mpi_logical ,p_address_master ,p_comm_glb ,p_err)
Expand Down

0 comments on commit 24a53ea

Please sign in to comment.