Listing complet des modifications apportees au code ORCA
pour le couplage POLCA
par rapport a la version IPSLCM4 du Lodyc





===================================================================
RCS file: /home/opalod/CVSROOT/OPA/SRC_ORCA/common.coupled.h,v
retrieving revision 2.3
diff -r2.3 common.coupled.h
31a32,33
> C EM -- sstmoy pour calcul du flux non solaire glace/eau
> C EM -- calv pour diagnostic sur la calving
34,35c36,37
<      $    catm(jpi,jpj)
<       COMMON/comflr2/watm,tatm,hatm,vatm,catm
---
>      $    catm(jpi,jpj), sstmoy(jpi,jpj,3), calv(jpi,jpj)
>       COMMON/comflr2/watm,tatm,hatm,vatm,catm,sstmoy,calv
80,96d81
< #if defined key_coupled || defined key_debug
< CC      sstoc()          : work array to average sst
< CC      sieoc()          : work array to average Ice INDEX
< CC      alboc()          : work array to average Ice Albedo
< CC      ticoc()          : work array to average Ice temperature
< C
<       REAL sstoc(jpi,jpj), sieoc(jpi,jpj)
<       REAL alboc(jpi,jpj), ticoc(jpi,jpj)
< C
<       COMMON/comwrk/ sstoc, sieoc, alboc, ticoc
< C
< C -- inc_sipc.h   97-08-11   Version 2.0   Author: S&A
< C    **********
< C@
< C@  Contents : variables describing pools formed of shared memory segments
< C@  --------
< C@
111a97,106
> #if defined key_coupled || defined key_debug
> CC      sstoc()          : work array to average sst
> CC      sieoc()          : work array to average Ice INDEX
> CC      alboc()          : work array to average Ice Albedo
> C
>       REAL sstoc(jpi,jpj), sieoc(jpi,jpj)
>       REAL alboc(jpi,jpj)
> C
>       COMMON/comwrk/ sstoc, sieoc, alboc
> C
===================================================================
RCS file: /home/opalod/CVSROOT/OPA/SRC_ORCA/common.h,v
retrieving revision 2.9
diff -r2.9 common.h
1762c1762
<       REAL sbcocn(jpi,jpj,10)
---
>       REAL sbcocn(jpi,jpj,11)
1766c1766
<       REAL sciobc(jpi,jpj,12)
---
>       REAL sciobc(jpi,jpj,13)
===================================================================
RCS file: /home/opalod/CVSROOT/OPA/SRC_ORCA/diawri.F,v
retrieving revision 2.6
diff -r2.6 diawri.F
323a324,327
> C      ...freshwater budget due to concentration/dilution effect (emps)
>           CALL histdef(nid1, "sowaflcd",
>      $        "EMPS", "kg/m2/s",
>      $        jpi, jpj, nhorid1, 1, 1, 1, -99, 32, clop,zsto,zout)
333,335c337,340
< C      ...freshwater budget due to concentration/dilution effect (emps)
<           CALL histdef(nid1, "sowaflcd",
<      $        "EMPS", "kg/m2/s",
---
> #if defined  key_ice_lln && defined key_coupled
> C      ...calving
>           CALL histdef(nid1, "socalvin",
>      $        "Calving", "Kg/m2/S",
336a342
> #endif
339c345
<      $        "EMPS.S Flux", "KG/M2/S",
---
>      $        "E.S Flux", "KG/M2/S",
421,428d426
< #if defined key_ice_lln && ( defined key_coupled || defined key_flx_lmd )
< C      ... sea ice surface temperature
<           CALL histdef(nid1,"soicetem" , "Ice Surface Temperature", "K",
<      $          jpi, jpj, nhorid1, 1, 1, 1, - 99, 32, clop,zsto,zout)
<           CALL histdef(nid1,"soicealb" , "Ice Albedo", "-",
<      $          jpi, jpj, nhorid1, 1, 1, 1, - 99, 32, clop,zsto,zout)
< #endif
< C
701a700,702
>           CALL histwrite(nid1, "sowaflcd", it, emps,ndim11,ndex11)
>           IF(clp) WRITE(numout,*)' diawri histwrite sowaflcd'
>           IF(clp) CALL FLUSH(numout)
709,710c710,712
<           CALL histwrite(nid1, "sowaflcd", it, emps, ndim11,ndex11)
<           IF(clp) WRITE(numout,*)' diawri histwrite emps'
---
> #if defined key_ice_lln  && defined key_coupled
>           CALL histwrite(nid1, "socalvin", it,  calv,  ndim11,ndex11)
>           IF(clp) WRITE(numout,*)' diawri histwrite socalvin'
711a714
> #endif
714c717
<               zwrite(ji,jj) = emps(ji,jj)*sn(ji,jj,1)*tmask(ji,jj,1)
---
>               zwrite(ji,jj) = emp(ji,jj)*sn(ji,jj,1)*tmask(ji,jj,1)
718c721
<           IF(clp) WRITE(numout,*)' diawri histwrite emps*sn'
---
>           IF(clp) WRITE(numout,*)' diawri histwrite emp*sn'
790,797d792
<           IF(clp) CALL FLUSH(numout)
< #endif
< #if defined key_ice_lln && ( defined key_coupled || defined key_flx_lmd )
<           CALL histwrite(nid1,"soicetem",it,tn_ice ,ndim11,ndex11)
<           IF(clp) WRITE(numout,*)' diawri histwrite soicetem'
<           IF(clp) CALL FLUSH(numout)
<           CALL histwrite(nid1,"soicealb",it,alb_ice,ndim11,ndex11)
<           IF(clp) WRITE(numout,*)' diawri histwrite soicealb'
===================================================================
RCS file: /home/opalod/CVSROOT/OPA/SRC_ORCA/dtacof.F,v
retrieving revision 2.10
diff -r2.10 dtacof.F
172c172
<      $            ipi, ipj, ipk, zlamt, zphit, zdept, jpmois,
---
>      $            ipi, ipj, ipk, zlamt, zphit, zdept, itime,
175c175
<      $           jpmois, 1, 1, nizoom, jpi, njzoom, jpj, zdct )
---
>      $           itime, 1, 1, nizoom, jpi, njzoom, jpj, zdct )
===================================================================
RCS file: /home/opalod/CVSROOT/OPA/SRC_ORCA/dtasal.monthly.h,v
retrieving revision 2.3
diff -r2.3 dtasal.monthly.h
183c183,184
<           CALL flinget(numsa1,'vosaline',jpidta,jpjdta,jpk,jpmois,nsal1,
---
>           itime=jpmois
>           CALL flinget(numsa1,'vosaline',jpidta,jpjdta,jpk,itime,nsal1,
185c186
<           CALL flinget(numsa1,'vosaline',jpidta,jpjdta,jpk,jpmois,nsal2,
---
>           CALL flinget(numsa1,'vosaline',jpidta,jpjdta,jpk,itime,nsal2,
===================================================================
RCS file: /home/opalod/CVSROOT/OPA/SRC_ORCA/dtatem.F,v
retrieving revision 2.3
diff -r2.3 dtatem.F
171c171,172
<           CALL flinget(numte1,'votemper',jpidta,jpjdta,jpk,jpmois,ntem1,
---
>           itime=jpmois
>           CALL flinget(numte1,'votemper',jpidta,jpjdta,jpk,itime,ntem1,
173c174
<           CALL flinget(numte1,'votemper',jpidta,jpjdta,jpk,jpmois,ntem2,
---
>           CALL flinget(numte1,'votemper',jpidta,jpjdta,jpk,itime,ntem2,
===================================================================
RCS file: /home/opalod/CVSROOT/OPA/SRC_ORCA/dtrlec.F,v
retrieving revision 2.9
diff -r2.9 dtrlec.F
68c68
<       CHARACTER (len=32) :: clname, cln
---
>       CHARACTER*32 clname,cln
70c70
<       CHARACTER (len=8) ::  clvnames(30)
197a198,201
> #if defined key_coupled
>       CALL restget(numrst,'sstmoyb',jpi,jpj,1,0,clog,sstmoy(:,:,1))
>       CALL restget(numrst,'sstmoyn',jpi,jpj,1,0,clog,sstmoy(:,:,2))
> #endif
===================================================================
RCS file: /home/opalod/CVSROOT/OPA/SRC_ORCA/flx.coupled.clio.h,v
retrieving revision 2.2
diff -r2.2 flx.coupled.clio.h
25a26
> CC       adapted: 01/06 : (S.Valcke, E. Maisonnave) Predicate version
31c32
<       USE ioipsl
---
> C      USE ioipsl
43c44
<       INTEGER info, inuread, index
---
>       INTEGER info, inuread, index, nbpos
47,54c48,54
<       REAL znsolc (jpiglo,jpjglo),zqsrc (jpiglo,jpjglo)
<       REAL zrunoff(jpiglo,jpjglo),zec   (jpiglo,jpjglo)
<       REAL zqsrice (jpiglo,jpjglo),zqsrwat (jpiglo,jpjglo)
<       REAL znsolice(jpiglo,jpjglo),znsolwat(jpiglo,jpjglo)
<       REAL znsicedt(jpiglo,jpjglo),zevice  (jpiglo,jpjglo)
<       REAL zevwat  (jpiglo,jpjglo),zpliq   (jpiglo,jpjglo)
<       REAL zpsol   (jpiglo,jpjglo),zruncot (jpiglo,jpjglo)
<       REAL zrunriv (jpiglo,jpjglo)
---
>       REAL znsoltot (jpiglo,jpjglo),zqsrtot (jpiglo,jpjglo)
>       REAL zrunoff(jpiglo,jpjglo)
>       REAL znsdqdt(jpiglo,jpjglo),zevap  (jpiglo,jpjglo)
>       REAL zpliq   (jpiglo,jpjglo),zcalv  (jpiglo,jpjglo)
>       REAL zpsol   (jpiglo,jpjglo)
>       REAL zstemp  (jpiglo,jpjglo), zalb (jpiglo,jpjglo)
>       REAL zcumulneg , zcumulpos
56c56
< c
---
>
58,64c58,64
< c
<       CHARACTER*80 clcplfnam
<       INTEGER nhoridcf,nidcf,ndexcf(jpi*jpj)
<       SAVE nhoridcf,nidcf,ndexcf
<       LOGICAL, SAVE :: lfirstf=.true.
<       REAL zjulian,zsec
<       INTEGER iyear,imonth,iday
---
>
> C      CHARACTER*80 clcplfnam
> C      INTEGER nhoridcf,nidcf,ndexcf(jpi*jpj)
> C      SAVE nhoridcf,nidcf,ndexcf
> C      LOGICAL, SAVE :: lfirstf=.true.
> C      REAL zjulian,zsec
> C      INTEGER iyear,imonth,iday
91,95c91,95
<       IF (lfirstf) THEN
<           lfirstf=.false.
<           ndexcf(:)=0
<           clcplfnam="cpl_oce_flx"
< C
---
> C      IF (lfirstf) THEN
> C          lfirstf=.false.
> C          ndexcf(:)=0
> C          clcplfnam="cpl_oce_flx"
> C
97,104c97,104
<           iyear = ndastp/10000
<           imonth = ndastp/100 - iyear*100
<           iday = ndastp - imonth*100 - iyear*10000
<           iyear = ndastp/10000
<           zsec=0.
<           CALL ymds2ju(iyear,imonth,iday,zsec,zjulian)
<           CALL histbeg(clcplfnam, jpiglo,glamt,jpjglo,gphit,1,jpiglo,1
<      $        ,jpjglo,0,zjulian,rdt,nhoridcf,nidcf)
---
> C          iyear = ndastp/10000
> C          imonth = ndastp/100 - iyear*100
> C          iday = ndastp - imonth*100 - iyear*10000
> C          iyear = ndastp/10000
> C          zsec=0.
> C          CALL ymds2ju(iyear,imonth,iday,zsec,zjulian)
> C          CALL histbeg(clcplfnam, jpiglo,glamt,jpjglo,gphit,1,jpiglo,1
> C     $        ,jpjglo,0,zjulian,rdt,nhoridcf,nidcf)
106,112c106,112
<           DO jf=1,nflxc2o
<             CALL histdef(nidcf, cpl_readflx(jf),cpl_readflx(jf),
<      $          "-",jpi, jpj, nhoridcf, 1, 1, 1, -99, 32, "inst",
<      $          rdt,rdt)
<           END DO
<           CALL histend(nidcf)
<       ENDIF
---
> C          DO jf=1,nflxc2o
> C            CALL histdef(nidcf, cpl_readflx(jf),cpl_readflx(jf),
> C     $          "-",jpi, jpj, nhoridcf, 1, 1, 1, -99, 32, "inst",
> C     $          rdt,rdt)
> C          END DO
> C          CALL histend(nidcf)
> C      ENDIF
130c130
< C* Test what kind of message passing we are using
---
> C*    Test what kind of message passing we are using
132,134c132,134
<           IF(lwp)WRITE(numout,*)' '
<           IF(lwp)WRITE(numout,*)'FLX: Read fields from CPL, itm1=',itm1
<           IF(lwp)WRITE(numout,*)' '
---
>           WRITE (numout,*) ' '
>           WRITE (numout,*) 'FLX: Read fields from CPL, itm1=',itm1
>           WRITE (numout,*) ' '
137,165c137
<           IF (cchan.eq.'PIPE') THEN
< C pipe mode
< c
< c UNIT number for fields
< c
<               inuread = 99
< c
< c exchanges from to atmosphere=CPL to ocean
< C
<               DO jf=1,nflxc2o
< c                CALL PIPE_Model_Recv(cpl_readflx(jf), icpliter, numout)
<                 OPEN (inuread, FILE=cpl_f_readflx(jf), FORM
<      $              ='UNFORMATTED')
<                 IF (jf.eq.1)
<      $              CALL locread(cpl_readflx(jf), znsolc, isize, inuread
<      $              ,iflag,numout)
<                 IF (jf.eq.2)
<      $              CALL locread(cpl_readflx(jf), zqsrc, isize, inuread,
<      $              iflag,numout)
<                 IF (jf.eq.3)
<      $              CALL locread(cpl_readflx(jf), zec, isize, inuread,
<      $              iflag,numout)
<                 IF (jf.eq.4)
<      $              CALL locread(cpl_readflx(jf), zrunoff, isize,
<      $              inuread,iflag,numout)
<                 CLOSE (inuread)
<               END DO
< c
<           ELSE IF (cchan.eq.'SIPC') THEN
---
>           IF (cchan.eq.'SIPC') THEN
168,169c140,142
< c         Define IF a header must be encapsulated within the field brick :
<               clmodinf = 'NOT'   ! as $MODINFO in namcouple
---
> c             Define IF a header must be encapsulated within
> c             the field brick :
>               clmodinf = 'NOT'  ! as $MODINFO in namcouple
171c144
< c         reading of input field non solar flux SONSHLDO
---
> c             reading of input field non solar flux SONSHLDO
174,175c147,148
< c              CALL SIPC_Read_Model(index, isize, clmodinf,
< c     $            cljobnam_r, infos, znsolc)
---
>               CALL SIPC_Read_Model(index, isize, clmodinf,
>      $            cljobnam_r, infos, znsoltot)
177c150
< c         reading of input field solar heat flux SOSHFLDO
---
> c              reading of input field solar heat flux SOSHFLDO
180,181c153,154
< c              CALL SIPC_Read_Model(index, isize, clmodinf,
< c     $            cljobnam_r, infos, zqsrc)
---
>               CALL SIPC_Read_Model(index, isize, clmodinf,
>      $            cljobnam_r, infos, zqsrtot)
183c156
< c         reading of input field water flux SOWAFLDO
---
> c             reading of input field evaporation flux SOLATHSU
186,187c159,160
< c              CALL SIPC_Read_Model(index, isize, clmodinf,
< c     $            cljobnam_r, infos, zec)
---
>               CALL SIPC_Read_Model(index, isize, clmodinf,
>      $            cljobnam_r, infos, zevap)
189c162
< c         reading of input field runoff SORUNOFF
---
> c             reading of input field liquid precipitation SOTOLPSU
192,193c165,208
< c              CALL SIPC_Read_Model(index, isize, clmodinf,
< cc     $            cljobnam_r, infos, zrunoff)
---
>               CALL SIPC_Read_Model(index, isize, clmodinf,
>      $            cljobnam_r, infos, zpliq)
> c
> c
> c             reading of input field solid precipitation SOTOSPSU
> c
>               index = 5
>               CALL SIPC_Read_Model(index, isize, clmodinf,
>      $            cljobnam_r, infos, zpsol)
> c
> c
> c             reading of input field runoff SORUNOFF
> c
>               index = 6
>               CALL SIPC_Read_Model(index, isize, clmodinf,
>      $            cljobnam_r, infos, zrunoff)
> c
> c
> c             reading of input field calving SOCALVIN
> c
>               index = 7
>               CALL SIPC_Read_Model(index, isize, clmodinf,
>      $            cljobnam_r, infos, zcalv)
> c
> c
> c             reading of input field surface temp
> c
> CEM  On recupere la valeur moyenne de la sst vue par l'atmosphere
> CEM  le jour precedent
>               zstemp=sstmoy(:,:,1)
> c
> c
> c             reading of input field flux derivative SODFLXDT
> c
>               index = 8
>               CALL SIPC_Read_Model(index, isize, clmodinf,
>      $            cljobnam_r, infos, znsdqdt)
> c
> c
> c             reading of input field mean albedo SOALBICE
> c
>               index = 9
>               CALL SIPC_Read_Model(index, isize, clmodinf,
>      $            cljobnam_r, infos, zalb)
198c213
<              IF(lwp) WRITE (numout,*) 'Reading flux from coupler '
---
>               WRITE (numout,*) 'Reading flux from coupler '
200a216,219
> CEM  On recupere la valeur moyenne de la sst vue par l'atmosphere
> CEM  le jour precedent
>               zstemp=sstmoy(:,:,1)
> c
203,211c222,230
<      $              ,zqsrice,info)
<                 IF (jf.eq.2) CALL CLIM_Import (cpl_readflx(jf),itm1
<      $              ,zqsrwat,info)
<                 IF (jf.eq.3) CALL CLIM_Import (cpl_readflx(jf),itm1,
<      $              znsolice,info)
<                 IF (jf.eq.4) CALL CLIM_Import (cpl_readflx(jf),itm1,
<      $              znsolwat,info)
<                 IF (jf.eq.5) CALL CLIM_Import (cpl_readflx(jf),itm1,
<      $              znsicedt,info)
---
>      $              ,znsoltot,info)
>                 IF (jf.eq.2) CALL CLIM_Import (cpl_readflx(jf),itm1,
>      $              zqsrtot,info)
>                 IF (jf.eq.3) CALL CLIM_Import (cpl_readflx(jf),itm1
>      $              ,zevap,info)
>                 IF (jf.eq.4) CALL CLIM_Import (cpl_readflx(jf),itm1
>      $              ,zpliq,info)
>                 IF (jf.eq.5) CALL CLIM_Import (cpl_readflx(jf),itm1
>      $              ,zpsol,info)
213c232
<      $              zevice,info)
---
>      $              zrunoff,info)
215c234
<      $              zevwat,info)
---
>      $              zcalv,info)
217c236
<      $              zpliq,info)
---
>      $              znsdqdt,info)
219,223c238
<      $              zpsol,info)
<                 IF (jf.eq.10) CALL CLIM_Import (cpl_readflx(jf),itm1
<      $              ,zruncot,info)
<                 IF (jf.eq.11) CALL CLIM_Import (cpl_readflx(jf),itm1
<      $              ,zrunriv,info)
---
>      $              zalb,info)
225,229c240,243
<                     IF(lwp)WRITE(numout,*)'Pb in reading '
<      $                  , cpl_readflx(jf), jf
<                     IF(lwp)WRITE(numout,*)'Couplage itm1 is = ',itm1
<                     IF(lwp)WRITE(numout,*)'CLIM error code is = ', info
<                     IF(lwp)WRITE(numout,*)'STOP in Flx'
---
>                     WRITE(numout,*)'Pb in reading ', cpl_readflx(jf), jf
>                     WRITE(numout,*)'Couplage itm1 is = ',itm1
>                     WRITE(numout,*)'CLIM error code is = ', info
>                     WRITE(numout,*)'STOP in Flx'
234,238c248,263
< cmaf          temporary patch deleted
< cmaf          znsicedt(:,:)=-40.
< cmaf temporaire runoff a 0
<           zruncot(:,:)=0.0
<           zrunriv(:,:)=0.0
---
> CEM
> C   Fichier de masque a revoir dans Oasis
> C   On recopie temporairement la premiere colonne de donnees dans l
> C   avant derniere
> CEM
>           DO jj=1,nlcj
>             znsoltot(jpi-1,jj)=znsoltot(1,jj)
>             zqsrtot(jpi-1,jj)=zqsrtot(1,jj)
>             zevap(jpi-1,jj)=zevap(1,jj)
>             zpliq(jpi-1,jj)=zpliq(1,jj)
>             zpsol(jpi-1,jj)=zpsol(1,jj)
>             zrunoff(jpi-1,jj)=zrunoff(1,jj)
>             zcalv(jpi-1,jj)=zcalv(1,jj)
>             znsdqdt(jpi-1,jj)=znsdqdt(1,jj)
>             zalb(jpi-1,jj)=zalb(1,jj)
>           END DO
243,268c268,289
<               DO jf=1,nflxc2o
<                 IF (jf.eq.1) CALL histwrite(nidcf,cpl_readflx(1), kt,
<      $              zqsrice,jpi*jpj,ndexcf)
<                 IF (jf.eq.2) CALL histwrite(nidcf,cpl_readflx(2), kt,
<      $              zqsrwat,jpi*jpj,ndexcf)
<                 IF (jf.eq.3) CALL histwrite(nidcf,cpl_readflx(3), kt,
<      $              znsolice,jpi*jpj,ndexcf)
<                 IF (jf.eq.4) CALL histwrite(nidcf,cpl_readflx(4), kt,
<      $              znsolwat,jpi*jpj,ndexcf)
<                 IF (jf.eq.5) CALL histwrite(nidcf,cpl_readflx(5), kt,
<      $              znsicedt,jpi*jpj,ndexcf)
<                 IF (jf.eq.6) CALL histwrite(nidcf,cpl_readflx(6), kt,
<      $              zevice,jpi*jpj,ndexcf)
<                 IF (jf.eq.7) CALL histwrite(nidcf,cpl_readflx(7), kt,
<      $              zevwat,jpi*jpj,ndexcf)
<                 IF (jf.eq.8) CALL histwrite(nidcf,cpl_readflx(8), kt,
<      $              zpliq,jpi*jpj,ndexcf)
<                 IF (jf.eq.9) CALL histwrite(nidcf,cpl_readflx(9), kt,
<      $              zpsol,jpi*jpj,ndexcf)
<                 IF (jf.eq.10) CALL histwrite(nidcf,cpl_readflx(10), kt,
<      $              zruncot,jpi*jpj,ndexcf)
<                 IF (jf.eq.11) CALL histwrite(nidcf,cpl_readflx(11), kt,
<      $              zrunriv,jpi*jpj,ndexcf)
<               END DO
<           CALL histsync(nidcf)
<           IF (nitend-kt.LT.nexco) CALL histclo(nidcf)
---
> C              DO jf=1,nflxc2o
> C                IF (jf.eq.1) CALL histwrite(nidcf,cpl_readflx(1), kt,
> C     $              znsoltot,jpi*jpj,ndexcf)
> C                IF (jf.eq.2) CALL histwrite(nidcf,cpl_readflx(2), kt,
> C     $              zqsrtot,jpi*jpj,ndexcf)
> C                IF (jf.eq.3) CALL histwrite(nidcf,cpl_readflx(3), kt,
> C     $              zevap,jpi*jpj,ndexcf)
> C                IF (jf.eq.4) CALL histwrite(nidcf,cpl_readflx(4), kt,
> C     $              zpliq,jpi*jpj,ndexcf)
> C                IF (jf.eq.5) CALL histwrite(nidcf,cpl_readflx(5), kt,
> C     $              zpsol,jpi*jpj,ndexcf)
> C                IF (jf.eq.6) CALL histwrite(nidcf,cpl_readflx(6), kt,
> C     $              zrunoff,jpi*jpj,ndexcf)
> C                IF (jf.eq.7) CALL histwrite(nidcf,cpl_readflx(7), kt,
> C     $              zcalv,jpi*jpj,ndexcf)
> C                IF (jf.eq.8) CALL histwrite(nidcf,cpl_readflx(8), kt,
> C     $              znsdqdt,jpi*jpj,ndexcf)
> C                IF (jf.eq.9) CALL histwrite(nidcf,cpl_readflx(9), kt,
> C     $              zalb,jpi*jpj,ndexcf)
> C              END DO
> C          CALL histsync(nidcf)
> C          IF (nitend-kt.LT.nexco) CALL histclo(nidcf)
273c294
< C  en W/m2
---
> C en W/m2
275c296,325
<
---
> C     At the coupling timestep, calculate sciobc that DO not depend
> C     on instantaneous field values
>         zcumulneg=0.
>         zcumulpos=0.
>         nbpos=0
>           DO jj=1,nlcj
>             DO ji=1,nlci
> c
>             IF ( zrunoff(mindi(ji),mindj(jj)) .LT. 0. ) THEN
>               zcumulneg=zcumulneg+
>      $             zrunoff(mindi(ji),mindj(jj))
>      $             * e1t(ji,jj)*e2t(ji,jj)*tmask(ji,jj,1)
>             ELSEIF ( zrunoff(mindi(ji),mindj(jj))
>      $           .GT. 0. ) THEN
>               nbpos=nbpos+1
>             ENDIF
>             zcumulpos=zcumulpos+zrunoff(mindi(ji),mindj(jj))
>      $             * e1t(ji,jj)*e2t(ji,jj)*tmask(ji,jj,1)
>             END DO
>           END DO
>         WRITE(numout,*) 'zcumulneg ', zcumulneg
>         WRITE(numout,*) 'nbpos ', nbpos
>         WRITE(numout,*) 'zcumulpos ', zcumulpos
> c
> CEM Le champ de runoff Arpege ne doit pas comporter de valeurs negatives
> CEM  Il est necessaire de sommer les valeurs dans le modele
> CEM  puis de les soustraire des valeurs positives
> CEM  afin de ne pas perdre une partie de la masse d'eau totale
> CEM
>         zcumulpos=0.
280,283c330,332
<               sciobc (ji,jj,1) =  zqsrwat  (mindi(ji),mindj(jj))
<      $            * tmask(ji,jj,1) * zfacflx
< c  2: le flux solaire sur la glace
<               sciobc (ji,jj,2) =  zqsrice  (mindi(ji),mindj(jj))
---
>               sciobc (ji,jj,1) =  zqsrtot  (mindi(ji),mindj(jj))
>      $            *        (1-0.065)
>      $            /        (1-zalb(mindi(ji),mindj(jj)))
285,296c334,338
< c  3: le flux non solaire  (descendant+montant) sur l'ocean
<               sciobc (ji,jj,3) =  znsolwat (mindi(ji),mindj(jj))
<      $            * tmask(ji,jj,1) * zfacflx
< c  4: le flux non solaire  (descendant+montant) sur la glace
<               sciobc (ji,jj,4) =  znsolice (mindi(ji),mindj(jj))
<      $            * tmask(ji,jj,1) * zfacflx
< c  5: le bilan hydrique ( precip liquide - evap )
<               sciobc (ji,jj,5) = ( zpliq   (mindi(ji),mindj(jj))
<      $            +                zpsol   (mindi(ji),mindj(jj))
<      $            -                zevwat  (mindi(ji),mindj(jj))
<      $            -                zevice  (mindi(ji),mindj(jj)) )
<      $            * tmask(ji,jj,1) * zfacwat
---
> c  5: le bilan hydrique (precip liquide + solide - evap)
>               sciobc (ji,jj,5) = ( zpliq   (mindi(ji),mindj(jj))
>      $        +                zpsol   (mindi(ji),mindj(jj))
>      $        -                zevap   (mindi(ji),mindj(jj)))
>      $        * tmask(ji,jj,1)
299,305c341,360
<      $            * tmask(ji,jj,1) * zfacwat
< c  7: runoff
<               sciobc (ji,jj,7) = ( zruncot (mindi(ji),mindj(jj))
<      $            +                zrunriv (mindi(ji),mindj(jj)) )
<      $            * tmask(ji,jj,1) * zfacwat
< c  8: la derivee des flux non solaire sur la glace
<               sciobc (ji,jj,8) =   znsicedt (mindi(ji),mindj(jj))
---
>      $            * tmask(ji,jj,1)
> c  7: le runoff (Attention, sciobc (ji,jj,7) n'est pas utilise dans le
> c modele de glace mais sert a initialiser runoff dans icelln.coupled.h)
>               sciobc (ji,jj,7) =  zrunoff(mindi(ji),mindj(jj))
>      $            * tmask(ji,jj,1)
> CEM Le champ de runoff Arpege ne doit pas comporter de valeurs negatives
> CEM  Il est necessaire de sommer les valeurs dans le modele
> CEM  puis de les soustraire des valeurs positives
> CEM  afin de ne pas perdre une partie de la masse d'eau totale
> CEM
>               IF ( sciobc (ji,jj,7) .GT. 0. ) THEN
>                 sciobc (ji,jj,7) = ( sciobc (ji,jj,7) +
>      $            zcumulneg/nbpos / (e1t(ji,jj)*e2t(ji,jj)) )
>               ELSE
>                 sciobc (ji,jj,7) = 0.0
>               ENDIF
>               zcumulpos=zcumulpos+sciobc (ji,jj,7)
>      $             * e1t(ji,jj)*e2t(ji,jj)*tmask(ji,jj,1)
> c  8: la derivee des flux non solaire sur la glace
>               sciobc (ji,jj,8) =   znsdqdt (mindi(ji),mindj(jj))
306a362,366
> c  13: calving
>           sciobc (ji,jj,13) =
>      $        zcalv (mindi(ji),mindj(jj)) * tmask(ji,jj,1)
> c     $                         0.0
> c
309a370,371
>         WRITE(numout,*) 'zcumulpos final', zcumulpos
> C
311,313d372
<           CALL lbc2 (sciobc(:,:, 2), 1, 1, 1, 1, 1, 1 )
<           CALL lbc2 (sciobc(:,:, 3), 1, 1, 1, 1, 1, 1 )
<           CALL lbc2 (sciobc(:,:, 4), 1, 1, 1, 1, 1, 1 )
317a377,378
>           CALL lbc2 (sciobc(:,:, 13), 1, 1, 1, 1, 1, 1 )
>
328c389,415
<
---
> C     At each timestep, calculate sciobc that depend
> C     on instantaneous field values (alb_ice, tn, tn_ice, freeze)
>       DO jj=1,nlcj
>         DO ji=1,nlci
> c  2: le flux solaire sur la glace
>           sciobc (ji,jj,2) =  zqsrtot  (mindi(ji),mindj(jj))
>      $            *        (1-alb_ice(mindi(ji),mindj(jj)))
>      $            /        (1-zalb(mindi(ji),mindj(jj)))
>      $            * tmask(ji,jj,1) * zfacflx
> C
> c  3: le flux non solaire  (descendant+montant) sur l'ocean
>           sciobc (ji,jj,3) =  znsoltot (mindi(ji),mindj(jj))
>      $            +        znsdqdt(mindi(ji),mindj(jj))
>      $            *      (tn(ji,jj,1)+rt0-zstemp(mindi(ji),mindj(jj)))
>      $            * tmask(ji,jj,1) * zfacflx
> c  4: le flux non solaire  (descendant+montant) sur la glace
>           sciobc (ji,jj,4) =  znsoltot (mindi(ji),mindj(jj))
>      $            +        znsdqdt(mindi(ji),mindj(jj))
>      $            *      (tn_ice(ji,jj)-zstemp(mindi(ji),mindj(jj)))
>      $            *      tmask(ji,jj,1) * zfacflx
> c
>           CALL lbc2 (sciobc(:,:, 2), 1, 1, 1, 1, 1, 1 )
>           CALL lbc2 (sciobc(:,:, 3), 1, 1, 1, 1, 1, 1 )
>           CALL lbc2 (sciobc(:,:, 4), 1, 1, 1, 1, 1, 1 )
>         END DO
>       END DO
>
===================================================================
RCS file: /home/opalod/CVSROOT/OPA/SRC_ORCA/flxrnf.F,v
retrieving revision 2.5
diff -r2.5 flxrnf.F
102c102
<       INTEGER ipi,ipj,ipk
---
>       INTEGER ipi,ipj,ipk,itime
176a177
>           itime=jpmois
183c184
<      $            ,ipk,zlon,zlat,zlev,jpmois,istep,zdate0,rdt,numrof)
---
>      $            ,ipk,zlon,zlat,zlev,itime,istep,zdate0,rdt,numrof)
186c187
<               IF(iman /= jpmois) THEN
---
>               IF(itime /= jpmois) THEN
189c190
<                   IF(lwp)WRITE(numout,*) ' iman ',iman,' jpmois ',jpmois
---
>                   IF(lwp)WRITE(numout,*) ' itime ',itime,' jpmois ',jpmois
192c193
<               IF(lwp)WRITE(numout,*) iman,istep,zdate0,rdt,numrof
---
>               IF(lwp)WRITE(numout,*) itime,istep,zdate0,rdt,numrof
224a226
>               itime=jpmois
239c241
<               CALL flinget(numrof,'sorunoff',jpidta,jpjdta,1,jpmois
---
>               CALL flinget(numrof,'sorunoff',jpidta,jpjdta,1,itime
241c243
<               CALL flinget(numrof,'sorunoff',jpidta,jpjdta,1,jpmois
---
>               CALL flinget(numrof,'sorunoff',jpidta,jpjdta,1,itime
274a277
>           itime=jpmois
283c286
<           CALL flinget(numrof,'socoefr',jpidta,jpjdta,1,jpmois,nrnf1
---
>           CALL flinget(numrof,'socoefr',jpidta,jpjdta,1,itime,nrnf1
===================================================================
RCS file: /home/opalod/CVSROOT/OPA/SRC_ORCA/icelln.F,v
retrieving revision 2.10
diff -r2.10 icelln.F
42c42,45
< #if defined key_coupled || defined key_flx_lmd
---
> #if defined key_coupled
>       REAL zciobc(jpi,jpj,13)
>       REAL ztdta, zqrp
> #elif defined defined key_flx_lmd
===================================================================
RCS file: /home/opalod/CVSROOT/OPA/SRC_ORCA/icelln.coupled.h,v
retrieving revision 2.3
diff -r2.3 icelln.coupled.h
13c13,14
< CC      Original  : 2000-10 (O. Marti)
---
> CC    Original              : 2000-10 (O. Marti)
> CC    Cerfacs Predicate Run : 2001-06 (S.Valcke-E.Maisonnave)
23,25c24,28
< C  6: Solid precipitation (snow)
< C  7: Runoff
< C      UNIT : kg/(day*m2)
---
> C      UNIT : mm/day
> C  6: Solid precipitation (snow)  (positive values)
> C      UNIT : mm/day
> C  7: Runoff (positive values)
> C      UNIT : mm/day
32c35,37
< C      UNIT : Pa
---
> C      UNIT : N/m2
> C 13: Calving (positive values)
> C      UNIT : mm/day
40a46
> C         ( evap - precip + concentration - dilution )
52a59,60
> c 11: Calving (negative value)
> C      UNIT : kg/m2/s
56c64
<       IF ( kt .EQ. nit000 ) THEN
---
>       IF ( MOD(kt-1,nexco) .EQ. 0 ) THEN
77a86
>           zciobc (:,:,13) = FLOAT ( nfice-1) * sciobc (:,:,13)
97a107
>       zciobc (:,:,13) = zciobc (:,:,13) + sciobc (:,:,13)
127c137,143
<           runoff = zciobc(:,:,7)
---
> CEM  Runoff
> CEM  Field not processed by ice model :
> CEM   unity conversion must be done here
> CEM       mm/day -> kg/m2/sec
> C
>           runoff = zciobc(:,:,7)/rday
>           WRITE (numout,*) 'Init calv ', zciobc(52,2,13)
171a188
>           CALL lbc2    (sbcocn(:,:,11), 1, 1, 1, 1, 1, 1 )
188a206,208
> C ... zero of the computer
> C         rsmall
> C
196,197c216,217
<                 zstrdmp(ji,jj) = zstrdmp(ji,jj)
<      $                         + strdmp(ji,jj,jk) * fse3t(ji,jj,jk)
---
>                 zstrdmp(ji,jj) = zstrdmp(ji,jj) +
>      $              strdmp(ji,jj,jk)*fse3t(ji,jj,jk)*htr(ji,jj)
209c229,233
< C
---
> C ... Calving
>           calv(:,:)= -sbcocn(:,:,11)
>       WRITE (numout, *) 'Fin calv ', calv(52,2)
>       call flush(numout)
> c
219a244,245
> C
>               zerp = 0.0e0
222,223c248,249
<               zdmp(ji,jj) = zstrdmp(ji,jj)
<      $                    * rauw / ( sbcocn(ji,jj,7) + rsmall )
---
>               zdmp(ji,jj) = zstrdmp(ji,jj) * fse3t(ji,jj,1) * 1.e3
>      $            / ( sbcocn(ji,jj,7) + rsmall )
232c258,259
<      $                    + runoff(ji,jj) + erp(ji,jj)
---
>      $                    - runoff(ji,jj) + erp(ji,jj)
>      $                    - calv(ji,jj)
234,235c261,263
<               emp (ji,jj) = sbcocn(ji,jj,10) - zdmp(ji,jj)
<      $                    + runoff(ji,jj) + erp(ji,jj)
---
>               emp (ji,jj) = sbcocn(ji,jj,10) + zdmp(ji,jj)
>      $                    - runoff(ji,jj) + erp(ji,jj)
>      $                    - calv(ji,jj)
236a265,267
> c$$$              zerp = zsrp * ( sbcocn(ji,jj,7) - sdta(ji,jj,1) )
> c$$$     $                    / ( sbcocn(ji,jj,7) + rsmall         )
>               zerp = 0.0e0
240c271,272
<      $                    + runoff(ji,jj) + erp(ji,jj)
---
>      $                    - runoff(ji,jj) + erp(ji,jj)
>      $                    - calv(ji,jj)
===================================================================
RCS file: /home/opalod/CVSROOT/OPA/SRC_ORCA/inicmo.F,v
retrieving revision 2.2
diff -r2.2 inicmo.F
95,96c95,99
< C I- PIPE
< C--------
---
> C Define imess (infos exchanged with coupler)
>       imess(1)=kastp
>       imess(2)=kexch
>       imess(3)=kstep
>       imess(4)=getpid()
98,163d100
< C W A R N I N G : PIPE technique is temporary diseable (nov. 2000)
< C
< C
<       IF (cchan.eq.'PIPE') THEN
< c
<           WRITE(numout,*) ' '
<           WRITE(numout,*) 'Making pipes for fields to receive from CPL'
<           WRITE(numout,*) ' '
<           CALL flush(numout)
<           ierror=0
< c
< c loop to define pipes (CPL=atmos to ocean)
< c
<           DO jf=1, nflxc2o
< c            CALL PIPE_Model_Define(numout,cpl_readflx(jf),jpread,info)
<             IF (info.ne.0) ierror=ierror+1
<           END DO
<           DO jf=1, ntauc2o
< c            CALL PIPE_Model_Define(numout,cpl_readtau(jf),jpread,info)
<             IF (info.ne.0) ierror=ierror+1
<           END DO
< c
<           WRITE(numout,*) ' '
<           WRITE(numout,*) 'Making pipes for fields to send to CPL'
<           WRITE(numout,*) ' '
< c
< c loop to define pipes (ocean to atmos=CPL)
< c
<           DO jf=1, nfldo2c
< c            CALL PIPE_Model_Define(numout, cpl_writ(jf), jpwrit, info)
<             IF (info.ne.0) ierror=ierror+1
<           END DO
< c
<           IF (ierror.ne.0) THEN
<               WRITE (numout,*) 'Error in pipes definitions'
<               WRITE (numout,*) 'STOP inicmo'
<               CALL abort
<           END IF
< c
<           WRITE(numout,*) ' '
<           WRITE(numout,*) 'All pipes have been made'
<           WRITE(numout,*) ' '
< c
<           WRITE(numout,*) ' '
<           WRITE(numout,*) 'Communication test between OCE and CPL'
<           WRITE(numout,*) ' '
<           CALL flush(numout)
< c
< c          CALL PIPE_Model_Stepi(numout, imess, nmodcpl, imesso, ierror)
< c
<           IF (ierror.ne.0) THEN
<               WRITE (numout,*)
<      $            'Error in exchange first informations with Oasis'
<               WRITE (numout,*) 'STOP inicmo'
<               CALL abort
<           END IF
< c
<           WRITE(numout,*) ' '
<           WRITE(numout,*) 'Communication test between OCE and CPL is OK'
<           WRITE(numout,*) ' total simulation time in oasis = ',imesso(1)
<           WRITE(numout,*) ' total number of iterations is  = ',imesso(2)
<           WRITE(numout,*) ' value of oasis timestep  is    = ',imesso(3)
<           WRITE(numout,*) ' process id for oasis  is       = ',imesso(4)
<           WRITE(numout,*) ' '
<           CALL flush(numout)
< c
167d103
< C W A R N I N G : SVIPC technique is temporary diseable (nov. 2000)
169,170c105
< C
<       ELSE  IF (cchan.eq.'SIPC') THEN
---
>       IF (cchan.eq.'SIPC') THEN
179c114
<           cljobnam = 'IPC'      ! as $JOBNAM in namcouple
---
>           cljobnam = 'PR1'      ! as $JOBNAM in namcouple
185c120
< c          CALL SIPC_Init_Model (cljobnam, cplmodnam, 1, info)
---
>           CALL SIPC_Init_Model (cljobnam, cplmodnam, 1, info)
201c136
< c            CALL SIPC_Attach(clpoolnam, ipoolhandle)
---
>             CALL SIPC_Attach(clpoolnam, ipoolhandle)
215c150
< c            CALL SIPC_Attach(clpoolnam, ipoolhandle)
---
>             CALL SIPC_Attach(clpoolnam, ipoolhandle)
226c161
< c            CALL SIPC_Attach(clpoolnam, ipoolhandle)
---
>             CALL SIPC_Attach(clpoolnam, ipoolhandle)
239c174,180
< c          CALL SVIPC_write(mpoolinitr, imess, ipoolsize, info)
---
>           WRITE (numout,*) 'imess '
>           WRITE (numout,*) 'imess(1)', imess(1)
>           WRITE (numout,*) 'imess(2)', imess(2)
>           WRITE (numout,*) 'imess(3)', imess(3)
>           WRITE (numout,*) 'imess(4)', imess(4)
>           CALL flush(numout)
>           CALL SVIPC_write(mpoolinitr, imess, ipoolsize, info)
280c221
< c          CALL SVIPC_close(mpoolinitw, 0, info)
---
>           CALL SVIPC_close(mpoolinitw, 0, info)
===================================================================
RCS file: /home/opalod/CVSROOT/OPA/SRC_ORCA/inidtr.F,v
retrieving revision 2.4
diff -r2.4 inidtr.F
46,47c46,47
< #if defined key_freesurf_cstvol
<       CHARACTER (len=32) :: clname
---
> #if defined key_freesurf_cstvol && ! defined key_ice_lln
>       CHARACTER*32 clname
353c353
< #else
---
> # else
376c376
< #else
---
> #  else
380c380
<      $        ' analytic profile or a NetCDF file'
---
>      $        ' analytic profile'
393c393
< #else
---
> #  else
425a426,434
>             DO jj = 1, jpj
>               DO ji = 1, jpi
>                 sbcocn(ji,jj,6) = sbcocn(ji,jj,6)
>      $                          + ( nfice-1 )*( tn(ji,jj,1)+rt0 )
>                 sbcocn(ji,jj,7) = sbcocn(ji,jj,7)
>      $                          + ( nfice-1 )*  sn(ji,jj,1)
>               END DO
>             END DO
> #if defined key_coupled
428,433c437,442
<               sbcocn(ji,jj,6) = sbcocn(ji,jj,6)
<      $                        + ( nfice-1 )*( tn(ji,jj,1)+rt0 )
<               sbcocn(ji,jj,7) = sbcocn(ji,jj,7)
<      $                        + ( nfice-1 )*  sn(ji,jj,1)
<             END DO
<           END DO
---
>               sstmoy(ji,jj,1)= tn(ji,jj,1)+rt0
>               sstmoy(ji,jj,2)= tn(ji,jj,1)+rt0
>               sstmoy(ji,jj,3)= tn(ji,jj,1)+rt0
>               END DO
>             END DO
> #endif
===================================================================
RCS file: /home/opalod/CVSROOT/OPA/SRC_ORCA/parameter.coupled.h,v
retrieving revision 2.2
diff -r2.2 parameter.coupled.h
26c26
<       PARAMETER(jpmaxfld = 40)
---
>       PARAMETER(jpmaxfld = 17)
64,65d63
<       INCLUDE '../../CPL/include/clim.h'
<       INCLUDE '../../CPL/include/mpiclim.h'
66a65,72
> #include "../../CPL/include/clim.h"
> C
>       INTEGER*4 mpi_totproc(1:CLIM_MaxMod-1),mpi_nproc(0:CLIM_MaxMod-1)
> C
>       CHARACTER*6 cmpi_modnam(1:CLIM_MaxMod-1)
> C
>       common/CLIM_mpiclim/mpi_totproc, mpi_nproc, cmpi_modnam
> C
===================================================================
RCS file: /home/opalod/CVSROOT/OPA/SRC_ORCA/parlec.F,v
retrieving revision 2.3
diff -r2.3 parlec.F
586c586
<       cchan='PIPE'
---
>       cchan='SIPC'
593c593
<       nfldo2c=2
---
>       nfldo2c=3
595a596
>       cpl_writ(3)='SOALBEDO'
599,600c600,601
<       nflxc2o=6
<       cpl_readflx(1)='SONSFLDO' ! non solar heat flux (positif vers l'ocean)
---
>       nflxc2o=9
>       cpl_readflx(1)='SONSHLDO' ! non solar heat flux (positif vers l'ocean)
602,611c603,615
<       cpl_readflx(3)='SOTOPRSU' ! precip
<       cpl_readflx(4)='SOTFSHSU' ! evaporation
<       cpl_readflx(5)='SORUNCOA' ! coastal run-off
<       cpl_readflx(6)='SORIVFLU' ! river run-off
<       ntauc2o=2
<       cpl_readtau(1)='SOZOTAUX' ! first zonal wind stress
<       cpl_readtau(2)='SOZOTAU2' ! second zonal wind stress
<       cpl_readtau(3)='SOMETAUY' ! first meridien wind stress
<       cpl_readtau(4)='SOMETAU2'! second meridien wind stress
< cc
---
>       cpl_readflx(3)='SOLATHSU' ! evaporation
>       cpl_readflx(4)='SOTOLPSU' ! liq precip
>       cpl_readflx(5)='SOTOSPSU' ! solid precip
>       cpl_readflx(6)='SORUNOFF' ! run-off
>       cpl_readflx(7)='SOCALVIN' ! calving
>       cpl_readflx(8)='SODFLXDT' ! non solar flux derivative
>       cpl_readflx(9)='SOALBICE' ! surface albedo
>       ntauc2o=4
>       cpl_readtau(1)='SOZOTAUX' ! zonal wind stress ugrid
>       cpl_readtau(2)='SOMETAUY' ! meridional wind stress vgrid
>       cpl_readtau(3)='SOZOTAUV' ! zonal wind stress vgrid
>       cpl_readtau(4)='SOMETAUU' ! meridional wind stress ugrid
> c
614,615c618,620
<       cpl_f_writ(1)='ocesst'
<       cpl_f_writ(2)='oceice'
---
>       cpl_f_writ(1)='oce2oas'
>       cpl_f_writ(2)='oce2oas'
>       cpl_f_writ(3)='oce2oas'
619,628c624
<       cpl_f_readflx(1)='oceflx'
<       cpl_f_readflx(2)='oceflx'
<       cpl_f_readflx(3)='oceflx'
<       cpl_f_readflx(4)='oceflx'
<       cpl_f_readflx(5)='oceflx'
<       cpl_f_readflx(6)='oceflx'
<       cpl_f_readtau(1)='ocetau'
<       cpl_f_readtau(2)='ocetau'
<       cpl_f_readtau(3)='ocetau'
<       cpl_f_readtau(4)='ocetau'
---
> c     not used for SIPC and CLIM techniques
===================================================================
RCS file: /home/opalod/CVSROOT/OPA/SRC_ORCA/rstwri.F,v
retrieving revision 2.10
diff -r2.10 rstwri.F
164a165,168
> #if defined key_coupled
>           CALL restput(numwrs,'sstmoyb',jpi,jpj,1,0,sstmoy(:,:,1))
>           CALL restput(numwrs,'sstmoyn',jpi,jpj,1,0,sstmoy(:,:,2))
> #endif
===================================================================
RCS file: /home/opalod/CVSROOT/OPA/SRC_ORCA/stpcmo.F,v
retrieving revision 2.3
22c22
< CC    3 types :
---
> CC    2 types :
24c24
< CC      between the 3 programs
---
> CC      between the 3 programs - DISABLED
41a42
> CC       adapted   : 01-06 (S. Valcke, E. Maisonnave) Predicate coupling
46c47
<       USE ioipsl
---
> C      USE ioipsl
64c65
<       REAL zalboc(jpiglo,jpjglo),zticoc(jpiglo,jpjglo)
---
>       REAL zalboc(jpiglo,jpjglo)
69,74c70,75
<       CHARACTER*80 clcplsnam
<       INTEGER nhoridcs,nidcs,ndexcs(1)
<       SAVE nhoridcs,nidcs,ndexcs
<       LOGICAL, SAVE :: lfirsts=.true.
<       REAL zjulian,zsec
<       INTEGER iyear,imonth,iday
---
> C      CHARACTER*80 clcplsnam
> C      INTEGER nhoridcs,nidcs,ndexcs(1)
> C      SAVE nhoridcs,nidcs,ndexcs
> C      LOGICAL, SAVE :: lfirsts=.true.
> C      REAL zjulian,zsec
> C      INTEGER iyear,imonth,iday
107d107
<               ticoc(ji,jj) = 0.e0
114,115c114,115
<           ndexcs(:)=0
<           clcplsnam="cpl_oce_sst"
---
> C          ndexcs(:)=0
> C          clcplsnam="cpl_oce_sst"
118,125c118,125
<           iyear = ndastp/10000
<           imonth = ndastp/100 - iyear*100
<           iday = ndastp - imonth*100 - iyear*10000
<           iyear = ndastp/10000
<           zsec=0.
<           CALL ymds2ju(iyear,imonth,iday,zsec,zjulian)
<           CALL histbeg(clcplsnam, jpiglo,glamt,jpjglo,gphit,1,jpiglo,1
<      $        ,jpjglo,0,zjulian,rdt,nhoridcs,nidcs)
---
> C          iyear = ndastp/10000
> C          imonth = ndastp/100 - iyear*100
> C          iday = ndastp - imonth*100 - iyear*10000
> C          iyear = ndastp/10000
> C          zsec=0.
> C          CALL ymds2ju(iyear,imonth,iday,zsec,zjulian)
> C          CALL histbeg(clcplsnam, jpiglo,glamt,jpjglo,gphit,1,jpiglo,1
> C     $        ,jpjglo,0,zjulian,rdt,nhoridcs,nidcs)
127,132c127,132
<           DO jf=1,nfldo2c
<             CALL histdef(nidcs, cpl_writ(jf),cpl_writ(jf),
<      $          "-",jpi, jpj, nhoridcs, 1, 1, 1, -99, 32, "inst",
<      $          rdt,rdt)
<           END DO
<           CALL histend(nidcs)
---
> C          DO jf=1,nfldo2c
> C            CALL histdef(nidcs, cpl_writ(jf),cpl_writ(jf),
> C     $          "-",jpi, jpj, nhoridcs, 1, 1, 1, -99, 32, "inst",
> C     $          rdt,rdt)
> C          END DO
> C          CALL histend(nidcs)
142c142,143
<      $                   (tn(ji,jj,1)+rt0)
---
>      $                   (tn(ji,jj,1)+rt0) + freeze(ji,jj)*
>      $                   tn_ice(ji,jj)
146,148c147,148
<      $                    alb_ice(ji,jj)
<           ticoc(ji,jj) = ticoc(ji,jj) + freeze(ji,jj)*
<      $                  tn_ice(ji,jj)
---
>      $                    alb_ice(ji,jj) +
>      $                    0.065*(1-freeze(ji,jj))
152,153d151
<           ticoc(ji,jj) = ticoc(ji,jj) + freeze(ji,jj)*
<      $                    (-10.0 + rt0 )
172d169
<               zticoc(ji,jj) = 0.0
177,180c174,179
<               zstoc (mindi(ji),mindj(jj)) = sstoc(ji,jj) / float(nexco)
<               zieoc (mindi(ji),mindj(jj)) = sieoc(ji,jj) / float(nexco)
<               zalboc(mindi(ji),mindj(jj)) = alboc(ji,jj) / float(nexco)
<               zticoc(mindi(ji),mindj(jj)) = ticoc(ji,jj) / float(nexco)
---
>               zstoc (mindi(ji),mindj(jj)) = sstoc(ji,jj)
>      $                 / float(nexco) * tmask(ji,jj,1)
>               zieoc (mindi(ji),mindj(jj)) = sieoc(ji,jj)
>      $                 / float(nexco) * tmask(ji,jj,1)
>               zalboc(mindi(ji),mindj(jj)) = alboc(ji,jj)
>      $                 / float(nexco) * tmask(ji,jj,1)
192,196c191,194
<           CALL histwrite(nidcs,cpl_writ(1),kt,zstoc,jpi*jpj,ndexcs)
<           CALL histwrite(nidcs,cpl_writ(2),kt,zieoc,jpi*jpj,ndexcs)
<           CALL histwrite(nidcs,cpl_writ(3),kt,zalboc,jpi*jpj,ndexcs)
<           CALL histwrite(nidcs,cpl_writ(4),kt,zticoc,jpi*jpj,ndexcs)
<           CALL histsync(nidcs)
---
> C          CALL histwrite(nidcs,cpl_writ(1),kt,zstoc,jpi*jpj,ndexcs)
> C          CALL histwrite(nidcs,cpl_writ(2),kt,zieoc,jpi*jpj,ndexcs)
> C          CALL histwrite(nidcs,cpl_writ(3),kt,zalboc,jpi*jpj,ndexcs)
> C          CALL histsync(nidcs)
206c204
<               CALL histclo(nidcs)
---
> C              CALL histclo(nidcs)
265,267d262
<                 IF (jf.eq.4)
<      $              CALL locwrite(cpl_writ(jf),zticoc, isize,
<      $              ifield(jf), ierror, numout)
295,303d289
< C PIPE mode
<           IF (cchan.eq.'PIPE') THEN
< c
< c Send message to pipes for CPL=atmosphere
< c
<               DO jf=1, nfldo2c
< c                CALL PIPE_Model_Send(cpl_writ(jf), icstep, numout)
<               END DO
< c
305c291
<           ELSE IF(cchan.eq.'SIPC') THEN
---
>           IF(cchan.eq.'SIPC') THEN
320,321c306,307
< c              CALL SIPC_Write_Model(index, isize, clmodinf,
< c     $            cljobnam, infos, zstoc)
---
>               CALL SIPC_Write_Model(index, isize, clmodinf,
>      $            cljobnam, infos, zstoc)
329,330c315,317
< c              CALL SIPC_Write_Model(index, isize, clmodinf,
< c     $            cljobnam, infos, zieoc)
---
>               CALL SIPC_Write_Model(index, isize, clmodinf,
>      $            cljobnam, infos, zieoc)
> C
331a319,328
> c
> c         Writing of output field Albedo
> c
> c         Index of sea-ice in total number of fields jpfldo2a:
>               index = 3
> c
>               CALL SIPC_Write_Model(index, isize, clmodinf,
>      $            cljobnam, infos, zalboc)
> C
> c
343,344d339
<                 IF (jn.eq.4) CALL CLIM_Export(cpl_writ(jn), icstep,
<      $                                        zticoc, info)
359a355,359
> CEM On sauve sstoc dans sstmoy. Cette variable
> C   sera recuperee au pas de temps
> C   de couplage suivant dans flx.coupled.clio.h
> C
>               sstmoy(ji,jj,3)=zstoc(ji,jj)
363d362
<               ticoc(ji,jj) = 0.0
365a365,374
>               WRITE (numout,*) ' sstmoy(ji,jj,3) initialisee '
>       ELSE IF ( MOD(kt,nexco).EQ.1 .AND. kt.NE.nit000) THEN
>           DO jj = 1, jpj
>             DO ji = 1, jpi
>               sstmoy(ji,jj,1)=sstmoy(ji,jj,2)

===================================================================
RCS file: /home/opalod/CVSROOT/OPA/SRC_ORCA/tau.coupled.clio.h,v
retrieving revision 2.3
diff -r2.3 tau.coupled.clio.h
< CC   define key : 'key_coupled' and 'key_ice_lln'
---
> CC   define key : 'key_coupled'
29a30
> CC      modified       : 01-06 (E. Maisonnave) Predicate configuration
34c35
<       USE ioipsl
---
> C      USE ioipsl
39c40
< CDIR$ LIST
---
> CDIR$ LIST
46,50c47,48
<       REAL ztauxxu (jpiglo,jpjglo), ztauxxv (jpiglo,jpjglo)
<       REAL ztauyyu (jpiglo,jpjglo), ztauyyv (jpiglo,jpjglo)
<       REAL ztauzzu (jpiglo,jpjglo), ztauzzv (jpiglo,jpjglo)
<       REAL ztauxx(jpi,jpj), ztauyy(jpi,jpj),ztauzz(jpi,jpj)
<       REAL ztauver(jpi,jpj)
---
>       REAL ztaux (jpiglo,jpjglo),ztauy (jpiglo,jpjglo)
>       REAL ztauxv(jpiglo,jpjglo),ztauyu(jpiglo,jpjglo)
56,61c54,59
<       CHARACTER*80 clcpltnam
<       INTEGER nhoridct,nidct,ndexct(jpi*jpj)
<       SAVE nhoridct,nidct,ndexct
<       LOGICAL, SAVE :: lfirstt=.true.
<       INTEGER iyear,imonth,iday
<       REAL zjulian,zsec
---
> C      CHARACTER*80 clcpltnam
> C      INTEGER nhoridct,nidct,ndexct(jpi*jpj)
> C      SAVE nhoridct,nidct,ndexct
> C      LOGICAL, SAVE :: lfirstt=.true.
> C      INTEGER iyear,imonth,iday
> C      REAL zjulian,zsec
65c63
<       CHARACTER*3 clmodinf      ! Header or not
---
>       CHARACTER*3 clmodinf       ! Header or not
82a81
> C
87,91c86,90
<       IF (lfirstt) THEN
<           lfirstt=.false.
<           ndexct(:)=0
<           clcpltnam="cpl_oce_tau"
< C
---
> C      IF (lfirstt) THEN
> C          lfirstt=.false.
> C          ndexct(:)=0
> C          clcpltnam="cpl_oce_tau"
> CC
93,124c92,111
<           iyear = ndastp/10000
<           imonth = ndastp/100 - iyear*100
<           iday = ndastp - imonth*100 - iyear*10000
<           iyear = ndastp/10000
<           zsec=0.
<           CALL ymds2ju(iyear,imonth,iday,zsec,zjulian)
<           CALL histbeg(clcpltnam, jpiglo,glamt,jpjglo,gphit,1,jpiglo,1
<      $        ,jpjglo,0,zjulian,rdt,nhoridct,nidct)
< C no vertical axis
<           CALL histdef(nidct, 'taux','taux', "-",jpi, jpj, nhoridct,
<      $        1, 1, 1, -99, 32, "inst",rdt,rdt)
<           CALL histdef(nidct, 'tauy','tauy', "-",jpi, jpj, nhoridct,
<      $        1, 1, 1, -99, 32, "inst",rdt,rdt)
<           CALL histdef(nidct, 'tauxeu','tauxeu', "-",jpi, jpj, nhoridct,
<      $        1, 1, 1, -99, 32, "inst",rdt,rdt)
<           CALL histdef(nidct, 'tauynu','tauynu', "-",jpi, jpj, nhoridct,
<      $        1, 1, 1, -99, 32, "inst",rdt,rdt)
<           CALL histdef(nidct, 'tauzzu','tauzzu', "-",jpi, jpj, nhoridct,
<      $        1, 1, 1, -99, 32, "inst",rdt,rdt)
<           CALL histdef(nidct, 'tauxev','tauxev', "-",jpi, jpj, nhoridct,
<      $        1, 1, 1, -99, 32, "inst",rdt,rdt)
<           CALL histdef(nidct, 'tauynv','tauynv', "-",jpi, jpj, nhoridct,
<      $        1, 1, 1, -99, 32, "inst",rdt,rdt)
<           CALL histdef(nidct, 'tauzzv','tauzzv', "-",jpi, jpj, nhoridct,
<      $        1, 1, 1, -99, 32, "inst",rdt,rdt)
<           DO jf=1,ntauc2o
<             CALL histdef(nidct, cpl_readtau(jf),cpl_readtau(jf),
<      $          "-",jpi, jpj, nhoridct, 1, 1, 1, -99, 32, "inst",
<      $          rdt,rdt)
<           END DO
<           CALL histend(nidct)
<       ENDIF
---
> C          iyear = ndastp/10000
> C          imonth = ndastp/100 - iyear*100
> C          iday = ndastp - imonth*100 - iyear*10000
> C          iyear = ndastp/10000
> C          zsec=0.
> C          CALL ymds2ju(iyear,imonth,iday,zsec,zjulian)
> C          CALL histbeg(clcpltnam, jpiglo,glamt,jpjglo,gphit,1,jpiglo,1
> C     $        ,jpjglo,0,zjulian,rdt,nhoridct,nidct)
> CC
> C          CALL histdef(nidct, 'taux','taux', "-",jpi, jpj, nhoridct,
> C     $        1, 1, 1, -99, 32, "inst",rdt,rdt)
> C          CALL histdef(nidct, 'tauy','tauy', "-",jpi, jpj, nhoridct,
> C     $        1, 1, 1, -99, 32, "inst",rdt,rdt)
> C          DO jf=1,ntauc2o
> C            CALL histdef(nidct, cpl_readtau(jf),cpl_readtau(jf),
> C     $          "-",jpi, jpj, nhoridct, 1, 1, 1, -99, 32, "inst",
> C     $          rdt,rdt)
> C          END DO
> C          CALL histend(nidct)
> C      ENDIF
134,167c121
<           IF (cchan.eq.'PIPE') THEN
< c
< c UNIT number for fields
< c
<               inuread = 99
< c
< c exchanges from to atmosphere=CPL to ocean
< c
<               DO jf=1,ntauc2o
< c                CALL PIPE_Model_Recv(cpl_readtau(jf), icpliter, numout)
<                 OPEN (inuread, FILE=cpl_f_readtau(jf), FORM
<      $              ='UNFORMATTED')
<                 IF (jf.eq.1)
<      $              CALL locread(cpl_readtau(jf), ztauxxu,isize,inuread,
<      $              iflag,numout)
<                 IF (jf.eq.2)
<      $              CALL locread(cpl_readtau(jf), ztauyyu,isize,inuread
<      $              ,iflag,numout)
<                 IF (jf.eq.3)
<      $              CALL locread(cpl_readtau(jf), ztauzzu,isize,inuread,
<      $              iflag,numout)
<                 IF (jf.eq.4)
<      $              CALL locread(cpl_readtau(jf), ztauxxv,isize,inuread
<      $              ,iflag,numout)
<                 IF (jf.eq.5)
<      $              CALL locread(cpl_readtau(jf), ztauyyv,isize,inuread
<      $              ,iflag,numout)
<                 IF (jf.eq.6)
<      $              CALL locread(cpl_readtau(jf), ztauyyv,isize,inuread
<      $              ,iflag,numout)
<                 CLOSE (inuread)
<               END DO
< c
<           ELSE IF (cchan.eq.'SIPC') THEN
---
>         IF (cchan.eq.'SIPC') THEN
174,176c128,130
<               index = 1
< c              CALL SIPC_Read_Model(index, isize, clmodinf,
< c     $            cljobnam_r, infos, ztaux)
---
>               index = 1+nflxc2o
>               CALL SIPC_Read_Model(index, isize, clmodinf,
>      $            cljobnam_r, infos, ztaux)
178c132
< c         reading of input field meridional wind stress SOZOTAU2 (at v point)
---
> c         reading of input field meridional wind stress SOMETAUY
180,182c134,136
<               index = 2
< c              CALL SIPC_Read_Model(index, isize, clmodinf,
< c     $            cljobnam_r, infos, ztaux2)
---
>               index = 2+nflxc2o
>               CALL SIPC_Read_Model(index, isize, clmodinf,
>      $            cljobnam_r, infos, ztauy)
184c138
< c         reading of input field zonal wind stress SOMETAUY
---
> c         reading of input field zonal wind stress SOZOTAUV (at v point)
186,188c140,142
<               index = 3
< c              CALL SIPC_Read_Model(index, isize, clmodinf,
< c     $            cljobnam_r, infos, ztauy)
---
>               index = 3+nflxc2o
>               CALL SIPC_Read_Model(index, isize, clmodinf,
>      $            cljobnam_r, infos, ztauxv)
190c144
< c         reading of input field meridional wind stress SOMETAU2 (at u point)
---
> c         reading of input field meridional wind stress SOMETAUU (at u point)
192,194c146,148
<               index = 4
< c              CALL SIPC_Read_Model(index, isize, clmodinf,
< c     $            cljobnam_r, infos, ztauy2)
---
>               index = 4+nflxc2o
>               CALL SIPC_Read_Model(index, isize, clmodinf,
>      $            cljobnam_r, infos, ztauyu)
198,199c152
< c
<               WRITE (numout,*) 'Reading wind stress from coupler ', kt
---
> c
205c158
<      $              ztauxxu,info)
---
>      $              ztaux,info)
207c160
<      $              ztauyyu,info)
---
>      $              ztauy,info)
209c162
<      $              ztauzzu,info)
---
>      $              ztauxv,info)
211,215c164
<      $              ztauxxv,info)
<                 IF (jf.eq.5) CALL CLIM_Import (cpl_readtau(jf), itm1,
<      $              ztauyyv,info)
<                 IF (jf.eq.6) CALL CLIM_Import (cpl_readtau(jf), itm1,
<      $              ztauzzv,info)
---
>      $              ztauyu,info)
225,241d173
<
<           DO jf=1,ntauc2o
<             IF (jf.eq.1) CALL histwrite(nidct,cpl_readtau(jf), kt
<      $          ,ztauxxu,jpi*jpj,ndexct)
<             IF (jf.eq.2) CALL histwrite(nidct,cpl_readtau(jf), kt
<      $          ,ztauyyu,jpi*jpj,ndexct)
<             IF (jf.eq.3) call histwrite(nidct,cpl_readtau(jf), kt
<      $          ,ztauzzu,jpi*jpj,ndexct)
<             IF (jf.eq.4) call histwrite(nidct,cpl_readtau(jf), kt
<      $          ,ztauxxv,jpi*jpj,ndexct)
<             IF (jf.eq.5) call histwrite(nidct,cpl_readtau(jf), kt
<      $          ,ztauyyv,jpi*jpj,ndexct)
<             IF (jf.eq.6) call histwrite(nidct,cpl_readtau(jf), kt
<      $          ,ztauzzv,jpi*jpj,ndexct)
<           END DO
<
<           CALL histsync(nidct)
243,251c175,184
< C 2. CHANGING DATA GRID COORDINATES --> GLOBAL GRID COORDINATES
< C -------------------------------------------------------------
< C On u grid
<           DO jj=1,jpj
<             DO ji=1,jpi
<               ztauxx (ji,jj) = ztauxxu (mindi(ji),mindj(jj))
<               ztauyy (ji,jj) = ztauyyu (mindi(ji),mindj(jj))
<               ztauzz (ji,jj) = ztauzzu (mindi(ji),mindj(jj))
<             END DO
---
> CEM
> C   Fichier de masque a revoir dans Oasis
> C   On recopie temporairement la premiere colonne de donnees dans l
> C   avant derniere
> CEM
>           DO jj=1,nlcj
>             ztaux(jpi-1,jj)=ztaux(1,jj)
>             ztauy(jpi-1,jj)=ztauy(1,jj)
>             ztauxv(jpi-1,jj)=ztauxv(1,jj)
>             ztauyu(jpi-1,jj)=ztauyu(1,jj)
254,256d186
<           CALL geo2oce( ztauxx, ztauyy, ztauzz, 'u', glamu, gphiu,
<      $        tauxg, ztauyg, ztauver )
<
258,260c188,200
<           CALL histwrite(nidct,'tauxeu', kt ,tauxg,jpi*jpj ,ndexct)
<           CALL histwrite(nidct,'tauynu', kt ,ztauyg,jpi*jpj ,ndexct)
<           CALL histwrite(nidct,'tauzzu', kt ,ztauver,jpi*jpj ,ndexct)
---
> C          DO jf=1,ntauc2o
> C            IF (jf.eq.1) CALL histwrite(nidct,cpl_readtau(jf), kt
> C     $          ,ztaux,jpi*jpj,ndexct)
> C            IF (jf.eq.2) CALL histwrite(nidct,cpl_readtau(jf), kt
> C     $          ,ztauyu,jpi*jpj,ndexct)
> C            IF (jf.eq.3) call histwrite(nidct,cpl_readtau(jf), kt
> C     $          ,ztauxv,jpi*jpj,ndexct)
> C            IF (jf.eq.4) call histwrite(nidct,cpl_readtau(jf), kt
> C     $          ,ztauy,jpi*jpj,ndexct)
> C          END DO
> C
> C          CALL histsync(nidct)
> C
262,263c202,205
<
< C On v grid
---
> C
> C 2. CHANGING DATA GRID COORDINATES --> GLOBAL GRID COORDINATES
> C -------------------------------------------------------------
> C
266,268c208,211
<               ztauxx (ji,jj) = ztauxxv (mindi(ji),mindj(jj))
<               ztauyy (ji,jj) = ztauyyv (mindi(ji),mindj(jj))
<               ztauzz (ji,jj) = ztauzzv (mindi(ji),mindj(jj))
---
>               tauxg (ji,jj)= ztaux (mindi(ji),mindj(jj))
>               tauyg (ji,jj)= ztauy (mindi(ji),mindj(jj))
>               ztauxg(ji,jj)= ztauxv(mindi(ji),mindj(jj))
>               ztauyg(ji,jj)= ztauyu(mindi(ji),mindj(jj))
272,281d214
<           CALL geo2oce( ztauxx, ztauyy, ztauzz, 'v', glamv, gphiv,
<      $        ztauxg, tauyg, ztauver )
<
< CCC TEMPORARY IOIPSL OUTPUTS START
<           CALL histwrite(nidct,'tauxev', kt ,ztauxg,jpi*jpj ,ndexct)
<           CALL histwrite(nidct,'tauynv', kt ,tauyg,jpi*jpj ,ndexct)
<           CALL histwrite(nidct,'tauzzv', kt ,ztauver,jpi*jpj ,ndexct)
< CCC TEMPORARY IOIPSL OUTPUTS END
<
< C
288,291c221,226
<           CALL histwrite(nidct,'taux', kt ,taux,jpi*jpj ,ndexct)
<           CALL histwrite(nidct,'tauy', kt ,tauy,jpi*jpj ,ndexct)
<           CALL histsync(nidct)
<           IF (nitend-kt.LT.nexco) CALL histclo(nidct)
---
> C          CALL histwrite(nidct,'taux', kt ,taux,jpi*jpj ,ndexct)
> C          CALL histwrite(nidct,'tauy', kt ,tauy,jpi*jpj ,ndexct)
> C          CALL histsync(nidct)
> C
> C       IF (nitend-kt.LT.nexco) CALL histclo(nidct)
> C