Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libcdi
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mpim-sw
libcdi
Commits
24238647
Commit
24238647
authored
13 years ago
by
Deike Kleberg
Browse files
Options
Downloads
Patches
Plain Diff
Testprogram collectData2003.F90.
parent
72d01c1f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
.gitattributes
+1
-0
1 addition, 0 deletions
.gitattributes
pioExamples/Makefile.am
+5
-1
5 additions, 1 deletion
pioExamples/Makefile.am
pioExamples/Makefile.in
+33
-4
33 additions, 4 deletions
pioExamples/Makefile.in
pioExamples/collectData2003.F90
+115
-0
115 additions, 0 deletions
pioExamples/collectData2003.F90
with
154 additions
and
5 deletions
.gitattributes
+
1
−
0
View file @
24238647
...
...
@@ -149,6 +149,7 @@ pioExamples/cdi_write_more_nodes.job -text
pioExamples/cdi_write_parallel.job -text
pioExamples/cdi_write_serial.job -text
pioExamples/collectData.c -text
pioExamples/collectData2003.F90 -text
pioExamples/compareResourcesArray.c -text
pioExamples/myModel.c -text
pioExamples/myModel2003.F90 -text
...
...
This diff is collapsed.
Click to expand it.
pioExamples/Makefile.am
+
5
−
1
View file @
24238647
noinst_PROGRAMS
=
collectData
noinst_PROGRAMS
=
collectData
collectData2003
if
USE_MPI
noinst_PROGRAMS
+=
compareResourcesArray
...
...
@@ -10,6 +10,10 @@ collectData_SOURCES=collectData.c
collectData_LDADD
=
-L
../src
-lcdi
collectData2003_SOURCES
=
collectData2003.F90
collectData2003_LDADD
=
-L
../src
-lcdi
compareResourcesArray_SOURCES
=
compareResourcesArray.c
compareResourcesArray_LDADD
=
-L
../src
-lcdi
\ No newline at end of file
This diff is collapsed.
Click to expand it.
pioExamples/Makefile.in
+
33
−
4
View file @
24238647
...
...
@@ -34,7 +34,8 @@ PRE_UNINSTALL = :
POST_UNINSTALL
=
:
build_triplet
=
@build@
host_triplet
=
@host@
noinst_PROGRAMS
=
collectData
$(
EXEEXT
)
$(
am__EXEEXT_1
)
noinst_PROGRAMS
=
collectData
$(
EXEEXT
)
collectData2003
$(
EXEEXT
)
\
$(
am__EXEEXT_1
)
@USE_MPI_TRUE@
am__append_1
=
compareResourcesArray
subdir
=
pioExamples
DIST_COMMON
=
README
$(
srcdir
)
/Makefile.am
$(
srcdir
)
/Makefile.in
...
...
@@ -62,6 +63,9 @@ PROGRAMS = $(noinst_PROGRAMS)
am_collectData_OBJECTS
=
collectData.
$(
OBJEXT
)
collectData_OBJECTS
=
$(
am_collectData_OBJECTS
)
collectData_DEPENDENCIES
=
am_collectData2003_OBJECTS
=
collectData2003.
$(
OBJEXT
)
collectData2003_OBJECTS
=
$(
am_collectData2003_OBJECTS
)
collectData2003_DEPENDENCIES
=
am_compareResourcesArray_OBJECTS
=
compareResourcesArray.
$(
OBJEXT
)
compareResourcesArray_OBJECTS
=
$(
am_compareResourcesArray_OBJECTS
)
compareResourcesArray_DEPENDENCIES
=
...
...
@@ -69,6 +73,15 @@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src
depcomp
=
$(
SHELL
)
$(
top_srcdir
)
/config/depcomp
am__depfiles_maybe
=
depfiles
am__mv
=
mv
-f
PPFCCOMPILE
=
$(
FC
)
$(
DEFS
)
$(
DEFAULT_INCLUDES
)
$(
INCLUDES
)
\
$(
AM_CPPFLAGS
)
$(
CPPFLAGS
)
$(
AM_FCFLAGS
)
$(
FCFLAGS
)
LTPPFCCOMPILE
=
$(
LIBTOOL
)
--tag
=
FC
$(
AM_LIBTOOLFLAGS
)
$(
LIBTOOLFLAGS
)
\
--mode
=
compile
$(
FC
)
$(
DEFS
)
$(
DEFAULT_INCLUDES
)
$(
INCLUDES
)
\
$(
AM_CPPFLAGS
)
$(
CPPFLAGS
)
$(
AM_FCFLAGS
)
$(
FCFLAGS
)
FCLD
=
$(
FC
)
FCLINK
=
$(
LIBTOOL
)
--tag
=
FC
$(
AM_LIBTOOLFLAGS
)
$(
LIBTOOLFLAGS
)
\
--mode
=
link
$(
FCLD
)
$(
AM_FCFLAGS
)
$(
FCFLAGS
)
$(
AM_LDFLAGS
)
\
$(
LDFLAGS
)
-o
$@
COMPILE
=
$(
CC
)
$(
DEFS
)
$(
DEFAULT_INCLUDES
)
$(
INCLUDES
)
$(
AM_CPPFLAGS
)
\
$(
CPPFLAGS
)
$(
AM_CFLAGS
)
$(
CFLAGS
)
LTCOMPILE
=
$(
LIBTOOL
)
--tag
=
CC
$(
AM_LIBTOOLFLAGS
)
$(
LIBTOOLFLAGS
)
\
...
...
@@ -78,8 +91,10 @@ CCLD = $(CC)
LINK
=
$(
LIBTOOL
)
--tag
=
CC
$(
AM_LIBTOOLFLAGS
)
$(
LIBTOOLFLAGS
)
\
--mode
=
link
$(
CCLD
)
$(
AM_CFLAGS
)
$(
CFLAGS
)
$(
AM_LDFLAGS
)
\
$(
LDFLAGS
)
-o
$@
SOURCES
=
$(
collectData_SOURCES
)
$(
compareResourcesArray_SOURCES
)
DIST_SOURCES
=
$(
collectData_SOURCES
)
$(
compareResourcesArray_SOURCES
)
SOURCES
=
$(
collectData_SOURCES
)
$(
collectData2003_SOURCES
)
\
$(
compareResourcesArray_SOURCES
)
DIST_SOURCES
=
$(
collectData_SOURCES
)
$(
collectData2003_SOURCES
)
\
$(
compareResourcesArray_SOURCES
)
ETAGS
=
etags
CTAGS
=
ctags
DISTFILES
=
$(
DIST_COMMON
)
$(
DIST_SOURCES
)
$(
TEXINFOS
)
$(
EXTRA_DIST
)
...
...
@@ -256,12 +271,14 @@ top_srcdir = @top_srcdir@
AM_CFLAGS
=
-I
$(
top_srcdir
)
/src
collectData_SOURCES
=
collectData.c
collectData_LDADD
=
-L
../src
-lcdi
collectData2003_SOURCES
=
collectData2003.F90
collectData2003_LDADD
=
-L
../src
-lcdi
compareResourcesArray_SOURCES
=
compareResourcesArray.c
compareResourcesArray_LDADD
=
-L
../src
-lcdi
all
:
all-am
.SUFFIXES
:
.SUFFIXES
:
.c .lo .o .obj
.SUFFIXES
:
.F90
.c .lo .o .obj
$(srcdir)/Makefile.in
:
@MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@
for
dep
in
$?
;
do
\
case
'
$(
am__configure_deps
)
'
in
\
...
...
@@ -304,6 +321,9 @@ clean-noinstPROGRAMS:
collectData$(EXEEXT)
:
$(collectData_OBJECTS) $(collectData_DEPENDENCIES)
@
rm
-f
collectData
$(
EXEEXT
)
$(
LINK
)
$(
collectData_OBJECTS
)
$(
collectData_LDADD
)
$(
LIBS
)
collectData2003$(EXEEXT)
:
$(collectData2003_OBJECTS) $(collectData2003_DEPENDENCIES)
@
rm
-f
collectData2003
$(
EXEEXT
)
$(
FCLINK
)
$(
collectData2003_OBJECTS
)
$(
collectData2003_LDADD
)
$(
LIBS
)
compareResourcesArray$(EXEEXT)
:
$(compareResourcesArray_OBJECTS) $(compareResourcesArray_DEPENDENCIES)
@
rm
-f
compareResourcesArray
$(
EXEEXT
)
$(
LINK
)
$(
compareResourcesArray_OBJECTS
)
$(
compareResourcesArray_LDADD
)
$(
LIBS
)
...
...
@@ -317,6 +337,15 @@ distclean-compile:
@AMDEP_TRUE@@am__include@
@am__quote@./$(DEPDIR)/collectData.Po@am__quote@
@AMDEP_TRUE@@am__include@
@am__quote@./$(DEPDIR)/compareResourcesArray.Po@am__quote@
.F90.o
:
$(
PPFCCOMPILE
)
-c
-o
$@
$<
.F90.obj
:
$(
PPFCCOMPILE
)
-c
-o
$@
`
$(
CYGPATH_W
)
'$<'
`
.F90.lo
:
$(
LTPPFCCOMPILE
)
-c
-o
$@
$<
.c.o
:
@am__fastdepCC_TRUE@
$(COMPILE)
-MT
$@
-MD
-MP
-MF
$(DEPDIR)/$*.Tpo
-c
-o
$@
$<
@am__fastdepCC_TRUE@
$(am__mv)
$(DEPDIR)/$*.Tpo
$(DEPDIR)/$*.Po
...
...
This diff is collapsed.
Click to expand it.
pioExamples/collectData2003.F90
0 → 100644
+
115
−
0
View file @
24238647
PROGRAM
COLLECTDATA2003
USE
iso_c_binding
IMPLICIT
NONE
INCLUDE
'cdi.inc'
#ifdef USE_MPI
INCLUDE
'mpif.h'
#endif
INTEGER
nlon
,
nlat
,
nlev
,
nts
PARAMETER
(
nlon
=
12
)
! Number of longitudes
PARAMETER
(
nlat
=
6
)
! Number of latitudes
PARAMETER
(
nlev
=
5
)
! Number of levels
PARAMETER
(
nts
=
3
)
! Number of time steps
INTEGER
gridID
,
zaxisID1
,
zaxisID2
,
taxisID
INTEGER
vlistID
,
varID1
,
varID2
,
streamID
,
tsID
INTEGER
i
,
nmiss
,
status
INTEGER
pioComm
,
rank
,
error
DOUBLE PRECISION
lons
(
nlon
),
lats
(
nlat
),
levs
(
nlev
)
DOUBLE PRECISION
var1
(
nlon
*
nlat
),
var2
(
nlon
*
nlat
*
nlev
)
CHARACTER
(
len
=
256
)
::
varname
DATA
lons
/
0
,
30
,
60
,
90
,
120
,
150
,
180
,
210
,
240
,
270
,
300
,
330
/
DATA
lats
/
-75
,
-45
,
-15
,
15
,
45
,
75
/
DATA
levs
/
101300
,
92500
,
85000
,
50000
,
20000
/
#ifdef USE_MPI
CALL
MPI_INIT
(
error
)
CALL
MPI_COMM_DUP
(
MPI_COMM_WORLD
,
pioComm
,
error
)
CALL
MPI_COMM_RANK
(
pioComm
,
rank
,
error
)
#endif
nmiss
=
0
! Create a regular lon/lat grid
gridID
=
gridCreate
(
GRID_LONLAT
,
nlon
*
nlat
)
CALL
gridDefXsize
(
gridID
,
nlon
)
CALL
gridDefYsize
(
gridID
,
nlat
)
CALL
gridDefXvals
(
gridID
,
lons
)
CALL
gridDefYvals
(
gridID
,
lats
)
! Create a surface level Z-axis
zaxisID1
=
zaxisCreate
(
ZAXIS_SURFACE
,
1
)
! Create a pressure level Z-axis
zaxisID2
=
zaxisCreate
(
ZAXIS_PRESSURE
,
nlev
)
CALL
zaxisDefLevels
(
zaxisID2
,
levs
)
! Create a variable list
vlistID
=
vlistCreate
()
! Define the variables
varID1
=
vlistDefVar
(
vlistID
,
gridID
,
zaxisID1
,
TIME_VARIABLE
)
varID2
=
vlistDefVar
(
vlistID
,
gridID
,
zaxisID2
,
TIME_VARIABLE
)
! Define the variable names
varname
=
"varname1"
CALL
vlistDefVarName
(
vlistID
,
varID1
,
TRIM
(
varname
)//
C_NULL_CHAR
)
CALL
vlistDefVarName
(
vlistID
,
varID2
,
C_CHAR_"varname2"
//
C_NULL_CHAR
)
! Create a Time axis
taxisID
=
taxisCreate
(
TAXIS_ABSOLUTE
)
! Assign the Time axis to the variable list
CALL
vlistDefTaxis
(
vlistID
,
taxisID
)
! Create a dataset in netCDF fromat
streamID
=
streamOpenWrite
(
C_CHAR_"example.grb"
//
C_NULL_CHAR
,
FILETYPE_GRB
)
IF
(
streamID
<
0
)
THEN
WRITE
(
0
,
*
)
cdiStringError
(
streamID
)
STOP
END
IF
! Assign the variable list to the dataset
CALL
streamDefVlist
(
streamID
,
vlistID
)
! Loop over the number of time steps
DO
tsID
=
0
,
nts
-1
! Set the verification date to 1985-01-01 + tsID
CALL
taxisDefVdate
(
taxisID
,
19850101
+
tsID
)
! Set the verification time to 12:00:00
CALL
taxisDefVtime
(
taxisID
,
120000
)
! Define the time step
status
=
streamDefTimestep
(
streamID
,
tsID
)
! Init var1 and var2
DO
i
=
1
,
nlon
*
nlat
var1
(
i
)
=
1.1
END
DO
DO
i
=
1
,
nlon
*
nlat
*
nlev
var2
(
i
)
=
2.2
END
DO
! Write var1 and var2
CALL
streamWriteVar
(
streamID
,
varID1
,
var1
,
nmiss
)
CALL
streamWriteVar
(
streamID
,
varID2
,
var2
,
nmiss
)
END
DO
! Close the output stream
CALL
streamClose
(
streamID
)
! Destroy the objects
CALL
vlistDestroy
(
vlistID
)
CALL
taxisDestroy
(
taxisID
)
CALL
zaxisDestroy
(
zaxisID1
)
CALL
zaxisDestroy
(
zaxisID2
)
CALL
gridDestroy
(
gridID
)
#ifdef USE_MPI
CALL
MPI_FINALIZE
(
error
)
#endif
END
PROGRAM
COLLECTDATA2003
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