Changeset 2768 for LMDZ5/trunk/libf
- Timestamp:
- Jan 23, 2017, 2:55:32 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ5/trunk/libf/phylmd/limit_read_mod.F90
r2667 r2768 204 204 END IF 205 205 206 first_call=.FALSE.207 ENDIF208 209 !****************************************************************************************210 ! 1) Open the file limit.nc if it is the right moment to read, once a day.211 ! The file is read only by the master thread of the master mpi process(is_mpi_root)212 ! Check by the way if the number of records is correct.213 !214 !****************************************************************************************215 216 is_modified = .FALSE.217 IF (MOD(itime-1, lmt_pas) == 0 .OR. jour_lu /= jour ) THEN ! time to read218 jour_lu = jour219 is_modified = .TRUE.220 206 !$OMP MASTER ! Only master thread 221 207 IF (is_mpi_root) THEN ! Only master processus 222 223 208 ierr = NF90_OPEN ('limit.nc', NF90_NOWRITE, nid) 224 209 IF (ierr /= NF90_NOERR) CALL abort_physic(modname,& … … 237 222 ierr=NF90_INQUIRE(nid, UnlimitedDimID=ndimid) 238 223 ierr=NF90_INQUIRE_DIMENSION(nid, ndimid, len=nn) 239 CALL num2str(nn,str) 240 abort_message='limit.nc records number ('//TRIM(str)//') does'//& 241 ' not match year length (' 242 CALL num2str(year_len,str) 243 abort_message=TRIM(abort_message)//TRIM(str)//')' 224 WRITE(abort_message,'(a,2(i0,a))')'limit.nc records number (',nn,') does no'//& 225 't match year length (',year_len,')' 244 226 IF(nn/=year_len) CALL abort_physic(modname,abort_message,1) 245 227 … … 247 229 ierr=NF90_INQ_DIMID(nid, 'points_physiques', ndimid) 248 230 ierr=NF90_INQUIRE_DIMENSION(nid, ndimid, len=nn) 249 CALL num2str(nn,str) 250 abort_message='limit.nc horizontal number of cells ('//TRIM(str)//') does'//& 251 ' not match LMDZ klon_glo (' 252 CALL num2str(klon_glo,str) 253 abort_message=TRIM(abort_message)//TRIM(str)//')' 231 WRITE(abort_message,'(a,2(i0,a))')'limit.nc horizontal number of cells (',nn, & 232 ') does not match LMDZ klon_glo (',klon_glo,')' 254 233 IF(nn/=klon_glo) CALL abort_physic(modname,abort_message,1) 234 235 ierr = NF90_CLOSE(nid) 236 IF (ierr /= NF90_NOERR) CALL abort_physic(modname,'Pb when closing file', 1) 237 first_call=.FALSE. 238 END IF ! is_mpi_root 239 !$OMP END MASTER 240 !$OMP BARRIER 241 END IF 242 243 !**************************************************************************************** 244 ! 1) Open the file limit.nc if it is the right moment to read, once a day. 245 ! The file is read only by the master thread of the master mpi process(is_mpi_root) 246 ! Check by the way if the number of records is correct. 247 ! 248 !**************************************************************************************** 249 250 is_modified = .FALSE. 251 IF (MOD(itime-1, lmt_pas) == 0 .OR. jour_lu /= jour ) THEN ! time to read 252 jour_lu = jour 253 is_modified = .TRUE. 254 !$OMP MASTER ! Only master thread 255 IF (is_mpi_root) THEN ! Only master processus 256 257 ierr = NF90_OPEN ('limit.nc', NF90_NOWRITE, nid) 258 IF (ierr /= NF90_NOERR) CALL abort_physic(modname,& 259 'Pb d''ouverture du fichier de conditions aux limites',1) 255 260 256 261 ! La tranche de donnees a lire: … … 370 375 END SUBROUTINE limit_read_tot 371 376 372 !--------------------------------------------------------------------------------------373 SUBROUTINE num2str(n,str)374 !--------------------------------------------------------------------------------------375 ! Arguments:376 INTEGER, INTENT(IN) :: n377 CHARACTER(LEN=99), INTENT(OUT) :: str378 !--------------------------------------------------------------------------------------379 ! Local variables:380 INTEGER :: nn381 !--------------------------------------------------------------------------------------382 nn=n; str=''; DO WHILE(nn>0); str=CHAR(nn-10*(nn/10)-48)//TRIM(str); nn=nn/10; END DO383 END SUBROUTINE num2str384 !--------------------------------------------------------------------------------------385 386 377 END MODULE limit_read_mod
Note: See TracChangeset
for help on using the changeset viewer.