Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Méso-NH code
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Méso-NH
Méso-NH code
Commits
a0962693
Commit
a0962693
authored
2 years ago
by
WURTZ Jean
Committed by
Jean Wurtz
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Jean Wurtz: Additionnal check for compartiment
parent
71621afc
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/SURFEX/init_bemn.F90
+42
-0
42 additions, 0 deletions
src/SURFEX/init_bemn.F90
with
42 additions
and
0 deletions
src/SURFEX/init_bemn.F90
+
42
−
0
View file @
a0962693
...
@@ -33,12 +33,14 @@
...
@@ -33,12 +33,14 @@
!! MODIFICATIONS
!! MODIFICATIONS
!! -------------
!! -------------
!! Original 04/2012
!! Original 04/2012
!! Jean Wurtz 05/2022 Adding check for compartment, initialization to 1 with 6 compartment cause invalid budget in BEM
!-------------------------------------------------------------------------------
!-------------------------------------------------------------------------------
!
!
!* 0. DECLARATIONS
!* 0. DECLARATIONS
! ------------
! ------------
!
!
!
!
USE
MODD_CSTS
,
ONLY
:
XSURF_EPSILON
USE
MODD_SURFEX_n
,
ONLY
:
TEB_GARDEN_MODEL_t
USE
MODD_SURFEX_n
,
ONLY
:
TEB_GARDEN_MODEL_t
USE
MODD_DATA_COVER_n
,
ONLY
:
DATA_COVER_t
USE
MODD_DATA_COVER_n
,
ONLY
:
DATA_COVER_t
!
!
...
@@ -89,6 +91,8 @@ CHARACTER(LEN=3) , INTENT(IN) :: HINIT ! choice of fields to initialize
...
@@ -89,6 +91,8 @@ CHARACTER(LEN=3) , INTENT(IN) :: HINIT ! choice of fields to initialize
!
!
INTEGER
::
JJ
! counter
INTEGER
::
JJ
! counter
INTEGER
::
JCOMP
! counter
INTEGER
::
JCOMP
! counter
INTEGER
::
JLIST
! counter
INTEGER
::
II
! counter
INTEGER
::
ILU
! sizes of TEB arrays
INTEGER
::
ILU
! sizes of TEB arrays
INTEGER
::
NDAY_SCHED
! Number of schedules for day of week
INTEGER
::
NDAY_SCHED
! Number of schedules for day of week
INTEGER
::
NCRE_SCHED
! Number of schedules per day
INTEGER
::
NCRE_SCHED
! Number of schedules per day
...
@@ -274,6 +278,44 @@ CASE("BEM")
...
@@ -274,6 +278,44 @@ CASE("BEM")
ENDDO
ENDDO
!
!
END
SELECT
END
SELECT
DO
JLIST
=
1
,
SIZE
(
B
%
XFRACOMP
,
1
)
!
! Check whether the individual compartment fractions by more than 1.0E-6 wrong
!
DO
II
=
1
,
SIZE
(
B
%
XFRACOMP
,
2
)
IF
((
B
%
XFRACOMP
(
JLIST
,
II
)
.LT.
-1.0E-6
)
.OR.
(
B
%
XFRACOMP
(
JLIST
,
II
)
.GT.
(
1.0+1.0E-6
)))
THEN
CALL
ABOR1_SFX
(
"INIT_BEMN: Wrong fraction of compartments"
)
ENDIF
ENDDO
!
! Very small deviations from 0.0 or 1.0 are corrected
!
WHERE
(
B
%
XFRACOMP
(
JLIST
,:)
.LT.
0.0
)
B
%
XFRACOMP
(
JLIST
,:)
=
0.0
ELSEWHERE
(
B
%
XFRACOMP
(
JLIST
,:)
.GT.
1.0
)
B
%
XFRACOMP
(
JLIST
,:)
=
1.0
ENDWHERE
!
! Check whether the sum is far from 1.0
!
IF
(
ABS
(
SUM
(
B
%
XFRACOMP
(
JLIST
,:))
-1.0
)
.GT.
1.0E-6
)
THEN
CALL
ABOR1_SFX
(
"INIT_BEMN : Wrong initial sum of compartment fractions, ensure usage are given if NCOMP>1"
)
ENDIF
!
! Renormalise the sum
!
B
%
XFRACOMP
(
JLIST
,:)
=
B
%
XFRACOMP
(
JLIST
,:)/
SUM
(
B
%
XFRACOMP
(
JLIST
,:))
!
! Check whether the renormalised sum is exactly 1.0
!
IF
(
ABS
(
SUM
(
B
%
XFRACOMP
(
JLIST
,:))
-1.0
)
.GT.
XSURF_EPSILON
)
THEN
CALL
ABOR1_SFX
(
"INIT_BEMN : Wrong final sum of compartment fractions, ensure usage are given if NCOMP>1"
)
ENDIF
!
ENDDO
!
!
!-------------------------------------------------------------------------------
!-------------------------------------------------------------------------------
!
!
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment