Index: NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/src/OCE/SBC/cpl_oasis3.F90
===================================================================
--- NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/src/OCE/SBC/cpl_oasis3.F90	(revision 14219)
+++ NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/src/OCE/SBC/cpl_oasis3.F90	(revision 14221)
@@ -14,5 +14,5 @@
    !!            3.6  !  2014-11  (S. Masson) OASIS3-MCT
    !!----------------------------------------------------------------------
-   
+
    !!----------------------------------------------------------------------
    !!   'key_oasis3'                    coupled Ocean/Atmosphere via OASIS3-MCT
@@ -63,15 +63,15 @@
 #endif
 
-   INTEGER                    ::   nrcv         ! total number of fields received 
-   INTEGER                    ::   nsnd         ! total number of fields sent 
+   INTEGER                    ::   nrcv         ! total number of fields received
+   INTEGER                    ::   nsnd         ! total number of fields sent
    INTEGER                    ::   ncplmodel    ! Maximum number of models to/from which NEMO is potentialy sending/receiving data
-   INTEGER, PUBLIC, PARAMETER ::   nmaxfld=60   ! Maximum number of coupling fields
+   INTEGER, PUBLIC, PARAMETER ::   nmaxfld=62   ! Maximum number of coupling fields
    INTEGER, PUBLIC, PARAMETER ::   nmaxcat=5    ! Maximum number of coupling fields
    INTEGER, PUBLIC, PARAMETER ::   nmaxcpl=5    ! Maximum number of coupling fields
-   
+
    TYPE, PUBLIC ::   FLD_CPL               !: Type for coupling field information
       LOGICAL               ::   laction   ! To be coupled or not
-      CHARACTER(len = 8)    ::   clname    ! Name of the coupling field   
-      CHARACTER(len = 1)    ::   clgrid    ! Grid type  
+      CHARACTER(len = 8)    ::   clname    ! Name of the coupling field
+      CHARACTER(len = 1)    ::   clgrid    ! Grid type
       REAL(wp)              ::   nsgn      ! Control of the sign change
       INTEGER, DIMENSION(nmaxcat,nmaxcpl) ::   nid   ! Id of the field (no more than 9 categories and 9 extrena models)
@@ -98,5 +98,5 @@
       !!    exchange between AGCM, OGCM and COUPLER. (OASIS3 software)
       !!
-      !! ** Method  :   OASIS3 MPI communication 
+      !! ** Method  :   OASIS3 MPI communication
       !!--------------------------------------------------------------------
       CHARACTER(len = *), INTENT(in   ) ::   cd_modname   ! model name as set in namcouple file
@@ -132,5 +132,5 @@
       !!    exchange between AGCM, OGCM and COUPLER. (OASIS3 software)
       !!
-      !! ** Method  :   OASIS3 MPI communication 
+      !! ** Method  :   OASIS3 MPI communication
       !!--------------------------------------------------------------------
       INTEGER, INTENT(in) ::   krcv, ksnd     ! Number of received and sent coupling fields
@@ -180,13 +180,13 @@
       !
       ! -----------------------------------------------------------------
-      ! ... Define the partition, excluding halos as we don't want them to be "seen" by oasis    
+      ! ... Define the partition, excluding halos as we don't want them to be "seen" by oasis
       ! -----------------------------------------------------------------
-      
+
       paral(1) = 2                                      ! box partitioning
-      paral(2) = Ni0glo * mjg0(nn_hls) + mig0(nn_hls)   ! NEMO lower left corner global offset, without halos 
+      paral(2) = Ni0glo * mjg0(nn_hls) + mig0(nn_hls)   ! NEMO lower left corner global offset, without halos
       paral(3) = Ni_0                                   ! local extent in i, excluding halos
       paral(4) = Nj_0                                   ! local extent in j, excluding halos
       paral(5) = Ni0glo                                 ! global extent in x, excluding halos
-      
+
       IF( sn_cfctl%l_oasout ) THEN
          WRITE(numout,*) ' multiexchg: paral (1:5)', paral
@@ -195,8 +195,8 @@
          WRITE(numout,*) ' multiexchg: Njs0, Nje0, njmpp =', Njs0, Nje0, njmpp
       ENDIF
-   
+
       CALL oasis_def_partition ( id_part, paral, nerror, Ni0glo*Nj0glo )   ! global number of points, excluding halos
       !
-      ! ... Announce send variables. 
+      ! ... Announce send variables.
       !
       ssnd(:)%ncplmodel = kcplmodel
@@ -210,5 +210,5 @@
                RETURN
             ENDIF
-            
+
             DO jc = 1, ssnd(ji)%nct
                DO jm = 1, kcplmodel
@@ -225,5 +225,5 @@
                   ENDIF
 #if defined key_agrif
-                  IF( agrif_fixed() /= 0 ) THEN 
+                  IF( agrif_fixed() /= 0 ) THEN
                      zclname=TRIM(Agrif_CFixed())//'_'//TRIM(zclname)
                   ENDIF
@@ -243,11 +243,11 @@
       END DO
       !
-      ! ... Announce received variables. 
+      ! ... Announce received variables.
       !
       srcv(:)%ncplmodel = kcplmodel
       !
       DO ji = 1, krcv
-         IF( srcv(ji)%laction ) THEN 
-            
+         IF( srcv(ji)%laction ) THEN
+
             IF( srcv(ji)%nct > nmaxcat ) THEN
                CALL oasis_abort ( ncomp_id, 'cpl_define', 'Number of categories of '//   &
@@ -255,8 +255,8 @@
                RETURN
             ENDIF
-            
+
             DO jc = 1, srcv(ji)%nct
                DO jm = 1, kcplmodel
-                  
+
                   IF( srcv(ji)%nct .GT. 1 ) THEN
                      WRITE(cli2,'(i2.2)') jc
@@ -270,5 +270,5 @@
                   ENDIF
 #if defined key_agrif
-                  IF( agrif_fixed() /= 0 ) THEN 
+                  IF( agrif_fixed() /= 0 ) THEN
                      zclname=TRIM(Agrif_CFixed())//'_'//TRIM(zclname)
                   ENDIF
@@ -288,9 +288,9 @@
          ENDIF
       END DO
-      
+
       !------------------------------------------------------------------
       ! End of definition phase
       !------------------------------------------------------------------
-      !     
+      !
 #if defined key_agrif
       IF( agrif_fixed() == Agrif_Nb_Fine_Grids() ) THEN
@@ -303,6 +303,6 @@
       !
    END SUBROUTINE cpl_define
-   
-   
+
+
    SUBROUTINE cpl_snd( kid, kstep, pdata, kinfo )
       !!---------------------------------------------------------------------
@@ -324,9 +324,9 @@
       DO jc = 1, ssnd(kid)%nct
          DO jm = 1, ssnd(kid)%ncplmodel
-        
+
             IF( ssnd(kid)%nid(jc,jm) /= -1 ) THEN   ! exclude halos from data sent to oasis
                CALL oasis_put ( ssnd(kid)%nid(jc,jm), kstep, pdata(Nis0:Nie0, Njs0:Nje0,jc), kinfo )
-               
-               IF ( sn_cfctl%l_oasout ) THEN        
+
+               IF ( sn_cfctl%l_oasout ) THEN
                   IF ( kinfo == OASIS_Sent     .OR. kinfo == OASIS_ToRest .OR.   &
                      & kinfo == OASIS_SentOut  .OR. kinfo == OASIS_ToRestOut ) THEN
@@ -342,7 +342,7 @@
                   ENDIF
                ENDIF
-               
+
             ENDIF
-            
+
          ENDDO
       ENDDO
@@ -379,16 +379,16 @@
             IF( srcv(kid)%nid(jc,jm) /= -1 ) THEN
 
-               CALL oasis_get ( srcv(kid)%nid(jc,jm), kstep, exfld, kinfo )         
-               
+               CALL oasis_get ( srcv(kid)%nid(jc,jm), kstep, exfld, kinfo )
+
                llaction =  kinfo == OASIS_Recvd   .OR. kinfo == OASIS_FromRest .OR.   &
                   &        kinfo == OASIS_RecvOut .OR. kinfo == OASIS_FromRestOut
-               
+
                IF ( sn_cfctl%l_oasout )   &
                   &  WRITE(numout,*) "llaction, kinfo, kstep, ivarid: " , llaction, kinfo, kstep, srcv(kid)%nid(jc,jm)
-               
+
                IF( llaction ) THEN   ! data received from oasis do not include halos
-                  
+
                   kinfo = OASIS_Rcv
-                  IF( ll_1st ) THEN 
+                  IF( ll_1st ) THEN
                      pdata(Nis0:Nie0,Njs0:Nje0,jc) =   exfld(:,:) * pmask(Nis0:Nie0,Njs0:Nje0,jm)
                      ll_1st = .FALSE.
@@ -397,6 +397,6 @@
                         &                                + exfld(:,:) * pmask(Nis0:Nie0,Njs0:Nje0,jm)
                   ENDIF
-                  
-                  IF ( sn_cfctl%l_oasout ) THEN        
+
+                  IF ( sn_cfctl%l_oasout ) THEN
                      WRITE(numout,*) '****************'
                      WRITE(numout,*) 'oasis_get: Incoming ', srcv(kid)%clname
@@ -409,16 +409,16 @@
                      WRITE(numout,*) '****************'
                   ENDIF
-                  
+
                ENDIF
-               
+
             ENDIF
-            
+
          ENDDO
 
          !--- we must call lbc_lnk to fill the halos that where not received.
          IF( .NOT. ll_1st ) THEN
-            CALL lbc_lnk( 'cpl_oasis3', pdata(:,:,jc), srcv(kid)%clgrid, srcv(kid)%nsgn )   
+            CALL lbc_lnk( 'cpl_oasis3', pdata(:,:,jc), srcv(kid)%clgrid, srcv(kid)%nsgn )
          ENDIF
- 
+
       ENDDO
       !
@@ -426,5 +426,5 @@
 
 
-   INTEGER FUNCTION cpl_freq( cdfieldname )  
+   INTEGER FUNCTION cpl_freq( cdfieldname )
       !!---------------------------------------------------------------------
       !!              ***  ROUTINE cpl_freq  ***
@@ -491,8 +491,8 @@
       DEALLOCATE( exfld )
       IF(nstop == 0) THEN
-         CALL oasis_terminate( nerror )         
+         CALL oasis_terminate( nerror )
       ELSE
          CALL oasis_abort( ncomp_id, "cpl_finalize", "NEMO ABORT STOP" )
-      ENDIF       
+      ENDIF
       !
    END SUBROUTINE cpl_finalize
@@ -544,5 +544,5 @@
       WRITE(numout,*) 'oasis_enddef: Error you sould not be there...'
    END SUBROUTINE oasis_enddef
-  
+
    SUBROUTINE oasis_put(k1,k2,p1,k3)
       REAL(wp), DIMENSION(:,:), INTENT(in   ) ::  p1
@@ -574,5 +574,5 @@
       WRITE(numout,*) 'oasis_terminate: Error you sould not be there...'
    END SUBROUTINE oasis_terminate
-   
+
 #endif
 
