source: CPL/oasis3/trunk/src/mod/oasis3/src/inilun.f @ 1677

Last change on this file since 1677 was 1677, checked in by aclsce, 12 years ago

Imported oasis3 (tag ipslcm5a) from cvs server to svn server (igcmg project).

File size: 4.7 KB
Line 
1      SUBROUTINE inilun
2C****
3C               *****************************
4C               * OASIS ROUTINE  -  LEVEL 0 *
5C               * -------------     ------- *
6C               *****************************
7C
8C**** *inilun*  - Initialize logical unit numbers
9C
10C     Purpose:
11C     -------
12C     Creates and prints logical unit numbers used to deal with
13C     grids, masks and surfaces files as well as anais-related files
14C
15C**   Interface:
16C     ---------
17C       *CALL*  *inilun*
18C
19C     Input:
20C     -----
21C     None
22C
23C     Output:
24C     ------
25C     None
26C
27C     Workspace:
28C     ---------
29C     None
30C
31C     Externals:
32C     ---------
33C     None
34C
35C     Reference:
36C     ---------
37C     See OASIS manual (1995) 
38C
39C     History:
40C     -------
41C       Version   Programmer     Date      Description
42C       -------   ----------     ----      ----------- 
43C       1.0       L. Terray      94/01/01  created
44C       2.0       L. Terray      95/08/23  modified: new structure
45C       2.2       L. Terray      97/10/10  added: unit nudum for SVIPC
46C       2.3       S. Valcke      99/03/30  added: unit nulgn for NINENN
47C       2.3       S. Valcke      99/04/30  added: printing levels
48C
49C %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
50C
51C* ---------------- Include files and USE of modules---------------------------
52C
53      USE mod_parameter
54      USE mod_string
55      USE mod_unit
56      USE mod_printing
57      USE mod_hardware
58C
59C* ---------------------------- Poema verses ----------------------------
60C
61C %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
62C
63C*    1. Assign unit numbers and initialize comlun
64C        -----------------------------------------
65C
66C* First we open output file for coupler
67C
68      IF (nlogprt .GE. 1) THEN
69          WRITE (UNIT = nulou,FMT = *) ' '
70          WRITE (UNIT = nulou,FMT = *) ' '
71          WRITE (UNIT = nulou,FMT = *) 
72     $    '           ROUTINE inilun  -  Level 0'
73          WRITE (UNIT = nulou,FMT = *) 
74     $    '           **************     *******'
75          WRITE (UNIT = nulou,FMT = *) ' '
76          WRITE (UNIT = nulou,FMT = *) 
77     $    ' Set up logical unit numbers'
78          WRITE (UNIT = nulou,FMT = *) ' '
79      ENDIF
80C
81C* If there is no field going through Oasis then assign only the trace file 
82C  unit for CLIM
83      IF (.not. lg_oasis_field) THEN
84         nultr = 7
85         IF (nlogprt .GE. 1)
86     $        WRITE (UNIT = nulou,FMT = *)'Trace file unit for CLIM :',
87     $        nultr
88      ELSE
89C* Grids file
90         nulgr = 11
91C* Masks file
92         nulma = 12
93C* Surfaces file
94         nulsu = 13
95C* File for reduced grid masks
96         nulrd = 14
97C* Trace file for CLIM and PVM
98         nultr = 7
99C* Output file for ANAIS interpolation
100         nulan = 8
101C* Dummy file for SVIPC library
102         nudum = 9
103C* Anaism weights file
104         nulcc = 16
105C* Anaisg weights file
106         nulgg = 17
107C* NINENN weight and address file
108         nulgn = 18
109C     
110C     
111C*    2. Print comlun
112C        ------------
113C     
114         IF (nlogprt .GE. 1) THEN
115            WRITE (UNIT = nulou,FMT ='(
116     $           '' nulin ='',i3,'' nulou ='',i3,
117     $           '' nulgr ='',i3,'' nulma ='',i3,
118     $           '' nulsu ='',i3,'' nultr ='',i3,   
119     $           '' nulcc ='',i3,'' nulgg ='',i3,'' nulgn ='',i3,
120     $           '' nulan ='',i3,'' nulrd ='',i3,'' nudum ='',i3,/)')
121     $           nulin, nulou, nulgr, nulma, nulsu, 
122     $           nultr, nulcc, nulgg, nulgn, nulan, nulrd, nudum
123         ENDIF
124C     
125C     
126C     
127C*    3. Assign unit numbers to input and output binary files
128C        ----------------------------------------------------
129C     
130         nluinp(1)=21
131         DO 310 jf = 2, ig_nfield
132            isamefic=0
133            DO 320 jj = 1, jf-1
134               IF (cficinp(jf) .eq. cficinp(jj)) THEN
135                  isamefic=1
136                  nluinp(jf) = nluinp(jj)
137               ENDIF
138 320        CONTINUE
139            IF (isamefic .lt. 1) nluinp(jf) = 20 + jf
140 310     CONTINUE
141C     
142C*    For PIPE technique only
143C     
144         IF (cchan. eq. 'PIPE' .or. cchan. eq. 'NONE') THEN
145            nluout(1)=21 + ig_nfield
146            DO 330 jf = 2, ig_nfield
147               DO 340 jj = 1, jf-1
148                  IF(cficout(jf) .eq. cficout(jj)) THEN
149                     nluout(jf) = nluout(jj)
150                  ELSE
151                     nluout(jf) = 20 + ig_nfield + jf
152                  ENDIF
153 340           CONTINUE
154 330        CONTINUE
155         ENDIF
156      ENDIF
157C
158C*     4. End of routine
159C         --------------
160C
161      IF (nlogprt .GE. 1) THEN
162          WRITE (UNIT = nulou,FMT = *) ' '
163          WRITE (UNIT = nulou,FMT = *) 
164     $    '          --------- End of routine inilun ---------'
165          CALL FLUSH (nulou)
166      ENDIF
167      RETURN
168      END
169
170
171
172
173
174
Note: See TracBrowser for help on using the repository browser.