- Timestamp:
- 2020-09-14T17:40:34+02:00 (4 years ago)
- Location:
- NEMO/branches/2019/dev_r11351_fldread_with_XIOS
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
NEMO/branches/2019/dev_r11351_fldread_with_XIOS
- Property svn:externals
-
old new 3 3 ^/utils/build/mk@HEAD mk 4 4 ^/utils/tools@HEAD tools 5 ^/vendors/AGRIF/dev @HEADext/AGRIF5 ^/vendors/AGRIF/dev_r12970_AGRIF_CMEMS ext/AGRIF 6 6 ^/vendors/FCM@HEAD ext/FCM 7 7 ^/vendors/IOIPSL@HEAD ext/IOIPSL 8 9 # SETTE 10 ^/utils/CI/sette@13382 sette
-
- Property svn:externals
-
NEMO/branches/2019/dev_r11351_fldread_with_XIOS/src/OCE/ICB/icbrst.F90
r10425 r13463 69 69 TYPE(point) :: localpt ! NOT a pointer but an actual local variable 70 70 !!---------------------------------------------------------------------- 71 72 71 ! Find a restart file. Assume iceberg restarts in same directory as ocean restarts 73 72 ! and are called TRIM(cn_ocerst)//'_icebergs' 74 cl_path = TRIM(cn_ ocerst_indir)73 cl_path = TRIM(cn_icbrst_indir) 75 74 IF( cl_path(LEN_TRIM(cl_path):) /= '/' ) cl_path = TRIM(cl_path) // '/' 76 cl_filename = TRIM(cn_ ocerst_in)//'_icebergs'75 cl_filename = TRIM(cn_icbrst_in) 77 76 CALL iom_open( TRIM(cl_path)//cl_filename, ncid ) 78 77 … … 92 91 ij = INT( localpt%yj + 0.5 ) 93 92 ! Only proceed if this iceberg is on the local processor (excluding halos). 94 IF ( ii .GE. nldi+nimpp-1 .AND. ii .LE. nlei+nimpp-1 .AND.&95 & ij .GE. nldj+njmpp-1 .AND. ij .LE. nlej+njmpp-1) THEN96 97 CALL iom_get( ncid, jpdom_unknown, 'number' 93 IF ( ii >= mig(Nis0) .AND. ii <= mig(Nie0) .AND. & 94 & ij >= mjg(Njs0) .AND. ij <= mjg(Nje0) ) THEN 95 96 CALL iom_get( ncid, jpdom_unknown, 'number', zdata(:) , ktime=jn, kstart=(/1/), kcount=(/nkounts/) ) 98 97 localberg%number(:) = INT(zdata(:)) 99 98 imax_icb = MAX( imax_icb, INT(zdata(1)) ) … … 124 123 125 124 ! Gridded variables 126 CALL iom_get( ncid, jpdom_autoglo, 'calving' , src_calving ) 127 CALL iom_get( ncid, jpdom_autoglo, 'calving_hflx', src_calving_hflx ) 128 CALL iom_get( ncid, jpdom_autoglo, 'stored_heat' , berg_grid%stored_heat ) 129 CALL iom_get( ncid, jpdom_autoglo_xy, 'stored_ice' , berg_grid%stored_ice, kstart=(/1,1,1/), kcount=(/1,1,nclasses/) ) 125 CALL iom_get( ncid, jpdom_auto, 'calving' , src_calving ) 126 CALL iom_get( ncid, jpdom_auto, 'calving_hflx', src_calving_hflx ) 127 CALL iom_get( ncid, jpdom_auto, 'stored_heat' , berg_grid%stored_heat ) 128 ! with jpdom_auto_xy, ue use only the third element of kstart and kcount. 129 CALL iom_get( ncid, jpdom_auto_xy, 'stored_ice' , berg_grid%stored_ice, kstart=(/-99,-99,1/), kcount=(/-99,-99,nclasses/) ) 130 130 131 131 CALL iom_get( ncid, jpdom_unknown, 'kount' , zdata(:) ) 132 132 num_bergs(:) = INT(zdata(:)) 133 ! Close file134 CALL iom_close( ncid )135 133 ! 136 134 … … 146 144 IF( lwp ) WRITE(numout,'(a,i5,a,i5,a)') 'icebergs, icb_rst_read: there were',ibergs_in_file, & 147 145 & ' bergs in the restart file and', jn,' bergs have been read' 146 ! Close file 147 CALL iom_close( ncid ) 148 148 ! 149 149 ! Confirm that all areas have a suitable base for assigning new iceberg … … 189 189 ! 190 190 INTEGER :: jn ! dummy loop index 191 INTEGER :: idg ! number of digits 191 192 INTEGER :: ix_dim, iy_dim, ik_dim, in_dim 192 193 CHARACTER(len=256) :: cl_path 193 194 CHARACTER(len=256) :: cl_filename 195 CHARACTER(len=8 ) :: cl_kt 196 CHARACTER(LEN=12 ) :: clfmt ! writing format 194 197 TYPE(iceberg), POINTER :: this 195 198 TYPE(point) , POINTER :: pt … … 204 207 ! Only operate on the restart timestep itself. 205 208 ! Assume we write iceberg restarts to same directory as ocean restarts. 206 cl_path = TRIM(cn_ocerst_outdir) 209 ! 210 ! directory name 211 cl_path = TRIM(cn_icbrst_outdir) 207 212 IF( cl_path(LEN_TRIM(cl_path):) /= '/' ) cl_path = TRIM(cl_path) // '/' 213 ! 214 ! file name 215 WRITE(cl_kt, '(i8.8)') kt 216 cl_filename = TRIM(cexper)//"_"//cl_kt//"_"//TRIM(cn_icbrst_out) 208 217 IF( lk_mpp ) THEN 209 WRITE(cl_filename,'(A,"_icebergs_",I8.8,"_restart_",I4.4,".nc")') TRIM(cexper), kt, narea-1 218 idg = MAX( INT(LOG10(REAL(MAX(1,jpnij-1),wp))) + 1, 4 ) ! how many digits to we need to write? min=4, max=9 219 WRITE(clfmt, "('(a,a,i', i1, '.', i1, ',a)')") idg, idg ! '(a,a,ix.x,a)' 220 WRITE(cl_filename, clfmt) TRIM(cl_filename), '_', narea-1, '.nc' 210 221 ELSE 211 WRITE(cl_filename,'( A,"_icebergs_",I8.8,"_restart.nc")') TRIM(cexper), kt222 WRITE(cl_filename,'(a,a)') TRIM(cl_filename), '.nc' 212 223 ENDIF 224 213 225 IF ( lwp .AND. nn_verbose_level >= 0) WRITE(numout,'(2a)') 'icebergs, write_restart: creating ', & 214 226 & TRIM(cl_path)//TRIM(cl_filename) … … 218 230 219 231 ! Dimensions 220 nret = NF90_DEF_DIM(ncid, 'x', jpi, ix_dim)232 nret = NF90_DEF_DIM(ncid, 'x', Ni_0, ix_dim) 221 233 IF (nret .ne. NF90_NOERR) CALL ctl_stop('icebergs, write_restart: nf_def_dim x failed') 222 234 223 nret = NF90_DEF_DIM(ncid, 'y', jpj, iy_dim)235 nret = NF90_DEF_DIM(ncid, 'y', Nj_0, iy_dim) 224 236 IF (nret .ne. NF90_NOERR) CALL ctl_stop('icebergs, write_restart: nf_def_dim y failed') 225 237 … … 233 245 IF( lk_mpp ) THEN 234 246 ! Set domain parameters (assume jpdom_local_full) 235 nret = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'DOMAIN_number_total' , jpnij )236 nret = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'DOMAIN_number' , narea-1 )237 nret = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'DOMAIN_dimensions_ids' , (/ 1 , 2/) )238 nret = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'DOMAIN_size_global' , (/ jpiglo, jpjglo/) )239 nret = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'DOMAIN_size_local' , (/ jpi , jpj/) )240 nret = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'DOMAIN_position_first' , (/ nimpp , njmpp/) )241 nret = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'DOMAIN_position_last' , (/ nimpp + jpi - 1 , njmpp + jpj - 1/) )242 nret = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'DOMAIN_halo_size_start', (/ nldi - 1 , nldj - 1/) )243 nret = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'DOMAIN_halo_size_end' , (/ jpi - nlei , jpj - nlej/) )244 nret = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'DOMAIN_type' , 'BOX' )247 nret = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'DOMAIN_number_total' , jpnij ) 248 nret = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'DOMAIN_number' , narea-1 ) 249 nret = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'DOMAIN_dimensions_ids' , (/ 1 , 2 /) ) 250 nret = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'DOMAIN_size_global' , (/ Ni0glo , Nj0glo /) ) 251 nret = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'DOMAIN_size_local' , (/ Ni_0 , Nj_0 /) ) 252 nret = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'DOMAIN_position_first' , (/ mig0(Nis0), mjg0(Njs0) /) ) 253 nret = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'DOMAIN_position_last' , (/ mig0(Nie0), mjg0(Nje0) /) ) 254 nret = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'DOMAIN_halo_size_start', (/ 0 , 0 /) ) 255 nret = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'DOMAIN_halo_size_end' , (/ 0 , 0 /) ) 256 nret = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'DOMAIN_type' , 'BOX' ) 245 257 ENDIF 246 258 … … 333 345 nstrt3(1) = 1 334 346 nstrt3(2) = 1 335 nlngth3(1) = jpi336 nlngth3(2) = jpj347 nlngth3(1) = Ni_0 348 nlngth3(2) = Nj_0 337 349 nlngth3(3) = 1 338 350 339 351 DO jn=1,nclasses 340 griddata(:,:,1) = berg_grid%stored_ice(:,:,jn)341 352 nstrt3(3) = jn 342 nret = NF90_PUT_VAR( ncid, nsiceid, griddata, nstrt3, nlngth3 )353 nret = NF90_PUT_VAR( ncid, nsiceid, berg_grid%stored_ice(Nis0:Nie0,Njs0:Nje0,jn), nstrt3, nlngth3 ) 343 354 IF (nret .ne. NF90_NOERR) THEN 344 355 IF( lwp ) WRITE(numout,*) TRIM(NF90_STRERROR( nret )) … … 351 362 IF (nret .ne. NF90_NOERR) CALL ctl_stop('icebergs, write_restart: nf_put_var kount failed') 352 363 353 nret = NF90_PUT_VAR( ncid, nsheatid, berg_grid%stored_heat( :,:) )364 nret = NF90_PUT_VAR( ncid, nsheatid, berg_grid%stored_heat(Nis0:Nie0,Njs0:Nje0) ) 354 365 IF (nret .ne. NF90_NOERR) CALL ctl_stop('icebergs, write_restart: nf_put_var stored_heat failed') 355 366 IF( lwp ) WRITE(numout,*) 'file: ',TRIM(cl_path)//TRIM(cl_filename),' var: stored_heat written' 356 367 357 nret = NF90_PUT_VAR( ncid, ncalvid , src_calving( :,:) )368 nret = NF90_PUT_VAR( ncid, ncalvid , src_calving(Nis0:Nie0,Njs0:Nje0) ) 358 369 IF (nret .ne. NF90_NOERR) CALL ctl_stop('icebergs, write_restart: nf_put_var calving failed') 359 nret = NF90_PUT_VAR( ncid, ncalvhid, src_calving_hflx( :,:) )370 nret = NF90_PUT_VAR( ncid, ncalvhid, src_calving_hflx(Nis0:Nie0,Njs0:Nje0) ) 360 371 IF (nret .ne. NF90_NOERR) CALL ctl_stop('icebergs, write_restart: nf_put_var calving_hflx failed') 361 372 IF( lwp ) WRITE(numout,*) 'file: ',TRIM(cl_path)//TRIM(cl_filename),' var: calving written'
Note: See TracChangeset
for help on using the changeset viewer.