TreeMig Code
Loading...
Searching...
No Matches
OpenAndWriteHeader.f90
Go to the documentation of this file.
1!==============================================================================
2!
3! Name : OpenAndWriteHeader
4!
5! Remarks: contains the SUBROUTINES
6!
7! OpenAndWriteHeader, OpenAndWriteHeaderLight
8!
9!==============================================================================
10! design : H. Lischke, N. Zimmermann
11! author(s) : H. Lischke, N. Zimmermann
12! implementation : H. Lischke, N. Zimmermann
13! cleaner : T.J. Loeffler
14! copyright : (c) 1999, 03 by H. Lischke
15!==============================================================================
16!==============================================================================
37!==============================================================================
38
39SUBROUTINE openandwriteheader(theFile, nspc)
41 use loggermodule
42 use all_par, only: tabsepoutput, spec
43
44 IMPLICIT NONE
45
46 ! Passed variables>--------------------------------------------------------------------------------
47 INTEGER, INTENT(in) :: nspc
48 TYPE(file), INTENT(in) :: theFile
49 ! Local variables>---------------------------------------------------------------------------------
50 INTEGER :: ispec, err
51 Character*1 :: tab
52
53 ! ere the SUBROUTINE starts>**********************************************************************
54 if (tabsepoutput) then
55 tab = char(9)
56 else
57 tab = ','
58 end if
59 call openfilew(thefile, err)
60 if (err /= 0) then
61 call logerror("Could not create file: "//thefile%path)
62 end if
63 write (thefile%unit, 100) "lat", tab, "lon", tab, "year", tab, &
64 ((spec(ispec)%nl), tab, ispec=1, nspc), "all_species"
65100 FORMAT(a3, a1, a3, a1, a4, a1, 58(a, a1))
66end SUBROUTINE openandwriteheader
67
68!==============================================================================
86!==============================================================================
87SUBROUTINE openandwriteheaderlight(theFile)
89 use loggermodule, only: logerror
90 ! CALL modules for TYPE definitions and +- fixed variables>---------------------------------------------------------------
91 use all_par, only: tabsepoutput, maxlc
92
93 IMPLICIT NONE
94
95 ! Passed variables>--------------------------------------------------------------------------------
96
97 TYPE(file), INTENT(in) :: theFile
98 ! Local variables>---------------------------------------------------------------------------------
99 INTEGER :: err, ilc
100 Character*1 :: tab
101 character*2 :: lclcharvec (maxlc)
102
103
104 ! Here the SUBROUTINE starts>**********************************************************************
105 if (tabsepoutput) then
106 tab = char(9)
107 else
108 tab = ','
109 end if
110 call openfilew(thefile, err)
111 if (err /= 0) then
112 call logerror("Could not create file: "//thefile%path)
113 end if
114 do ilc = 1,maxlc
115 write(lclcharvec(ilc),"(I2.2)") ilc
116 end do
117
118 write (thefile%unit, 100) "lat", tab, "lon", tab, "year", tab, "h_cl", tab,&
119 ("l_cl"//lclcharvec(ilc), tab, ilc=1, maxlc)
120100 FORMAT(a3, a1, a3, a1, a4, a1, a4, a1, 40(a, a1))
121end SUBROUTINE openandwriteheaderlight
122
123!done
subroutine openandwriteheaderlight(thefile)
OpenAndWriteHeaderLight
subroutine openandwriteheader(thefile, nspc)
OpenAndWriteHeader
type(specproperties), dimension(maxspc) spec
Definition All_par.f90:345
integer, parameter maxlc
Definition All_par.f90:100
real, dimension(5) a1
Definition All_par.f90:130
logical tabsepoutput
Definition All_par.f90:89
subroutine openfilew(thefile, err)
openFileW
LoggerModule.
subroutine logerror(msg)
LogError