Changeset 2528 for trunk/NEMOGCM/NEMO/LIM_SRC_3/limrst.F90
- Timestamp:
- 2010-12-27T18:33:53+01:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/NEMOGCM/NEMO/LIM_SRC_3/limrst.F90
r2477 r2528 4 4 !! Ice restart : write the ice restart file 5 5 !!====================================================================== 6 !! History: - ! 2005-04 (M. Vancoppenolle) Original code 7 !! 3.0 ! 2008-03 (C. Ethe) restart files in using IOM interface 8 !!---------------------------------------------------------------------- 6 9 #if defined key_lim3 7 10 !!---------------------------------------------------------------------- … … 12 15 !! lim_rst_read : read the restart file 13 16 !!---------------------------------------------------------------------- 14 !! * Modules used 15 USE ice 16 USE par_ice 17 USE in_out_manager 18 USE dom_oce 19 USE sbc_oce ! Surface boundary condition: ocean fields 20 USE sbc_ice ! Surface boundary condition: ice fields 21 USE iom 17 USE ice ! sea-ice variables 18 USE par_ice ! sea-ice parameters 19 USE dom_oce ! ocean domain 20 USE sbc_oce ! Surface boundary condition: ocean fields 21 USE sbc_ice ! Surface boundary condition: ice fields 22 USE in_out_manager ! I/O manager 23 USE iom ! I/O library 22 24 23 25 IMPLICIT NONE 24 26 PRIVATE 25 27 26 !! * Accessibility 27 PUBLIC lim_rst_opn ! routine called by icestep.F90 28 PUBLIC lim_rst_write ! routine called by icestep.F90 29 PUBLIC lim_rst_read ! routine called by iceinit.F90 28 PUBLIC lim_rst_opn ! routine called by icestep.F90 29 PUBLIC lim_rst_write ! routine called by icestep.F90 30 PUBLIC lim_rst_read ! routine called by iceini.F90 30 31 31 32 LOGICAL, PUBLIC :: lrst_ice !: logical to control the ice restart write … … 33 34 34 35 !!---------------------------------------------------------------------- 35 !! LIM 3.0, UCL-LOCEAN-IPSL (2008)36 !! NEMO/LIM3 3.3 , UCL - NEMO Consortium (2010) 36 37 !! $Id$ 37 !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 38 !!---------------------------------------------------------------------- 39 38 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 39 !!---------------------------------------------------------------------- 40 40 CONTAINS 41 41 … … 48 48 INTEGER, INTENT(in) :: kt ! number of iteration 49 49 ! 50 CHARACTER(LEN=20) :: clkt ! ocean time-step de ine as a character50 CHARACTER(LEN=20) :: clkt ! ocean time-step define as a character 51 51 CHARACTER(LEN=50) :: clname ! ice output restart file name 52 52 !!---------------------------------------------------------------------- … … 54 54 IF( kt == nit000 ) lrst_ice = .FALSE. ! default definition 55 55 56 ! to get better performances with NetCDF format: 57 ! we open and define the ice restart file one ice time step before writing the data (-> at nitrst - 2*nn_fsbc + 1) 58 ! except if we write ice restart files every ice time step or if an ice restart file was writen at nitend - 2*nn_fsbc + 1 59 IF( kt == nitrst - 2*nn_fsbc + 1 .OR. nstock == nn_fsbc .OR. ( kt == nitend - nn_fsbc + 1 .AND. .NOT. lrst_ice ) ) THEN 56 ! in order to get better performances with NetCDF format, we open and define the ice restart file 57 ! one ice time step before writing the data (-> at nitrst - 2*nn_fsbc + 1), except if we write ice 58 ! restart files every ice time step or if an ice restart file was writen at nitend - 2*nn_fsbc + 1 59 IF( kt == nitrst - 2*nn_fsbc + 1 .OR. nstock == nn_fsbc & 60 & .OR. ( kt == nitend - nn_fsbc + 1 .AND. .NOT. lrst_ice ) ) THEN 60 61 ! beware of the format used to write kt (default is i8.8, that should be large enough...) 61 62 IF( nitrst > 99999999 ) THEN ; WRITE(clkt, * ) nitrst … … 75 76 ENDIF 76 77 ENDIF 77 78 ! 78 79 CALL iom_open( clname, numriw, ldwrt = .TRUE., kiolib = jprstlib ) 79 80 lrst_ice = .TRUE. … … 82 83 END SUBROUTINE lim_rst_opn 83 84 85 84 86 SUBROUTINE lim_rst_write( kt ) 85 87 !!---------------------------------------------------------------------- … … 87 89 !! 88 90 !! ** purpose : output of sea-ice variable in a netcdf file 91 !!---------------------------------------------------------------------- 92 INTEGER, INTENT(in) :: kt ! number of iteration 89 93 !! 90 !!---------------------------------------------------------------------- 91 ! Arguments : 92 INTEGER, INTENT(in) :: kt ! number of iteration 93 94 ! Local variables : 94 INTEGER :: ji, jj, jk ,jl ! dummy loop indices 95 INTEGER :: iter 96 CHARACTER(len=15) :: znam 97 CHARACTER(len=1) :: zchar, zchar1 95 98 REAL(wp), DIMENSION(jpi,jpj) :: z2d 96 INTEGER :: ji, jj, jk ,jl97 INTEGER :: iter98 CHARACTER(len=15) :: znam99 CHARACTER(len=1) :: zchar, zchar1100 99 !!---------------------------------------------------------------------- 101 100 … … 111 110 ! ------------------ 112 111 ! ! calendar control 113 CALL iom_rstput( iter, nitrst, numriw, 'nn_fsbc', REAL( nn_fsbc, wp ) ) ! time-step114 CALL iom_rstput( iter, nitrst, numriw, 'kt_ice' , REAL( iter , wp) )! date112 CALL iom_rstput( iter, nitrst, numriw, 'nn_fsbc', REAL( nn_fsbc, wp ) ) ! time-step 113 CALL iom_rstput( iter, nitrst, numriw, 'kt_ice' , REAL( iter , wp ) ) ! date 115 114 116 115 ! Prognostic variables … … 288 287 ENDIF 289 288 ! 290 291 289 END SUBROUTINE lim_rst_write 290 292 291 293 292 SUBROUTINE lim_rst_read … … 297 296 !! ** purpose : read of sea-ice variable restart in a netcdf file 298 297 !!---------------------------------------------------------------------- 299 ! Local variables300 298 INTEGER :: ji, jj, jk, jl, indx 301 299 REAL(wp) :: zfice, ziter 302 REAL(wp) :: & !parameters for the salinity profile 303 zs_inf, z_slope_s, zsmax, zsmin, zalpha, zindb 304 REAL(wp), DIMENSION(nlay_i) :: zs_zero 305 REAL(wp), DIMENSION(jpi,jpj) :: z2d 306 CHARACTER(len=15) :: znam 307 CHARACTER(len=1) :: zchar, zchar1 308 INTEGER :: jlibalt = jprstlib 309 LOGICAL :: llok 300 REAL(wp) :: zs_inf, z_slope_s, zsmax, zsmin, zalpha, zindb ! local scalars used for the salinity profile 301 REAL(wp), DIMENSION(nlay_i) :: zs_zero 302 REAL(wp), DIMENSION(jpi,jpj) :: z2d 303 CHARACTER(len=15) :: znam 304 CHARACTER(len=1) :: zchar, zchar1 305 INTEGER :: jlibalt = jprstlib 306 LOGICAL :: llok 310 307 !!---------------------------------------------------------------------- 311 308 … … 384 381 END DO 385 382 386 ! Salinity profile 387 !----------------- 388 IF( num_sal == 2 ) THEN 389 ! CALL lim_var_salprof 383 IF( num_sal == 2 ) THEN ! Salinity profile 390 384 DO jl = 1, jpl 391 385 DO jk = 1, nlay_i … … 393 387 DO ji = 1, jpi 394 388 zs_inf = sm_i(ji,jj,jl) 395 z_slope_s = 2. 0*sm_i(ji,jj,jl)/MAX(0.01,ht_i(ji,jj,jl))389 z_slope_s = 2._wp * sm_i(ji,jj,jl) / MAX( 0.01_wp , ht_i(ji,jj,jl) ) 396 390 !- slope of the salinity profile 397 zs_zero(jk) = z_slope_s * ( FLOAT(jk)-1.0/2.0 ) * & 398 ht_i(ji,jj,jl) / FLOAT(nlay_i) 399 zsmax = 4.5 400 zsmin = 3.5 391 zs_zero(jk) = z_slope_s * ( REAL(jk,wp) - 0.5_wp ) * ht_i(ji,jj,jl) / REAL(nlay_i,wp) 392 zsmax = 4.5_wp 393 zsmin = 3.5_wp 401 394 IF( sm_i(ji,jj,jl) .LT. zsmin ) THEN 402 zalpha = 1. 0395 zalpha = 1._wp 403 396 ELSEIF( sm_i(ji,jj,jl) .LT.zsmax ) THEN 404 zalpha = sm_i(ji,jj,jl) / ( zsmin-zsmax) + zsmax / (zsmax-zsmin)397 zalpha = sm_i(ji,jj,jl) / ( zsmin - zsmax ) + zsmax / ( zsmax - zsmin ) 405 398 ELSE 406 zalpha = 0. 0399 zalpha = 0._wp 407 400 ENDIF 408 s_i(ji,jj,jk,jl) = zalpha *zs_zero(jk) + ( 1.0 - zalpha )*zs_inf401 s_i(ji,jj,jk,jl) = zalpha * zs_zero(jk) + ( 1._wp - zalpha ) * zs_inf 409 402 END DO 410 403 END DO … … 558 551 END DO 559 552 END DO 560 553 ! 561 554 CALL iom_close( numrir ) 562 555 ! 563 556 END SUBROUTINE lim_rst_read 564 565 557 566 558 #else
Note: See TracChangeset
for help on using the changeset viewer.