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 6020 for branches/UKMO/icebergs_restart_single_file/NEMOGCM/NEMO/OPA_SRC/ASM/asminc.F90 – NEMO

Ignore:
Timestamp:
2015-12-08T12:39:53+01:00 (8 years ago)
Author:
timgraham
Message:

Merged with head of trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/UKMO/icebergs_restart_single_file/NEMOGCM/NEMO/OPA_SRC/ASM/asminc.F90

    r6019 r6020  
    1414 
    1515   !!---------------------------------------------------------------------- 
    16    !!   'key_asminc'   : Switch on the assimilation increment interface 
    17    !!---------------------------------------------------------------------- 
    1816   !!   asm_inc_init   : Initialize the increment arrays and IAU weights 
    1917   !!   calc_date      : Compute the calendar date YYYYMMDD on a given step 
     
    2826   USE domvvl           ! domain: variable volume level 
    2927   USE oce              ! Dynamics and active tracers defined in memory 
    30    USE ldfdyn_oce       ! ocean dynamics: lateral physics 
     28   USE ldfdyn           ! lateral diffusion: eddy viscosity coefficients 
    3129   USE eosbn2           ! Equation of state - in situ and potential density 
    3230   USE zpshde           ! Partial step : Horizontal Derivative 
     
    5654    LOGICAL, PUBLIC, PARAMETER :: lk_asminc = .FALSE.  !: No assimilation increments 
    5755#endif 
    58    LOGICAL, PUBLIC :: ln_bkgwri = .FALSE.      !: No output of the background state fields 
    59    LOGICAL, PUBLIC :: ln_asmiau = .FALSE.      !: No applying forcing with an assimilation increment 
    60    LOGICAL, PUBLIC :: ln_asmdin = .FALSE.      !: No direct initialization 
    61    LOGICAL, PUBLIC :: ln_trainc = .FALSE.      !: No tracer (T and S) assimilation increments 
    62    LOGICAL, PUBLIC :: ln_dyninc = .FALSE.      !: No dynamics (u and v) assimilation increments 
    63    LOGICAL, PUBLIC :: ln_sshinc = .FALSE.      !: No sea surface height assimilation increment 
    64    LOGICAL, PUBLIC :: ln_seaiceinc             !: No sea ice concentration increment 
    65    LOGICAL, PUBLIC :: ln_salfix = .FALSE.      !: Apply minimum salinity check 
     56   LOGICAL, PUBLIC :: ln_bkgwri     !: No output of the background state fields 
     57   LOGICAL, PUBLIC :: ln_asmiau     !: No applying forcing with an assimilation increment 
     58   LOGICAL, PUBLIC :: ln_asmdin     !: No direct initialization 
     59   LOGICAL, PUBLIC :: ln_trainc     !: No tracer (T and S) assimilation increments 
     60   LOGICAL, PUBLIC :: ln_dyninc     !: No dynamics (u and v) assimilation increments 
     61   LOGICAL, PUBLIC :: ln_sshinc     !: No sea surface height assimilation increment 
     62   LOGICAL, PUBLIC :: ln_seaiceinc  !: No sea ice concentration increment 
     63   LOGICAL, PUBLIC :: ln_salfix     !: Apply minimum salinity check 
    6664   LOGICAL, PUBLIC :: ln_temnofreeze = .FALSE. !: Don't allow the temperature to drop below freezing 
    67    INTEGER, PUBLIC :: nn_divdmp                !: Apply divergence damping filter nn_divdmp times 
     65   INTEGER, PUBLIC :: nn_divdmp     !: Apply divergence damping filter nn_divdmp times 
    6866 
    6967   REAL(wp), PUBLIC, DIMENSION(:,:,:), ALLOCATABLE ::   t_bkg   , s_bkg      !: Background temperature and salinity 
     
    9088   !! * Substitutions 
    9189#  include "domzgr_substitute.h90" 
    92 #  include "ldfdyn_substitute.h90" 
    9390#  include "vectopt_loop_substitute.h90" 
    9491   !!---------------------------------------------------------------------- 
     
    139136      ! Read Namelist nam_asminc : assimilation increment interface 
    140137      !----------------------------------------------------------------------- 
    141       ln_seaiceinc = .FALSE. 
     138      ln_seaiceinc   = .FALSE. 
    142139      ln_temnofreeze = .FALSE. 
    143140 
     
    428425 
    429426      IF ( ln_dyninc .AND. nn_divdmp > 0 ) THEN 
    430  
    431          CALL wrk_alloc(jpi,jpj,hdiv)  
    432  
    433          DO  jt = 1, nn_divdmp 
    434  
     427         ! 
     428         CALL wrk_alloc( jpi,jpj,   hdiv )  
     429         ! 
     430         DO jt = 1, nn_divdmp 
     431            ! 
    435432            DO jk = 1, jpkm1 
    436  
    437433               hdiv(:,:) = 0._wp 
    438  
    439434               DO jj = 2, jpjm1 
    440435                  DO ji = fs_2, fs_jpim1   ! vector opt. 
     
    444439                         + e1v(ji  ,jj  ) * fse3v(ji  ,jj  ,jk) * v_bkginc(ji  ,jj  ,jk)     & 
    445440                         - e1v(ji  ,jj-1) * fse3v(ji  ,jj-1,jk) * v_bkginc(ji  ,jj-1,jk)  )  & 
    446                          / ( e1t(ji,jj) * e2t(ji,jj) * fse3t(ji,jj,jk) ) 
     441                         / ( e1e2t(ji,jj) * fse3t(ji,jj,jk) ) 
    447442                  END DO 
    448443               END DO 
    449  
    450444               CALL lbc_lnk( hdiv, 'T', 1. )   ! lateral boundary cond. (no sign change) 
    451  
     445               ! 
    452446               DO jj = 2, jpjm1 
    453447                  DO ji = fs_2, fs_jpim1   ! vector opt. 
    454                      u_bkginc(ji,jj,jk) = u_bkginc(ji,jj,jk) + 0.2_wp * ( e1t(ji+1,jj)*e2t(ji+1,jj) * hdiv(ji+1,jj)   & 
    455                                                                         - e1t(ji  ,jj)*e2t(ji  ,jj) * hdiv(ji  ,jj) ) & 
    456                                                                       / e1u(ji,jj) * umask(ji,jj,jk)  
    457                      v_bkginc(ji,jj,jk) = v_bkginc(ji,jj,jk) + 0.2_wp * ( e1t(ji,jj+1)*e2t(ji,jj+1) * hdiv(ji,jj+1)   & 
    458                                                                         - e1t(ji,jj  )*e2t(ji,jj  ) * hdiv(ji,jj  ) ) & 
    459                                                                       / e2v(ji,jj) * vmask(ji,jj,jk)  
     448                     u_bkginc(ji,jj,jk) = u_bkginc(ji,jj,jk) + 0.2_wp * ( e1e2t(ji+1,jj) * hdiv(ji+1,jj)   & 
     449                        &                                               - e1e2t(ji  ,jj) * hdiv(ji  ,jj) ) & 
     450                        &                                             * r1_e1u(ji,jj) * umask(ji,jj,jk)  
     451                     v_bkginc(ji,jj,jk) = v_bkginc(ji,jj,jk) + 0.2_wp * ( e1e2t(ji,jj+1) * hdiv(ji,jj+1)   & 
     452                        &                                               - e1e2t(ji,jj  ) * hdiv(ji,jj  ) ) & 
     453                        &                                             * r1_e2v(ji,jj) * vmask(ji,jj,jk)  
    460454                  END DO 
    461455               END DO 
    462  
    463456            END DO 
    464  
     457            ! 
    465458         END DO 
    466  
    467          CALL wrk_dealloc(jpi,jpj,hdiv)  
    468  
     459         ! 
     460         CALL wrk_dealloc( jpi,jpj,   hdiv )  
     461         ! 
    469462      ENDIF 
    470  
    471  
    472463 
    473464      !----------------------------------------------------------------------- 
     
    476467 
    477468      IF ( ln_asmdin ) THEN 
    478  
     469         ! 
    479470         ALLOCATE( t_bkg(jpi,jpj,jpk) ) 
    480471         ALLOCATE( s_bkg(jpi,jpj,jpk) ) 
     
    482473         ALLOCATE( v_bkg(jpi,jpj,jpk) ) 
    483474         ALLOCATE( ssh_bkg(jpi,jpj)   ) 
    484  
    485          t_bkg(:,:,:) = 0.0 
    486          s_bkg(:,:,:) = 0.0 
    487          u_bkg(:,:,:) = 0.0 
    488          v_bkg(:,:,:) = 0.0 
    489          ssh_bkg(:,:) = 0.0 
    490  
     475         ! 
     476         t_bkg(:,:,:) = 0._wp 
     477         s_bkg(:,:,:) = 0._wp 
     478         u_bkg(:,:,:) = 0._wp 
     479         v_bkg(:,:,:) = 0._wp 
     480         ssh_bkg(:,:) = 0._wp 
     481         ! 
    491482         !-------------------------------------------------------------------- 
    492483         ! Read from file the background state at analysis time 
    493484         !-------------------------------------------------------------------- 
    494  
     485         ! 
    495486         CALL iom_open( c_asmdin, inum ) 
    496  
     487         ! 
    497488         CALL iom_get( inum, 'rdastp', zdate_bkg )  
    498          
     489         ! 
    499490         IF(lwp) THEN 
    500491            WRITE(numout,*)  
    501             WRITE(numout,*) 'asm_inc_init : Assimilation background state valid at : ', & 
    502                &  NINT( zdate_bkg ) 
     492            WRITE(numout,*) 'asm_inc_init : Assimilation background state valid at : ', NINT( zdate_bkg ) 
    503493            WRITE(numout,*) '~~~~~~~~~~~~' 
    504494         ENDIF 
    505  
     495         ! 
    506496         IF ( NINT( zdate_bkg ) /= iitdin_date ) & 
    507497            & CALL ctl_warn( ' Validity time of assimilation background state does', & 
    508498            &                ' not agree with Direct Initialization time' ) 
    509  
     499         ! 
    510500         IF ( ln_trainc ) THEN    
    511501            CALL iom_get( inum, jpdom_autoglo, 'tn', t_bkg ) 
     
    514504            s_bkg(:,:,:) = s_bkg(:,:,:) * tmask(:,:,:) 
    515505         ENDIF 
    516  
     506         ! 
    517507         IF ( ln_dyninc ) THEN    
    518508            CALL iom_get( inum, jpdom_autoglo, 'un', u_bkg ) 
     
    521511            v_bkg(:,:,:) = v_bkg(:,:,:) * vmask(:,:,:) 
    522512         ENDIF 
    523          
     513         ! 
    524514         IF ( ln_sshinc ) THEN 
    525515            CALL iom_get( inum, jpdom_autoglo, 'sshn', ssh_bkg ) 
    526516            ssh_bkg(:,:) = ssh_bkg(:,:) * tmask(:,:,1) 
    527517         ENDIF 
    528  
     518         ! 
    529519         CALL iom_close( inum ) 
    530  
     520         ! 
    531521      ENDIF 
    532522      ! 
     
    574564      ! If kt = kit000 - 1 then set the date to the restart date 
    575565      IF ( kt == kit000 - 1 ) THEN 
    576  
    577566         kdate = ndastp 
    578567         RETURN 
    579  
    580568      ENDIF 
    581569 
     
    646634      !! ** Action  :  
    647635      !!---------------------------------------------------------------------- 
    648       INTEGER, INTENT(IN) :: kt               ! Current time step 
    649       ! 
    650       INTEGER :: ji,jj,jk 
    651       INTEGER :: it 
     636      INTEGER, INTENT(IN) ::   kt   ! Current time step 
     637      ! 
     638      INTEGER  :: ji, jj, jk 
     639      INTEGER  :: it 
    652640      REAL(wp) :: zincwgt  ! IAU weight for current time step 
    653641      REAL (wp), DIMENSION(jpi,jpj,jpk) :: fzptnz ! 3d freezing point values 
    654642      !!---------------------------------------------------------------------- 
    655  
     643      ! 
    656644      ! freezing point calculation taken from oc_fz_pt (but calculated for all depths)  
    657645      ! used to prevent the applied increments taking the temperature below the local freezing point  
    658  
    659646      DO jk = 1, jpkm1 
    660          fzptnz(:,:,jk) = eos_fzp( tsn(:,:,jk,jp_sal), fsdept(:,:,jk) ) 
     647        CALL eos_fzp( tsn(:,:,jk,jp_sal), fzptnz(:,:,jk), fsdept(:,:,jk) ) 
    661648      END DO 
    662  
    663       IF ( ln_asmiau ) THEN 
    664  
    665          !-------------------------------------------------------------------- 
    666          ! Incremental Analysis Updating 
    667          !-------------------------------------------------------------------- 
    668  
     649         ! 
     650         !                             !-------------------------------------- 
     651      IF ( ln_asmiau ) THEN            ! Incremental Analysis Updating 
     652         !                             !-------------------------------------- 
     653         ! 
    669654         IF ( ( kt >= nitiaustr_r ).AND.( kt <= nitiaufin_r ) ) THEN 
    670  
     655            ! 
    671656            it = kt - nit000 + 1 
    672657            zincwgt = wgtiau(it) / rdt   ! IAU weight for the current time step 
    673  
     658            ! 
    674659            IF(lwp) THEN 
    675660               WRITE(numout,*)  
     
    677662               WRITE(numout,*) '~~~~~~~~~~~~' 
    678663            ENDIF 
    679  
     664            ! 
    680665            ! Update the tracer tendencies 
    681666            DO jk = 1, jpkm1 
     
    700685               ENDIF 
    701686            END DO 
    702  
    703          ENDIF 
    704  
     687            ! 
     688         ENDIF 
     689         ! 
    705690         IF ( kt == nitiaufin_r + 1  ) THEN   ! For bias crcn to work 
    706691            DEALLOCATE( t_bkginc ) 
    707692            DEALLOCATE( s_bkginc ) 
    708693         ENDIF 
    709  
    710  
    711       ELSEIF ( ln_asmdin ) THEN 
    712  
    713          !-------------------------------------------------------------------- 
    714          ! Direct Initialization 
    715          !-------------------------------------------------------------------- 
    716              
     694         !                             !-------------------------------------- 
     695      ELSEIF ( ln_asmdin ) THEN        ! Direct Initialization 
     696         !                             !-------------------------------------- 
     697         !             
    717698         IF ( kt == nitdin_r ) THEN 
    718  
     699            ! 
    719700            neuler = 0  ! Force Euler forward step 
    720  
     701            ! 
    721702            ! Initialize the now fields with the background + increment 
    722703            IF (ln_temnofreeze) THEN 
     
    745726!!gm 
    746727 
    747  
    748             IF( ln_zps .AND. .NOT. lk_c1d .AND. .NOT. ln_isfcav)      & 
    749                &  CALL zps_hde    ( kt, jpts, tsb, gtsu, gtsv,        &  ! Partial steps: before horizontal gradient 
    750                &                              rhd, gru , grv          )  ! of t, s, rd at the last ocean level 
    751             IF( ln_zps .AND. .NOT. lk_c1d .AND.       ln_isfcav)      & 
    752                &  CALL zps_hde_isf( nit000, jpts, tsb, gtsu, gtsv,    &    ! Partial steps for top cell (ISF) 
    753                &                                  rhd, gru , grv , aru , arv , gzu , gzv , ge3ru , ge3rv ,   & 
    754                &                           gtui, gtvi, grui, grvi, arui, arvi, gzui, gzvi, ge3rui, ge3rvi    ) ! of t, s, rd at the last ocean level 
    755  
    756 #if defined key_zdfkpp 
    757             CALL eos( tsn, rhd, fsdept_n(:,:,:) )                      ! Compute rhd 
    758 !!gm fabien            CALL eos( tsn, rhd )                      ! Compute rhd 
    759 #endif 
    760  
     728            IF( ln_zps .AND. .NOT. lk_c1d ) THEN      ! Partial steps: before horizontal gradient 
     729               IF(ln_isfcav) THEN                        ! ocean cavities: top and bottom cells (ISF) 
     730                  CALL zps_hde_isf( nit000, jpts, tsb, gtsu, gtsv, gtui, gtvi,     & 
     731                     &                            rhd, gru , grv , aru , arv , gzu , gzv , ge3ru , ge3rv ,   & 
     732                     &                     grui, grvi, arui, arvi, gzui, gzvi, ge3rui, ge3rvi    ) 
     733               ELSE                                      ! no ocean cavities: bottom cells 
     734                  CALL zps_hde    ( kt, jpts, tsb, gtsu, gtsv,        &  !  
     735                     &                        rhd, gru , grv          )  ! of t, s, rd at the last ocean level 
     736               ENDIF 
     737            ENDIF 
     738            ! 
    761739            DEALLOCATE( t_bkginc ) 
    762740            DEALLOCATE( s_bkginc ) 
     
    767745      ENDIF 
    768746      ! Perhaps the following call should be in step 
    769       IF   ( ln_seaiceinc  )   CALL seaice_asm_inc ( kt )   ! apply sea ice concentration increment 
     747      IF ( ln_seaiceinc  )   CALL seaice_asm_inc ( kt )   ! apply sea ice concentration increment 
    770748      ! 
    771749   END SUBROUTINE tra_asm_inc 
     
    788766      REAL(wp) :: zincwgt  ! IAU weight for current time step 
    789767      !!---------------------------------------------------------------------- 
    790  
    791       IF ( ln_asmiau ) THEN 
    792  
    793          !-------------------------------------------------------------------- 
    794          ! Incremental Analysis Updating 
    795          !-------------------------------------------------------------------- 
    796  
     768      ! 
     769      !                          !-------------------------------------------- 
     770      IF ( ln_asmiau ) THEN      ! Incremental Analysis Updating 
     771         !                       !-------------------------------------------- 
     772         ! 
    797773         IF ( ( kt >= nitiaustr_r ).AND.( kt <= nitiaufin_r ) ) THEN 
    798  
     774            ! 
    799775            it = kt - nit000 + 1 
    800776            zincwgt = wgtiau(it) / rdt   ! IAU weight for the current time step 
    801  
     777            ! 
    802778            IF(lwp) THEN 
    803779               WRITE(numout,*)  
    804                WRITE(numout,*) 'dyn_asm_inc : Dynamics IAU at time step = ', & 
    805                   &  kt,' with IAU weight = ', wgtiau(it) 
     780               WRITE(numout,*) 'dyn_asm_inc : Dynamics IAU at time step = ', kt,' with IAU weight = ', wgtiau(it) 
    806781               WRITE(numout,*) '~~~~~~~~~~~~' 
    807782            ENDIF 
    808  
     783            ! 
    809784            ! Update the dynamic tendencies 
    810785            DO jk = 1, jpkm1 
     
    812787               va(:,:,jk) = va(:,:,jk) + v_bkginc(:,:,jk) * zincwgt 
    813788            END DO 
    814             
     789            ! 
    815790            IF ( kt == nitiaufin_r ) THEN 
    816791               DEALLOCATE( u_bkginc ) 
    817792               DEALLOCATE( v_bkginc ) 
    818793            ENDIF 
    819  
    820          ENDIF 
    821  
    822       ELSEIF ( ln_asmdin ) THEN  
    823  
    824          !-------------------------------------------------------------------- 
    825          ! Direct Initialization 
    826          !-------------------------------------------------------------------- 
    827           
     794            ! 
     795         ENDIF 
     796         !                          !----------------------------------------- 
     797      ELSEIF ( ln_asmdin ) THEN     ! Direct Initialization 
     798         !                          !----------------------------------------- 
     799         !          
    828800         IF ( kt == nitdin_r ) THEN 
    829  
     801            ! 
    830802            neuler = 0                    ! Force Euler forward step 
    831  
     803            ! 
    832804            ! Initialize the now fields with the background + increment 
    833805            un(:,:,:) = u_bkg(:,:,:) + u_bkginc(:,:,:) 
    834806            vn(:,:,:) = v_bkg(:,:,:) + v_bkginc(:,:,:)   
    835  
     807            ! 
    836808            ub(:,:,:) = un(:,:,:)         ! Update before fields 
    837809            vb(:,:,:) = vn(:,:,:) 
    838   
     810            ! 
    839811            DEALLOCATE( u_bkg    ) 
    840812            DEALLOCATE( v_bkg    ) 
     
    864836      REAL(wp) :: zincwgt  ! IAU weight for current time step 
    865837      !!---------------------------------------------------------------------- 
    866  
    867       IF ( ln_asmiau ) THEN 
    868  
    869          !-------------------------------------------------------------------- 
    870          ! Incremental Analysis Updating 
    871          !-------------------------------------------------------------------- 
    872  
     838      ! 
     839      !                             !----------------------------------------- 
     840      IF ( ln_asmiau ) THEN         ! Incremental Analysis Updating 
     841         !                          !----------------------------------------- 
     842         ! 
    873843         IF ( ( kt >= nitiaustr_r ).AND.( kt <= nitiaufin_r ) ) THEN 
    874  
     844            ! 
    875845            it = kt - nit000 + 1 
    876846            zincwgt = wgtiau(it) / rdt   ! IAU weight for the current time step 
    877  
     847            ! 
    878848            IF(lwp) THEN 
    879849               WRITE(numout,*)  
     
    882852               WRITE(numout,*) '~~~~~~~~~~~~' 
    883853            ENDIF 
    884  
     854            ! 
    885855            ! Save the tendency associated with the IAU weighted SSH increment 
    886856            ! (applied in dynspg.*) 
     
    891861               DEALLOCATE( ssh_bkginc ) 
    892862            ENDIF 
    893  
    894          ENDIF 
    895  
    896       ELSEIF ( ln_asmdin ) THEN 
    897  
    898          !-------------------------------------------------------------------- 
    899          ! Direct Initialization 
    900          !-------------------------------------------------------------------- 
    901  
     863            ! 
     864         ENDIF 
     865         !                          !----------------------------------------- 
     866      ELSEIF ( ln_asmdin ) THEN     ! Direct Initialization 
     867         !                          !----------------------------------------- 
     868         ! 
    902869         IF ( kt == nitdin_r ) THEN 
    903  
    904             neuler = 0                    ! Force Euler forward step 
    905  
    906             ! Initialize the now fields the background + increment 
    907             sshn(:,:) = ssh_bkg(:,:) + ssh_bkginc(:,:)   
    908  
    909             ! Update before fields 
    910             sshb(:,:) = sshn(:,:)          
    911  
     870            ! 
     871            neuler = 0                                   ! Force Euler forward step 
     872            ! 
     873            sshn(:,:) = ssh_bkg(:,:) + ssh_bkginc(:,:)   ! Initialize the now fields the background + increment 
     874            ! 
     875            sshb(:,:) = sshn(:,:)                        ! Update before fields 
     876            ! 
    912877            IF( lk_vvl ) THEN 
    913878               DO jk = 1, jpk 
     
    915880               END DO 
    916881            ENDIF 
    917  
     882            ! 
    918883            DEALLOCATE( ssh_bkg    ) 
    919884            DEALLOCATE( ssh_bkginc ) 
    920  
     885            ! 
    921886         ENDIF 
    922887         ! 
     
    937902      !! 
    938903      !!---------------------------------------------------------------------- 
    939       IMPLICIT NONE 
    940       ! 
    941       INTEGER, INTENT(in)           ::   kt   ! Current time step 
     904      INTEGER, INTENT(in)           ::   kt       ! Current time step 
    942905      INTEGER, INTENT(in), OPTIONAL ::   kindic   ! flag for disabling the deallocation 
    943906      ! 
     
    949912#endif 
    950913      !!---------------------------------------------------------------------- 
    951  
    952       IF ( ln_asmiau ) THEN 
    953  
    954          !-------------------------------------------------------------------- 
    955          ! Incremental Analysis Updating 
    956          !-------------------------------------------------------------------- 
    957  
     914      ! 
     915      !                             !----------------------------------------- 
     916      IF ( ln_asmiau ) THEN         ! Incremental Analysis Updating 
     917         !                          !----------------------------------------- 
     918         ! 
    958919         IF ( ( kt >= nitiaustr_r ).AND.( kt <= nitiaufin_r ) ) THEN 
    959  
     920            ! 
    960921            it = kt - nit000 + 1 
    961922            zincwgt = wgtiau(it)      ! IAU weight for the current time step  
    962923            ! note this is not a tendency so should not be divided by rdt (as with the tracer and other increments) 
    963  
     924            ! 
    964925            IF(lwp) THEN 
    965926               WRITE(numout,*)  
    966                WRITE(numout,*) 'seaice_asm_inc : sea ice conc IAU at time step = ', & 
    967                   &  kt,' with IAU weight = ', wgtiau(it) 
     927               WRITE(numout,*) 'seaice_asm_inc : sea ice conc IAU at time step = ', kt,' with IAU weight = ', wgtiau(it) 
    968928               WRITE(numout,*) '~~~~~~~~~~~~' 
    969929            ENDIF 
    970  
     930            ! 
    971931            ! Sea-ice : LIM-3 case (to add) 
    972  
     932            ! 
    973933#if defined key_lim2 
    974934            ! Sea-ice : LIM-2 case 
     
    1008968 
    1009969#if defined key_cice && defined key_asminc 
    1010             ! Sea-ice : CICE case. Zero ice increment tendency into CICE 
    1011             ndaice_da(:,:) = 0.0_wp 
    1012 #endif 
    1013  
    1014          ENDIF 
    1015  
    1016       ELSEIF ( ln_asmdin ) THEN 
    1017  
    1018          !-------------------------------------------------------------------- 
    1019          ! Direct Initialization 
    1020          !-------------------------------------------------------------------- 
    1021  
     970            ndaice_da(:,:) = 0._wp        ! Sea-ice : CICE case. Zero ice increment tendency into CICE 
     971#endif 
     972 
     973         ENDIF 
     974         !                          !----------------------------------------- 
     975      ELSEIF ( ln_asmdin ) THEN     ! Direct Initialization 
     976         !                          !----------------------------------------- 
     977         ! 
    1022978         IF ( kt == nitdin_r ) THEN 
    1023  
     979            ! 
    1024980            neuler = 0                    ! Force Euler forward step 
    1025  
     981            ! 
    1026982            ! Sea-ice : LIM-3 case (to add) 
    1027  
     983            ! 
    1028984#if defined key_lim2 
    1029985            ! Sea-ice : LIM-2 case. 
     
    1041997               zhicifinc(:,:) = (zhicifmin - hicif(:,:)) * zincwgt     
    1042998            ELSEWHERE 
    1043                zhicifinc(:,:) = 0.0_wp 
     999               zhicifinc(:,:) = 0._wp 
    10441000            END WHERE 
    10451001            ! 
     
    10501006            ! seaice salinity balancing (to add) 
    10511007#endif 
    1052   
     1008            ! 
    10531009#if defined key_cice && defined key_asminc 
    10541010            ! Sea-ice : CICE case. Pass ice increment tendency into CICE 
    10551011           ndaice_da(:,:) = seaice_bkginc(:,:) / rdt 
    10561012#endif 
    1057            IF ( .NOT. PRESENT(kindic) ) THEN 
    1058               DEALLOCATE( seaice_bkginc ) 
    1059            END IF 
    1060  
     1013            IF ( .NOT. PRESENT(kindic) ) THEN 
     1014               DEALLOCATE( seaice_bkginc ) 
     1015            END IF 
     1016            ! 
    10611017         ELSE 
    1062  
     1018            ! 
    10631019#if defined key_cice && defined key_asminc 
    1064             ! Sea-ice : CICE case. Zero ice increment tendency into CICE  
    1065             ndaice_da(:,:) = 0.0_wp 
    1066 #endif 
    1067           
     1020            ndaice_da(:,:) = 0._wp     ! Sea-ice : CICE case. Zero ice increment tendency into CICE 
     1021 
     1022#endif 
     1023            ! 
    10681024         ENDIF 
    10691025 
     
    11421098! 
    11431099!#endif 
    1144  
     1100         ! 
    11451101      ENDIF 
    1146  
     1102      ! 
    11471103   END SUBROUTINE seaice_asm_inc 
    11481104    
Note: See TracChangeset for help on using the changeset viewer.