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
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
VIE Benoît
Méso-NH code
Commits
d426b6f3
Commit
d426b6f3
authored
6 months ago
by
WAUTELET Philippe
Browse files
Options
Downloads
Patches
Plain Diff
Philippe 03/09/2024: CBULIST_*: deallocate them when not enabled
parent
b076faf6
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/MNH/ini_budget.f90
+23
-15
23 additions, 15 deletions
src/MNH/ini_budget.f90
with
23 additions
and
15 deletions
src/MNH/ini_budget.f90
+
23
−
15
View file @
d426b6f3
!MNH_LIC Copyright 1995-202
3
CNRS, Meteo-France and Universite Paul Sabatier
!MNH_LIC Copyright 1995-202
4
CNRS, Meteo-France and Universite Paul Sabatier
!MNH_LIC This is part of the Meso-NH software governed by the CeCILL-C licence
!MNH_LIC This is part of the Meso-NH software governed by the CeCILL-C licence
!MNH_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt
!MNH_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt
!MNH_LIC for details. version 1.
!MNH_LIC for details. version 1.
...
@@ -4521,19 +4521,19 @@ end do SV_BUDGETS
...
@@ -4521,19 +4521,19 @@ end do SV_BUDGETS
call
Ini_budget_groups
(
tbudgets
,
ibudim1
,
ibudim2
,
ibudim3
)
call
Ini_budget_groups
(
tbudgets
,
ibudim1
,
ibudim2
,
ibudim3
)
if
(
tbudgets
(
NBUDGET_U
)
%
lenabled
)
call
Sourcelist_nml_compact
(
tbudgets
(
NBUDGET_U
),
cbulist_ru
)
call
Sourcelist_nml_compact
(
tbudgets
(
NBUDGET_U
),
cbulist_ru
)
if
(
tbudgets
(
NBUDGET_V
)
%
lenabled
)
call
Sourcelist_nml_compact
(
tbudgets
(
NBUDGET_V
),
cbulist_rv
)
call
Sourcelist_nml_compact
(
tbudgets
(
NBUDGET_V
),
cbulist_rv
)
if
(
tbudgets
(
NBUDGET_W
)
%
lenabled
)
call
Sourcelist_nml_compact
(
tbudgets
(
NBUDGET_W
),
cbulist_rw
)
call
Sourcelist_nml_compact
(
tbudgets
(
NBUDGET_W
),
cbulist_rw
)
if
(
tbudgets
(
NBUDGET_TH
)
%
lenabled
)
call
Sourcelist_nml_compact
(
tbudgets
(
NBUDGET_TH
),
cbulist_rth
)
call
Sourcelist_nml_compact
(
tbudgets
(
NBUDGET_TH
),
cbulist_rth
)
if
(
tbudgets
(
NBUDGET_TKE
)
%
lenabled
)
call
Sourcelist_nml_compact
(
tbudgets
(
NBUDGET_TKE
),
cbulist_rtke
)
call
Sourcelist_nml_compact
(
tbudgets
(
NBUDGET_TKE
),
cbulist_rtke
)
if
(
tbudgets
(
NBUDGET_RV
)
%
lenabled
)
call
Sourcelist_nml_compact
(
tbudgets
(
NBUDGET_RV
),
cbulist_rrv
)
call
Sourcelist_nml_compact
(
tbudgets
(
NBUDGET_RV
),
cbulist_rrv
)
if
(
tbudgets
(
NBUDGET_RC
)
%
lenabled
)
call
Sourcelist_nml_compact
(
tbudgets
(
NBUDGET_RC
),
cbulist_rrc
)
call
Sourcelist_nml_compact
(
tbudgets
(
NBUDGET_RC
),
cbulist_rrc
)
if
(
tbudgets
(
NBUDGET_RR
)
%
lenabled
)
call
Sourcelist_nml_compact
(
tbudgets
(
NBUDGET_RR
),
cbulist_rrr
)
call
Sourcelist_nml_compact
(
tbudgets
(
NBUDGET_RR
),
cbulist_rrr
)
if
(
tbudgets
(
NBUDGET_RI
)
%
lenabled
)
call
Sourcelist_nml_compact
(
tbudgets
(
NBUDGET_RI
),
cbulist_rri
)
call
Sourcelist_nml_compact
(
tbudgets
(
NBUDGET_RI
),
cbulist_rri
)
if
(
tbudgets
(
NBUDGET_RS
)
%
lenabled
)
call
Sourcelist_nml_compact
(
tbudgets
(
NBUDGET_RS
),
cbulist_rrs
)
call
Sourcelist_nml_compact
(
tbudgets
(
NBUDGET_RS
),
cbulist_rrs
)
if
(
tbudgets
(
NBUDGET_RG
)
%
lenabled
)
call
Sourcelist_nml_compact
(
tbudgets
(
NBUDGET_RG
),
cbulist_rrg
)
call
Sourcelist_nml_compact
(
tbudgets
(
NBUDGET_RG
),
cbulist_rrg
)
if
(
tbudgets
(
NBUDGET_RH
)
%
lenabled
)
call
Sourcelist_nml_compact
(
tbudgets
(
NBUDGET_RH
),
cbulist_rrh
)
call
Sourcelist_nml_compact
(
tbudgets
(
NBUDGET_RH
),
cbulist_rrh
)
if
(
lbu_rsv
)
call
Sourcelist_sv_nml_compact
(
cbulist_rsv
)
call
Sourcelist_sv_nml_compact
(
lbu_rsv
,
cbulist_rsv
)
end
subroutine
Ini_budget
end
subroutine
Ini_budget
...
@@ -5031,6 +5031,8 @@ subroutine Sourcelist_nml_compact( tpbudget, hbulist )
...
@@ -5031,6 +5031,8 @@ subroutine Sourcelist_nml_compact( tpbudget, hbulist )
if
(
Allocated
(
hbulist
)
)
Deallocate
(
hbulist
)
if
(
Allocated
(
hbulist
)
)
Deallocate
(
hbulist
)
if
(
.not.
tpbudget
%
lenabled
)
return
if
(
tpbudget
%
ngroups
<
3
)
then
if
(
tpbudget
%
ngroups
<
3
)
then
call
Print_msg
(
NVERB_ERROR
,
'BUD'
,
'Sourcelist_nml_compact'
,
'ngroups is too small'
)
call
Print_msg
(
NVERB_ERROR
,
'BUD'
,
'Sourcelist_nml_compact'
,
'ngroups is too small'
)
return
return
...
@@ -5066,18 +5068,24 @@ subroutine Sourcelist_nml_compact( tpbudget, hbulist )
...
@@ -5066,18 +5068,24 @@ subroutine Sourcelist_nml_compact( tpbudget, hbulist )
end
subroutine
Sourcelist_nml_compact
end
subroutine
Sourcelist_nml_compact
subroutine
Sourcelist_sv_nml_compact
(
hbulist
)
subroutine
Sourcelist_sv_nml_compact
(
oenabled
,
hbulist
)
!This subroutine reduce the size of the hbulist
!This subroutine reduce the size of the hbulist
!For SV variables the reduction is simpler than for other variables
!For SV variables the reduction is simpler than for other variables
!because it is too complex to do this cleanly (the enabled source terms are different for each scalar variable)
!because it is too complex to do this cleanly (the enabled source terms are different for each scalar variable)
use
modd_budget
,
only
:
NBULISTMAXLEN
,
tbudgetdata
use
modd_budget
,
only
:
NBULISTMAXLEN
,
tbudgetdata
logical
,
intent
(
in
)
::
oenabled
character
(
len
=*
),
dimension
(:),
allocatable
,
intent
(
inout
)
::
hbulist
character
(
len
=*
),
dimension
(:),
allocatable
,
intent
(
inout
)
::
hbulist
character
(
len
=
NBULISTMAXLEN
),
dimension
(:),
allocatable
::
ybulist_new
character
(
len
=
NBULISTMAXLEN
),
dimension
(:),
allocatable
::
ybulist_new
integer
::
ilines
integer
::
ilines
integer
::
ji
integer
::
ji
if
(
.not.
oenabled
)
then
if
(
allocated
(
hbulist
)
)
deallocate
(
hbulist
)
return
end
if
ilines
=
0
ilines
=
0
do
ji
=
1
,
Size
(
hbulist
)
do
ji
=
1
,
Size
(
hbulist
)
if
(
Len_trim
(
hbulist
(
ji
))
>
0
)
ilines
=
ilines
+
1
if
(
Len_trim
(
hbulist
(
ji
))
>
0
)
ilines
=
ilines
+
1
...
...
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