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 9819 for branches/UKMO – NEMO

Changeset 9819 for branches/UKMO


Ignore:
Timestamp:
2018-06-21T12:48:26+02:00 (6 years ago)
Author:
dancopsey
Message:

Added a bunch of fixes and a nemo2cice print statement.

Location:
branches/UKMO/dev_merge_2017_CICE_interface/NEMOGCM/NEMO/OPA_SRC/SBC
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/UKMO/dev_merge_2017_CICE_interface/NEMOGCM/NEMO/OPA_SRC/SBC/sbc_ice.F90

    r9675 r9819  
    3838   LOGICAL         , PUBLIC, PARAMETER ::   lk_cice    = .TRUE.   !: CICE ice model 
    3939   CHARACTER(len=1), PUBLIC            ::   cp_ice_msh = 'F'      !: 'F'-grid ice-velocity 
     40    
     41   ! Parameters imported from LIM to get CICE to work with NEMO4 
     42   INTEGER , PUBLIC, PARAMETER ::   np_jules_OFF    = 0  !: no Jules coupling (ice thermodynamics forced via qsr and qns) 
     43   INTEGER , PUBLIC, PARAMETER ::   np_jules_EMULE  = 1  !: emulated Jules coupling via icethd_zdf.F90 (BL99) (1st round compute qcn and qsr_tr, 2nd round use it) 
     44   INTEGER , PUBLIC, PARAMETER ::   np_jules_ACTIVE = 2  !: active Jules coupling                      (SM0L) (compute qcn and qsr_tr via sbcblk.F90 or sbccpl.F90) 
     45   INTEGER , PUBLIC, PARAMETER ::   nice_jules = np_jules_ACTIVE   !: Choice of jules coupling  
    4046# endif 
    4147 
     
    5662   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   emp_ice        !: sublimation - precip over sea ice          [kg/m2/s] 
    5763 
    58 #if defined  key_lim3 
     64#if defined  key_lim3 || defined key_cice 
    5965   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   evap_ice       !: sublimation                              [kg/m2/s] 
    6066   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   devap_ice      !: sublimation sensitivity                [kg/m2/s/K] 
  • branches/UKMO/dev_merge_2017_CICE_interface/NEMOGCM/NEMO/OPA_SRC/SBC/sbccpl.F90

    r9803 r9819  
    12461246      !                                                      !   ice skin temp.   ! 
    12471247      !                                                      ! ================== ! 
    1248 #if defined key_lim3 
     1248#if defined key_lim3 || defined key_cice 
    12491249      ! needed by Met Office 
    12501250      IF( srcv(jpr_ts_ice)%laction ) THEN  
     
    17151715      REAL(wp), DIMENSION(jpi,jpj)     ::   zemp_tot, zemp_ice, zemp_oce, ztprecip, zsprecip  , zevap_oce, zdevap_ice 
    17161716      REAL(wp), DIMENSION(jpi,jpj)     ::   zqns_tot, zqns_oce, zqsr_tot, zqsr_oce, zqprec_ice, zqemp_oce, zqemp_ice 
    1717       REAL(wp), DIMENSION(jpi,jpj,jpl) ::   zqns_ice, zqsr_ice, zdqns_ice, zqevap_ice, zevap_ice    !!gm , zfrqsr_tr_i 
     1717      REAL(wp), DIMENSION(jpi,jpj,jpl) ::   zqns_ice, zqsr_ice, zdqns_ice, zqevap_ice    !!gm , zfrqsr_tr_i 
     1718      REAL(wp), DIMENSION(jpi,jpj)     ::   ztmp 
    17181719      !!---------------------------------------------------------------------- 
    17191720      ! 
     
    17351736         ztprecip(:,:) =   frcv(jpr_rain)%z3(:,:,1) + zsprecip(:,:)  ! May need to ensure positive here 
    17361737         zemp_tot(:,:) =   frcv(jpr_tevp)%z3(:,:,1) - ztprecip(:,:) 
     1738          
     1739#if defined key_cice 
     1740         IF ( TRIM(sn_rcv_emp%clcat) == 'yes' ) THEN 
     1741            ! zemp_ice is the sum of frcv(jpr_ievp)%z3(:,:,1) over all layers - snow 
     1742            zemp_ice(:,:) = - frcv(jpr_snow)%z3(:,:,1) 
     1743            DO jl=1,jpl 
     1744               zemp_ice(:,:   ) = zemp_ice(:,:) + frcv(jpr_ievp)%z3(:,:,jl) 
     1745            ENDDO 
     1746            ! latent heat coupled for each category in CICE 
     1747            zevap_ice(:,:,1:jpl) = - frcv(jpr_ievp)%z3(:,:,1:jpl) 
     1748         ELSE 
     1749            ! If CICE has multicategories it still expects coupling fields for 
     1750            ! each even if we treat as a single field 
     1751            ! The latent heat flux is split between the ice categories according 
     1752            ! to the fraction of the ice in each category 
     1753            zemp_ice(:,:) = frcv(jpr_ievp)%z3(:,:,1) - frcv(jpr_snow)%z3(:,:,1) 
     1754            WHERE ( ziceld(:,:) /= 0._wp )  
     1755               ztmp(:,:) = 1./ziceld(:,:) 
     1756            ELSEWHERE  
     1757               ztmp(:,:) = 0.e0 
     1758            END WHERE   
     1759            DO jl=1,jpl 
     1760               zevap_ice(:,:,jl) = - a_i(:,:,jl) * ztmp(:,:) * frcv(jpr_ievp)%z3(:,:,1) 
     1761            END DO 
     1762            WHERE ( ziceld(:,:) == 0._wp )  zevap_ice(:,:,1) = -frcv(jpr_ievp)%z3(:,:,1) 
     1763         ENDIF 
     1764          
     1765#else              
    17371766         zemp_ice(:,:) = ( frcv(jpr_ievp)%z3(:,:,1) - frcv(jpr_snow)%z3(:,:,1) ) * picefr(:,:) 
     1767#endif 
     1768 
    17381769      CASE( 'oce and ice'   )   ! received fields: jpr_sbpr, jpr_semp, jpr_oemp, jpr_ievp 
    17391770         zemp_tot(:,:) = ziceld(:,:) * frcv(jpr_oemp)%z3(:,:,1) + picefr(:,:) * frcv(jpr_sbpr)%z3(:,:,1) 
     
    19611992      ELSE 
    19621993         qns_tot(:,:  ) = zqns_tot(:,:  ) 
    1963          qns_ice(:,:,:) = zqns_ice(:,:,:) 
     1994         IF ( TRIM( sn_rcv_qsr%cldes ) /= 'oce only' ) qns_ice(:,:,:) = zqns_ice(:,:,:) 
    19641995      ENDIF 
    19651996 
     
    20432074      ELSE 
    20442075         qsr_tot(:,:  ) = zqsr_tot(:,:  ) 
    2045          IF ( TRIM( sn_rcv_qsr%cldes ) /= 'oce only' ) THEN 
    2046             qsr_ice(:,:,:) = zqsr_ice(:,:,:) 
    2047          ENDIF 
     2076         IF ( TRIM( sn_rcv_qsr%cldes ) /= 'oce only' ) qsr_ice(:,:,:) = zqsr_ice(:,:,:) 
    20482077      ENDIF 
    20492078 
     
    20702099      ENDIF 
    20712100 
    2072 #if defined key_lim3       
     2101#if defined key_lim3 || defined key_cice 
    20732102      !                                                      ! ========================= ! 
    20742103      SELECT CASE( TRIM( sn_rcv_iceflx%cldes ) )             !  ice topmelt and botmelt  ! 
  • branches/UKMO/dev_merge_2017_CICE_interface/NEMOGCM/NEMO/OPA_SRC/SBC/sbcice_cice.F90

    r9695 r9819  
    209209         ! there is no restart file. 
    210210         ! Values from a CICE restart file would overwrite this 
    211          CALL nemo2cice( tsn(:,:,1,jp_tem) , sst , 'T' , 1.)  
     211         CALL nemo2cice( tsn(:,:,1,jp_tem) , sst , 'T' , 1.,'sst1')  
    212212#endif 
    213213 
     
    216216      ! calculate surface freezing temperature and send to CICE 
    217217      CALL  eos_fzp(sss_m(:,:), sstfrz(:,:), gdept_n(:,:,1))  
    218       CALL nemo2cice(sstfrz,Tf, 'T', 1. ) 
     218      CALL nemo2cice(sstfrz,Tf, 'T', 1.,'tf1' ) 
    219219 
    220220      CALL cice2nemo(aice,fr_i, 'T', 1. ) 
     
    320320         IF(lwp) WRITE(numout,*)'cice_sbc_in' 
    321321      ENDIF 
     322      WRITE(numout,*)'zevap_ice 7: min, max = ', MINVAL(zevap_ice(:,:,:)), MAXVAL(zevap_ice(:,:,:)) 
    322323 
    323324      ztmp(:,:)=0.0 
     
    340341            ENDDO 
    341342         ENDDO 
    342          CALL nemo2cice(ztmp,strax,'F', -1. ) 
     343          
     344         CALL nemo2cice(ztmp,strax,'F', -1.,'strax' )          
    343345 
    344346! y comp of wind stress (CI_2) 
     
    350352            ENDDO 
    351353         ENDDO 
    352          CALL nemo2cice(ztmp,stray,'F', -1. ) 
     354         CALL nemo2cice(ztmp,stray,'F', -1.,'stray' ) 
    353355 
    354356 
     
    379381 
    380382         DO jl=1,ncat 
    381             CALL nemo2cice(ztmpn(:,:,jl),flatn_f(:,:,jl,:),'T', 1. ) 
     383            CALL nemo2cice(ztmpn(:,:,jl),flatn_f(:,:,jl,:),'T', 1.,'flatn' ) 
    382384 
    383385! GBM conductive flux through ice (CI_6) 
     
    388390               ztmp(:,:) = qcn_ice(:,:,jl) 
    389391            ENDIF 
    390             CALL nemo2cice(ztmp,fcondtopn_f(:,:,jl,:),'T', 1. ) 
     392            CALL nemo2cice(ztmp,fcondtopn_f(:,:,jl,:),'T', 1.,'fcondtopn' ) 
    391393 
    392394! GBM surface heat flux (CI_7) 
     
    397399               ztmp(:,:) = (qml_ice(:,:,jl)+qcn_ice(:,:,jl)) 
    398400            ENDIF 
    399             CALL nemo2cice(ztmp,fsurfn_f(:,:,jl,:),'T', 1. ) 
     401            CALL nemo2cice(ztmp,fsurfn_f(:,:,jl,:),'T', 1. ,'fsurfn_f') 
    400402         ENDDO 
    401403 
     
    405407! x comp and y comp of atmosphere surface wind (CICE expects on T points) 
    406408         ztmp(:,:) = wndi_ice(:,:) 
    407          CALL nemo2cice(ztmp,uatm,'T', -1. ) 
     409         CALL nemo2cice(ztmp,uatm,'T', -1. ,'uatm') 
    408410         ztmp(:,:) = wndj_ice(:,:) 
    409          CALL nemo2cice(ztmp,vatm,'T', -1. ) 
     411         CALL nemo2cice(ztmp,vatm,'T', -1.,'vatm' ) 
    410412         ztmp(:,:) = SQRT ( wndi_ice(:,:)**2 + wndj_ice(:,:)**2 ) 
    411          CALL nemo2cice(ztmp,wind,'T', 1. )    ! Wind speed (m/s) 
     413         CALL nemo2cice(ztmp,wind,'T', 1.,'wind' )    ! Wind speed (m/s) 
    412414         ztmp(:,:) = qsr_ice(:,:,1) 
    413          CALL nemo2cice(ztmp,fsw,'T', 1. )     ! Incoming short-wave (W/m^2) 
     415         CALL nemo2cice(ztmp,fsw,'T', 1.,'fsw' )     ! Incoming short-wave (W/m^2) 
    414416         ztmp(:,:) = qlw_ice(:,:,1) 
    415          CALL nemo2cice(ztmp,flw,'T', 1. )     ! Incoming long-wave (W/m^2) 
     417         CALL nemo2cice(ztmp,flw,'T', 1.,'flw' )     ! Incoming long-wave (W/m^2) 
    416418         ztmp(:,:) = tatm_ice(:,:) 
    417          CALL nemo2cice(ztmp,Tair,'T', 1. )    ! Air temperature (K) 
    418          CALL nemo2cice(ztmp,potT,'T', 1. )    ! Potential temp (K) 
     419         CALL nemo2cice(ztmp,Tair,'T', 1.,'tair' )    ! Air temperature (K) 
     420         CALL nemo2cice(ztmp,potT,'T', 1.,'pott' )    ! Potential temp (K) 
    419421! Following line uses MAX(....) to avoid problems if tatm_ice has unset halo rows   
    420422         ztmp(:,:) = 101000. / ( 287.04 * MAX(1.0,tatm_ice(:,:)) )     
    421423                                               ! Constant (101000.) atm pressure assumed 
    422          CALL nemo2cice(ztmp,rhoa,'T', 1. )    ! Air density (kg/m^3) 
     424         CALL nemo2cice(ztmp,rhoa,'T', 1.,'rhoa' )    ! Air density (kg/m^3) 
    423425         ztmp(:,:) = qatm_ice(:,:) 
    424          CALL nemo2cice(ztmp,Qa,'T', 1. )      ! Specific humidity (kg/kg) 
     426         CALL nemo2cice(ztmp,Qa,'T', 1.,'qa' )      ! Specific humidity (kg/kg) 
    425427         ztmp(:,:)=10.0 
    426          CALL nemo2cice(ztmp,zlvl,'T', 1. )    ! Atmos level height (m) 
     428         CALL nemo2cice(ztmp,zlvl,'T', 1.,'zlvl' )    ! Atmos level height (m) 
    427429 
    428430! May want to check all values are physically realistic (as in CICE routine  
     
    431433! Divide shortwave into spectral bands (as in prepare_forcing) 
    432434         ztmp(:,:)=qsr_ice(:,:,1)*frcvdr       ! visible direct 
    433          CALL nemo2cice(ztmp,swvdr,'T', 1. )              
     435         CALL nemo2cice(ztmp,swvdr,'T', 1.,'swvdr' )              
    434436         ztmp(:,:)=qsr_ice(:,:,1)*frcvdf       ! visible diffuse 
    435          CALL nemo2cice(ztmp,swvdf,'T', 1. )               
     437         CALL nemo2cice(ztmp,swvdf,'T', 1.,'swvdf' )               
    436438         ztmp(:,:)=qsr_ice(:,:,1)*frcidr       ! near IR direct 
    437          CALL nemo2cice(ztmp,swidr,'T', 1. ) 
     439         CALL nemo2cice(ztmp,swidr,'T', 1.,'swidr' ) 
    438440         ztmp(:,:)=qsr_ice(:,:,1)*frcidf       ! near IR diffuse 
    439          CALL nemo2cice(ztmp,swidf,'T', 1. ) 
     441         CALL nemo2cice(ztmp,swidf,'T', 1. ,'swidf') 
    440442 
    441443      ENDIF 
     
    444446!Ice concentration change (from assimilation) 
    445447      ztmp(:,:)=ndaice_da(:,:)*tmask(:,:,1) 
    446       Call nemo2cice(ztmp,daice_da,'T', 1. ) 
     448      Call nemo2cice(ztmp,daice_da,'T', 1. ,'daice_da') 
    447449#endif  
    448450 
     
    451453      IF( iom_use('snowpre') )   CALL iom_put('snowpre',MAX( (1.0-fr_i(:,:))*sprecip(:,:) ,0.0)) !!Joakim edit   
    452454      ztmp(:,:)=MAX(fr_i(:,:)*sprecip(:,:),0.0)   
    453       CALL nemo2cice(ztmp,fsnow,'T', 1. )  
     455      CALL nemo2cice(ztmp,fsnow,'T', 1.,'fsnow' )  
    454456 
    455457! Rainfall 
    456458      IF( iom_use('precip') )   CALL iom_put('precip', (1.0-fr_i(:,:))*(tprecip(:,:)-sprecip(:,:)) ) !!Joakim edit 
    457459      ztmp(:,:)=fr_i(:,:)*(tprecip(:,:)-sprecip(:,:)) 
    458       CALL nemo2cice(ztmp,frain,'T', 1. )  
     460      CALL nemo2cice(ztmp,frain,'T', 1.,'frain' )  
    459461 
    460462! Recalculate freezing temperature and send to CICE  
    461463      CALL eos_fzp(sss_m(:,:), sstfrz(:,:), gdept_n(:,:,1))  
    462       CALL nemo2cice(sstfrz,Tf,'T', 1. ) 
     464      CALL nemo2cice(sstfrz,Tf,'T', 1. ,'Tf') 
    463465 
    464466! Freezing/melting potential 
    465467! Calculated over NEMO leapfrog timestep (hence 2*dt) 
    466468      nfrzmlt(:,:)=rau0*rcp*e3t_m(:,:)*(sstfrz(:,:)-sst_m(:,:))/(2.0*dt)  
    467       CALL nemo2cice(nfrzmlt,frzmlt,'T', 1. ) 
     469      CALL nemo2cice(nfrzmlt,frzmlt,'T', 1.,'frzmlt' ) 
    468470 
    469471! SST  and SSS 
    470472 
    471       CALL nemo2cice(sst_m,sst,'T', 1. ) 
    472       CALL nemo2cice(sss_m,sss,'T', 1. ) 
     473      CALL nemo2cice(sst_m,sst,'T', 1.,'sst' ) 
     474      CALL nemo2cice(sss_m,sss,'T', 1.,'sss' ) 
    473475 
    474476      IF( ksbc == jp_purecpl ) THEN 
    475477! Sea ice surface skin temperature 
    476478         DO jl=1,ncat 
    477            CALL nemo2cice(tsfc_ice(:,:,jl), trcrn(:,:,nt_tsfc,jl,:),'T',1.) 
     479           CALL nemo2cice(tsfc_ice(:,:,jl), trcrn(:,:,nt_tsfc,jl,:),'T',1., 'trcrn') 
    478480         ENDDO  
    479481      ENDIF 
     
    486488         ENDDO 
    487489      ENDDO 
    488       CALL nemo2cice(ztmp,uocn,'F', -1. ) 
     490      CALL nemo2cice(ztmp,uocn,'F', -1., 'uocn' ) 
    489491 
    490492! V point to F point 
     
    494496         ENDDO 
    495497      ENDDO 
    496       CALL nemo2cice(ztmp,vocn,'F', -1. ) 
     498      CALL nemo2cice(ztmp,vocn,'F', -1. ,'vocn') 
    497499 
    498500      IF( ln_ice_embd ) THEN             !== embedded sea ice: compute representative ice top surface ==! 
     
    521523         END DO 
    522524      END DO 
    523       CALL nemo2cice( ztmp,ss_tltx,'F', -1. ) 
     525      CALL nemo2cice( ztmp,ss_tltx,'F', -1. , 'ss_tltx') 
    524526 
    525527! T point to F point 
     
    530532         END DO 
    531533      END DO 
    532       CALL nemo2cice(ztmp,ss_tlty,'F', -1. ) 
     534      CALL nemo2cice(ztmp,ss_tlty,'F', -1. ,'ss_tlty') 
    533535      ! 
    534536   END SUBROUTINE cice_sbc_in 
     
    900902   END SUBROUTINE cice_sbc_force 
    901903 
    902    SUBROUTINE nemo2cice( pn, pc, cd_type, psgn) 
     904   SUBROUTINE nemo2cice( pn, pc, cd_type, psgn, varname) 
    903905      !!--------------------------------------------------------------------- 
    904906      !!                    ***  ROUTINE nemo2cice  *** 
     
    931933#endif 
    932934      REAL (kind=dbl_kind), dimension(nx_block,ny_block,max_blocks) :: pc 
     935      CHARACTER(len=10), INTENT( in ) :: varname 
    933936      INTEGER (int_kind) :: & 
    934937         field_type,        &! id for type of field (scalar, vector, angle) 
     
    10101013#endif 
    10111014 
     1015      IF ( ln_ctl ) THEN 
     1016         WRITE(numout,*)'nemo2cice: ',varname,' min,max = ',MINVAL(pc(:,:,:)), MAXVAL(pc(:,:,:)) 
     1017         CALL flush(numout) 
     1018      ENDIF 
    10121019   END SUBROUTINE nemo2cice 
    10131020 
Note: See TracChangeset for help on using the changeset viewer.