Changeset 9987 for branches/UKMO/dev_r5518_obs_oper_update_icethick/NEMOGCM/NEMO/OPA_SRC/SBC/sbcice_cice.F90
- Timestamp:
- 2018-07-23T11:33:03+02:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/UKMO/dev_r5518_obs_oper_update_icethick/NEMOGCM/NEMO/OPA_SRC/SBC/sbcice_cice.F90
r7960 r9987 15 15 USE dom_oce ! ocean space and time domain 16 16 USE domvvl 17 USE phycst, only : rcp, rau0, r1_rau0, rhosn, rhoic 17 USE eosbn2, only : eos_fzp ! Function to calculate freezing point of seawater 18 USE phycst, only : rcp, rau0, r1_rau0, rhosn, rhoic, rt0 18 19 USE in_out_manager ! I/O manager 19 20 USE iom, ONLY : iom_put,iom_use ! I/O manager library !!Joakim edit … … 37 38 USE ice_gather_scatter 38 39 USE ice_calendar, only: dt 40 # if defined key_cice4 39 41 USE ice_state, only: aice,aicen,uvel,vvel,vsno,vsnon,vice,vicen 40 # if defined key_cice441 42 USE ice_flux, only: strax,stray,strocnx,strocny,frain,fsnow, & 42 43 strocnxT,strocnyT, & … … 45 46 flatn_f,fsurfn_f,fcondtopn_f, & 46 47 uatm,vatm,wind,fsw,flw,Tair,potT,Qa,rhoa,zlvl, & 47 swvdr,swvdf,swidr,swidf 48 swvdr,swvdf,swidr,swidf,Tf 48 49 USE ice_therm_vertical, only: calc_Tsfc 49 50 #else 51 USE ice_state, only: aice,aicen,uvel,nt_hpnd,trcrn,vvel,vsno,& 52 vsnon,vice,vicen,nt_Tsfc 50 53 USE ice_flux, only: strax,stray,strocnx,strocny,frain,fsnow, & 51 54 strocnxT,strocnyT, & 52 sst,sss,uocn,vocn,ss_tltx,ss_tlty,fsalt_ai, &53 fresh_ai,fhocn_ai,fswthru_ai,frzmlt, &55 sst,sss,uocn,vocn,ss_tltx,ss_tlty,fsalt_ai, & 56 fresh_ai,fhocn_ai,fswthru_ai,frzmlt, & 54 57 flatn_f,fsurfn_f,fcondtopn_f, & 58 #ifdef key_asminc 59 daice_da,fresh_da,fsalt_da, & 60 #endif 55 61 uatm,vatm,wind,fsw,flw,Tair,potT,Qa,rhoa,zlvl, & 56 swvdr,swvdf,swidr,swidf 57 USE ice_therm_shared, only: calc_Tsfc 62 swvdr,swvdf,swidr,swidf,Tf, & 63 !! When using NEMO with CICE, this change requires use of 64 !! one of the following two CICE branches: 65 !! - at CICE5.0, hadax/r1015_GSI8_with_GSI7 66 !! - at CICE5.1.2, hadax/vn5.1.2_GSI8 67 keffn_top,Tn_top 68 69 USE ice_therm_shared, only: calc_Tsfc, heat_capacity 70 USE ice_shortwave, only: apeffn 58 71 #endif 59 72 USE ice_forcing, only: frcvdr,frcvdf,frcidr,frcidf … … 161 174 INTEGER, INTENT( in ) :: ksbc ! surface forcing type 162 175 REAL(wp), DIMENSION(:,:), POINTER :: ztmp1, ztmp2 163 REAL(wp) :: zcoefu, zcoefv, zcoeff ! local scalar176 REAL(wp), DIMENSION(:,:,:), POINTER :: ztfrz3d 164 177 INTEGER :: ji, jj, jl, jk ! dummy loop indices 165 178 !!--------------------------------------------------------------------- … … 174 187 jj_off = INT ( (jpjglo - ny_global) / 2 ) 175 188 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 189 ! Initialize CICE 186 190 CALL CICE_Initialize 187 191 188 ! Do some CICE consistency checks192 ! Do some CICE consistency checks 189 193 IF ( (ksbc == jp_flx) .OR. (ksbc == jp_purecpl) ) THEN 190 194 IF ( calc_strair .OR. calc_Tsfc ) THEN … … 198 202 199 203 200 ! allocate sbc_ice and sbc_cice arrays201 IF( sbc_ice_alloc() /= 0 ) CALL ctl_stop( 'STOP', 'sbc_ice_ cice_alloc : unable to allocate arrays' )204 ! allocate sbc_ice and sbc_cice arrays 205 IF( sbc_ice_alloc() /= 0 ) CALL ctl_stop( 'STOP', 'sbc_ice_alloc : unable to allocate arrays' ) 202 206 IF( sbc_ice_cice_alloc() /= 0 ) CALL ctl_stop( 'STOP', 'sbc_ice_cice_alloc : unable to allocate cice arrays' ) 203 207 204 ! Ensure ocean temperatures are nowhere below freezing if not a NEMO restart208 ! Ensure that no temperature points are below freezing if not a NEMO restart 205 209 IF( .NOT. ln_rstart ) THEN 206 tsn(:,:,:,jp_tem) = MAX (tsn(:,:,:,jp_tem),Tocnfrz) 210 211 CALL wrk_alloc( jpi,jpj,jpk, ztfrz3d ) 212 DO jk=1,jpk 213 CALL eos_fzp( tsn(:,:,jk,jp_sal), ztfrz3d(:,:,jk), fsdept_n(:,:,jk) ) 214 ENDDO 215 tsn(:,:,:,jp_tem) = MAX( tsn(:,:,:,jp_tem), ztfrz3d ) 207 216 tsb(:,:,:,jp_tem) = tsn(:,:,:,jp_tem) 208 ENDIF 209 210 fr_iu(:,:)=0.0 211 fr_iv(:,:)=0.0 217 CALL wrk_dealloc( jpi,jpj,jpk, ztfrz3d ) 218 219 #if defined key_nemocice_decomp 220 ! Pass initial SST from NEMO to CICE so ice is initialised correctly if 221 ! there is no restart file. 222 ! Values from a CICE restart file would overwrite this 223 CALL nemo2cice( tsn(:,:,1,jp_tem) , sst , 'T' , 1.) 224 #endif 225 226 ENDIF 227 228 ! calculate surface freezing temperature and send to CICE 229 CALL eos_fzp(sss_m(:,:), sstfrz(:,:), fsdept_n(:,:,1)) 230 CALL nemo2cice(sstfrz,Tf, 'T', 1. ) 212 231 213 232 CALL cice2nemo(aice,fr_i, 'T', 1. ) … … 220 239 ! T point to U point 221 240 ! T point to V point 241 fr_iu(:,:)=0.0 242 fr_iv(:,:)=0.0 222 243 DO jj=1,jpjm1 223 244 DO ji=1,jpim1 … … 283 304 284 305 CALL wrk_dealloc( jpi,jpj, ztmp1, ztmp2 ) 285 ! 306 307 #if defined key_asminc 308 ! Initialize fresh water and salt fluxes from data assim 309 ! and data assimilation index to cice 310 nfresh_da(:,:) = 0.0 311 nfsalt_da(:,:) = 0.0 312 ndaice_da(:,:) = 0.0 313 #endif 314 ! 315 ! In coupled mode get extra fields from CICE for passing back to atmosphere 316 317 IF ( ksbc == jp_purecpl ) CALL cice_sbc_hadgam(nit000) 318 ! 286 319 IF( nn_timing == 1 ) CALL timing_stop('cice_sbc_init') 287 320 ! … … 343 376 CALL nemo2cice(ztmp,stray,'F', -1. ) 344 377 378 379 ! Alex West: From configuration GSI8 onwards, when NEMO is used with CICE in 380 ! HadGEM3 the 'time-travelling ice' coupling approach is used, whereby 381 ! atmosphere-ice fluxes are passed as pseudo-local values, formed by dividing 382 ! gridbox mean fluxes in the UM by future ice concentration obtained through 383 ! OASIS. This allows for a much more realistic apportionment of energy through 384 ! the ice - and conserves energy. 385 ! Therefore the fluxes are now divided by ice concentration in the coupled 386 ! formulation (jp_purecpl) as well as for jp_flx. This NEMO branch should only 387 ! be used at UM10.2 onwards (unless an explicit GSI8 UM branch is included), at 388 ! which point the GSI8 UM changes were committed. 389 345 390 ! Surface downward latent heat flux (CI_5) 346 391 IF (ksbc == jp_flx) THEN … … 348 393 ztmpn(:,:,jl)=qla_ice(:,:,1)*a_i(:,:,jl) 349 394 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 395 ELSE IF (ksbc == jp_purecpl) THEN 396 DO jl=1,ncat 397 ztmpn(:,:,jl)=qla_ice(:,:,jl)*a_i(:,:,jl) 368 398 ENDDO 399 ELSE 400 !In coupled mode - qla_ice calculated in sbc_cpl for each category 401 ztmpn(:,:,1:ncat)=qla_ice(:,:,1:ncat) 369 402 ENDIF 403 370 404 DO jl=1,ncat 371 405 CALL nemo2cice(ztmpn(:,:,jl),flatn_f(:,:,jl,:),'T', 1. ) … … 373 407 ! GBM conductive flux through ice (CI_6) 374 408 ! Convert to GBM 375 IF (ksbc == jp_flx ) THEN409 IF (ksbc == jp_flx .OR. ksbc == jp_purecpl) THEN 376 410 ztmp(:,:) = botmelt(:,:,jl)*a_i(:,:,jl) 377 411 ELSE … … 382 416 ! GBM surface heat flux (CI_7) 383 417 ! Convert to GBM 384 IF (ksbc == jp_flx ) THEN418 IF (ksbc == jp_flx .OR. ksbc == jp_purecpl) THEN 385 419 ztmp(:,:) = (topmelt(:,:,jl)+botmelt(:,:,jl))*a_i(:,:,jl) 386 420 ELSE … … 431 465 ENDIF 432 466 467 #if defined key_asminc 468 !Ice concentration change (from assimilation) 469 ztmp(:,:)=ndaice_da(:,:)*tmask(:,:,1) 470 Call nemo2cice(ztmp,daice_da,'T', 1. ) 471 #endif 472 433 473 ! Snowfall 434 474 ! Ensure fsnow is positive (as in CICE routine prepare_forcing) 435 475 IF( iom_use('snowpre') ) CALL iom_put('snowpre',MAX( (1.0-fr_i(:,:))*sprecip(:,:) ,0.0)) !!Joakim edit 436 ztmp(:,:)=MAX(fr_i(:,:)*sprecip(:,:),0.0) 476 IF( kt == nit000 .AND. lwp ) THEN 477 WRITE(numout,*) 'sprecip weight, rn_sfac=', rn_sfac 478 ENDIF 479 ztmp(:,:)=MAX(fr_i(:,:)*rn_sfac*sprecip(:,:),0.0) 437 480 CALL nemo2cice(ztmp,fsnow,'T', 1. ) 438 481 … … 442 485 CALL nemo2cice(ztmp,frain,'T', 1. ) 443 486 487 ! Recalculate freezing temperature and send to CICE 488 CALL eos_fzp(sss_m(:,:), sstfrz(:,:), fsdept_n(:,:,1)) 489 CALL nemo2cice(sstfrz,Tf,'T', 1. ) 490 444 491 ! Freezing/melting potential 445 492 ! Calculated over NEMO leapfrog timestep (hence 2*dt) 446 nfrzmlt(:,:)=rau0*rcp*fse3t_m(:,:)*(Tocnfrz-sst_m(:,:))/(2.0*dt) 447 448 ztmp(:,:) = nfrzmlt(:,:) 449 CALL nemo2cice(ztmp,frzmlt,'T', 1. ) 493 nfrzmlt(:,:)=rau0*rcp*fse3t_m(:,:)*(sstfrz(:,:)-sst_m(:,:))/(2.0*dt) 494 CALL nemo2cice(nfrzmlt,frzmlt,'T', 1. ) 450 495 451 496 ! SST and SSS … … 453 498 CALL nemo2cice(sst_m,sst,'T', 1. ) 454 499 CALL nemo2cice(sss_m,sss,'T', 1. ) 500 501 IF( ksbc == jp_purecpl ) THEN 502 ! Sea ice surface skin temperature 503 DO jl=1,ncat 504 CALL nemo2cice(tsfc_ice(:,:,jl), trcrn(:,:,nt_tsfc,jl,:),'T',1.) 505 ENDDO 506 ENDIF 455 507 456 508 ! x comp and y comp of surface ocean current … … 685 737 ENDIF 686 738 739 #if defined key_asminc 740 ! Import fresh water and salt flux due to seaice da 741 CALL cice2nemo(fresh_da, nfresh_da,'T',1.0) 742 CALL cice2nemo(fsalt_da, nfsalt_da,'T',1.0) 743 #endif 744 687 745 ! Release work space 688 746 … … 708 766 IF( nn_timing == 1 ) CALL timing_start('cice_sbc_hadgam') 709 767 ! 710 IF( kt == nit000 ) THEN711 IF(lwp) WRITE(numout,*)'cice_sbc_hadgam'712 IF( sbc_cpl_alloc() /= 0 ) CALL ctl_stop( 'STOP', 'sbc_cpl_alloc : unable to allocate arrays' )713 ENDIF714 715 768 ! ! =========================== ! 716 769 ! ! Prepare Coupling fields ! … … 730 783 CALL cice2nemo(vicen(:,:,jl,:),ht_i(:,:,jl),'T', 1. ) 731 784 ENDDO 785 786 #if ! defined key_cice4 787 ! Meltpond fraction and depth 788 DO jl = 1,ncat 789 CALL cice2nemo(apeffn(:,:,jl,:),a_p(:,:,jl),'T', 1. ) 790 CALL cice2nemo(trcrn(:,:,nt_hpnd,jl,:),ht_p(:,:,jl),'T', 1. ) 791 ENDDO 792 #endif 793 794 795 ! If using multilayers thermodynamics in CICE then get top layer temperature 796 ! and effective conductivity 797 !! When using NEMO with CICE, this change requires use of 798 !! one of the following two CICE branches: 799 !! - at CICE5.0, hadax/r1015_GSI8_with_GSI7 800 !! - at CICE5.1.2, hadax/vn5.1.2_GSI8 801 IF (heat_capacity) THEN 802 DO jl = 1,ncat 803 CALL cice2nemo(Tn_top(:,:,jl,:),tn_ice(:,:,jl),'T', 1. ) 804 CALL cice2nemo(keffn_top(:,:,jl,:),kn_ice(:,:,jl),'T', 1. ) 805 ENDDO 806 ! Convert surface temperature to Kelvin 807 tn_ice(:,:,:)=tn_ice(:,:,:)+rt0 808 ELSE 809 tn_ice(:,:,:) = 0.0 810 kn_ice(:,:,:) = 0.0 811 ENDIF 812 732 813 ! 733 814 IF( nn_timing == 1 ) CALL timing_stop('cice_sbc_hadgam')
Note: See TracChangeset
for help on using the changeset viewer.