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 5797 for branches – NEMO

Changeset 5797 for branches


Ignore:
Timestamp:
2015-10-15T13:04:41+02:00 (9 years ago)
Author:
dancopsey
Message:

[CICE#69]: Fix non-restartability of salinity-dependent freezing code

File:
1 edited

Legend:

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

    r5796 r5797  
    172172      REAL(wp), DIMENSION(:,:), POINTER :: ztmp1, ztmp2 
    173173      REAL(wp), DIMENSION(:,:,:), POINTER :: ztfrz3d 
    174       REAL(wp) ::   zcoefu, zcoefv, zcoeff            ! local scalar 
    175174      INTEGER  ::   ji, jj, jl, jk                    ! dummy loop indices 
    176175      !!--------------------------------------------------------------------- 
     
    185184      jj_off = INT ( (jpjglo - ny_global) / 2 ) 
    186185 
    187       ! Set freezing temperatures and ensure consistencey between NEMO and CICE 
    188       CALL wrk_alloc( jpi,jpj,jpk, ztfrz3d )  
    189       DO jk=1,jpk 
    190          ztfrz3d(:,:,jk) = eos_fzp( tsn(:,:,jk,jp_sal), fsdept_n(:,:,jk) ) 
    191       ENDDO 
    192  
    193       !Ensure that no temperature points are below freezing if not a NEMO restart 
    194       IF( .NOT. ln_rstart ) THEN 
    195          tsn(:,:,:,jp_tem) = MAX (tsn(:,:,:,jp_tem),ztfrz3d) 
    196          tsb(:,:,:,jp_tem) = tsn(:,:,:,jp_tem) 
    197       ENDIF 
    198  
    199 #if defined key_nemocice_decomp 
    200       ! Pass initial SST from NEMO to CICE so ice is initialised correctly if 
    201       ! there is no restart file. 
    202       ! Values from a CICE restart file would overwrite this 
    203       IF ( .NOT. ln_rstart ) THEN     
    204          CALL nemo2cice( tsn(:,:,1,jp_tem) , sst , 'T' , 1.)  
    205       ENDIF   
    206 #endif 
    207  
    208 ! Initialize CICE 
     186      ! Initialize CICE 
    209187      CALL CICE_Initialize 
    210188 
    211 ! Do some CICE consistency checks 
     189      ! Do some CICE consistency checks 
    212190      IF ( (ksbc == jp_flx) .OR. (ksbc == jp_purecpl) ) THEN 
    213191         IF ( calc_strair .OR. calc_Tsfc ) THEN 
     
    221199 
    222200 
    223 ! allocate sbc_ice and sbc_cice arrays 
    224       IF( sbc_ice_alloc()      /= 0 )   CALL ctl_stop( 'STOP', 'sbc_ice_cice_alloc : unable to allocate arrays' ) 
     201      ! allocate sbc_ice and sbc_cice arrays 
     202      IF( sbc_ice_alloc()      /= 0 )   CALL ctl_stop( 'STOP', 'sbc_ice_alloc : unable to allocate arrays' ) 
    225203      IF( sbc_ice_cice_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'sbc_ice_cice_alloc : unable to allocate cice arrays' ) 
    226204 
    227       ! Populate the surface freezing temperature array 
    228       sstfrz(:,:)=ztfrz3d(:,:,1) 
    229  
    230       fr_iu(:,:)=0.0 
    231       fr_iv(:,:)=0.0 
     205      ! Ensure that no temperature points are below freezing if not a NEMO restart 
     206      IF( .NOT. ln_rstart ) THEN 
     207 
     208         CALL wrk_alloc( jpi,jpj,jpk, ztfrz3d )  
     209         DO jk=1,jpk 
     210            ztfrz3d(:,:,jk) = eos_fzp( tsn(:,:,jk,jp_sal), fsdept_n(:,:,jk) ) 
     211         ENDDO 
     212         tsn(:,:,:,jp_tem) = MAX( tsn(:,:,:,jp_tem), ztfrz3d ) 
     213         tsb(:,:,:,jp_tem) = tsn(:,:,:,jp_tem) 
     214         CALL wrk_dealloc( jpi,jpj,jpk, ztfrz3d )  
     215 
     216#if defined key_nemocice_decomp 
     217         ! Pass initial SST from NEMO to CICE so ice is initialised correctly if 
     218         ! there is no restart file. 
     219         ! Values from a CICE restart file would overwrite this 
     220         CALL nemo2cice( tsn(:,:,1,jp_tem) , sst , 'T' , 1.)  
     221#endif 
     222 
     223      ENDIF   
     224 
     225      ! calculate surface freezing temperature and send to CICE 
     226      sstfrz(:,:) = eos_fzp(sss_m(:,:), fsdept_n(:,:,1))  
     227      CALL nemo2cice(sstfrz,Tf, 'T', 1. ) 
    232228 
    233229      CALL cice2nemo(aice,fr_i, 'T', 1. ) 
     
    240236! T point to U point 
    241237! T point to V point 
     238      fr_iu(:,:)=0.0 
     239      fr_iv(:,:)=0.0 
    242240      DO jj=1,jpjm1 
    243241         DO ji=1,jpim1 
     
    303301  
    304302      CALL wrk_dealloc( jpi,jpj, ztmp1, ztmp2 ) 
    305       CALL wrk_dealloc( jpi,jpj,jpk, ztfrz3d )  
    306303      ! 
    307304      IF( nn_timing == 1 )  CALL timing_stop('cice_sbc_init') 
     
    381378               ztmpn(:,:,jl)=qla_ice(:,:,1)*a_i(:,:,jl) 
    382379            ENDDO 
    383          ELSE IF (ksbc == jp_purecpl) THEN  
    384             DO jl=1,ncat  
    385                ztmpn(:,:,jl)=qla_ice(:,:,jl)*a_i(:,:,jl)  
    386             ENDDO  
    387          ELSE  
     380         ELSE IF (ksbc == jp_purecpl) THEN 
     381            DO jl=1,ncat 
     382               ztmpn(:,:,jl)=qla_ice(:,:,jl)*a_i(:,:,jl) 
     383            ENDDO 
     384    ELSE 
    388385           !In coupled mode - qla_ice calculated in sbc_cpl for each category 
    389386           ztmpn(:,:,1:ncat)=qla_ice(:,:,1:ncat) 
Note: See TracChangeset for help on using the changeset viewer.