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 11883 – NEMO

Changeset 11883


Ignore:
Timestamp:
2019-11-11T10:26:36+01:00 (4 years ago)
Author:
timgraham
Message:

Mergerd in changes from Chris' working copy (except for symlink changes)

Location:
branches/UKMO/dev_r5518_GO6_starthour_obsoper/NEMOGCM
Files:
9 edited

Legend:

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

    r10120 r11883  
    5151   ln_clobber  = .false.   !  clobber (overwrite) an existing file 
    5252   nn_chunksz  =       0   !  chunksize (bytes) for NetCDF file (works only with iom_nf90 routines) 
     53   nn_abort    =       1   !  output the final state (1) or not (0) in case of model error 
    5354/ 
    5455! 
     
    406407   rn_antarctica_calving_fraction = 0.5 ! Set fraction of total freshwater flux for iceberg calving - remainder goes to iceshelf melting. 
    407408   rn_iceshelf_fluxes_tolerance = 1e-6  ! Fractional threshold for detecting differences in icesheet masses (must be positive definite). 
     409   ln_fix_sea_ice_fluxes = .false. ! Fix sea ice heat flux coupling issues 
    408410/ 
    409411!----------------------------------------------------------------------- 
  • branches/UKMO/dev_r5518_GO6_starthour_obsoper/NEMOGCM/NEMO/OPA_SRC/DIA/diawri.F90

    r9830 r11883  
    11231123#endif 
    11241124 
    1125       IF (cdfile_name == "output.abort") THEN 
    1126          CALL ctl_stop('MPPSTOP', 'NEMO abort from dia_wri_state') 
    1127       END IF 
    11281125        
    11291126!     IF( nn_timing == 1 )   CALL timing_stop('dia_wri_state') ! not sure this works for routines not called in first timestep 
  • branches/UKMO/dev_r5518_GO6_starthour_obsoper/NEMOGCM/NEMO/OPA_SRC/DOM/domain.F90

    r10005 r11883  
    137137      NAMELIST/namrun/ cn_ocerst_indir, cn_ocerst_outdir, nn_stocklist, ln_rst_list,               & 
    138138         &             nn_no   , cn_exp    , cn_ocerst_in, cn_ocerst_out, ln_rstart , ln_rstdate, nn_rstctl,   & 
    139          &             nn_it000, nn_itend  , nn_date0    , nn_time0,      nn_leapy     , nn_istate , nn_stock ,   & 
     139         &             nn_it000, nn_itend  , nn_date0    , nn_time0,      nn_leapy     , nn_istate , nn_abort, nn_stock ,   & 
    140140         &             nn_write, ln_dimgnnn, ln_mskland  , ln_cfmeta    , ln_clobber, nn_chunksz, nn_euler 
    141141      NAMELIST/namdom/ nn_bathy, rn_bathy , rn_e3zps_min, rn_e3zps_rat, nn_msh, rn_hmin,   & 
     
    183183         WRITE(numout,*) '      leap year calendar (0/1)        nn_leapy   = ', nn_leapy 
    184184         WRITE(numout,*) '      initial state output            nn_istate  = ', nn_istate 
     185         WRITE(numout,*) '      abort state output              nn_abort   = ', nn_abort 
    185186         IF( ln_rst_list ) THEN 
    186187            WRITE(numout,*) '      list of restart dump times      nn_stocklist   =', nn_stocklist 
  • branches/UKMO/dev_r5518_GO6_starthour_obsoper/NEMOGCM/NEMO/OPA_SRC/IOM/in_out_manager.F90

    r10005 r11883  
    4141   INTEGER       ::   nn_leapy         !: Leap year calendar flag (0/1 or 30) 
    4242   INTEGER       ::   nn_istate        !: initial state output flag (0/1) 
     43   INTEGER       ::   nn_abort         !: Output final state in case of error flag (0/1) 
    4344   INTEGER       ::   nn_write         !: model standard output frequency 
    4445   INTEGER       ::   nn_stock         !: restart file frequency 
  • branches/UKMO/dev_r5518_GO6_starthour_obsoper/NEMOGCM/NEMO/OPA_SRC/SBC/cpl_oasis3.F90

    r8280 r11883  
    151151      INTEGER :: id_part 
    152152      INTEGER :: paral(5)       ! OASIS3 box partition 
    153       INTEGER :: ishape(2,2)    ! shape of arrays passed to PSMILe 
     153      INTEGER :: ishape(4)      ! Shape of 2D arrays passed to PSMILe.  
     154                                ! Redundant from OASIS3-MCT vn4.0 onwards but required 
     155                                ! to satisfy interface and for backward compatibility. 
     156      INTEGER :: ishape0d1d(2)  ! Shape of 0D or 1D arrays passed to PSMILe. 
     157      INTEGER :: var_nodims(2)  ! Number of coupling field dimensions. 
     158                                ! var_nodims(1) is redundant from OASIS3-MCT vn4.0 onwards 
     159                                ! but retained for backward compatibility.  
     160                                ! var_nodims(2) is the number of fields in a bundle  
     161                                ! or 1 for unbundled fields (bundles are not yet catered for 
     162                                ! in NEMO hence we default to 1).   
    154163      INTEGER :: ji,jc,jm       ! local loop indicees 
    155164      CHARACTER(LEN=64) :: zclname 
     
    182191      !     nl* is set to the global values 1 and jp*glo. 
    183192      ! 
    184       ishape(:,1) = (/ 1, nlei-nldi+1 /) 
    185       ishape(:,2) = (/ 1, nlej-nldj+1 /) 
     193      ishape(1) = 1 
     194      ishape(2) = nlei-nldi+1 
     195      ishape(3) = 1 
     196      ishape(4) = nlej-nldj+1 
     197 
     198      ishape0d1d(1) = 0 
     199      ishape0d1d(2) = 0 
     200 
    186201      ! 
    187202      ! ... Allocate memory for data exchange 
     
    243258#endif 
    244259                  IF( ln_ctl ) WRITE(numout,*) "Define", ji, jc, jm, " "//TRIM(zclname), " for ", OASIS_Out 
    245                   CALL oasis_def_var (ssnd(ji)%nid(jc,jm), zclname, id_part   , (/ 2, 0 /),   & 
     260 
     261                  ! 
     262                  ! ... Set the field dimension and bundle count 
     263                  var_nodims(1) = 2 
     264                  var_nodims(2) = 1 ! Modify this value to cater for bundled fields.     
     265 
     266                  CALL oasis_def_var (ssnd(ji)%nid(jc,jm), zclname, id_part   , var_nodims,   & 
    246267                     &                OASIS_Out          , ishape , OASIS_REAL, nerror ) 
    247268                  IF ( nerror /= OASIS_Ok ) THEN 
     
    288309#endif 
    289310                  IF( ln_ctl ) WRITE(numout,*) "Define", ji, jc, jm, " "//TRIM(zclname), " for ", OASIS_In 
    290                   CALL oasis_def_var (srcv(ji)%nid(jc,jm), zclname, id_part   , (/ 2, 0 /),   & 
    291                      &                OASIS_In           , ishape , OASIS_REAL, nerror ) 
     311 
     312                  var_nodims(1) = 2 
     313                  var_nodims(2) = 1 ! Modify this value to cater for bundled fields.      
     314 
     315                  CALL oasis_def_var (srcv(ji)%nid(jc,jm), zclname, id_part   , var_nodims,   & 
     316                                      OASIS_In           , ishape , OASIS_REAL, nerror ) 
    292317                  IF ( nerror /= OASIS_Ok ) THEN 
    293318                     WRITE(numout,*) 'Failed to define transient ', ji, jc, jm, " "//TRIM(zclname) 
  • branches/UKMO/dev_r5518_GO6_starthour_obsoper/NEMOGCM/NEMO/OPA_SRC/SBC/sbc_ice.F90

    r9975 r11883  
    124124#if defined key_lim2 || defined key_cice 
    125125   ! already defined in ice.F90 for LIM3 
    126    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::  a_i 
     126   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::  a_i                ! Sea ice fraction on categories 
     127   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::  a_i_last_couple    ! Sea ice fraction on categories at the last coupling point 
    127128   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::  ht_i, ht_s 
    128129#endif 
  • branches/UKMO/dev_r5518_GO6_starthour_obsoper/NEMOGCM/NEMO/OPA_SRC/SBC/sbccpl.F90

    r9321 r11883  
    5454   USE lib_fortran, ONLY: glob_sum 
    5555 
     56#if defined key_oasis3 
     57   USE mod_oasis, ONLY : OASIS_Sent, OASIS_ToRest, OASIS_SentOut, OASIS_ToRestOut 
     58#endif 
     59 
    5660   IMPLICIT NONE 
    5761   PRIVATE 
     
    154158                                                 ! i.e. specifically nmol/L (= umol/m3) 
    155159 
     160#if ! defined key_oasis3 
     161   ! Dummy variables to enable compilation when oasis3 is not being used 
     162   INTEGER                    ::   OASIS_Sent        = -1 
     163   INTEGER                    ::   OASIS_SentOut     = -1 
     164   INTEGER                    ::   OASIS_ToRest      = -1 
     165   INTEGER                    ::   OASIS_ToRestOut   = -1 
     166#endif 
     167 
    156168   !                                                         !!** namelist namsbc_cpl ** 
    157169   TYPE ::   FLD_C 
     
    175187   LOGICAL     ::   ln_usecplmask          !  use a coupling mask file to merge data received from several models 
    176188                                           !   -> file cplmask.nc with the float variable called cplmask (jpi,jpj,nn_cplmodel) 
     189   LOGICAL, PUBLIC ::   ln_fix_sea_ice_fluxes     ! Apply sea ice flux bug fixes (GMED#449) 
     190 
    177191   TYPE ::   DYNARR      
    178192      REAL(wp), POINTER, DIMENSION(:,:,:)    ::   z3    
     
    200214      !!             ***  FUNCTION sbc_cpl_alloc  *** 
    201215      !!---------------------------------------------------------------------- 
    202       INTEGER :: ierr(3) 
     216      INTEGER :: ierr(4) 
    203217      !!---------------------------------------------------------------------- 
    204218      ierr(:) = 0 
     
    212226      ! Hardwire only two models as nn_cplmodel has not been read in 
    213227      ! from the namelist yet. 
    214       ALLOCATE( xcplmask(jpi,jpj,0:2) , STAT=ierr(3) )    
     228      ALLOCATE( xcplmask(jpi,jpj,0:2) , STAT=ierr(3) )  
     229#if defined key_cice 
     230      ALLOCATE( a_i_last_couple(jpi,jpj,jpl) , STAT=ierr(4) )  
     231#endif 
    215232      ! 
    216233      sbc_cpl_alloc = MAXVAL( ierr ) 
     
    247264         &                  ln_usecplmask, nn_coupled_iceshelf_fluxes, ln_iceshelf_init_atmos,        & 
    248265         &                  rn_greenland_total_fw_flux, rn_greenland_calving_fraction, & 
    249          &                  rn_antarctica_total_fw_flux, rn_antarctica_calving_fraction, rn_iceshelf_fluxes_tolerance 
     266         &                  rn_antarctica_total_fw_flux, rn_antarctica_calving_fraction, rn_iceshelf_fluxes_tolerance, & 
     267         &                  ln_fix_sea_ice_fluxes 
    250268      !!--------------------------------------------------------------------- 
    251269 
     
    317335         WRITE(numout,*)'  nn_cplmodel                         = ', nn_cplmodel 
    318336         WRITE(numout,*)'  ln_usecplmask                       = ', ln_usecplmask 
     337         WRITE(numout,*)'  ln_fix_sea_ice_fluxes               = ', ln_fix_sea_ice_fluxes 
    319338         WRITE(numout,*)'  nn_coupled_iceshelf_fluxes          = ', nn_coupled_iceshelf_fluxes 
    320339         WRITE(numout,*)'  ln_iceshelf_init_atmos              = ', ln_iceshelf_init_atmos 
     
    17581777         IF ( TRIM(sn_rcv_emp%clcat) == 'yes' ) THEN 
    17591778            ! zemp_ice is the sum of frcv(jpr_ievp)%z3(:,:,1) over all layers - snow 
    1760             zemp_ice(:,:) = - frcv(jpr_snow)%z3(:,:,1) 
     1779            IF ( ln_fix_sea_ice_fluxes ) THEN 
     1780               zemp_ice(:,:) = - frcv(jpr_snow)%z3(:,:,1) * zicefr(:,:) 
     1781            ELSE 
     1782               zemp_ice(:,:) = - frcv(jpr_snow)%z3(:,:,1) 
     1783            ENDIF 
    17611784            DO jl=1,jpl 
    1762                zemp_ice(:,:   ) = zemp_ice(:,:) + frcv(jpr_ievp)%z3(:,:,jl) 
     1785               IF ( ln_fix_sea_ice_fluxes ) THEN 
     1786                  zemp_ice(:,:   ) = zemp_ice(:,:) + frcv(jpr_ievp)%z3(:,:,jl) * a_i_last_couple(:,:,jl) 
     1787               ELSE 
     1788                  zemp_ice(:,:   ) = zemp_ice(:,:) + frcv(jpr_ievp)%z3(:,:,jl) 
     1789               ENDIF 
    17631790            ENDDO 
    17641791            ! latent heat coupled for each category in CICE 
     
    22692296         END SELECT 
    22702297         IF( ssnd(jps_fice)%laction )   CALL cpl_snd( jps_fice, isec, ztmp3, info ) 
     2298 
     2299#if defined key_lim2 || defined key_cice 
     2300         ! If this coupling was successful then save ice fraction for use between coupling points. 
     2301         ! This is needed for some calculations where the ice fraction at the last coupling point 
     2302         ! is needed. 
     2303         IF( info == OASIS_Sent     .OR. info == OASIS_ToRest .OR.   & 
     2304                     & info == OASIS_SentOut  .OR. info == OASIS_ToRestOut ) THEN 
     2305           IF ( sn_snd_thick%clcat == 'yes' ) THEN 
     2306             a_i_last_couple(:,:,:) = a_i(:,:,:) 
     2307           ENDIF 
     2308         ENDIF 
     2309#endif 
     2310          
    22712311      ENDIF 
    22722312       
  • branches/UKMO/dev_r5518_GO6_starthour_obsoper/NEMOGCM/NEMO/OPA_SRC/SBC/sbcice_cice.F90

    r9975 r11883  
    395395         ELSE IF (ksbc == jp_purecpl) THEN 
    396396            DO jl=1,ncat 
    397                ztmpn(:,:,jl)=qla_ice(:,:,jl)*a_i(:,:,jl) 
     397               IF ( ln_fix_sea_ice_fluxes ) THEN 
     398                  ztmpn(:,:,jl)=qla_ice(:,:,jl)*a_i_last_couple(:,:,jl) 
     399               ELSE 
     400                  ztmpn(:,:,jl)=qla_ice(:,:,jl)*a_i(:,:,jl) 
     401               ENDIF 
    398402            ENDDO 
    399403    ELSE 
     
    408412!  Convert to GBM 
    409413            IF (ksbc == jp_flx .OR. ksbc == jp_purecpl) THEN 
    410                ztmp(:,:) = botmelt(:,:,jl)*a_i(:,:,jl) 
     414               IF ( ln_fix_sea_ice_fluxes ) THEN 
     415                  ztmp(:,:) = botmelt(:,:,jl)*a_i_last_couple(:,:,jl) 
     416               ELSE 
     417                  ztmp(:,:) = botmelt(:,:,jl)*a_i(:,:,jl) 
     418               ENDIF 
    411419            ELSE 
    412420               ztmp(:,:) = botmelt(:,:,jl) 
     
    417425!  Convert to GBM 
    418426            IF (ksbc == jp_flx .OR. ksbc == jp_purecpl) THEN 
    419                ztmp(:,:) = (topmelt(:,:,jl)+botmelt(:,:,jl))*a_i(:,:,jl)  
     427               IF ( ln_fix_sea_ice_fluxes ) THEN 
     428                  ztmp(:,:) = (topmelt(:,:,jl)+botmelt(:,:,jl))*a_i_last_couple(:,:,jl)  
     429               ELSE 
     430                  ztmp(:,:) = (topmelt(:,:,jl)+botmelt(:,:,jl))*a_i(:,:,jl) 
     431               ENDIF 
    420432            ELSE 
    421433               ztmp(:,:) = (topmelt(:,:,jl)+botmelt(:,:,jl)) 
  • branches/UKMO/dev_r5518_GO6_starthour_obsoper/NEMOGCM/NEMO/OPA_SRC/step.F90

    r8400 r11883  
    374374      IF( indic < 0        )   THEN 
    375375                               CALL ctl_stop( 'step: indic < 0' ) 
    376                                CALL dia_wri_state( 'output.abort', kstp ) 
     376                               IF( nn_abort > 0 ) CALL dia_wri_state( 'output.abort', kstp ) 
     377                               CALL ctl_stop('MPPSTOP', 'NEMO abort from stp') 
    377378      ENDIF 
    378379      IF( kstp == nit000   )   THEN 
Note: See TracChangeset for help on using the changeset viewer.