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 14037 for NEMO/branches/2020/dev_r13333_KERNEL-08_techene_gm_HPG_SPG/src/ICE/icerst.F90 – NEMO

Ignore:
Timestamp:
2020-12-03T12:20:38+01:00 (3 years ago)
Author:
ayoung
Message:

Updated to trunk at 14020. Sette tests passed with change of results for configurations with non-linear ssh. Ticket #2506.

Location:
NEMO/branches/2020/dev_r13333_KERNEL-08_techene_gm_HPG_SPG
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2020/dev_r13333_KERNEL-08_techene_gm_HPG_SPG

    • Property svn:externals
      •  

        old new  
        88 
        99# SETTE 
        10 ^/utils/CI/sette@13292        sette 
         10^/utils/CI/sette_wave@13990         sette 
  • NEMO/branches/2020/dev_r13333_KERNEL-08_techene_gm_HPG_SPG/src/ICE/icerst.F90

    r13286 r14037  
    1818   USE phycst  , ONLY : rt0 
    1919   USE sbc_oce , ONLY : nn_fsbc, ln_cpl 
     20   USE sbc_oce , ONLY : nn_components, jp_iam_sas   ! SAS ss[st]_m init 
     21   USE sbc_oce , ONLY : sst_m, sss_m                ! SAS ss[st]_m init 
     22   USE oce     , ONLY : ts                          ! SAS ss[st]_m init 
     23   USE eosbn2  , ONLY : l_useCT, eos_pt_from_ct     ! SAS ss[st]_m init 
    2024   USE iceistate      ! sea-ice: initial state 
    2125   USE icectl         ! sea-ice: control 
     
    5155      CHARACTER(len=50)   ::   clname   ! ice output restart file name 
    5256      CHARACTER(len=256)  ::   clpath   ! full path to ice output restart file  
     57      CHARACTER(LEN=52)   ::   clpname   ! ocean output restart file name including prefix for AGRIF 
    5358      !!---------------------------------------------------------------------- 
    5459      ! 
     
    8085            ENDIF 
    8186            ! 
    82             CALL iom_open( TRIM(clpath)//TRIM(clname), numriw, ldwrt = .TRUE., kdlev = jpl, cdcomp = 'ICE' ) 
     87            IF(.NOT.lwxios) THEN 
     88               CALL iom_open( TRIM(clpath)//TRIM(clname), numriw, ldwrt = .TRUE., kdlev = jpl, cdcomp = 'ICE' ) 
     89            ELSE 
     90#if defined key_iomput 
     91               cw_icerst_cxt = "rstwi_"//TRIM(ADJUSTL(clkt)) 
     92               IF( TRIM(Agrif_CFixed()) == '0' ) THEN 
     93                  clpname = clname 
     94               ELSE 
     95                  clpname = TRIM(Agrif_CFixed())//"_"//clname 
     96               ENDIF 
     97               numriw = iom_xios_setid(TRIM(clpath)//TRIM(clpname)) 
     98               CALL iom_init( cw_icerst_cxt, kdid = numriw, ld_closedef = .FALSE. ) 
     99               CALL iom_swap( cxios_context ) 
     100#else 
     101               clinfo = 'Can not use XIOS in rst_opn' 
     102               CALL ctl_stop(TRIM(clinfo)) 
     103#endif 
     104            ENDIF 
    83105            lrst_ice = .TRUE. 
    84106         ENDIF 
     
    113135         IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~~~'          
    114136      ENDIF 
    115  
     137       
    116138      ! Write in numriw (if iter == nitrst) 
    117139      ! ------------------  
     
    119141      CALL iom_rstput( iter, nitrst, numriw, 'nn_fsbc', REAL( nn_fsbc, wp ) )      ! time-step  
    120142      CALL iom_rstput( iter, nitrst, numriw, 'kt_ice' , REAL( iter   , wp ) )      ! date 
    121       CALL iom_delay_rst( 'WRITE', 'ICE', numriw )   ! save only ice delayed global communication variables 
     143       
     144      IF(.NOT.lwxios) CALL iom_delay_rst( 'WRITE', 'ICE', numriw )   ! save only ice delayed global communication variables 
    122145 
    123146      ! Prognostic variables 
     
    132155      CALL iom_rstput( iter, nitrst, numriw, 'a_ip' , a_ip  ) 
    133156      CALL iom_rstput( iter, nitrst, numriw, 'v_ip' , v_ip  ) 
     157      CALL iom_rstput( iter, nitrst, numriw, 'v_il' , v_il  ) 
    134158      ! Snow enthalpy 
    135159      DO jk = 1, nlay_s  
     
    149173      IF( ln_cpl ) THEN 
    150174         CALL iom_rstput( iter, nitrst, numriw, 'cnd_ice', cnd_ice ) 
    151          CALL iom_rstput( iter, nitrst, numriw, 't1_ice' , t1_ice  ) 
     175         CALL iom_rstput( iter, nitrst, numriw, 't1_ice' , t1_ice ) 
    152176      ENDIF 
    153177      ! 
     
    156180      ! ------------------ 
    157181      IF( iter == nitrst ) THEN 
    158          CALL iom_close( numriw ) 
     182         IF(.NOT.lwxios) THEN 
     183            CALL iom_close( numriw ) 
     184         ELSE 
     185            CALL iom_context_finalize(      cw_icerst_cxt          ) 
     186            iom_file(numriw)%nfid       = 0 
     187            numriw = 0 
     188         ENDIF 
    159189         lrst_ice = .FALSE. 
    160190      ENDIF 
     
    172202      INTEGER           ::   jk 
    173203      LOGICAL           ::   llok 
    174       INTEGER           ::   id0, id1, id2, id3, id4   ! local integer 
     204      INTEGER           ::   id0, id1, id2, id3, id4, id5   ! local integer 
    175205      CHARACTER(len=25) ::   znam 
    176206      CHARACTER(len=2)  ::   zchar, zchar1 
    177207      REAL(wp)          ::   zfice, ziter 
     208      CHARACTER(lc)     ::   clpname 
    178209      REAL(wp), DIMENSION(jpi,jpj,jpl) ::   z3d   ! 3D workspace 
    179210      !!---------------------------------------------------------------------- 
     
    185216      ENDIF 
    186217 
     218      lxios_sini = .FALSE. 
    187219      CALL iom_open ( TRIM(cn_icerst_indir)//'/'//cn_icerst_in, numrir ) 
     220 
     221      IF( lrxios) THEN 
     222          cr_icerst_cxt = 'si3_rst' 
     223          IF(lwp) WRITE(numout,*) 'Enable restart reading by XIOS for SI3' 
     224!         IF( TRIM(Agrif_CFixed()) == '0' ) THEN 
     225!            clpname = cn_icerst_in 
     226!         ELSE 
     227!            clpname = TRIM(Agrif_CFixed())//"_"//cn_icerst_in    
     228!         ENDIF 
     229          CALL iom_init( cr_icerst_cxt, kdid = numrir, ld_closedef = .TRUE. ) 
     230      ENDIF 
    188231 
    189232      ! test if v_i exists  
     
    193236      IF( id0 > 0 ) THEN   ! == case of a normal restart == ! 
    194237         !                 ! ------------------------------ ! 
    195           
    196238         ! Time info 
    197239         CALL iom_get( numrir, 'nn_fsbc', zfice ) 
     
    251293            v_ip(:,:,:) = 0._wp 
    252294         ENDIF 
     295         ! melt pond lids 
     296         id3 = iom_varid( numrir, 'v_il' , ldstop = .FALSE. ) 
     297         IF( id3 > 0 ) THEN 
     298            CALL iom_get( numrir, jpdom_auto, 'v_il', v_il) 
     299         ELSE 
     300            IF(lwp) WRITE(numout,*) '   ==>>   previous run without melt ponds lids output then set it to zero' 
     301            v_il(:,:,:) = 0._wp 
     302         ENDIF 
    253303         ! fields needed for Met Office (Jules) coupling 
    254304         IF( ln_cpl ) THEN 
    255             id3 = iom_varid( numrir, 'cnd_ice' , ldstop = .FALSE. ) 
    256             id4 = iom_varid( numrir, 't1_ice'  , ldstop = .FALSE. ) 
    257             IF( id3 > 0 .AND. id4 > 0 ) THEN         ! fields exist 
     305            id4 = iom_varid( numrir, 'cnd_ice' , ldstop = .FALSE. ) 
     306            id5 = iom_varid( numrir, 't1_ice'  , ldstop = .FALSE. ) 
     307            IF( id4 > 0 .AND. id5 > 0 ) THEN         ! fields exist 
    258308               CALL iom_get( numrir, jpdom_auto, 'cnd_ice', cnd_ice ) 
    259309               CALL iom_get( numrir, jpdom_auto, 't1_ice' , t1_ice  ) 
     
    265315         ENDIF 
    266316 
    267          CALL iom_delay_rst( 'READ', 'ICE', numrir )   ! read only ice delayed global communication variables 
    268  
     317         IF(.NOT.lrxios) CALL iom_delay_rst( 'READ', 'ICE', numrir )   ! read only ice delayed global communication variables 
    269318         !                 ! ---------------------------------- ! 
    270319      ELSE                 ! == case of a simplified restart == ! 
    271320         !                 ! ---------------------------------- ! 
    272          CALL ctl_warn('ice_rst_read: you are using a simplified ice restart') 
     321         CALL ctl_warn('ice_rst_read: you are attempting to use an unsuitable ice restart') 
    273322         ! 
    274          CALL ice_istate_init 
     323         IF( .NOT. ln_iceini .OR. nn_iceini_file == 2 ) THEN 
     324            CALL ctl_stop('STOP', 'ice_rst_read: you need ln_ice_ini=T and nn_iceini_file=0 or 1') 
     325         ELSE 
     326            CALL ctl_warn('ice_rst_read: using ice_istate to set initial conditions instead') 
     327         ENDIF 
     328         ! 
     329         IF( nn_components == jp_iam_sas ) THEN   ! SAS case: ss[st]_m were not initialized by sbc_ssm_init 
     330            ! 
     331            IF(lwp) WRITE(numout,*) '  SAS: default initialisation of ss[st]_m arrays used in ice_istate' 
     332            IF( l_useCT )  THEN    ;   sst_m(:,:) = eos_pt_from_ct( ts(:,:,1,jp_tem, Kmm), ts(:,:,1,jp_sal, Kmm) ) 
     333            ELSE                   ;   sst_m(:,:) = ts(:,:,1,jp_tem, Kmm) 
     334            ENDIF 
     335            sss_m(:,:) = ts(:,:,1,jp_sal, Kmm) 
     336         ENDIF 
     337         ! 
    275338         CALL ice_istate( nit000, Kbb, Kmm, Kaa ) 
    276339         ! 
    277          IF( .NOT.ln_iceini .OR. .NOT.ln_iceini_file ) & 
    278             &   CALL ctl_stop('STOP', 'ice_rst_read: you need ln_ice_ini=T and ln_iceini_file=T') 
    279          ! 
    280340      ENDIF 
    281341 
Note: See TracChangeset for help on using the changeset viewer.