Subversion Repositories lagranto.ecmwf

Rev

Rev 11 | Rev 15 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 11 Rev 13
Line 845... Line 845...
845
     >     ' [ time = ',time,' ]'    
845
     >     ' [ time = ',time,' ]'    
846
 
846
 
847
      varname  = 'RESIDENCE'
847
      varname  = 'RESIDENCE'
848
      longname = 'residence time'
848
      longname = 'residence time'
849
      varunit  = 'hours per grid point'
849
      varunit  = 'hours per grid point'
-
 
850
 
-
 
851
      print*,'crefile = ',crefile
-
 
852
 
850
      call  writecdf2D_cf (cdfname,varname,longname,varunit,gridtype,
853
      call  writecdf2D_cf (cdfname,varname,longname,varunit,gridtype,
851
     >       clon,clat,nlonlat,dlonlat,res,time,dx,dy,xmin,ymin,nx,
854
     >       clon,clat,nlonlat,dlonlat,res,time,dx,dy,xmin,ymin,nx,
852
     >       ny,0,crefile,1)
855
     >       ny,0,crefile,1)
853
      write(*,'(a8,a10,a5,a10,a10,f7.2,a2)') 
856
      write(*,'(a8,a10,a5,a10,a10,f7.2,a2)') 
854
     >     '    ... ',trim(varname),' -> ',trim(cdfname),
857
     >     '    ... ',trim(varname),' -> ',trim(cdfname),
Line 1404... Line 1407...
1404
c     Enter define mode
1407
c     Enter define mode
1405
      ierr = nf90_redef(ncID)
1408
      ierr = nf90_redef(ncID)
1406
 
1409
 
1407
c     Write definition and add attributes
1410
c     Write definition and add attributes
1408
      ierr = nf90_def_var(ncID,varname,NF90_FLOAT,
1411
      ierr = nf90_def_var(ncID,varname,NF90_FLOAT,
1409
     >                   (/ LonDimID, LatDimID, varTimeID /),varID)
1412
     >                   (/ LonDimID, LatDimID, TimeDimID /),varID)
1410
      ierr = nf90_put_att(ncID, varID, "long_name" , longname )
1413
      ierr = nf90_put_att(ncID, varID, "long_name" , longname )
1411
      ierr = nf90_put_att(ncID, varID, "units"     , unit     ) 
1414
      ierr = nf90_put_att(ncID, varID, "units"     , unit     ) 
1412
      ierr = nf90_put_att(ncID, varID, '_FillValue', -999.99  ) 
1415
      ierr = nf90_put_att(ncID, varID, '_FillValue', -999.99  ) 
1413
 
1416
 
1414
c     Check whether definition was successful
1417
c     Check whether definition was successful
Line 1416... Line 1419...
1416
      if (ierr.gt.0) then
1419
      if (ierr.gt.0) then
1417
         print*, 'An error occurred while attempting to ', 
1420
         print*, 'An error occurred while attempting to ', 
1418
     >           'finish definition mode.'
1421
     >           'finish definition mode.'
1419
         stop
1422
         stop
1420
      endif
1423
      endif
-
 
1424
      print*,trim(varname),' defined on ',trim(cdfname)
1421
 
1425
 
1422
c     Close netCDF file 
1426
c     Close netCDF file 
1423
      ierr = nf90_close(ncID)
1427
      ierr = nf90_close(ncID)
1424
 
1428
 
1425
 110  continue
1429
 110  continue