New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
cpl_oasis3.F90 in branches/2015/dev_r5204_CNRS_PISCES_dcy/NEMOGCM/NEMO/OPA_SRC/SBC – NEMO

source: branches/2015/dev_r5204_CNRS_PISCES_dcy/NEMOGCM/NEMO/OPA_SRC/SBC/cpl_oasis3.F90 @ 5225

Last change on this file since 5225 was 5225, checked in by cetlod, 9 years ago

dev_r5204_CNRS_PISCES_dcy : fixes to avoid compilation errors

  • Property svn:keywords set to Id
File size: 24.4 KB
Line 
1MODULE cpl_oasis3
2   !!======================================================================
3   !!                    ***  MODULE cpl_oasis  ***
4   !! Coupled O/A : coupled ocean-atmosphere case using OASIS3-MCT
5   !!=====================================================================
6   !! History :   
7   !!   9.0  !  04-06  (R. Redler, NEC Laboratories Europe, Germany) Original code
8   !!   " "  !  04-11  (R. Redler, NEC Laboratories Europe; N. Keenlyside, W. Park, IFM-GEOMAR, Germany) revision
9   !!   " "  !  04-11  (V. Gayler, MPI M&D) Grid writing
10   !!   " "  !  05-08  (R. Redler, W. Park) frld initialization, paral(2) revision
11   !!   " "  !  05-09  (R. Redler) extended to allow for communication over root only
12   !!   " "  !  06-01  (W. Park) modification of physical part
13   !!   " "  !  06-02  (R. Redler, W. Park) buffer array fix for root exchange
14   !!   3.4  !  11-11  (C. Harris) Changes to allow mutiple category fields
15   !!----------------------------------------------------------------------
16   !!----------------------------------------------------------------------
17   !!   'key_oasis3'                    coupled Ocean/Atmosphere via OASIS3
18   !!----------------------------------------------------------------------
19   !!   cpl_init     : initialization of coupled mode communication
20   !!   cpl_define   : definition of grid and fields
21   !!   cpl_snd     : snd out fields in coupled mode
22   !!   cpl_rcv     : receive fields in coupled mode
23   !!   cpl_finalize : finalize the coupled mode communication
24   !!----------------------------------------------------------------------
25#if defined key_oasis3
26   USE mod_oasis                    ! OASIS3-MCT module
27#endif
28   USE par_oce                      ! ocean parameters
29   USE dom_oce                      ! ocean space and time domain
30   USE in_out_manager               ! I/O manager
31   USE lbclnk                       ! ocean lateral boundary conditions (or mpp link)
32
33   IMPLICIT NONE
34   PRIVATE
35
36   PUBLIC   cpl_init
37   PUBLIC   cpl_define
38   PUBLIC   cpl_snd
39   PUBLIC   cpl_rcv
40   PUBLIC   cpl_freq
41   PUBLIC   cpl_finalize
42
43   INTEGER, PUBLIC            ::   OASIS_Rcv  = 1    !: return code if received field
44   INTEGER, PUBLIC            ::   OASIS_idle = 0    !: return code if nothing done by oasis
45   INTEGER                    ::   ncomp_id          ! id returned by oasis_init_comp
46   INTEGER                    ::   nerror            ! return error code
47#if ! defined key_oasis3
48   ! OASIS Variables not used. defined only for compilation purpose
49   INTEGER                    ::   OASIS_Out         = -1
50   INTEGER                    ::   OASIS_REAL        = -1
51   INTEGER                    ::   OASIS_Ok          = -1
52   INTEGER                    ::   OASIS_In          = -1
53   INTEGER                    ::   OASIS_Sent        = -1
54   INTEGER                    ::   OASIS_SentOut     = -1
55   INTEGER                    ::   OASIS_ToRest      = -1
56   INTEGER                    ::   OASIS_ToRestOut   = -1
57   INTEGER                    ::   OASIS_Recvd       = -1
58   INTEGER                    ::   OASIS_RecvOut     = -1
59   INTEGER                    ::   OASIS_FromRest    = -1
60   INTEGER                    ::   OASIS_FromRestOut = -1
61#endif
62
63   INTEGER                    ::   nrcv         ! total number of fields received
64   INTEGER                    ::   nsnd         ! total number of fields sent
65   INTEGER                    ::   ncplmodel    ! Maximum number of models to/from which NEMO is potentialy sending/receiving data
66   INTEGER, PUBLIC, PARAMETER ::   nmaxfld=50   ! Maximum number of coupling fields
67   INTEGER, PUBLIC, PARAMETER ::   nmaxcat=5    ! Maximum number of coupling fields
68   INTEGER, PUBLIC, PARAMETER ::   nmaxcpl=5    ! Maximum number of coupling fields
69   
70   TYPE, PUBLIC ::   FLD_CPL               !: Type for coupling field information
71      LOGICAL               ::   laction   ! To be coupled or not
72      CHARACTER(len = 8)    ::   clname    ! Name of the coupling field   
73      CHARACTER(len = 1)    ::   clgrid    ! Grid type 
74      REAL(wp)              ::   nsgn      ! Control of the sign change
75      INTEGER, DIMENSION(nmaxcat,nmaxcpl) ::   nid   ! Id of the field (no more than 9 categories and 9 extrena models)
76      INTEGER               ::   nct       ! Number of categories in field
77      INTEGER               ::   ncplmodel ! Maximum number of models to/from which this variable may be sent/received
78   END TYPE FLD_CPL
79
80   TYPE(FLD_CPL), DIMENSION(nmaxfld), PUBLIC ::   srcv, ssnd   !: Coupling fields
81
82   REAL(wp), DIMENSION(:,:), ALLOCATABLE ::   exfld   ! Temporary buffer for receiving
83
84   !!----------------------------------------------------------------------
85   !! NEMO/OPA 3.3 , NEMO Consortium (2010)
86   !! $Id$
87   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
88   !!----------------------------------------------------------------------
89CONTAINS
90
91   SUBROUTINE cpl_init( kl_comm )
92      !!-------------------------------------------------------------------
93      !!             ***  ROUTINE cpl_init  ***
94      !!
95      !! ** Purpose :   Initialize coupled mode communication for ocean
96      !!    exchange between AGCM, OGCM and COUPLER. (OASIS3 software)
97      !!
98      !! ** Method  :   OASIS3 MPI communication
99      !!--------------------------------------------------------------------
100      INTEGER, INTENT(out) ::   kl_comm   ! local communicator of the model
101      !!--------------------------------------------------------------------
102
103      ! WARNING: No write in numout in this routine
104      !============================================
105
106      !------------------------------------------------------------------
107      ! 1st Initialize the OASIS system for the application
108      !------------------------------------------------------------------
109      CALL oasis_init_comp ( ncomp_id, 'oceanx', nerror )
110      IF ( nerror /= OASIS_Ok ) &
111         CALL oasis_abort (ncomp_id, 'cpl_init', 'Failure in oasis_init_comp')
112
113      !------------------------------------------------------------------
114      ! 3rd Get an MPI communicator for OPA local communication
115      !------------------------------------------------------------------
116
117      CALL oasis_get_localcomm ( kl_comm, nerror )
118      IF ( nerror /= OASIS_Ok ) &
119         CALL oasis_abort (ncomp_id, 'cpl_init','Failure in oasis_get_localcomm' )
120      !
121   END SUBROUTINE cpl_init
122
123
124   SUBROUTINE cpl_define( krcv, ksnd, kcplmodel )
125      !!-------------------------------------------------------------------
126      !!             ***  ROUTINE cpl_define  ***
127      !!
128      !! ** Purpose :   Define grid and field information for ocean
129      !!    exchange between AGCM, OGCM and COUPLER. (OASIS3 software)
130      !!
131      !! ** Method  :   OASIS3 MPI communication
132      !!--------------------------------------------------------------------
133      INTEGER, INTENT(in) ::   krcv, ksnd     ! Number of received and sent coupling fields
134      INTEGER, INTENT(in) ::   kcplmodel      ! Maximum number of models to/from which NEMO is potentialy sending/receiving data
135      !
136      INTEGER :: id_part
137      INTEGER :: paral(5)       ! OASIS3 box partition
138      INTEGER :: ishape(2,2)    ! shape of arrays passed to PSMILe
139      INTEGER :: ji,jc,jm       ! local loop indicees
140      CHARACTER(LEN=64) :: zclname
141      CHARACTER(LEN=2) :: cli2
142      !!--------------------------------------------------------------------
143
144      IF(lwp) WRITE(numout,*)
145      IF(lwp) WRITE(numout,*) 'cpl_define : initialization in coupled ocean/atmosphere case'
146      IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~~~~~~'
147      IF(lwp) WRITE(numout,*)
148
149      ncplmodel = kcplmodel
150      IF( kcplmodel > nmaxcpl ) THEN
151         CALL oasis_abort ( ncomp_id, 'cpl_define', 'ncplmodel is larger than nmaxcpl, increase nmaxcpl')   ;   RETURN
152      ENDIF
153
154      nrcv = krcv
155      IF( nrcv > nmaxfld ) THEN
156         CALL oasis_abort ( ncomp_id, 'cpl_define', 'nrcv is larger than nmaxfld, increase nmaxfld')   ;   RETURN
157      ENDIF
158
159      nsnd = ksnd
160      IF( nsnd > nmaxfld ) THEN
161         CALL oasis_abort ( ncomp_id, 'cpl_define', 'nsnd is larger than nmaxfld, increase nmaxfld')   ;   RETURN
162      ENDIF
163
164      !
165      ! ... Define the shape for the area that excludes the halo
166      !     For serial configuration (key_mpp_mpi not being active)
167      !     nl* is set to the global values 1 and jp*glo.
168      !
169      ishape(:,1) = (/ 1, nlei-nldi+1 /)
170      ishape(:,2) = (/ 1, nlej-nldj+1 /)
171      !
172      ! ... Allocate memory for data exchange
173      !
174      ALLOCATE(exfld(nlei-nldi+1, nlej-nldj+1), stat = nerror)
175      IF( nerror > 0 ) THEN
176         CALL oasis_abort ( ncomp_id, 'cpl_define', 'Failure in allocating exfld')   ;   RETURN
177      ENDIF
178      !
179      ! -----------------------------------------------------------------
180      ! ... Define the partition
181      ! -----------------------------------------------------------------
182     
183      paral(1) = 2                                              ! box partitioning
184      paral(2) = jpiglo * (nldj-1+njmpp-1) + (nldi-1+nimpp-1)   ! NEMO lower left corner global offset   
185      paral(3) = nlei-nldi+1                                    ! local extent in i
186      paral(4) = nlej-nldj+1                                    ! local extent in j
187      paral(5) = jpiglo                                         ! global extent in x
188     
189      IF( ln_ctl ) THEN
190         WRITE(numout,*) ' multiexchg: paral (1:5)', paral
191         WRITE(numout,*) ' multiexchg: jpi, jpj =', jpi, jpj
192         WRITE(numout,*) ' multiexchg: nldi, nlei, nimpp =', nldi, nlei, nimpp
193         WRITE(numout,*) ' multiexchg: nldj, nlej, njmpp =', nldj, nlej, njmpp
194      ENDIF
195     
196      CALL oasis_def_partition ( id_part, paral, nerror )
197      !
198      ! ... Announce send variables.
199      !
200      ssnd(:)%ncplmodel = kcplmodel
201      !
202      DO ji = 1, ksnd
203         IF ( ssnd(ji)%laction ) THEN
204
205            IF( ssnd(ji)%nct > nmaxcat ) THEN
206               CALL oasis_abort ( ncomp_id, 'cpl_define', 'Number of categories of '//   &
207                  &              TRIM(ssnd(ji)%clname)//' is larger than nmaxcat, increase nmaxcat' )
208               RETURN
209            ENDIF
210           
211            DO jc = 1, ssnd(ji)%nct
212               DO jm = 1, kcplmodel
213
214                  IF ( ssnd(ji)%nct .GT. 1 ) THEN
215                     WRITE(cli2,'(i2.2)') jc
216                     zclname = TRIM(ssnd(ji)%clname)//'_cat'//cli2
217                  ELSE
218                     zclname = ssnd(ji)%clname
219                  ENDIF
220                  IF ( kcplmodel  > 1 ) THEN
221                     WRITE(cli2,'(i2.2)') jm
222                     zclname = 'model'//cli2//'_'//TRIM(zclname)
223                  ENDIF
224#if defined key_agrif
225                  IF( agrif_fixed() /= 0 ) THEN
226                     zclname=TRIM(Agrif_CFixed())//'_'//TRIM(zclname)
227                  END IF
228#endif
229                  IF( ln_ctl ) WRITE(numout,*) "Define", ji, jc, jm, " "//TRIM(zclname), " for ", OASIS_Out
230                  CALL oasis_def_var (ssnd(ji)%nid(jc,jm), zclname, id_part   , (/ 2, 0 /),   &
231                     &                OASIS_Out          , ishape , OASIS_REAL, nerror )
232                  IF ( nerror /= OASIS_Ok ) THEN
233                     WRITE(numout,*) 'Failed to define transient ', ji, jc, jm, " "//TRIM(zclname)
234                     CALL oasis_abort ( ssnd(ji)%nid(jc,jm), 'cpl_define', 'Failure in oasis_def_var' )
235                  ENDIF
236                  IF( ln_ctl .AND. ssnd(ji)%nid(jc,jm) /= -1 ) WRITE(numout,*) "variable defined in the namcouple"
237                  IF( ln_ctl .AND. ssnd(ji)%nid(jc,jm) == -1 ) WRITE(numout,*) "variable NOT defined in the namcouple"
238               END DO
239            END DO
240         ENDIF
241      END DO
242      !
243      ! ... Announce received variables.
244      !
245      srcv(:)%ncplmodel = kcplmodel
246      !
247      DO ji = 1, krcv
248         IF ( srcv(ji)%laction ) THEN
249           
250            IF( srcv(ji)%nct > nmaxcat ) THEN
251               CALL oasis_abort ( ncomp_id, 'cpl_define', 'Number of categories of '//   &
252                  &              TRIM(srcv(ji)%clname)//' is larger than nmaxcat, increase nmaxcat' )
253               RETURN
254            ENDIF
255           
256            DO jc = 1, srcv(ji)%nct
257               DO jm = 1, kcplmodel
258                 
259                  IF ( srcv(ji)%nct .GT. 1 ) THEN
260                     WRITE(cli2,'(i2.2)') jc
261                     zclname = TRIM(srcv(ji)%clname)//'_cat'//cli2
262                  ELSE
263                     zclname = srcv(ji)%clname
264                  ENDIF
265                  IF ( kcplmodel  > 1 ) THEN
266                     WRITE(cli2,'(i2.2)') jm
267                     zclname = 'model'//cli2//'_'//TRIM(zclname)
268                  ENDIF
269#if defined key_agrif
270                  IF( agrif_fixed() /= 0 ) THEN
271                     zclname=TRIM(Agrif_CFixed())//'_'//TRIM(zclname)
272                  END IF
273#endif
274                  IF( ln_ctl ) WRITE(numout,*) "Define", ji, jc, jm, " "//TRIM(zclname), " for ", OASIS_In
275                  CALL oasis_def_var (srcv(ji)%nid(jc,jm), zclname, id_part   , (/ 2, 0 /),   &
276                     &                OASIS_In           , ishape , OASIS_REAL, nerror )
277                  IF ( nerror /= OASIS_Ok ) THEN
278                     WRITE(numout,*) 'Failed to define transient ', ji, jc, jm, " "//TRIM(zclname)
279                     CALL oasis_abort ( srcv(ji)%nid(jc,jm), 'cpl_define', 'Failure in oasis_def_var' )
280                  ENDIF
281                  IF( ln_ctl .AND. srcv(ji)%nid(jc,jm) /= -1 ) WRITE(numout,*) "variable defined in the namcouple"
282                  IF( ln_ctl .AND. srcv(ji)%nid(jc,jm) == -1 ) WRITE(numout,*) "variable NOT defined in the namcouple"
283
284               END DO
285            END DO
286         ENDIF
287      END DO
288     
289      !------------------------------------------------------------------
290      ! End of definition phase
291      !------------------------------------------------------------------
292     
293      CALL oasis_enddef(nerror)
294      IF( nerror /= OASIS_Ok )   CALL oasis_abort ( ncomp_id, 'cpl_define', 'Failure in oasis_enddef')
295      !
296   END SUBROUTINE cpl_define
297   
298   
299   SUBROUTINE cpl_snd( kid, kstep, pdata, kinfo )
300      !!---------------------------------------------------------------------
301      !!              ***  ROUTINE cpl_snd  ***
302      !!
303      !! ** Purpose : - At each coupling time-step,this routine sends fields
304      !!      like sst or ice cover to the coupler or remote application.
305      !!----------------------------------------------------------------------
306      INTEGER                   , INTENT(in   ) ::   kid       ! variable index in the array
307      INTEGER                   , INTENT(  out) ::   kinfo     ! OASIS3 info argument
308      INTEGER                   , INTENT(in   ) ::   kstep     ! ocean time-step in seconds
309      REAL(wp), DIMENSION(:,:,:), INTENT(in   ) ::   pdata
310      !!
311      INTEGER                                   ::   jc,jm     ! local loop index
312      !!--------------------------------------------------------------------
313      !
314      ! snd data to OASIS3
315      !
316      DO jc = 1, ssnd(kid)%nct
317         DO jm = 1, ssnd(kid)%ncplmodel
318       
319            IF( ssnd(kid)%nid(jc,jm) /= -1 ) THEN
320               CALL oasis_put ( ssnd(kid)%nid(jc,jm), kstep, pdata(nldi:nlei, nldj:nlej,jc), kinfo )
321               
322               IF ( ln_ctl ) THEN       
323                  IF ( kinfo == OASIS_Sent     .OR. kinfo == OASIS_ToRest .OR.   &
324                     & kinfo == OASIS_SentOut  .OR. kinfo == OASIS_ToRestOut ) THEN
325                     WRITE(numout,*) '****************'
326                     WRITE(numout,*) 'oasis_put: Outgoing ', ssnd(kid)%clname
327                     WRITE(numout,*) 'oasis_put: ivarid ', ssnd(kid)%nid(jc,jm)
328                     WRITE(numout,*) 'oasis_put:  kstep ', kstep
329                     WRITE(numout,*) 'oasis_put:   info ', kinfo
330                     WRITE(numout,*) '     - Minimum value is ', MINVAL(pdata(:,:,jc))
331                     WRITE(numout,*) '     - Maximum value is ', MAXVAL(pdata(:,:,jc))
332                     WRITE(numout,*) '     -     Sum value is ', SUM(pdata(:,:,jc))
333                     WRITE(numout,*) '****************'
334                  ENDIF
335               ENDIF
336               
337            ENDIF
338           
339         ENDDO
340      ENDDO
341      !
342    END SUBROUTINE cpl_snd
343
344
345   SUBROUTINE cpl_rcv( kid, kstep, pdata, pmask, kinfo )
346      !!---------------------------------------------------------------------
347      !!              ***  ROUTINE cpl_rcv  ***
348      !!
349      !! ** Purpose : - At each coupling time-step,this routine receives fields
350      !!      like stresses and fluxes from the coupler or remote application.
351      !!----------------------------------------------------------------------
352      INTEGER                   , INTENT(in   ) ::   kid       ! variable index in the array
353      INTEGER                   , INTENT(in   ) ::   kstep     ! ocean time-step in seconds
354      REAL(wp), DIMENSION(:,:,:), INTENT(inout) ::   pdata     ! IN to keep the value if nothing is done
355      REAL(wp), DIMENSION(:,:,:), INTENT(in   ) ::   pmask     ! coupling mask
356      INTEGER                   , INTENT(  out) ::   kinfo     ! OASIS3 info argument
357      !!
358      INTEGER                                   ::   jc,jm     ! local loop index
359      LOGICAL                                   ::   llaction, llfisrt
360      !!--------------------------------------------------------------------
361      !
362      ! receive local data from OASIS3 on every process
363      !
364      kinfo = OASIS_idle
365      !
366      DO jc = 1, srcv(kid)%nct
367         llfisrt = .TRUE.
368
369         DO jm = 1, srcv(kid)%ncplmodel
370
371            IF( srcv(kid)%nid(jc,jm) /= -1 ) THEN
372
373               CALL oasis_get ( srcv(kid)%nid(jc,jm), kstep, exfld, kinfo )         
374               
375               llaction =  kinfo == OASIS_Recvd   .OR. kinfo == OASIS_FromRest .OR.   &
376                  &        kinfo == OASIS_RecvOut .OR. kinfo == OASIS_FromRestOut
377               
378               IF ( ln_ctl )   WRITE(numout,*) "llaction, kinfo, kstep, ivarid: " , llaction, kinfo, kstep, srcv(kid)%nid(jc,jm)
379               
380               IF ( llaction ) THEN
381                 
382                  kinfo = OASIS_Rcv
383                  IF( llfisrt ) THEN
384                     pdata(nldi:nlei,nldj:nlej,jc) =                                 exfld(:,:) * pmask(nldi:nlei,nldj:nlej,jm)
385                     llfisrt = .FALSE.
386                  ELSE
387                     pdata(nldi:nlei,nldj:nlej,jc) = pdata(nldi:nlei,nldj:nlej,jc) + exfld(:,:) * pmask(nldi:nlei,nldj:nlej,jm)
388                  ENDIF
389                 
390                  IF ( ln_ctl ) THEN       
391                     WRITE(numout,*) '****************'
392                     WRITE(numout,*) 'oasis_get: Incoming ', srcv(kid)%clname
393                     WRITE(numout,*) 'oasis_get: ivarid '  , srcv(kid)%nid(jc,jm)
394                     WRITE(numout,*) 'oasis_get:   kstep', kstep
395                     WRITE(numout,*) 'oasis_get:   info ', kinfo
396                     WRITE(numout,*) '     - Minimum value is ', MINVAL(pdata(:,:,jc))
397                     WRITE(numout,*) '     - Maximum value is ', MAXVAL(pdata(:,:,jc))
398                     WRITE(numout,*) '     -     Sum value is ', SUM(pdata(:,:,jc))
399                     WRITE(numout,*) '****************'
400                  ENDIF
401                 
402               ENDIF
403               
404            ENDIF
405           
406         ENDDO
407
408         !--- Fill the overlap areas and extra hallows (mpp)
409         !--- check periodicity conditions (all cases)
410         IF( .not. llfisrt )   CALL lbc_lnk( pdata(:,:,jc), srcv(kid)%clgrid, srcv(kid)%nsgn )   
411 
412      ENDDO
413      !
414   END SUBROUTINE cpl_rcv
415
416   INTEGER FUNCTION cpl_freq( cdfieldname )
417      !!---------------------------------------------------------------------
418      !!              ***  ROUTINE cpl_freq  ***
419      !!
420      !! ** Purpose : - send back the coupling frequency for a particular field
421      !!----------------------------------------------------------------------
422      CHARACTER(len = *), INTENT(in) ::   cdfieldname    ! field name as set in namcouple file
423      !!
424      INTEGER               :: id
425      INTEGER               :: info
426      INTEGER, DIMENSION(1) :: itmp
427      INTEGER               :: ji,jm     ! local loop index
428      !!----------------------------------------------------------------------
429      cpl_freq = 0   ! defaut definition
430      id = -1        ! defaut definition
431      !
432      DO ji = 1, nsnd
433         DO jm = 1, ncplmodel
434            IF( ssnd(ji)%nid(1,jm) /= -1 ) THEN
435               IF( TRIM(cdfieldname) == TRIM(ssnd(ji)%clname) ) id = ssnd(ji)%nid(1,jm)
436            ENDIF
437         ENDDO
438      ENDDO
439      DO ji = 1, nrcv
440         DO jm = 1, ncplmodel
441            IF( srcv(ji)%nid(1,jm) /= -1 ) THEN
442               IF( TRIM(cdfieldname) == TRIM(srcv(ji)%clname) ) id = srcv(ji)%nid(1,jm)
443            ENDIF
444         ENDDO
445      ENDDO
446      !
447      IF( id /= -1 ) THEN
448         CALL oasis_get_freqs(id, 1, itmp, info)
449         cpl_freq = itmp(1)
450      ENDIF
451      !
452   END FUNCTION cpl_freq
453
454   SUBROUTINE cpl_finalize
455      !!---------------------------------------------------------------------
456      !!              ***  ROUTINE cpl_finalize  ***
457      !!
458      !! ** Purpose : - Finalizes the coupling. If MPI_init has not been
459      !!      called explicitly before cpl_init it will also close
460      !!      MPI communication.
461      !!----------------------------------------------------------------------
462      !
463      DEALLOCATE( exfld )
464      IF (nstop == 0) THEN
465         CALL oasis_terminate( nerror )         
466      ELSE
467         CALL oasis_abort( ncomp_id, "cpl_finalize", "NEMO ABORT STOP" )
468      ENDIF       
469      !
470   END SUBROUTINE cpl_finalize
471
472#if ! defined key_oasis3
473
474   !!----------------------------------------------------------------------
475   !!   No OASIS Library          OASIS3 Dummy module...
476   !!----------------------------------------------------------------------
477
478   SUBROUTINE oasis_init_comp(k1,cd1,k2)
479      CHARACTER(*), INTENT(in   ) ::  cd1
480      INTEGER     , INTENT(  out) ::  k1,k2
481      k1 = -1 ; k2 = -1
482      WRITE(numout,*) 'oasis_init_comp: Error you sould not be there...', cd1
483   END SUBROUTINE oasis_init_comp
484
485   SUBROUTINE oasis_abort(k1,cd1,cd2)
486      INTEGER     , INTENT(in   ) ::  k1
487      CHARACTER(*), INTENT(in   ) ::  cd1,cd2
488      WRITE(numout,*) 'oasis_abort: Error you sould not be there...', cd1, cd2
489   END SUBROUTINE oasis_abort
490
491   SUBROUTINE oasis_get_localcomm(k1,k2)
492      INTEGER     , INTENT(  out) ::  k1,k2
493      k1 = -1 ; k2 = -1
494      WRITE(numout,*) 'oasis_get_localcomm: Error you sould not be there...'
495   END SUBROUTINE oasis_get_localcomm
496
497   SUBROUTINE oasis_def_partition(k1,k2,k3)
498      INTEGER     , INTENT(  out) ::  k1,k3
499      INTEGER     , INTENT(in   ) ::  k2(5)
500      k1 = k2(1) ; k3 = k2(5)
501      WRITE(numout,*) 'oasis_def_partition: Error you sould not be there...'
502   END SUBROUTINE oasis_def_partition
503
504   SUBROUTINE oasis_def_var(k1,cd1,k2,k3,k4,k5,k6,k7)
505      CHARACTER(*), INTENT(in   ) ::  cd1
506      INTEGER     , INTENT(in   ) ::  k2,k3(2),k4,k5(2,2),k6
507      INTEGER     , INTENT(  out) ::  k1,k7
508      k1 = -1 ; k7 = -1
509      WRITE(numout,*) 'oasis_def_var: Error you sould not be there...', cd1
510   END SUBROUTINE oasis_def_var
511
512   SUBROUTINE oasis_enddef(k1)
513      INTEGER     , INTENT(  out) ::  k1
514      k1 = -1
515      WRITE(numout,*) 'oasis_enddef: Error you sould not be there...'
516   END SUBROUTINE oasis_enddef
517 
518   SUBROUTINE oasis_put(k1,k2,p1,k3)
519      REAL(wp), DIMENSION(:,:), INTENT(in   ) ::  p1
520      INTEGER                 , INTENT(in   ) ::  k1,k2
521      INTEGER                 , INTENT(  out) ::  k3
522      k3 = -1
523      WRITE(numout,*) 'oasis_put: Error you sould not be there...'
524   END SUBROUTINE oasis_put
525
526   SUBROUTINE oasis_get(k1,k2,p1,k3)
527      REAL(wp), DIMENSION(:,:), INTENT(  out) ::  p1
528      INTEGER                 , INTENT(in   ) ::  k1,k2
529      INTEGER                 , INTENT(  out) ::  k3
530      p1(1,1) = -1. ; k3 = -1
531      WRITE(numout,*) 'oasis_get: Error you sould not be there...'
532   END SUBROUTINE oasis_get
533
534   SUBROUTINE oasis_get_freqs(k1,k2,k3,k4)
535      INTEGER              , INTENT(in   ) ::  k1,k2
536      INTEGER, DIMENSION(1), INTENT(  out) ::  k3
537      INTEGER              , INTENT(  out) ::  k4
538      k3(1) = k1 ; k4 = k2
539      WRITE(numout,*) 'oasis_get_freqs: Error you sould not be there...'
540   END SUBROUTINE oasis_get_freqs
541
542   SUBROUTINE oasis_terminate(k1)
543      INTEGER     , INTENT(  out) ::  k1
544      k1 = -1
545      WRITE(numout,*) 'oasis_terminate: Error you sould not be there...'
546   END SUBROUTINE oasis_terminate
547   
548#endif
549
550   !!=====================================================================
551END MODULE cpl_oasis3
Note: See TracBrowser for help on using the repository browser.