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 9181 for branches/UKMO – NEMO

Changeset 9181 for branches/UKMO


Ignore:
Timestamp:
2018-01-04T15:38:10+01:00 (6 years ago)
Author:
kingr
Message:

Adding changes required for surface temperature increments to be projected through mixed layer.

Location:
branches/UKMO/AMM15_v3_6_STABLE_package/NEMOGCM/NEMO/OPA_SRC
Files:
3 edited

Legend:

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

    r9180 r9181  
    4040#endif 
    4141   USE sbc_oce          ! Surface boundary condition variables. 
     42   USE zdfmxl, ONLY :  &   
     43   &  hmld_tref,       &    
     44#if defined key_karaml 
     45   &  hmld_kara,       & 
     46   &  ln_kara,         & 
     47#endif    
     48   &  hmld,            &  
     49   &  hmlp,            & 
     50   &  hmlpt 
     51#if defined key_bdy  
     52   USE bdy_oce, ONLY: bdytmask   
     53#endif   
    4254 
    4355   IMPLICIT NONE 
     
    90102   REAL(wp), DIMENSION(:,:), ALLOCATABLE ::   seaice_bkginc         ! Increment to the background sea ice conc 
    91103 
     104   INTEGER :: mld_choice        = 4   !: choice of mld criteria to use for physics assimilation 
     105                                      !: 1) hmld      - Turbocline/mixing depth                           [W points] 
     106                                      !: 2) hmlp      - Density criterion (0.01 kg/m^3 change from 10m)   [W points] 
     107                                      !: 3) hmld_kara - Kara MLD                                          [Interpolated] 
     108                                      !: 4) hmld_tref - Temperature criterion (0.2 K change from surface) [T points] 
     109 
     110 
    92111   !! * Substitutions 
    93112#  include "domzgr_substitute.h90" 
     
    121140      INTEGER :: iitiaustr_date  ! Date YYYYMMDD of IAU interval start time step 
    122141      INTEGER :: iitiaufin_date  ! Date YYYYMMDD of IAU interval final time step 
     142      INTEGER :: isurfstat       ! Local integer for status of reading surft variable 
    123143      INTEGER :: iitavgbkg_date  ! Date YYYYMMDD of end of assim bkg averaging period 
    124144      ! 
     
    130150      REAL(wp) :: zdate_inc    ! Time axis in increments file 
    131151      ! 
     152      REAL(wp), ALLOCATABLE, DIMENSION(:,:) :: &  
     153          &       t_bkginc_2d  ! file for reading in 2D   
     154      !                        ! temperature increments  
     155      REAL(wp), ALLOCATABLE, DIMENSION(:,:) :: &  
     156          &       z_mld     ! Mixed layer depth  
     157           
    132158      REAL(wp), POINTER, DIMENSION(:,:) ::   hdiv   ! 2D workspace 
     159      ! 
     160      LOGICAL :: lk_surft      ! Logical: T => Increments file contains surft variable  
     161                               !               so only apply surft increments. 
    133162      !! 
    134163      NAMELIST/nam_asminc/ ln_bkgwri, ln_avgbkg,                           & 
     
    136165         &                 ln_asmdin, ln_asmiau,                           & 
    137166         &                 nitbkg, nitdin, nitiaustr, nitiaufin, niaufn,   & 
    138          &                 ln_salfix, salfixmin, nn_divdmp, nitavgbkg 
     167         &                 ln_salfix, salfixmin, nn_divdmp, nitavgbkg, mld_choice 
    139168      !!---------------------------------------------------------------------- 
    140169 
     
    193222         WRITE(numout,*) '      Logical switch for ensuring that the sa > salfixmin      ln_salfix = ', ln_salfix 
    194223         WRITE(numout,*) '      Minimum salinity after applying the increments           salfixmin = ', salfixmin 
     224         WRITE(numout,*) '      Choice of MLD for physics assimilation                  mld_choice = ', mld_choice 
    195225      ENDIF 
    196226 
     
    358388      !-------------------------------------------------------------------- 
    359389 
    360       ALLOCATE( t_bkginc(jpi,jpj,jpk) ) 
    361       ALLOCATE( s_bkginc(jpi,jpj,jpk) ) 
    362       ALLOCATE( u_bkginc(jpi,jpj,jpk) ) 
    363       ALLOCATE( v_bkginc(jpi,jpj,jpk) ) 
    364       ALLOCATE( ssh_bkginc(jpi,jpj)   ) 
    365       ALLOCATE( seaice_bkginc(jpi,jpj)) 
     390      IF ( ln_trainc ) THEN 
     391         ALLOCATE( t_bkginc(jpi,jpj,jpk) ) 
     392         ALLOCATE( s_bkginc(jpi,jpj,jpk) ) 
     393         t_bkginc(:,:,:) = 0.0 
     394         s_bkginc(:,:,:) = 0.0 
     395      ENDIF 
     396      IF ( ln_dyninc ) THEN  
     397         ALLOCATE( u_bkginc(jpi,jpj,jpk) ) 
     398         ALLOCATE( v_bkginc(jpi,jpj,jpk) ) 
     399         u_bkginc(:,:,:) = 0.0 
     400         v_bkginc(:,:,:) = 0.0 
     401      ENDIF 
     402      IF ( ln_sshinc ) THEN 
     403         ALLOCATE( ssh_bkginc(jpi,jpj)   ) 
     404         ssh_bkginc(:,:) = 0.0 
     405      ENDIF 
     406      IF ( ln_seaiceinc ) THEN  
     407         ALLOCATE( seaice_bkginc(jpi,jpj)) 
     408         seaice_bkginc(:,:) = 0.0 
     409      ENDIF 
    366410#if defined key_asminc 
    367411      ALLOCATE( ssh_iau(jpi,jpj)      ) 
    368 #endif 
    369       t_bkginc(:,:,:) = 0.0 
    370       s_bkginc(:,:,:) = 0.0 
    371       u_bkginc(:,:,:) = 0.0 
    372       v_bkginc(:,:,:) = 0.0 
    373       ssh_bkginc(:,:) = 0.0 
    374       seaice_bkginc(:,:) = 0.0 
    375 #if defined key_asminc 
    376412      ssh_iau(:,:)    = 0.0 
    377413#endif 
     
    409445 
    410446         IF ( ln_trainc ) THEN    
    411             CALL iom_get( inum, jpdom_autoglo, 'bckint', t_bkginc, 1 ) 
    412             CALL iom_get( inum, jpdom_autoglo, 'bckins', s_bkginc, 1 ) 
    413             ! Apply the masks 
    414             t_bkginc(:,:,:) = t_bkginc(:,:,:) * tmask(:,:,:) 
    415             s_bkginc(:,:,:) = s_bkginc(:,:,:) * tmask(:,:,:) 
    416             ! Set missing increments to 0.0 rather than 1e+20 
    417             ! to allow for differences in masks 
    418             WHERE( ABS( t_bkginc(:,:,:) ) > 1.0e+10 ) t_bkginc(:,:,:) = 0.0 
    419             WHERE( ABS( s_bkginc(:,:,:) ) > 1.0e+10 ) s_bkginc(:,:,:) = 0.0 
     447 
     448            !Test if the increments file contains the surft variable. 
     449            isurfstat = iom_varid( inum, 'bckinsurft', ldstop = .FALSE. ) 
     450            IF ( isurfstat == -1 ) THEN 
     451               lk_surft = .FALSE. 
     452            ELSE 
     453               lk_surft = .TRUE. 
     454               CALL ctl_warn( ' Applying 2D temperature increment to bottom of ML: ', & 
     455            &                 ' bckinsurft found in increments file.' ) 
     456            ENDIF              
     457 
     458            IF (lk_surft) THEN  
     459                 
     460               ALLOCATE(z_mld(jpi,jpj))  
     461               SELECT CASE(mld_choice)  
     462               CASE(1)  
     463                  z_mld = hmld  
     464               CASE(2)  
     465                  z_mld = hmlp  
     466               CASE(3)  
     467#if defined key_karaml 
     468                  IF ( ln_kara ) THEN 
     469                     z_mld = hmld_kara 
     470                  ELSE 
     471                     CALL ctl_stop("Kara mixed layer not calculated as ln_kara=.false.") 
     472                  ENDIF 
     473#else 
     474                  CALL ctl_stop("Kara mixed layer not defined in current version of NEMO")  ! JW: Safety feature, should be removed 
     475                                                                                            ! once the Kara mixed layer is available  
     476#endif 
     477               CASE(4)  
     478                  z_mld = hmld_tref  
     479               END SELECT        
     480                       
     481               ALLOCATE( t_bkginc_2d(jpi,jpj) )  
     482               CALL iom_get( inum, jpdom_autoglo, 'bckinsurft', t_bkginc_2d, 1)  
     483#if defined key_bdy                 
     484               DO jk = 1,jpkm1  
     485                  WHERE( z_mld(:,:) > fsdepw(:,:,jk) )  
     486                     t_bkginc(:,:,jk) = t_bkginc_2d(:,:) * 0.5 * & 
     487                     &       ( 1 + cos( (fsdept(:,:,jk)/z_mld(:,:) ) * rpi ) ) 
     488                      
     489                     t_bkginc(:,:,jk) = t_bkginc(:,:,jk) * bdytmask(:,:)  
     490                  ELSEWHERE  
     491                     t_bkginc(:,:,jk) = 0.  
     492                  ENDWHERE  
     493               ENDDO  
     494#else  
     495               t_bkginc(:,:,:) = 0.  
     496#endif                 
     497               s_bkginc(:,:,:) = 0.  
     498                 
     499               DEALLOCATE(z_mld, t_bkginc_2d)  
     500             
     501            ELSE  
     502                
     503               CALL iom_get( inum, jpdom_autoglo, 'bckint', t_bkginc, 1 ) 
     504               CALL iom_get( inum, jpdom_autoglo, 'bckins', s_bkginc, 1 ) 
     505               ! Apply the masks 
     506               t_bkginc(:,:,:) = t_bkginc(:,:,:) * tmask(:,:,:) 
     507               s_bkginc(:,:,:) = s_bkginc(:,:,:) * tmask(:,:,:) 
     508               ! Set missing increments to 0.0 rather than 1e+20 
     509               ! to allow for differences in masks 
     510               WHERE( ABS( t_bkginc(:,:,:) ) > 1.0e+10 ) t_bkginc(:,:,:) = 0.0 
     511               WHERE( ABS( s_bkginc(:,:,:) ) > 1.0e+10 ) s_bkginc(:,:,:) = 0.0 
     512          
     513            ENDIF 
     514 
    420515         ENDIF 
    421516 
  • branches/UKMO/AMM15_v3_6_STABLE_package/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfmxl.F90

    r8393 r9181  
    2727   PRIVATE 
    2828 
     29   PUBLIC   zdf_mxl_tref  ! called by asminc.F90 
    2930   PUBLIC   zdf_mxl       ! called by step.F90 
    3031 
     32   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   hmld_tref  !: mixed layer depth at t-points - temperature criterion [m] 
    3133   INTEGER , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   nmln    !: number of level in the mixed layer (used by TOP) 
    3234   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   hmld    !: mixing layer depth (turbocline)      [m] 
     
    7880        &          ll_found(jpi,jpj), ll_belowml(jpi,jpj,jpk), STAT= zdf_mxl_alloc ) 
    7981         ! 
     82         ALLOCATE(hmld_tref(jpi,jpj)) 
    8083         IF( lk_mpp             )   CALL mpp_sum ( zdf_mxl_alloc ) 
    8184         IF( zdf_mxl_alloc /= 0 )   CALL ctl_warn('zdf_mxl_alloc: failed to allocate arrays.') 
     
    8487   END FUNCTION zdf_mxl_alloc 
    8588 
     89 
     90   SUBROUTINE zdf_mxl_tref() 
     91      !!---------------------------------------------------------------------- 
     92      !!                  ***  ROUTINE zdf_mxl_tref  *** 
     93      !!                    
     94      !! ** Purpose :   Compute the mixed layer depth with temperature criteria. 
     95      !! 
     96      !! ** Method  :   The temperature-defined mixed layer depth is required 
     97      !!                   when assimilating SST in a 2D analysis.  
     98      !! 
     99      !! ** Action  :   hmld_tref 
     100      !!---------------------------------------------------------------------- 
     101      ! 
     102      INTEGER  ::   ji, jj, jk   ! dummy loop indices 
     103      REAL(wp) ::   t_ref               ! Reference temperature   
     104      REAL(wp) ::   temp_c = 0.2        ! temperature criterion for mixed layer depth   
     105      !!---------------------------------------------------------------------- 
     106      ! 
     107      ! Initialise array 
     108      IF( zdf_mxl_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'zdf_mxl_tref : unable to allocate arrays' ) 
     109       
     110      !For the AMM model assimiation uses a temperature based mixed layer depth   
     111      !This is defined here   
     112      DO jj = 1, jpj   
     113         DO ji = 1, jpi   
     114           hmld_tref(ji,jj)=fsdept(ji,jj,1  )    
     115           IF(ssmask(ji,jj) > 0.)THEN   
     116             t_ref=tsn(ji,jj,1,jp_tem)  
     117             DO jk=2,jpk   
     118               IF(ssmask(ji,jj)==0.)THEN   
     119                  hmld_tref(ji,jj)=fsdept(ji,jj,jk )   
     120                  EXIT   
     121               ELSEIF( ABS(tsn(ji,jj,jk,jp_tem)-t_ref) < temp_c)THEN   
     122                  hmld_tref(ji,jj)=fsdept(ji,jj,jk )   
     123               ELSE   
     124                  EXIT   
     125               ENDIF   
     126             ENDDO   
     127           ENDIF   
     128         ENDDO   
     129      ENDDO 
     130 
     131   END SUBROUTINE zdf_mxl_tref 
    86132 
    87133   SUBROUTINE zdf_mxl( kt ) 
  • branches/UKMO/AMM15_v3_6_STABLE_package/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90

    r8561 r9181  
    480480 
    481481      !                                     ! Assimilation increments 
    482       IF( lk_asminc     )   CALL asm_inc_init   ! Initialize assimilation increments 
     482      IF( lk_asminc ) THEN  
     483#if defined key_shelf  
     484         CALL  zdf_mxl_tref()     ! Initialization of hmld_tref 
     485#endif  
     486         CALL asm_inc_init     ! Initialize assimilation increments  
     487      ENDIF 
     488 
    483489      IF(lwp) WRITE(numout,*) 'Euler time step switch is ', neuler 
    484490                            CALL dia_tmb_init  ! TMB outputs 
Note: See TracChangeset for help on using the changeset viewer.