Ignore:
Timestamp:
2018-12-18T16:57:34+01:00 (3 years ago)
Message:

make all the sette tests successful

Location:
Files:
9 edited

### Legend:

Unmodified
Removed

 r9902 &namdyn         !   Ice dynamics !------------------------------------------------------------------------------ ln_landfast      = .false.         !  landfast ice parameterization (T or F) / !------------------------------------------------------------------------------

 r10399 !                               ! -- check h_i -- ! ! if h_i is larger than the surrounding 9 pts => reduce h_i and increase a_i zhi = v_i (ji,jj,jl) / a_i(ji,jj,jl) zhi = v_i(ji,jj,jl) / a_i(ji,jj,jl) !!clem                  zdv = v_i(ji,jj,jl) - v_i_b(ji,jj,jl) !!clem                  IF ( ( zdv >  0.0 .AND. zh > phmax(ji,jj,jl) .AND. at_i_b(ji,jj) < 0.80 ) .OR. & !                               ! -- check h_s -- ! ! if h_s is larger than the surrounding 9 pts => put the snow excess in the ocean zhs = v_s (ji,jj,jl) / a_i(ji,jj,jl) zhs = v_s(ji,jj,jl) / a_i(ji,jj,jl) IF( v_s(ji,jj,jl) > 0._wp .AND. zhs > phs_max(ji,jj,jl) .AND. a_i(ji,jj,jl) < 0.15 ) THEN zfra = a_i(ji,jj,jl) * phs_max(ji,jj,jl) / MAX( v_s(ji,jj,jl), epsi20 )

 r10399 ELSE                    ;   icycle = 1 ENDIF zdt = rdt_ice / REAL(icycle) IF(.NOT. ALLOCATED(z1_ai))       ALLOCATE(z1_ai(jpi,jpj)) IF(.NOT. ALLOCATED(amaxu))       ALLOCATE(amaxu (jpi,jpj)) IF(.NOT. ALLOCATED(amaxv))       ALLOCATE(amaxv (jpi,jpj)) IF( ll_zeroup2 ) THEN IF(.NOT. ALLOCATED(amaxu))       ALLOCATE(amaxu (jpi,jpj)) IF(.NOT. ALLOCATED(amaxv))       ALLOCATE(amaxv (jpi,jpj)) ENDIF !---------------! !== advection ==! &         * tmask(ji,jj,1) ENDIF IF( ji==26 .AND. jj==86) THEN WRITE(numout,*) '************************' WRITE(numout,*) 'zpt upstream',zpt(ji,jj) ENDIF !!                  IF( ji==26 .AND. jj==86) THEN !!                     WRITE(numout,*) '************************' !!                     WRITE(numout,*) 'zpt upstream',zpt(ji,jj) !!                  ENDIF END DO END DO &         * tmask(ji,jj,1) ENDIF IF( ji==26 .AND. jj==86) THEN WRITE(numout,*) '************************' WRITE(numout,*) 'zpt upstream',zpt(ji,jj) ENDIF !!                  IF( ji==26 .AND. jj==86) THEN !!                     WRITE(numout,*) '************************' !!                     WRITE(numout,*) 'zpt upstream',zpt(ji,jj) !!                  ENDIF END DO END DO zt_ups(ji,jj) = ( ptc(ji,jj) + pdt * ztra ) * tmask(ji,jj,1) ENDIF IF( ji==26 .AND. jj==86) THEN WRITE(numout,*) '**************************' WRITE(numout,*) 'zt upstream',zt_ups(ji,jj) ENDIF !!            IF( ji==26 .AND. jj==86) THEN !!               WRITE(numout,*) '**************************' !!               WRITE(numout,*) 'zt upstream',zt_ups(ji,jj) !!            ENDIF END DO END DO IF( pt(ji,jj) < 0._wp .AND. pt(ji,jj) >= -epsi20 )   pt(ji,jj) = 0._wp IF( ji==26 .AND. jj==86) THEN WRITE(numout,*) 'zt high order',pt(ji,jj) ENDIF !!               IF( ji==26 .AND. jj==86) THEN !!                  WRITE(numout,*) 'zt high order',pt(ji,jj) !!               ENDIF END DO END DO ptc(ji,jj) = ( ptc(ji,jj) + ztra ) * tmask(ji,jj,1) IF( ji==26 .AND. jj==86) THEN WRITE(numout,*) 'ztc high order',ptc(ji,jj) ENDIF !!               IF( ji==26 .AND. jj==86) THEN !!                  WRITE(numout,*) 'ztc high order',ptc(ji,jj) !!               ENDIF END DO WRITE(numout,*) '*** 1 negative high order zzt ***',ji,jj,zzt(ji,jj) ENDIF IF( ji==26 .AND. jj==86) THEN WRITE(numout,*) 'zzt high order',zzt(ji,jj) WRITE(numout,*) 'pfu_ho',(pfu_ho(ji,jj)) * r1_e1e2t(ji,jj) * pdt WRITE(numout,*) 'pfv_ho',(pfv_ho(ji,jj)) * r1_e1e2t(ji,jj) * pdt WRITE(numout,*) 'pfu_hom1',(pfu_ho(ji-1,jj)) * r1_e1e2t(ji,jj) * pdt WRITE(numout,*) 'pfv_hom1',(pfv_ho(ji,jj-1)) * r1_e1e2t(ji,jj) * pdt ENDIF !!               IF( ji==26 .AND. jj==86) THEN !!                  WRITE(numout,*) 'zzt high order',zzt(ji,jj) !!                  WRITE(numout,*) 'pfu_ho',(pfu_ho(ji,jj)) * r1_e1e2t(ji,jj) * pdt !!                  WRITE(numout,*) 'pfv_ho',(pfv_ho(ji,jj)) * r1_e1e2t(ji,jj) * pdt !!                  WRITE(numout,*) 'pfu_hom1',(pfu_ho(ji-1,jj)) * r1_e1e2t(ji,jj) * pdt !!                  WRITE(numout,*) 'pfv_hom1',(pfv_ho(ji,jj-1)) * r1_e1e2t(ji,jj) * pdt !!               ENDIF IF( ll_gurvan ) THEN zzt(ji,jj) = ( pt(ji,jj) - ( pfu_ho(ji,jj) - pfu_ho(ji-1,jj) ) * pdt * r1_e1e2t(ji,jj)  & ! IF( ji==26 .AND. jj==86) THEN WRITE(numout,*) '-----------------' WRITE(numout,*) 'zpos',zpos,zpos2 WRITE(numout,*) 'zneg',zneg,zneg2 WRITE(numout,*) 'puc/pu',ABS(puc(ji,jj))/MAX(epsi20, ABS(pu(ji,jj))) WRITE(numout,*) 'pvc/pv',ABS(pvc(ji,jj))/MAX(epsi20, ABS(pv(ji,jj))) WRITE(numout,*) 'pucm1/pu',ABS(puc(ji-1,jj))/MAX(epsi20, ABS(pu(ji-1,jj))) WRITE(numout,*) 'pvcm1/pv',ABS(pvc(ji,jj-1))/MAX(epsi20, ABS(pv(ji,jj-1))) WRITE(numout,*) 'pfu_ho',(pfu_ho(ji,jj)+pfu_low(ji,jj)) * r1_e1e2t(ji,jj) * pdt WRITE(numout,*) 'pfv_ho',(pfv_ho(ji,jj)+pfv_low(ji,jj)) * r1_e1e2t(ji,jj) * pdt WRITE(numout,*) 'pfu_hom1',(pfu_ho(ji-1,jj)+pfu_low(ji-1,jj)) * r1_e1e2t(ji,jj) * pdt WRITE(numout,*) 'pfv_hom1',(pfv_ho(ji,jj-1)+pfv_low(ji,jj-1)) * r1_e1e2t(ji,jj) * pdt WRITE(numout,*) 'pfu_low',pfu_low(ji,jj) * r1_e1e2t(ji,jj) * pdt WRITE(numout,*) 'pfv_low',pfv_low(ji,jj) * r1_e1e2t(ji,jj) * pdt WRITE(numout,*) 'pfu_lowm1',pfu_low(ji-1,jj) * r1_e1e2t(ji,jj) * pdt WRITE(numout,*) 'pfv_lowm1',pfv_low(ji,jj-1) * r1_e1e2t(ji,jj) * pdt WRITE(numout,*) 'pt',pt(ji,jj) WRITE(numout,*) 'ptim1',pt(ji-1,jj) WRITE(numout,*) 'ptjm1',pt(ji,jj-1) WRITE(numout,*) 'pt_low',pt_low(ji,jj) WRITE(numout,*) 'zbetup',zbetup(ji,jj) WRITE(numout,*) 'zbetdo',zbetdo(ji,jj) WRITE(numout,*) 'zup',zup WRITE(numout,*) 'zdo',zdo ENDIF !!            IF( ji==26 .AND. jj==86) THEN !               WRITE(numout,*) '-----------------' !               WRITE(numout,*) 'zpos',zpos,zpos2 !               WRITE(numout,*) 'zneg',zneg,zneg2 !               WRITE(numout,*) 'puc/pu',ABS(puc(ji,jj))/MAX(epsi20, ABS(pu(ji,jj))) !               WRITE(numout,*) 'pvc/pv',ABS(pvc(ji,jj))/MAX(epsi20, ABS(pv(ji,jj))) !               WRITE(numout,*) 'pucm1/pu',ABS(puc(ji-1,jj))/MAX(epsi20, ABS(pu(ji-1,jj))) !               WRITE(numout,*) 'pvcm1/pv',ABS(pvc(ji,jj-1))/MAX(epsi20, ABS(pv(ji,jj-1))) !               WRITE(numout,*) 'pfu_ho',(pfu_ho(ji,jj)+pfu_low(ji,jj)) * r1_e1e2t(ji,jj) * pdt !               WRITE(numout,*) 'pfv_ho',(pfv_ho(ji,jj)+pfv_low(ji,jj)) * r1_e1e2t(ji,jj) * pdt !               WRITE(numout,*) 'pfu_hom1',(pfu_ho(ji-1,jj)+pfu_low(ji-1,jj)) * r1_e1e2t(ji,jj) * pdt !               WRITE(numout,*) 'pfv_hom1',(pfv_ho(ji,jj-1)+pfv_low(ji,jj-1)) * r1_e1e2t(ji,jj) * pdt !               WRITE(numout,*) 'pfu_low',pfu_low(ji,jj) * r1_e1e2t(ji,jj) * pdt !               WRITE(numout,*) 'pfv_low',pfv_low(ji,jj) * r1_e1e2t(ji,jj) * pdt !               WRITE(numout,*) 'pfu_lowm1',pfu_low(ji-1,jj) * r1_e1e2t(ji,jj) * pdt !               WRITE(numout,*) 'pfv_lowm1',pfv_low(ji,jj-1) * r1_e1e2t(ji,jj) * pdt ! !               WRITE(numout,*) 'pt',pt(ji,jj) !               WRITE(numout,*) 'ptim1',pt(ji-1,jj) !               WRITE(numout,*) 'ptjm1',pt(ji,jj-1) !               WRITE(numout,*) 'pt_low',pt_low(ji,jj) !               WRITE(numout,*) 'zbetup',zbetup(ji,jj) !               WRITE(numout,*) 'zbetdo',zbetdo(ji,jj) !               WRITE(numout,*) 'zup',zup !               WRITE(numout,*) 'zdo',zdo !            ENDIF ! END DO pfu_ho(ji,jj) = pfu_ho(ji,jj) * zcoef + pfu_low(ji,jj) IF( ji==26 .AND. jj==86) THEN WRITE(numout,*) 'coefU',zcoef WRITE(numout,*) 'pfu_ho',(pfu_ho(ji,jj)) * r1_e1e2t(ji,jj) * pdt WRITE(numout,*) 'pfu_hom1',(pfu_ho(ji-1,jj)) * r1_e1e2t(ji,jj) * pdt ENDIF !!            IF( ji==26 .AND. jj==86) THEN !!               WRITE(numout,*) 'coefU',zcoef !!               WRITE(numout,*) 'pfu_ho',(pfu_ho(ji,jj)) * r1_e1e2t(ji,jj) * pdt !!               WRITE(numout,*) 'pfu_hom1',(pfu_ho(ji-1,jj)) * r1_e1e2t(ji,jj) * pdt !!            ENDIF END DO pfv_ho(ji,jj) = pfv_ho(ji,jj) * zcoef + pfv_low(ji,jj) IF( ji==26 .AND. jj==86) THEN WRITE(numout,*) 'coefV',zcoef WRITE(numout,*) 'pfv_ho',(pfv_ho(ji,jj)) * r1_e1e2t(ji,jj) * pdt WRITE(numout,*) 'pfv_hom1',(pfv_ho(ji,jj-1)) * r1_e1e2t(ji,jj) * pdt ENDIF !!            IF( ji==26 .AND. jj==86) THEN !!               WRITE(numout,*) 'coefV',zcoef !!               WRITE(numout,*) 'pfv_ho',(pfv_ho(ji,jj)) * r1_e1e2t(ji,jj) * pdt !!               WRITE(numout,*) 'pfv_hom1',(pfv_ho(ji,jj-1)) * r1_e1e2t(ji,jj) * pdt !!            ENDIF END DO END DO

 r10399 ! divergence given by the advection scheme !   (which may not be equal to divu as computed from the velocity field) IF( ln_adv_Pra ) THEN IF    ( ln_adv_Pra ) THEN zdivu_adv(ji) = ( 1._wp - ato_i_1d(ji) - SUM( a_i_2d(ji,:) ) ) * r1_rdtice ELSEIF( ln_adv_UMx ) THEN

 r9943 !!------------------------------------------------------------------- ! ! DO jl = 1, jpl       !==  loop over the categories  ==! ! !---------------------------------------- ! zap ice energy and send it to the ocean !---------------------------------------- DO jk = 1, nlay_i DO jj = 1 , jpj DO ji = 1 , jpi IF( pe_i(ji,jj,jk,jl) < 0._wp .OR. pa_i(ji,jj,jl) < 0._wp ) THEN hfx_res(ji,jj)   = hfx_res(ji,jj) - pe_i(ji,jj,jk,jl) * r1_rdtice ! W.m-2 <0 pe_i(ji,jj,jk,jl) = 0._wp ENDIF END DO END DO END DO ! DO jk = 1, nlay_s DO jj = 1 , jpj DO ji = 1 , jpi IF( pe_s(ji,jj,jk,jl) < 0._wp .OR. pa_i(ji,jj,jl) < 0._wp ) THEN hfx_res(ji,jj)   = hfx_res(ji,jj) - pe_s(ji,jj,jk,jl) * r1_rdtice ! W.m-2 <0 pe_s(ji,jj,jk,jl) = 0._wp ENDIF END DO END DO END DO ! !----------------------------------------------------- ! zap ice and snow volume, add water and salt to ocean !----------------------------------------------------- DO jj = 1 , jpj DO ji = 1 , jpi IF( pv_i(ji,jj,jl) < 0._wp .OR. pa_i(ji,jj,jl) < 0._wp ) THEN wfx_res(ji,jj)    = wfx_res(ji,jj) + pv_i (ji,jj,jl) * rhoi * r1_rdtice pv_i   (ji,jj,jl) = 0._wp ENDIF IF( pv_s(ji,jj,jl) < 0._wp .OR. pa_i(ji,jj,jl) < 0._wp ) THEN wfx_res(ji,jj)    = wfx_res(ji,jj) + pv_s (ji,jj,jl) * rhos * r1_rdtice pv_s   (ji,jj,jl) = 0._wp ENDIF IF( psv_i(ji,jj,jl) < 0._wp .OR. pa_i(ji,jj,jl) < 0._wp ) THEN sfx_res(ji,jj)    = sfx_res(ji,jj) + psv_i(ji,jj,jl) * rhoi * r1_rdtice psv_i  (ji,jj,jl) = 0._wp ENDIF END DO END DO ! END DO ! WHERE( pato_i(:,:)   < 0._wp )   pato_i(:,:)   = 0._wp WHERE( poa_i (:,:,:) < 0._wp )   poa_i (:,:,:) = 0._wp WHERE( pv_ip (:,:,:) < 0._wp )   pv_ip (:,:,:) = 0._wp ! in theory one should change wfx_pnd(-) and wfx_sum(+) !                                                        but it does not change conservation, so keep it this way is ok ! DO jl = 1, jpl       !==  loop over the categories  ==! ! !---------------------------------------- ! zap ice energy and send it to the ocean !---------------------------------------- DO jk = 1, nlay_i DO jj = 1 , jpj DO ji = 1 , jpi IF( pe_i(ji,jj,jk,jl) < 0._wp ) THEN hfx_res(ji,jj)   = hfx_res(ji,jj) - pe_i(ji,jj,jk,jl) * r1_rdtice ! W.m-2 <0 pe_i(ji,jj,jk,jl) = 0._wp ENDIF END DO END DO END DO ! DO jk = 1, nlay_s DO jj = 1 , jpj DO ji = 1 , jpi IF( pe_s(ji,jj,jk,jl) < 0._wp ) THEN hfx_res(ji,jj)   = hfx_res(ji,jj) - pe_s(ji,jj,jk,jl) * r1_rdtice ! W.m-2 <0 pe_s(ji,jj,jk,jl) = 0._wp ENDIF END DO END DO END DO ! !----------------------------------------------------- ! zap ice and snow volume, add water and salt to ocean !----------------------------------------------------- DO jj = 1 , jpj DO ji = 1 , jpi IF( pv_i(ji,jj,jl) < 0._wp ) THEN wfx_res(ji,jj)    = wfx_res(ji,jj) + pv_i (ji,jj,jl) * rhoi * r1_rdtice pv_i   (ji,jj,jl) = 0._wp ENDIF IF( pv_s(ji,jj,jl) < 0._wp ) THEN wfx_res(ji,jj)    = wfx_res(ji,jj) + pv_s (ji,jj,jl) * rhos * r1_rdtice pv_s   (ji,jj,jl) = 0._wp ENDIF IF( psv_i(ji,jj,jl) < 0._wp ) THEN sfx_res(ji,jj)    = sfx_res(ji,jj) + psv_i(ji,jj,jl) * rhoi * r1_rdtice psv_i  (ji,jj,jl) = 0._wp ENDIF END DO END DO ! END DO ! END SUBROUTINE ice_var_zapneg