Re: [netcdfgroup] error when closing a file

You have implicit typing, so it thinks that "chk_ncid" is a real number. chk_ncid needs to be typed as an integer. (It's always a good idea to set "implicit none" to enforce typing -- and it can help avoid bugs with accidental misspellings.

-- Ted

On Mar 17, 2010, at 6:41 PM, H.Dang wrote:

Hi~,

I got the following error message when closing a netCDF file that I create:

PGF90-S-0188-Argument number 1 to nf90_close: type mismatch (nc_close_chk.f90: 8)
  0 inform,   0 warnings,   1 severes, 0 fatal for nc_close_chk
make: *** [nc_close_chk.o] Error 2

Following is the code with line number:

     1       subroutine nc_close_chk(chk_ncid)
      2       use netcdf
      3       use nc_adj_module

                implicit none
      4
      5       integer chk_cls_sts
                integer chk_ncid
      6
      7 !     call nc_check( nf90_close(chk_ncid) )
      8       chk_cls_sts = nf90_close(chk_ncid)
      9
     10       end subroutine nc_close_chk

Could you please show me the cause of the mistake? Thank you!

--
Cordially,
Hongyan
鸿雁
_______________________________________________
netcdfgroup mailing list
netcdfgroup@xxxxxxxxxxxxxxxx
For list information or to unsubscribe,  visit: 
http://www.unidata.ucar.edu/mailing_lists/



  • 2010 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdfgroup archives: