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
df87f6e9
Commit
df87f6e9
authored
9 years ago
by
WAUTELET Philippe
Browse files
Options
Downloads
Patches
Plain Diff
lfi2cdf: open and close files in separate subroutines in all cases (cleaner)
parent
40df5cc0
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tools/lfi2cdf/src/lfi2cdf.f90
+2
-8
2 additions, 8 deletions
tools/lfi2cdf/src/lfi2cdf.f90
tools/lfi2cdf/src/mode_util.f90
+29
-0
29 additions, 0 deletions
tools/lfi2cdf/src/mode_util.f90
with
31 additions
and
8 deletions
tools/lfi2cdf/src/lfi2cdf.f90
+
2
−
8
View file @
df87f6e9
...
@@ -19,9 +19,6 @@ subroutine LFI2CDFMAIN(hinfile,iiflen,ooutname,houtfile,ioflen,hvarlist,ivlen,o
...
@@ -19,9 +19,6 @@ subroutine LFI2CDFMAIN(hinfile,iiflen,ooutname,houtfile,ioflen,hvarlist,ivlen,o
INTEGER
::
nbvar_tbw
! number of variables to be written
INTEGER
::
nbvar_tbw
! number of variables to be written
INTEGER
::
nbvar
! number of defined variables
INTEGER
::
nbvar
! number of defined variables
INTEGER
::
first_level
,
current_level
,
last_level
INTEGER
::
first_level
,
current_level
,
last_level
INTEGER
(
KIND
=
LFI_INT
)
::
iresp
,
iverb
,
inap
CHARACTER
(
LEN
=
3
)
::
suffix
CHARACTER
(
LEN
=
iiflen
)
::
filename
TYPE
(
cdf_files
)
::
cdffiles
TYPE
(
cdf_files
)
::
cdffiles
TYPE
(
workfield
),
DIMENSION
(:),
POINTER
::
tzreclist
TYPE
(
workfield
),
DIMENSION
(:),
POINTER
::
tzreclist
...
@@ -87,7 +84,6 @@ subroutine LFI2CDFMAIN(hinfile,iiflen,ooutname,houtfile,ioflen,hvarlist,ivlen,o
...
@@ -87,7 +84,6 @@ subroutine LFI2CDFMAIN(hinfile,iiflen,ooutname,houtfile,ioflen,hvarlist,ivlen,o
ELSE
ELSE
!Treat several LFI files and merge into 1 NC file
!Treat several LFI files and merge into 1 NC file
iverb
=
0
!Verbosity level for LFI
!Determine first level (eg needed to find suffix of the variable name)
!Determine first level (eg needed to find suffix of the variable name)
read
(
hinfile
(
len
(
hinfile
)
-6
:
len
(
hinfile
)
-4
)
,
"(I3)"
)
first_level
read
(
hinfile
(
len
(
hinfile
)
-6
:
len
(
hinfile
)
-4
)
,
"(I3)"
)
first_level
...
@@ -103,13 +99,11 @@ subroutine LFI2CDFMAIN(hinfile,iiflen,ooutname,houtfile,ioflen,hvarlist,ivlen,o
...
@@ -103,13 +99,11 @@ subroutine LFI2CDFMAIN(hinfile,iiflen,ooutname,houtfile,ioflen,hvarlist,ivlen,o
DO
current_level
=
first_level
,
last_level
DO
current_level
=
first_level
,
last_level
print
*
,
'Treating level '
,
current_level
print
*
,
'Treating level '
,
current_level
IF
(
current_level
/
=
first_level
)
THEN
IF
(
current_level
/
=
first_level
)
THEN
write
(
suffix
,
'(I3.3)'
)
current_level
CALL
open_split_lfifile
(
ilu
,
hinfile
,
current_level
)
filename
=
hinfile
(
1
:
len
(
hinfile
)
-7
)//
suffix
//
'.lfi'
CALL
LFIOUV
(
iresp
,
ilu
,
ltrue
,
filename
,
'OLD'
,
lfalse
,
lfalse
,
iverb
,
inap
,
nbvar_lfi
)
CALL
read_data_lfi
(
ilu
,
hvarlist
,
nbvar
,
tzreclist
,
ibuflen
,
current_level
)
CALL
read_data_lfi
(
ilu
,
hvarlist
,
nbvar
,
tzreclist
,
ibuflen
,
current_level
)
END
IF
END
IF
CALL
fill_ncdf
(
ilu
,
tzreclist
,
nbvar
,
ibuflen
,
cdffiles
,
current_level
)
CALL
fill_ncdf
(
ilu
,
tzreclist
,
nbvar
,
ibuflen
,
cdffiles
,
current_level
)
IF
(
current_level
/
=
last_level
)
CALL
LFIFER
(
iresp
,
ilu
,
'KEEP'
)
IF
(
current_level
/
=
last_level
)
CALL
close_split_lfifile
(
ilu
)
END
DO
END
DO
END
IF
END
IF
...
...
This diff is collapsed.
Click to expand it.
tools/lfi2cdf/src/mode_util.f90
+
29
−
0
View file @
df87f6e9
...
@@ -1006,6 +1006,27 @@ print *,'lowmem: not tested!!!!!' (to be compared with no low mem version)
...
@@ -1006,6 +1006,27 @@ print *,'lowmem: not tested!!!!!' (to be compared with no low mem version)
END
SUBROUTINE
OPEN_FILES
END
SUBROUTINE
OPEN_FILES
SUBROUTINE
OPEN_SPLIT_LFIFILE
(
ilu
,
hinfile
,
current_level
)
INTEGER
,
INTENT
(
IN
)
::
ilu
CHARACTER
(
LEN
=*
),
INTENT
(
IN
)
::
hinfile
INTEGER
,
INTENT
(
IN
)
::
current_level
INTEGER
(
KIND
=
LFI_INT
)
::
iresp
,
iverb
,
inap
,
nbvar
CHARACTER
(
LEN
=
3
)
::
suffix
CHARACTER
(
LEN
=
:),
ALLOCATABLE
::
filename
iverb
=
0
!Verbosity level for LFI
ALLOCATE
(
character
(
len
=
len
(
hinfile
))
::
filename
)
write
(
suffix
,
'(I3.3)'
)
current_level
filename
=
hinfile
(
1
:
len
(
hinfile
)
-7
)//
suffix
//
'.lfi'
CALL
LFIOUV
(
iresp
,
ilu
,
ltrue
,
filename
,
'OLD'
,
lfalse
,
lfalse
,
iverb
,
inap
,
nbvar
)
DEALLOCATE
(
filename
)
END
SUBROUTINE
OPEN_SPLIT_LFIFILE
SUBROUTINE
OPEN_SPLIT_NCFILES
(
houtfile
,
nbvar
,
tpreclist
,
cdffiles
,
ohdf5
)
SUBROUTINE
OPEN_SPLIT_NCFILES
(
houtfile
,
nbvar
,
tpreclist
,
cdffiles
,
ohdf5
)
CHARACTER
(
LEN
=*
),
INTENT
(
IN
)
::
houtfile
CHARACTER
(
LEN
=*
),
INTENT
(
IN
)
::
houtfile
INTEGER
,
INTENT
(
IN
)
::
nbvar
INTEGER
,
INTENT
(
IN
)
::
nbvar
...
@@ -1073,4 +1094,12 @@ print *,'lowmem: not tested!!!!!' (to be compared with no low mem version)
...
@@ -1073,4 +1094,12 @@ print *,'lowmem: not tested!!!!!' (to be compared with no low mem version)
END
SUBROUTINE
CLOSE_files
END
SUBROUTINE
CLOSE_files
SUBROUTINE
CLOSE_SPLIT_LFIFILE
(
ilu
)
INTEGER
,
INTENT
(
IN
)
::
ilu
INTEGER
(
KIND
=
LFI_INT
)
::
iresp
CALL
LFIFER
(
iresp
,
ilu
,
'KEEP'
)
END
SUBROUTINE
CLOSE_SPLIT_LFIFILE
END
MODULE
mode_util
END
MODULE
mode_util
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