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 3355 – NEMO

Changeset 3355


Ignore:
Timestamp:
2012-04-13T14:05:07+02:00 (12 years ago)
Author:
charris
Message:

#953 First set of modifications (details in ticket).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2012/dev_3352_UKMO8_CICE/NEMOGCM/NEMO/OPA_SRC/SBC/sbcice_cice.F90

    r3294 r3355  
    146146      !!--------------------------------------------------------------------- 
    147147 
    148       INTEGER  ::   ji, jj, jpl                        ! dummy loop indices 
     148      INTEGER  ::   ji, jj, jl                        ! dummy loop indices 
    149149 
    150150      IF( nn_timing == 1 )  CALL timing_start('cice_sbc_init') 
     
    182182      CALL cice2nemo(aice,fr_i, 'T', 1. ) 
    183183      IF ( (nsbc == 2).OR.(nsbc == 5) ) THEN 
    184          DO jpl=1,ncat 
    185             CALL cice2nemo(aicen(:,:,jpl,:),a_i(:,:,jpl), 'T', 1. ) 
     184         DO jl=1,ncat 
     185            CALL cice2nemo(aicen(:,:,jl,:),a_i(:,:,jl), 'T', 1. ) 
    186186         ENDDO 
    187187      ENDIF 
     
    212212      INTEGER, INTENT(in   ) ::   nsbc ! surface forcing type 
    213213 
    214       INTEGER  ::   ji, jj, jpl                   ! dummy loop indices       
     214      INTEGER  ::   ji, jj, jl                   ! dummy loop indices       
    215215      REAL(wp), DIMENSION(:,:), POINTER :: ztmp 
    216216      REAL(wp), DIMENSION(:,:,:), POINTER :: ztmpn 
     
    259259! Surface downward latent heat flux (CI_5) 
    260260         IF (nsbc == 2) THEN 
    261             DO jpl=1,ncat 
    262                ztmpn(:,:,jpl)=qla_ice(:,:,1)*a_i(:,:,jpl) 
     261            DO jl=1,ncat 
     262               ztmpn(:,:,jl)=qla_ice(:,:,1)*a_i(:,:,jl) 
    263263            ENDDO 
    264264         ELSE 
     
    269269               DO ji=1,jpi 
    270270                  IF (fr_i(ji,jj).eq.0.0) THEN 
    271                      DO jpl=1,ncat 
    272                         ztmpn(ji,jj,jpl)=0.0 
     271                     DO jl=1,ncat 
     272                        ztmpn(ji,jj,jl)=0.0 
    273273                     ENDDO 
    274274                     ! This will then be conserved in CICE 
    275275                     ztmpn(ji,jj,1)=qla_ice(ji,jj,1) 
    276276                  ELSE 
    277                      DO jpl=1,ncat 
    278                         ztmpn(ji,jj,jpl)=qla_ice(ji,jj,1)*a_i(ji,jj,jpl)/fr_i(ji,jj) 
     277                     DO jl=1,ncat 
     278                        ztmpn(ji,jj,jl)=qla_ice(ji,jj,1)*a_i(ji,jj,jl)/fr_i(ji,jj) 
    279279                     ENDDO 
    280280                  ENDIF 
     
    282282            ENDDO 
    283283         ENDIF 
    284          DO jpl=1,ncat 
    285             CALL nemo2cice(ztmpn(:,:,jpl),flatn_f(:,:,jpl,:),'T', 1. ) 
     284         DO jl=1,ncat 
     285            CALL nemo2cice(ztmpn(:,:,jl),flatn_f(:,:,jl,:),'T', 1. ) 
    286286 
    287287! GBM conductive flux through ice (CI_6) 
    288288!  Convert to GBM 
    289289            IF (nsbc == 2) THEN 
    290                ztmp(:,:) = botmelt(:,:,jpl)*a_i(:,:,jpl) 
     290               ztmp(:,:) = botmelt(:,:,jl)*a_i(:,:,jl) 
    291291            ELSE 
    292                ztmp(:,:) = botmelt(:,:,jpl) 
     292               ztmp(:,:) = botmelt(:,:,jl) 
    293293            ENDIF 
    294             CALL nemo2cice(ztmp,fcondtopn_f(:,:,jpl,:),'T', 1. ) 
     294            CALL nemo2cice(ztmp,fcondtopn_f(:,:,jl,:),'T', 1. ) 
    295295 
    296296! GBM surface heat flux (CI_7) 
    297297!  Convert to GBM 
    298298            IF (nsbc == 2) THEN 
    299                ztmp(:,:) = (topmelt(:,:,jpl)+botmelt(:,:,jpl))*a_i(:,:,jpl)  
     299               ztmp(:,:) = (topmelt(:,:,jl)+botmelt(:,:,jl))*a_i(:,:,jl)  
    300300            ELSE 
    301                ztmp(:,:) = (topmelt(:,:,jpl)+botmelt(:,:,jpl)) 
     301               ztmp(:,:) = (topmelt(:,:,jl)+botmelt(:,:,jl)) 
    302302            ENDIF 
    303             CALL nemo2cice(ztmp,fsurfn_f(:,:,jpl,:),'T', 1. ) 
     303            CALL nemo2cice(ztmp,fsurfn_f(:,:,jl,:),'T', 1. ) 
    304304         ENDDO 
    305305 
     
    420420      INTEGER, INTENT( in  ) ::   nsbc ! surface forcing type 
    421421       
    422       INTEGER  ::   ji, jj, jpl                 ! dummy loop indices 
    423       REAL(wp), DIMENSION(:,:), POINTER :: ztmp 
     422      INTEGER  ::   ji, jj, jl                 ! dummy loop indices 
     423      REAL(wp), DIMENSION(:,:), POINTER :: ztmp1, ztmp2 
    424424      !!--------------------------------------------------------------------- 
    425425 
    426426      IF( nn_timing == 1 )  CALL timing_start('cice_sbc_out') 
    427427      ! 
    428       CALL wrk_alloc( jpi,jpj, ztmp ) 
     428      CALL wrk_alloc( jpi,jpj, ztmp1, ztmp2 ) 
    429429       
    430430      IF( kt == nit000 )  THEN 
     
    433433       
    434434! x comp of ocean-ice stress  
    435       CALL cice2nemo(strocnx,ztmp,'F', -1. ) 
     435      CALL cice2nemo(strocnx,ztmp1,'F', -1. ) 
    436436      ss_iou(:,:)=0.0 
    437437! F point to U point 
    438438      DO jj=2,jpjm1 
    439439         DO ji=2,jpim1 
    440             ss_iou(ji,jj) = 0.5 * ( ztmp(ji,jj-1) + ztmp(ji,jj) ) * umask(ji,jj,1) 
     440            ss_iou(ji,jj) = 0.5 * ( ztmp1(ji,jj-1) + ztmp1(ji,jj) ) * umask(ji,jj,1) 
    441441         ENDDO 
    442442      ENDDO 
     
    444444 
    445445! y comp of ocean-ice stress  
    446       CALL cice2nemo(strocny,ztmp,'F', -1. ) 
     446      CALL cice2nemo(strocny,ztmp1,'F', -1. ) 
    447447      ss_iov(:,:)=0.0 
    448448! F point to V point 
     
    450450      DO jj=1,jpjm1 
    451451         DO ji=2,jpim1 
    452             ss_iov(ji,jj) = 0.5 * ( ztmp(ji-1,jj) + ztmp(ji,jj) ) * vmask(ji,jj,1) 
     452            ss_iov(ji,jj) = 0.5 * ( ztmp1(ji-1,jj) + ztmp1(ji,jj) ) * vmask(ji,jj,1) 
    453453         ENDDO 
    454454      ENDDO 
     
    477477      ENDIF 
    478478 
    479 ! Subtract fluxes from CICE to get freshwater equivalent flux used in  
    480 ! salinity calculation 
    481       CALL cice2nemo(fresh_gbm,ztmp,'T', 1. ) 
    482       emps(:,:)=emp(:,:)-ztmp(:,:) 
    483 ! Note the 1000.0 is to convert from kg salt to g salt (needed for PSU) 
    484       CALL cice2nemo(fsalt_gbm,ztmp,'T', 1. ) 
    485       DO jj=1,jpj 
    486          DO ji=1,jpi 
    487             IF (sss_m(ji,jj).gt.0.0) THEN 
    488                emps(ji,jj)=emps(ji,jj)+ztmp(ji,jj)*1000.0/sss_m(ji,jj) 
    489             ENDIF 
    490          ENDDO 
    491       ENDDO 
    492  
    493 ! No longer remove precip over ice from free surface calculation on basis that the 
     479      CALL cice2nemo(fresh_gbm,ztmp1,'T', 1. ) 
     480      CALL cice2nemo(fsalt_gbm,ztmp2,'T', 1. ) 
     481! Check to avoid unphysical expression when ice is forming (ztmp1 negative) 
     482! Otherwise we are effectively allowing ice of higher salinity than the ocean to form 
     483! which has to be compensated for by the ocean salinity potentially going negative 
     484! This check breaks conservation but seems reasonable until we have prognostic ice salinity 
     485! The lines below ensure that when ice is forming emps will not be negative 
     486! Note the 1000.0 below is to convert from kg salt to g salt (needed for PSU) 
     487      emps(:,:)=0.0 
     488      WHERE (ztmp1(:,:).lt.0.0) ztmp2(:,:)=MAX(ztmp2(:,:),ztmp1(:,:)*sss_m(:,:)/1000.0) 
     489      WHERE (sss_m(:,:).gt.0.0) emps(:,:)=-ztmp1(:,:)+ztmp2(:,:)*1000.0/sss_m(:,:) 
     490! Now add other non-ice freshwater contributions into emps 
     491      emps(:,:)=emp(:,:)+emps(:,:) 
     492  
     493      IF (lk_vvl) THEN 
     494 
     495! The relevant quantity for calculating the salinity change is emps-emp 
     496! This is in fact just the ztmp2*1000.0/sss_m term above 
     497         emp(:,:)=emp(:,:)-ztmp1(:,:) 
     498 
     499      ELSE 
     500 
     501! Don't remove precip over ice from free surface calculation on basis that the 
    494502! weight of the precip will affect the free surface even if it falls on the ice 
    495 ! (same to the argument that freezing / melting of ice doesn't change the free surface)  
    496 ! Sublimation from the ice is treated in a similar way (included in emp but not emps)   
    497 ! 
    498 ! This should not be done in the variable volume case 
    499  
    500       IF (.NOT. lk_vvl) THEN 
    501  
     503! (same argument that freezing / melting of ice doesn't change the free surface)  
    502504         emp(:,:)  = emp(:,:) - tprecip(:,:)*fr_i(:,:) 
    503  
    504 ! Take sublimation into account 
     505! Sublimation from the ice is treated in a similar way (included in emp but not emps) 
    505506         IF (nsbc == 5 ) THEN  
    506507            emp(:,:) = emp(:,:) + ( emp_ice(:,:) + sprecip(:,:) ) 
     
    532533! Now add in ice / snow related terms 
    533534! [fswthru will be zero unless running with calc_Tsfc=T in CICE] 
    534       CALL cice2nemo(fswthru_gbm,ztmp,'T', 1. ) 
    535       qsr(:,:)=qsr(:,:)+ztmp(:,:) 
     535      CALL cice2nemo(fswthru_gbm,ztmp1,'T', 1. ) 
     536      qsr(:,:)=qsr(:,:)+ztmp1(:,:) 
    536537      CALL lbc_lnk( qsr , 'T', 1. ) 
    537538 
     
    542543      ENDDO 
    543544 
    544       CALL cice2nemo(fhocn_gbm,ztmp,'T', 1. ) 
    545       qns(:,:)=qns(:,:)+nfrzmlt(:,:)+ztmp(:,:) 
     545      CALL cice2nemo(fhocn_gbm,ztmp1,'T', 1. ) 
     546      qns(:,:)=qns(:,:)+nfrzmlt(:,:)+ztmp1(:,:) 
    546547 
    547548      CALL lbc_lnk( qns , 'T', 1. ) 
     
    551552      CALL cice2nemo(aice,fr_i,'T', 1. ) 
    552553      IF ( (nsbc == 2).OR.(nsbc == 5) ) THEN 
    553          DO jpl=1,ncat 
    554             CALL cice2nemo(aicen(:,:,jpl,:),a_i(:,:,jpl), 'T', 1. ) 
     554         DO jl=1,ncat 
     555            CALL cice2nemo(aicen(:,:,jl,:),a_i(:,:,jl), 'T', 1. ) 
    555556         ENDDO 
    556557      ENDIF 
     
    570571! Release work space 
    571572 
    572       CALL wrk_dealloc( jpi,jpj, ztmp ) 
     573      CALL wrk_dealloc( jpi,jpj, ztmp1, ztmp2 ) 
    573574      ! 
    574575      IF( nn_timing == 1 )  CALL timing_stop('cice_sbc_out') 
     
    587588      !!--------------------------------------------------------------------- 
    588589 
    589       INTEGER  ::   jpl                        ! dummy loop index 
     590      INTEGER  ::   jl                        ! dummy loop index 
    590591      INTEGER  ::   ierror 
    591592 
     
    610611! Snow and ice thicknesses (CO_2 and CO_3) 
    611612 
    612       DO jpl = 1,ncat 
    613          CALL cice2nemo(vsnon(:,:,jpl,:),ht_s(:,:,jpl),'T', 1. ) 
    614          CALL cice2nemo(vicen(:,:,jpl,:),ht_i(:,:,jpl),'T', 1. ) 
     613      DO jl = 1,ncat 
     614         CALL cice2nemo(vsnon(:,:,jl,:),ht_s(:,:,jl),'T', 1. ) 
     615         CALL cice2nemo(vicen(:,:,jl,:),ht_i(:,:,jl),'T', 1. ) 
    615616      ENDDO 
    616617      ! 
Note: See TracChangeset for help on using the changeset viewer.