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.
sbcice_cice.F90 in branches/2012/dev_3352_UKMO8_CICE/NEMOGCM/NEMO/OPA_SRC/SBC – NEMO

source: branches/2012/dev_3352_UKMO8_CICE/NEMOGCM/NEMO/OPA_SRC/SBC/sbcice_cice.F90 @ 3356

Last change on this file since 3356 was 3356, checked in by charris, 12 years ago

#953 Changes to give salinity dependence for freezing temperature (except in the fully coupled case when the UM still requires that freezing temperature is fixed as -1.8). More details in ticket.

File size: 38.5 KB
Line 
1MODULE sbcice_cice
2   !!======================================================================
3   !!                       ***  MODULE  sbcice_cice  ***
4   !! To couple with sea ice model CICE (LANL)
5   !!=====================================================================
6#if defined key_cice
7   !!----------------------------------------------------------------------
8   !!   'key_cice' :                                     CICE sea-ice model
9   !!----------------------------------------------------------------------
10   !!   sbc_ice_cice  : sea-ice model time-stepping and update ocean sbc over ice-covered area
11   !!   
12   !!   
13   !!----------------------------------------------------------------------
14   USE oce             ! ocean dynamics and tracers
15   USE dom_oce         ! ocean space and time domain
16   USE domvvl
17   USE phycst, only : rcp, rau0
18   USE eosbn2, only : tfreez
19   USE in_out_manager  ! I/O manager
20   USE lib_mpp         ! distributed memory computing library
21   USE lbclnk          ! ocean lateral boundary conditions (or mpp link)
22   USE wrk_nemo        ! work arrays
23   USE timing          ! Timing
24   USE daymod          ! calendar
25   USE fldread         ! read input fields
26
27   USE sbc_oce         ! Surface boundary condition: ocean fields
28   USE sbc_ice         ! Surface boundary condition: ice   fields
29   USE sbcblk_core     ! Surface boundary condition: CORE bulk
30   USE sbccpl
31
32   USE ice_kinds_mod
33   USE ice_blocks
34   USE ice_domain
35   USE ice_domain_size
36   USE ice_boundary
37   USE ice_constants
38   USE ice_gather_scatter
39   USE ice_calendar, only: dt
40   USE ice_state, only: aice,aicen,uvel,vvel,vsnon,vicen
41   USE ice_flux, only: strax,stray,strocnx,strocny,frain,fsnow,  &
42                sst,sss,uocn,vocn,ss_tltx,ss_tlty,fsalt_gbm,     &
43                fresh_gbm,fhocn_gbm,fswthru_gbm,frzmlt,          &
44                flatn_f,fsurfn_f,fcondtopn_f,                    &
45                uatm,vatm,wind,fsw,flw,Tair,potT,Qa,rhoa,zlvl,   &
46                swvdr,swvdf,swidr,swidf,Tf
47   USE ice_forcing, only: frcvdr,frcvdf,frcidr,frcidf
48   USE ice_atmo, only: calc_strair
49   USE ice_therm_vertical, only: calc_Tsfc
50
51   USE CICE_InitMod
52   USE CICE_RunMod
53   USE CICE_FinalMod
54
55   IMPLICIT NONE
56   PRIVATE
57
58   !! * Routine accessibility
59   PUBLIC cice_sbc_init   ! routine called by sbc_init
60   PUBLIC cice_sbc_final  ! routine called by sbc_final
61   PUBLIC sbc_ice_cice    ! routine called by sbc
62
63   INTEGER , PARAMETER ::   jpfld   = 13   ! maximum number of files to read
64   INTEGER , PARAMETER ::   jp_snow = 1    ! index of snow file
65   INTEGER , PARAMETER ::   jp_rain = 2    ! index of rain file
66   INTEGER , PARAMETER ::   jp_sblm = 3    ! index of sublimation file
67   INTEGER , PARAMETER ::   jp_top1 = 4    ! index of category 1 topmelt file
68   INTEGER , PARAMETER ::   jp_top2 = 5    ! index of category 2 topmelt file
69   INTEGER , PARAMETER ::   jp_top3 = 6    ! index of category 3 topmelt file
70   INTEGER , PARAMETER ::   jp_top4 = 7    ! index of category 4 topmelt file
71   INTEGER , PARAMETER ::   jp_top5 = 8    ! index of category 5 topmelt file
72   INTEGER , PARAMETER ::   jp_bot1 = 9    ! index of category 1 botmelt file
73   INTEGER , PARAMETER ::   jp_bot2 = 10   ! index of category 2 botmelt file
74   INTEGER , PARAMETER ::   jp_bot3 = 11   ! index of category 3 botmelt file
75   INTEGER , PARAMETER ::   jp_bot4 = 12   ! index of category 4 botmelt file
76   INTEGER , PARAMETER ::   jp_bot5 = 13   ! index of category 5 botmelt file
77   TYPE(FLD), ALLOCATABLE, DIMENSION(:) ::   sf    ! structure of input fields (file informations, fields read)
78
79   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:), PRIVATE ::   png     ! local array used in sbc_cice_ice
80
81   !! * Substitutions
82#  include "domzgr_substitute.h90"
83
84CONTAINS
85
86   INTEGER FUNCTION sbc_ice_cice_alloc()
87      !!----------------------------------------------------------------------
88      !!                ***  FUNCTION sbc_ice_cice_alloc  ***
89      !!----------------------------------------------------------------------
90      ALLOCATE( png(jpi,jpj,jpnij), STAT=sbc_ice_cice_alloc )
91      IF( lk_mpp                 )   CALL mpp_sum ( sbc_ice_cice_alloc )
92      IF( sbc_ice_cice_alloc > 0 )   CALL ctl_warn('sbc_ice_cice_alloc: allocation of arrays failed.')
93   END FUNCTION sbc_ice_cice_alloc
94
95   SUBROUTINE sbc_ice_cice( kt, nsbc )
96      !!---------------------------------------------------------------------
97      !!                  ***  ROUTINE sbc_ice_cice  ***
98      !!                   
99      !! ** Purpose :   update the ocean surface boundary condition via the
100      !!                CICE Sea Ice Model time stepping
101      !!
102      !! ** Method  : - Get any extra forcing fields for CICE 
103      !!              - Prepare forcing fields
104      !!              - CICE model time stepping
105      !!              - call the routine that computes mass and
106      !!                heat fluxes at the ice/ocean interface
107      !!
108      !! ** Action  : - time evolution of the CICE sea-ice model
109      !!              - update all sbc variables below sea-ice:
110      !!                utau, vtau, qns , qsr, emp , emps
111      !!---------------------------------------------------------------------
112      INTEGER, INTENT(in) ::   kt      ! ocean time step
113      INTEGER, INTENT(in) ::   nsbc    ! surface forcing type
114      !!----------------------------------------------------------------------
115      !
116      IF( nn_timing == 1 )  CALL timing_start('sbc_ice_cice')
117      !
118      !                                        !----------------------!
119      IF( MOD( kt-1, nn_fsbc ) == 0 ) THEN     !  Ice time-step only  !
120         !                                     !----------------------!
121
122         ! Make sure any fluxes required for CICE are set
123         IF ( nsbc == 2 )  THEN
124            CALL cice_sbc_force(kt)
125         ELSE IF ( nsbc == 5 ) THEN
126            CALL sbc_cpl_ice_flx( 1.0-fr_i  )
127         ENDIF
128
129         CALL cice_sbc_in ( kt, nsbc )
130         CALL CICE_Run
131         CALL cice_sbc_out ( kt, nsbc )
132
133         IF ( nsbc == 5 )  CALL cice_sbc_hadgam(kt+1)
134
135      ENDIF                                          ! End sea-ice time step only
136      !
137      IF( nn_timing == 1 )  CALL timing_stop('sbc_ice_cice')
138
139   END SUBROUTINE sbc_ice_cice
140
141   SUBROUTINE cice_sbc_init (nsbc)
142      !!---------------------------------------------------------------------
143      !!                    ***  ROUTINE cice_sbc_init  ***
144      !! ** Purpose: Initialise ice related fields for NEMO and coupling
145      !!
146      INTEGER, INTENT( in  ) ::   nsbc ! surface forcing type
147      !!---------------------------------------------------------------------
148
149      INTEGER  ::   ji, jj, jk, jl             ! dummy loop indices
150      REAL(wp), DIMENSION(:,:,:), POINTER :: ztmp
151
152      IF( nn_timing == 1 )  CALL timing_start('cice_sbc_init')
153      !
154      CALL wrk_alloc( jpi,jpj,jpk, ztmp )
155      IF(lwp) WRITE(numout,*)'cice_sbc_init'
156
157! Initialize CICE
158      CALL CICE_Initialize
159
160! Do some CICE consistency checks
161      IF ( (nsbc == 2) .OR. (nsbc == 5) ) THEN
162         IF ( calc_strair .OR. calc_Tsfc ) THEN
163            CALL ctl_stop( 'STOP', 'cice_sbc_init : Forcing option requires calc_strair=F and calc_Tsfc=F in ice_in' )
164         ENDIF
165      ELSEIF (nsbc == 4) THEN
166         IF ( .NOT. (calc_strair .AND. calc_Tsfc) ) THEN
167            CALL ctl_stop( 'STOP', 'cice_sbc_init : Forcing option requires calc_strair=T and calc_Tsfc=T in ice_in' )
168         ENDIF
169      ENDIF
170
171
172! allocate sbc_ice and sbc_cice arrays
173      IF( sbc_ice_alloc()      /= 0 )   CALL ctl_stop( 'STOP', 'sbc_ice_cice_alloc : unable to allocate arrays' )
174      IF( sbc_ice_cice_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'sbc_ice_cice_alloc : unable to allocate cice arrays' )
175
176! Set freezing temperatures and ensure consistency between NEMO and CICE
177! (-1.8 for fully coupled, salinity dependence otherwise)
178! Setting of Tf here or in cice_sbc_in will over-write anything already done in cice_init
179! Ensure ocean temperatures are nowhere below freezing if not a NEMO restart
180
181      IF (nsbc == 5) THEN
182         ztmp(:,:,:)=-1.8
183         CALL nemo2cice(ztmp(:,:,1),Tf,'T', 1. )     ! Set in CICE here as won't be updated in cice_sbc_in 
184      ELSE
185         DO jk=1,jpk
186            ztmp(:,:,jk)= tfreez(tsn(:,:,jk,jp_sal),fsdepw(:,:,jk))
187         ENDDO
188      ENDIF
189
190      IF( .NOT. ln_rstart ) THEN
191         tsn(:,:,:,jp_tem) = MAX (tsn(:,:,:,jp_tem),ztmp)
192         tsb(:,:,:,jp_tem) = tsn(:,:,:,jp_tem)
193      ENDIF
194
195      fr_iu(:,:)=0.0
196      fr_iv(:,:)=0.0
197
198      CALL cice2nemo(aice,fr_i, 'T', 1. )
199      IF ( (nsbc == 2).OR.(nsbc == 5) ) THEN
200         DO jl=1,ncat
201            CALL cice2nemo(aicen(:,:,jl,:),a_i(:,:,jl), 'T', 1. )
202         ENDDO
203      ENDIF
204
205! T point to U point
206! T point to V point
207      DO jj=1,jpjm1
208         DO ji=1,jpim1
209            fr_iu(ji,jj)=0.5*(fr_i(ji,jj)+fr_i(ji+1,jj))*umask(ji,jj,1)
210            fr_iv(ji,jj)=0.5*(fr_i(ji,jj)+fr_i(ji,jj+1))*vmask(ji,jj,1)
211         ENDDO
212      ENDDO
213
214      CALL lbc_lnk ( fr_iu , 'U', 1. )
215      CALL lbc_lnk ( fr_iv , 'V', 1. )
216      !
217      CALL wrk_dealloc( jpi,jpj,jpk, ztmp )
218      !
219      IF( nn_timing == 1 )  CALL timing_stop('cice_sbc_init')
220      !
221   END SUBROUTINE cice_sbc_init
222
223   
224   SUBROUTINE cice_sbc_in (kt, nsbc)
225      !!---------------------------------------------------------------------
226      !!                    ***  ROUTINE cice_sbc_in  ***
227      !! ** Purpose: Set coupling fields and pass to CICE
228      !!---------------------------------------------------------------------
229      INTEGER, INTENT(in   ) ::   kt   ! ocean time step
230      INTEGER, INTENT(in   ) ::   nsbc ! surface forcing type
231
232      INTEGER  ::   ji, jj, jl                   ! dummy loop indices     
233      REAL(wp), DIMENSION(:,:), POINTER :: ztmp
234      REAL(wp), DIMENSION(:,:,:), POINTER :: ztmpn
235      !!---------------------------------------------------------------------
236
237      IF( nn_timing == 1 )  CALL timing_start('cice_sbc_in')
238      !
239      CALL wrk_alloc( jpi,jpj, ztmp )
240      CALL wrk_alloc( jpi,jpj,ncat, ztmpn )
241
242      IF( kt == nit000 )  THEN
243         IF(lwp) WRITE(numout,*)'cice_sbc_in'
244      ENDIF
245
246      ztmp(:,:)=0.0
247
248! Aggregate ice concentration already set in cice_sbc_out (or cice_sbc_init on
249! the first time-step)
250
251! forced and coupled case
252
253      IF ( (nsbc == 2).OR.(nsbc == 5) ) THEN
254
255         ztmpn(:,:,:)=0.0
256
257! x comp of wind stress (CI_1)
258! U point to F point
259         DO jj=1,jpjm1
260            DO ji=1,jpi
261               ztmp(ji,jj) = 0.5 * (  fr_iu(ji,jj) * utau(ji,jj)      &
262                                    + fr_iu(ji,jj+1) * utau(ji,jj+1) ) * fmask(ji,jj,1)
263            ENDDO
264         ENDDO
265         CALL nemo2cice(ztmp,strax,'F', -1. )
266
267! y comp of wind stress (CI_2)
268! V point to F point
269         DO jj=1,jpj
270            DO ji=1,jpim1
271               ztmp(ji,jj) = 0.5 * (  fr_iv(ji,jj) * vtau(ji,jj)      &
272                                    + fr_iv(ji+1,jj) * vtau(ji+1,jj) ) * fmask(ji,jj,1)
273            ENDDO
274         ENDDO
275         CALL nemo2cice(ztmp,stray,'F', -1. )
276
277! Surface downward latent heat flux (CI_5)
278         IF (nsbc == 2) THEN
279            DO jl=1,ncat
280               ztmpn(:,:,jl)=qla_ice(:,:,1)*a_i(:,:,jl)
281            ENDDO
282         ELSE
283! emp_ice is set in sbc_cpl_ice_flx as sublimation-snow
284            qla_ice(:,:,1)= - ( emp_ice(:,:)+sprecip(:,:) ) * Lsub
285! End of temporary code
286            DO jj=1,jpj
287               DO ji=1,jpi
288                  IF (fr_i(ji,jj).eq.0.0) THEN
289                     DO jl=1,ncat
290                        ztmpn(ji,jj,jl)=0.0
291                     ENDDO
292                     ! This will then be conserved in CICE
293                     ztmpn(ji,jj,1)=qla_ice(ji,jj,1)
294                  ELSE
295                     DO jl=1,ncat
296                        ztmpn(ji,jj,jl)=qla_ice(ji,jj,1)*a_i(ji,jj,jl)/fr_i(ji,jj)
297                     ENDDO
298                  ENDIF
299               ENDDO
300            ENDDO
301         ENDIF
302         DO jl=1,ncat
303            CALL nemo2cice(ztmpn(:,:,jl),flatn_f(:,:,jl,:),'T', 1. )
304
305! GBM conductive flux through ice (CI_6)
306!  Convert to GBM
307            IF (nsbc == 2) THEN
308               ztmp(:,:) = botmelt(:,:,jl)*a_i(:,:,jl)
309            ELSE
310               ztmp(:,:) = botmelt(:,:,jl)
311            ENDIF
312            CALL nemo2cice(ztmp,fcondtopn_f(:,:,jl,:),'T', 1. )
313
314! GBM surface heat flux (CI_7)
315!  Convert to GBM
316            IF (nsbc == 2) THEN
317               ztmp(:,:) = (topmelt(:,:,jl)+botmelt(:,:,jl))*a_i(:,:,jl) 
318            ELSE
319               ztmp(:,:) = (topmelt(:,:,jl)+botmelt(:,:,jl))
320            ENDIF
321            CALL nemo2cice(ztmp,fsurfn_f(:,:,jl,:),'T', 1. )
322         ENDDO
323
324      ELSE IF (nsbc == 4) THEN
325
326! Pass CORE forcing fields to CICE (which will calculate heat fluxes etc itself)
327! x comp and y comp of atmosphere surface wind (CICE expects on T points)
328         ztmp(:,:) = wndi_ice(:,:)
329         CALL nemo2cice(ztmp,uatm,'T', -1. )
330         ztmp(:,:) = wndj_ice(:,:)
331         CALL nemo2cice(ztmp,vatm,'T', -1. )
332         ztmp(:,:) = SQRT ( wndi_ice(:,:)**2 + wndj_ice(:,:)**2 )
333         CALL nemo2cice(ztmp,wind,'T', 1. )    ! Wind speed (m/s)
334         ztmp(:,:) = qsr_ice(:,:,1)
335         CALL nemo2cice(ztmp,fsw,'T', 1. )     ! Incoming short-wave (W/m^2)
336         ztmp(:,:) = qlw_ice(:,:,1)
337         CALL nemo2cice(ztmp,flw,'T', 1. )     ! Incoming long-wave (W/m^2)
338         ztmp(:,:) = tatm_ice(:,:)
339         CALL nemo2cice(ztmp,Tair,'T', 1. )    ! Air temperature (K)
340         CALL nemo2cice(ztmp,potT,'T', 1. )    ! Potential temp (K)
341! Following line uses MAX(....) to avoid problems if tatm_ice has unset halo rows 
342         ztmp(:,:) = 101000. / ( 287.04 * MAX(1.0,tatm_ice(:,:)) )   
343                                               ! Constant (101000.) atm pressure assumed
344         CALL nemo2cice(ztmp,rhoa,'T', 1. )    ! Air density (kg/m^3)
345         ztmp(:,:) = qatm_ice(:,:)
346         CALL nemo2cice(ztmp,Qa,'T', 1. )      ! Specific humidity (kg/kg)
347         ztmp(:,:)=10.0
348         CALL nemo2cice(ztmp,zlvl,'T', 1. )    ! Atmos level height (m)
349
350! May want to check all values are physically realistic (as in CICE routine
351! prepare_forcing)?
352
353! Divide shortwave into spectral bands (as in prepare_forcing)
354         ztmp(:,:)=qsr_ice(:,:,1)*frcvdr       ! visible direct
355         CALL nemo2cice(ztmp,swvdr,'T', 1. )             
356         ztmp(:,:)=qsr_ice(:,:,1)*frcvdf       ! visible diffuse
357         CALL nemo2cice(ztmp,swvdf,'T', 1. )             
358         ztmp(:,:)=qsr_ice(:,:,1)*frcidr       ! near IR direct
359         CALL nemo2cice(ztmp,swidr,'T', 1. )
360         ztmp(:,:)=qsr_ice(:,:,1)*frcidf       ! near IR diffuse
361         CALL nemo2cice(ztmp,swidf,'T', 1. )
362
363      ENDIF
364
365! Snowfall
366! Ensure fsnow is positive (as in CICE routine prepare_forcing) 
367      ztmp(:,:)=MAX(fr_i(:,:)*sprecip(:,:),0.0) 
368      CALL nemo2cice(ztmp,fsnow,'T', 1. ) 
369
370! Rainfall
371      ztmp(:,:)=fr_i(:,:)*(tprecip(:,:)-sprecip(:,:))
372      CALL nemo2cice(ztmp,frain,'T', 1. ) 
373
374! Recalculate freezing temperature and send to CICE except for fully coupled when
375! it remains as -1.8 throughout the run
376      IF ( nsbc==5 ) THEN
377         ztmp(:,:)=-1.8
378      ELSE
379         ztmp(:,:)=tfreez(sss_m(:,:))
380         CALL nemo2cice(ztmp,Tf,'T', 1. )
381      ENDIF
382
383! Freezing/melting potential
384! Calculated over NEMO leapfrog timestep (hence 2*dt)
385      nfrzmlt(:,:)=rau0*rcp*fse3t_m(:,:,1)*(ztmp(:,:)-sst_m(:,:))/(2.0*dt)
386      CALL nemo2cice(nfrzmlt,frzmlt,'T', 1. )
387
388! SST  and SSS
389
390      CALL nemo2cice(sst_m,sst,'T', 1. )
391      CALL nemo2cice(sss_m,sss,'T', 1. )
392
393! x comp and y comp of surface ocean current
394! U point to F point
395      DO jj=1,jpjm1
396         DO ji=1,jpi
397            ztmp(ji,jj)=0.5*(ssu_m(ji,jj)+ssu_m(ji,jj+1))*fmask(ji,jj,1)
398         ENDDO
399      ENDDO
400      CALL nemo2cice(ztmp,uocn,'F', -1. )
401
402! V point to F point
403      DO jj=1,jpj
404         DO ji=1,jpim1
405            ztmp(ji,jj)=0.5*(ssv_m(ji,jj)+ssv_m(ji+1,jj))*fmask(ji,jj,1)
406         ENDDO
407      ENDDO
408      CALL nemo2cice(ztmp,vocn,'F', -1. )
409
410! x comp and y comp of sea surface slope (on F points)
411! T point to F point
412      DO jj=1,jpjm1
413         DO ji=1,jpim1
414            ztmp(ji,jj)=0.5 * (  (ssh_m(ji+1,jj  )-ssh_m(ji,jj  ))/e1u(ji,jj  )   &
415                               + (ssh_m(ji+1,jj+1)-ssh_m(ji,jj+1))/e1u(ji,jj+1) ) & 
416                            *  fmask(ji,jj,1)
417         ENDDO
418      ENDDO
419      CALL nemo2cice(ztmp,ss_tltx,'F', -1. )
420
421! T point to F point
422      DO jj=1,jpjm1
423         DO ji=1,jpim1
424            ztmp(ji,jj)=0.5 * (  (ssh_m(ji  ,jj+1)-ssh_m(ji  ,jj))/e2v(ji  ,jj)   &
425                               + (ssh_m(ji+1,jj+1)-ssh_m(ji+1,jj))/e2v(ji+1,jj) ) &
426                            *  fmask(ji,jj,1)
427         ENDDO
428      ENDDO
429      CALL nemo2cice(ztmp,ss_tlty,'F', -1. )
430
431      CALL wrk_dealloc( jpi,jpj, ztmp )
432      CALL wrk_dealloc( jpi,jpj,ncat, ztmpn )
433      !
434      IF( nn_timing == 1 )  CALL timing_stop('cice_sbc_in')
435      !
436   END SUBROUTINE cice_sbc_in
437
438
439   SUBROUTINE cice_sbc_out (kt,nsbc)
440      !!---------------------------------------------------------------------
441      !!                    ***  ROUTINE cice_sbc_out  ***
442      !! ** Purpose: Get fields from CICE and set surface fields for NEMO
443      !!---------------------------------------------------------------------
444      INTEGER, INTENT( in  ) ::   kt   ! ocean time step
445      INTEGER, INTENT( in  ) ::   nsbc ! surface forcing type
446     
447      INTEGER  ::   ji, jj, jl                 ! dummy loop indices
448      REAL(wp), DIMENSION(:,:), POINTER :: ztmp1, ztmp2
449      !!---------------------------------------------------------------------
450
451      IF( nn_timing == 1 )  CALL timing_start('cice_sbc_out')
452      !
453      CALL wrk_alloc( jpi,jpj, ztmp1, ztmp2 )
454     
455      IF( kt == nit000 )  THEN
456         IF(lwp) WRITE(numout,*)'cice_sbc_out'
457      ENDIF
458     
459! x comp of ocean-ice stress
460      CALL cice2nemo(strocnx,ztmp1,'F', -1. )
461      ss_iou(:,:)=0.0
462! F point to U point
463      DO jj=2,jpjm1
464         DO ji=2,jpim1
465            ss_iou(ji,jj) = 0.5 * ( ztmp1(ji,jj-1) + ztmp1(ji,jj) ) * umask(ji,jj,1)
466         ENDDO
467      ENDDO
468      CALL lbc_lnk( ss_iou , 'U', -1. )
469
470! y comp of ocean-ice stress
471      CALL cice2nemo(strocny,ztmp1,'F', -1. )
472      ss_iov(:,:)=0.0
473! F point to V point
474
475      DO jj=1,jpjm1
476         DO ji=2,jpim1
477            ss_iov(ji,jj) = 0.5 * ( ztmp1(ji-1,jj) + ztmp1(ji,jj) ) * vmask(ji,jj,1)
478         ENDDO
479      ENDDO
480      CALL lbc_lnk( ss_iov , 'V', -1. )
481
482! x and y comps of surface stress
483! Combine wind stress and ocean-ice stress
484! [Note that fr_iu hasn't yet been updated, so still from start of CICE timestep]
485
486      utau(:,:)=(1.0-fr_iu(:,:))*utau(:,:)-ss_iou(:,:)
487      vtau(:,:)=(1.0-fr_iv(:,:))*vtau(:,:)-ss_iov(:,:)     
488
489! Freshwater fluxes
490
491      IF (nsbc == 2) THEN
492! Note that emp from the forcing files is evap*(1-aice)-(tprecip-aice*sprecip)
493! What we want here is evap*(1-aice)-tprecip*(1-aice) hence manipulation below
494! Not ideal since aice won't be the same as in the atmosphere. 
495! Better to use evap and tprecip? (but for now don't read in evap in this case)
496         emp(:,:)  = emp(:,:)+fr_i(:,:)*(tprecip(:,:)-sprecip(:,:))
497      ELSE IF (nsbc == 4) THEN
498         emp(:,:)  = (1.0-fr_i(:,:))*emp(:,:)       
499      ELSE IF (nsbc ==5) THEN
500! emp_tot is set in sbc_cpl_ice_flx (call from cice_sbc_in above)
501         emp(:,:) = emp_tot(:,:)+tprecip(:,:)*fr_i(:,:) 
502      ENDIF
503
504      CALL cice2nemo(fresh_gbm,ztmp1,'T', 1. )
505      CALL cice2nemo(fsalt_gbm,ztmp2,'T', 1. )
506! Check to avoid unphysical expression when ice is forming (ztmp1 negative)
507! Otherwise we are effectively allowing ice of higher salinity than the ocean to form
508! which has to be compensated for by the ocean salinity potentially going negative
509! This check breaks conservation but seems reasonable until we have prognostic ice salinity
510! The lines below ensure that when ice is forming emps will not be negative
511! Note the 1000.0 below is to convert from kg salt to g salt (needed for PSU)
512      emps(:,:)=0.0
513      WHERE (ztmp1(:,:).lt.0.0) ztmp2(:,:)=MAX(ztmp2(:,:),ztmp1(:,:)*sss_m(:,:)/1000.0)
514      WHERE (sss_m(:,:).gt.0.0) emps(:,:)=-ztmp1(:,:)+ztmp2(:,:)*1000.0/sss_m(:,:)
515! Now add other non-ice freshwater contributions into emps
516      emps(:,:)=emp(:,:)+emps(:,:)
517 
518      IF (lk_vvl) THEN
519
520! The relevant quantity for calculating the salinity change is emps-emp
521! This is in fact just the ztmp2*1000.0/sss_m term above
522         emp(:,:)=emp(:,:)-ztmp1(:,:)
523
524      ELSE
525
526! Don't remove precip over ice from free surface calculation on basis that the
527! weight of the precip will affect the free surface even if it falls on the ice
528! (same argument that freezing / melting of ice doesn't change the free surface)
529         emp(:,:)  = emp(:,:) - tprecip(:,:)*fr_i(:,:)
530! Sublimation from the ice is treated in a similar way (included in emp but not emps)
531         IF (nsbc == 5 ) THEN
532            emp(:,:) = emp(:,:) + ( emp_ice(:,:) + sprecip(:,:) )
533         ELSE IF (nsbc == 2 ) THEN
534            emp(:,:) = emp(:,:) - qla_ice(:,:,1) / Lsub
535         ENDIF
536
537      ENDIF
538
539      CALL lbc_lnk( emp , 'T', 1. )
540      CALL lbc_lnk( emps , 'T', 1. )
541
542! Solar penetrative radiation and non solar surface heat flux
543
544! Scale qsr and qns according to ice fraction (bulk formulae only)
545
546      IF (nsbc == 4) THEN
547         qsr(:,:)=qsr(:,:)*(1.0-fr_i(:,:))
548         qns(:,:)=qns(:,:)*(1.0-fr_i(:,:))
549      ENDIF
550! Take into account snow melting except for fully coupled when already in qns_tot
551      IF (nsbc == 5) THEN
552         qsr(:,:)= qsr_tot(:,:)
553         qns(:,:)= qns_tot(:,:)
554      ELSE
555         qns(:,:)= qns(:,:)-sprecip(:,:)*Lfresh*(1.0-fr_i(:,:))
556      ENDIF
557
558! Now add in ice / snow related terms
559! [fswthru will be zero unless running with calc_Tsfc=T in CICE]
560      CALL cice2nemo(fswthru_gbm,ztmp1,'T', 1. )
561      qsr(:,:)=qsr(:,:)+ztmp1(:,:)
562      CALL lbc_lnk( qsr , 'T', 1. )
563
564      DO jj=1,jpj
565         DO ji=1,jpi
566            nfrzmlt(ji,jj)=MAX(nfrzmlt(ji,jj),0.0)
567         ENDDO
568      ENDDO
569
570      CALL cice2nemo(fhocn_gbm,ztmp1,'T', 1. )
571      qns(:,:)=qns(:,:)+nfrzmlt(:,:)+ztmp1(:,:)
572
573      CALL lbc_lnk( qns , 'T', 1. )
574
575! Prepare for the following CICE time-step
576
577      CALL cice2nemo(aice,fr_i,'T', 1. )
578      IF ( (nsbc == 2).OR.(nsbc == 5) ) THEN
579         DO jl=1,ncat
580            CALL cice2nemo(aicen(:,:,jl,:),a_i(:,:,jl), 'T', 1. )
581         ENDDO
582      ENDIF
583
584! T point to U point
585! T point to V point
586      DO jj=1,jpjm1
587         DO ji=1,jpim1
588            fr_iu(ji,jj)=0.5*(fr_i(ji,jj)+fr_i(ji+1,jj))*umask(ji,jj,1)
589            fr_iv(ji,jj)=0.5*(fr_i(ji,jj)+fr_i(ji,jj+1))*vmask(ji,jj,1)
590         ENDDO
591      ENDDO
592
593      CALL lbc_lnk ( fr_iu , 'U', 1. )
594      CALL lbc_lnk ( fr_iv , 'V', 1. )
595
596! Release work space
597
598      CALL wrk_dealloc( jpi,jpj, ztmp1, ztmp2 )
599      !
600      IF( nn_timing == 1 )  CALL timing_stop('cice_sbc_out')
601      !
602   END SUBROUTINE cice_sbc_out
603
604
605#if defined key_oasis3 || defined key_oasis4
606   SUBROUTINE cice_sbc_hadgam( kt )
607      !!---------------------------------------------------------------------
608      !!                    ***  ROUTINE cice_sbc_hadgam  ***
609      !! ** Purpose: Prepare fields needed to pass to HadGAM3 atmosphere
610      !!
611      !!
612      INTEGER, INTENT( in  ) ::   kt   ! ocean time step
613      !!---------------------------------------------------------------------
614
615      INTEGER  ::   jl                        ! dummy loop index
616      INTEGER  ::   ierror
617
618      IF( nn_timing == 1 )  CALL timing_start('cice_sbc_hadgam')
619      !
620      IF( kt == nit000 )  THEN
621         IF(lwp) WRITE(numout,*)'cice_sbc_hadgam'
622         IF( sbc_cpl_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'sbc_cpl_alloc : unable to allocate arrays' )
623      ENDIF
624
625      !                                         ! =========================== !
626      !                                         !   Prepare Coupling fields   !
627      !                                         ! =========================== !
628
629! x and y comp of ice velocity
630
631      CALL cice2nemo(uvel,u_ice,'F', -1. )
632      CALL cice2nemo(vvel,v_ice,'F', -1. )
633
634! Ice concentration (CO_1) = a_i calculated at end of cice_sbc_out 
635
636! Snow and ice thicknesses (CO_2 and CO_3)
637
638      DO jl = 1,ncat
639         CALL cice2nemo(vsnon(:,:,jl,:),ht_s(:,:,jl),'T', 1. )
640         CALL cice2nemo(vicen(:,:,jl,:),ht_i(:,:,jl),'T', 1. )
641      ENDDO
642      !
643      IF( nn_timing == 1 )  CALL timing_stop('cice_sbc_hadgam')
644      !
645   END SUBROUTINE cice_sbc_hadgam
646
647#else
648   SUBROUTINE cice_sbc_hadgam( kt )    ! Dummy routine
649      INTEGER, INTENT( in  ) ::   kt   ! ocean time step
650      WRITE(*,*) 'cice_sbc_hadgam: You should not have seen this print! error?'
651   END SUBROUTINE cice_sbc_hadgam
652#endif
653
654   SUBROUTINE cice_sbc_final
655      !!---------------------------------------------------------------------
656      !!                    ***  ROUTINE cice_sbc_final  ***
657      !! ** Purpose: Finalize CICE
658      !!---------------------------------------------------------------------
659
660      IF(lwp) WRITE(numout,*)'cice_sbc_final'
661
662      CALL CICE_Finalize
663
664   END SUBROUTINE cice_sbc_final
665
666   SUBROUTINE cice_sbc_force (kt)
667      !!---------------------------------------------------------------------
668      !!                    ***  ROUTINE cice_sbc_force  ***
669      !! ** Purpose : Provide CICE forcing from files
670      !!
671      !!---------------------------------------------------------------------
672      !! ** Method  :   READ monthly flux file in NetCDF files
673      !!     
674      !!  snowfall   
675      !!  rainfall   
676      !!  sublimation rate   
677      !!  topmelt (category)
678      !!  botmelt (category)
679      !!
680      !! History :
681      !!----------------------------------------------------------------------
682      !! * Modules used
683      USE iom
684
685      !! * arguments
686      INTEGER, INTENT( in  ) ::   kt ! ocean time step
687
688      INTEGER  ::   ierror             ! return error code
689      INTEGER  ::   ifpr               ! dummy loop index
690      !!
691      CHARACTER(len=100) ::  cn_dir                            !   Root directory for location of CICE forcing files
692      TYPE(FLD_N), DIMENSION(jpfld) ::   slf_i                 ! array of namelist informations on the fields to read
693      TYPE(FLD_N) ::   sn_snow, sn_rain, sn_sblm               ! informations about the fields to be read
694      TYPE(FLD_N) ::   sn_top1, sn_top2, sn_top3, sn_top4, sn_top5
695      TYPE(FLD_N) ::   sn_bot1, sn_bot2, sn_bot3, sn_bot4, sn_bot5 
696
697      !!
698      NAMELIST/namsbc_cice/ cn_dir, sn_snow, sn_rain, sn_sblm,   &
699         &                          sn_top1, sn_top2, sn_top3, sn_top4, sn_top5,  &
700         &                          sn_bot1, sn_bot2, sn_bot3, sn_bot4, sn_bot5
701      !!---------------------------------------------------------------------
702
703      !                                         ! ====================== !
704      IF( kt == nit000 ) THEN                   !  First call kt=nit000  !
705         !                                      ! ====================== !
706         ! set file information (default values)
707         cn_dir = './'       ! directory in which the model is executed
708
709         ! (NB: frequency positive => hours, negative => months)
710         !            !    file          ! frequency !  variable    ! time intep !  clim   ! 'yearly' or ! weights  ! rotation   !
711         !            !    name          !  (hours)  !   name       !   (T/F)    !  (T/F)  !  'monthly'  ! filename ! pairs      !
712         sn_snow = FLD_N( 'snowfall_1m'  ,    -1.    ,  'snowfall'  ,  .true.    , .true.  ,  ' yearly'  , ''       , ''         ) 
713         sn_rain = FLD_N( 'rainfall_1m'  ,    -1.    ,  'rainfall'  ,  .true.    , .true.  ,  ' yearly'  , ''       , ''         ) 
714         sn_sblm = FLD_N( 'sublim_1m'    ,    -1.    ,  'sublim'    ,  .true.    , .true.  ,  ' yearly'  , ''       , ''         )
715         sn_top1 = FLD_N( 'topmeltn1_1m' ,    -1.    ,  'topmeltn1' ,  .true.    , .true.  ,  ' yearly'  , ''       , ''         )
716         sn_top2 = FLD_N( 'topmeltn2_1m' ,    -1.    ,  'topmeltn2' ,  .true.    , .true.  ,  ' yearly'  , ''       , ''         )
717         sn_top3 = FLD_N( 'topmeltn3_1m' ,    -1.    ,  'topmeltn3' ,  .true.    , .true.  ,  ' yearly'  , ''       , ''         )
718         sn_top4 = FLD_N( 'topmeltn4_1m' ,    -1.    ,  'topmeltn4' ,  .true.    , .true.  ,  ' yearly'  , ''       , ''         )
719         sn_top5 = FLD_N( 'topmeltn5_1m' ,    -1.    ,  'topmeltn5' ,  .true.    , .true.  ,  ' yearly'  , ''       , ''         )
720         sn_bot1 = FLD_N( 'botmeltn1_1m' ,    -1.    ,  'botmeltn1' ,  .true.    , .true.  ,  ' yearly'  , ''       , ''         )
721         sn_bot2 = FLD_N( 'botmeltn2_1m' ,    -1.    ,  'botmeltn2' ,  .true.    , .true.  ,  ' yearly'  , ''       , ''         )
722         sn_bot3 = FLD_N( 'botmeltn3_1m' ,    -1.    ,  'botmeltn3' ,  .true.    , .true.  ,  ' yearly'  , ''       , ''         )
723         sn_bot4 = FLD_N( 'botmeltn4_1m' ,    -1.    ,  'botmeltn4' ,  .true.    , .true.  ,  ' yearly'  , ''       , ''         )
724         sn_bot5 = FLD_N( 'botmeltn5_1m' ,    -1.    ,  'botmeltn5' ,  .true.    , .true.  ,  ' yearly'  , ''       , ''         )
725
726!         REWIND ( numnam )               ! ... at some point might read in from NEMO namelist?
727!         READ   ( numnam, namsbc_cice )
728
729         ! store namelist information in an array
730         slf_i(jp_snow) = sn_snow   ;   slf_i(jp_rain) = sn_rain   ;   slf_i(jp_sblm) = sn_sblm
731         slf_i(jp_top1) = sn_top1   ;   slf_i(jp_top2) = sn_top2   ;   slf_i(jp_top3) = sn_top3
732         slf_i(jp_top4) = sn_top4   ;   slf_i(jp_top5) = sn_top5   ;   slf_i(jp_bot1) = sn_bot1
733         slf_i(jp_bot2) = sn_bot2   ;   slf_i(jp_bot3) = sn_bot3   ;   slf_i(jp_bot4) = sn_bot4
734         slf_i(jp_bot5) = sn_bot5
735         
736         ! set sf structure
737         ALLOCATE( sf(jpfld), STAT=ierror )
738         IF( ierror > 0 ) THEN
739            CALL ctl_stop( 'cice_sbc_force: unable to allocate sf structure' )   ;   RETURN
740         ENDIF
741
742         DO ifpr= 1, jpfld
743            ALLOCATE( sf(ifpr)%fnow(jpi,jpj,1) )
744            ALLOCATE( sf(ifpr)%fdta(jpi,jpj,1,2) )
745         END DO
746
747         ! fill sf with slf_i and control print
748         CALL fld_fill( sf, slf_i, cn_dir, 'cice_sbc_force', 'flux formulation for CICE', 'namsbc_cice' )
749         !
750      ENDIF
751
752      CALL fld_read( kt, nn_fsbc, sf )           ! Read input fields and provides the
753      !                                          ! input fields at the current time-step
754
755      ! set the fluxes from read fields
756      sprecip(:,:) = sf(jp_snow)%fnow(:,:,1)
757      tprecip(:,:) = sf(jp_snow)%fnow(:,:,1)+sf(jp_rain)%fnow(:,:,1)
758! May be better to do this conversion somewhere else
759      qla_ice(:,:,1) = -Lsub*sf(jp_sblm)%fnow(:,:,1)
760      topmelt(:,:,1) = sf(jp_top1)%fnow(:,:,1)
761      topmelt(:,:,2) = sf(jp_top2)%fnow(:,:,1)
762      topmelt(:,:,3) = sf(jp_top3)%fnow(:,:,1)
763      topmelt(:,:,4) = sf(jp_top4)%fnow(:,:,1)
764      topmelt(:,:,5) = sf(jp_top5)%fnow(:,:,1)
765      botmelt(:,:,1) = sf(jp_bot1)%fnow(:,:,1)
766      botmelt(:,:,2) = sf(jp_bot2)%fnow(:,:,1)
767      botmelt(:,:,3) = sf(jp_bot3)%fnow(:,:,1)
768      botmelt(:,:,4) = sf(jp_bot4)%fnow(:,:,1)
769      botmelt(:,:,5) = sf(jp_bot5)%fnow(:,:,1)
770
771      ! control print (if less than 100 time-step asked)
772      IF( nitend-nit000 <= 100 .AND. lwp ) THEN
773         WRITE(numout,*) 
774         WRITE(numout,*) '        read forcing fluxes for CICE OK'
775         CALL FLUSH(numout)
776      ENDIF
777
778   END SUBROUTINE cice_sbc_force
779
780   SUBROUTINE nemo2cice( pn, pc, cd_type, psgn)
781      !!---------------------------------------------------------------------
782      !!                    ***  ROUTINE nemo2cice  ***
783      !! ** Purpose :   Transfer field in NEMO array to field in CICE array. 
784#if defined key_nemocice_decomp
785      !!             
786      !!                NEMO and CICE PE sub domains are identical, hence
787      !!                there is no need to gather or scatter data from
788      !!                one PE configuration to another.
789#else
790      !!                Automatically gather/scatter between
791      !!                different processors and blocks
792      !! ** Method :    A. Ensure all haloes are filled in NEMO field (pn)
793      !!                B. Gather pn into global array (png)
794      !!                C. Map png into CICE global array (pcg)
795      !!                D. Scatter pcg to CICE blocks (pc) + update haloes 
796#endif
797      !!---------------------------------------------------------------------
798
799      CHARACTER(len=1), INTENT( in ) ::   &
800          cd_type       ! nature of pn grid-point
801          !             !   = T or F gridpoints
802      REAL(wp), INTENT( in ) ::   &
803          psgn          ! control of the sign change
804          !             !   =-1 , the sign is modified following the type of b.c. used
805          !             !   = 1 , no sign change
806      REAL(wp), DIMENSION(jpi,jpj) :: pn
807#if !defined key_nemocice_decomp
808      REAL (kind=dbl_kind), dimension(nx_global,ny_global) :: pcg
809#endif
810      REAL (kind=dbl_kind), dimension(nx_block,ny_block,max_blocks) :: pc
811      INTEGER (int_kind) :: &
812         field_type,        &! id for type of field (scalar, vector, angle)
813         grid_loc            ! id for location on horizontal grid
814                            !  (center, NEcorner, Nface, Eface)
815
816      INTEGER  ::   ji, jj, jn                      ! dummy loop indices
817
818!     A. Ensure all haloes are filled in NEMO field (pn)
819
820      CALL lbc_lnk( pn , cd_type, psgn )
821
822#if defined key_nemocice_decomp
823
824      ! Copy local domain data from NEMO to CICE field
825      pc(:,:,1)=0.0
826      DO jj=2,ny_block
827         DO ji=2,nx_block
828            pc(ji,jj,1)=pn(ji,jj-1)
829         ENDDO
830      ENDDO
831
832#else
833
834!     B. Gather pn into global array (png)
835
836      IF ( jpnij > 1) THEN
837         CALL mppsync
838         CALL mppgather (pn,0,png) 
839         CALL mppsync
840      ELSE
841         png(:,:,1)=pn(:,:)
842      ENDIF
843
844!     C. Map png into CICE global array (pcg)
845
846! Need to make sure this is robust to changes in NEMO halo rows....
847! (may be OK but not 100% sure)
848
849      IF (nproc==0) THEN     
850!        pcg(:,:)=0.0
851         DO jn=1,jpnij
852            DO jj=1,nlcjt(jn)-1
853               DO ji=2,nlcit(jn)-1
854                  pcg(ji+nimppt(jn)-2,jj+njmppt(jn)-1)=png(ji,jj,jn)       
855               ENDDO
856            ENDDO
857         ENDDO
858      ENDIF
859
860#endif
861
862      SELECT CASE ( cd_type )
863         CASE ( 'T' )
864            grid_loc=field_loc_center
865         CASE ( 'F' )                             
866            grid_loc=field_loc_NEcorner
867      END SELECT
868
869      SELECT CASE ( NINT(psgn) )
870         CASE ( -1 )
871            field_type=field_type_vector
872         CASE ( 1 )                             
873            field_type=field_type_scalar
874      END SELECT
875
876#if defined key_nemocice_decomp
877      ! Ensure CICE halos are up to date
878      CALL ice_HaloUpdate (pc, halo_info, grid_loc, field_type)
879#else
880!     D. Scatter pcg to CICE blocks (pc) + update halos
881      CALL scatter_global(pc, pcg, 0, distrb_info, grid_loc, field_type)
882#endif
883
884   END SUBROUTINE nemo2cice
885
886   SUBROUTINE cice2nemo ( pc, pn, cd_type, psgn )
887      !!---------------------------------------------------------------------
888      !!                    ***  ROUTINE cice2nemo  ***
889      !! ** Purpose :   Transfer field in CICE array to field in NEMO array.
890#if defined key_nemocice_decomp
891      !!             
892      !!                NEMO and CICE PE sub domains are identical, hence
893      !!                there is no need to gather or scatter data from
894      !!                one PE configuration to another.
895#else 
896      !!                Automatically deal with scatter/gather between
897      !!                different processors and blocks
898      !! ** Method :    A. Gather CICE blocks (pc) into global array (pcg)
899      !!                B. Map pcg into NEMO global array (png)
900      !!                C. Scatter png into NEMO field (pn) for each processor
901      !!                D. Ensure all haloes are filled in pn
902#endif
903      !!---------------------------------------------------------------------
904
905      CHARACTER(len=1), INTENT( in ) ::   &
906          cd_type       ! nature of pn grid-point
907          !             !   = T or F gridpoints
908      REAL(wp), INTENT( in ) ::   &
909          psgn          ! control of the sign change
910          !             !   =-1 , the sign is modified following the type of b.c. used
911          !             !   = 1 , no sign change
912      REAL(wp), DIMENSION(jpi,jpj) :: pn
913
914#if defined key_nemocice_decomp
915      INTEGER (int_kind) :: &
916         field_type,        & ! id for type of field (scalar, vector, angle)
917         grid_loc             ! id for location on horizontal grid
918                              ! (center, NEcorner, Nface, Eface)
919#else
920      REAL (kind=dbl_kind), dimension(nx_global,ny_global) :: pcg
921#endif
922
923      REAL (kind=dbl_kind), dimension(nx_block,ny_block,max_blocks) :: pc
924
925      INTEGER  ::   ji, jj, jn                      ! dummy loop indices
926
927
928#if defined key_nemocice_decomp
929
930      SELECT CASE ( cd_type )
931         CASE ( 'T' )
932            grid_loc=field_loc_center
933         CASE ( 'F' )                             
934            grid_loc=field_loc_NEcorner
935      END SELECT
936
937      SELECT CASE ( NINT(psgn) )
938         CASE ( -1 )
939            field_type=field_type_vector
940         CASE ( 1 )                             
941            field_type=field_type_scalar
942      END SELECT
943
944      CALL ice_HaloUpdate (pc, halo_info, grid_loc, field_type)
945
946
947      pn(:,:)=0.0
948      DO jj=1,jpjm1
949         DO ji=1,jpim1
950            pn(ji,jj)=pc(ji,jj+1,1)
951         ENDDO
952      ENDDO
953
954#else
955
956!      A. Gather CICE blocks (pc) into global array (pcg)
957
958      CALL gather_global(pcg, pc, 0, distrb_info)
959
960!     B. Map pcg into NEMO global array (png)
961
962! Need to make sure this is robust to changes in NEMO halo rows....
963! (may be OK but not spent much time thinking about it)
964
965      IF (nproc==0) THEN
966         png(:,:,:)=0.0
967         DO jn=1,jpnij
968            DO jj=1,nlcjt(jn)-1
969               DO ji=2,nlcit(jn)-1
970                  png(ji,jj,jn)=pcg(ji+nimppt(jn)-2,jj+njmppt(jn)-1)     
971               ENDDO
972            ENDDO
973         ENDDO
974      ENDIF
975
976!     C. Scatter png into NEMO field (pn) for each processor
977
978      IF ( jpnij > 1) THEN
979         CALL mppsync
980         CALL mppscatter (png,0,pn) 
981         CALL mppsync
982      ELSE
983         pn(:,:)=png(:,:,1)
984      ENDIF
985
986#endif
987
988!     D. Ensure all haloes are filled in pn
989
990      CALL lbc_lnk( pn , cd_type, psgn )
991
992   END SUBROUTINE cice2nemo
993
994#else
995   !!----------------------------------------------------------------------
996   !!   Default option           Dummy module         NO CICE sea-ice model
997   !!----------------------------------------------------------------------
998CONTAINS
999
1000   SUBROUTINE sbc_ice_cice ( kt, nsbc )     ! Dummy routine
1001      WRITE(*,*) 'sbc_ice_cice: You should not have seen this print! error?', kt
1002   END SUBROUTINE sbc_ice_cice
1003
1004   SUBROUTINE cice_sbc_init (nsbc)    ! Dummy routine
1005      WRITE(*,*) 'cice_sbc_init: You should not have seen this print! error?'
1006   END SUBROUTINE cice_sbc_init
1007
1008   SUBROUTINE cice_sbc_final     ! Dummy routine
1009      WRITE(*,*) 'cice_sbc_final: You should not have seen this print! error?'
1010   END SUBROUTINE cice_sbc_final
1011
1012#endif
1013
1014   !!======================================================================
1015END MODULE sbcice_cice
Note: See TracBrowser for help on using the repository browser.