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

Changeset 8400 for branches/UKMO


Ignore:
Timestamp:
2017-08-01T16:12:29+02:00 (7 years ago)
Author:
timgraham
Message:

GMED ticket 335:

  • Merge dev_r5518_GO6_package_inc_asm into package branch to make everything easier for data assimilation
  • No effect on configs without data assimilation
Location:
branches/UKMO/dev_r5518_GO6_package/NEMOGCM
Files:
12 edited
3 copied

Legend:

Unmodified
Added
Removed
  • branches/UKMO/dev_r5518_GO6_package/NEMOGCM/CONFIG/SHARED/namelist_ref

    r8280 r8400  
    12851285    ln_asmdin = .false.    !  Logical switch for Direct Initialization (DI) 
    12861286    ln_asmiau = .false.    !  Logical switch for Incremental Analysis Updating (IAU) 
     1287    ln_seaiceinc = .false. !  Logical switch for applying sea ice increments 
     1288    ln_temnofreeze = .false. !  Logical to not add increments if temperature would fall below freezing 
    12871289    nitbkg    = 0          !  Timestep of background in [0,nitend-nit000-1] 
    12881290    nitdin    = 0          !  Timestep of background for DI in [0,nitend-nit000-1] 
     
    13211323   rn_htrmax         =  200.0   ! max. depth of transition range 
    13221324/ 
     1325!----------------------------------------------------------------------- 
     1326&nambias   ! Bias pressure correctiom 
     1327!----------------------------------------------------------------------- 
     1328   ln_bias        = .false. 
     1329   ln_bias_asm    = .false. 
     1330   ln_bias_rlx    = .false. 
     1331   ln_bias_ofl    = .false. 
     1332   ln_bias_ts_app = .false. 
     1333   ln_bias_pc_app = .false.         
     1334   fb_t_asm       = 0.0 
     1335   fb_t_rlx       = 0.0 
     1336   fb_t_ofl       = 1.0 
     1337   fb_p_asm       = 1.0 
     1338   fb_p_rlx       = 1.0 
     1339   fb_p_ofl       = 0.0 
     1340   eft_rlx        = 365.0 
     1341   eft_asm        = 365.0 
     1342   t_rlx_upd      = 0.1 
     1343   t_asm_upd      = 0.1 
     1344   nn_lat_ramp    = 0           
     1345   bias_time_unit_asm = 86400.0 
     1346   bias_time_unit_rlx = 1.0 
     1347   bias_time_unit_ofl = 1.0  
     1348   cn_bias_tot    = "bias_tot.nc"  
     1349   cn_bias_asm    = "bias_asm.nc" 
     1350   cn_dir         = './'   
     1351   ln_bsyncro     = .FALSE.  
     1352   fctamp         = 1. 
     1353   rn_maxlat_bias = 23.0       
     1354   rn_minlat_bias = 10.0 
     1355   nn_bias_itwrt  = 15 
     1356   ln_itdecay     = .FALSE. 
     1357/ 
  • branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/OPA_SRC/ASM/asmbkg.F90

    r6486 r8400  
    119119            CALL iom_rstput( kt, nitbkg_r, inum, 'en'     , en                ) 
    120120#endif 
    121             CALL iom_rstput( kt, nitbkg_r, inum, 'gcx'    , gcx               ) 
     121!            CALL iom_rstput( kt, nitbkg_r, inum, 'gcx'    , gcx               ) 
     122            CALL iom_rstput( kt, nitbkg_r, inum, 'avt'    , avt               ) 
    122123            ! 
    123124            CALL iom_close( inum ) 
     
    153154            CALL iom_rstput( kt, nitdin_r, inum, 'tn'     , tsn(:,:,:,jp_tem) ) 
    154155            CALL iom_rstput( kt, nitdin_r, inum, 'sn'     , tsn(:,:,:,jp_sal) ) 
     156            CALL iom_rstput( kt, nitdin_r, inum, 'avt'    , avt     ) 
    155157            CALL iom_rstput( kt, nitdin_r, inum, 'sshn'   , sshn              ) 
    156158#if defined key_lim2 || defined key_lim3 
  • branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/OPA_SRC/ASM/asminc.F90

    r7962 r8400  
    3939   USE ice_2            ! LIM2 
    4040#endif 
     41#if defined key_cice && defined key_asminc 
     42   USE sbc_ice, ONLY : & ! CICE Ice model variables 
     43   & ndaice_da, nfresh_da, nfsalt_da 
     44#endif 
    4145   USE sbc_oce          ! Surface boundary condition variables. 
    4246 
     
    133137         &                 ln_asmdin, ln_asmiau,                           & 
    134138         &                 nitbkg, nitdin, nitiaustr, nitiaufin, niaufn,   & 
    135          &                 ln_salfix, salfixmin, nn_divdmp 
     139         &                 ln_salfix, salfixmin, nn_divdmp,                & 
     140         &                 ln_seaiceinc, ln_temnofreeze 
    136141      !!---------------------------------------------------------------------- 
    137142 
     
    892897            ENDIF 
    893898 
     899         ELSE 
     900#if defined key_asminc 
     901            ssh_iau(:,:) = 0.0 
     902#endif 
    894903         ENDIF 
    895904 
  • branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/OPA_SRC/DIA/diawri.F90

    r8280 r8400  
    4747   USE iom 
    4848   USE ioipsl 
    49    USE dynspg_oce, ONLY: un_adv, vn_adv ! barotropic velocities      
    50  
     49   USE dynspg_oce, ONLY: un_adv, vn_adv ! barotropic velocities     
     50   USE insitu_tem, ONLY: insitu_t, theta2t 
    5151#if defined key_lim2 
    5252   USE limwri_2  
     
    164164       
    165165      CALL iom_put( "toce", tsn(:,:,:,jp_tem) )    ! 3D temperature 
     166      CALL theta2t ! in-situ temperature conversion 
     167      CALL iom_put( "tinsitu", insitu_t(:,:,:))    ! in-situ temperature 
    166168      CALL iom_put(  "sst", tsn(:,:,1,jp_tem) )    ! surface temperature 
    167169      IF ( iom_use("sbt") ) THEN 
     
    202204         CALL iom_put( "taubot", z2d )            
    203205      ENDIF 
    204           
     206       
    205207      CALL iom_put( "uoce", un(:,:,:)         )    ! 3D i-current 
    206208      CALL iom_put(  "ssu", un(:,:,1)         )    ! surface i-current 
  • branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/OPA_SRC/DYN/dynhpg.F90

    r6486 r8400  
    4444   USE wrk_nemo        ! Memory Allocation 
    4545   USE timing          ! Timing 
     46   USE biaspar         ! bias correction variables 
    4647 
    4748   IMPLICIT NONE 
     
    8485      INTEGER, INTENT(in) ::   kt   ! ocean time-step index 
    8586      REAL(wp), POINTER, DIMENSION(:,:,:) ::  ztrdu, ztrdv 
     87      REAL(wp), ALLOCATABLE, DIMENSION(:,:,:)   ::   z_rhd_st  ! tmp density storage for pressure corr 
     88      REAL(wp), ALLOCATABLE, DIMENSION(:,:)     ::   z_gru_st  ! tmp ua trends storage for pressure corr 
     89      REAL(wp), ALLOCATABLE, DIMENSION(:,:)     ::   z_grv_st  ! tmp va trends storage for pressure corr 
    8690      !!---------------------------------------------------------------------- 
    8791      ! 
     
    9296         ztrdu(:,:,:) = ua(:,:,:) 
    9397         ztrdv(:,:,:) = va(:,:,:) 
     98      ENDIF 
     99      ! 
     100      IF ( ln_bias .AND. ln_bias_pc_app ) THEN 
     101 
     102         !Allocate space for tempory variables 
     103         ALLOCATE( z_rhd_st(jpi,jpj,jpk), & 
     104            &      z_gru_st(jpi,jpj),     & 
     105            &      z_grv_st(jpi,jpj)      ) 
     106 
     107         z_rhd_st(:,:,:) = rhd(:,:,:)     ! store orig density  
     108         rhd(:,:,:)      = rhd_pc(:,:,:)  ! use pressure corrected density 
     109         z_gru_st(:,:)   = gru(:,:) 
     110         gru(:,:)        = gru_pc(:,:) 
     111         z_grv_st(:,:)   = grv(:,:) 
     112         grv(:,:)        = grv_pc(:,:) 
     113 
    94114      ENDIF 
    95115      ! 
     
    112132      IF(ln_ctl)   CALL prt_ctl( tab3d_1=ua, clinfo1=' hpg  - Ua: ', mask1=umask,   & 
    113133         &                       tab3d_2=va, clinfo2=       ' Va: ', mask2=vmask, clinfo3='dyn' ) 
     134      ! 
     135      IF ( ln_bias .AND. ln_bias_pc_app )  THEN 
     136         rhd(:,:,:) = z_rhd_st(:,:,:)     ! restore original density 
     137         gru(:,:)   = z_gru_st(:,:) 
     138         grv(:,:)   = z_grv_st(:,:) 
     139 
     140         !Deallocate tempory variables 
     141         DEALLOCATE( z_rhd_st,     & 
     142            &        z_gru_st,     & 
     143            &        z_grv_st      ) 
     144      ENDIF 
    114145      ! 
    115146      IF( nn_timing == 1 )  CALL timing_stop('dyn_hpg') 
  • branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/OPA_SRC/DYN/sshwzv.F90

    r6487 r8400  
    7474      INTEGER, INTENT(in) ::   kt                      ! time step 
    7575      !  
    76       INTEGER             ::   jk                      ! dummy loop indice 
     76      INTEGER             ::   jk                      ! dummy loop indices 
    7777      REAL(wp)            ::   z2dt, z1_rau0           ! local scalars 
    7878      !!---------------------------------------------------------------------- 
     
    9494      z2dt = 2._wp * rdt                              ! set time step size (Euler/Leapfrog) 
    9595      IF( neuler == 0 .AND. kt == nit000 )   z2dt = rdt 
     96 
     97 
     98#if defined key_asminc 
     99      !                                                ! Include the IAU weighted SSH increment 
     100      IF( lk_asminc .AND. ln_sshinc .AND. ln_asmiau ) THEN 
     101         CALL ssh_asm_inc( kt ) 
     102#if defined key_vvl 
     103! Don't directly adjust ssh but change hdivn at all levels instead 
     104! In trasbc also add in the heat and salt content associated with these changes at each level   
     105        DO jk = 1, jpkm1                                  
     106                 hdivn(:,:,jk) = hdivn(:,:,jk) - ( ssh_iau(:,:) / ( ht_0(:,:) + 1.0 - ssmask(:,:) ) ) * ( e3t_0(:,:,jk) / fse3t_n(:,:,jk) ) * tmask(:,:,jk)  
     107        END DO 
     108      ENDIF 
     109#endif 
     110#endif 
     111 
    96112 
    97113      !                                           !------------------------------! 
     
    123139#endif 
    124140 
    125 #if defined key_asminc 
    126       !                                                ! Include the IAU weighted SSH increment 
    127       IF( lk_asminc .AND. ln_sshinc .AND. ln_asmiau ) THEN 
    128          CALL ssh_asm_inc( kt ) 
    129          ssha(:,:) = ssha(:,:) + z2dt * ssh_iau(:,:) 
    130       ENDIF 
    131 #endif 
    132141 
    133142      !                                           !------------------------------! 
  • branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/OPA_SRC/SBC/sbc_ice.F90

    r6498 r8400  
    110110   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   u_ice, v_ice          ! jpi, jpj 
    111111   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::  a_p, ht_p ! Meltpond fraction and depth 
     112    
     113   ! 
     114    
     115   ! 
     116#if defined key_asminc 
     117   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   ndaice_da          !: NEMO fresh water flux to ocean due to data assim 
     118   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   nfresh_da          !: NEMO salt flux to ocean due to data assim 
     119   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   nfsalt_da          !: NEMO ice concentration change/second from data assim 
     120#endif 
     121       
    112122#endif 
    113123    
     
    162172                ss_iov(jpi,jpj)       , fr_iu(jpi,jpj)        , fr_iv(jpi,jpj)        , & 
    163173                a_i(jpi,jpj,ncat)     , topmelt(jpi,jpj,ncat) , botmelt(jpi,jpj,ncat) , & 
     174#if defined key_asminc 
     175                ndaice_da(jpi,jpj)    , nfresh_da(jpi,jpj)    , nfsalt_da(jpi,jpj)    , & 
     176#endif 
    164177                sstfrz(jpi,jpj)       , STAT= ierr(1) ) 
    165178   ! Alex West: Allocating tn_ice with 5 categories.  When NEMO is used with CICE, this variable 
  • branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/OPA_SRC/SBC/sbcice_cice.F90

    r8280 r8400  
    5656                fresh_ai,fhocn_ai,fswthru_ai,frzmlt,             & 
    5757                flatn_f,fsurfn_f,fcondtopn_f,                    & 
     58#ifdef key_asminc 
     59                daice_da,fresh_da,fsalt_da,                    & 
     60#endif 
    5861                uatm,vatm,wind,fsw,flw,Tair,potT,Qa,rhoa,zlvl,   & 
    5962                swvdr,swvdf,swidr,swidf,Tf,                      & 
     
    301304  
    302305      CALL wrk_dealloc( jpi,jpj, ztmp1, ztmp2 ) 
     306 
     307#if defined key_asminc 
     308      ! Initialize fresh water and salt fluxes from data assim    
     309      !  and data assimilation index to cice  
     310      nfresh_da(:,:) = 0.0    
     311      nfsalt_da(:,:) = 0.0    
     312      ndaice_da(:,:) = 0.0          
     313#endif 
    303314      ! 
    304315      ! In coupled mode get extra fields from CICE for passing back to atmosphere 
     
    454465      ENDIF 
    455466 
     467#if defined key_asminc 
     468!Ice concentration change (from assimilation) 
     469      ztmp(:,:)=ndaice_da(:,:)*tmask(:,:,1) 
     470      Call nemo2cice(ztmp,daice_da,'T', 1. ) 
     471#endif  
     472 
    456473! Snowfall 
    457474! Ensure fsnow is positive (as in CICE routine prepare_forcing) 
     
    716733         snwice_fmass (:,:) = ( snwice_mass(:,:) - snwice_mass_b(:,:) ) / dt 
    717734      ENDIF 
     735 
     736#if defined key_asminc 
     737! Import fresh water and salt flux due to seaice da 
     738      CALL cice2nemo(fresh_da, nfresh_da,'T',1.0) 
     739      CALL cice2nemo(fsalt_da, nfsalt_da,'T',1.0) 
     740#endif 
    718741 
    719742! Release work space 
  • branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/OPA_SRC/TRA/trasbc.F90

    r7993 r8400  
    3333   USE timing          ! Timing 
    3434   USE eosbn2 
     35#if defined key_asminc    
     36   USE asminc          ! Assimilation increment 
     37#endif 
    3538 
    3639   IMPLICIT NONE 
     
    120123      REAL(wp) ::   zfact, z1_e3t, zdep 
    121124      REAL(wp) ::   zalpha, zhk 
     125      REAL(wp) ::  zt_frz, zpress 
    122126      REAL(wp), POINTER, DIMENSION(:,:,:) ::  ztrdt, ztrds 
    123127      !!---------------------------------------------------------------------- 
     
    283287      IF( iom_use('rnf_x_sss') )   CALL iom_put( "rnf_x_sss", rnf*tsn(:,:,1,jp_sal) )   ! runoff term on sss 
    284288 
     289#if defined key_asminc 
     290! WARNING: THIS MAY WELL NOT BE REQUIRED - WE DON'T WANT TO CHANGE T&S BUT THIS MAY COMPENSATE ANOTHER TERM... 
     291! Rate of change in e3t for each level is ssh_iau*e3t_0/ht_0 
     292! Contribution to tsa should be rate of change in level / per m of ocean? (hence the division by fse3t_n) 
     293      IF( ln_sshinc ) THEN         ! input of heat and salt due to assimilation 
     294         DO jj = 2, jpj  
     295            DO ji = fs_2, fs_jpim1 
     296               zdep = ssh_iau(ji,jj) / ( ht_0(ji,jj) + 1.0 - ssmask(ji, jj) ) 
     297               DO jk = 1, jpkm1 
     298                  tsa(ji,jj,jk,jp_tem) = tsa(ji,jj,jk,jp_tem)   & 
     299                                        &            + tsn(ji,jj,jk,jp_tem) * zdep * ( e3t_0(ji,jj,jk) / fse3t_n(ji,jj,jk) ) 
     300                  tsa(ji,jj,jk,jp_sal) = tsa(ji,jj,jk,jp_sal)   & 
     301                                        &            + tsn(ji,jj,jk,jp_sal) * zdep * ( e3t_0(ji,jj,jk) / fse3t_n(ji,jj,jk) ) 
     302               END DO 
     303            END DO   
     304         END DO   
     305      ENDIF 
     306#endif 
     307  
    285308      IF( l_trdtra )   THEN                      ! send trends for further diagnostics 
    286309         ztrdt(:,:,:) = tsa(:,:,:,jp_tem) - ztrdt(:,:,:) 
  • branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90

    r8280 r8400  
    227227#endif 
    228228      ! 
     229      ! Met Office addition: if failed, return non-zero exit code 
     230      IF( nstop /= 0 )  CALL exit( 9 )  
     231      ! 
    229232   END SUBROUTINE nemo_gcm 
    230233 
     
    480483                            CALL dia_hsb_init   ! heat content, salt content and volume budgets 
    481484                            CALL     trd_init   ! Mixed-layer/Vorticity/Integral constraints trends 
     485                            CALL     bias_init  ! Pressure correction bias 
    482486      IF( lk_diaobs     ) THEN                  ! Observation & model comparison 
    483487                            CALL dia_obs_init            ! Initialize observational data 
     
    646650      !!---------------------------------------------------------------------- 
    647651      USE diawri    , ONLY: dia_wri_alloc 
     652      USE insitu_tem, ONLY: insitu_tem_alloc 
    648653      USE dom_oce   , ONLY: dom_oce_alloc 
    649654      USE ldfdyn_oce, ONLY: ldfdyn_oce_alloc 
     
    662667      ierr =        oce_alloc       ()          ! ocean 
    663668      ierr = ierr + dia_wri_alloc   () 
     669      ierr = ierr + insitu_tem_alloc() 
    664670      ierr = ierr + dom_oce_alloc   ()          ! ocean domain 
    665671      ierr = ierr + ldfdyn_oce_alloc()          ! ocean lateral  physics : dynamics 
  • branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/OPA_SRC/step.F90

    r8280 r8400  
    103103      IF( ln_crs     )       CALL iom_setkt( kstp - nit000 + 1, TRIM(cxios_context)//"_crs" )   ! tell iom we are at time step kstp 
    104104 
     105      IF( ln_bias )          CALL bias_opn( kstp ) 
     106 
    105107      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    106108      ! Update data, open boundaries, surface boundary condition (including sea-ice) 
     
    267269      IF( lk_trabbl      )   CALL tra_bbl    ( kstp )       ! advective (and/or diffusive) bottom boundary layer scheme 
    268270      IF( ln_tradmp      )   CALL tra_dmp    ( kstp )       ! internal damping trends 
     271      IF( ln_bias        )   CALL tra_bias   ( kstp ) 
    269272      IF( lk_bdy         )   CALL bdy_tra_dmp( kstp )       ! bdy damping trends 
    270273                             CALL tra_adv    ( kstp )       ! horizontal & vertical advection 
     
    290293               &                                           rhd, gru , grv , aru , arv , gzu , gzv , ge3ru , ge3rv ,   & 
    291294               &                                    gtui, gtvi, grui, grvi, arui, arvi, gzui, gzvi, ge3rui, ge3rvi    ) ! of t, s, rd at the last ocean level 
     295            IF( ln_bias )    CALL dyn_bias( kstp ) 
    292296      ELSE                                                  ! centered hpg  (eos then time stepping) 
    293297         IF ( .NOT. lk_dynspg_ts ) THEN                     ! eos already called in time-split case 
     
    303307         IF( ln_zdfnpc   )   CALL tra_npc( kstp )                ! update after fields by non-penetrative convection 
    304308                             CALL tra_nxt( kstp )                ! tracer fields at next time step 
     309         IF( ln_bias )       CALL dyn_bias( kstp ) 
    305310      ENDIF 
    306311 
     
    377382      ENDIF 
    378383 
     384 
     385      IF( lrst_bias )          CALL bias_wrt     ( kstp ) 
     386 
    379387      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    380388      ! Coupled mode 
  • branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/OPA_SRC/step_oce.F90

    r6491 r8400  
    100100 
    101101   USE crsfld           ! Standard output on coarse grid   (crs_fld routine) 
    102  
     102   USE biaspar          ! bias param 
     103   USE bias             ! bias routines                    (tra_bias routine 
     104                        !                                   dyn_bias routine) 
    103105   USE asminc           ! assimilation increments      (tra_asm_inc routine) 
    104106   !                                                   (dyn_asm_inc routine) 
Note: See TracChangeset for help on using the changeset viewer.