Changeset 297
- Timestamp:
- 11/27/14 15:01:16 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
codes/icosagcm/branches/SATURN_DYNAMICO/ICOSAGCM/src/restart.f90
r290 r297 74 74 75 75 IF (is_mpi_root) THEN 76 status = NF90_CREATE(TRIM(ADJUSTL(restart_file_name))//'.nc', NF90_CLOBBER, ncid) 76 status = NF90_CREATE(TRIM(ADJUSTL(restart_file_name))//'.nc', IOR(NF90_CLOBBER,NF90_NETCDF4), ncid) 77 IF (status/=NF90_NOERR) THEN 78 WRITE(*,*) "write_restart error: failed to create ",TRIM(ADJUSTL(restart_file_name))//'.nc' 79 WRITE(*,*) TRIM(NF90_STRERROR(status)) 80 ELSE 81 WRITE(*,*) "write_restart: created ",TRIM(ADJUSTL(restart_file_name))//'.nc' 82 ENDIF 77 83 status = NF90_DEF_DIM(ncid,'cell',ncell_glo,cellId) 78 84 status = NF90_DEF_DIM(ncid,'edge',3*ncell_glo,edgeId) … … 119 125 ENDIF 120 126 ENDIF 127 IF (status/=NF90_NOERR) THEN 128 WRITE(*,*) "write_restart error: for ",TRIM(ADJUSTL(field(1)%name)) 129 WRITE(*,*) TRIM(NF90_STRERROR(status)) 130 ENDIF 121 131 ENDDO 122 132 123 133 124 134 status = NF90_ENDDEF(ncid) 135 IF (status/=NF90_NOERR) THEN 136 WRITE(*,*) "write_restart error: failed to switch out of netcdf define mode" 137 WRITE(*,*) TRIM(NF90_STRERROR(status)) 138 STOP 139 ENDIF 125 140 126 141 ALLOCATE(lon(ncell_glo),lat(ncell_glo),bounds_lon(0:nvert-1,ncell_glo),bounds_lat(0:nvert-1,ncell_glo)) … … 147 162 status=NF90_PUT_VAR(ncid,bounds_latId,REAL(bounds_lat,r8),start=(/ 1,1 /),count=(/ nvert,ncell_glo /)) 148 163 status=NF90_PUT_VAR(ncid,levAxisId,REAL(presnivs,r8),start=(/ 1 /),count=(/ llm /)) 149 ENDIF 164 ENDIF ! of IF (is_mpi_root) 150 165 151 166 DO nf=1,nfield … … 163 178 IF (is_mpi_root) THEN 164 179 status = NF90_CLOSE(ncid) 180 IF (status/=NF90_NOERR) THEN 181 WRITE(*,*) "write_restart error: failed to close ",TRIM(ADJUSTL(restart_file_name))//'.nc' 182 WRITE(*,*) TRIM(NF90_STRERROR(status)) 183 STOP 184 ELSE 185 WRITE(*,*) "write_restart: finished writing ",TRIM(ADJUSTL(restart_file_name))//'.nc' 186 ENDIF 165 187 ENDIF 166 188 !$OMP END MASTER
Note: See TracChangeset
for help on using the changeset viewer.