- Timestamp:
- 2016-01-08T10:35:19+01:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2014/dev_r4704_NOC5_MPP_BDY_UPDATE/NEMOGCM/NEMO/LIM_SRC_3/limrst.F90
r4688 r6225 18 18 USE ice ! sea-ice variables 19 19 USE oce , ONLY : snwice_mass, snwice_mass_b 20 USE par_ice ! sea-ice parameters21 20 USE dom_oce ! ocean domain 22 21 USE sbc_oce ! Surface boundary condition: ocean fields … … 27 26 USE wrk_nemo ! work arrays 28 27 USE lib_fortran ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined) 28 USE limctl 29 29 30 30 IMPLICIT NONE … … 33 33 PUBLIC lim_rst_opn ! routine called by icestep.F90 34 34 PUBLIC lim_rst_write ! routine called by icestep.F90 35 PUBLIC lim_rst_read ! routine called by iceini.F9035 PUBLIC lim_rst_read ! routine called by sbc_lim_init 36 36 37 37 LOGICAL, PUBLIC :: lrst_ice !: logical to control the ice restart write … … 55 55 CHARACTER(LEN=20) :: clkt ! ocean time-step define as a character 56 56 CHARACTER(LEN=50) :: clname ! ice output restart file name 57 CHARACTER(len=256) :: clpath ! full path to ice output restart file 57 58 !!---------------------------------------------------------------------- 58 59 ! … … 64 65 IF( kt == nitrst - 2*nn_fsbc + 1 .OR. nstock == nn_fsbc & 65 66 & .OR. ( kt == nitend - nn_fsbc + 1 .AND. .NOT. lrst_ice ) ) THEN 66 ! beware of the format used to write kt (default is i8.8, that should be large enough...) 67 IF( nitrst > 99999999 ) THEN ; WRITE(clkt, * ) nitrst 68 ELSE ; WRITE(clkt, '(i8.8)') nitrst 67 IF( nitrst <= nitend .AND. nitrst > 0 ) THEN 68 ! beware of the format used to write kt (default is i8.8, that should be large enough...) 69 IF( nitrst > 99999999 ) THEN ; WRITE(clkt, * ) nitrst 70 ELSE ; WRITE(clkt, '(i8.8)') nitrst 71 ENDIF 72 ! create the file 73 clname = TRIM(cexper)//"_"//TRIM(ADJUSTL(clkt))//"_"//TRIM(cn_icerst_out) 74 clpath = TRIM(cn_icerst_outdir) 75 IF( clpath(LEN_TRIM(clpath):) /= '/' ) clpath = TRIM(clpath)//'/' 76 IF(lwp) THEN 77 WRITE(numout,*) 78 SELECT CASE ( jprstlib ) 79 CASE DEFAULT 80 WRITE(numout,*) ' open ice restart NetCDF file: ',TRIM(clpath)//clname 81 END SELECT 82 IF( kt == nitrst - 2*nn_fsbc + 1 ) THEN 83 WRITE(numout,*) ' kt = nitrst - 2*nn_fsbc + 1 = ', kt,' date= ', ndastp 84 ELSE ; WRITE(numout,*) ' kt = ' , kt,' date= ', ndastp 85 ENDIF 86 ENDIF 87 ! 88 CALL iom_open( TRIM(clpath)//TRIM(clname), numriw, ldwrt = .TRUE., kiolib = jprstlib ) 89 lrst_ice = .TRUE. 69 90 ENDIF 70 ! create the file71 clname = TRIM(cexper)//"_"//TRIM(ADJUSTL(clkt))//"_"//TRIM(cn_icerst_out)72 IF(lwp) THEN73 WRITE(numout,*)74 SELECT CASE ( jprstlib )75 CASE ( jprstdimg ) ; WRITE(numout,*) ' open ice restart binary file: '//clname76 CASE DEFAULT ; WRITE(numout,*) ' open ice restart NetCDF file: '//clname77 END SELECT78 IF( kt == nitrst - 2*nn_fsbc + 1 ) THEN79 WRITE(numout,*) ' kt = nitrst - 2*nn_fsbc + 1 = ', kt,' date= ', ndastp80 ELSE ; WRITE(numout,*) ' kt = ' , kt,' date= ', ndastp81 ENDIF82 ENDIF83 !84 CALL iom_open( clname, numriw, ldwrt = .TRUE., kiolib = jprstlib )85 lrst_ice = .TRUE.86 91 ENDIF 87 92 ! 93 IF( ln_icectl ) CALL lim_prt( kt, iiceprt, jiceprt, 1, ' - Beginning the time step - ' ) ! control print 88 94 END SUBROUTINE lim_rst_opn 89 95 … … 142 148 CALL iom_rstput( iter, nitrst, numriw, znam , z2d ) 143 149 END DO 144 150 145 151 DO jl = 1, jpl 146 152 WRITE(zchar,'(I1)') jl … … 165 171 CALL iom_rstput( iter, nitrst, numriw, 'stress2_i' , stress2_i ) 166 172 CALL iom_rstput( iter, nitrst, numriw, 'stress12_i' , stress12_i ) 167 CALL iom_rstput( iter, nitrst, numriw, 'snwice_mass' , snwice_mass ) !clem modif168 CALL iom_rstput( iter, nitrst, numriw, 'snwice_mass_b', snwice_mass_b ) !clem modif173 CALL iom_rstput( iter, nitrst, numriw, 'snwice_mass' , snwice_mass ) 174 CALL iom_rstput( iter, nitrst, numriw, 'snwice_mass_b', snwice_mass_b ) 169 175 170 176 DO jl = 1, jpl … … 306 312 !! ** purpose : read of sea-ice variable restart in a netcdf file 307 313 !!---------------------------------------------------------------------- 308 INTEGER :: ji, jj, jk, jl , indx314 INTEGER :: ji, jj, jk, jl 309 315 REAL(wp) :: zfice, ziter 310 REAL(wp) :: zs_inf, z_slope_s, zsmax, zsmin, zalpha, zindb ! local scalars used for the salinity profile311 REAL(wp), POINTER, DIMENSION(:) :: zs_zero312 316 REAL(wp), POINTER, DIMENSION(:,:) :: z2d 313 317 CHARACTER(len=15) :: znam … … 317 321 !!---------------------------------------------------------------------- 318 322 319 CALL wrk_alloc( nlay_i, zs_zero )320 323 CALL wrk_alloc( jpi, jpj, z2d ) 321 324 … … 326 329 ENDIF 327 330 328 IF ( jprstlib == jprstdimg ) THEN 329 ! eventually read netcdf file (monobloc) for restarting on different number of processors 330 ! if {cn_icerst_in}.nc exists, then set jlibalt to jpnf90 331 INQUIRE( FILE = TRIM(cn_icerst_in)//'.nc', EXIST = llok ) 332 IF ( llok ) THEN ; jlibalt = jpnf90 ; ELSE ; jlibalt = jprstlib ; ENDIF 333 ENDIF 334 335 CALL iom_open ( cn_icerst_in, numrir, kiolib = jprstlib ) 331 CALL iom_open ( TRIM(cn_icerst_indir)//'/'//cn_icerst_in, numrir, kiolib = jprstlib ) 336 332 337 333 CALL iom_get( numrir, 'nn_fsbc', zfice ) … … 395 391 CALL iom_get( numrir, jpdom_autoglo, 'stress2_i' , stress2_i ) 396 392 CALL iom_get( numrir, jpdom_autoglo, 'stress12_i', stress12_i ) 397 CALL iom_get( numrir, jpdom_autoglo, 'snwice_mass' , snwice_mass ) !clem modif398 CALL iom_get( numrir, jpdom_autoglo, 'snwice_mass_b', snwice_mass_b ) !clem modif393 CALL iom_get( numrir, jpdom_autoglo, 'snwice_mass' , snwice_mass ) 394 CALL iom_get( numrir, jpdom_autoglo, 'snwice_mass_b', snwice_mass_b ) 399 395 400 396 DO jl = 1, jpl … … 521 517 ! 522 518 ! clem: I do not understand why the following IF is needed 523 ! I suspect something inconsistent in the main code with option n um_sal=1524 IF( n um_sal == 1 ) THEN519 ! I suspect something inconsistent in the main code with option nn_icesal=1 520 IF( nn_icesal == 1 ) THEN 525 521 DO jl = 1, jpl 526 sm_i(:,:,jl) = bulk_sal522 sm_i(:,:,jl) = rn_icesal 527 523 DO jk = 1, nlay_i 528 s_i(:,:,jk,jl) = bulk_sal524 s_i(:,:,jk,jl) = rn_icesal 529 525 END DO 530 526 END DO … … 533 529 !CALL iom_close( numrir ) !clem: closed in sbcice_lim.F90 534 530 ! 535 CALL wrk_dealloc( nlay_i, zs_zero )536 531 CALL wrk_dealloc( jpi, jpj, z2d ) 537 532 !
Note: See TracChangeset
for help on using the changeset viewer.