- Timestamp:
- 2020-12-03T12:20:38+01:00 (3 years ago)
- 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 8 8 9 9 # SETTE 10 ^/utils/CI/sette @13292sette10 ^/utils/CI/sette_wave@13990 sette
-
- Property svn:externals
-
NEMO/branches/2020/dev_r13333_KERNEL-08_techene_gm_HPG_SPG/src/ICE/icerst.F90
r13286 r14037 18 18 USE phycst , ONLY : rt0 19 19 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 20 24 USE iceistate ! sea-ice: initial state 21 25 USE icectl ! sea-ice: control … … 51 55 CHARACTER(len=50) :: clname ! ice output restart file name 52 56 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 53 58 !!---------------------------------------------------------------------- 54 59 ! … … 80 85 ENDIF 81 86 ! 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 83 105 lrst_ice = .TRUE. 84 106 ENDIF … … 113 135 IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~~~' 114 136 ENDIF 115 137 116 138 ! Write in numriw (if iter == nitrst) 117 139 ! ------------------ … … 119 141 CALL iom_rstput( iter, nitrst, numriw, 'nn_fsbc', REAL( nn_fsbc, wp ) ) ! time-step 120 142 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 122 145 123 146 ! Prognostic variables … … 132 155 CALL iom_rstput( iter, nitrst, numriw, 'a_ip' , a_ip ) 133 156 CALL iom_rstput( iter, nitrst, numriw, 'v_ip' , v_ip ) 157 CALL iom_rstput( iter, nitrst, numriw, 'v_il' , v_il ) 134 158 ! Snow enthalpy 135 159 DO jk = 1, nlay_s … … 149 173 IF( ln_cpl ) THEN 150 174 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 ) 152 176 ENDIF 153 177 ! … … 156 180 ! ------------------ 157 181 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 159 189 lrst_ice = .FALSE. 160 190 ENDIF … … 172 202 INTEGER :: jk 173 203 LOGICAL :: llok 174 INTEGER :: id0, id1, id2, id3, id4 ! local integer204 INTEGER :: id0, id1, id2, id3, id4, id5 ! local integer 175 205 CHARACTER(len=25) :: znam 176 206 CHARACTER(len=2) :: zchar, zchar1 177 207 REAL(wp) :: zfice, ziter 208 CHARACTER(lc) :: clpname 178 209 REAL(wp), DIMENSION(jpi,jpj,jpl) :: z3d ! 3D workspace 179 210 !!---------------------------------------------------------------------- … … 185 216 ENDIF 186 217 218 lxios_sini = .FALSE. 187 219 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 188 231 189 232 ! test if v_i exists … … 193 236 IF( id0 > 0 ) THEN ! == case of a normal restart == ! 194 237 ! ! ------------------------------ ! 195 196 238 ! Time info 197 239 CALL iom_get( numrir, 'nn_fsbc', zfice ) … … 251 293 v_ip(:,:,:) = 0._wp 252 294 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 253 303 ! fields needed for Met Office (Jules) coupling 254 304 IF( ln_cpl ) THEN 255 id 3= iom_varid( numrir, 'cnd_ice' , ldstop = .FALSE. )256 id 4= iom_varid( numrir, 't1_ice' , ldstop = .FALSE. )257 IF( id 3 > 0 .AND. id4> 0 ) THEN ! fields exist305 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 258 308 CALL iom_get( numrir, jpdom_auto, 'cnd_ice', cnd_ice ) 259 309 CALL iom_get( numrir, jpdom_auto, 't1_ice' , t1_ice ) … … 265 315 ENDIF 266 316 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 269 318 ! ! ---------------------------------- ! 270 319 ELSE ! == case of a simplified restart == ! 271 320 ! ! ---------------------------------- ! 272 CALL ctl_warn('ice_rst_read: you are using a simplifiedice restart')321 CALL ctl_warn('ice_rst_read: you are attempting to use an unsuitable ice restart') 273 322 ! 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 ! 275 338 CALL ice_istate( nit000, Kbb, Kmm, Kaa ) 276 339 ! 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 !280 340 ENDIF 281 341
Note: See TracChangeset
for help on using the changeset viewer.