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
07c07eb7
Commit
07c07eb7
authored
9 years ago
by
WAUTELET Philippe
Browse files
Options
Downloads
Patches
Plain Diff
lfi2cdf: new option: "-s or --split" to split the variables in different files
WARNING: not yet implemented! (the option is just recognized)
parent
40b96f8a
No related branches found
Branches containing commit
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
-2
2 additions, 2 deletions
tools/lfi2cdf/src/lfi2cdf.f90
tools/lfi2cdf/src/newmain.c
+16
-4
16 additions, 4 deletions
tools/lfi2cdf/src/newmain.c
with
18 additions
and
6 deletions
tools/lfi2cdf/src/lfi2cdf.f90
+
2
−
2
View file @
07c07eb7
subroutine
LFI2CDFMAIN
(
hinfile
,
iiflen
,
ooutname
,
houtfile
,
ioflen
,
hvarlist
,
ivlen
,
olfi2cdf
,
olfilist
,
ohdf5
,
omerge
,
nb_levels
,&
subroutine
LFI2CDFMAIN
(
hinfile
,
iiflen
,
ooutname
,
houtfile
,
ioflen
,
hvarlist
,
ivlen
,
olfi2cdf
,
olfilist
,
ohdf5
,
omerge
,
nb_levels
,&
oreduceprecision
,
ocompress
,
compress_level
)
oreduceprecision
,
osplit
,
ocompress
,
compress_level
)
USE
mode_util
USE
mode_util
IMPLICIT
NONE
IMPLICIT
NONE
INTEGER
::
iiflen
,
ioflen
,
ivlen
INTEGER
::
iiflen
,
ioflen
,
ivlen
...
@@ -7,7 +7,7 @@ subroutine LFI2CDFMAIN(hinfile,iiflen,ooutname,houtfile,ioflen,hvarlist,ivlen,o
...
@@ -7,7 +7,7 @@ subroutine LFI2CDFMAIN(hinfile,iiflen,ooutname,houtfile,ioflen,hvarlist,ivlen,o
CHARACTER
(
LEN
=
iiflen
)
::
hinfile
CHARACTER
(
LEN
=
iiflen
)
::
hinfile
CHARACTER
(
LEN
=
ioflen
)
::
houtfile
CHARACTER
(
LEN
=
ioflen
)
::
houtfile
CHARACTER
(
LEN
=
ivlen
)
::
hvarlist
CHARACTER
(
LEN
=
ivlen
)
::
hvarlist
LOGICAL
::
ooutname
,
olfi2cdf
,
olfilist
,
ohdf5
,
omerge
,
oreduceprecision
,
ocompress
LOGICAL
::
ooutname
,
olfi2cdf
,
olfilist
,
ohdf5
,
omerge
,
oreduceprecision
,
osplit
,
ocompress
INTEGER
::
compress_level
INTEGER
::
compress_level
INTEGER
::
ibuflen
INTEGER
::
ibuflen
...
...
This diff is collapsed.
Click to expand it.
tools/lfi2cdf/src/newmain.c
+
16
−
4
View file @
07c07eb7
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
#define BUFSIZE 4096
#define BUFSIZE 4096
extern
lfi2cdfmain_
(
char
*
,
int
*
,
int
*
,
char
*
,
int
*
,
char
*
,
int
*
,
int
*
,
int
*
,
int
*
,
int
*
,
int
*
,
int
*
,
int
*
,
int
*
);
extern
lfi2cdfmain_
(
char
*
,
int
*
,
int
*
,
char
*
,
int
*
,
char
*
,
int
*
,
int
*
,
int
*
,
int
*
,
int
*
,
int
*
,
int
*
,
int
*
,
int
*
,
int
*
);
char
*
cleancomma
(
char
*
varlist
)
char
*
cleancomma
(
char
*
varlist
)
{
{
...
@@ -34,6 +34,7 @@ int main(int argc, char **argv)
...
@@ -34,6 +34,7 @@ int main(int argc, char **argv)
int
reduceprecision_flag
;
int
reduceprecision_flag
;
int
outname_flag
;
int
outname_flag
;
int
compress_flag
,
compress_level
;
int
compress_flag
,
compress_level
;
int
split_flag
;
char
*
cmd
,
*
infile
;
char
*
cmd
,
*
infile
;
int
c
;
int
c
;
char
buff
[
BUFSIZE
];
char
buff
[
BUFSIZE
];
...
@@ -72,11 +73,12 @@ int main(int argc, char **argv)
...
@@ -72,11 +73,12 @@ int main(int argc, char **argv)
{
"merge"
,
required_argument
,
0
,
'm'
},
{
"merge"
,
required_argument
,
0
,
'm'
},
{
"output"
,
required_argument
,
0
,
'o'
},
{
"output"
,
required_argument
,
0
,
'o'
},
{
"reduce-precision"
,
no_argument
,
0
,
'r'
},
{
"reduce-precision"
,
no_argument
,
0
,
'r'
},
{
"split"
,
no_argument
,
0
,
's'
},
{
"var"
,
required_argument
,
0
,
'v'
},
{
"var"
,
required_argument
,
0
,
'v'
},
{
0
,
0
,
0
,
0
}
{
0
,
0
,
0
,
0
}
};
};
c
=
getopt_long
(
argc
,
argv
,
"4c:lm:o:rv:"
,
c
=
getopt_long
(
argc
,
argv
,
"4c:lm:o:r
s
v:"
,
long_options
,
&
option_index
);
long_options
,
&
option_index
);
if
(
c
==
-
1
)
if
(
c
==
-
1
)
break
;
break
;
...
@@ -114,6 +116,9 @@ int main(int argc, char **argv)
...
@@ -114,6 +116,9 @@ int main(int argc, char **argv)
case
'r'
:
case
'r'
:
reduceprecision_flag
=
1
;
reduceprecision_flag
=
1
;
break
;
break
;
case
's'
:
split_flag
=
1
;
break
;
case
'v'
:
case
'v'
:
if
(
l2c_flag
)
{
if
(
l2c_flag
)
{
lenopt
=
strlen
(
optarg
);
lenopt
=
strlen
(
optarg
);
...
@@ -135,7 +140,7 @@ int main(int argc, char **argv)
...
@@ -135,7 +140,7 @@ int main(int argc, char **argv)
}
}
if
(
optind
==
argc
)
{
if
(
optind
==
argc
)
{
printf
(
"usage : lfi2cdf [--cdf4 -4] [-l] [-v --var var1[,...]] [-r --reduce-precision] [-m --merge number_of_z_levels] [-o --output output-file.nc] [-c --compress compression_level] input-file.lfi
\n
"
);
printf
(
"usage : lfi2cdf [--cdf4 -4] [-l] [-v --var var1[,...]] [-r --reduce-precision] [-m --merge number_of_z_levels]
[-s --split]
[-o --output output-file.nc] [-c --compress compression_level] input-file.lfi
\n
"
);
printf
(
" cdf2lfi [-o --output output-file.lfi] input-file.nc
\n
"
);
printf
(
" cdf2lfi [-o --output output-file.lfi] input-file.nc
\n
"
);
exit
(
EXIT_FAILURE
);
exit
(
EXIT_FAILURE
);
}
}
...
@@ -178,8 +183,15 @@ int main(int argc, char **argv)
...
@@ -178,8 +183,15 @@ int main(int argc, char **argv)
infile, ilen, outfile, olen, varlist, varlistlen);
infile, ilen, outfile, olen, varlist, varlistlen);
*/
*/
/* Split flag only supported if -v is set */
if
(
varlistlen
==
0
)
{
split_flag
=
0
;
printf
(
"Warning: split option is forced to disable.
\n
"
);
}
lfi2cdfmain_
(
infile
,
&
ilen
,
&
outname_flag
,
outfile
,
&
olen
,
varlist
,
&
varlistlen
,
&
l2c_flag
,
&
list_flag
,
&
hdf5_flag
,
&
merge_flag
,
lfi2cdfmain_
(
infile
,
&
ilen
,
&
outname_flag
,
outfile
,
&
olen
,
varlist
,
&
varlistlen
,
&
l2c_flag
,
&
list_flag
,
&
hdf5_flag
,
&
merge_flag
,
&
nb_levels
,
&
reduceprecision_flag
,
&
compress_flag
,
&
compress_level
);
&
nb_levels
,
&
reduceprecision_flag
,
&
split_flag
,
&
compress_flag
,
&
compress_level
);
exit
(
EXIT_SUCCESS
);
exit
(
EXIT_SUCCESS
);
}
}
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