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 4927 for branches/2014/dev_CNRS_CICE/NEMOGCM/NEMO – NEMO

Ignore:
Timestamp:
2014-12-01T10:09:19+01:00 (10 years ago)
Author:
cetlod
Message:

2014/dev_CNRS_CICE : merging CCIE branch into dev_CNRS_CICE

Location:
branches/2014/dev_CNRS_CICE/NEMOGCM/NEMO
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/2014/dev_CNRS_CICE/NEMOGCM/NEMO/LIM_SRC_3/limdiahsb.F90

    r4765 r4927  
    7777      z1_area = 1.d0 / MAX( glob_sum( area(:,:) * tms(:,:) ), epsi06 ) 
    7878 
    79       zinda = MAX( 0.d0 , SIGN( 1.d0 , glob_sum( area(:,:) * tms(:,:) ) - epsi06 ) ) 
     79      zinda = MAX( 0._wp , SIGN( 1._wp , glob_sum( area(:,:) * tms(:,:) ) - epsi06 ) ) 
    8080      ! ----------------------- ! 
    8181      ! 1 -  Content variations ! 
     
    153153      ! 3 - Diagnostics writing ! 
    154154      ! ----------------------- ! 
    155       zindb = MAX( 0.d0 , SIGN( 1.d0 , zbg_ivo - epsi06 ) ) 
     155      zindb = MAX( 0._wp , SIGN( 1._wp , zbg_ivo - epsi06 ) ) 
    156156      ! 
    157157      CALL iom_put( 'ibgvoltot' , zbg_ivo * rhoic * r1_rau0 * 1.e-9        )   ! ice volume (km3 equivalent liquid)          
  • branches/2014/dev_CNRS_CICE/NEMOGCM/NEMO/LIM_SRC_3/limistate.F90

    r4765 r4927  
    301301 
    302302      IF(lwp) THEN  
    303          WRITE(numout,*), ' ztests : ', ztests 
     303         WRITE(numout,*) ' ztests : ', ztests 
    304304         IF ( ztests .NE. 4 ) THEN 
    305305            WRITE(numout,*) 
    306             WRITE(numout,*), ' !!!! ALERT                  !!! ' 
    307             WRITE(numout,*), ' !!!! Something is wrong in the LIM3 initialization procedure ' 
     306            WRITE(numout,*) ' !!!! ALERT                  !!! ' 
     307            WRITE(numout,*) ' !!!! Something is wrong in the LIM3 initialization procedure ' 
    308308            WRITE(numout,*) 
    309             WRITE(numout,*), ' *** ztests is not equal to 4 ' 
    310             WRITE(numout,*), ' *** ztest_i (i=1,4) = ', ztest_1, ztest_2, ztest_3, ztest_4 
    311             WRITE(numout,*), ' zat_i_ini : ', zat_i_ini(i_hemis) 
    312             WRITE(numout,*), ' zht_i_ini : ', zht_i_ini(i_hemis) 
     309            WRITE(numout,*) ' *** ztests is not equal to 4 ' 
     310            WRITE(numout,*) ' *** ztest_i (i=1,4) = ', ztest_1, ztest_2, ztest_3, ztest_4 
     311            WRITE(numout,*) ' zat_i_ini : ', zat_i_ini(i_hemis) 
     312            WRITE(numout,*) ' zht_i_ini : ', zht_i_ini(i_hemis) 
    313313         ENDIF ! ztests .NE. 4 
    314314      ENDIF 
  • branches/2014/dev_CNRS_CICE/NEMOGCM/NEMO/OPA_SRC/SBC/sbc_ice.F90

    r4306 r4927  
    2121   USE ice_2 
    2222# endif 
    23 # if defined key_cice  
     23# if defined key_cice 
    2424   USE ice_domain_size, only: ncat  
    2525#endif 
  • branches/2014/dev_CNRS_CICE/NEMOGCM/NEMO/OPA_SRC/SBC/sbcfwb.F90

    r4689 r4927  
    9090         area = glob_sum( e1e2t(:,:) )           ! interior global domain surface 
    9191         ! 
    92 #if ! defined key_lim2 &&  ! defined key_lim3 && ! defined key_cice  
     92#if ! defined key_lim2 &&  ! defined key_lim3 && ! defined key_cice 
    9393         snwice_mass_b(:,:) = 0.e0               ! no sea-ice model is being used : no snow+ice mass 
    9494         snwice_mass  (:,:) = 0.e0 
  • branches/2014/dev_CNRS_CICE/NEMOGCM/NEMO/OPA_SRC/SBC/sbcice_cice.F90

    r4627 r4927  
    1717   USE phycst, only : rcp, rau0, r1_rau0, rhosn, rhoic 
    1818   USE in_out_manager  ! I/O manager 
     19   USE iom, only : iom_put              ! I/O manager library !!Joakim edit 
    1920   USE lib_mpp         ! distributed memory computing library 
    2021   USE lbclnk          ! ocean lateral boundary conditions (or mpp link) 
     
    2324   USE daymod          ! calendar 
    2425   USE fldread         ! read input fields 
    25  
    2626   USE sbc_oce         ! Surface boundary condition: ocean fields 
    2727   USE sbc_ice         ! Surface boundary condition: ice   fields 
     
    3838   USE ice_calendar, only: dt 
    3939   USE ice_state, only: aice,aicen,uvel,vvel,vsno,vsnon,vice,vicen 
     40# if defined key_cice4 
    4041   USE ice_flux, only: strax,stray,strocnx,strocny,frain,fsnow,  & 
    4142                sst,sss,uocn,vocn,ss_tltx,ss_tlty,fsalt_gbm,     & 
     
    4445                uatm,vatm,wind,fsw,flw,Tair,potT,Qa,rhoa,zlvl,   & 
    4546                swvdr,swvdf,swidr,swidf 
     47   USE ice_therm_vertical, only: calc_Tsfc 
     48#else 
     49   USE ice_flux, only: strax,stray,strocnx,strocny,frain,fsnow,  & 
     50                sst,sss,uocn,vocn,ss_tltx,ss_tlty,fsalt_ai,     & 
     51                fresh_ai,fhocn_ai,fswthru_ai,frzmlt,          & 
     52                flatn_f,fsurfn_f,fcondtopn_f,                    & 
     53                uatm,vatm,wind,fsw,flw,Tair,potT,Qa,rhoa,zlvl,   & 
     54                swvdr,swvdf,swidr,swidf 
     55   USE ice_therm_shared, only: calc_Tsfc 
     56#endif 
    4657   USE ice_forcing, only: frcvdr,frcvdf,frcidr,frcidf 
    4758   USE ice_atmo, only: calc_strair 
    48    USE ice_therm_vertical, only: calc_Tsfc 
    4959 
    5060   USE CICE_InitMod 
     
    149159      REAL(wp), DIMENSION(:,:), POINTER :: ztmp1, ztmp2 
    150160      REAL(wp) ::   zcoefu, zcoefv, zcoeff            ! local scalar 
    151       INTEGER  ::   ji, jj, jl                        ! dummy loop indices 
     161      INTEGER  ::   ji, jj, jl, jk                    ! dummy loop indices 
    152162      !!--------------------------------------------------------------------- 
    153163 
     
    160170      ji_off = INT ( (jpiglo - nx_global) / 2 ) 
    161171      jj_off = INT ( (jpjglo - ny_global) / 2 ) 
     172 
     173#if defined key_nemocice_decomp 
     174      ! Pass initial SST from NEMO to CICE so ice is initialised correctly if 
     175      ! there is no restart file. 
     176      ! Values from a CICE restart file would overwrite this 
     177      IF ( .NOT. ln_rstart ) THEN     
     178         CALL nemo2cice( tsn(:,:,1,jp_tem) , sst , 'T' , 1.)  
     179      ENDIF   
     180#endif 
    162181 
    163182! Initialize CICE 
     
    218237         snwice_mass_b(:,:) = 0.0_wp         ! no mass exchanges 
    219238      ENDIF 
    220       IF( nn_ice_embd == 2 .AND.          &  ! full embedment (case 2) & no restart :  
    221          &   .NOT.ln_rstart ) THEN           ! deplete the initial ssh belew sea-ice area 
    222          sshn(:,:) = sshn(:,:) - snwice_mass(:,:) * r1_rau0 
    223          sshb(:,:) = sshb(:,:) - snwice_mass(:,:) * r1_rau0 
    224          ! 
     239      IF( .NOT. ln_rstart ) THEN 
     240         IF( nn_ice_embd == 2 ) THEN            ! full embedment (case 2) deplete the initial ssh below sea-ice area 
     241            sshn(:,:) = sshn(:,:) - snwice_mass(:,:) * r1_rau0 
     242            sshb(:,:) = sshb(:,:) - snwice_mass(:,:) * r1_rau0 
     243#if defined key_vvl             
     244           ! key_vvl necessary? clem: yes for compilation purpose 
     245            DO jk = 1,jpkm1                     ! adjust initial vertical scale factors 
     246               fse3t_n(:,:,jk) = e3t_0(:,:,jk)*( 1._wp + sshn(:,:)*tmask(:,:,1)/(ht_0(:,:) + 1.0 - tmask(:,:,1)) ) 
     247               fse3t_b(:,:,jk) = e3t_0(:,:,jk)*( 1._wp + sshb(:,:)*tmask(:,:,1)/(ht_0(:,:) + 1.0 - tmask(:,:,1)) ) 
     248            ENDDO 
     249            fse3t_a(:,:,:) = fse3t_b(:,:,:) 
     250            ! Reconstruction of all vertical scale factors at now and before time 
     251            ! steps 
     252            ! ============================================================================= 
     253            ! Horizontal scale factor interpolations 
     254            ! -------------------------------------- 
     255            CALL dom_vvl_interpol( fse3t_b(:,:,:), fse3u_b(:,:,:), 'U' ) 
     256            CALL dom_vvl_interpol( fse3t_b(:,:,:), fse3v_b(:,:,:), 'V' ) 
     257            CALL dom_vvl_interpol( fse3t_n(:,:,:), fse3u_n(:,:,:), 'U' ) 
     258            CALL dom_vvl_interpol( fse3t_n(:,:,:), fse3v_n(:,:,:), 'V' ) 
     259            CALL dom_vvl_interpol( fse3u_n(:,:,:), fse3f_n(:,:,:), 'F' ) 
     260            ! Vertical scale factor interpolations 
     261            ! ------------------------------------ 
     262            CALL dom_vvl_interpol( fse3t_n(:,:,:), fse3w_n (:,:,:), 'W'  ) 
     263            CALL dom_vvl_interpol( fse3u_n(:,:,:), fse3uw_n(:,:,:), 'UW' ) 
     264            CALL dom_vvl_interpol( fse3v_n(:,:,:), fse3vw_n(:,:,:), 'VW' ) 
     265            CALL dom_vvl_interpol( fse3u_b(:,:,:), fse3uw_b(:,:,:), 'UW' ) 
     266            CALL dom_vvl_interpol( fse3v_b(:,:,:), fse3vw_b(:,:,:), 'VW' ) 
     267            ! t- and w- points depth 
     268            ! ---------------------- 
     269            fsdept_n(:,:,1) = 0.5_wp * fse3w_n(:,:,1) 
     270            fsdepw_n(:,:,1) = 0.0_wp 
     271            fsde3w_n(:,:,1) = fsdept_n(:,:,1) - sshn(:,:) 
     272            DO jk = 2, jpk 
     273               fsdept_n(:,:,jk) = fsdept_n(:,:,jk-1) + fse3w_n(:,:,jk) 
     274               fsdepw_n(:,:,jk) = fsdepw_n(:,:,jk-1) + fse3t_n(:,:,jk-1) 
     275               fsde3w_n(:,:,jk) = fsdept_n(:,:,jk  ) - sshn   (:,:) 
     276            END DO 
     277#endif 
     278         ENDIF 
    225279      ENDIF 
    226280  
     
    375429 
    376430! Snowfall 
    377 ! Ensure fsnow is positive (as in CICE routine prepare_forcing)   
     431! Ensure fsnow is positive (as in CICE routine prepare_forcing) 
     432      CALL iom_put('snowpre',MAX( (1.0-fr_i(:,:))*sprecip(:,:) ,0.0)) !!Joakim edit   
    378433      ztmp(:,:)=MAX(fr_i(:,:)*sprecip(:,:),0.0)   
    379434      CALL nemo2cice(ztmp,fsnow,'T', 1. )  
    380435 
    381436! Rainfall 
     437      CALL iom_put('precip', (1.0-fr_i(:,:))*(tprecip(:,:)-sprecip(:,:)) ) !!Joakim edit 
    382438      ztmp(:,:)=fr_i(:,:)*(tprecip(:,:)-sprecip(:,:)) 
    383439      CALL nemo2cice(ztmp,frain,'T', 1. )  
     
    524580      ENDIF 
    525581 
     582#if defined key_cice4 
    526583      CALL cice2nemo(fresh_gbm,ztmp1,'T', 1. ) 
    527584      CALL cice2nemo(fsalt_gbm,ztmp2,'T', 1. ) 
     585#else 
     586      CALL cice2nemo(fresh_ai,ztmp1,'T', 1. ) 
     587      CALL cice2nemo(fsalt_ai,ztmp2,'T', 1. ) 
     588#endif 
    528589 
    529590! Check to avoid unphysical expression when ice is forming (ztmp1 negative) 
     
    535596      sfx(:,:)=ztmp2(:,:)*1000.0 
    536597      emp(:,:)=emp(:,:)-ztmp1(:,:) 
    537   
     598      fmmflx(:,:) = ztmp1(:,:) !!Joakim edit 
     599       
    538600      CALL lbc_lnk( emp , 'T', 1. ) 
    539601      CALL lbc_lnk( sfx , 'T', 1. ) 
     
    557619! Now add in ice / snow related terms 
    558620! [fswthru will be zero unless running with calc_Tsfc=T in CICE] 
     621#if defined key_cice4 
    559622      CALL cice2nemo(fswthru_gbm,ztmp1,'T', 1. ) 
     623#else 
     624      CALL cice2nemo(fswthru_ai,ztmp1,'T', 1. ) 
     625#endif 
    560626      qsr(:,:)=qsr(:,:)+ztmp1(:,:) 
    561627      CALL lbc_lnk( qsr , 'T', 1. ) 
     
    567633      ENDDO 
    568634 
     635#if defined key_cice4 
    569636      CALL cice2nemo(fhocn_gbm,ztmp1,'T', 1. ) 
     637#else 
     638      CALL cice2nemo(fhocn_ai,ztmp1,'T', 1. ) 
     639#endif 
    570640      qns(:,:)=qns(:,:)+nfrzmlt(:,:)+ztmp1(:,:) 
    571641 
     
    713783      IF( kt == nit000 ) THEN                   !  First call kt=nit000  ! 
    714784         !                                      ! ====================== ! 
     785         ! namsbc_cice is not yet in the reference namelist 
     786         ! set file information (default values) 
     787         cn_dir = './'       ! directory in which the model is executed 
     788 
     789         ! (NB: frequency positive => hours, negative => months) 
     790         !            !    file          ! frequency !  variable    ! time intep !  clim   ! 'yearly' or ! weights  ! rotation   ! landmask 
     791         !            !    name          !  (hours)  !   name       !   (T/F)    !  (T/F)  !  'monthly'  ! filename ! pairs      ! file 
     792         sn_snow = FLD_N( 'snowfall_1m'  ,    -1.    ,  'snowfall'  ,  .true.    , .true.  ,  ' yearly'  , ''       , ''         ,  ''    )  
     793         sn_rain = FLD_N( 'rainfall_1m'  ,    -1.    ,  'rainfall'  ,  .true.    , .true.  ,  ' yearly'  , ''       , ''         ,  ''    )  
     794         sn_sblm = FLD_N( 'sublim_1m'    ,    -1.    ,  'sublim'    ,  .true.    , .true.  ,  ' yearly'  , ''       , ''         ,  ''    ) 
     795         sn_top1 = FLD_N( 'topmeltn1_1m' ,    -1.    ,  'topmeltn1' ,  .true.    , .true.  ,  ' yearly'  , ''       , ''         ,  ''    ) 
     796         sn_top2 = FLD_N( 'topmeltn2_1m' ,    -1.    ,  'topmeltn2' ,  .true.    , .true.  ,  ' yearly'  , ''       , ''         ,  ''    ) 
     797         sn_top3 = FLD_N( 'topmeltn3_1m' ,    -1.    ,  'topmeltn3' ,  .true.    , .true.  ,  ' yearly'  , ''       , ''         ,  ''    ) 
     798         sn_top4 = FLD_N( 'topmeltn4_1m' ,    -1.    ,  'topmeltn4' ,  .true.    , .true.  ,  ' yearly'  , ''       , ''         ,  ''    ) 
     799         sn_top5 = FLD_N( 'topmeltn5_1m' ,    -1.    ,  'topmeltn5' ,  .true.    , .true.  ,  ' yearly'  , ''       , ''         ,  ''    ) 
     800         sn_bot1 = FLD_N( 'botmeltn1_1m' ,    -1.    ,  'botmeltn1' ,  .true.    , .true.  ,  ' yearly'  , ''       , ''         ,  ''    ) 
     801         sn_bot2 = FLD_N( 'botmeltn2_1m' ,    -1.    ,  'botmeltn2' ,  .true.    , .true.  ,  ' yearly'  , ''       , ''         ,  ''    ) 
     802         sn_bot3 = FLD_N( 'botmeltn3_1m' ,    -1.    ,  'botmeltn3' ,  .true.    , .true.  ,  ' yearly'  , ''       , ''         ,  ''    ) 
     803         sn_bot4 = FLD_N( 'botmeltn4_1m' ,    -1.    ,  'botmeltn4' ,  .true.    , .true.  ,  ' yearly'  , ''       , ''         ,  ''    ) 
     804         sn_bot5 = FLD_N( 'botmeltn5_1m' ,    -1.    ,  'botmeltn5' ,  .true.    , .true.  ,  ' yearly'  , ''       , ''         ,  ''    ) 
     805 
    715806         REWIND( numnam_ref )              ! Namelist namsbc_cice in reference namelist :  
    716807         READ  ( numnam_ref, namsbc_cice, IOSTAT = ios, ERR = 901) 
Note: See TracChangeset for help on using the changeset viewer.