Changeset 5837 for branches/2014/dev_r4650_UKMO14.4_OBS_GENERAL_VINTERP/NEMOGCM/NEMO/OPA_SRC/ICB/icbrst.F90
- Timestamp:
- 2015-10-26T15:59:39+01:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2014/dev_r4650_UKMO14.4_OBS_GENERAL_VINTERP/NEMOGCM/NEMO/OPA_SRC/ICB/icbrst.F90
- Property svn:keywords set to Id
r3614 r5837 42 42 !!---------------------------------------------------------------------- 43 43 !! NEMO/OPA 3.3 , NEMO Consortium (2011) 44 !! $Id :$44 !! $Id$ 45 45 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 46 46 !!---------------------------------------------------------------------- … … 64 64 ! start and count arrays 65 65 LOGICAL :: ll_found_restart 66 CHARACTER(len=80) :: cl_filename 66 CHARACTER(len=256) :: cl_path 67 CHARACTER(len=256) :: cl_filename 67 68 CHARACTER(len=NF90_MAX_NAME) :: cl_dname 68 69 TYPE(iceberg) :: localberg ! NOT a pointer but an actual local variable … … 70 71 !!---------------------------------------------------------------------- 71 72 72 ! Find a restart file 73 ! Find a restart file. Assume iceberg restarts in same directory as ocean restarts. 74 cl_path = TRIM(cn_ocerst_indir) 75 IF( cl_path(LEN_TRIM(cl_path):) /= '/' ) cl_path = TRIM(cl_path) // '/' 73 76 cl_filename = ' ' 74 77 IF ( lk_mpp ) THEN 75 78 cl_filename = ' ' 76 79 WRITE( cl_filename, '("restart_icebergs_",I4.4,".nc")' ) narea-1 77 INQUIRE( file=TRIM(cl_ filename), exist=ll_found_restart )80 INQUIRE( file=TRIM(cl_path)//TRIM(cl_filename), exist=ll_found_restart ) 78 81 ELSE 79 82 cl_filename = 'restart_icebergs.nc' 80 INQUIRE( file=TRIM(cl_ filename), exist=ll_found_restart )83 INQUIRE( file=TRIM(cl_path)//TRIM(cl_filename), exist=ll_found_restart ) 81 84 ENDIF 82 85 … … 86 89 87 90 IF (nn_verbose_level >= 0 .AND. lwp) & 88 WRITE(numout,'(2a)') 'icebergs, read_restart_bergs: found restart file = ',TRIM(cl_ filename)89 90 nret = NF90_OPEN(TRIM(cl_ filename), NF90_NOWRITE, ncid)91 WRITE(numout,'(2a)') 'icebergs, read_restart_bergs: found restart file = ',TRIM(cl_path)//TRIM(cl_filename) 92 93 nret = NF90_OPEN(TRIM(cl_path)//TRIM(cl_filename), NF90_NOWRITE, ncid) 91 94 IF (nret .ne. NF90_NOERR) CALL ctl_stop('icebergs, read_restart_bergs: nf_open failed') 92 95 … … 228 231 INTEGER :: jn ! dummy loop index 229 232 INTEGER :: ix_dim, iy_dim, ik_dim, in_dim 230 CHARACTER(len=80) :: cl_filename 233 CHARACTER(len=256) :: cl_path 234 CHARACTER(len=256) :: cl_filename 231 235 TYPE(iceberg), POINTER :: this 232 236 TYPE(point) , POINTER :: pt 233 237 !!---------------------------------------------------------------------- 234 238 239 ! Assume we write iceberg restarts to same directory as ocean restarts. 240 cl_path = TRIM(cn_ocerst_outdir) 241 IF( cl_path(LEN_TRIM(cl_path):) /= '/' ) cl_path = TRIM(cl_path) // '/' 235 242 IF( lk_mpp ) THEN 236 WRITE(cl_filename,'( "icebergs_",I8.8,"_restart_",I4.4,".nc")')kt, narea-1243 WRITE(cl_filename,'(A,"_icebergs_",I8.8,"_restart_",I4.4,".nc")') TRIM(cexper), kt, narea-1 237 244 ELSE 238 WRITE(cl_filename,'( "icebergs_",I8.8,"_restart.nc")')kt239 ENDIF 240 IF (nn_verbose_level >= 0) WRITE(numout,'(2a)') 'icebergs, write_restart: creating ',TRIM(cl_ filename)241 242 nret = NF90_CREATE(TRIM(cl_ filename), NF90_CLOBBER, ncid)245 WRITE(cl_filename,'(A,"_icebergs_",I8.8,"_restart.nc")') TRIM(cexper), kt 246 ENDIF 247 IF (nn_verbose_level >= 0) WRITE(numout,'(2a)') 'icebergs, write_restart: creating ',TRIM(cl_path)//TRIM(cl_filename) 248 249 nret = NF90_CREATE(TRIM(cl_path)//TRIM(cl_filename), NF90_CLOBBER, ncid) 243 250 IF (nret .ne. NF90_NOERR) CALL ctl_stop('icebergs, write_restart: nf_create failed') 244 251 … … 256 263 IF (nret .ne. NF90_NOERR) CALL ctl_stop('icebergs, write_restart: nf_def_dim k failed') 257 264 265 ! global attributes 266 IF( lk_mpp ) THEN 267 ! Set domain parameters (assume jpdom_local_full) 268 nret = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'DOMAIN_number_total' , jpnij ) 269 nret = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'DOMAIN_number' , narea-1 ) 270 nret = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'DOMAIN_dimensions_ids' , (/1 , 2 /) ) 271 nret = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'DOMAIN_size_global' , (/jpiglo, jpjglo/) ) 272 nret = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'DOMAIN_size_local' , (/jpi , jpj /) ) 273 nret = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'DOMAIN_position_first' , (/nimpp , njmpp /) ) 274 nret = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'DOMAIN_position_last' , (/nimpp + jpi - 1 , njmpp + jpj - 1 /) ) 275 nret = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'DOMAIN_halo_size_start', (/nldi - 1 , nldj - 1 /) ) 276 nret = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'DOMAIN_halo_size_end' , (/jpi - nlei , jpj - nlej /) ) 277 nret = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'DOMAIN_type' , 'BOX' ) 278 ENDIF 279 258 280 IF (associated(first_berg)) then 259 281 nret = NF90_DEF_DIM(ncid, 'n', NF90_UNLIMITED, in_dim) … … 357 379 ENDIF 358 380 ENDDO 359 IF( lwp ) WRITE(numout,*) 'file: ',TRIM(cl_ filename),' var: stored_ice written'381 IF( lwp ) WRITE(numout,*) 'file: ',TRIM(cl_path)//TRIM(cl_filename),' var: stored_ice written' 360 382 361 383 nret = NF90_PUT_VAR( ncid, nkountid, num_bergs(:) ) … … 364 386 nret = NF90_PUT_VAR( ncid, nsheatid, berg_grid%stored_heat(:,:) ) 365 387 IF (nret .ne. NF90_NOERR) CALL ctl_stop('icebergs, write_restart: nf_put_var stored_heat failed') 366 IF( lwp ) WRITE(numout,*) 'file: ',TRIM(cl_ filename),' var: stored_heat written'388 IF( lwp ) WRITE(numout,*) 'file: ',TRIM(cl_path)//TRIM(cl_filename),' var: stored_heat written' 367 389 368 390 nret = NF90_PUT_VAR( ncid, ncalvid , src_calving(:,:) ) … … 370 392 nret = NF90_PUT_VAR( ncid, ncalvhid, src_calving_hflx(:,:) ) 371 393 IF (nret .ne. NF90_NOERR) CALL ctl_stop('icebergs, write_restart: nf_put_var calving_hflx failed') 372 IF( lwp ) WRITE(numout,*) 'file: ',TRIM(cl_ filename),' var: calving written'394 IF( lwp ) WRITE(numout,*) 'file: ',TRIM(cl_path)//TRIM(cl_filename),' var: calving written' 373 395 374 396 IF ( ASSOCIATED(first_berg) ) THEN
Note: See TracChangeset
for help on using the changeset viewer.