source: CPL/oasis3/trunk/src/mod/oasis3/src/couple.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: 17.1 KB
Line 
1      PROGRAM couple
2C=====================================================================C
3C                                                                     C
4C                 ####     ##     ####     #     ####                 C
5C                #    #   #  #   #         #    #                     C
6C                #    #  #    #   ####     #     ####                 C
7C                #    #  ######       #    #         #                C
8C                #    #  #    #  #    #    #    #    #                C
9C                 ####   #    #   ####     #     ####                 C
10C                                                                     C
11C=====================================================================C
12C                                                                     C
13C            Ocean Atmosphere Sea Ice Soil Simulation Software        C 
14C                          -- VERSION 3_prism_2-3 --                  C
15C                                                                     C
16C MAIN CONTRIBUTORS: S. VALCKE, A. CAUBEL, R. VOGELSANG. D. DECLAT    C
17C                                                                     C
18C THIS VERSION WAS DEVELOPED UNDER THE EU FP6 PRISM PROJECT           C
19C CONTRACT NO: EVR1-CT-2001-40012-PRISM                               C
20C                                                                     C
21C              CLIMATE MODELLING AND GLOBAL CHANGE TEAM               C
22C                            C.E.R.F.A.C.S                            C
23C                      42, Ave. Gustave Coriolis                      C
24C                        31057  TOULOUSE CEDEX                        C
25C                              FRANCE                                 C
26C                                                                     C
27C=====================================================================C
28C                                                                     C
29C CONTACT SOPHIE VALCKE                                               C
30C             Email: oasishelp@cerfacs.fr Tel:(33)5.61.19.30.76       C
31C                                                                     C
32C   WITH QUESTIONS OR COMMENTS CONCERNING THIS SOFTWARE               C
33C                                                                     C
34C                                                                     C
35C=====================================================================C
36C                                                                     C
37C Reference for this software is:                                     C
38C S. Valcke, A. Caubel, R. Vogelsang, D. Declat, 2004,                C 
39C OASIS3 Ocean Atmosphere Sea Ice Soil User's Guide,                  C
40C Technical Report TR/CMGC/04/68, CERFACS, Toulouse, France           C
41C=====================================================================C
42C                                                                     C
43C Copyright © 2004 Centre Europeen de Recherche et Formation          C
44C Avancee en Calcul Scientifique (CERFACS).                           C
45C                                                                     C
46C This software and ancillary information called OASIS3 is free       C
47C software.  CERFACS has rights to use, reproduce, and distribute     C
48C OASIS3. The public may copy, distribute, use, prepare derivative    C
49C works and                                                           C
50C publicly display OASIS3 under the terms of the Lesser GNU General   C
51C Public License (LGPL) as published by the Free Software Foundation, C
52C provided that this notice and any statement of authorship are       C
53C reproduced on all copies. If OASIS3 is modified to produce          C
54C derivative works, such modified software should be clearly marked,  C
55C so as not to confuse it with the OASIS3 version available           C
56C from CERFACS.                                                       C
57C                                                                     C
58C The developers of the OASIS3 software are researchers attempting to C
59C build a modular and user-friendly coupler accessible to the climate C
60C modelling community. Although we use the tool ourselves and have    C
61C made every effort to ensure its accuracy, we can not make any       C
62C guarantees. We provide the software to you for free. In return, you C     
63C --the user--assume full responsibility for use of the software. The C
64C OASIS3 software comes without any warranties (implied or expressed) C
65C and is not guaranteed to work for you or on your computer.          C
66C Specifically,                                                       C
67C CERFACS and the various individuals involved in development and     C
68C maintenance of the OASIS3 software are not responsible for any      C
69C damage                                                              C
70C that may result from correct or incorrect use of this software.     C
71C                                                                     C
72C=====================================================================C
73C   V1.0 (2/94) IS THE ORIGINAL VERSION OF THIS SOFTWARE              C
74C   ***********                                                       C
75C                                                                     C
76C The OASIS software allows coupling of General Circulation Models of C
77C the Atmosphere and the Ocean (AGCM and OGCM).                       C
78C                                                                     C
79C---------------------------------------------------------------------C
80C   V1.1 (8/94) includes the following changes:                       C
81C   ***********                                                       C
82C                                                                     C
83C - Bug corrected for interpolation in fscint package near poles:     C
84C   different treatment for scalar and vector.                        C
85C   P. Braconnot, O. Marti, L. Terray                                 C
86C                                                                     C
87C - Extension of Z grids incorporated in fscint package.              C
88C   P. Braconnot, O. Marti, L. Terray                                 C
89C                                                                     C
90C - Bug corrected in prtfld routine in case nmode = 1,2 due to non    C
91C   initialized variables not taken care of by namelist options.      C
92C   L. Fairhead, L. Terray                                            C
93C                                                                     C
94C - Bug corrected in routines naflux, qlflux (argument list mismatch) C
95C   L. Terray                                                         C
96C                                                                     C
97C - Addition of fluxes to force a sea-ice model.                      C
98C   L. Terray, G. Garric                                              C
99C                                                                     C
100C - Sea-ice extent can be prescribed from climatology or read from    C
101C   ogcm + sea-ice model.                                             C
102C   L. Terray                                                         C
103C                                                                     C
104C - Adding of the no-interpolation case.                              C
105C   L. Terray                                                         C
106C                                                                     C
107C - Global flux conservation implemented.                             C
108C   L. Terray                                                         C
109C---------------------------------------------------------------------C
110C   V2.0 (1/96) is a major enhancement of the software.               C
111C   ***********                                                       C
112C                                                                     C
113C New main features are as follows:                                   C
114C                                                                     C
115C - Distributed computing allowed (Use of CLIM library based on PVM). C
116C                                                                     C
117C - Dynamic definition of coupling fields.                            C
118C                                                                     C
119C - Choice of the time coupling strategy.                             C
120C                                                                     C
121C - Binary format to transfer coupling fields.                        C
122C                                                                     C
123C - Workstation version.                                              C
124C                                                                     C
125C - And much more... (See manual for details).                        C
126C                                                                     C
127C---------------------------------------------------------------------C
128C   V2.2 (1/98) has some new interesting features:                    C
129C                                                                     C
130C - a new communication technique based on Sytem V shared memory      C
131C   segments developed by S.Saarinen (ECMWF)                          C
132C                                                                     C
133C - new extrapolation method                                          C
134C                                                                     C
135C - mode "interpolator only"                                          C
136C                                                                     C
137C - possibility to have an extended header for the coupling fields    C
138C                                                                     C
139C - new memory allocation in fscint package (with F90 features)       C
140C                                                                     C
141C - atmosphere and ocean toys provided with full environment for the  C
142C   pipe and svipc techniques                                         C
143C                                                                     C
144C The code has been successfully run on various platforms:            C
145C Crays (C90, J90, T3E), VPPs (300, 700), SGIs (Origin 200, 2000) ... C
146C The portability on NEC machines is currently being investigated     C
147C                                                                     C
148C---------------------------------------------------------------------C
149C   V2.3 (10/99) has some new features:                               C
150C                                                                     C
151C - a new communication technique for NEC machines which is based on  C
152C   the global memory concept                                         C
153C                                                                     C
154C - optimization of the extrapolation package                         C
155C                                                                     C
156C - introduction of several printing levels for oasis output file     C
157C                                                                     C
158C - new definition of gaussian grids                                  C
159C                                                                     C
160C - new definition of grid periodicity                                C
161C                                                                     C
162C - bugs correction: fscint, fiasco, leap years etc ...               C
163C
164C---------------------------------------------------------------------C
165C   V2.4 (05/2k) new features:                                        C
166C                                                                     C
167C - the possibility of using MPI2 as message passing library within   C
168C   the CLIM communication technique                                  C
169C                                                                     C
170C - the possibility of using the GMEM technique to couple a           C
171C   MPI parallel model                                                C     
172C                                                                     C
173C---------------------------------------------------------------------C
174C  V3 prism_1-2 (09/03) see User's Guide                              C
175C                                                                     C
176C---------------------------------------------------------------------C
177C  V3 prism_2-2 (06/04) see User's Guide                              C
178C                                                                     C
179C---------------------------------------------------------------------C
180C  V3 prism_2-3 (07/04) see User's Guide                              C
181C                                                                     C
182C---------------------------------------------------------------------C
183C=====================================================================C
184C                                                                     C
185C                ####     ##     ####      #     ####                 C
186C               #    #   #  #   #          #    #                     C
187C               #    #  #    #   ####      #     ####                 C
188C               #    #  ######       #     #         #                C
189C               #    #  #    #  #    #     #    #    #                C
190C                ####   #    #   ####      #     ####                 C
191C                                                                     C
192C=====================================================================C
193C
194C %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
195C
196C* ---------------------------- Include files ---------------------------
197C
198      USE mod_unit
199C
200C* ---------------------------- Poema verses ----------------------------
201C
202C %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
203C
204C*    1. Open main output file for OASIS coupler.
205C        ----------------------------------------
206C
207C* First we open output file connected to unit nulou = 6
208C
209      nulou = 6
210      iost = 0
211      OPEN (UNIT = nulou,FILE ='cplout',STATUS='UNKNOWN',
212     $      FORM ='FORMATTED',ERR = 110,IOSTAT = iost)
213C
214C* Let 's the fun begin
215C
216      WRITE (UNIT = nulou,FMT = *) ' '
217      WRITE (UNIT = nulou,FMT = *)
218     $    '                ANOTHER FANTASTIC RUN OF THE SUPER '
219      WRITE (UNIT = nulou,FMT = *)
220     $    '                  Ocean Atmosphere Sea Ice Soil '
221      WRITE (UNIT = nulou,FMT = *)
222     $    '                  ----------------------------- '
223      WRITE (UNIT = nulou,FMT = *)
224     $    '               A fractal, random and poetic software '
225      WRITE (UNIT = nulou,FMT = *)
226     $    '                for surrealistic simulations of the '
227      WRITE (UNIT = nulou,FMT = *)
228     $    '                           EARTH CLIMATE '
229      WRITE (UNIT = nulou,FMT = *)
230     $    '                           ************* '
231      WRITE (UNIT = nulou,FMT = *) ' '
232      WRITE (UNIT = nulou,FMT = *) ' '
233      WRITE (UNIT = nulou,FMT = *)
234     $    '           PROGRAM couple  -  Level 0'
235      WRITE (UNIT = nulou,FMT = *)
236     $    '           **************     *******'
237      WRITE (UNIT = nulou,FMT = *) ' '
238      WRITE (UNIT = nulou,FMT = *)
239     $       ' Open main input-output files and launch the simulation'
240      WRITE (UNIT = nulou,FMT = *) ' '
241      CALL prtout
242     $    ('Open output file cplout connected to unit',nulou,1)
243 110  CONTINUE
244      IF (iost .ne. 0) THEN
245          WRITE (UNIT = nulou,FMT = *) '        ***WARNING***'
246          WRITE (UNIT = nulou,FMT = *)
247     $        ' ===>>> : ERROR opening output FILE'
248          WRITE (UNIT = nulou,FMT = *)
249     $        ' ======   =====                ===='
250          WRITE (UNIT = nulou,FMT = *)
251     $           ' Logical unit ',nulou,' error number = ',iost
252          WRITE (UNIT = nulou,FMT = *) ' '
253          WRITE (UNIT = nulou,FMT = *)
254     $        ' We STOP!!! Verify the file cplout'
255          WRITE (UNIT = nulou,FMT = *) ' '
256          CALL HALTE ('STOP in couple')
257      ENDIF
258C
259C
260C*    2. Open main input file for OASIS coupler.
261C        ----------------------------------------
262C
263C* Open input file connected to unit nulin=4
264C
265      nulin = 4
266      iost = 0
267      OPEN (UNIT = nulin,FILE ='namcouple',STATUS='OLD',
268     $      FORM ='FORMATTED',ERR = 210,IOSTAT = iost)
269      CALL prtout 
270     $    ('Open input file namcouple connected to unit ',nulin,1)
271 210  CONTINUE
272      IF (iost .ne. 0) THEN
273          WRITE (UNIT = nulou,FMT = *) '        ***WARNING***' 
274          WRITE (UNIT = nulou,FMT = *) 
275     $        ' ===>>> : ERROR opening input  FILE'
276          WRITE (UNIT = nulou,FMT = *) 
277     $        ' ======   =====                ===='
278          WRITE (UNIT = nulou,FMT = *) 
279     $        ' Logical unit ',nulin,' error number = ',iost
280          WRITE (UNIT = nulou,FMT = *) ' '
281          WRITE (UNIT = nulou,FMT = *) 
282     $        ' We STOP!!! Verify the file namcouple'
283          WRITE (UNIT = nulou,FMT = *) ' '
284          CALL HALTE ('STOP in couple')
285      ENDIF
286C
287C
288C*    3. Launch the run by calling the simulation driver
289C        -----------------------------------------------
290C
291      CALL driver
292C
293C
294C*    4. End of the fun
295C        --------------
296C
297      WRITE(nulou, *) 'END of Oasis'
298      CLOSE(nulin)
299      CLOSE(nulou)
300      STOP 'END OF OASIS SIMULATION'
301      END
Note: See TracBrowser for help on using the repository browser.