Changeset 5250
- Timestamp:
- 2015-05-01T15:07:32+02:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2014/dev_r4650_UKMO11_restart_functionality/NEMOGCM/NEMO/OPA_SRC/ICB/icbrst.F90
r5235 r5250 64 64 ! start and count arrays 65 65 LOGICAL :: ll_found_restart 66 CHARACTER(len=256) :: cl_path 66 67 CHARACTER(len=256) :: cl_filename 67 68 CHARACTER(len=NF90_MAX_NAME) :: cl_dname … … 70 71 !!---------------------------------------------------------------------- 71 72 72 ! Find a restart file 73 ! Find a restart file. Assume iceberg restarts in same directory as ocean restarts. 74 clpath = TRIM(cn_ocerst_indir) 75 IF( clpath(LEN_TRIM(clpath):) /= '/' ) clpath = TRIM(clpath) // '/' 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 233 CHARACTER(len=256) :: cl_path 230 234 CHARACTER(len=256) :: cl_filename 231 235 TYPE(iceberg), POINTER :: this … … 233 237 !!---------------------------------------------------------------------- 234 238 239 ! Assume we write iceberg restarts to same directory as ocean restarts. 240 clpath = TRIM(cn_ocerst_outdir) 241 IF( clpath(LEN_TRIM(clpath):) /= '/' ) clpath = TRIM(clpath) // '/' 235 242 IF( lk_mpp ) THEN 236 243 WRITE(cl_filename,'("icebergs_",I8.8,"_restart_",I4.4,".nc")') kt, narea-1 … … 238 245 WRITE(cl_filename,'("icebergs_",I8.8,"_restart.nc")') kt 239 246 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)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 … … 372 379 ENDIF 373 380 ENDDO 374 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' 375 382 376 383 nret = NF90_PUT_VAR( ncid, nkountid, num_bergs(:) ) … … 379 386 nret = NF90_PUT_VAR( ncid, nsheatid, berg_grid%stored_heat(:,:) ) 380 387 IF (nret .ne. NF90_NOERR) CALL ctl_stop('icebergs, write_restart: nf_put_var stored_heat failed') 381 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' 382 389 383 390 nret = NF90_PUT_VAR( ncid, ncalvid , src_calving(:,:) ) … … 385 392 nret = NF90_PUT_VAR( ncid, ncalvhid, src_calving_hflx(:,:) ) 386 393 IF (nret .ne. NF90_NOERR) CALL ctl_stop('icebergs, write_restart: nf_put_var calving_hflx failed') 387 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' 388 395 389 396 IF ( ASSOCIATED(first_berg) ) THEN
Note: See TracChangeset
for help on using the changeset viewer.