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.
Changeset 6200 for branches/UKMO/dev_r5518_med_test/NEMOGCM/NEMO/OPA_SRC/SBC/sbcice_cice.F90 – NEMO

Ignore:
Timestamp:
2016-01-04T11:49:32+01:00 (8 years ago)
Author:
frrh
Message:

Merge in branches/UKMO/dev_r5518_coupling_GSI7_GSI8_landice@5797
and MY medusa interface, resolve conflicts in sbccpl and, mysteriously
in sbcice_cice.F90 which frankly should not occur since I am doing nothing in
here!

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/UKMO/dev_r5518_med_test/NEMOGCM/NEMO/OPA_SRC/SBC/sbcice_cice.F90

    r5575 r6200  
    161161      INTEGER, INTENT( in  ) ::   ksbc                ! surface forcing type 
    162162      REAL(wp), DIMENSION(:,:), POINTER :: ztmp1, ztmp2 
    163       REAL(wp) ::   zcoefu, zcoefv, zcoeff            ! local scalar 
     163      REAL(wp), DIMENSION(:,:,:), POINTER :: ztfrz3d 
    164164      INTEGER  ::   ji, jj, jl, jk                    ! dummy loop indices 
    165165      !!--------------------------------------------------------------------- 
     
    174174      jj_off = INT ( (jpjglo - ny_global) / 2 ) 
    175175 
    176 #if defined key_nemocice_decomp 
    177       ! Pass initial SST from NEMO to CICE so ice is initialised correctly if 
    178       ! there is no restart file. 
    179       ! Values from a CICE restart file would overwrite this 
    180       IF ( .NOT. ln_rstart ) THEN     
    181          CALL nemo2cice( tsn(:,:,1,jp_tem) , sst , 'T' , 1.)  
    182       ENDIF   
    183 #endif 
    184  
    185 ! Initialize CICE 
     176      ! Initialize CICE 
    186177      CALL CICE_Initialize 
    187178 
    188 ! Do some CICE consistency checks 
     179      ! Do some CICE consistency checks 
    189180      IF ( (ksbc == jp_flx) .OR. (ksbc == jp_purecpl) ) THEN 
    190181         IF ( calc_strair .OR. calc_Tsfc ) THEN 
     
    198189 
    199190 
    200 ! allocate sbc_ice and sbc_cice arrays 
    201       IF( sbc_ice_alloc()      /= 0 )   CALL ctl_stop( 'STOP', 'sbc_ice_cice_alloc : unable to allocate arrays' ) 
     191      ! allocate sbc_ice and sbc_cice arrays 
     192      IF( sbc_ice_alloc()      /= 0 )   CALL ctl_stop( 'STOP', 'sbc_ice_alloc : unable to allocate arrays' ) 
    202193      IF( sbc_ice_cice_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'sbc_ice_cice_alloc : unable to allocate cice arrays' ) 
    203194 
    204 ! Ensure ocean temperatures are nowhere below freezing if not a NEMO restart 
     195      ! Ensure that no temperature points are below freezing if not a NEMO restart 
    205196      IF( .NOT. ln_rstart ) THEN 
    206          tsn(:,:,:,jp_tem) = MAX (tsn(:,:,:,jp_tem),Tocnfrz) 
     197 
     198         CALL wrk_alloc( jpi,jpj,jpk, ztfrz3d )  
     199         DO jk=1,jpk 
     200            ztfrz3d(:,:,jk) = eos_fzp( tsn(:,:,jk,jp_sal), fsdept_n(:,:,jk) ) 
     201         ENDDO 
     202         tsn(:,:,:,jp_tem) = MAX( tsn(:,:,:,jp_tem), ztfrz3d ) 
    207203         tsb(:,:,:,jp_tem) = tsn(:,:,:,jp_tem) 
    208       ENDIF 
    209  
    210       fr_iu(:,:)=0.0 
    211       fr_iv(:,:)=0.0 
     204         CALL wrk_dealloc( jpi,jpj,jpk, ztfrz3d )  
     205 
     206#if defined key_nemocice_decomp 
     207         ! Pass initial SST from NEMO to CICE so ice is initialised correctly if 
     208         ! there is no restart file. 
     209         ! Values from a CICE restart file would overwrite this 
     210         CALL nemo2cice( tsn(:,:,1,jp_tem) , sst , 'T' , 1.)  
     211#endif 
     212 
     213      ENDIF   
     214 
     215      ! calculate surface freezing temperature and send to CICE 
     216      sstfrz(:,:) = eos_fzp(sss_m(:,:), fsdept_n(:,:,1))  
     217      CALL nemo2cice(sstfrz,Tf, 'T', 1. ) 
    212218 
    213219      CALL cice2nemo(aice,fr_i, 'T', 1. ) 
     
    220226! T point to U point 
    221227! T point to V point 
     228      fr_iu(:,:)=0.0 
     229      fr_iv(:,:)=0.0 
    222230      DO jj=1,jpjm1 
    223231         DO ji=1,jpim1 
     
    348356               ztmpn(:,:,jl)=qla_ice(:,:,1)*a_i(:,:,jl) 
    349357            ENDDO 
    350          ELSE 
    351 ! emp_ice is set in sbc_cpl_ice_flx as sublimation-snow 
    352             qla_ice(:,:,1)= - ( emp_ice(:,:)+sprecip(:,:) ) * Lsub 
    353 ! End of temporary code 
    354             DO jj=1,jpj 
    355                DO ji=1,jpi 
    356                   IF (fr_i(ji,jj).eq.0.0) THEN 
    357                      DO jl=1,ncat 
    358                         ztmpn(ji,jj,jl)=0.0 
    359                      ENDDO 
    360                      ! This will then be conserved in CICE 
    361                      ztmpn(ji,jj,1)=qla_ice(ji,jj,1) 
    362                   ELSE 
    363                      DO jl=1,ncat 
    364                         ztmpn(ji,jj,jl)=qla_ice(ji,jj,1)*a_i(ji,jj,jl)/fr_i(ji,jj) 
    365                      ENDDO 
    366                   ENDIF 
    367                ENDDO 
     358         ELSE IF (ksbc == jp_purecpl) THEN 
     359            DO jl=1,ncat 
     360               ztmpn(:,:,jl)=qla_ice(:,:,jl)*a_i(:,:,jl) 
    368361            ENDDO 
     362    ELSE 
     363           !In coupled mode - qla_ice calculated in sbc_cpl for each category 
     364           ztmpn(:,:,1:ncat)=qla_ice(:,:,1:ncat) 
    369365         ENDIF 
    370366         DO jl=1,ncat 
Note: See TracChangeset for help on using the changeset viewer.