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

Ignore:
Timestamp:
2020-03-26T11:57:02+01:00 (4 years ago)
Author:
dcarneir
Message:

Inclusion of sea ice thickness in OBS branch

File:
1 edited

Legend:

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

    r9486 r12610  
    2121   !!   dyn_asm_inc    : Apply the dynamic (u and v) increments 
    2222   !!   ssh_asm_inc    : Apply the SSH increment 
    23    !!   seaice_asm_inc : Apply the seaice increment 
     23   !!   seaice_asm_inc : Apply the sea ice concentration increment 
     24   !!   sit_asm_inc    : Apply the sea ice thickness increment 
    2425   !!---------------------------------------------------------------------- 
    2526   USE wrk_nemo         ! Memory Allocation 
     
    4950   PUBLIC   dyn_asm_inc    !: Apply the dynamic (u and v) increments 
    5051   PUBLIC   ssh_asm_inc    !: Apply the SSH increment 
    51    PUBLIC   seaice_asm_inc !: Apply the seaice increment 
     52   PUBLIC   seaice_asm_inc !: Apply the seaice concentration increment 
     53   PUBLIC   sit_asm_inc    !: Apply the seaice thickness increment 
     54   PUBLIC   bgc_asm_inc    !: Apply the biogeochemistry increments 
    5255 
    5356#if defined key_asminc 
     
    5760#endif 
    5861   LOGICAL, PUBLIC :: ln_bkgwri = .FALSE.      !: No output of the background state fields 
     62   LOGICAL, PUBLIC :: ln_avgbkg = .FALSE.      !: No output of the mean background state fields 
    5963   LOGICAL, PUBLIC :: ln_asmiau = .FALSE.      !: No applying forcing with an assimilation increment 
    6064   LOGICAL, PUBLIC :: ln_asmdin = .FALSE.      !: No direct initialization 
     
    6266   LOGICAL, PUBLIC :: ln_dyninc = .FALSE.      !: No dynamics (u and v) assimilation increments 
    6367   LOGICAL, PUBLIC :: ln_sshinc = .FALSE.      !: No sea surface height assimilation increment 
    64    LOGICAL, PUBLIC :: ln_seaiceinc             !: No sea ice concentration increment 
     68   LOGICAL, PUBLIC :: ln_seaiceinc = .FALSE.   !: No sea ice concentration increment 
     69   LOGICAL, PUBLIC :: ln_sitinc = .FALSE.      !: No sea ice thickness increment 
     70   LOGICAL, PUBLIC :: lk_bgcinc = .FALSE.      !: No biogeochemistry increments 
    6571   LOGICAL, PUBLIC :: ln_salfix = .FALSE.      !: Apply minimum salinity check 
    6672   LOGICAL, PUBLIC :: ln_temnofreeze = .FALSE. !: Don't allow the temperature to drop below freezing 
     
    8591   REAL(wp), DIMENSION(:,:), ALLOCATABLE ::   ssh_bkg, ssh_bkginc   ! Background sea surface height and its increment 
    8692   REAL(wp), DIMENSION(:,:), ALLOCATABLE ::   seaice_bkginc         ! Increment to the background sea ice conc 
     93   REAL(wp), DIMENSION(:,:), ALLOCATABLE ::   sit_bkginc            ! Increment to the background sea ice thickness 
    8794 
    8895   !! * Substitutions 
     
    127134      REAL(wp), POINTER, DIMENSION(:,:) ::   hdiv   ! 2D workspace 
    128135      !! 
    129       NAMELIST/nam_asminc/ ln_bkgwri,                                      & 
     136      NAMELIST/nam_asminc/ ln_bkgwri, ln_avgbkg, ln_balwri,                & 
    130137         &                 ln_trainc, ln_dyninc, ln_sshinc,                & 
    131138         &                 ln_asmdin, ln_asmiau,                           & 
     
    138145      !----------------------------------------------------------------------- 
    139146      ln_seaiceinc = .FALSE. 
     147      ln_sitinc = .FALSE. 
    140148      ln_temnofreeze = .FALSE. 
    141149 
     
    154162         WRITE(numout,*) 'asm_inc_init : Assimilation increment initialization :' 
    155163         WRITE(numout,*) '~~~~~~~~~~~~' 
    156          WRITE(numout,*) '   Namelist namasm : set assimilation increment parameters' 
     164         WRITE(numout,*) '   Namelist nam_asminc : set assimilation increment parameters' 
    157165         WRITE(numout,*) '      Logical switch for writing out background state          ln_bkgwri = ', ln_bkgwri 
     166         WRITE(numout,*) '      Logical switch for writing mean background state         ln_avgbkg = ', ln_avgbkg 
     167         WRITE(numout,*) '      Logical switch for writing out balancing increments      ln_balwri = ', ln_balwri 
    158168         WRITE(numout,*) '      Logical switch for applying tracer increments            ln_trainc = ', ln_trainc 
    159169         WRITE(numout,*) '      Logical switch for applying velocity increments          ln_dyninc = ', ln_dyninc 
    160170         WRITE(numout,*) '      Logical switch for applying SSH increments               ln_sshinc = ', ln_sshinc 
     171         WRITE(numout,*) '      Logical switch for applying SIC increments               ln_seaiceinc = ', ln_seaiceinc 
     172         WRITE(numout,*) '      Logical switch for applying SIT increments               ln_sitinc = ', ln_sitinc 
    161173         WRITE(numout,*) '      Logical switch for Direct Initialization (DI)            ln_asmdin = ', ln_asmdin 
    162          WRITE(numout,*) '      Logical switch for applying sea ice increments        ln_seaiceinc = ', ln_seaiceinc 
    163174         WRITE(numout,*) '      Logical switch for Incremental Analysis Updating (IAU)   ln_asmiau = ', ln_asmiau 
    164175         WRITE(numout,*) '      Timestep of background in [0,nitend-nit000-1]            nitbkg    = ', nitbkg 
     
    216227 
    217228      IF (      ( ( .NOT. ln_asmdin ).AND.( .NOT. ln_asmiau ) ) & 
    218            .AND.( ( ln_trainc ).OR.( ln_dyninc ).OR.( ln_sshinc ) .OR. ( ln_seaiceinc) )) & 
    219          & CALL ctl_stop( ' One or more of ln_trainc, ln_dyninc, ln_sshinc and ln_seaiceinc is set to .true.', & 
     229         & .AND.( ( ln_trainc ).OR.( ln_dyninc ).OR.( ln_sshinc ).OR.( ln_seaiceinc ).OR. & 
     230         &        ( ln_sitinc ).OR.( lk_bgcinc ) )) & 
     231         & CALL ctl_stop( ' One or more of ln_trainc, ln_dyninc, ln_sshinc, ln_seaiceinc,', & 
     232         &                ' ln_sitinc and ln_(bgc-variable)inc is set to .true.', & 
    220233         &                ' but ln_asmdin and ln_asmiau are both set to .false. :', & 
    221234         &                ' Inconsistent options') 
     
    226239 
    227240      IF ( ( .NOT. ln_trainc ).AND.( .NOT. ln_dyninc ).AND.( .NOT. ln_sshinc ).AND.( .NOT. ln_seaiceinc ) & 
    228          &                     )  & 
    229          & CALL ctl_warn( ' ln_trainc, ln_dyninc, ln_sshinc and ln_seaiceinc are set to .false. :', & 
     241         & .AND.( .NOT. ln_sitinc ).AND.( .NOT. lk_bgcinc ) )  & 
     242         & CALL ctl_warn( ' ln_trainc, ln_dyninc, ln_sshinc, ln_seaiceinc,', & 
     243         &                ' ln_sitinc and ln_(bgc-variable)inc are set to .false. :', & 
    230244         &                ' The assimilation increments are not applied') 
    231245 
     
    325339      !-------------------------------------------------------------------- 
    326340 
    327       ALLOCATE( t_bkginc(jpi,jpj,jpk) ) 
    328       ALLOCATE( s_bkginc(jpi,jpj,jpk) ) 
    329       ALLOCATE( u_bkginc(jpi,jpj,jpk) ) 
    330       ALLOCATE( v_bkginc(jpi,jpj,jpk) ) 
    331       ALLOCATE( ssh_bkginc(jpi,jpj)   ) 
    332       ALLOCATE( seaice_bkginc(jpi,jpj)) 
     341      IF ( ln_trainc ) THEN 
     342         ALLOCATE( t_bkginc(jpi,jpj,jpk) ) 
     343         ALLOCATE( s_bkginc(jpi,jpj,jpk) ) 
     344         t_bkginc(:,:,:) = 0.0 
     345         s_bkginc(:,:,:) = 0.0 
     346      ENDIF 
     347      IF ( ln_dyninc ) THEN  
     348         ALLOCATE( u_bkginc(jpi,jpj,jpk) ) 
     349         ALLOCATE( v_bkginc(jpi,jpj,jpk) ) 
     350         u_bkginc(:,:,:) = 0.0 
     351         v_bkginc(:,:,:) = 0.0 
     352      ENDIF 
     353      IF ( ln_sshinc ) THEN 
     354         ALLOCATE( ssh_bkginc(jpi,jpj)   ) 
     355         ssh_bkginc(:,:) = 0.0 
     356      ENDIF 
     357      IF ( ln_seaiceinc ) THEN  
     358         ALLOCATE( seaice_bkginc(jpi,jpj)) 
     359         seaice_bkginc(:,:) = 0.0 
     360      ENDIF 
     361      IF ( ln_sitinc ) THEN  
     362         ALLOCATE( sit_bkginc(jpi,jpj)) 
     363         sit_bkginc(:,:) = 0.0 
     364      ENDIF 
    333365#if defined key_asminc 
    334366      ALLOCATE( ssh_iau(jpi,jpj)      ) 
    335 #endif 
    336       t_bkginc(:,:,:) = 0.0 
    337       s_bkginc(:,:,:) = 0.0 
    338       u_bkginc(:,:,:) = 0.0 
    339       v_bkginc(:,:,:) = 0.0 
    340       ssh_bkginc(:,:) = 0.0 
    341       seaice_bkginc(:,:) = 0.0 
    342 #if defined key_asminc 
    343367      ssh_iau(:,:)    = 0.0 
    344368#endif 
    345       IF ( ( ln_trainc ).OR.( ln_dyninc ).OR.( ln_sshinc ).OR.( ln_seaiceinc ) ) THEN 
     369      IF ( ( ln_trainc ).OR.( ln_dyninc ).OR.( ln_sshinc ).OR.( ln_seaiceinc ) & 
     370         &  .OR.( ln_sitinc ).OR.( lk_bgcinc ) ) THEN 
    346371 
    347372         !-------------------------------------------------------------------- 
     
    406431            ! to allow for differences in masks 
    407432            WHERE( ABS( ssh_bkginc(:,:) ) > 1.0e+10 ) ssh_bkginc(:,:) = 0.0 
     433         ENDIF 
     434 
     435         IF ( ln_sitinc ) THEN 
     436            CALL iom_get( inum, jpdom_autoglo, 'bckinsit', sit_bkginc, 1 ) 
     437            ! Apply the masks 
     438            sit_bkginc(:,:) = sit_bkginc(:,:) * tmask(:,:,1) 
     439            ! Set missing increments to 0.0 rather than 1e+20 
     440            ! to allow for differences in masks 
     441            WHERE( ABS( sit_bkginc(:,:) ) > 1.0e+10 ) sit_bkginc(:,:) = 0.0 
    408442         ENDIF 
    409443 
     
    766800      ! Perhaps the following call should be in step 
    767801      IF   ( ln_seaiceinc  )   CALL seaice_asm_inc ( kt )   ! apply sea ice concentration increment 
     802      IF   ( ln_sitinc  )      CALL sit_asm_inc ( kt )      ! apply sea ice thickness increment 
    768803      ! 
    769804   END SUBROUTINE tra_asm_inc 
     
    923958   END SUBROUTINE ssh_asm_inc 
    924959 
     960   SUBROUTINE sit_asm_inc( kt, kindic ) 
     961      !!---------------------------------------------------------------------- 
     962      !!                    ***  ROUTINE sit_asm_inc  *** 
     963      !!           
     964      !! ** Purpose : Apply the sea ice thickness assimilation increment. 
     965      !! 
     966      !! ** Method  : Direct initialization or Incremental Analysis Updating. 
     967      !! 
     968      !! ** Action  :  
     969      !! 
     970      !!---------------------------------------------------------------------- 
     971      IMPLICIT NONE 
     972      ! 
     973      INTEGER, INTENT(in)           ::   kt   ! Current time step 
     974      INTEGER, INTENT(in), OPTIONAL ::   kindic   ! flag for disabling the deallocation 
     975      ! 
     976      INTEGER  ::   it 
     977      REAL(wp) ::   zincwgt   ! IAU weight for current time step 
     978      !!---------------------------------------------------------------------- 
     979 
     980      IF ( ln_asmiau ) THEN 
     981 
     982         !-------------------------------------------------------------------- 
     983         ! Incremental Analysis Updating 
     984         !-------------------------------------------------------------------- 
     985 
     986         IF ( ( kt >= nitiaustr_r ).AND.( kt <= nitiaufin_r ) ) THEN 
     987 
     988            it = kt - nit000 + 1 
     989            zincwgt = wgtiau(it)      ! IAU weight for the current time step  
     990            ! note this is not a tendency so should not be divided by rdt (as with the tracer and other increments) 
     991            ! EF: Actually CICE is expecting a tendency so is divided by rdt below 
     992 
     993            IF(lwp) THEN 
     994               WRITE(numout,*)  
     995               WRITE(numout,*) 'sit_asm_inc : sea ice thick IAU at time step = ', & 
     996                  &  kt,' with IAU weight = ', wgtiau(it) 
     997               WRITE(numout,*) '~~~~~~~~~~~~' 
     998            ENDIF 
     999 
     1000#if defined key_cice && defined key_asminc 
     1001            ! Sea-ice thickness : CICE case. Pass ice thickness increment tendency into CICE 
     1002            ndsit_da(:,:) = sit_bkginc(:,:) * zincwgt / rdt 
     1003#endif 
     1004 
     1005            IF ( kt == nitiaufin_r ) THEN 
     1006               DEALLOCATE( sit_bkginc ) 
     1007            ENDIF 
     1008 
     1009         ELSE 
     1010 
     1011#if defined key_cice && defined key_asminc 
     1012            ! Sea-ice thickness : CICE case. Zero ice increment tendency into CICE 
     1013            ndsit_da(:,:) = 0.0_wp 
     1014#endif 
     1015 
     1016         ENDIF 
     1017 
     1018      ELSEIF ( ln_asmdin ) THEN 
     1019 
     1020         !-------------------------------------------------------------------- 
     1021         ! Direct Initialization 
     1022         !-------------------------------------------------------------------- 
     1023 
     1024         IF ( kt == nitdin_r ) THEN 
     1025 
     1026            neuler = 0                    ! Force Euler forward step 
     1027 
     1028#if defined key_cice && defined key_asminc 
     1029            ! Sea-ice thickness : CICE case. Pass ice thickness increment tendency into CICE 
     1030           ndsit_da(:,:) = sit_bkginc(:,:) / rdt 
     1031#endif 
     1032           IF ( .NOT. PRESENT(kindic) ) THEN 
     1033              DEALLOCATE( sit_bkginc ) 
     1034           END IF 
     1035 
     1036         ELSE 
     1037 
     1038#if defined key_cice && defined key_asminc 
     1039            ! Sea-ice thicnkness : CICE case. Zero ice thickness increment tendency into CICE  
     1040            ndsit_da(:,:) = 0.0_wp 
     1041#endif 
     1042          
     1043         ENDIF 
     1044 
     1045      ENDIF 
     1046 
     1047   END SUBROUTINE sit_asm_inc 
    9251048 
    9261049   SUBROUTINE seaice_asm_inc( kt, kindic ) 
     
    9281051      !!                    ***  ROUTINE seaice_asm_inc  *** 
    9291052      !!           
    930       !! ** Purpose : Apply the sea ice assimilation increment. 
     1053      !! ** Purpose : Apply the sea ice concentration assimilation increment. 
    9311054      !! 
    9321055      !! ** Method  : Direct initialization or Incremental Analysis Updating. 
Note: See TracChangeset for help on using the changeset viewer.